fix: install no longer fails on tree-sitter peer-dep ERESOLVE (#2300)

* fix: install no longer fails on tree-sitter peer-dep ERESOLVE

The marketplace npm install was failing on a peer-dep conflict between
@derekstride/tree-sitter-sql (peers tree-sitter@^0.21) and
@tree-sitter-grammars/tree-sitter-lua (peers tree-sitter@^0.22.4),
breaking install across all 12 supported IDEs (#2261-#2272).

The conflict is irrelevant: smart_outline/smart_search/smart_unfold use
the tree-sitter CLI + .wasm files shipped inside each grammar package,
never the JS native bindings, so the peer warning is harmless.

- package.json: move grammar packages to dependencies (their .wasm files
  are loaded at runtime by parser.ts, so they were never devDeps).
- src/npx-cli/commands/install.ts: pass --legacy-peer-deps to silence
  the resolver and replace deprecated --production with --omit=dev.

Verified across all 12 IDEs in the install harness: zero npm errors,
21 grammar packages installed, smart_outline parses TypeScript and
smart_search matches across TypeScript+Python.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs: clarify --legacy-peer-deps rationale in marketplace install

Addresses Greptile review comment on PR #2300.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alex Newman
2026-05-04 20:21:23 -07:00
committed by GitHub
parent 39f1102600
commit 3ff6fcbe1e
2 changed files with 30 additions and 26 deletions
+25 -25
View File
@@ -118,7 +118,13 @@
"dependencies": {
"@anthropic-ai/claude-agent-sdk": "^0.2.119",
"@clack/prompts": "^1.2.0",
"@derekstride/tree-sitter-sql": "^0.3.11",
"@modelcontextprotocol/sdk": "^1.29.0",
"@tree-sitter-grammars/tree-sitter-lua": "^0.4.1",
"@tree-sitter-grammars/tree-sitter-markdown": "^0.3.2",
"@tree-sitter-grammars/tree-sitter-toml": "^0.7.0",
"@tree-sitter-grammars/tree-sitter-yaml": "^0.7.1",
"@tree-sitter-grammars/tree-sitter-zig": "^1.1.2",
"ansi-to-html": "^0.7.2",
"dompurify": "^3.4.1",
"express": "^5.2.1",
@@ -127,31 +133,6 @@
"picocolors": "^1.1.1",
"react": "^19.2.5",
"react-dom": "^19.2.5",
"yaml": "^2.8.3",
"zod": "^4.3.6",
"zod-to-json-schema": "^3.25.2"
},
"devDependencies": {
"@derekstride/tree-sitter-sql": "^0.3.11",
"@tree-sitter-grammars/tree-sitter-lua": "^0.4.1",
"@tree-sitter-grammars/tree-sitter-markdown": "^0.3.2",
"@tree-sitter-grammars/tree-sitter-toml": "^0.7.0",
"@tree-sitter-grammars/tree-sitter-yaml": "^0.7.1",
"@tree-sitter-grammars/tree-sitter-zig": "^1.1.2",
"@types/bun": "^1.3.13",
"@types/cors": "^2.8.19",
"@types/dompurify": "^3.2.0",
"@types/express": "^5.0.6",
"@types/node": "^25.6.0",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"esbuild": "^0.28.0",
"jimp": "^1.6.1",
"np": "^11.2.0",
"parse5": "^8.0.1",
"postcss": "^8.5.13",
"remark-mdx": "^3.1.1",
"remark-parse": "^11.0.0",
"tree-sitter-bash": "^0.25.1",
"tree-sitter-c": "^0.24.1",
"tree-sitter-cli": "^0.26.8",
@@ -171,6 +152,25 @@
"tree-sitter-scss": "^1.0.0",
"tree-sitter-swift": "^0.7.1",
"tree-sitter-typescript": "^0.23.2",
"yaml": "^2.8.3",
"zod": "^4.3.6",
"zod-to-json-schema": "^3.25.2"
},
"devDependencies": {
"@types/bun": "^1.3.13",
"@types/cors": "^2.8.19",
"@types/dompurify": "^3.2.0",
"@types/express": "^5.0.6",
"@types/node": "^25.6.0",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"esbuild": "^0.28.0",
"jimp": "^1.6.1",
"np": "^11.2.0",
"parse5": "^8.0.1",
"postcss": "^8.5.13",
"remark-mdx": "^3.1.1",
"remark-parse": "^11.0.0",
"ts-prune": "^0.10.3",
"tsx": "^4.21.0",
"typescript": "^6.0.3",
+5 -1
View File
@@ -539,7 +539,11 @@ function runNpmInstallInMarketplace(): void {
if (!existsSync(packageJsonPath)) return;
execSync('npm install --production', {
// --legacy-peer-deps suppresses a known false-positive ERESOLVE between
// tree-sitter@0.21 and @tree-sitter-grammars/* peer ranges. The native
// bindings path is unused (we load .wasm), so the conflict is benign.
// Revisit if real peer constraints are added to the marketplace deps.
execSync('npm install --omit=dev --legacy-peer-deps', {
cwd: marketplaceDir,
stdio: 'pipe',
encoding: 'utf8',