@usephase/codemod
v0.1.0
Published
Versioned migrations for phase packages
Readme
@usephase/codemod
Versioned migrations for phase packages.
Status: Alpha. Review all changes before committing them.
Each migration is a subcommand named for its source and destination. Published subcommands keep their original behavior, so teams can run the same migration later.
Available codemods
| Codemod | From | To | Purpose |
| ------------------------------------------------------------------------------------------------------------------------------------ | -------------- | --------------------------------------------------- | ------------------------------------------------------------------------ |
| migrate-phase-to-usephase | phase <0.6.0 | @usephase/core ^0.6.0@usephase/react ^0.6.0 | Move legacy runtime imports and package metadata to the scoped packages. |
The linked guide explains what each codemod changes and any limits that apply.
Run a codemod
npx @usephase/codemod@latest <codemod> [--dry] <path>- Start from a clean Git worktree.
- Run with
--dryand read the report. - Run again without
--dry. - Review the diff.
- Run your package manager. Codemods do not edit lockfiles.
Safety
--drywrites nothing.- Discovery and parsing finish before writes begin.
- Each changed file is replaced atomically.
- If a later write fails, the report lists completed files. Rerunning is safe.
Exit codes
| Code | Meaning | | ---- | --------------------------------- | | 0 | Help shown or migration succeeded | | 1 | Read, parse, or write failure | | 2 | Invalid invocation or target |
Requirements
Node.js 22.12.0 or later.
