pnpm-catalogs-to-bun
v0.1.1
Published
Migrate pnpm workspace catalogs to bun catalog format
Maintainers
Readme
pnpm-catalogs-to-bun
Migrate pnpm workspace catalogs to bun catalog format.
Usage
# Run the migration
npx codemod pnpm-catalogs-to-bun
# Or run directly
npx pnpm-catalogs-to-bunWhat it does
This codemod migrates your pnpm workspace catalog configuration to bun's catalog format:
Before (pnpm-workspace.yaml)
packages:
- 'packages/*'
catalog:
react: ^19.2.0
lodash: ^4.17.21
typescript: ^5.3.0After (package.json)
{
"workspaces": {
"packages": ["packages/*"],
"catalog": {
"lodash": "^4.17.21",
"react": "^19.2.0",
"typescript": "^5.3.0"
}
}
}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
Remove pnpm files (optional):
rm pnpm-workspace.yaml pnpm-lock.yamlInstall dependencies with bun:
bun installVerify:
bun pm ls
Features
- ✅ Migrates catalog from
pnpm-workspace.yamlto rootpackage.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
