bun-catalogs-to-pnpm
v0.1.1
Published
Migrate bun catalog to pnpm workspace catalogs format
Maintainers
Readme
bun-catalogs-to-pnpm
Migrate bun catalog to pnpm workspace catalogs format.
Usage
# Run the migration
npx codemod bun-catalogs-to-pnpm
# Or run directly
npx bun-catalogs-to-pnpmWhat it does
This codemod migrates your bun catalog configuration back to pnpm's workspace catalog format:
Before (package.json)
{
"workspaces": {
"packages": ["packages/*"],
"catalog": {
"lodash": "^4.17.21",
"react": "^19.2.0",
"typescript": "^5.3.0"
}
}
}After (pnpm-workspace.yaml)
packages:
- 'packages/*'
catalog:
lodash: ^4.17.21
react: ^19.2.0
typescript: ^5.3.0The 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
Remove bun files (optional):
rm bun.lockbInstall dependencies with pnpm:
pnpm installVerify:
cat pnpm-workspace.yaml
Features
- ✅ Migrates catalog from root
package.jsontopnpm-workspace.yaml - ✅ Preserves
catalog:references in workspace packages - ✅ Creates
pnpm-workspace.yamlif it doesn't exist - ✅ Updates existing
pnpm-workspace.yamlif 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.yamlautomatically
License
Apache-2.0
