Skip to content

Commit 62d8b8e

Browse files
committed
feat: external sourcemap upload for compiled binaries
Two-step build: bundle TS → JS+sourcemap, then compile JS → binary. The sourcemap is uploaded to Sentry for server-side stack trace resolution, never shipped to users in the binary. Verified end-to-end: stack traces in Sentry now show original function names (throwApiError, unwrapResult) and file paths (src/lib/api/infrastructure.ts:48) instead of minified names (G8, W41) and //root/bin.js. Impact vs current (no sourcemaps): Download size: +0.04 MB gzipped (+0.1%) Delta patches: +0.83 KB per release Binary size: +0.54 MB raw (+0.5%) Build changes: - script/build.ts: Step 1 bundles with external sourcemap, sentry-cli injects debug IDs + uploads with //root/ prefix, Step 2 compiles the JS without re-minifying - CI: passes SENTRY_AUTH_TOKEN to build-binary job for upload - Intermediate JS/map files cleaned up after compile
1 parent 4b4ed91 commit 62d8b8e

File tree

3 files changed

+190
-59
lines changed

3 files changed

+190
-59
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@ jobs:
225225
- name: Build
226226
env:
227227
SENTRY_CLIENT_ID: ${{ vars.SENTRY_CLIENT_ID }}
228+
# Sourcemap upload to Sentry (non-fatal, skipped when token is absent)
229+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
228230
# Set on main/release branches so build.ts runs binpunch + creates .gz
229231
RELEASE_BUILD: ${{ github.event_name != 'pull_request' && '1' || '' }}
230232
run: bun run build --target ${{ matrix.target }}

0 commit comments

Comments
 (0)