@tsonic/tsbindgen 0.1.1 → 0.1.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.
- package/bin.js +12 -6
- package/index.js +7 -6
- package/package.json +1 -1
package/bin.js
CHANGED
|
@@ -8,10 +8,10 @@ import { fileURLToPath } from "node:url";
|
|
|
8
8
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
9
9
|
|
|
10
10
|
const PLATFORMS = {
|
|
11
|
-
"darwin-arm64": "
|
|
12
|
-
"darwin-x64": "
|
|
13
|
-
"linux-arm64": "
|
|
14
|
-
"linux-x64": "
|
|
11
|
+
"darwin-arm64": "tsbindgen-darwin-arm64",
|
|
12
|
+
"darwin-x64": "tsbindgen-darwin-x64",
|
|
13
|
+
"linux-arm64": "tsbindgen-linux-arm64",
|
|
14
|
+
"linux-x64": "tsbindgen-linux-x64",
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
const getPlatformKey = () => `${process.platform}-${process.arch}`;
|
|
@@ -27,9 +27,15 @@ const findBinary = () => {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
const binaryName = "tsbindgen";
|
|
30
|
+
|
|
31
|
+
// Search paths for the platform-specific binary
|
|
30
32
|
const paths = [
|
|
31
|
-
|
|
33
|
+
// Nested in this package's node_modules
|
|
34
|
+
join(__dirname, "node_modules", "@tsonic", packageName, binaryName),
|
|
35
|
+
// Sibling in @tsonic scope (hoisted)
|
|
32
36
|
join(__dirname, "..", packageName, binaryName),
|
|
37
|
+
// At root node_modules level
|
|
38
|
+
join(__dirname, "..", "..", "@tsonic", packageName, binaryName),
|
|
33
39
|
];
|
|
34
40
|
|
|
35
41
|
for (const p of paths) {
|
|
@@ -39,7 +45,7 @@ const findBinary = () => {
|
|
|
39
45
|
}
|
|
40
46
|
|
|
41
47
|
console.error(`Could not find tsbindgen binary for ${key}`);
|
|
42
|
-
console.error(`Package
|
|
48
|
+
console.error(`Package @tsonic/${packageName} may not be installed.`);
|
|
43
49
|
process.exit(1);
|
|
44
50
|
};
|
|
45
51
|
|
package/index.js
CHANGED
|
@@ -10,10 +10,10 @@ import { fileURLToPath } from "node:url";
|
|
|
10
10
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
11
11
|
|
|
12
12
|
const PLATFORMS = {
|
|
13
|
-
"darwin-arm64": "
|
|
14
|
-
"darwin-x64": "
|
|
15
|
-
"linux-arm64": "
|
|
16
|
-
"linux-x64": "
|
|
13
|
+
"darwin-arm64": "tsbindgen-darwin-arm64",
|
|
14
|
+
"darwin-x64": "tsbindgen-darwin-x64",
|
|
15
|
+
"linux-arm64": "tsbindgen-linux-arm64",
|
|
16
|
+
"linux-x64": "tsbindgen-linux-x64",
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
const getPlatformKey = () => `${process.platform}-${process.arch}`;
|
|
@@ -34,8 +34,9 @@ export const getBinaryPath = () => {
|
|
|
34
34
|
|
|
35
35
|
const binaryName = "tsbindgen";
|
|
36
36
|
const paths = [
|
|
37
|
-
join(__dirname, "node_modules", packageName, binaryName),
|
|
37
|
+
join(__dirname, "node_modules", "@tsonic", packageName, binaryName),
|
|
38
38
|
join(__dirname, "..", packageName, binaryName),
|
|
39
|
+
join(__dirname, "..", "..", "@tsonic", packageName, binaryName),
|
|
39
40
|
];
|
|
40
41
|
|
|
41
42
|
for (const p of paths) {
|
|
@@ -46,7 +47,7 @@ export const getBinaryPath = () => {
|
|
|
46
47
|
|
|
47
48
|
throw new Error(
|
|
48
49
|
`Could not find tsbindgen binary for ${key}. ` +
|
|
49
|
-
`Package
|
|
50
|
+
`Package @tsonic/${packageName} may not be installed.`
|
|
50
51
|
);
|
|
51
52
|
};
|
|
52
53
|
|