syncpack 14.0.0-alpha.31 → 14.0.0-alpha.32
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/index.cjs +22 -2
- package/package.json +10 -8
package/index.cjs
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
const { spawnSync } = require('node:child_process');
|
|
4
|
+
const { dirname, join } = require('node:path');
|
|
4
5
|
|
|
5
6
|
const args = process.argv.slice(2);
|
|
6
7
|
const arch = process.arch;
|
|
7
8
|
const [os, extension] = ['win32', 'cygwin'].includes(process.platform) ? ['windows', '.exe'] : [process.platform, ''];
|
|
8
9
|
const optionalDep = `syncpack-${os}-${arch}`;
|
|
9
|
-
const
|
|
10
|
-
|
|
10
|
+
const binaryName = `syncpack${extension}`;
|
|
11
|
+
|
|
12
|
+
const pathToBinary = resolveBinaryPath();
|
|
11
13
|
|
|
12
14
|
process.exit(
|
|
13
15
|
spawnSync(pathToBinary, args, {
|
|
@@ -16,3 +18,21 @@ process.exit(
|
|
|
16
18
|
env: process.env,
|
|
17
19
|
}).status || 0,
|
|
18
20
|
);
|
|
21
|
+
|
|
22
|
+
function resolveBinaryPath() {
|
|
23
|
+
// Strategy 1: Resolve via package.json for pnpm Plug'n'Play
|
|
24
|
+
try {
|
|
25
|
+
const packageJsonPath = require.resolve(`${optionalDep}/package.json`);
|
|
26
|
+
const packageDir = dirname(packageJsonPath);
|
|
27
|
+
return join(packageDir, 'bin', binaryName);
|
|
28
|
+
} catch (_) {}
|
|
29
|
+
|
|
30
|
+
// Strategy 2: Original approach (works with traditional node_modules)
|
|
31
|
+
try {
|
|
32
|
+
return require.resolve(`${optionalDep}/bin/${binaryName}`);
|
|
33
|
+
} catch (_) {}
|
|
34
|
+
|
|
35
|
+
throw new Error(
|
|
36
|
+
`Failed to resolve binary for ${os}-${arch}. Please ensure ${optionalDep} is installed as an optional dependency.`,
|
|
37
|
+
);
|
|
38
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "syncpack",
|
|
3
3
|
"description": "Consistent dependency versions in large JavaScript Monorepos",
|
|
4
|
-
"version": "14.0.0-alpha.
|
|
4
|
+
"version": "14.0.0-alpha.32",
|
|
5
5
|
"author": "Jamie Mason <jamie@foldleft.io> (https://github.com/JamieMason)",
|
|
6
6
|
"bugs": "https://github.com/JamieMason/syncpack/issues",
|
|
7
7
|
"contributors": [
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"Tom Fletcher (https://github.com/tom-fletcher)"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"tsx": "^4.
|
|
43
|
+
"tsx": "^4.21.0"
|
|
44
44
|
},
|
|
45
45
|
"engines": {
|
|
46
46
|
"node": ">=14.17.0"
|
|
@@ -76,12 +76,14 @@
|
|
|
76
76
|
"syncpack": "./index.cjs"
|
|
77
77
|
},
|
|
78
78
|
"optionalDependencies": {
|
|
79
|
-
"syncpack-linux-x64": "14.0.0-alpha.
|
|
80
|
-
"syncpack-linux-
|
|
81
|
-
"syncpack-
|
|
82
|
-
"syncpack-
|
|
83
|
-
"syncpack-
|
|
84
|
-
"syncpack-
|
|
79
|
+
"syncpack-linux-x64": "14.0.0-alpha.32",
|
|
80
|
+
"syncpack-linux-x64-musl": "14.0.0-alpha.32",
|
|
81
|
+
"syncpack-linux-arm64": "14.0.0-alpha.32",
|
|
82
|
+
"syncpack-linux-arm64-musl": "14.0.0-alpha.32",
|
|
83
|
+
"syncpack-darwin-x64": "14.0.0-alpha.32",
|
|
84
|
+
"syncpack-darwin-arm64": "14.0.0-alpha.32",
|
|
85
|
+
"syncpack-windows-x64": "14.0.0-alpha.32",
|
|
86
|
+
"syncpack-windows-arm64": "14.0.0-alpha.32"
|
|
85
87
|
},
|
|
86
88
|
"types": "./syncpack.d.ts"
|
|
87
89
|
}
|