homebridge 2.0.2-alpha.1 → 2.0.2-alpha.3
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;
|
|
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;AAQxD,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,67 +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
|
-
let proc;
|
|
127
|
-
try {
|
|
128
|
-
proc = (await import('node:process')).default || (await import('node:process'));
|
|
129
|
-
}
|
|
130
|
-
catch { }
|
|
131
|
-
if (proc?.env?.MATTER_MAIN_VERSION) {
|
|
132
|
-
return proc.env.MATTER_MAIN_VERSION;
|
|
133
|
-
}
|
|
134
|
-
// 2. Try to resolve @matter/main/package.json using import.meta.resolve (Node 20+)
|
|
135
|
-
let matterPkgPath;
|
|
136
|
-
if (typeof import.meta.resolve === 'function') {
|
|
137
|
-
try {
|
|
138
|
-
matterPkgPath = import.meta.resolve('@matter/main/package.json');
|
|
139
|
-
}
|
|
140
|
-
catch { }
|
|
141
|
-
}
|
|
142
|
-
// 3. Fallback: try require.resolve
|
|
143
|
-
if (!matterPkgPath) {
|
|
144
|
-
try {
|
|
145
|
-
const require = createRequire(import.meta.url);
|
|
146
|
-
matterPkgPath = require.resolve('@matter/main/package.json');
|
|
147
|
-
}
|
|
148
|
-
catch { }
|
|
149
|
-
}
|
|
150
|
-
// 4. If we found a path, try to read it
|
|
151
|
-
if (matterPkgPath) {
|
|
152
|
-
try {
|
|
153
|
-
const fs = await import('node:fs/promises');
|
|
154
|
-
// Remove file:// if present (import.meta.resolve returns URLs)
|
|
155
|
-
const filePath = matterPkgPath.startsWith('file://') ? matterPkgPath.slice(7) : matterPkgPath;
|
|
156
|
-
const pkgRaw = await fs.readFile(filePath, 'utf8');
|
|
157
|
-
const pkgJson = JSON.parse(pkgRaw);
|
|
158
|
-
if (pkgJson && typeof pkgJson.version === 'string') {
|
|
159
|
-
return pkgJson.version;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
catch { }
|
|
163
|
-
}
|
|
164
|
-
// 5. Fallback: try to read from local package.json dependencies
|
|
165
|
-
try {
|
|
166
|
-
// Use import to read the version from the project's package.json
|
|
167
|
-
// @ts-expect-error: dynamic import of JSON
|
|
168
|
-
const pkg = await import('../../package.json', { assert: { type: 'json' } });
|
|
169
|
-
const dependencies = pkg.default?.dependencies;
|
|
170
|
-
const depVer = dependencies?.['@matter/main'];
|
|
171
|
-
if (depVer) {
|
|
172
|
-
return depVer;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
catch { }
|
|
176
|
-
// 6. Final fallback: try to import @matter/main/package.json via dynamic import
|
|
177
|
-
try {
|
|
178
|
-
// @ts-expect-error: dynamic import of JSON
|
|
179
|
-
const matterPkg = await import('@matter/main/package.json', { assert: { type: 'json' } });
|
|
180
|
-
if (matterPkg.default?.version) {
|
|
181
|
-
return matterPkg.default.version;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
catch { }
|
|
185
|
-
// 7. Give up
|
|
186
|
-
return '0.0.0';
|
|
124
|
+
return '0.17.0-alpha.0-20260506-f11e35041';
|
|
187
125
|
}
|
|
188
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;AAIH
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../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AAyB,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-alpha.
|
|
4
|
+
"version": "2.0.2-alpha.3",
|
|
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",
|