alexnault / classix

🏛️ The fastest and tiniest utility for conditionally joining classNames.
https://www.npmjs.com/package/classix
MIT License
196 stars 4 forks source link

Codemod to convert from `clsx` or `classnames` to `classix` #31

Open charkour opened 2 years ago

charkour commented 2 years ago

First, thank you for creating and maintaining this package! It is great.

For devs currently utilizing clsx or classnames, do you have a suggested way to move from those to classix? Perhaps we could create a codemod to do that for devs looking to migrate. I looked through the readme and discussions and was not able to find best practices to make the switch.

Thanks!

alexnault commented 2 years ago

Hey @charkour! Thanks a lot!

I think it's a good idea. I'll add a "Moving to classix" section in the readme.

I don't have experience with writing codemods though. I could look into it but maybe someone with more experience would want to jump in?

charkour commented 2 years ago

Thanks for the follow up! I think adding a readme section would be great.

A code mod would be a nice to have request. I haven't any experience writing either. I won't commit to it now, but will let you know if I start working on it.

Thanks!

alexnault commented 2 years ago

@charkour I've created this PR for the migration instructions. Let me know what you think!

alexnault commented 2 years ago

I'm leaving the issue open for a potential codemod :)

charkour commented 2 years ago

Roger, thanks! I'm not planning on making it, but will let you know if I do! Would be awesome to have.

charkour commented 2 years ago

I spent some time working on a simple codemod. Not sure if/when I'll finish it, but wanted to link it here just in case people would like to help!

Using ASTexplorer.net to build the code mod.