@matter-server/ws-controller 0.2.0-alpha.0-20260113-761834c → 0.2.1
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
|
|
11
|
-
const matterMainPath =
|
|
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,
|
|
5
|
-
"names": [
|
|
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
|
@@ -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
|
|
24
|
-
const
|
|
25
|
-
const matterMainPath =
|
|
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 !== "/") {
|