Skip to content
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

fix: Use Tailwindcss::Ruby executable #1387

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ PATH
rails (>= 6.0)
sprockets-rails
stimulus-rails (>= 0.7.0)
tailwindcss-rails (>= 2.0.0)
tailwindcss-ruby
turbo-rails (>= 0.9, < 3.0)
view_component (>= 2.32, < 4.0)

Expand Down Expand Up @@ -297,8 +297,7 @@ GEM
stimulus-rails (1.3.3)
railties (>= 6.0.0)
stringio (3.1.0)
tailwindcss-rails (2.2.1)
railties (>= 6.0.0)
tailwindcss-ruby (3.4.14)
thor (1.3.0)
timeout (0.4.1)
turbo-rails (2.0.1)
Expand Down
16 changes: 12 additions & 4 deletions lib/tasks/tailwind.rake
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
require "tailwindcss-rails"
require "tailwindcss/ruby"

namespace :spina do
namespace :tailwind do
def spina_tailwind_compile_command
"#{Tailwindcss::Engine.root.join("exe/tailwindcss")} -i #{Spina::Engine.root.join("app/assets/stylesheets/spina/application.tailwind.css")} -o #{Rails.root.join("app/assets/builds", "spina/tailwind.css")} -c #{Rails.root.join("app/assets/config/spina/tailwind.config.js")}"
[
Tailwindcss::Ruby.executable,
"-i", Spina::Engine.root.join("app/assets/stylesheets/spina/application.tailwind.css").to_s,
"-o", Rails.root.join("app/assets/builds/spina/tailwind.css").to_s,
"-c", Rails.root.join("app/assets/config/spina/tailwind.config.js").to_s,
]
end

desc "Build your Tailwind CSS"
task build: :environment do
Rails::Generators.invoke("spina:tailwind_config", ["--force"])
system spina_tailwind_compile_command
command = spina_tailwind_compile_command
system *command
end

task watch: :environment do
Rails::Generators.invoke("spina:tailwind_config", ["--force"])
system "#{spina_tailwind_compile_command} -w"
command = spina_tailwind_compile_command
command << "-w"
system *command
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spina.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ Gem::Specification.new do |gem|
gem.add_dependency "babosa"
gem.add_dependency "jsonapi-serializer"
gem.add_dependency "browser"
gem.add_dependency "tailwindcss-rails", ">= 2.0.0"
gem.add_dependency "tailwindcss-ruby"
end
Loading