Commit 76fa663
Adopt Bun for install + script running (selective migration)
Package manager is now Bun: bun install replaces npm install, bun run <script>
replaces npm run <script>, and the committed lockfile is bun.lock (migrated
from package-lock.json). Install drops from ~90s to ~5s locally.
Deliberately selective, not a full stack swap. Two parallel research agents
came back with:
- tests/.../research-bun-test-migration.md: bun test has multiple blockers
for this repo — vi.resetModules() unimplemented (oven-sh/bun#16140, open
as of 2026-07), vi.mock() not hoisted (needs preload/await import()
refactor), coverage emits lcov only (no Istanbul JSON, which our
scripts/merge-coverage.mjs consumes), fake timers missing. Rough effort
estimate 15–30 hrs, dominated by module-mock refactors, for the single
feature we cared about (per-file coverage threshold) which Vitest already
provides via coverage.thresholds.perFile. Staying on Vitest.
- tests/.../research-bun-runtime-compat.md: Miniflare's workerd child-process
lifecycle is the biggest risk switching to Bun as the top-level runtime;
Playwright + Bun is known-flaky (microsoft/playwright#27139); Wrangler +
Bun is officially documented; Vite 7 + @cloudflare/vite-plugin works for
builds, less so for dev. Recommendation was a selective switch matching
what this commit does.
Smoke-tested locally under bun run:
- bun run test:unit: 20 files, 388 tests, all pass
- bun run test:integration: 7 files, 70 tests, all pass
- bun run test:e2e: 49 tests, all pass
- bun run lint / typecheck / build: clean
CI changes (.github/workflows/ci.yml):
- Every job replaces actions/setup-node@v4 + npm ci with oven-sh/setup-bun@v2
+ bun install --frozen-lockfile.
- Scripts invoked via bun run.
- The e2e + visual jobs keep actions/setup-node@v4 alongside setup-bun so
Playwright's test runner has a clean Node host for its browser worker
subprocesses — and those jobs explicitly call `npx playwright test`
instead of `bun run test:e2e` to route around playwright#27139.
- bun_version pinned to 1.3.11 to match the local smoke-tested version.
CLAUDE.md: documents the bun install / bun run convention and the reason
bun test migration is deferred.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 06e3c45 commit 76fa663
3 files changed
Lines changed: 894 additions & 41 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
30 | 29 | | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
37 | | - | |
| 36 | + | |
38 | 37 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
43 | 41 | | |
44 | 42 | | |
45 | 43 | | |
| |||
54 | 52 | | |
55 | 53 | | |
56 | 54 | | |
57 | | - | |
| 55 | + | |
58 | 56 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
63 | 60 | | |
64 | 61 | | |
65 | 62 | | |
| |||
69 | 66 | | |
70 | 67 | | |
71 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
72 | 75 | | |
73 | 76 | | |
74 | | - | |
75 | | - | |
76 | | - | |
| 77 | + | |
| 78 | + | |
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
| |||
89 | 91 | | |
90 | 92 | | |
91 | 93 | | |
92 | | - | |
93 | | - | |
| 94 | + | |
| 95 | + | |
94 | 96 | | |
95 | 97 | | |
96 | 98 | | |
| |||
115 | 117 | | |
116 | 118 | | |
117 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
118 | 123 | | |
119 | 124 | | |
120 | | - | |
121 | | - | |
122 | | - | |
| 125 | + | |
| 126 | + | |
123 | 127 | | |
124 | 128 | | |
125 | 129 | | |
| |||
131 | 135 | | |
132 | 136 | | |
133 | 137 | | |
134 | | - | |
| 138 | + | |
135 | 139 | | |
136 | | - | |
| 140 | + | |
137 | 141 | | |
138 | 142 | | |
139 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
31 | 35 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
45 | 52 | | |
46 | 53 | | |
47 | 54 | | |
| |||
0 commit comments