matheus23 / elm-tailwind-modules

Generate Elm code for Tailwind Utilities and Components that purges using Elm's dead code elimination!
https://matheus23.github.io/elm-tailwind-modules/
117 stars 12 forks source link

Proposal: Communicate used tailwind version #15

Open nidico opened 2 years ago

nidico commented 2 years ago

I wonder if it would make sense to output the used tailwind version to

a) the generated elm files (as a comment) b) the build process output of npx elm-tailwind-modules.

Maybe together with a hash of the used tailwind.config.js file?

My motivation behind the proposal is that I just noticed by accident that I'm still using tailwind v2 on a development machine (tailwindcss is installed manually there at the moment).

nidico commented 2 years ago

While looking at this: Should elm-tailwind-modules version 0.4.0 only be used with tailwindcss version 3.1.6, as ^3.1.6 is listed in devDependencies in package.json (and not with e.g. tailwindcss 3.2.1)?

(I'm a bit confused, as running npm i --save-dev elm-tailwind-modules pulls tailwindcss version 2.2.19, not 3.1.6...)

matheus23 commented 2 years ago

elm-tailwind-modules's devDependencies are purely for when you check out the repository and want to develop with the project. You'll see the actual requirements for users of the package in dependencies and peerDependencies, the latter of which contains the tailwindcss bounds.

matheus23 commented 2 years ago

As for the proposal of communicating the tailwind version, that's a great idea :)

I don't think the tailwind config hash is going to be super meaningful to the user, but maybe just printing back the resolved file name for the config may be helpful.

nidico commented 2 years ago

elm-tailwind-modules's devDependencies are purely for when you check out the repository and want to develop with the project. You'll see the actual requirements for users of the package in dependencies and peerDependencies, the latter of which contains the tailwindcss bounds.

Thanks for the explanation! So does the tailwindcss ^2.0.2 peerDependency mean users shold use tailwindcss 2.0.2 and not e.g. 3.x? Looking at the docs about peerDependencies doesn't really help much. I'm a bit confused, as 0.4.0 added support for tailwindcss v3...

matheus23 commented 2 years ago

I'm getting confused here as well. I guess tailwind version 3.0.0 isn't covered by the version bound ^2.0.2. I guess it should actually be something like ^2.0.2 || ^3.1.6 or so.

nidico commented 2 years ago

I'm getting confused here as well. I guess tailwind version 3.0.0 isn't covered by the version bound ^2.0.2. I guess it should actually be something like ^2.0.2 || ^3.1.6 or so.

Yeah, this would be sufficient until tailwind <4 is released. Old tailwind docs state that tailwind follows semantic versioning, so this should be fine.

matheus23 commented 1 year ago

I think this should be covered now.

nidico commented 1 year ago

I think this should be covered now.

I don't see how... In my case I can't find the string 3.2.4 (the used tailwindcss version) in either of the generated elm files or the output of elm-tailwind-modules, no matter if it's called with --with-docs or not. Did I overlook something?