Kkingsword09

bun-catalogs-to-pnpm

Migrate bun catalog to pnpm workspace catalogs format

bunpnpmcatalogworkspacemigration
Public
2 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

bun-catalogs-to-pnpm

Migrate bun catalog to pnpm workspace catalogs format.

Usage

bash

What it does

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

Before (package.json)

json

After (pnpm-workspace.yaml)

yaml

The catalog is removed from package.json and moved to pnpm-workspace.yaml.

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

Requirements

  • pnpm v9.5.0 or higher (for catalog support)
  • Existing bun workspace with catalog configuration in package.json

After migration

  1. Remove bun files (optional):

    bash
  2. Install dependencies with pnpm:

    bash
  3. Verify:

    bash

Features

  • ✅ Migrates catalog from root package.json to pnpm-workspace.yaml
  • ✅ Preserves catalog: references in workspace packages
  • ✅ Creates pnpm-workspace.yaml if it doesn't exist
  • ✅ Updates existing pnpm-workspace.yaml if present
  • ✅ Removes catalog from root package.json

Notes

  • This is the reverse operation of pnpm-catalogs-to-bun
  • All catalog: references in workspace packages remain unchanged
  • The codemod creates or updates pnpm-workspace.yaml automatically

License

Apache-2.0

Ready to contribute?

Build your own codemod and share it with the community.