Skip to content

codemod/migrations-template

Repository files navigation

Migrations Template

Initial setup guide (remove once the repo is customized)

  1. Search and replace placeholders:
    • <ECOSYSTEM_NAME> (e.g., "React", "Node.js", "AcmeLib")
    • @<NAMESPACE> (e.g., acme)
    • <MAJOR_VERSION> (e.g., v5)
  2. Scaffold new codemods under recipes and name them like @<NAMESPACE>/<MAJOR_VERSION> (optional)/<codemod-name>:
npx codemod@latest init recipes/my-codemod
  1. Build codemod manually or with Codemod Studio (recommended) (Read docs →).
  2. Validate and test:
npm run validate
npm run test
  1. Commit hooks and CI run lint, validate, typecheck, and tests.

  2. Publish codemods to Codemod Registry:

# In package directory:
npx codemod@latest publish

Overview

This repository contains codemods (automated migrations) for <ECOSYSTEM_NAME>. These codemods facilitate adopting new features and upgrading across breaking changes.

Quickstart

# Run a specific codemod from the registry
npx codemod@latest @<NAMESPACE>/<codemod-name>

# Run locally from a recipe directory
npx codemod@latest workflow run -w workflow.yaml

For all commands, see the full Codemod CLI reference →

Available codemods

Caution

These scripts change source code. Commit or stash your changes before running them.

List your published codemods here, e.g.:

  • @<NAMESPACE>/<MAJOR_VERSION>/example-codemod — short description

Contributing

See CONTRIBUTING.md.

Security

See SECURITY.md.

License

MIT

About

Codemod migrations template for framework builders & contributors.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published