@costrict/cs 3.0.0-preview → 3.0.0
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/cs +10 -1
- package/package.json +12 -12
- package/postinstall.mjs +13 -3
package/bin/cs
CHANGED
|
@@ -6,14 +6,23 @@ const path = require("path")
|
|
|
6
6
|
const os = require("os")
|
|
7
7
|
|
|
8
8
|
function run(target) {
|
|
9
|
+
console.error(`[DEBUG] Executing: ${target} ${process.argv.slice(2).join(' ')}`)
|
|
10
|
+
console.error(`[DEBUG] target exists: ${fs.existsSync(target)}`)
|
|
11
|
+
if (!fs.existsSync(target)) {
|
|
12
|
+
console.error(`[ERROR] Binary not found: ${target}`)
|
|
13
|
+
process.exit(1)
|
|
14
|
+
}
|
|
9
15
|
const result = childProcess.spawnSync(target, process.argv.slice(2), {
|
|
10
16
|
stdio: "inherit",
|
|
17
|
+
shell: process.platform === "win32",
|
|
11
18
|
})
|
|
12
19
|
if (result.error) {
|
|
13
|
-
console.error(result.error.message)
|
|
20
|
+
console.error(`[ERROR] Execution failed: ${result.error.message}`)
|
|
21
|
+
console.error(`[ERROR] Error code: ${result.error.code}`)
|
|
14
22
|
process.exit(1)
|
|
15
23
|
}
|
|
16
24
|
const code = typeof result.status === "number" ? result.status : 0
|
|
25
|
+
console.error(`[DEBUG] Exit code: ${code}`)
|
|
17
26
|
process.exit(code)
|
|
18
27
|
}
|
|
19
28
|
|
package/package.json
CHANGED
|
@@ -6,18 +6,18 @@
|
|
|
6
6
|
"scripts": {
|
|
7
7
|
"postinstall": "bun ./postinstall.mjs || node ./postinstall.mjs"
|
|
8
8
|
},
|
|
9
|
-
"version": "3.0.0
|
|
9
|
+
"version": "3.0.0",
|
|
10
10
|
"optionalDependencies": {
|
|
11
|
-
"@costrict/cs-linux-arm64": "3.0.0
|
|
12
|
-
"@costrict/cs-linux-x64": "3.0.0
|
|
13
|
-
"@costrict/cs-linux-x64-baseline": "3.0.0
|
|
14
|
-
"@costrict/cs-linux-arm64-musl": "3.0.0
|
|
15
|
-
"@costrict/cs-linux-x64-musl": "3.0.0
|
|
16
|
-
"@costrict/cs-linux-x64-baseline-musl": "3.0.0
|
|
17
|
-
"@costrict/cs-darwin-arm64": "3.0.0
|
|
18
|
-
"@costrict/cs-darwin-x64": "3.0.0
|
|
19
|
-
"@costrict/cs-darwin-x64-baseline": "3.0.0
|
|
20
|
-
"@costrict/cs-windows-x64": "3.0.0
|
|
21
|
-
"@costrict/cs-windows-x64-baseline": "3.0.0
|
|
11
|
+
"@costrict/cs-linux-arm64": "3.0.0",
|
|
12
|
+
"@costrict/cs-linux-x64": "3.0.0",
|
|
13
|
+
"@costrict/cs-linux-x64-baseline": "3.0.0",
|
|
14
|
+
"@costrict/cs-linux-arm64-musl": "3.0.0",
|
|
15
|
+
"@costrict/cs-linux-x64-musl": "3.0.0",
|
|
16
|
+
"@costrict/cs-linux-x64-baseline-musl": "3.0.0",
|
|
17
|
+
"@costrict/cs-darwin-arm64": "3.0.0",
|
|
18
|
+
"@costrict/cs-darwin-x64": "3.0.0",
|
|
19
|
+
"@costrict/cs-darwin-x64-baseline": "3.0.0",
|
|
20
|
+
"@costrict/cs-windows-x64": "3.0.0",
|
|
21
|
+
"@costrict/cs-windows-x64-baseline": "3.0.0"
|
|
22
22
|
}
|
|
23
23
|
}
|
package/postinstall.mjs
CHANGED
|
@@ -99,10 +99,20 @@ function symlinkBinary(sourcePath, binaryName) {
|
|
|
99
99
|
|
|
100
100
|
async function main() {
|
|
101
101
|
try {
|
|
102
|
+
console.log(`[DEBUG] Platform: ${os.platform()}, Arch: ${os.arch()}`)
|
|
103
|
+
|
|
102
104
|
if (os.platform() === "win32") {
|
|
103
|
-
// On Windows, the
|
|
104
|
-
|
|
105
|
-
|
|
105
|
+
// On Windows, verify the platform-specific package is installed
|
|
106
|
+
try {
|
|
107
|
+
const { binaryPath } = findBinary()
|
|
108
|
+
console.log(`[DEBUG] Windows binary found at: ${binaryPath}`)
|
|
109
|
+
console.log("Windows: Platform binary verified successfully")
|
|
110
|
+
} catch (error) {
|
|
111
|
+
console.error(`[ERROR] Failed to find Windows binary: ${error.message}`)
|
|
112
|
+
console.error("[ERROR] This usually means @costrict/cs-windows-x64 was not installed")
|
|
113
|
+
console.error("[ERROR] Try: npm install @costrict/cs-windows-x64 --save-optional")
|
|
114
|
+
// Don't exit with error for Windows - let the wrapper handle it
|
|
115
|
+
}
|
|
106
116
|
return
|
|
107
117
|
}
|
|
108
118
|
|