From 8dd2904a2c67253bf9ef82fdfa3342fd3f8eaf34 Mon Sep 17 00:00:00 2001 From: Sawyer Cutler Date: Mon, 28 Sep 2026 09:03:35 -0700 Subject: [PATCH 1/2] build(bin): embed sourcemaps in the compiled binary Crash stacks from the standalone binary pointed at minified frames with no source mapping, leaving production failures unactionable. An embedded sourcemap restores file-and-line stacks at a small size cost. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 718ef3fb2..85aa0f52d 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ }, "scripts": { "build": "bun build ./src/index.ts --outdir ./dist --target bun --external '@opentui/core-*' && bun scripts/copy-repo-plugins.ts", - "build:bin": "bun build ./src/index.ts --compile --minify --define process.env.NODE_ENV='\"production\"' --outfile ./dist/corbits && ([ \"$(uname -s)\" != Darwin ] || codesign -s - --force ./dist/corbits) && bun scripts/copy-repo-plugins.ts", + "build:bin": "bun build ./src/index.ts --compile --minify --sourcemap --define process.env.NODE_ENV='\"production\"' --outfile ./dist/corbits && ([ \"$(uname -s)\" != Darwin ] || codesign -s - --force ./dist/corbits) && bun scripts/copy-repo-plugins.ts", "typecheck": "tsc --noEmit", "test": "bun test ./src ./tests ./evals ./scripts --randomize --seed 424242", "test:paths": "bun scripts/test-paths.ts", From 720f4a0605b2fb2d76b074d8db5d800006c6a791 Mon Sep 17 00:00:00 2001 From: Sawyer Cutler Date: Mon, 28 Sep 2026 09:04:45 -0700 Subject: [PATCH 2/2] build(release): embed sourcemaps in release binaries --- scripts/release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/release.sh b/scripts/release.sh index 87d600bfd..30fd2de34 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -145,7 +145,7 @@ host_label() { # `codesign` only exists on macOS hosts, which is where darwin releases are cut. compile_bin() { # compile_bin BUN_TARGET OUTFILE local target=$1 out=$2 - bun build ./src/index.ts --compile --target="$target" --minify \ + bun build ./src/index.ts --compile --target="$target" --minify --sourcemap \ --define process.env.NODE_ENV='"production"' \ --define process.env.DEV='"false"' \ --outfile "$out" >/dev/null