Closed elycheea closed 1 month ago
Next refinement, we can review the list of current codemods and document some of the codemods that could be helpful to test. For example, updating props versus updating imports (which could be useful for deprecation + replace scenarios).
@elycheea I've tested all the Codemod Transforms mentioned above, as well as the sort-prop-types
transformer.
npx @carbon/upgrade migrate update-carbon-icons-react-import-to-carbon-react --write
https://github.com/user-attachments/assets/867b5c2c-3d41-4ebf-9db7-ff4d05a86c3e
npx @carbon/upgrade migrate size-prop-update --write
https://github.com/user-attachments/assets/bff0a516-0edb-4a32-a072-9f446df61888
npx @carbon/upgrade migrate small-to-size-prop --write
https://github.com/user-attachments/assets/2c3022ce-ba68-418f-a189-8dc611620f79
The small-to-size-prop
transformer not taking the <ButtonSkelton />
component.
npx jscodeshift -t node_modules/@carbon/upgrade/transforms/sort-prop-types.js src/UnsortedPropExample/UnsortedPropExample.jsx
https://github.com/user-attachments/assets/abf63036-5756-43af-9a78-9afdd8b41c38
For the above giving an interface to use transforms like npx @carbon/upgrade migrate <transformName>
might be more helpful than executing with the jscodeshift
. For eg: npx @carbon/upgrade transform <transformName>
In addition, implementing a few Codemods like those below would improve our workflow:
Great work @makafsal, looks like the work for this is complete 🎉
Codemods to test should include