@commercetools-frontend/codemod

22.35.1 • Public • Published

@commercetools-frontend/codemod

Latest release (latest dist-tag) Latest release (next dist-tag) Minified + GZipped size GitHub license

Codemod transformations for Custom Applications.

Usage

$ 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 run prettier on the staged files. Therefore, you don't need to run it manually.

Transforms

remove-deprecated-modal-level-props

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-to-jsx

Rename .js files using React JSX syntax to .jsx.

$ npx @commercetools-frontend/codemod@latest rename-js-to-jsx 'src/**/*.js'

rename-mod-css-to-module-css

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}'

redesign-cleanup

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}'

Package Sidebar

Install

npm i @commercetools-frontend/codemod

Weekly Downloads

205

Version

22.35.1

License

MIT

Unpacked Size

30.5 kB

Total Files

12

Last publish

Collaborators

  • tdeekens
  • emmenko
  • commercetools-admin