Codemod transformations for Custom Applications.
$ npx @commercetools-frontend/codemod@latest <transform> <glob_pattern>
We recommend to run prettier
on the modified files to preserve the formatting configured on your project. For example, you can run prettier --write $(git diff --name-only)
.
If you are using
lint-staged
there is a high chance that you already runprettier
on the staged files. Therefore, you don't need to run it manually.
Remove deprecated level
and baseZIndex
props from modal page components.
$ npx @commercetools-frontend/codemod@latest remove-deprecated-modal-level-props 'src/**/*.{js,jsx,ts,tsx}'
Rename .js
files using React JSX syntax to .jsx
.
$ npx @commercetools-frontend/codemod@latest rename-js-to-jsx 'src/**/*.js'
Rename .mod.css
files to .module.css
and update imports.
$ npx @commercetools-frontend/codemod@latest rename-mod-css-to-module-css 'src/**/*.{js,jsx,ts,tsx}'
Remove code related to the old design when using the useTheme
hook, for example the usage of themedValue
.
$ npx @commercetools-frontend/codemod@latest redesign-cleanup 'src/**/*.{jsx,tsx}'