Skip to content
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

Invite to port to official nodejs/userland-migrations #2

Open
JakobJingleheimer opened this issue Jan 11, 2025 · 5 comments
Open

Invite to port to official nodejs/userland-migrations #2

JakobJingleheimer opened this issue Jan 11, 2025 · 5 comments

Comments

@JakobJingleheimer
Copy link

Hiya @nicojs!

I'm the lead for node's userland-migrations team (https://github.com/nodejs/userland-migrations) where we publish exactly this sort of thing. Would you like to port this there? It would then be listed in the official registry, and we can help with getting it in users hands 🙂 You would of course retain full authorship (you'll be listed as the author, etc in the registry).

I see you have a use-case in your list to potentially support: We've got specifier correction covered (correct-ts-specifiers).

@nicojs
Copy link
Owner

nicojs commented Jan 11, 2025

That sounds interesting! Would I be able to use the TypeScript compiler API? Are there any other restrictions I should know about?

Can I still keep this package and make it run codemod underneath?

@JakobJingleheimer
Copy link
Author

JakobJingleheimer commented Jan 11, 2025

That sounds interesting! Would I be able to use the TypeScript compiler API?

Sure 🙂

Are there any other restrictions I should know about?

The main thing I can think of is around code quality: it has to have unit and end-to-end tests. CI may require node's test runner for those, I'd have to look (happy to help port if needed). And I suppose we would frown upon a dubious dependency.

Can I still keep this package and make it run codemod underneath?

You could separate the codemod layer, sure. I would suggest that regardless. That's what I did for correct-ts-specifiers 🙂

@nicojs
Copy link
Owner

nicojs commented Jan 11, 2025

Could I keep the migrations' brains in this package here and use them from the package in your repo? I see that correct-ts-specifiers depends on @codemod.com/workflow, which has a lot of maintenance overhead (it has many dependencies). I want to keep the core clean of dependencies.

Or I could add 2 packages there, 1 for the brains and 1 for the codemod integration.

@JakobJingleheimer
Copy link
Author

Could I keep the migrations' brains in this package here and use them from the package in your repo?

No, definitely not. We would be certifying to the ecosystem that the migration is trusted. We cannot do that when it can be changed without re-certification.

You can also publish it to the registry as an unofficial and untrusted migration.

correct-ts-specifiers depends on @codemod.com/workflow, which has a lot of maintenance overhead (it has many dependencies).

You don't have to use workflow (and in fact, they are refactoring it); they do encourage use of astGrep, which is basically the only thing correct-ts-specifiers is using anyway. They also have several other utilities, but you don't have to use those either. It just needs to be runnable via the codemod bin. But those utils will probably help you a lot with what you're doing.

I want to keep the core clean of dependencies.

I definitely understand and encourage that 🙂

Or I could add 2 packages there, 1 for the brains and 1 for the codemod integration.

I'm not sure what this means / entails.

@nicojs
Copy link
Owner

nicojs commented Jan 11, 2025

Thanks for the answers to my questions. I think my lack of codemod experience is hindering my understanding a bit. I've opened nodejs/userland-migrations#21 to discuss this further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants