From 7944b2bce8c5807f9b3bc9173ebc0805b2d1a1a3 Mon Sep 17 00:00:00 2001 From: Aditya Date: Sat, 6 Jun 2026 14:06:31 +0530 Subject: [PATCH 1/2] Add missing copy-wasm.js build script The pm run copy-wasm script in package.json references scripts/copy-wasm.js, but the file was never committed to the repo. This causes make setup to fail for new contributors with: Error: Cannot find module '...frontend/scripts/copy-wasm.js' The script copies tree-sitter WASM files from node_modules into the out/ build directory, which the extension needs at runtime for code parsing. Also updates frontend/.gitignore to un-ignore this specific build script (scripts/* was blanket-ignored for dev/test scripts). --- frontend/.gitignore | 5 +++-- frontend/scripts/copy-wasm.js | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 frontend/scripts/copy-wasm.js diff --git a/frontend/.gitignore b/frontend/.gitignore index bd98881..fcfde15 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -2,6 +2,7 @@ # Codag cache directory .codag-cache/ -# Test/dev scripts -scripts/ +# Test/dev scripts (keep copy-wasm.js which is required for builds) +scripts/* +!scripts/copy-wasm.js _test_*.ts diff --git a/frontend/scripts/copy-wasm.js b/frontend/scripts/copy-wasm.js new file mode 100644 index 0000000..9d579b8 --- /dev/null +++ b/frontend/scripts/copy-wasm.js @@ -0,0 +1,27 @@ +const fs = require('fs'); +const path = require('path'); + +const destDir = path.join(__dirname, '..', 'out'); +if (!fs.existsSync(destDir)) { + fs.mkdirSync(destDir, { recursive: true }); +} + +const wasmSourceDir = path.join(__dirname, '..', 'node_modules', 'tree-sitter-wasms', 'out'); +const treeSitterWasm = path.join(__dirname, '..', 'node_modules', 'web-tree-sitter', 'tree-sitter.wasm'); + +if (fs.existsSync(treeSitterWasm)) { + fs.copyFileSync(treeSitterWasm, path.join(destDir, 'tree-sitter.wasm')); + console.log('Copied: tree-sitter.wasm'); +} else { + console.warn('Warning: tree-sitter.wasm not found'); +} + +if (fs.existsSync(wasmSourceDir)) { + const files = fs.readdirSync(wasmSourceDir).filter(f => f.endsWith('.wasm')); + for (const file of files) { + fs.copyFileSync(path.join(wasmSourceDir, file), path.join(destDir, file)); + console.log(`Copied: ${file}`); + } +} else { + console.warn('Warning: tree-sitter-wasms/out not found'); +} From 72a5829d0a1e796a12e712148219e10d1cd16dfb Mon Sep 17 00:00:00 2001 From: Aditya Date: Sat, 6 Jun 2026 14:06:53 +0530 Subject: [PATCH 2/2] Add MCP server dependency install to make setup The compile:mcp script bundles packages/mcp-server/src/index.ts via esbuild, which imports @modelcontextprotocol/sdk and zod. However, make setup never ran pm install in packages/mcp-server/, causing the build to fail with: X [ERROR] Could not resolve @modelcontextprotocol/sdk/server/mcp.js X [ERROR] Could not resolve zod This adds cd packages/mcp-server && npm install before the frontend compile step. --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 7b9b0d4..afb7934 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ setup: echo "Created backend/.env - add your Gemini API key!"; \ fi @echo "Setting up frontend..." + cd packages/mcp-server && npm install cd frontend && npm install && npm run compile @echo "Setup complete!"