You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(build:wasm): add preflight check with clear remediation (#990)
* fix(build:wasm): add preflight check with clear remediation
When tree-sitter-cli's binary download fails (e.g. behind a proxy or
with --ignore-scripts), `npm run build:wasm` would attempt all 35
grammars and dump a raw Node.js ENOENT stack for each, with no hint
about how to fix it.
Add a one-shot preflight that runs `npx tree-sitter --version` before
the loop. On a missing-binary ENOENT pattern, print a single clear
banner naming the root cause and listing concrete fixes (npm rebuild
tree-sitter-cli, install -g, or download from releases), then exit
cleanly so the rest of `prepare` can proceed.
Per-grammar builds now capture stdio instead of inheriting it, so
failures show one trimmed stderr line instead of a 20-line crash dump.
A second banner surfaces if individual builds fail with a missing
docker/emcc toolchain, pointing users at Docker Desktop or Emscripten.
Impact: 3 functions changed, 2 affected
* fix(build:wasm): quote shell args and include message in toolchain detect (#990)
- quoteShellArg: with shell: true, execFileSync joins cmd+args into
one shell string, so whitespace in paths (e.g. Windows 'C:\Users\First Last')
gets re-split. Quote args containing whitespace with platform-appropriate
quoting (cmd.exe double quotes vs POSIX single quotes).
- Toolchain detection: include build.message in the combined string so
Node-surfaced ENOENTs (e.g. 'spawn emcc ENOENT') trigger the missing
toolchain banner. Also match on ENOENT as a trigger word.
Impact: 2 functions changed, 2 affected
0 commit comments