@matter/main 0.11.0-alpha.0-20241022-4fc11014f → 0.11.0-alpha.0-20241025-b177b0a59
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +72 -1
- package/package.json +9 -9
package/README.md
CHANGED
@@ -1 +1,72 @@
|
|
1
|
-
|
1
|
+
# @matter/main
|
2
|
+
|
3
|
+
Implementation of Matter protocol in typescript with no native dependencies (and very limited dependencies).
|
4
|
+
|
5
|
+
This is a convenient single-dependency for applications build on matter.js and have automatic registrations for Node.js
|
6
|
+
and react-native as platforms.
|
7
|
+
|
8
|
+
> This package supports all Node.js LTS versions starting with 18.x (when Node.js is used).
|
9
|
+
|
10
|
+
The following features are abstracted away to allow to be implemented environment specific:
|
11
|
+
|
12
|
+
- Network (UDP/MDNS)
|
13
|
+
- Crypto
|
14
|
+
- Storage
|
15
|
+
- Date/Timer
|
16
|
+
- Logger (Default uses "console")
|
17
|
+
- Environment (Process and Configuration handling)
|
18
|
+
|
19
|
+
## Exported functionality
|
20
|
+
|
21
|
+
> [!IMPORTANT]
|
22
|
+
> All exports here are for the current API. Legacy Cluster implementations are only exported via @project-chip/matter.js!
|
23
|
+
|
24
|
+
This library exports the Matter protocol functionality as well as some helper functions as named exports:
|
25
|
+
|
26
|
+
| Export | Description |
|
27
|
+
|----------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
28
|
+
| `@matter/main` | Re-Exports all functionality from `@matter/general`, `@matter/node`, Environment class, Matter model class and the datatypes from `@matter/types` |
|
29
|
+
| `@matter/main/behaviors` | Exports Behavior classes as framework to implement all relevant Logic for clusters and internal logic. Contains auto-generated class structures and also [Cluster default implementations](../../docs/CLUSTER_DEFAULT_IMPLEMENTATIONS.md). |
|
30
|
+
| `@matter/main/behaviors/*` | Exports Behavior classes as framework to implement all relevant Logic for clusters and internal logic. Contains auto-generated class structures and also [Cluster default implementations](../../docs/CLUSTER_DEFAULT_IMPLEMENTATIONS.md) as cluster-name export |
|
31
|
+
| `@matter/main/clusters` | Exports all Matter Cluster definitions |
|
32
|
+
| `@matter/main/clusters/*` | Exports Matter Cluster definitions as cluster-name export |
|
33
|
+
| `@matter/main/devices` | Exports Matter Device type classes |
|
34
|
+
| `@matter/main/devices/*` | Exports Matter Device type classes as cluster-name export |
|
35
|
+
| `@matter/main/endpoints` | Exports Matter Endpoint structure classes |
|
36
|
+
| `@matter/main/endpoints/*` | Exports Matter Endpoint structure classes as cluster-name export |
|
37
|
+
| `@matter/main/model` | Exports a JavaScript version of the Matter data model. Re-exports `@matter/model` package. |
|
38
|
+
| `@matter/main/node` | Exports the matter node specific classes. Re-exports `@matter/node` package. |
|
39
|
+
| `@matter/main/protocol` | Exports Basic Matter protocol functionality. Re-exports `@matter/protocol` package. |
|
40
|
+
| `@matter/main/types` | Exports all Types (includes Clusters and Matter datatypes and matter.js own datatypes. Re-exports `@matter/types` package. |
|
41
|
+
|
42
|
+
Both exports and the typings are exported as CommonJS and ES6 modules.
|
43
|
+
|
44
|
+
For more details please refer to the [API Documentation](../../docs/README.md).
|
45
|
+
|
46
|
+
### Typescript note
|
47
|
+
|
48
|
+
To have Typescript and your IDE know all the relevant exported functionality you need to use the following in your tsconfig.json:
|
49
|
+
|
50
|
+
```json5
|
51
|
+
{
|
52
|
+
compilerOptions: {
|
53
|
+
moduleResolution: "node16", // Required to support package.json exports
|
54
|
+
module: "node16", // Required to make sure all imports are js
|
55
|
+
},
|
56
|
+
}
|
57
|
+
```
|
58
|
+
|
59
|
+
Additionally, we recommend using `"strictNullChecks": true` or better for code quality `"strict": true` to make sure that all types are correctly determined.
|
60
|
+
|
61
|
+
## Building
|
62
|
+
|
63
|
+
- `npm run build`: Build all code and create CommonJS and ES6 variants in dist directory. This will built incrementally and only build the changed files.
|
64
|
+
- `npm run build-clean`: Clean the dist directory and build all code from scratch
|
65
|
+
|
66
|
+
## Tests
|
67
|
+
|
68
|
+
- `npm run test-node`: Run tests in node.js
|
69
|
+
- `npm run test-web`: Run tests in the browser
|
70
|
+
- `npm run test`: Run all tests
|
71
|
+
|
72
|
+
test-web will create a /coverage directory containing the test code coverage
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@matter/main",
|
3
|
-
"version": "0.11.0-alpha.0-
|
3
|
+
"version": "0.11.0-alpha.0-20241025-b177b0a59",
|
4
4
|
"description": "Matter.js main entrypoint",
|
5
5
|
"keywords": [
|
6
6
|
"iot",
|
@@ -41,19 +41,19 @@
|
|
41
41
|
"#*": "./src/*"
|
42
42
|
},
|
43
43
|
"dependencies": {
|
44
|
-
"@matter/general": "0.11.0-alpha.0-
|
45
|
-
"@matter/model": "0.11.0-alpha.0-
|
46
|
-
"@matter/node": "0.11.0-alpha.0-
|
47
|
-
"@matter/protocol": "0.11.0-alpha.0-
|
48
|
-
"@matter/types": "0.11.0-alpha.0-
|
44
|
+
"@matter/general": "0.11.0-alpha.0-20241025-b177b0a59",
|
45
|
+
"@matter/model": "0.11.0-alpha.0-20241025-b177b0a59",
|
46
|
+
"@matter/node": "0.11.0-alpha.0-20241025-b177b0a59",
|
47
|
+
"@matter/protocol": "0.11.0-alpha.0-20241025-b177b0a59",
|
48
|
+
"@matter/types": "0.11.0-alpha.0-20241025-b177b0a59",
|
49
49
|
"@noble/curves": "^1.5.0"
|
50
50
|
},
|
51
51
|
"optionalDependencies": {
|
52
|
-
"@matter/nodejs": "0.11.0-alpha.0-
|
53
|
-
"@matter/react-native": "0.11.0-alpha.0-
|
52
|
+
"@matter/nodejs": "0.11.0-alpha.0-20241025-b177b0a59",
|
53
|
+
"@matter/react-native": "0.11.0-alpha.0-20241025-b177b0a59"
|
54
54
|
},
|
55
55
|
"devDependencies": {
|
56
|
-
"@matter/tools": "0.11.0-alpha.0-
|
56
|
+
"@matter/tools": "0.11.0-alpha.0-20241025-b177b0a59"
|
57
57
|
},
|
58
58
|
"files": [
|
59
59
|
"dist/**/*",
|