Skip to content

refactor: remove Bun artifacts and convert remaining Bun APIs#1002

Merged
BYK merged 1 commit into
mainfrom
refactor/phase5-cleanup
May 22, 2026
Merged

refactor: remove Bun artifacts and convert remaining Bun APIs#1002
BYK merged 1 commit into
mainfrom
refactor/phase5-cleanup

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented May 22, 2026

Phase 5: Bun Cleanup

Final phase of the Bun → Node.js migration. Removes Bun-specific artifacts and converts the last remaining Bun API usages.

Changes

Removed Bun artifacts:

  • bun.lock and docs/bun.lock — replaced by pnpm-lock.yaml (added in Phase 4)
  • bunfig.toml — Bun configuration, no longer needed
  • @types/bun from devDependencies — replaced by src/global.d.ts
  • .cursor/rules/bun-cli.mdc — outdated Bun-specific Cursor AI rule

Converted remaining Bun APIs:

  • src/commands/local/run.ts: Bun.spawn()spawn() from node:child_process
  • src/commands/local/server.ts: Bun.sleep()sleep() from node:timers/promises
  • Removed corresponding spawn/sleep polyfills from script/node-polyfills.ts

Added type declarations (src/global.d.ts):

  • Worker class with typed event map (previously from @types/bun)
  • RegExp.escape() augmentation (ES2025, Node 23.6+)

Test fixes:

  • test/commands/local/run.test.ts: removed isBun skip guard (now runs on Node)
  • test/lib/db/concurrent.test.ts: removed isBun skip guard, switched worker spawn to tsx
  • test/script/node-polyfills.test.ts: removed spawn polyfill tests

Intentionally kept

  • bun:sqlite try/catch in src/lib/db/sqlite.ts — compiled Bun binary still needs it
  • node-polyfills.ts — still used by bundle.ts for the npm CJS distribution
  • Bun.build() in script/build.ts — no Node equivalent for binary compilation
  • setup-bun in build-binary CI job

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 22, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/_preview/pr-1002/

Built to branch gh-pages at 2026-05-22 09:02 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Comment thread src/commands/local/run.ts
Comment thread src/commands/local/run.ts Outdated
@BYK BYK force-pushed the refactor/phase5-cleanup branch from cd58f70 to e57f6cc Compare May 22, 2026 08:14
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e57f6cc. Configure here.

Comment thread src/commands/local/run.ts Outdated
Comment thread src/commands/local/run.ts Outdated
@BYK BYK force-pushed the refactor/phase5-cleanup branch 4 times, most recently from e5e0b77 to 41ee053 Compare May 22, 2026 08:50
- Remove @types/bun, bun.lock, docs/bun.lock, bunfig.toml
- Remove .cursor/rules/bun-cli.mdc (outdated)
- Convert Bun.spawn → node:child_process in local/run.ts
- Convert Bun.sleep → node:timers/promises in local/server.ts
- Remove spawn/sleep polyfills from node-polyfills.ts
- Add src/global.d.ts for Worker and RegExp.escape types
- Remove isBun guards from tests (now run on Node)
@BYK BYK force-pushed the refactor/phase5-cleanup branch from 41ee053 to 82779e8 Compare May 22, 2026 09:01
@github-actions
Copy link
Copy Markdown
Contributor

Codecov Results 📊

✅ Patch coverage is 83.33%. Project has 4236 uncovered lines.
✅ Project coverage is 81.86%. Comparing base (base) to head (head).

Files with missing lines (2)
File Patch % Lines
src/commands/local/run.ts 90.91% ⚠️ 1 Missing and 2 partials
src/commands/local/server.ts 0.00% ⚠️ 1 Missing
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    81.63%    81.86%    +0.23%
==========================================
  Files          328       328         —
  Lines        23343     23349        +6
  Branches     15111     15114        +3
==========================================
+ Hits         19055     19113       +58
- Misses        4288      4236       -52
- Partials      1614      1621        +7

Generated by Codecov Action

Comment thread src/commands/local/run.ts
@BYK BYK merged commit 33515c5 into main May 22, 2026
30 checks passed
@BYK BYK deleted the refactor/phase5-cleanup branch May 22, 2026 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant