From 744826a130e23ac7aa4c1f405532805ef1ce7c8c Mon Sep 17 00:00:00 2001 From: Mike Vormwald Date: Sun, 16 Aug 2026 06:14:26 -0400 Subject: [PATCH 1/6] test: add end-to-end integration spec with the real tailwind CLI Add the first non-mocked test: it builds a fixture Jekyll site through Jekyll::Site with the real tailwindcss-ruby executable and asserts the generated CSS contains compiled utilities. Runs in under a second, so it stays in the default rspec run. Co-Authored-By: Claude --- spec/fixtures/site/_config.yml | 1 + spec/fixtures/site/_layouts/default.html | 10 ++++++ spec/fixtures/site/_tailwind.css | 1 + .../site/assets/css/styles.tailwindcss | 3 ++ spec/fixtures/site/index.md | 6 ++++ spec/integration/build_spec.rb | 35 +++++++++++++++++++ 6 files changed, 56 insertions(+) create mode 100644 spec/fixtures/site/_config.yml create mode 100644 spec/fixtures/site/_layouts/default.html create mode 100644 spec/fixtures/site/_tailwind.css create mode 100644 spec/fixtures/site/assets/css/styles.tailwindcss create mode 100644 spec/fixtures/site/index.md create mode 100644 spec/integration/build_spec.rb diff --git a/spec/fixtures/site/_config.yml b/spec/fixtures/site/_config.yml new file mode 100644 index 0000000..f0f30b4 --- /dev/null +++ b/spec/fixtures/site/_config.yml @@ -0,0 +1 @@ +title: Integration Spec Fixture Site diff --git a/spec/fixtures/site/_layouts/default.html b/spec/fixtures/site/_layouts/default.html new file mode 100644 index 0000000..5e319e3 --- /dev/null +++ b/spec/fixtures/site/_layouts/default.html @@ -0,0 +1,10 @@ + + + + + + +

{{ page.title }}

+ {{ content }} + + diff --git a/spec/fixtures/site/_tailwind.css b/spec/fixtures/site/_tailwind.css new file mode 100644 index 0000000..f1d8c73 --- /dev/null +++ b/spec/fixtures/site/_tailwind.css @@ -0,0 +1 @@ +@import "tailwindcss"; diff --git a/spec/fixtures/site/assets/css/styles.tailwindcss b/spec/fixtures/site/assets/css/styles.tailwindcss new file mode 100644 index 0000000..8fb6cc2 --- /dev/null +++ b/spec/fixtures/site/assets/css/styles.tailwindcss @@ -0,0 +1,3 @@ +--- +--- +This file is just a placeholder. Its content will be replaced by output from the tailwindcss CLI. diff --git a/spec/fixtures/site/index.md b/spec/fixtures/site/index.md new file mode 100644 index 0000000..3134cd9 --- /dev/null +++ b/spec/fixtures/site/index.md @@ -0,0 +1,6 @@ +--- +layout: default +title: Home +--- + +Hello from the integration spec fixture site. diff --git a/spec/integration/build_spec.rb b/spec/integration/build_spec.rb new file mode 100644 index 0000000..4a093a1 --- /dev/null +++ b/spec/integration/build_spec.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +require "spec_helper" +require "jekyll" +require "tmpdir" +require "fileutils" + +RSpec.describe "building a Jekyll site with the real tailwindcss CLI" do + let(:fixture_source) { File.expand_path("../fixtures/site", __dir__) } + + it "generates real tailwind-compiled CSS into _site" do + Dir.mktmpdir do |destination| + # The plugin resolves the tailwind css config path (default "./_tailwind.css") + # relative to the process working directory rather than the site source, + # so the fixture site must be the cwd for the build to find it. + Dir.chdir(fixture_source) do + config = Jekyll.configuration( + "source" => fixture_source, + "destination" => destination, + "quiet" => true + ) + site = Jekyll::Site.new(config) + site.process + end + + generated_css_path = File.join(destination, "assets", "css", "styles.css") + + expect(File).to exist(generated_css_path) + + generated_css = File.read(generated_css_path) + expect(generated_css).not_to be_empty + expect(generated_css).to match(/text-center/) + end + end +end From 679ef7fb9b478cd8e74f3e45565b07b96ca583d0 Mon Sep 17 00:00:00 2001 From: Mike Vormwald Date: Sun, 16 Aug 2026 06:29:15 -0400 Subject: [PATCH 2/6] style: fix standardrb Style/EmptyStringInsideInterpolation offenses Co-Authored-By: Claude --- lib/jekyll/converters/css.rb | 2 +- lib/jekyll/converters/tailwindcss.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/converters/css.rb b/lib/jekyll/converters/css.rb index 9a9b456..43cdc40 100644 --- a/lib/jekyll/converters/css.rb +++ b/lib/jekyll/converters/css.rb @@ -23,7 +23,7 @@ def convert(content) end dev_mode = Jekyll.env == "development" - Jekyll.logger.info "Jekyll Tailwind:", "Generating #{dev_mode ? "" : "minified "}CSS" + Jekyll.logger.info "Jekyll Tailwind:", "Generating #{"minified " unless dev_mode}CSS" compile_command = ::Tailwindcss::Commands .compile_command(debug: dev_mode, config_path: config_path, postcss_path: postcss_path) diff --git a/lib/jekyll/converters/tailwindcss.rb b/lib/jekyll/converters/tailwindcss.rb index e6054ba..8ec332e 100644 --- a/lib/jekyll/converters/tailwindcss.rb +++ b/lib/jekyll/converters/tailwindcss.rb @@ -23,7 +23,7 @@ def convert(content) end dev_mode = Jekyll.env == "development" - Jekyll.logger.info "Jekyll Tailwind:", "Generating #{dev_mode ? "" : "minified "}CSS" + Jekyll.logger.info "Jekyll Tailwind:", "Generating #{"minified " unless dev_mode}CSS" compile_command = ::Tailwindcss::Commands .compile_command(debug: dev_mode) From 4b1000cdd4544887e430b8458ec400fdac6e2bf4 Mon Sep 17 00:00:00 2001 From: Mike Vormwald Date: Sat, 22 Aug 2026 12:29:46 -0400 Subject: [PATCH 3/6] Apply suggestions from code review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- lib/jekyll/converters/css.rb | 2 +- lib/jekyll/converters/tailwindcss.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/converters/css.rb b/lib/jekyll/converters/css.rb index 43cdc40..9a9b456 100644 --- a/lib/jekyll/converters/css.rb +++ b/lib/jekyll/converters/css.rb @@ -23,7 +23,7 @@ def convert(content) end dev_mode = Jekyll.env == "development" - Jekyll.logger.info "Jekyll Tailwind:", "Generating #{"minified " unless dev_mode}CSS" + Jekyll.logger.info "Jekyll Tailwind:", "Generating #{dev_mode ? "" : "minified "}CSS" compile_command = ::Tailwindcss::Commands .compile_command(debug: dev_mode, config_path: config_path, postcss_path: postcss_path) diff --git a/lib/jekyll/converters/tailwindcss.rb b/lib/jekyll/converters/tailwindcss.rb index 8ec332e..e6054ba 100644 --- a/lib/jekyll/converters/tailwindcss.rb +++ b/lib/jekyll/converters/tailwindcss.rb @@ -23,7 +23,7 @@ def convert(content) end dev_mode = Jekyll.env == "development" - Jekyll.logger.info "Jekyll Tailwind:", "Generating #{"minified " unless dev_mode}CSS" + Jekyll.logger.info "Jekyll Tailwind:", "Generating #{dev_mode ? "" : "minified "}CSS" compile_command = ::Tailwindcss::Commands .compile_command(debug: dev_mode) From 0ff7a70fbcff285f2b8df602c51638677fa376d9 Mon Sep 17 00:00:00 2001 From: Mike Vormwald Date: Sat, 22 Aug 2026 12:52:44 -0400 Subject: [PATCH 4/6] test: keep the integration build out of the fixture directory Jekyll writes its disk cache under the site source, so building the fixture in place left spec/fixtures/site/.jekyll-cache behind after every run. It never showed up in git status because Jekyll drops a self-ignoring .gitignore inside the cache, but a stale cache could still affect later runs. Copy the fixture into the tmpdir and build from there so the spec cleans up everything it creates. Redirecting cache_dir instead does not work: Jekyll resolves it through in_source_dir, so an absolute path is re-rooted under the source. Also add the logger gem for Ruby 3.5+ compatibility and lock the arm64-darwin platform so the tailwindcss-ruby binary resolves on Apple Silicon. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_015kxK16Xgi7P4GeUfkmQNxr --- Gemfile | 1 + Gemfile.lock | 16 ++++++++++------ spec/integration/build_spec.rb | 15 +++++++++++---- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/Gemfile b/Gemfile index 89c6b01..73b1726 100644 --- a/Gemfile +++ b/Gemfile @@ -12,6 +12,7 @@ gem "standard", "~> 1.3" # needed as a jekyll dependency since ruby 3.4 removed them gem "csv" +gem "logger" gem "base64" group :development, :test do diff --git a/Gemfile.lock b/Gemfile.lock index 490a6d4..fdff9af 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -21,13 +21,11 @@ GEM eventmachine (>= 0.12.9) http_parser.rb (~> 0) eventmachine (1.2.7) - ffi (1.17.1) - ffi (1.17.1-x86_64-linux-gnu) + ffi (1.17.4) + ffi (1.17.4-arm64-darwin) + ffi (1.17.4-x86_64-linux-gnu) forwardable-extended (2.6.0) - google-protobuf (4.29.3) - bigdecimal - rake (>= 13) - google-protobuf (4.29.3-x86_64-linux) + google-protobuf (4.33.6) bigdecimal rake (>= 13) http_parser.rb (0.8.0) @@ -72,6 +70,7 @@ GEM listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) + logger (1.7.0) mercenary (0.4.0) parallel (1.26.3) parser (3.3.7.1) @@ -132,6 +131,8 @@ GEM sass-embedded (1.83.4) google-protobuf (~> 4.29) rake (>= 13) + sass-embedded (1.83.4-arm64-darwin) + google-protobuf (~> 4.29) sass-embedded (1.83.4-x86_64-linux-gnu) google-protobuf (~> 4.29) standard (1.44.0) @@ -148,6 +149,7 @@ GEM rubocop-performance (~> 1.23.0) stringio (3.1.2) tailwindcss-ruby (4.0.6) + tailwindcss-ruby (4.0.6-arm64-darwin) tailwindcss-ruby (4.0.6-x86_64-linux-gnu) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) @@ -155,6 +157,7 @@ GEM webrick (1.9.1) PLATFORMS + arm64-darwin ruby x86_64-linux @@ -164,6 +167,7 @@ DEPENDENCIES irb (~> 1.14) jekyll (~> 4.3) jekyll-tailwindcss! + logger rake (~> 13.0) rspec (~> 3.0) standard (~> 1.3) diff --git a/spec/integration/build_spec.rb b/spec/integration/build_spec.rb index 4a093a1..507c3ae 100644 --- a/spec/integration/build_spec.rb +++ b/spec/integration/build_spec.rb @@ -9,13 +9,20 @@ let(:fixture_source) { File.expand_path("../fixtures/site", __dir__) } it "generates real tailwind-compiled CSS into _site" do - Dir.mktmpdir do |destination| + Dir.mktmpdir do |tmp| + # Build from a throwaway copy of the fixture: Jekyll writes its disk cache + # (.jekyll-cache) under the site source, so building in place would leave + # artifacts behind in the repository. + source = File.join(tmp, "site") + destination = File.join(tmp, "_site") + FileUtils.cp_r(fixture_source, source) + # The plugin resolves the tailwind css config path (default "./_tailwind.css") # relative to the process working directory rather than the site source, - # so the fixture site must be the cwd for the build to find it. - Dir.chdir(fixture_source) do + # so the site being built must be the cwd for the build to find it. + Dir.chdir(source) do config = Jekyll.configuration( - "source" => fixture_source, + "source" => source, "destination" => destination, "quiet" => true ) From df1a207f7c68b61bfe4ae80f6acf87bdf9c22d65 Mon Sep 17 00:00:00 2001 From: Mike Vormwald Date: Sat, 22 Aug 2026 15:07:57 -0400 Subject: [PATCH 5/6] fix: restore the ruby 3.1 compatible lockfile The merge from main resolved Gemfile.lock in favor of this branch's copy, which had picked up sass-embedded 1.83.4 when I re-resolved to add the arm64-darwin platform. That version requires ruby >= 3.2 and so violates the "sass-embedded < 1.77.1" pin, breaking bundle install on the ruby 3.1 CI job. Take the lockfile from edfb22d (where the pins were resolved) and re-add only the arm64-darwin platform on top. Also drop the duplicate gem "logger" the merge left behind. Every locked gem version is installable on ruby 3.1.7. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_015kxK16Xgi7P4GeUfkmQNxr --- Gemfile | 1 - Gemfile.lock | 26 ++++++++++++++++---------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/Gemfile b/Gemfile index 57540af..f79aa9a 100644 --- a/Gemfile +++ b/Gemfile @@ -14,7 +14,6 @@ gem "standard", "~> 1.3" gem "csv" gem "logger" gem "base64" -gem "logger" # transitive deps whose newer releases require ruby >= 3.2; CI still tests ruby 3.1 gem "rdoc", "< 8" # rdoc 8 requires ruby >= 3.2 and pulls in rbs (also >= 3.2) diff --git a/Gemfile.lock b/Gemfile.lock index 529d0c6..59e4cc1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -24,13 +24,19 @@ GEM erb (4.0.4.1) cgi (>= 0.3.3) eventmachine (1.2.7) - ffi (1.17.4) - ffi (1.17.4-arm64-darwin) - ffi (1.17.4-x86_64-linux-gnu) + ffi (1.17.1) + ffi (1.17.1-arm64-darwin) + ffi (1.17.1-x86_64-linux-gnu) forwardable-extended (2.6.0) google-protobuf (4.33.6) bigdecimal rake (>= 13) + google-protobuf (4.33.6-arm64-darwin) + bigdecimal + rake (>= 13) + google-protobuf (4.33.6-x86_64-linux-gnu) + bigdecimal + rake (>= 13) http_parser.rb (0.8.0) i18n (1.14.7) concurrent-ruby (~> 1.0) @@ -135,13 +141,13 @@ GEM rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (1.13.0) safe_yaml (1.0.5) - sass-embedded (1.83.4) - google-protobuf (~> 4.29) - rake (>= 13) - sass-embedded (1.83.4-arm64-darwin) - google-protobuf (~> 4.29) - sass-embedded (1.83.4-x86_64-linux-gnu) - google-protobuf (~> 4.29) + sass-embedded (1.77.0) + google-protobuf (>= 3.25, < 5.0) + rake (>= 13.0.0) + sass-embedded (1.77.0-arm64-darwin) + google-protobuf (>= 3.25, < 5.0) + sass-embedded (1.77.0-x86_64-linux-gnu) + google-protobuf (>= 3.25, < 5.0) standard (1.44.0) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.0) From 444ea4df866afeae8fd0faa812a58245d92cf805 Mon Sep 17 00:00:00 2001 From: Mike Vormwald Date: Sat, 22 Aug 2026 15:11:23 -0400 Subject: [PATCH 6/6] fix: lock gem versions that work on every CI ruby The ruby 4.0 job failed on the precompiled binary gems: ffi 1.17.1 and google-protobuf 4.33.6 both cap their native variants at ruby < 3.5, even though the pure-ruby specs allow 4.0. My earlier compatibility check only looked at the ruby-platform entries, so it missed them. Bump ffi to 1.17.4 and google-protobuf to 4.35.1, and pin google-protobuf < 4.36 alongside the existing pins since 4.36 drops ruby 3.1. All 79 locked specs, platform variants included, now resolve on ruby 3.1, 3.2, 3.3, 3.4 and 4.0. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_015kxK16Xgi7P4GeUfkmQNxr --- Gemfile | 1 + Gemfile.lock | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Gemfile b/Gemfile index f79aa9a..b0b6d95 100644 --- a/Gemfile +++ b/Gemfile @@ -19,6 +19,7 @@ gem "base64" gem "rdoc", "< 8" # rdoc 8 requires ruby >= 3.2 and pulls in rbs (also >= 3.2) gem "erb", "< 5" # erb >= 6 requires ruby >= 3.2 gem "sass-embedded", "< 1.77.1" # sass-embedded >= 1.77.1 requires ruby >= 3.2 +gem "google-protobuf", "< 4.36" # google-protobuf >= 4.36 requires ruby >= 3.2 group :development, :test do gem "irb", "~> 1.14" diff --git a/Gemfile.lock b/Gemfile.lock index 59e4cc1..c91ec0d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -24,19 +24,19 @@ GEM erb (4.0.4.1) cgi (>= 0.3.3) eventmachine (1.2.7) - ffi (1.17.1) - ffi (1.17.1-arm64-darwin) - ffi (1.17.1-x86_64-linux-gnu) + ffi (1.17.4) + ffi (1.17.4-arm64-darwin) + ffi (1.17.4-x86_64-linux-gnu) forwardable-extended (2.6.0) - google-protobuf (4.33.6) + google-protobuf (4.35.1) bigdecimal - rake (>= 13) - google-protobuf (4.33.6-arm64-darwin) + rake (~> 13.3) + google-protobuf (4.35.1-arm64-darwin) bigdecimal - rake (>= 13) - google-protobuf (4.33.6-x86_64-linux-gnu) + rake (~> 13.3) + google-protobuf (4.35.1-x86_64-linux-gnu) bigdecimal - rake (>= 13) + rake (~> 13.3) http_parser.rb (0.8.0) i18n (1.14.7) concurrent-ruby (~> 1.0) @@ -98,7 +98,7 @@ GEM public_suffix (6.0.1) racc (1.8.1) rainbow (3.1.1) - rake (13.2.1) + rake (13.4.2) rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) @@ -179,6 +179,7 @@ DEPENDENCIES base64 csv erb (< 5) + google-protobuf (< 4.36) irb (~> 1.14) jekyll (~> 4.3) jekyll-tailwindcss!