Probably wrong custom classes after added to project
Hi,
We recently added this extension to our Phoenix project. So far 2 developers had problems with the formatter. It generated different changes which were later blocked in CI/CD as wrong. We found out that when these developers pulled new changes, they had to do the same as you suggest to do for CI/CD.
❯ mix tailwind default
❯ mix deps.compile tailwind_formatter --force
==> tailwind_formatter
Compiling 5 files (.ex)
Loading in .../_build/classes.txt.
Loading in .../_build/variants.txt.
Generated tailwind_formatter app
So it looks to me like we didn't have proper txt files when we first compiled this dep. I think you plan to fix this with the Tailwind 4.0 update, but it would be nice to mention it until it is fixed. Or do you have any suggestions please? Thanks for this project, by the way.
You might have missed this in the README.md:
https://github.com/100phlecs/tailwind_formatter#usage-in-ci
No, I saw it, point is that same issue happen on developer's machines.
My bad, I misread your comment.
I experienced the same. Adding this to the mix.exs aliases helped in my case:
defp aliases do
[
# ...
format: [
"tailwind.install --if-missing",
"tailwind default",
"deps.compile --force tailwind_formatter",
"format"
]
]
end
thanks but it's not good idea for bigger project because it will do too much work when mix format is executed. Thinking making own alias and use it in just some "pre commit" checks. Thanks for suggestion. Do you think will it be fixed in newer version like you mentioned in some other issue?
I sure hope so. I'm looking forward to what #60 can offer to help with this regard.