-
Notifications
You must be signed in to change notification settings - Fork 1.2k
chore: Refactor codemods #8056
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
base: main
Are you sure you want to change the base?
chore: Refactor codemods #8056
Conversation
] | ||
}, | ||
ActionGroup: { | ||
changes: [ |
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.
just checking, but the declarative approach is going away?
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.
Yep, I think there were just too many steps to remember to do when adding a codemod. Also with more single component-specific codemods getting added it made less sense.
packages/dev/codemods/src/s1-to-s2/src/codemods/components/ActionGroup/transform.ts
Show resolved
Hide resolved
* - Change variant="cta" to variant="accent" | ||
* - Change variant="overBackground" to variant="primary" staticColor="white" | ||
* - Change style to fillStyle | ||
* - Comment out isPending (it has not been implemented yet) |
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.
we should fix this one https://react-spectrum.adobe.com/s2/index.html?path=/docs/button--docs not in this PR, just tasks we follow up with
Or, I guess it's just deleting the line?
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.
I can clean this up in a follow-up, and double check that others are updated as well.
This will make it easier to add and maintain S1 to S2 codemods in the future.
Codemods are now split up by component in
src/codemods/components/
.So to add a Button codemod:
src/codemods/components/Button/transform.ts
if it doesn't existremoveProp
)__tests__/button.test.ts
✅ Pull Request Checklist:
📝 Test Instructions:
Unit tests should validate that all the transforms are still correctly applied, but it would be good to build and test that it still works end-to-end:
cd packages/dev/codemods && yarn build
Change directories to an example app
node ../../packages/dev/codemods/dist/index.js s1-to-s2
🧢 Your Project: