We are thrilled to announce that we are partnering with the pnpm team to build and maintain open-source codemods in the pnpm/codemod repo. This collaboration aims to enhance pnpm migrations, beginning with the adoption of the pnpm catalog feature.
pnpm catalog migration
As described in pnpm docs, catalog comes with the following benefits:
- Maintain unique versions — It's usually desirable to have only one version of a dependency in a workspace. Catalogs make this easier to maintain. Duplicated dependencies can conflict at runtime and cause bugs. Duplicates also increase size when using a bundler.
- Easier upgrades — When upgrading a dependency, only the catalog entry in pnpm-workspace.yaml needs to be edited rather than all package.json files using that dependency. This saves time — only one line needs to be changed instead of many.
- Fewer merge conflicts — Since package.json files do not need to be edited when upgrading a dependency, git merge conflicts no longer happen in these files.
We've developed a codemod to help you migrate your project to pnpm's latest version and adopt the catalog feature. Use the following command to migrate your project:
1pnpx codemod pnpm/catalog
For more details about the codemod visit Codemod Registry.
Enhanced Codemod Platform
Using Codemod platform for pnpm and other framework migrations, brings many benefits:
- Diverse Codemod Engines: We support various engines like ast-grep, ts-morph, and LLM-based engines (Codemod 2.0), allowing us to choose the best tool for each task.
- Recipes/Presets: An ordered list of codemods that can be executed with one click to streamline your workflow.
- Flexible File Selection: Better control over which files are processed.
- Dependency Management: Simplify the installation and uninstallation of dependencies after running your codemods.
- Enhanced Performance: Enjoy faster execution times with threading.
- Integrated Formatter: Automatically format code post-modification for clean, readable output.
- Community and Reporting: Report issues and engage with the community for support. We are just one CLI command away:
npx codemod feedback
. - AI Customization: Build new or customize existing codemods with the help of Codemod AI in the studio.
- Unified Search (
codemod search <fuzzy-terms>
): Find all codemods regardless of language, framework, or publisher. - Argument Flexibility: Customize codemods with specific arguments. Examples include feature flag clean up codemods.
- Enterprise Support: Manage large-scale changes for big enterprises. Codemod architecture is designed from day one to optimize community involvement while separating features needed for large teams and enterprises. Contact us for more details.
Join Our Community
Put your migration campaigns on autopilot.
Accelerate large-scale code changes with unprecedented insights and automations, freeing your engineers to build new features on secure and performant codebases.