From d085aa1828bdd93266cad5946e3684d8864fbe5a Mon Sep 17 00:00:00 2001 From: Abdullah Hashim Date: Fri, 22 May 2026 13:47:52 -0400 Subject: [PATCH 1/3] Enable npm_add gemspec metadata --- CHANGELOG.md | 3 ++- bridgetown-stoa.gemspec | 9 +++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0223de1..9b2871e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -- ... +### Changed +- Enabled the `npm_add` gemspec metadata so Bridgetown sites that install the gem auto-add the `bridgetown-stoa` npm dependency. Safe now that the package exists on the registry (was held back in 0.2.0 because the init-time lookup 404'd loudly until first publish). ## [0.2.0] - 2026-05-22 diff --git a/bridgetown-stoa.gemspec b/bridgetown-stoa.gemspec index a7871ed..5104ab6 100644 --- a/bridgetown-stoa.gemspec +++ b/bridgetown-stoa.gemspec @@ -14,12 +14,9 @@ Gem::Specification.new do |spec| spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r!^(test|script|spec|features)/!) } spec.test_files = spec.files.grep(%r!^test/!) spec.require_paths = ["lib"] - # TODO: enable the `npm_add` metadata below once the npm companion is - # published. While the package is unpublished, Bridgetown's init-time - # registry lookup 404s loudly during every test run. - # spec.metadata = { - # "npm_add" => "bridgetown-stoa@#{BridgetownStoa::VERSION}", - # } + spec.metadata = { + "npm_add" => "bridgetown-stoa@#{BridgetownStoa::VERSION}", + } spec.required_ruby_version = ">= 3.2" From d12139ce046f5760eaf4cf3a4cd2b977a6813c28 Mon Sep 17 00:00:00 2001 From: Abdullah Hashim Date: Fri, 22 May 2026 14:00:20 -0400 Subject: [PATCH 2/3] Match bridgetown-quick-search plugin conventions --- CHANGELOG.md | 4 +++- bridgetown-stoa.gemspec | 4 ++-- test/fixtures/config/initializers.rb | 6 +++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b2871e..3a8cf1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Changed -- Enabled the `npm_add` gemspec metadata so Bridgetown sites that install the gem auto-add the `bridgetown-stoa` npm dependency. Safe now that the package exists on the registry (was held back in 0.2.0 because the init-time lookup 404'd loudly until first publish). +- Enabled the `yarn-add` gemspec metadata so Bridgetown sites that install the gem auto-add the `bridgetown-stoa` npm dependency. Matches the idiomatic pattern from `bridgetown-quick-search`. (`yarn-add` and `npm_add` are synonyms inside Bridgetown's plugin manager — the gemspec template's commented `npm_add` is the older name; the ecosystem has standardized on `yarn-add`.) +- Excluded `frontend/` from the gem's `files` glob. The Tailwind partial belongs in the npm companion only; shipping it in the gem too was duplicate distribution. +- Test fixture initializer now passes `require_gem: false` to `init :"bridgetown-stoa"` so Bridgetown's plugin manager doesn't run `install_npm_dependencies` during the test suite (which would inject a self-referencing dep into the gem's own `package.json`). The gem is already loaded by `test/helper.rb`, so the re-require was redundant anyway. ## [0.2.0] - 2026-05-22 diff --git a/bridgetown-stoa.gemspec b/bridgetown-stoa.gemspec index 5104ab6..ff1bb8a 100644 --- a/bridgetown-stoa.gemspec +++ b/bridgetown-stoa.gemspec @@ -11,11 +11,11 @@ Gem::Specification.new do |spec| spec.homepage = "https://github.com/Guided-Rails/bridgetown-stoa" spec.license = "MIT" - spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r!^(test|script|spec|features)/!) } + spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r!^(test|script|spec|features|frontend)/!) } spec.test_files = spec.files.grep(%r!^test/!) spec.require_paths = ["lib"] spec.metadata = { - "npm_add" => "bridgetown-stoa@#{BridgetownStoa::VERSION}", + "yarn-add" => "bridgetown-stoa@#{BridgetownStoa::VERSION}", } spec.required_ruby_version = ">= 3.2" diff --git a/test/fixtures/config/initializers.rb b/test/fixtures/config/initializers.rb index cf08a5d..2ec2bf2 100644 --- a/test/fixtures/config/initializers.rb +++ b/test/fixtures/config/initializers.rb @@ -1,5 +1,9 @@ # frozen_string_literal: true Bridgetown.configure do |config| - init :"bridgetown-stoa" + # require_gem: false because test/helper.rb already loads the gem; without + # this, Bridgetown's plugin manager calls `install_npm_dependencies` and + # injects a self-referencing `bridgetown-stoa` dep into the gem's own + # `package.json` on every test run. + init :"bridgetown-stoa", require_gem: false end From db1627a85c08ae531bc08efd615e22e4bae530f6 Mon Sep 17 00:00:00 2001 From: Abdullah Hashim Date: Fri, 22 May 2026 14:02:37 -0400 Subject: [PATCH 3/3] wip --- test/fixtures/config/initializers.rb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/fixtures/config/initializers.rb b/test/fixtures/config/initializers.rb index 2ec2bf2..8110ad2 100644 --- a/test/fixtures/config/initializers.rb +++ b/test/fixtures/config/initializers.rb @@ -1,9 +1,5 @@ # frozen_string_literal: true Bridgetown.configure do |config| - # require_gem: false because test/helper.rb already loads the gem; without - # this, Bridgetown's plugin manager calls `install_npm_dependencies` and - # injects a self-referencing `bridgetown-stoa` dep into the gem's own - # `package.json` on every test run. init :"bridgetown-stoa", require_gem: false end