matterbridge 3.1.9-dev-20250729-d64715f → 3.2.0-dev-20250730-d04e6d8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -8,14 +8,29 @@ If you like this project and find it useful, please consider giving it a star on
8
8
  <img src="bmc-button.svg" alt="Buy me a coffee" width="120">
9
9
  </a>
10
10
 
11
- ## [3.1.9] - 2025-07-??
11
+ ### Breaking Changes
12
+
13
+ Removed node 18 support.
14
+ Please install Node.js 22 LTS.
15
+ Don't use Node.js Current but always the Node.js LTS.
16
+ Node.js 23, like all odd-numbered versions, is not supported.
17
+
18
+ ## [3.2.0] - 2025-07-??
12
19
 
13
20
  ### Added
14
21
 
22
+ - [update]: Added a Snackbar message for available updates from npm. It differs for latest and dev versions. The update check, as always, is performed at restart (1 minute after) and each 12 hours. It can be triggered manually from the frontend.
23
+ - [update]: First steps of update and log important messages from GitHub.
24
+ - [build]: Added workflow_dispatch trigger and enhance dependency management in CI.
25
+ - [build]: Added macOS 15 to the CI matrix for Node.js builds.
26
+ - [frontend]: Bump version 2.7.2.
27
+ - [frontend]: Added the plugin name on the QR/Fabrics when in childbridge mode. Changed operational mode to one click only.
28
+
15
29
  ### Changed
16
30
 
17
31
  - [package]: Updated dependencies.
18
32
  - [matter.js]: Bumped `matter.js` to 0.15.2 (https://github.com/project-chip/matter.js/discussions/2203). Great job matter.js!
33
+ - [node.js]: Removed node 18 support.
19
34
 
20
35
  <a href="https://www.buymeacoffee.com/luligugithub">
21
36
  <img src="bmc-button.svg" alt="Buy me a coffee" width="80">
package/README.md CHANGED
@@ -69,7 +69,7 @@ https://matter-smarthome.de/en/interview/an-alternative-to-the-official-matter-s
69
69
  To run Matterbridge, you need either a [Node.js](https://nodejs.org/en) environment or [Docker](https://docs.docker.com/get-started/get-docker/) installed on your system.
70
70
 
71
71
  If you don't have Node.js already install, please use this method to install it on a debian device: https://github.com/nodesource/distributions.
72
- The supported versions of node are 18, 20 and 22. Please install Node.js 22 LTS.
72
+ The supported versions of node are 20 and 22. Please install Node.js 22 LTS. Don't use Node.js Current but always the Node.js LTS.
73
73
  Node.js 23, like all odd-numbered versions, is not supported.
74
74
  Nvm is not a good choice and should not be used for production.
75
75
 
package/dist/update.js CHANGED
@@ -1,7 +1,9 @@
1
- import { db, nt, wr } from 'node-ansi-logger';
1
+ import { db, debugStringify, nt, wr } from 'node-ansi-logger';
2
2
  import { plg } from './matterbridgeTypes.js';
3
+ import { isValidString } from './utils/isvalid.js';
3
4
  export async function checkUpdates(matterbridge) {
4
5
  const { hasParameter } = await import('./utils/commandLine.js');
6
+ const update = checkUpdatesAndLog(matterbridge);
5
7
  const latestVersion = getMatterbridgeLatestVersion(matterbridge);
6
8
  const devVersion = getMatterbridgeDevVersion(matterbridge);
7
9
  const pluginsVersions = [];
@@ -20,7 +22,24 @@ export async function checkUpdates(matterbridge) {
20
22
  const mainUpdate = getShellyMainUpdate(matterbridge);
21
23
  shellyUpdates.push(mainUpdate);
22
24
  }
23
- await Promise.all([latestVersion, devVersion, ...pluginsVersions, ...pluginsDevVersions, ...shellyUpdates]);
25
+ await Promise.all([update, latestVersion, devVersion, ...pluginsVersions, ...pluginsDevVersions, ...shellyUpdates]);
26
+ }
27
+ export async function checkUpdatesAndLog(matterbridge) {
28
+ const { getGitHubUpdate } = await import('./utils/network.js');
29
+ const branch = matterbridge.matterbridgeVersion.includes('-dev-') ? 'dev' : 'main';
30
+ try {
31
+ const updateJson = await getGitHubUpdate(branch, 'update.json', 5_000);
32
+ matterbridge.log.debug(`GitHub ${branch} update status: ${debugStringify(updateJson)}.`);
33
+ if (isValidString(branch === 'main' ? updateJson.latestMessage : updateJson.devMessage, 1) &&
34
+ isValidString(branch === 'main' ? updateJson.latestMessageSeverity : updateJson.devMessageSeverity, 4) &&
35
+ ['info', 'warning', 'error', 'success'].includes(branch === 'main' ? updateJson.latestMessageSeverity : updateJson.devMessageSeverity)) {
36
+ matterbridge.log.notice(`GitHub ${branch} update message: ${branch === 'main' ? updateJson.latestMessage : updateJson.devMessage}`);
37
+ matterbridge.frontend.wssSendSnackbarMessage(branch === 'main' ? updateJson.latestMessage : updateJson.devMessage, 0, branch === 'main' ? updateJson.latestMessageSeverity : updateJson.devMessageSeverity);
38
+ }
39
+ }
40
+ catch (error) {
41
+ matterbridge.log.debug(`Error checking GitHub ${branch} updates: ${error instanceof Error ? error.message : error}`);
42
+ }
24
43
  }
25
44
  export async function getMatterbridgeLatestVersion(matterbridge) {
26
45
  const { getNpmPackageVersion } = await import('./utils/network.js');
@@ -31,6 +50,7 @@ export async function getMatterbridgeLatestVersion(matterbridge) {
31
50
  await matterbridge.nodeContext?.set('matterbridgeLatestVersion', matterbridge.matterbridgeLatestVersion);
32
51
  if (matterbridge.matterbridgeVersion !== matterbridge.matterbridgeLatestVersion) {
33
52
  matterbridge.log.notice(`Matterbridge is out of date. Current version: ${matterbridge.matterbridgeVersion}. Latest version: ${matterbridge.matterbridgeLatestVersion}.`);
53
+ matterbridge.frontend.wssSendSnackbarMessage('Matterbridge latest update available', 0, 'info');
34
54
  matterbridge.frontend.wssSendRefreshRequired('matterbridgeLatestVersion');
35
55
  matterbridge.frontend.wssSendUpdateRequired();
36
56
  }
@@ -52,6 +72,7 @@ export async function getMatterbridgeDevVersion(matterbridge) {
52
72
  await matterbridge.nodeContext?.set('matterbridgeDevVersion', version);
53
73
  if (matterbridge.matterbridgeVersion.includes('-dev-') && matterbridge.matterbridgeVersion !== version) {
54
74
  matterbridge.log.notice(`Matterbridge@dev is out of date. Current version: ${matterbridge.matterbridgeVersion}. Latest dev version: ${matterbridge.matterbridgeDevVersion}.`);
75
+ matterbridge.frontend.wssSendSnackbarMessage('Matterbridge dev update available', 0, 'info');
55
76
  matterbridge.frontend.wssSendRefreshRequired('matterbridgeDevVersion');
56
77
  matterbridge.frontend.wssSendUpdateRequired(true);
57
78
  }
@@ -124,6 +124,44 @@ export async function getNpmPackageVersion(packageName, tag = 'latest', timeout
124
124
  });
125
125
  });
126
126
  }
127
+ export async function getGitHubUpdate(branch, file, timeout = 10000) {
128
+ const https = await import('node:https');
129
+ return new Promise((resolve, reject) => {
130
+ const url = `https://raw.githubusercontent.com/Luligu/matterbridge/${branch}/public/${file}`;
131
+ const controller = new AbortController();
132
+ const timeoutId = setTimeout(() => {
133
+ controller.abort();
134
+ reject(new Error(`Request timed out after ${timeout / 1000} seconds`));
135
+ }, timeout);
136
+ const req = https.get(url, { signal: controller.signal }, (res) => {
137
+ let data = '';
138
+ if (res.statusCode !== 200) {
139
+ clearTimeout(timeoutId);
140
+ res.resume();
141
+ req.destroy();
142
+ reject(new Error(`Failed to fetch data. Status code: ${res.statusCode}`));
143
+ return;
144
+ }
145
+ res.on('data', (chunk) => {
146
+ data += chunk;
147
+ });
148
+ res.on('end', () => {
149
+ clearTimeout(timeoutId);
150
+ try {
151
+ const jsonData = JSON.parse(data);
152
+ resolve(jsonData);
153
+ }
154
+ catch (error) {
155
+ reject(new Error(`Failed to parse response JSON: ${error instanceof Error ? error.message : error}`));
156
+ }
157
+ });
158
+ });
159
+ req.on('error', (error) => {
160
+ clearTimeout(timeoutId);
161
+ reject(new Error(`Request failed: ${error instanceof Error ? error.message : error}`));
162
+ });
163
+ });
164
+ }
127
165
  export async function getGlobalNodeModules() {
128
166
  const { exec } = await import('node:child_process');
129
167
  return new Promise((resolve, reject) => {
@@ -1,4 +1,4 @@
1
- import { AnsiLogger } from '../logger/export.js';
1
+ import { AnsiLogger } from 'node-ansi-logger';
2
2
  export const log = new AnsiLogger({ logName: 'MatterbridgeUtils', logTimestampFormat: 4, logLevel: "info" });
3
3
  export async function waiter(name, check, exitWithReject = false, resolveTimeout = 5000, resolveInterval = 500, debug = false) {
4
4
  if (check())
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "files": {
3
3
  "main.css": "./static/css/main.944b63c3.css",
4
- "main.js": "./static/js/main.6ab99f2a.js",
4
+ "main.js": "./static/js/main.41269326.js",
5
5
  "static/js/453.d855a71b.chunk.js": "./static/js/453.d855a71b.chunk.js",
6
6
  "static/media/roboto-latin-700-normal.woff2": "./static/media/roboto-latin-700-normal.c4d6cab43bec89049809.woff2",
7
7
  "static/media/roboto-latin-500-normal.woff2": "./static/media/roboto-latin-500-normal.599f66a60bdf974e578e.woff2",
@@ -77,11 +77,11 @@
77
77
  "static/media/roboto-greek-ext-300-normal.woff": "./static/media/roboto-greek-ext-300-normal.60729cafbded24073dfb.woff",
78
78
  "index.html": "./index.html",
79
79
  "main.944b63c3.css.map": "./static/css/main.944b63c3.css.map",
80
- "main.6ab99f2a.js.map": "./static/js/main.6ab99f2a.js.map",
80
+ "main.41269326.js.map": "./static/js/main.41269326.js.map",
81
81
  "453.d855a71b.chunk.js.map": "./static/js/453.d855a71b.chunk.js.map"
82
82
  },
83
83
  "entrypoints": [
84
84
  "static/css/main.944b63c3.css",
85
- "static/js/main.6ab99f2a.js"
85
+ "static/js/main.41269326.js"
86
86
  ]
87
87
  }
@@ -1 +1 @@
1
- <!doctype html><html lang="en"><head><meta charset="utf-8"/><base href="./"><link rel="icon" href="./matterbridge 32x32.png"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><title>Matterbridge</title><link rel="manifest" href="./manifest.json"/><script defer="defer" src="./static/js/main.6ab99f2a.js"></script><link href="./static/css/main.944b63c3.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
1
+ <!doctype html><html lang="en"><head><meta charset="utf-8"/><base href="./"><link rel="icon" href="./matterbridge 32x32.png"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><title>Matterbridge</title><link rel="manifest" href="./manifest.json"/><script defer="defer" src="./static/js/main.41269326.js"></script><link href="./static/css/main.944b63c3.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>