Mokshit06 / typewind

The safety of Typescript with the magic of Tailwind.
https://typewind.dev/
MIT License
2.23k stars 23 forks source link

Codemod: Tailwind -> Typewind #20

Open NicolasLopes7 opened 1 year ago

NicolasLopes7 commented 1 year ago

Create a codemod that converts tailwind classes to typewind.

I still need to figure out the patterns we want to observe and how to make sure it's a class from tailwind. Would love to hear your thoughts here @Mokshit06 @kavinvalli

Mokshit06 commented 1 year ago

Hi! I'm not sure what class patterns to observe in this case, like we can make the codemod work decently well for class/className attributes but it is hard to be sure how reliably we can convert other places. Like if I have a text "This is a container", should it be replaced with "This is a ${tw.container}", or be converted to a template literal.

Do you have any ideas on how we should approach this?

epicbytes commented 1 year ago

Hi, i wrote some similar plugin - prettier-plugin-typewind, and it do this

add link to this https://github.com/epicbytes/prettier-plugin-typewind