Skip to content

Conversation

@bjohansebas
Copy link
Member

New codemod migrated to use ast-grep and will be published soon on the codemod.com platform

@bjohansebas bjohansebas marked this pull request as ready for review December 24, 2025 03:32
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically, this code is repeated from the previous codemods, probably could be factored out into a utils package, though I'm wondering how this would behave for codemod registration, being a separate package and not published to npm

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a local npm workspace will be bundled by the codemod cli.

!the ci have to npm I before publish!

@@ -0,0 +1,22 @@
{
"name": "@expressjs/req-param",
"private": true,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, I'm setting this to private so we don't accidentally publish this to npm, but does this affect codemod registration?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

codemod cli don't care about package.json

Copy link

@AugustinMauroy AugustinMauroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay on userland migration we require some test around import idk what do you want but here the list

  • cjs
  • cjs destructred
  • esm dynamic import with const foo = await import and in C.B.
  • esm alias

@@ -0,0 +1,23 @@
schema_version: "1.0"
name: "@expressjs/req-param"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure of the naming because it's too general. So it's may confuse user

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming codemods is just as hard as naming variables, a difficult decision.

I’ll think about other names.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW I use gh copilot for that question and not same too bad. if you want I have gh pro for free as student I can ask.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, i also have github pro for free as a student. i’ll ask them for some good name suggestions.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

explicit-request-params? req-param-migration?

@bjohansebas
Copy link
Member Author

okay on userland migration we require some test around import idk what do you want but here the list

I don’t quite understand what you mean by the imports. We don’t need to modify imports here in the codemods.

@AugustinMauroy
Copy link

okay on userland migration we require some test around import idk what do you want but here the list

I don’t quite understand what you mean by the imports. We don’t need to modify imports here in the codemods.

Oh right, my bad just simple ESM should work 😅

Copy link

@AugustinMauroy AugustinMauroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGMT !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants