fix tree-sitter install on node 24#27
Conversation
The Prerequisites section listed only "Node.js >= 20 and pnpm >= 8", missing the tree-sitter CLI requirement that `pnpm build` needs to generate the parser in `packages/parser-tree-sitter`. New contributors hit "sh: tree-sitter: command not found" with no guidance from the README. Recommends `mise install` as the primary setup path (respects the pinned 0.25.x line in mise.toml) and provides a manual-install fallback that explicitly lists Node 22, pnpm 10, and the tree-sitter CLI 0.25.x. Calls out the macOS Homebrew gotcha: `brew install tree-sitter` ships only the C library; the CLI is a separate `tree-sitter-cli` formula (which currently ships 0.26.x, a minor mismatch with the pin). Addresses #33 Part B (the undocumented CLI prerequisite). Part A (Node 26 compatibility) is covered by #23 and #27. Refs #33
|
Hi @qingliaowu, thanks for this contribution! The lack of default compatibility with C++20 in tree-sitter has bugged me for a while, so thanks for looking at this. Could you let me know your thoughts about whether it's ok to use |
Thanks for raising that. I agree bare I checked whether we could avoid the pnpm-only patch. There is not a newer published Given this repo already standardizes on pnpm via |
What
tree-sitter@0.25.0so its native binding builds with C++20 instead of C++17.Why
Fixes #7.
Node 24 V8 headers require C++20, but
tree-sitter@0.25.0forces C++17 inbinding.gyp. That makespnpm installfail when the native binding compiles under Node 24.How
The pnpm patch updates the upstream package build flags for Unix, macOS/Xcode, and Windows/MSVC to C++20. The new CI job runs
pnpm install --frozen-lockfileon Node 24 so the install path is checked directly.Test Plan
corepack pnpm install --frozen-lockfileon Node v24.10.0 withoutCXXFLAGScorepack pnpm rebuild tree-sitteron Node v24.10.0 withoutCXXFLAGSnode --test packages/parser-tree-sitter/bindings/node/*_test.jscorepack pnpm --filter @agentscript/parser testcorepack pnpm exec prettier --check .github/workflows/ci.yml package.json pnpm-lock.yamlcorepack pnpm --filter @agentscript/parser-tree-sitter test(local machine is missing the externaltree-sitterCLI; its Node binding subtest passed)Checklist