Closed danieldelcore closed 3 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 🙂
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
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 :)
No worries @thepassle, LMK if there's anything I can do to help :)
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
hypermod.config.js
file which is essentially just a barrel file :). (We don't need any additional deps)HOW TO USE
(will run the isString codemod)
(will show a prompt)
Absolutely no pressure to accept this PR, just hoping to contribute to this great initiative :)