Skip to content

Migrate from Yarn to Bun (Vite retained) - #260

Merged
mmcardle merged 1 commit into
masterfrom
chore/migrate-to-bun
Jul 4, 2026
Merged

Migrate from Yarn to Bun (Vite retained)#260
mmcardle merged 1 commit into
masterfrom
chore/migrate-to-bun

Conversation

@mmcardle

@mmcardle mmcardle commented Jul 4, 2026

Copy link
Copy Markdown
Owner

Summary

Replaces Yarn with Bun as the package manager and task runner across the monorepo. Vite is retained as the bundler/dev-server (executed through Bun). The repo is now bun-only (node removed from mise) and every yarn/npm/npx reference has been converted.

What changed

  • Package manager: yarn.lock + yarn-error.log removed; bun.lock committed. packageManager: bun@1.3.14.
  • Scripts: root/workspace scripts use bun run --filter=<pkg> <script>.
  • bunfig.toml sets linker = "hoisted" so Vite/Rollup can resolve firebase's deep @firebase/app import (bun's default symlinked store broke the djangobuilder4 build; io was unaffected as it uses firebase/compat/app).
  • CI: oven-sh/setup-bun@v2 + bun install --frozen-lockfile; every yarnbun run.
  • Glue: Makefile, script/deploy.sh, script/cli_test.sh converted; the Firebase CLI now runs via bunx firebase.
  • CLI (bun-native): cli.ts now exports main; new cli-run.ts is the direct-run entry; bin/django-builder imports main — which also fixes the previously-broken bin (django-builder in.json out.tar now works).
  • Docs/READMEs: all commands converted to Bun.

Selective resolutions

Bun 1.3.14 supports only flat overrides (not nested resolutions/overrides). The 32 **/parent/child security pins were dropped after verifying Bun's fresh resolution already meets or exceeds every version floor (minimatch 3.1.5/5.1.9/6.2.3/9.0.9/10.2.5, ajv 6.15.0/8.20.0, path-to-regexp express→0.1.13 & router→8.4.2). The 10 flat pins are kept; bun.lock freezes the tree. See the comment:overrides key and the spec.

Validation (all pass under Bun)

  • bun install --frozen-lockfile — consistent, no drift
  • bun run build (io + v4) — both build; PACKAGE_VERSION still injected
  • bun run lint
  • bun run test — smoke ✓, core 174, v4 stub, io 5
  • bun run cli + ./bin/django-builder + make create — identical 39-entry tar
  • Vite dev server — VITE v6.4.3 ready, HTTP 200
  • Confirmed Bun runs node-shebang .bin tools with no node on PATH (bun-only CI viable)

Note: bun's fresh install also fixed 4 io tests that were failing on the stale Yarn tree (hoisted Vue 2).

Caveat

The firebase deploy path (Makefile deploy, deploy.sh) now uses bunx firebase but wasn't exercised here (no CI coverage, needs Firebase auth). Verify bunx firebase --version before the next deploy.

Full design + outcomes: docs/superpowers/specs/2026-07-04-bun-migration-design.md.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JwrmFjP62vMVjTqCXc2rfR

Replace Yarn with Bun across the monorepo while keeping Vite as the
bundler/dev-server. The repo is now bun-only (node removed from mise) and
all yarn/npm/npx references are converted.

Highlights:
- Root/workspace scripts use `bun run --filter=<pkg> <script>`; lockfile is
  `bun.lock` (yarn.lock + yarn-error.log removed).
- CI (.github/workflows/ci.yml) uses oven-sh/setup-bun and
  `bun install --frozen-lockfile`.
- Makefile, deploy.sh, cli_test.sh, README/docs converted; Firebase CLI runs
  via `bunx firebase`.
- Core CLI ported to bun-native: cli.ts exports `main`, new cli-run.ts is the
  direct-run entry, and bin/django-builder imports `main` (also fixes the
  previously-broken bin).
- bunfig.toml sets `linker = "hoisted"` so Vite/Rollup resolves firebase's
  deep `@firebase/app` import (bun's default symlinked store broke the v4
  build).
- 32 selective `**/parent/child` resolutions dropped (Bun supports only flat
  pins); verified bun's fresh resolution already meets every version floor.
  10 flat pins kept in `overrides`.

Validated: build (io+v4), lint, test_smoke, test_core (174), test_io (5),
CLI parity, and the Vite dev server all pass under Bun.

See docs/superpowers/specs/2026-07-04-bun-migration-design.md.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JwrmFjP62vMVjTqCXc2rfR
@mmcardle
mmcardle merged commit 607dbf8 into master Jul 4, 2026
10 checks passed
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