From 1981f9b2fe5255e09c1a1a4d5a488fa9c75d09b9 Mon Sep 17 00:00:00 2001 From: Alex Newman Date: Mon, 4 May 2026 21:47:27 -0700 Subject: [PATCH] fix(install): revert tree-sitter grammars to devDependencies (#2300 regression) (#2305) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR #2300 moved 21 tree-sitter grammar packages from devDependencies into root dependencies, claiming "their .wasm files are loaded at runtime by parser.ts." That justification is wrong for the root claude-mem npm package: parser.ts compiles into plugin/scripts/worker-service.cjs, which runs from the marketplace folder where plugin/package.json already lists every grammar as a runtime dep. Nothing in dist/npx-cli/ ever loads a grammar, and resolveGrammarPath() handles missing packages gracefully. The regression: `npx claude-mem@12.6.1 install` now fetches all 21 grammars at npx time. tree-sitter-swift's postinstall pulls a nested tree-sitter-cli that downloads a Rust binary from GitHub and hangs the install. npm ignores the trustedDependencies bun-allowlist, so there's no way to skip the postinstall scripts on a bare `npx` fetch. Fix: move grammar packages back to root devDependencies. The marketplace plugin install (installPluginDependencies → bun install in plugin/) still works because plugin/package.json keeps them as deps and Bun honors trustedDependencies: ["tree-sitter-cli"] to skip the harmful postinstalls on every other grammar. Keep PR #2300's --legacy-peer-deps + --omit=dev install.ts changes — those address a separate, valid marketplace ERESOLVE. Co-authored-by: Claude Opus 4.7 (1M context) --- package.json | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/package.json b/package.json index 1a81653b..c576c57e 100644 --- a/package.json +++ b/package.json @@ -118,13 +118,7 @@ "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", @@ -133,6 +127,31 @@ "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", @@ -152,25 +171,6 @@ "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",