Kkingsword09

pnpm-catalogs-to-bun

Migrate pnpm workspace catalogs to bun catalog format

pnpmbuncatalogworkspacemigration
Public
6 downloads
0 stars
How to Use
Run this codemod on your codebase using one of the following commands

The easiest way to run this codemod without installing anything globally:

Documentation

pnpm-catalogs-to-bun

Migrate pnpm workspace catalogs to bun catalog format.

Usage

bash

What it does

This codemod migrates your pnpm workspace catalog configuration to bun's catalog format:

Before (pnpm-workspace.yaml)

yaml

After (package.json)

json

All workspace packages using catalog dependencies (catalog:) will continue to work with bun.

Requirements

  • Bun v1.1.30 or higher (for catalog support)
  • Existing pnpm workspace with catalog configuration

After migration

  1. Remove pnpm files (optional):

    bash
  2. Install dependencies with bun:

    bash
  3. Verify:

    bash

Features

  • ✅ Migrates catalog from pnpm-workspace.yaml to root package.json
  • ✅ Preserves catalog: references in workspace packages
  • ✅ Merges named catalogs (if any) into single catalog
  • ✅ Sorts catalog entries alphabetically
  • ✅ Adds workspaces configuration if missing

Notes

  • Bun's catalog feature is equivalent to pnpm's catalog
  • Named catalogs (pnpm's catalogs:) are merged into one catalog
  • The codemod preserves all existing catalog: references

License

Apache-2.0

Ready to contribute?

Build your own codemod and share it with the community.