chore: bump tree-sitter 0.21→0.25 and all grammar packages#8
Draft
vnz wants to merge 1 commit intoCSCSoftware:masterfrom
Draft
chore: bump tree-sitter 0.21→0.25 and all grammar packages#8vnz wants to merge 1 commit intoCSCSoftware:masterfrom
vnz wants to merge 1 commit intoCSCSoftware:masterfrom
Conversation
Enables support for newer grammar packages (like tree-sitter-hcl) that require tree-sitter ^0.25.0. Refactors parser setup to use a centralized GRAMMAR_MAP record instead of per-language switch blocks. - tree-sitter: ^0.21.0 → ^0.25.0 - All 10 grammar packages bumped to latest compatible versions - tree-sitter-c-sharp pinned to ~0.23.1 (0.23.5 is ESM-only, incompatible) - Added asLang() helper for grammar type bridging (NAPI-safe) - Added .npmrc with legacy-peer-deps for peer dep resolution - Added .node-version pinning Node 22 (tree-sitter 0.25 requires compilation, not yet compatible with Node 24) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tree-sitterfrom^0.21.0to^0.25.0and all 10 grammar packages to their latest compatible versionsswitchblocks with a centralizedGRAMMAR_MAPrecordMotivation
The only published HCL grammar (
@tree-sitter-grammars/tree-sitter-hcl@1.2.0) requirestree-sitter ^0.25.0. Several other grammar packages have also moved ahead of the pinned 0.21.x versions. This PR aligns the dependency stack with the current ecosystem.Changes
package.jsonsrc/parser/tree-sitter.tsGRAMMAR_MAP, addasLang()type bridge.npmrclegacy-peer-deps=true(5 grammars declare peer deps below ^0.25).node-versionCHANGELOG.mdNotable decisions
tree-sitter-c-sharppinned to^0.23.1: v0.23.5 switched to ESM-only with top-levelawait, breaking CJS import compatibilityasLang()helper: Grammar packages export types incompatible with tree-sitter 0.25's stricterParser.Languageinterface. All grammars work at runtime via NAPI — this is a type declaration mismatch onlyGRAMMAR_MAPrefactor: Centralizes all grammar-to-language mappings, eliminates a 30-line switch. Adding a new language is now a one-line changeValidation
npm install && npm run build— clean compile on Node 22node build/index.js init .— successfully indexed the AiDex project (66 files, 7174 items, 399 methods, 132 types)node-types.jsonfilesTest plan
🤖 Generated with Claude Code