bun
Summary
Complete migration from Yarn 4.6.0 to Bun 1.3.2 as the package manager for the Plate monorepo.
Key Changes
- Package Manager: Upgraded from Yarn 4.6.0 to Bun 1.3.2
- Lockfile: Replaced
yarn.lockwithbun.lock(6,023 entries) - Configuration: Removed Yarn-specific files (
.yarnrc.yml,.yarn/directory) - Scripts: Updated all
package.jsonscripts to usebuncommands - CI/CD: Created new
bun-installGitHub Action and updated all workflows - Documentation: Updated
CLAUDE.md, tech stack documentation, and README
Files Changed
Removed:
.yarnrc.ymlyarn.lock(22,275 lines).yarn/plugins/and.yarn/releases/.github/actions/yarn-nm-install/
Created:
bun.lock(6,023 entries).github/actions/bun-install/action.yml.claude/docs/plans/yarn-to-bun-migration-plan.mdZOD_ISSUE.md(documenting known issue)
Modified:
- Root
package.json(packageManager, engines, all scripts) - All 51 package
package.jsonfiles - All GitHub workflow files (
.github/workflows/*.yml) CLAUDE.md(command documentation).cursor/rules/tech-stack.mdc
Benefits
- Faster Installation: Bun's native speed improvements
- Faster Execution: Built-in task runner performance
- Simpler Configuration: No custom Yarn plugins needed
- Better Monorepo Support: Native workspace support
Verification
- ✅ All packages build successfully
- ✅ Type checking passes
- ✅ Linting passes
- ✅ All tests pass (2,233 tests, 32 snapshots)
- ✅ CI/CD workflows updated and validated
Breaking Changes
For Contributors:
- Must install Bun 1.3.2 or later
- Replace all
yarncommands withbun - Replace
npxwithbunx
For CI/CD:
- GitHub workflows now use
oven-sh/setup-bun@v2action - Cache keys updated to use
bun.lock
Migration Commands
# Old (Yarn)
yarn install
yarn build
yarn test
yarn workspace @platejs/core build
# New (Bun)
bun install
bun build
bun test
bun workspace @platejs/core build
Test Plan
- [x] Clean install:
rm -rf node_modules && bun install - [x] Build all packages:
bun build - [x] Type check:
bun typecheck - [x] Run linting:
bun check - [x] Run tests:
bun test - [x] Verify CI workflows syntax
- [x] Test individual package operations
Known Issues
- Zod Version Issue: There's a known peer dependency warning with Zod (documented in
ZOD_ISSUE.md)- Not blocking for this migration
- Can be addressed in a follow-up PR
Rollback Plan
If issues arise:
- Revert the commit:
git revert ae6271b1e - Restore Yarn:
yarn install(will recreateyarn.lock) - Rebuild:
yarn build
References
- Migration plan:
.claude/docs/plans/yarn-to-bun-migration-plan.md - Bun Documentation: https://bun.sh/docs
- Setup Bun Action: https://github.com/oven-sh/setup-bun
🤖 Generated with Claude Code
Co-Authored-By: Claude [email protected]
⚠️ No Changeset found
Latest commit: a8748f9cd67dc9a06d8ba20ae9a205a40def4d09
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| plate | Nov 21, 2025 11:43am |
bun + turbopack does not work here. will go for pnpm in the meantime.
pnpm: same issue with turbopack
## Error Type
Runtime ReferenceError
## Error Message
int is not defined
at module evaluation (src/registry/components/editor/use-chat.ts:5:76)
at module evaluation (src/registry/components/editor/plugins/ai-kit.tsx:17:1)
at module evaluation (src/registry/components/editor/editor-kit.tsx:6:41)
at module evaluation (src/registry/examples/playground-demo.tsx:11:68)
at module evaluation (src/components/playground-preview.tsx:11:65)
at IndexPage (src/app/(app)/page.tsx:119:13)
## Code Frame
3 | import * as React from 'react';
4 |
> 5 | import { type UseChatHelpers, useChat as useBaseChat } from '@ai-sdk/react';
| ^
6 | import { faker } from '@faker-js/faker';
7 | import { AIChatPlugin, aiCommentToRange } from '@platejs/ai/react';
8 | import { getCommentKey, getTransientCommentKey } from '@platejs/comment';
Next.js version: 16.0.3 (Turbopack)