Skip to content
Draft

bun #4737

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
917 changes: 917 additions & 0 deletions .claude/docs/plans/yarn-to-bun-migration-plan.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions .cursor/rules/app-design-document.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Tools and features specifically for developers:

1. **First-Time Setup**

- Developer installs Plate via npm/yarn
- Developer installs Plate via bun
- Copies components using shadcn CLI
- Configures plugins for their use case
- Deploys basic editor in minutes
Expand Down Expand Up @@ -524,7 +524,7 @@ Tools and features specifically for developers:

1. **First-Time Setup**

- Developer installs Plate via npm/yarn
- Developer installs Plate via bun
- Copies components using shadcn CLI
- Configures plugins for their use case
- Deploys basic editor in minutes
Expand Down
33 changes: 15 additions & 18 deletions .cursor/rules/tech-stack.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Plate is a modern, extensible rich-text editor framework for React built as a so

- **Frontend**: React 19.1.0, Next.js 15.3.3, TypeScript 5.8.3
- **Styling**: Tailwind CSS 4.1.8, Radix UI, shadcn/ui patterns
- **Build**: Yarn workspaces, Turbo, tsup
- **Build**: Bun workspaces, Turbo, tsup
- **Testing**: Jest, Playwright, Testing Library
- **Deployment**: Vercel with automatic deployments
- **Distribution**: npm packages under @platejs scope
Expand All @@ -32,7 +32,7 @@ Plate is a modern, extensible rich-text editor framework for React built as a so
### Node.js Runtime

- **Required Version**: >= 18.12.0
- **Package Manager**: Yarn 4.6.0 (using Plug'n'Play with node-modules linker)
- **Package Manager**: Bun 1.3.2
- **Engine Enforcement**: Strict engine checking enabled

### Language Features
Expand Down Expand Up @@ -159,12 +159,9 @@ export async function POST(req: Request) {

### Package Manager

```yaml
# .yarnrc.yml configuration
nodeLinker: node-modules
enableGlobalCache: false
enableTelemetry: false
```
- **Bun**: 1.3.2 for fast package management
- Configuration via `package.json` packageManager field
- No additional configuration files needed

### Code Quality Tools

Expand All @@ -189,13 +186,13 @@ enableTelemetry: false

### Type Checking

**Important**: Before running `yarn typecheck`, you must first run `yarn install --frozen-lockfile`, then `yarn build` to ensure all packages are built and type definitions are available.
**Important**: Before running `bun run typecheck`, you must first run `bun install --frozen-lockfile`, then `bun run build` to ensure all packages are built and type definitions are available.

```bash
# Required sequence for type checking
yarn install --frozen-lockfile # Install all dependencies and update lockfile if needed
yarn build # Build all packages (generates type definitions)
yarn typecheck # Check all packages
bun install --frozen-lockfile # Install all dependencies
bun run build # Build all packages (generates type definitions)
bun run typecheck # Check all packages
```

### Testing Strategy
Expand All @@ -222,14 +219,14 @@ yarn typecheck # Check all packages

```bash
# Required sequence for development
yarn install --frozen-lockfile # Install dependencies and update lockfile if needed
yarn build # Build all packages first
yarn typecheck # Type checking (requires built packages)
bun install --frozen-lockfile # Install dependencies
bun run build # Build all packages first
bun run typecheck # Type checking (requires built packages)

# Other development commands
yarn dev # Start development server
yarn test # Run tests
yarn lint # Run ESLint
bun run dev # Start development server
bun run test # Run tests
bun run lint # Run Biome linter
```

These are root commands, but if you modified just a few packages, it's more efficient to run those commands in the modified packages.
Expand Down
14 changes: 7 additions & 7 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
**Checklist**

- [x] `yarn typecheck`
- [x] `yarn lint:fix`
- [x] `yarn test`
- [x] `yarn brl`
- [x] `yarn changeset`
- [x] `bun typecheck`
- [x] `bun lint:fix`
- [x] `bun test`
- [x] `bun brl`
- [x] `bun changeset`
- [x] [ui changelog](docs/components/changelog.mdx)

<!--

Thanks for the PR. Please complete the checklist below to ensure your PR can be
merged as soon as possible.

- yarn brl: Required if adding, moving or removing a file in a package.
- yarn changeset: Required if updating `packages`. Please be brief and descriptive. For breaking
- bun brl: Required if adding, moving or removing a file in a package.
- bun changeset: Required if updating `packages`. Please be brief and descriptive. For breaking
changes, use a major changeset. For new features, use a minor changeset. For
bug fixes, use a patch changeset.
- changelog: Required if updating `apps/www/src/registry`. See `apps/www/src/registry/components/changelog.mdx`.
Expand Down
124 changes: 0 additions & 124 deletions .github/actions/yarn-nm-install/action.yml

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/claude-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ jobs:

Please analyze the changes in this PR/issue and create or update the relevant tests accordingly.
**Important Development Sequence:**
- Before running type checking, you must first run `yarn install` and build affected packages
- Use `yarn turbo build --filter=./packages/modified-package` to build only modified packages and their dependencies
- Use `yarn turbo typecheck --filter=./packages/modified-package` for type checking modified packages
- Use `yarn turbo lint:fix --filter=./packages/modified-package` for linting modified packages.
- Avoid full project commands (`yarn build`, `yarn typecheck`, `yarn lint:fix`), these are very slow
- Before running type checking, you must first run `bun install` and build affected packages
- Use `bun turbo build --filter=./packages/modified-package` to build only modified packages and their dependencies
- Use `bun turbo typecheck --filter=./packages/modified-package` for type checking modified packages
- Use `bun turbo lint:fix --filter=./packages/modified-package` for linting modified packages.
- Avoid full project commands (`bun run build`, `bun typecheck`, `bun lint:fix`), these are very slow
16 changes: 8 additions & 8 deletions .github/workflows/claude.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ jobs:
- Documentation
- Changeset required when updating packages
- Updating `docs/components/changelog.mdx` is required only when updating `apps/www/src/registry`
- (only once) Run `yarn install`, then build only modified packages with their dependencies
- (only once) Run `bun install`, then build only modified packages with their dependencies
- Validate your package changes efficiently using turbo filtering for modified packages
**Important Development Sequence:**
- Before running type checking, you must first run `yarn install` and build affected packages
- Use `yarn turbo build --filter=./packages/modified-package` to build only modified packages and their dependencies
- Use `yarn turbo typecheck --filter=./packages/modified-package` for type checking modified packages
- Use `yarn turbo lint:fix --filter=./packages/modified-package` for linting modified packages
- For multiple packages: `yarn turbo build --filter=./packages/core --filter=./packages/utils`
- Always end development work with `yarn turbo lint:fix --filter=./packages/modified-package` to auto-fix linting issues
- Avoid full project commands (`yarn build`, `yarn typecheck`, `yarn lint:fix`), these are very slow
- Before running type checking, you must first run `bun install` and build affected packages
- Use `bun turbo build --filter=./packages/modified-package` to build only modified packages and their dependencies
- Use `bun turbo typecheck --filter=./packages/modified-package` for type checking modified packages
- Use `bun turbo lint:fix --filter=./packages/modified-package` for linting modified packages
- For multiple packages: `bun turbo build --filter=./packages/core --filter=./packages/utils`
- Always end development work with `bun turbo lint:fix --filter=./packages/modified-package` to auto-fix linting issues
- Avoid full project commands (`bun run build`, `bun typecheck`, `bun lint:fix`), these are very slow
45 changes: 30 additions & 15 deletions .github/workflows/lint-typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ on:
- 'packages/**'
- '.github/actions/**'
- '.github/workflows/lint-typecheck.yml'
- '.yarnrc.yml'
- 'yarn.lock'
- 'bun.lock'
- 'biome.jsonc'
- 'eslint*'
- 'jest.config.js'
Expand All @@ -28,8 +27,7 @@ on:
- 'packages/**'
- '.github/actions/**'
- '.github/workflows/**'
- '.yarnrc.yml'
- 'yarn.lock'
- 'bun.lock'
- 'biome.jsonc'
- 'eslint*'
- 'jest.config.js'
Expand All @@ -52,40 +50,57 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: 📥 Monorepo install
uses: ./.github/actions/yarn-nm-install
- name: ♻️ Setup bun cache
uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lock') }}
restore-keys: |
${{ runner.os }}-bun-

- name: 📥 Install dependencies
run: bun install --frozen-lockfile

- name: 🔬 Lint
run: yarn check
run: bun check

- name: ♻️ Restore packages cache
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/.cache
${{ github.workspace }}/**/tsconfig.tsbuildinfo
key: packages-cache-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
key: packages-cache-${{ runner.os }}-${{ hashFiles('bun.lock') }}

- name: 🏗 Build
run: yarn build
run: bun run build

- name: 🕵️ Typecheck
run: bun run typecheck

- name: 🕵️ Typecheck + 🧪 Test (parallel)
run: yarn verify
- name: 🧪 Test
run: bun run test

# - name: 📥 Install Playwright dependencies
# run: |
# yarn playwright install-deps
# yarn playwright install
# bun playwright install-deps
# bun playwright install

# - name: 🎭 Run Playwright tests
# run: yarn e2e
# run: bun e2e

notify-failure:
name: Discord Notification
Expand Down
Loading