Pin Bun for reproducible embedded review bundles

CI used a newer minifier than the local release build. Keep the byte-for-byte drift check and use one explicit build toolchain across local regeneration and CI.

AI assistance: OpenAI Codex.
This commit is contained in:
Paul Bakaus
2026-09-13 20:48:00 -07:00
parent 6a93a35293
commit 6a7e931f7e
5 changed files with 15 additions and 11 deletions
+3
View File
@@ -1,7 +1,10 @@
// Source bundle embedded in the native engine; no Node/Bun is needed at runtime.
import { fileURLToPath } from 'node:url';
import { resolve } from 'node:path';
import { readFileSync } from 'node:fs';
const root = fileURLToPath(new URL('../', import.meta.url));
const pinnedBun = readFileSync(resolve(root, '.bun-version'), 'utf8').trim();
if (Bun.version !== pinnedBun) throw new Error(`Component review bundles require Bun ${pinnedBun}; received ${Bun.version}. Use the pinned toolchain before regenerating tracked output.`);
const result = await Bun.build({ entrypoints: [resolve(root, 'ui/component-review/entry.ts')], target: 'browser', format: 'iife', minify: true });
if (!result.success) throw new AggregateError(result.logs, 'Component review bundle failed');
await Bun.write(resolve(root, 'crates/context/assets/component-review.js'), await result.outputs[0].text());