Uh oh!
There was an error while loading. Please reload this page.
build: migrate package manager from pnpm to bun - #19
Merged
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR migrates the JavaScript/TypeScript monorepo (
apps/web,packages/*) from pnpm to Bun (bun@1.3.14).webjob: 78s → 51s on warm cache, 101s → 54s on cold cache).pnpm-lock.yaml→ 1,353 lines in text-basedbun.lock).Why
Dependency installation and module resolution in large monorepos introduce noticeable latency during local iterations and CI pipelines. Bun's native Zig/C++ runtime provides near-instantaneous zero-network installs (121ms) and faster file I/O for test suites.
Bun natively supports
workspacesand theworkspace:*dependency protocol directly withinpackage.json, removing the need for a separatepnpm-workspace.yaml.Bun 1.2+ uses a standardized, human-readable text lockfile (
bun.lock), significantly reducing PR diff fatigue and git merge conflicts.Retains 100% compatibility with Next.js 16 (Turbopack), React 19, Vitest with jsdom / Testing Library, Better Auth, and ESLint 9 without modifying application code.
Empirical Benchmarks (Local & CI)
node_modulesclean install)web) — Warm Cacheweb) — Cold CacheChanges
1. Workspace Configuration & Lockfile
package.jsonto declare"packageManager": "bun@1.3.14","workspaces": ["apps/web", "packages/*"], and migrated security patchoverrides(brace-expansion,postcss,sharp).pnpm-workspace.yamlandpnpm-lock.yaml.bun.lock.2. Task Runners (
justfile)install,dev-web,test-api-client,test-web,lint-web, andbuild-webtargets to usebunandbun --filter.3. CI/CD Workflow (
.github/workflows/ci.yml)pnpm/action-setupand Node.js setup/caching withoven-sh/setup-bun@v2(SHA pinned).actions/cache@v4targeting~/.bun/install/cachewithbun-${{ runner.os }}-${{ hashFiles('bun.lock') }}.4. Git Ignore & Documentation
.gitignore(.pnpm-store/→.bun/) andapps/web/.gitignore(removed.pnpm-debug.log*).README.mdandREADME.ko.md.Verification
All repository-level gates were verified locally: