classcat icon indicating copy to clipboard operation
classcat copied to clipboard

codemod?

Open VinSpee opened this issue 8 years ago • 7 comments

I started tinkering with a codemod to replace JedWatson/classNames with classwrap re: this comment.

JSCodeShift hurts my head.

progress so far: http://astexplorer.net/#/gist/0373f05229963c3e336b5eec91818479/3718f610fc2e9982a934da242a35104be0947312

may there be weeping and gnashing of teeth.

VinSpee avatar Sep 26 '17 15:09 VinSpee

@VinSpee That would be awesome to have, we could put it on the README to instruct users how to migrate from classNames to classwrap.

jorgebucaran avatar Sep 26 '17 16:09 jorgebucaran

BTW I edited your post to clarify it. Make sure that's what you meant though. It took me more than a moment to understand what you were after. 👋😄

jorgebucaran avatar Sep 26 '17 16:09 jorgebucaran

Just wanted to pop in and say THANK YOU for creating this library @jorgebucaran . I spent far too many hours trying to get classnames play nicely with TS and TS-Jest. I replaced classnames with this library and 15 minutes later I am up and running. Thanks again!

zachariahtimothy avatar Mar 06 '18 18:03 zachariahtimothy

I did look for the "buy me a beer" button on the home page :)

zachariahtimothy avatar Mar 06 '18 18:03 zachariahtimothy

@zachariahtimothy There isn't one, but you can ⭐️ the repo to show your appreciation! 😉🍻

jorgebucaran avatar Mar 06 '18 18:03 jorgebucaran

I've been using this library for quite sometime, and I've always wanted to learn codeshift and make this happen:

https://gist.github.com/reywright/e17ada1c068c972d410774b957ada75c https://astexplorer.net/#/gist/101109ef50bd59758e55975fb9aa31b6/769082c5c84f50844c7b0bf85a3a6e9f3692ed83

This is a very naive conversion that assumes you don't need recursive flattening, and that you're only using a single object for conditionals. Just started learning codeshift but let me know what you think, and happy to try to make modifications to this. If one of the maintainers gives me some help and guidelines, it would be sweet to become a contributor on this and close this last issue.

cc @jorgebucaran

silouanwright avatar May 27 '20 21:05 silouanwright

@reywright Looks very promising Rey! Nice work.

jorgebucaran avatar Jun 03 '20 13:06 jorgebucaran