@matter-server/ws-controller 0.2.0 → 0.2.2

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.
@@ -4,11 +4,11 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import { readFileSync } from "node:fs";
7
- import { createRequire } from "node:module";
8
7
  import { dirname, join } from "node:path";
8
+ import { fileURLToPath } from "node:url";
9
9
  function getMatterVersion() {
10
- const require2 = createRequire(import.meta.url);
11
- const matterMainPath = require2.resolve("@matter/main");
10
+ const matterMainUrl = import.meta.resolve("@matter/main");
11
+ const matterMainPath = fileURLToPath(matterMainUrl);
12
12
  let dir = dirname(matterMainPath);
13
13
  while (dir !== "/") {
14
14
  try {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/util/matterVersion.ts"],
4
- "mappings": "AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,SAAS,YAAY;AASvB,SAAS,mBAA2B;AAEvC,QAAMA,WAAU,cAAc,YAAY,GAAG;AAC7C,QAAM,iBAAiBA,SAAQ,QAAQ,cAAc;AAErD,MAAI,MAAM,QAAQ,cAAc;AAChC,SAAO,QAAQ,KAAK;AAChB,QAAI;AACA,YAAM,kBAAkB,KAAK,KAAK,cAAc;AAChD,YAAM,UAAU,aAAa,iBAAiB,OAAO;AACrD,YAAM,MAAM,KAAK,MAAM,OAAO;AAC9B,UAAI,IAAI,SAAS,gBAAgB;AAC7B,eAAO,IAAI;AAAA,MACf;AAAA,IACJ,QAAQ;AAAA,IAER;AACA,UAAM,QAAQ,GAAG;AAAA,EACrB;AACA,QAAM,IAAI,MAAM,0CAA0C;AAC9D;AAGO,MAAM,iBAAiB,iBAAiB;",
5
- "names": ["require"]
4
+ "mappings": "AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,SAAS,oBAAoB;AAC7B,SAAS,SAAS,YAAY;AAC9B,SAAS,qBAAqB;AASvB,SAAS,mBAA2B;AAEvC,QAAM,gBAAgB,YAAY,QAAQ,cAAc;AACxD,QAAM,iBAAiB,cAAc,aAAa;AAElD,MAAI,MAAM,QAAQ,cAAc;AAChC,SAAO,QAAQ,KAAK;AAChB,QAAI;AACA,YAAM,kBAAkB,KAAK,KAAK,cAAc;AAChD,YAAM,UAAU,aAAa,iBAAiB,OAAO;AACrD,YAAM,MAAM,KAAK,MAAM,OAAO;AAC9B,UAAI,IAAI,SAAS,gBAAgB;AAC7B,eAAO,IAAI;AAAA,MACf;AAAA,IACJ,QAAQ;AAAA,IAER;AACA,UAAM,QAAQ,GAAG;AAAA,EACrB;AACA,QAAM,IAAI,MAAM,0CAA0C;AAC9D;AAGO,MAAM,iBAAiB,iBAAiB;",
5
+ "names": []
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@matter-server/ws-controller",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "description": "matter.js based Matter controller library",
6
6
  "bugs": {
@@ -22,15 +22,15 @@
22
22
  "node": ">=20.19.0 <22.0.0 || >=22.13.0"
23
23
  },
24
24
  "optionalDependencies": {
25
- "@matter/nodejs-ble": "0.16.1"
25
+ "@matter/nodejs-ble": "0.16.2"
26
26
  },
27
27
  "dependencies": {
28
- "@matter/main": "0.16.1",
29
- "@project-chip/matter.js": "0.16.1",
28
+ "@matter/main": "0.16.2",
29
+ "@project-chip/matter.js": "0.16.2",
30
30
  "ws": "^8.18.3"
31
31
  },
32
32
  "devDependencies": {
33
- "@types/node": "^25.0.3",
33
+ "@types/node": "^25.0.8",
34
34
  "@types/ws": "^8.18.1"
35
35
  },
36
36
  "files": [
@@ -9,8 +9,8 @@
9
9
  */
10
10
 
11
11
  import { readFileSync } from "node:fs";
12
- import { createRequire } from "node:module";
13
12
  import { dirname, join } from "node:path";
13
+ import { fileURLToPath } from "node:url";
14
14
 
15
15
  interface PackageJson {
16
16
  version: string;
@@ -20,9 +20,9 @@ interface PackageJson {
20
20
  * Get the version of the @matter/main package.
21
21
  */
22
22
  export function getMatterVersion(): string {
23
- // Use createRequire to resolve the module path, then read the package.json
24
- const require = createRequire(import.meta.url);
25
- const matterMainPath = require.resolve("@matter/main");
23
+ // Use import.meta.resolve for ESM-native module resolution
24
+ const matterMainUrl = import.meta.resolve("@matter/main");
25
+ const matterMainPath = fileURLToPath(matterMainUrl);
26
26
  // Navigate up from the resolved module to find package.json
27
27
  let dir = dirname(matterMainPath);
28
28
  while (dir !== "/") {