Skip to content

Commit 33515c5

Browse files
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 job
1 parent 2a62159 commit 33515c5

14 files changed

Lines changed: 91 additions & 2956 deletions

File tree

.cursor/rules/bun-cli.mdc

Lines changed: 0 additions & 304 deletions
This file was deleted.

biome.jsonc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
"./lint-rules/no-stderr-write-in-commands.grit"
1111
],
1212
"files": {
13-
"includes": ["!docs", "!test/init-eval/templates"]
13+
// custom-ca.ts excluded: Biome's type analysis hits the 200k type limit
14+
// on the node:tls module graph — an internal Biome bug that surfaces
15+
// non-deterministically as error vs warning. See biome issue tracker.
16+
"includes": ["!docs", "!test/init-eval/templates", "!!src/lib/custom-ca.ts"]
1417
},
1518
"javascript": {
1619
"globals": ["Bun"]

0 commit comments

Comments
 (0)