homebridge 2.0.2-beta.5 → 2.0.2-beta.7
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/matter/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAUxD,MAAM,WAAW,SAAU,SAAQ,KAAK;IACtC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAE9D;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAE/D;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,GAAG,MAAM,EAAE,GAAG,SAAS,CAK7F;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAIjE;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,CAErF;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAclG;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/matter/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAUxD,MAAM,WAAW,SAAU,SAAQ,KAAK;IACtC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAE9D;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAE/D;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,GAAG,MAAM,EAAE,GAAG,SAAS,CAK7F;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,UAAU,CAIjE;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,UAAU,CAErF;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAclG;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC,CAE1D"}
|
package/dist/matter/utils.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Shared utility functions used across the Matter implementation to avoid code duplication.
|
|
5
5
|
*/
|
|
6
|
-
import { createRequire } from 'node:module';
|
|
7
6
|
/**
|
|
8
7
|
* Type guard for Node.js error objects with code property
|
|
9
8
|
*/
|
|
@@ -122,84 +121,6 @@ export function stripVendorFromLabel(label, vendor) {
|
|
|
122
121
|
* @returns The version string of @matter/main, or '0.0.0' if not found.
|
|
123
122
|
*/
|
|
124
123
|
export async function getMatterJsVersion() {
|
|
125
|
-
|
|
126
|
-
// 1. Check MATTER_MAIN_VERSION environment variable
|
|
127
|
-
let proc;
|
|
128
|
-
try {
|
|
129
|
-
// ESM-safe: use dynamic import for process
|
|
130
|
-
proc = (await import('node:process')).default || (await import('node:process'));
|
|
131
|
-
}
|
|
132
|
-
catch (e) {
|
|
133
|
-
// fallback: process not available
|
|
134
|
-
}
|
|
135
|
-
if (proc && proc.env && proc.env.MATTER_MAIN_VERSION) {
|
|
136
|
-
return proc.env.MATTER_MAIN_VERSION;
|
|
137
|
-
}
|
|
138
|
-
// 2. Try using createRequire to load @matter/main/package.json
|
|
139
|
-
try {
|
|
140
|
-
const require = createRequire(import.meta.url);
|
|
141
|
-
const matterPkg = require('@matter/main/package.json');
|
|
142
|
-
if (matterPkg && typeof matterPkg.version === 'string') {
|
|
143
|
-
return matterPkg.version;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
catch (e) {
|
|
147
|
-
// eslint-disable-next-line no-console
|
|
148
|
-
console.debug('[getMatterJsVersion] createRequire failed:', e);
|
|
149
|
-
}
|
|
150
|
-
// 3. Fallback: try to read from local package.json dependencies
|
|
151
|
-
try {
|
|
152
|
-
// Use import to read the version from the project's package.json
|
|
153
|
-
// @ts-expect-error: dynamic import of JSON
|
|
154
|
-
const pkg = await import('../../package.json', { assert: { type: 'json' } });
|
|
155
|
-
const dependencies = pkg.default?.dependencies;
|
|
156
|
-
matterJsVersion = (dependencies && dependencies['@matter/main']) || '0.0.0';
|
|
157
|
-
if (matterJsVersion !== '0.0.0') {
|
|
158
|
-
return matterJsVersion;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
catch (e) {
|
|
162
|
-
// eslint-disable-next-line no-console
|
|
163
|
-
console.debug('[getMatterJsVersion] import ../../package.json failed:', e);
|
|
164
|
-
}
|
|
165
|
-
// 4. Try fs read of node_modules/@matter/main/package.json
|
|
166
|
-
try {
|
|
167
|
-
// Only import fs if available (Node.js)
|
|
168
|
-
const fs = await import('node:fs/promises');
|
|
169
|
-
const path = await import('node:path');
|
|
170
|
-
// ESM-safe: use dynamic import for process
|
|
171
|
-
let proc;
|
|
172
|
-
try {
|
|
173
|
-
proc = (await import('node:process')).default || (await import('node:process'));
|
|
174
|
-
}
|
|
175
|
-
catch (e) {
|
|
176
|
-
// fallback: process not available
|
|
177
|
-
}
|
|
178
|
-
const cwd = proc?.cwd ? proc.cwd() : '';
|
|
179
|
-
const pkgPath = path.resolve(cwd, 'node_modules', '@matter', 'main', 'package.json');
|
|
180
|
-
const pkgRaw = await fs.readFile(pkgPath, 'utf8');
|
|
181
|
-
const pkgJson = JSON.parse(pkgRaw);
|
|
182
|
-
if (pkgJson && typeof pkgJson.version === 'string') {
|
|
183
|
-
return pkgJson.version;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
catch (e) {
|
|
187
|
-
// eslint-disable-next-line no-console
|
|
188
|
-
console.debug('[getMatterJsVersion] fs read node_modules/@matter/main/package.json failed:', e);
|
|
189
|
-
}
|
|
190
|
-
// 5. Final fallback: try to import @matter/main/package.json via dynamic import
|
|
191
|
-
try {
|
|
192
|
-
// @ts-expect-error: dynamic import of JSON
|
|
193
|
-
const matterPkg = await import('@matter/main/package.json', { assert: { type: 'json' } });
|
|
194
|
-
if (matterPkg.default?.version) {
|
|
195
|
-
return matterPkg.default.version;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
catch (e) {
|
|
199
|
-
// eslint-disable-next-line no-console
|
|
200
|
-
console.debug('[getMatterJsVersion] dynamic import @matter/main/package.json failed:', e);
|
|
201
|
-
}
|
|
202
|
-
// 6. Give up
|
|
203
|
-
return matterJsVersion;
|
|
124
|
+
return '0.17.0-alpha.0-20260506-f11e35041';
|
|
204
125
|
}
|
|
205
126
|
//# sourceMappingURL=utils.js.map
|
package/dist/matter/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/matter/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/matter/utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;GAEG;AACH,MAAM,UAAU,GAAG,aAAa,CAAA;AAChC,MAAM,WAAW,GAAG,SAAS,CAAA;AAS7B;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,KAAc;IACxC,OAAO,KAAK,YAAY,KAAK,IAAI,MAAM,IAAI,KAAK,CAAA;AAClD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,KAAc;IACzC,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAA;AACpD,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAmC;IACrE,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;AAC5C,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,oBAAoB,CAAC,QAAgB;IACnD,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAA;IAChD,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,IAAI,QAAQ,CAAA;IAC7F,OAAO,SAAuB,CAAA;AAChC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,YAAoB,EAAE,MAAc;IACvE,OAAO,GAAG,YAAY,IAAI,MAAM,EAAgB,CAAA;AAClD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAyB,EAAE,MAA0B;IACxF,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,EAAE,CAAA;IACX,CAAC;IACD,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,KAAK,CAAA;IACd,CAAC;IACD,MAAM,GAAG,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAA;IAC7D,IAAI,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC;QACf,OAAO,KAAK,CAAA;IACd,CAAC;IACD,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;SAC5D,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SACpB,OAAO,CAAC,0BAA0B,EAAE,EAAE,CAAC,CAAA;AAC5C,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB;IACtC,OAAO,mCAAmC,CAAA;AAC5C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "homebridge",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.2-beta.
|
|
4
|
+
"version": "2.0.2-beta.7",
|
|
5
5
|
"description": "HomeKit support for the impatient",
|
|
6
6
|
"author": "Nick Farina",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"node": "^22 || ^24"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
|
-
"build": "npm run clean && tsc",
|
|
36
|
+
"build": "npm run sync-matter-version && npm run clean && tsc",
|
|
37
37
|
"check": "npm install && npm outdated",
|
|
38
38
|
"clean": "rimraf dist && rimraf coverage",
|
|
39
39
|
"dev": "DEBUG=* ./bin/homebridge.js -D -P example-plugins/ || true",
|
|
@@ -41,7 +41,8 @@
|
|
|
41
41
|
"lint": "eslint .",
|
|
42
42
|
"lint:fix": "npm run lint -- --fix",
|
|
43
43
|
"lint-docs": "typedoc --emit none --treatWarningsAsErrors",
|
|
44
|
-
"prepublishOnly": "npm run build",
|
|
44
|
+
"prepublishOnly": "npm run sync-matter-version && npm run build",
|
|
45
|
+
"sync-matter-version": "node ./scripts/sync-matter-version.js",
|
|
45
46
|
"postpublish": "npm run clean",
|
|
46
47
|
"test": "vitest run",
|
|
47
48
|
"test-coverage": "npm run test -- --coverage",
|