From ea573f70934a63747dffd4b7ef4c84667b495b1e Mon Sep 17 00:00:00 2001 From: Adam Malczewski Date: Fri, 26 Jun 2026 20:33:06 +0900 Subject: fix(build): run tsc --build before bun build --compile bin/build was compiling the binary directly from stale dist/*.js files without first recompiling the TypeScript packages. Since package.json main fields point to dist/index.js, source edits to .ts files were silently lost in the compiled binary. Now tsc --build runs first (composite project references rebuild all packages in dependency order), then bun build --compile bundles the fresh dist/ output. --- bin/build | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'bin/build') diff --git a/bin/build b/bin/build index 0517af5..c410156 100755 --- a/bin/build +++ b/bin/build @@ -24,6 +24,14 @@ if [[ "${1:-}" == "--no-frontend" ]]; then BUILD_FRONTEND=0 fi +# Recompile all TypeScript packages (composite project references) so the +# dist/*.js files are up to date with the .ts source. The packages' package.json +# `main` fields point to dist/index.js, so bun build --compile reads the compiled +# JavaScript — without this step, source edits are silently lost in the binary. +echo "[build] tsc --build (recompile packages from source)" +cd "$BACKEND" +bunx tsc --build 2>&1 | tail -5 + echo "[build] backend binary → dist/dispatch-server" mkdir -p "$ROOT/dist" bun build --compile "$BACKEND/packages/host-bin/src/main.ts" \ -- cgit v1.2.3