es-tooling / module-replacements-codemods

MIT License
188 stars 26 forks source link

Consider using @hypermod/cli as a drop-in distribution solution #73

Closed danieldelcore closed 3 months ago

danieldelcore commented 4 months ago

There's is a very barebones CLI implemented, mostly just to have something there, and it's also not published to NPM yet, because the name/home of this project is still TBD.

I think @hypermod/cli could be a good fit for this project😄. It is a drop-in solution for distributing codemods.

Once this package is published to NPM hypermod is able to download and present a list of codemods to the user (see screen capture) which they can then choose from and run.

It is already in use by the following projects if you'd like to compare:

https://github.com/user-attachments/assets/3a6bb26f-6775-4263-b5d0-afe29070aa56

CHANGES

HOW TO USE

npx @hypermod/cli --package-name module-replacements#isString path/to/source

(will run the isString codemod)

npx @hypermod/cli --package-name module-replacements path/to/source

(will show a prompt)

npx @hypermod/cli list --package-name module-replacements 

Absolutely no pressure to accept this PR, just hoping to contribute to this great initiative :)

thepassle commented 4 months ago

Hi, thanks! This looks cool. I know @43081j had some thoughts on how to approach the CLI though, so I'll tag him in here 🙂

43081j commented 4 months ago

the thing we have yet to decide is how far a CLI goes for this project. we should probably figure that out before merging something like this

basically, i feel like this'd be good for a "codemods CLI" - but i think we can go further and have a CLI for the whole of the es-tooling umbrella (i.e. one which can find replacements, offer to auto-fix them, and maybe more). though we may still benefit from a codemods-only CLI for people who don't want the whole package too

ill start the discussion on discord at least and see where we get to

thepassle commented 3 months ago

The scope of this repository has changed a bit, and the CLI will be implemented elsewhere. This repo will just be a home for the codemods, so that other tools can use them and do whatever they wish with them, so if you would like to implement a CLI around the codemods yourself, feel free to do so! I'll close this issue for now :)

danieldelcore commented 3 months ago

No worries @thepassle, LMK if there's anything I can do to help :)