-
Notifications
You must be signed in to change notification settings - Fork 186
feat: fall back to locally-installed tailwindcss executables #226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
9474737
to
e5c406c
Compare
@TheNeikos do you want to give this branch a try and let me know if it works for you? Here's how you can try it out:
|
Sadly it still does not work :c This is because you are explicitly checking for wrapper scripts and ignore them? I don't think that is necessary, since users can decide themselves how they want their executables to be called. In my case for example, and quite usual for NixOS, |
Can you help me understand what "does not work" looks like for you? Can you give me more information about how it doesn't work? I chose to ignore wrapper scripts because Rubygems will install a |
Maybe I'm overthinking this, would a suitable alternative be to set an environment variable to the path of your "real" tailwindcss installation? Something like this in your .envrc for example:
Would that solve your use case? |
Sorry I didn't go into more detail. But basically, same behaviour as before. It just tells me that I need to have it installed (since it is just a wrapper script I have in my PATH, I assume that whatever it does find, it just skips it). My first question would be, why does the rubygems shim have the same name? Could it be removed/renamed?
That would 100% solve it! I can easily set things like that. |
For the same reason that Nix's shim has the same name?
OK, I'll overhaul this PR with that approach. |
Haha, fair enough! I just wouldn't expect a rubygem to install an executable with the same name as the one it tries to catch only to say that it is not installed! In the NixOS case its to make sure tailwind can find all the plugins it needs and is more of a redirect to the actual executable. |
Another Nix user here: this is the main blocker for me moving my app's build process entirely under Nix, is there anything I can do to help move it along? |
I just ended up creating a new PR (#259) with the environment variable override approach |
fwiw, it's also a problem for people running on "unsupported" platform (freebsd etc). I just override the whole function for now. Actual tailwindcss can be installed no problem on platforms with node using npm/yarn. # config/initializers/00tailwind_freebsd.rb
module Tailwindcss
module Commands
def self.executable(*)
File.expand_path(File.join(__dir__, "..", "..", "node_modules", ".bin", "tailwindcss"))
end
end
end |
e5c406c
to
30bf340
Compare
I've updated this branch with an environment-variable-setting approach. |
05c32bb
to
fa95991
Compare
this will work for both the vanilla "ruby" platform as well as override the behavior of the native platform gem.
fa95991
to
56bdb1f
Compare
If a user has installed the
ruby
platform gem, but has thetailwindcss
executable installed in their path, then we should fall back to that.Closes #224