Commit 33515c5
authored
refactor: remove Bun artifacts and convert remaining Bun APIs (#1002)
## 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 job1 parent 2a62159 commit 33515c5
14 files changed
Lines changed: 91 additions & 2956 deletions
File tree
- .cursor/rules
- docs
- script
- src
- commands/local
- test
- commands/local
- lib/db
- script
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| |||
0 commit comments