-
Notifications
You must be signed in to change notification settings - Fork 14
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(PPDSC-2163): codemods for enums #331
Conversation
You can preview these changes on: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you will need to update readme and cli file as well
lib/codemod/src/transforms/__tests__/enums-to-union/enums-to-union.test.js
Outdated
Show resolved
Hide resolved
There are three enums that I didn't include in the codemod script:
Maybe it's OK to leave them as enums for now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very good, did you check how it works on our docs site and other projects like virgin radio?
Good idea. Let me test it. |
The enum to union script works well with Newskit components but not renamed components like CustomStack:
Have fixed this by removing the componentName. Don't think it's needed in this case |
* feat(PPDSC-2163): codemods for enums * fix(PPDSC-2163): address reviews * fix(PPDSC-2163): ignore eslintcache * fix(PPDSC-2163): remove then ignore * fix(PPDSC-2163): remove eslint change * fix(PPDSC-2163): add more comps * fix(PPDSC-2163): add iconButton and allow renaming * fix(PPDSC-2163): lint * fix(PPDSC-2163): address reviews
PPDSC-2163
Write a codemod transform script to find out the components that are using Enums and replace it with union types. Make sure all the tests are passing. No visual changes.
Context: PPDSC-1872: Remove TextFieldSize and replace with a union type
I have done:
I have tested manually:
Before:
After:
Who should review this PR:
How to test: