@danske/sapphire-react-codemods
v1.1.1
Published
Codemods for migrating breaking changes of @sapphire-react packages
Downloads
11
Readme
@danske/sapphire-react-codemods
Codemods for migrating breaking changes of @sapphire-react/ packages.
How to use
Some updates in Sapphire react packages that contain breaking changes will be shipped with a jscodeshift transform.
- Make sure git status is clean, to be able to easily revert changes if anything goes wrong.
- Apply the changes, by running the transform. Example:
npx @danske/sapphire-react-codemods <transform-name> <your-src-directory><transform-name>: typically in form of x.0.0, for each major version.<your-src-directory>: directory (relative to where you are running the command) to apply the transform on
By default @danske/sapphire-react-codemods will run prettier after running transformers, if prettier is installed.
You can disable that by passing --skip-prettier.
npx @danske/sapphire-react-codemods <transform-name> <your-src-directory> --skip-prettierYou can also pass additional jscodeshift options if needed:
# Dry running transforms. Useful for checking how many files would be changed and if it succeeds.
npx @danske/sapphire-react-codemods <transform-name> <your-src-directory> --dry