refactor: replace Bun.build with fossilize for Node SEA binaries#1003
Merged
Conversation
8237365 to
1939ab9
Compare
1939ab9 to
fee2e04
Compare
fee2e04 to
83525b2
Compare
Contributor
|
Contributor
Codecov Results 📊❌ Patch coverage is 50.00%. Project has 4237 uncovered lines. Files with missing lines (1)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
- Coverage 81.86% 81.85% -0.01%
==========================================
Files 328 328 —
Lines 23349 23347 -2
Branches 15114 15114 —
==========================================
+ Hits 19115 19110 -5
- Misses 4234 4237 +3
- Partials 1620 1618 -2Generated by Codecov Action |
5a46789 to
c89949e
Compare
c89949e to
8d8607c
Compare
8d8607c to
d994421
Compare
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d994421. Configure here.
- Replace Bun.build({ compile: true }) with fossilize --no-bundle
- Switch esbuild output from ESM to CJS (Node SEA requirement)
- Add import-meta-url.js shim for CJS format
- Target node22 to downlevel 'using' declarations
- Embed Ink sidecar via fossilize --assets + node:sea.getAsset()
- Update text-import-plugin: file imports return path string (no ESM external)
- Drop musl targets (Node doesn't publish musl binaries)
- Remove bun:sqlite fallback from sqlite.ts (Node-only now)
- Remove setup-bun from CI, add rcodesign for macOS signing
- Remove Bun global from biome.jsonc
- Suppress SQLite ExperimentalWarning in bin.ts
- Add dist-build/ to .gitignore and biome excludes
d994421 to
ddacf83
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Phase 6: Replace Bun Binary Compilation with Fossilize
Final phase of the Bun → Node.js migration. Replaces
Bun.build({ compile: true })with fossilize for producing Node SEA (Single Executable Application) binaries. This completely removes Bun from the codebase.Architecture Change
Changes
Build script (
script/build.ts):Bun.build({ compile: true })withnpx fossilize --no-bundleimport-meta-url.jsinject + define for CJS compatibilitynode22(downlevelsusingdeclarations unsupported in CJS)dist-build/) from fossilize output (dist-bin/)Bun.$,Bun.file,Bun.writewith Node.js equivalentsInk sidecar (
src/lib/init/ui/ink-ui.ts):node:sea.getAsset()runtime path for SEA binaries--assetsflagimport()s at runtimeSQLite (
src/lib/db/sqlite.ts):bun:sqlitetry/catch fallback — Node-only nowBinary entry (
src/bin.ts):ExperimentalWarning: SQLite is an experimental featureCI (
.github/workflows/ci.yml):setup-bunentirely (no more Bun in CI)rcodesignv0.29.0 installation for macOS code signing from LinuxFOSSILIZE_SIGNenv var controls signing (enabled on main/release pushes)Other cleanup:
Bunfrombiome.jsoncglobalspackage.jsonbuild scripts:bun run→pnpm tsxdist-build/to.gitignoreand biome excludestext-import-plugin: file imports return path string for all formats (no more ESM external for Bun.compile)Benchmark Results
Code cache improvement deferred — requires fossilize PR to support per-platform
useCodeCache.What's Gone
setup-bunfrom CIbun:sqlitefallbackBun.build()/Bun.$/Bun.file/Bun.writein build scriptBunglobal declarationTesting
--helpand--versioncorrectly