Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(codemod): add in codemod for size prop updates #8570

Merged
merged 3 commits into from
May 5, 2021

Conversation

tw15egan
Copy link
Member

@tw15egan tw15egan commented May 3, 2021

Closes #8563
Refs #8370

This PR adds in a new codemod to help users convert their old size prop names to the new convention

Screen Shot 2021-05-03 at 3 00 20 PM

Changelog

New

  • size-prop-update.js contains the codemod that will convert the code to the new syntax
  • code-mod-story.js contains a bunch of current components all using the current naming convention.
  • After you run the codemod, you can paste the results into the second story in code-mod-story.js

Changed

  • TableToolbarAction was updated to use the sm class, and marked the old classes for removal in V11

Testing / Reviewing

Pull down the PR, then navigate to the codemods folder. From there, run yarn jscodeshift -d -t ./transforms/size-prop-update.js '../packages/react/src/components/Test/code-mod-story.js'.

After that has run, you will notice a new file in the react package ( packages/react/src/components/Test/output.js that contains the updated code. Paste this code into the associated story in code-mod-story.js that contains a feature flag.

Verify all components are using the new props, and that nothing has changed visually 🎉

(extra code and stories will be removed after approval / before emerging)

@netlify
Copy link

netlify bot commented May 3, 2021

Deploy preview for carbon-elements ready!

Built with commit 0705f8f

https://deploy-preview-8570--carbon-elements.netlify.app

@netlify
Copy link

netlify bot commented May 4, 2021

Deploy preview for carbon-elements ready!

Built with commit 55a938c

https://deploy-preview-8570--carbon-elements.netlify.app

@netlify
Copy link

netlify bot commented May 4, 2021

Deploy preview for carbon-components-react ready!

Built with commit 0705f8f

https://deploy-preview-8570--carbon-components-react.netlify.app

@netlify
Copy link

netlify bot commented May 4, 2021

Deploy preview for carbon-components-react ready!

Built with commit 55a938c

https://deploy-preview-8570--carbon-components-react.netlify.app

@tw15egan tw15egan requested a review from a team as a code owner May 4, 2021 19:16
Copy link
Contributor

@joshblack joshblack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@kodiakhq kodiakhq bot merged commit 6c2c9d8 into carbon-design-system:main May 5, 2021
@tw15egan tw15egan mentioned this pull request May 10, 2021
22 tasks
@tw15egan tw15egan deleted the size-prop-codemod branch March 3, 2022 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create codemod for size changes in v11
3 participants