-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
T dama/CodeMods - Add generic config-based codemod generator #14496
T dama/CodeMods - Add generic config-based codemod generator #14496
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit abde9f2:
|
Perf AnalysisNo significant results to display. All results
Perf Analysis (Fluent)Perf comparison
Perf tests with no regressions
|
Asset size changesUnable to find bundle size details for Baseline commit: a121562 Possible causes
Recommendations
|
🎉 Handy links: |
…ft#14496) * merge conflicts * merge conflicts * merge conflicts * merge conflicts * fix prop helper * merge conflicts * WIP improve logging * merge conflicts * merge conflicts * merge conflicts * merge conflicts * WIP polishing * remove logging * add generic config mod * Change files * fix test * add snapshot testing * add snapshot * improve logging * new snaps * fix tests Co-authored-by: Trip Master <[email protected]>
-Added configMod.ts, which can read a codemod from a json file and return it. Take a look at upgrades.json for a sample upgrade file! Added simple testing for it too, which sets a nice precedent for testing actual codemods w/ jest and not just utilities
-Hopefully this middle ground between mod and json can also be leveraged / generalized further to add more flexibility at a high level for developers.
-TODO: Add support for more codemods -- adding support for new ones shouldn't be too tricky -- a dev just needs to set a standard for what upgrades.json should look like, and then parse that into a series of functions that can be stored. Check out getCodeModUtilitiesFromJson for more deets.