Skip to content

Commit eb9d51f

Browse files
npapagnaclaude
andcommitted
Replace scripts/compile-parallel.sh with Lage
compile-parallel.sh ran all four tsc invocations concurrently on every `npm run compile`, but it always spawned every process even when nothing had changed, so a no-op compile still cost close to 2 seconds. Lage adds a content-hash cache on top of that: unchanged workspaces now skip invoking tsc entirely, dropping a no-op compile under half a second. It also narrows how far a change propagates. mcp-server's tsconfig reaches into two files under client/src for type-checking, and that cross-package dependency was previously declared globally, so editing either file invalidated client's and server's caches too, even though neither uses them. It is now scoped to mcp-server alone. compile:bin only type-checks CI helper scripts, not the extension itself, so it stays out of Lage's task graph and runs as a plain sequential step afterward instead. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 68543b2 commit eb9d51f

6 files changed

Lines changed: 157 additions & 36 deletions

File tree

lage.config.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// @ts-check
2+
/** @type {import("lage").ConfigFileOptions} */
3+
const config = {
4+
pipeline: {
5+
compile: {
6+
outputs: ['out/**/*'],
7+
},
8+
// mcp-server's tsconfig type-checks two files straight out of client/src
9+
// (see mcp-server/tsconfig.json's "include") - they live outside its own
10+
// package root, so lage's per-package hash wouldn't otherwise notice
11+
// when they change. Scoped here (not in the global environmentGlob
12+
// below) so editing them only invalidates mcp-server's cache, not
13+
// client's and server's too.
14+
'gemstone-mcp-server#compile': {
15+
outputs: ['out/**/*'],
16+
environmentGlob: ['client/src/gciLibrary.ts', 'client/src/gciConstants.ts'],
17+
},
18+
},
19+
npmClient: 'npm',
20+
cacheOptions: {
21+
// Changes to any of these invalidate every package's cache: the first
22+
// three affect how every tsconfig resolves (shared compiler options,
23+
// dependency versions).
24+
environmentGlob: ['package.json', 'package-lock.json', 'tsconfig.base.json', 'lage.config.js'],
25+
},
26+
};
27+
module.exports = config;

mcp-server/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"description": "MCP server for GemStone database interaction",
66
"main": "out/index.js",
77
"scripts": {
8+
"compile": "tsc -p tsconfig.json",
89
"compile:clean": "rm -rf out ../node_modules/.cache/tsc/mcp.tsbuildinfo",
910
"test": "vitest run"
1011
},

package-lock.json

Lines changed: 125 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2490,8 +2490,8 @@
24902490
],
24912491
"scripts": {
24922492
"vscode:prepublish": "npm run bundle",
2493-
"//compile": "The four projects run concurrently (scripts/compile-parallel.sh) and are each built incrementally; tsc skips unchanged files using .tsbuildinfo caches under node_modules/.cache/tsc/, keyed by compile:clean to force a full re-check.",
2494-
"compile": "bash scripts/compile-parallel.sh",
2493+
"//compile": "lage (lage.config.js) runs client/server/mcp's tsc invocations in parallel and caches results by content hash; tsc itself also skips unchanged files using .tsbuildinfo caches under node_modules/.cache/tsc/, keyed by compile:clean to force a full re-check. compile:bin only type-checks CI helper scripts, so its excluded",
2494+
"compile": "lage compile --continue",
24952495
"compile:client": "npm run compile --workspace client",
24962496
"compile:clean": "npm run compile:clean --workspaces",
24972497
"compile:bin": "tsc -p client/tsconfig.bin.json",
@@ -2548,6 +2548,7 @@
25482548
"eslint-config-flat-gitignore": "^2.3.0",
25492549
"eslint-config-prettier": "^10.1.8",
25502550
"globals": "^16.0.0",
2551+
"lage": "^2.15.17",
25512552
"lefthook": "^2.1.10",
25522553
"ovsx": "^0.10.5",
25532554
"playwright-bdd": "^9.2.0",

scripts/compile-parallel.sh

Lines changed: 0 additions & 34 deletions
This file was deleted.

server/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.1.0",
44
"private": true,
55
"scripts": {
6+
"compile": "tsc -p tsconfig.json",
67
"compile:clean": "rm -rf out ../node_modules/.cache/tsc/server.tsbuildinfo",
78
"test": "vitest run"
89
},

0 commit comments

Comments
 (0)