JSPM

instantsearch-codemods

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 9
  • Score
    100M100P100Q51370F
  • License MIT

Codemods for Algolia InstantSearch libraries

Package Exports

  • instantsearch-codemods
  • instantsearch-codemods/dist/codeshift.config.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (instantsearch-codemods) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Table of Contents generated with DocToc

Codemods

These codemods (code transformers) can be ran with jscodeshift.

rish-to-ris

This will replace all imports from react-instantsearch-hooks to their react-instantsearch equivalent.

npx @codeshift/cli --packages 'instantsearch-codemods#rish-to-ris' <path>

ris-v6-to-v7

This will:

  • Replace react-instantsearch-dom imports to react-instantsearch
  • Replace prop names to their new equivalent
  • Replace translations keys to their new equivalent if they are defined inline, otherwise it will add a TODO comment
  • Add some TODO comments to help you migrate
npx @codeshift/cli --packages 'instantsearch-codemods#ris-v6-to-v7' <path>

Notes

If you are using Prettier or ESLint, make sure to run its autofixing after this transformation, since code can be formatted differently after it has been transformed. For example, in our repository, the Prettier command would be:

yarn prettier --write '{examples,stories,.storybook}/**/*.{js,jsx,ts,tsx}'