Skip to content

Commit c340e29

Browse files
committed
build: prune stale bundle chunks before rebuilding dists
Stale content-hashed chunks from earlier builds accumulate in dist/ and carry old schema-fence values; anyone verifying a rebuild by grepping dist/*.js finds a mix of old and new fences and reaches the wrong conclusion (tonight's fleet seat-death postmortem). Deleting the bundle entrypoints and hashed chunks before bun build makes the on-disk chunk set exactly the referenced set, so an artifact grep is trustworthy. Declaration trees and the compiled TUI are untouched.
1 parent e4a49ff commit c340e29

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

packages/pi-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"README.md"
2727
],
2828
"scripts": {
29-
"build": "bun build src/index.ts src/subagent-entry.ts --outdir dist --target node --format esm --splitting --external @earendil-works/pi-coding-agent --external @earendil-works/pi-tui --external @huggingface/transformers --external node:sqlite",
29+
"build": "rm -f dist/index.js dist/subagent-entry.js dist/*-*.js && bun build src/index.ts src/subagent-entry.ts --outdir dist --target node --format esm --splitting --external @earendil-works/pi-coding-agent --external @earendil-works/pi-tui --external @huggingface/transformers --external node:sqlite",
3030
"typecheck": "tsc --noEmit",
3131
"test": "bun test",
3232
"lint": "biome check src",

packages/plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"README.md"
3131
],
3232
"scripts": {
33-
"build": "bun run build:tui && bun build src/index.ts --outdir dist --target node --format esm --splitting --external @opencode-ai/plugin --external @huggingface/transformers --external onnxruntime-web --external bun:sqlite --external node:sqlite && tsc --emitDeclarationOnly",
33+
"build": "bun run build:tui && rm -f dist/index.js dist/*-*.js && bun build src/index.ts --outdir dist --target node --format esm --splitting --external @opencode-ai/plugin --external @huggingface/transformers --external onnxruntime-web --external bun:sqlite --external node:sqlite && tsc --emitDeclarationOnly",
3434
"build:tui": "bun scripts/build-tui.ts",
3535
"check:tui-compiled": "bun run build:tui && git diff --exit-code -- src/tui-compiled && test -z \"$(git status --porcelain -- src/tui-compiled)\"",
3636
"typecheck": "tsc --noEmit && tsc -p tsconfig.scripts.json",

0 commit comments

Comments
 (0)