-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
[Upgrade-Tool] Refactor the CLI and add codemods commands #19984
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
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.
First review looks good! I'll check it out closer tomorrow.
@@ -79,7 +79,7 @@ export class Upgrader implements UpgraderInterface { | |||
`${this.target.major}.${this.target.minor}.${this.target.patch}` | |||
); | |||
|
|||
this.logger?.debug( | |||
this.logger?.debug?.( |
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.
Is there a reason we don't require a logger everywhere? and/or if we don't want one we create a stub that doesn't actually log anything?
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.
In the future, we might want to programmatically create an upgrader instance that won't log anything (silent).
We could create a stub, but I found it simpler to assume we might not have a logger at all. What do you think?
FYI @Marc-Roig |
…ol/enhance-codemods-command
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 great and works for me 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.
QAed it and it works!
What does it do?
codemods run [uid]
to run codemods (optionally provide a single codemod UID)codemods ls
to get a list of available codemodscodemod-runner
,codemod-repository,
codemod
)Why is it needed?
Allow listing available codemods and running specific ones, especially useful when developing codemods for a version that's not available now.
How to test it?
codemods ls
,codemods run [UID]
) and make sure everything works according to the help description