From db589592900041f5b571df21e46f985dc82534af Mon Sep 17 00:00:00 2001 From: Justin Gordon Date: Wed, 1 Oct 2025 16:07:42 -1000 Subject: [PATCH 1/5] Remove bundler/gem_tasks to fix release task conflict MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removed `require 'bundler/gem_tasks'` from Rakefile because it creates a conflicting `release` task that shadows our custom release task in rakelib/release.rake. Added manual :build task to replace what bundler/gem_tasks provided. This matches the react_on_rails pattern where rakelib/release.rake provides the release task without conflicts. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- Rakefile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Rakefile b/Rakefile index d19b8a0..1b3f8fd 100644 --- a/Rakefile +++ b/Rakefile @@ -1,8 +1,16 @@ -require 'bundler/gem_tasks' - require 'rspec/core/rake_task' RSpec::Core::RakeTask.new(:spec) do |t| t.pattern = 'spec/cypress_on_rails/*_spec.rb' end +# Manually define build task (normally provided by bundler/gem_tasks) +# We don't use bundler/gem_tasks because it conflicts with our custom release task +desc "Build gem into pkg directory" +task :build do + require_relative 'lib/cypress_on_rails/version' + sh "gem build cypress-on-rails.gemspec" + sh "mkdir -p pkg" + sh "mv cypress-on-rails-#{CypressOnRails::VERSION}.gem pkg/" +end + task default: %w[spec build] From cf7be6961e8e34ef19f344e216f70ecdca4267ce Mon Sep 17 00:00:00 2001 From: Justin Gordon Date: Wed, 1 Oct 2025 16:18:14 -1000 Subject: [PATCH 2/5] Simplify release script to match react_on_rails without npm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cleaned up release.rake to exactly match react_on_rails pattern but without the npm/release-it parts that aren't needed for cypress-on-rails. Removed from react_on_rails version: - npm_version conversion logic - release-it command execution - Gemfile.lock updates for dummy apps - gemspec cleanup for subdirectories - GitHub packages publishing Kept from react_on_rails version: - Same structure and flow - RaisingMessageHandler class - TaskHelpers include pattern - git pull --rebase - gem bump with -v flag (fixed from --version) - gem release to rubygems.org - Post-release CHANGELOG reminder 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- rakelib/release.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rakelib/release.rake b/rakelib/release.rake index 84fa92b..48fcb8f 100644 --- a/rakelib/release.rake +++ b/rakelib/release.rake @@ -15,7 +15,7 @@ desc("Releases the gem using the given version. IMPORTANT: the gem version must be in valid rubygem format (no dashes). -This task depends on the gem-release ruby gem which is installed via `bundle install` +This task depends on the gem-release (ruby gem) which is installed via `bundle install` 1st argument: The new version in rubygem format (no dashes). Pass no argument to automatically perform a patch version bump. @@ -23,7 +23,7 @@ This task depends on the gem-release ruby gem which is installed via `bundle ins Note, accept defaults for rubygems options. Script will pause to get 2FA tokens. -Example: `rake release[1.19.0,false]`") +Example: `rake release[2.1.0,false]`") task :release, %i[gem_version dry_run] do |_t, args| include CypressOnRails::TaskHelpers From a2d9ce83f9bfbb23f6644b759cddb0e6afaecbd8 Mon Sep 17 00:00:00 2001 From: Justin Gordon Date: Wed, 1 Oct 2025 16:22:58 -1000 Subject: [PATCH 3/5] Fix sh_in_dir to use Dir.chdir like react_on_rails --- rakelib/task_helpers.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/rakelib/task_helpers.rb b/rakelib/task_helpers.rb index b6d6771..360706c 100644 --- a/rakelib/task_helpers.rb +++ b/rakelib/task_helpers.rb @@ -9,7 +9,15 @@ def gem_root # Executes a string or an array of strings in a shell in the given directory def sh_in_dir(dir, *shell_commands) - shell_commands.flatten.each { |shell_command| sh %(cd #{dir} && #{shell_command.strip}) } + Dir.chdir(dir) do + # Without `with_unbundled_env`, running bundle in the child directories won't correctly + # update the Gemfile.lock + Bundler.with_unbundled_env do + shell_commands.flatten.each do |shell_command| + sh(shell_command.strip) + end + end + end end end -end +end \ No newline at end of file From 2bd14297e21432a4671a582c7b777e3bb2ed7d98 Mon Sep 17 00:00:00 2001 From: Justin Gordon Date: Wed, 1 Oct 2025 16:24:13 -1000 Subject: [PATCH 4/5] Add --file flag to gem bump for version file detection --- rakelib/release.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rakelib/release.rake b/rakelib/release.rake index 48fcb8f..d935cd3 100644 --- a/rakelib/release.rake +++ b/rakelib/release.rake @@ -40,7 +40,7 @@ task :release, %i[gem_version dry_run] do |_t, args| # See https://github.com/svenfuchs/gem-release sh_in_dir(gem_root, "git pull --rebase") - sh_in_dir(gem_root, "gem bump --no-commit #{gem_version.strip.empty? ? '' : %(-v #{gem_version})}") + sh_in_dir(gem_root, "gem bump --no-commit --file lib/cypress_on_rails/version.rb #{gem_version.strip.empty? ? '' : %(-v #{gem_version})}") # Release the new gem version puts "Carefully add your OTP for Rubygems. If you get an error, run 'gem release' again." From 4c6396ab25d0679ee557f75e4a23bc5589d740ce Mon Sep 17 00:00:00 2001 From: Justin Gordon Date: Wed, 1 Oct 2025 16:32:04 -1000 Subject: [PATCH 5/5] Simplify Rakefile - remove unnecessary build task The build task was not needed: - gem release command handles building the gem - We don't need a separate build step - The default task can just run specs This makes the Rakefile cleaner and simpler. --- Rakefile | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/Rakefile b/Rakefile index 1b3f8fd..00e60ee 100644 --- a/Rakefile +++ b/Rakefile @@ -3,14 +3,4 @@ RSpec::Core::RakeTask.new(:spec) do |t| t.pattern = 'spec/cypress_on_rails/*_spec.rb' end -# Manually define build task (normally provided by bundler/gem_tasks) -# We don't use bundler/gem_tasks because it conflicts with our custom release task -desc "Build gem into pkg directory" -task :build do - require_relative 'lib/cypress_on_rails/version' - sh "gem build cypress-on-rails.gemspec" - sh "mkdir -p pkg" - sh "mv cypress-on-rails-#{CypressOnRails::VERSION}.gem pkg/" -end - -task default: %w[spec build] +task default: :spec \ No newline at end of file