classix icon indicating copy to clipboard operation
classix copied to clipboard

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

Open charkour opened this issue 2 years ago • 6 comments

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!

charkour avatar Sep 09 '22 14:09 charkour

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?

alexnault avatar Sep 10 '22 15:09 alexnault

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!

charkour avatar Sep 11 '22 02:09 charkour

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

alexnault avatar Sep 14 '22 01:09 alexnault

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

alexnault avatar Sep 14 '22 17:09 alexnault

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

charkour avatar Sep 14 '22 17:09 charkour

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.

charkour avatar Sep 17 '22 19:09 charkour