Skip to content

Commit e8798b2

Browse files
justin808claude
andcommitted
refactor: rename CI_PNPM_FALLBACK_VERSION to CI_PNPM_FALLBACK_MINOR
The constant holds a minor-level floor (e.g. "9.15"), not a precise pin. pnpm/action-setup@v4 resolves it to the latest matching patch at install time, so the name and comment now reflect that behavior accurately. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent ca01233 commit e8798b2

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

react_on_rails/lib/generators/react_on_rails/install_generator.rb

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -253,13 +253,15 @@ def setup_react_dependencies
253253
setup_js_dependencies
254254
end
255255

256-
# Pinned when the scaffolded CI workflow has to supply a pnpm version because
257-
# `pnpm/action-setup` requires one unless package.json declares `packageManager`.
258-
# Patch-level pin keeps the drift window inside one pnpm minor series; bump when
259-
# the repo's own CI upgrades pnpm. Users can override by committing
260-
# `packageManager` to their package.json.
261-
CI_PNPM_FALLBACK_VERSION = "9.15"
262-
private_constant :CI_PNPM_FALLBACK_VERSION
256+
# Minor-level floor used when the scaffolded CI workflow has to supply a pnpm
257+
# version because `pnpm/action-setup` requires one unless package.json declares
258+
# `packageManager`. `pnpm/action-setup@v4` resolves this to the latest matching
259+
# patch (e.g. `9.15` → latest `9.15.x`) at install time, so this is a minor
260+
# floor — not a reproducible patch pin. Bump when the repo's own CI upgrades
261+
# pnpm. Users who need exact reproducibility should commit `packageManager` to
262+
# their package.json instead.
263+
CI_PNPM_FALLBACK_MINOR = "9.15"
264+
private_constant :CI_PNPM_FALLBACK_MINOR
263265

264266
def add_ci_workflow
265267
return if options[:pretend]
@@ -292,7 +294,7 @@ def add_ci_workflow
292294
template("templates/base/base/.github/workflows/ci.yml.tt", ci_path,
293295
{ package_manager: package_manager, has_lockfile: has_lockfile,
294296
package_manager_declared: package_manager_declared,
295-
pnpm_fallback_version: CI_PNPM_FALLBACK_VERSION,
297+
pnpm_fallback_version: CI_PNPM_FALLBACK_MINOR,
296298
has_active_record: has_active_record, has_rspec: has_rspec })
297299
@ci_workflow_generated = true
298300
end

react_on_rails/spec/react_on_rails/generators/install_generator_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2130,9 +2130,9 @@ class ActiveSupport::TestCase
21302130
# Existing Shakapacker apps skip the seeding path, so the CI scaffold has to pin the
21312131
# version itself or the workflow fails before dependency install.
21322132
it "pins a pnpm version in the setup step" do
2133-
# Anchor to the constant so silent drift between `CI_PNPM_FALLBACK_VERSION`
2133+
# Anchor to the constant so silent drift between `CI_PNPM_FALLBACK_MINOR`
21342134
# and the rendered template would fail this test.
2135-
fallback_version = described_class.send(:const_get, :CI_PNPM_FALLBACK_VERSION)
2135+
fallback_version = described_class.send(:const_get, :CI_PNPM_FALLBACK_MINOR)
21362136
assert_file ".github/workflows/ci.yml" do |content|
21372137
expect(content).to include("uses: pnpm/action-setup@v4")
21382138
expect(content).to match(

0 commit comments

Comments
 (0)