Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"fmt": "prettier --write \"src/**/*.ts\" \"tests/**/*.ts\" \"plugins/**/*.ts\" \"builtin-modules/**/*.js\"",
"fmt:check": "prettier --check \"src/**/*.ts\" \"tests/**/*.ts\" \"plugins/**/*.ts\" \"builtin-modules/**/*.js\"",
"check": "npm run fmt:check && npm run typecheck && npm run test",
"prepare": "npm run build:modules",
"postinstall": "node scripts/patch-vscode-jsonrpc.js && node scripts/check-native-runtime.js"
"prepare": "[ ! -f scripts/build-modules.js ] || npm run build:modules",
"postinstall": "[ ! -f scripts/patch-vscode-jsonrpc.js ] || (node scripts/patch-vscode-jsonrpc.js && node scripts/check-native-runtime.js)"
Comment on lines +28 to +29
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new prepare/postinstall guards use POSIX [ ... ] tests and subshell syntax, which will fail (or behave incorrectly) when npm runs scripts under cmd.exe on Windows. If Windows installs are expected now or in the future, consider switching to a Node-based existence check (e.g., a tiny JS entrypoint in dist/ that checks fs.existsSync(...) before running the real script) so the hooks are cross-platform while still skipping cleanly in the published tarball.

Suggested change
"prepare": "[ ! -f scripts/build-modules.js ] || npm run build:modules",
"postinstall": "[ ! -f scripts/patch-vscode-jsonrpc.js ] || (node scripts/patch-vscode-jsonrpc.js && node scripts/check-native-runtime.js)"
"prepare": "node -e \"const fs = require('fs'); const { spawnSync } = require('child_process'); if (!fs.existsSync('scripts/build-modules.js')) process.exit(0); const npmCmd = process.platform === 'win32' ? 'npm.cmd' : 'npm'; const result = spawnSync(npmCmd, ['run', 'build:modules'], { stdio: 'inherit' }); process.exit(result.status == null ? 0 : result.status);\"",
"postinstall": "node -e \"const fs = require('fs'); const { spawnSync } = require('child_process'); if (!fs.existsSync('scripts/patch-vscode-jsonrpc.js')) process.exit(0); const nodePath = process.execPath; let r = spawnSync(nodePath, ['scripts/patch-vscode-jsonrpc.js'], { stdio: 'inherit' }); if (r.status) process.exit(r.status); r = spawnSync(nodePath, ['scripts/check-native-runtime.js'], { stdio: 'inherit' }); process.exit(r.status == null ? 0 : r.status);\""

Copilot uses AI. Check for mistakes.
},
"dependencies": {
"@github/copilot-sdk": "^0.1.32",
Expand Down
Loading