Skip to content

Commit

Permalink
Merge pull request #176 from Luligu/dev
Browse files Browse the repository at this point in the history
Release 1.6.4
  • Loading branch information
Luligu authored Nov 29, 2024
2 parents dfe11ec + 78a715a commit 267e78d
Show file tree
Hide file tree
Showing 10 changed files with 295 additions and 188 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ If you want to run Matterbridge in Home Assistant please use the official add-on

Tamer (https://github.com/tammeryousef1006) has created the Matterbridge Discord group: https://discord.gg/QX58CDe6hd.

## [1.6.4] - 2024-11-29

### Changed

- [matter.js]: Update to matter.js 0.11.7.

<a href="https://www.buymeacoffee.com/luligugithub">
<img src="./yellow-button.png" alt="Buy me a coffee" width="120">
</a>

## [1.6.3] - 2024-11-27

Expand All @@ -26,6 +35,10 @@ Tamer (https://github.com/tammeryousef1006) has created the Matterbridge Discord
- [matter.js]: Temporary fix the crash of matter.js on close when using command line parameters.
- [matter.js]: Update to matter.js 0.11.6.

<a href="https://www.buymeacoffee.com/luligugithub">
<img src="./yellow-button.png" alt="Buy me a coffee" width="120">
</a>

## [1.6.2] - 2024-11-25

### Added
Expand Down
19 changes: 12 additions & 7 deletions README-DEV.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ Matterbridge exports from:
- Matterbridge and all Matterbridge related classes.
- All relevant matter-node.js or matter.js clusters, classes and functions.

"matterbridge/matter"

- All relevant matter.js new api only exports (in beta).

"matterbridge/cluster"

- All clusters not present in matter.js or modified.
Expand All @@ -33,15 +37,15 @@ Matterbridge exports from:

"matterbridge/logger"

- NodeAnsiLogger class.
- AnsiLogger class.

"matterbridge/storage"

- NodeStorage classes.
- NodeStorageManager and NodeStorage classes.

# \***\*\*\*\*\***

A plugin must never install or import from `matter-node.js` or `matter.js` directly (neither as a dependency, devDependency, nor peerDependency), as this leads to a second instance of `matter.js`, causing instability and unpredictable errors such as "The only instance is Endpoint".
A plugin must never install or import from `@matter` or `@project-chip` directly (neither as a dependency, devDependency, nor peerDependency), as this leads to a second instance of `matter.js`, causing instability and unpredictable errors such as "The only instance is Endpoint".

Additionally, when Matterbridge updates the `matter.js` version, it should be consistent across all plugins.

Expand All @@ -61,15 +65,16 @@ Matterbridge must be linked to the plugin in development only.

# \***\*\*\*\*\***

In the next releases I will remove the duplicated exports so please update your plugins.

I added some error messages when a plugin has wrong imports or configurations and the plugin will be disabled to prevent instability and crashes.

## Guidelines on the migration to matter.js V8
## Migration to matter.js V8

I'm working with matter.js team to define the strategy for the migration of Matterbridge to the new API.

More informations will be added soon.
- First phase: crete MatterbridgeEdge class: completed 90%
- Second phase: create MatterbridgeEndpoint and MatterbridgeBehaviors classes: completed 90%
- Third phase: modifiy all plugins to support both normal and edge mode of Matterbridge: completed 80%
- Fourth phase: remove all old api code from Matterbridge and all plugins...

## How to create your plugin

Expand Down
128 changes: 64 additions & 64 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "matterbridge",
"version": "1.6.3",
"version": "1.6.4",
"description": "Matterbridge plugin manager for Matter",
"author": "https://github.com/Luligu",
"license": "Apache-2.0",
Expand Down Expand Up @@ -121,9 +121,9 @@
"install:jest": "npm install --save-dev jest ts-jest @types/jest eslint-plugin-jest"
},
"dependencies": {
"@matter/main": "^0.11.6",
"@matter/nodejs": "^0.11.6",
"@project-chip/matter.js": "^0.11.6",
"@matter/main": "^0.11.7",
"@matter/nodejs": "^0.11.7",
"@project-chip/matter.js": "^0.11.7",
"archiver": "7.0.1",
"express": "4.21.1",
"glob": "11.0.0",
Expand All @@ -138,7 +138,7 @@
"@types/eslint__js": "8.42.3",
"@types/express": "5.0.0",
"@types/jest": "29.5.14",
"@types/node": "22.10.0",
"@types/node": "22.10.1",
"@types/ws": "8.5.13",
"eslint": "9.15.0",
"eslint-config-prettier": "9.1.0",
Expand Down
18 changes: 9 additions & 9 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,16 @@
import { Matterbridge } from './matterbridge.js';
import { MatterbridgeEdge } from './matterbridgeEdge.js';

export type Identity<T> = T;

export type AtLeastOne<T> = ArrayMinLength<T, 1>;

type BuildArrayMinLength<T, N extends number, Current extends T[]> = Current['length'] extends N ? [...Current, ...T[]] : BuildArrayMinLength<T, N, [...Current, T]>;

export type ArrayMinLength<T, N extends number> = BuildArrayMinLength<T, N, []>;

// @matter
export { Identity, AtLeastOne } from '@matter/main';
// export { Identity, AtLeastOne } from '@matter/main';
export * from '@matter/main/clusters';
export * from '@matter/main/types';
export {
Expand All @@ -49,14 +57,6 @@ export {
// @project-chip
export * from '@project-chip/matter.js/device';
export * from '@project-chip/matter.js/cluster';
/*
export * from '@project-chip/matter.js/cluster';
export * from '@project-chip/matter.js/log';
export * from '@project-chip/matter.js/datatype';
export * from '@project-chip/matter.js/util';
export * from '@project-chip/matter.js/schema';
export * from '@project-chip/matter.js/tlv';
*/

// Matterbridge
export * from './matterbridge.js';
Expand Down
Loading

0 comments on commit 267e78d

Please sign in to comment.