summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-06-26 20:33:06 +0900
committerAdam Malczewski <[email protected]>2026-06-26 20:33:06 +0900
commitea573f70934a63747dffd4b7ef4c84667b495b1e (patch)
treee9ff8e3c69b31f59c5d0e7acbeb3dd723bfd932b
parente8b4bf1fe4fedc48bd0dc56b5745467542946474 (diff)
downloaddispatch-ea573f70934a63747dffd4b7ef4c84667b495b1e.tar.gz
dispatch-ea573f70934a63747dffd4b7ef4c84667b495b1e.zip
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.
-rwxr-xr-xbin/build8
1 files changed, 8 insertions, 0 deletions
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" \