feat(magic-redirect): migrate magic-redirect to codemod.com#91
feat(magic-redirect): migrate magic-redirect to codemod.com#91bjohansebas merged 10 commits intomainfrom
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
63b5b32 to
ced14f3
Compare
|
Hey @expressjs/codemod-collaborators @AugustinMauroy @alexbit-codemod, I’d love your review here, this would be the first codemod to be released on the platform 🙂 |
|
Hey @bjohansebas! Thank you for using Codemod's JSSG and ast-grep! I just opened a PR to merge to your branch: I refactored the code to use JSSG's semantic analysis tools ( |
* refactor: refactor the express codemod * fix lint Signed-off-by: Sebastian Beltran <bjohansebas@gmail.com> --------- Signed-off-by: Sebastian Beltran <bjohansebas@gmail.com> Co-authored-by: Sebastian Beltran <bjohansebas@gmail.com>
AugustinMauroy
left a comment
There was a problem hiding this comment.
what if there are another method called redirect ? from my comprehension it's will be modified so we need to create a new workflow logic:
catch express import => with that catch all app => catch all usage of the app => read the call back => modify the arg
It's look complex but there are an esay way which is https://docs.codemod.com/jssg/semantic-analysis (on user lad migration we don't use it for now since this api is new)
in overall it's LGTM.
package.json
Outdated
| "node": ">=18" | ||
| } | ||
| }, | ||
| "workspaces": ["./recipes/*"] |
There was a problem hiding this comment.
use codemod dir recipes was a mistake from userland migration
i think this would go further than necessary and would be fairly extreme cases, I’d prefer to keep it simple as it is right now. What do you think? |
I didn't have strong opinions but start by that and then update if there are report |
|
Since it's end of year and many of us are on vacation, and I'm unsure if they're available to approve the release, I'll merge this to main, but we won't do the release yet (i.e., create the tag that'll deploy to the platform) as it needs another person's approval. Hopefully, the second week of January or sooner if possible, we can do the release when the team is back, along with the other codemods. |
I’ve just migrated the codemod to use ast-grep, which is what Codemod uses under the hood. I copied the tests from the old CLI and added more tests to ensure it works correctly.
I didn’t remove the files from the old codemod that uses jscodeshift so this PR is easier to review. In the future, once we’ve completed all the migrations, we can remove the old CLI in a single PR