diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b6cd38026..31a3dff35 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,6 +39,7 @@ jobs: - Gemfile - gemfiles/Gemfile-rails-6-1 - gemfiles/Gemfile-rails-main + - gemfiles/Gemfile-sorbet-minimum include: - gemfile: gemfiles/Gemfile-rails-main experimental: true diff --git a/Gemfile b/Gemfile index c50137ff5..361bce274 100644 --- a/Gemfile +++ b/Gemfile @@ -23,7 +23,7 @@ group(:development, :test) do gem("smart_properties", require: false) gem("frozen_record", require: false) gem("sprockets", require: false) - gem("rails", require: false) + gem("rails", require: false) unless defined?(@specified_rails) gem("state_machines", require: false) gem("activerecord-typedstore", require: false) gem("sqlite3") diff --git a/Gemfile.lock b/Gemfile.lock index c16baba7f..19a0f5253 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -22,7 +22,7 @@ PATH netrc (>= 0.11.0) parallel (>= 1.21.0) rbi (~> 0.0.0, >= 0.0.16) - sorbet-static-and-runtime (>= 0.5.9892) + sorbet-static-and-runtime (>= 0.5.9896) spoom (~> 1.1.0, >= 1.1.11) thor (>= 1.2.0) yard-sorbet diff --git a/gemfiles/Gemfile-rails-6-1 b/gemfiles/Gemfile-rails-6-1 index 33b1404e4..719647763 100644 --- a/gemfiles/Gemfile-rails-6-1 +++ b/gemfiles/Gemfile-rails-6-1 @@ -1,56 +1,6 @@ # frozen_string_literal: true -source("https://rubygems.org") +gem("rails", "~> 6.1.0", require: false) +@specified_rails = true -gemspec path: ".." - -gem("minitest") -gem("minitest-hooks") -gem("minitest-reporters") -gem("pry-byebug") -gem("rubocop-shopify", require: false) -gem("rubocop-sorbet", ">= 0.4.1") -gem("rubocop-rspec", require: false) -gem("ruby-lsp", require: false) - -group(:deployment, :development) do - gem("rake") -end - -group(:development, :test) do - gem("smart_properties", require: false) - gem("frozen_record", require: false) - gem("sprockets", require: false) - gem("rails", "~> 6.1.0", require: false) - gem("state_machines", require: false) - gem("activerecord-typedstore", require: false) - gem("sqlite3") - gem("identity_cache", require: false) - gem( - "cityhash", - git: "https://github.com/csfrancis/cityhash.git", - ref: "3cfc7d01f333c01811d5e834f1495eaa29f87c36", - require: false - ) - gem("activeresource", require: false) - gem("google-protobuf", require: false) - gem("graphql", require: false) - gem("shopify-money", require: false) - gem("sidekiq", require: false) - gem("nokogiri", require: false) - gem("config", github: "rubyconfig/config", branch: "master", require: false) - gem("aasm", require: false) - gem("bcrypt", require: false) - gem("xpath", require: false) - - # net-smtp was removed from default gems in Ruby 3.1, but is used by the `mail` gem. - # So we need to add it as a dependency until `mail` is fixed: - # https://github.com/rails/rails/blob/0919aa97260ab8240150278d3b07a1547489e3fd/Gemfile#L178-L191 - gem("net-smtp", "0.3.1", require: false) -end - -group :test do - gem("webmock") -end - -gem "kramdown", "~> 2.4" +eval_gemfile "../Gemfile" diff --git a/gemfiles/Gemfile-rails-main b/gemfiles/Gemfile-rails-main index deb300310..d881c6ffc 100644 --- a/gemfiles/Gemfile-rails-main +++ b/gemfiles/Gemfile-rails-main @@ -1,56 +1,6 @@ # frozen_string_literal: true -source("https://rubygems.org") +gem("rails", github: "rails/rails", branch: "main", require: false) +@specified_rails = true -gemspec path: ".." - -gem("minitest") -gem("minitest-hooks") -gem("minitest-reporters") -gem("pry-byebug") -gem("rubocop-shopify", require: false) -gem("rubocop-sorbet", ">= 0.4.1") -gem("rubocop-rspec", require: false) -gem("ruby-lsp", require: false) - -group(:deployment, :development) do - gem("rake") -end - -group(:development, :test) do - gem("smart_properties", require: false) - gem("frozen_record", require: false) - gem("sprockets", require: false) - gem("rails", github: "rails/rails", branch: "main", require: false) - gem("state_machines", require: false) - gem("activerecord-typedstore", require: false) - gem("sqlite3") - gem("identity_cache", require: false) - gem( - "cityhash", - git: "https://github.com/csfrancis/cityhash.git", - ref: "3cfc7d01f333c01811d5e834f1495eaa29f87c36", - require: false - ) - gem("activeresource", require: false) - gem("google-protobuf", require: false) - gem("graphql", require: false) - gem("shopify-money", require: false) - gem("sidekiq", require: false) - gem("nokogiri", require: false) - gem("config", github: "rubyconfig/config", branch: "master", require: false) - gem("aasm", require: false) - gem("bcrypt", require: false) - gem("xpath", require: false) - - # net-smtp was removed from default gems in Ruby 3.1, but is used by the `mail` gem. - # So we need to add it as a dependency until `mail` is fixed: - # https://github.com/rails/rails/blob/0919aa97260ab8240150278d3b07a1547489e3fd/Gemfile#L178-L191 - gem("net-smtp", "0.3.1", require: false) -end - -group :test do - gem("webmock") -end - -gem "kramdown", "~> 2.4" +eval_gemfile "../Gemfile" diff --git a/gemfiles/Gemfile-sorbet-minimum b/gemfiles/Gemfile-sorbet-minimum new file mode 100644 index 000000000..b3c4fef3e --- /dev/null +++ b/gemfiles/Gemfile-sorbet-minimum @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +# Extract minimum supported version from gemspec +minimum_sorbet_version = File.read("tapioca.gemspec")[ + # spec.add_dependency("sorbet-static-and-runtime", ">= 1.2.3456") + # ^^^^^^^^ + /"sorbet-static-and-runtime", ">= ([^"]+)"/, + 1, +] + +gem("sorbet-static-and-runtime", minimum_sorbet_version) + +eval_gemfile "../Gemfile" diff --git a/tapioca.gemspec b/tapioca.gemspec index c5d035f3c..eb5db8327 100644 --- a/tapioca.gemspec +++ b/tapioca.gemspec @@ -27,7 +27,7 @@ Gem::Specification.new do |spec| spec.add_dependency("netrc", ">= 0.11.0") spec.add_dependency("parallel", ">= 1.21.0") spec.add_dependency("rbi", "~> 0.0.0", ">= 0.0.16") - spec.add_dependency("sorbet-static-and-runtime", ">= 0.5.9892") + spec.add_dependency("sorbet-static-and-runtime", ">= 0.5.9896") spec.add_dependency("spoom", "~> 1.1.0", ">= 1.1.11") spec.add_dependency("thor", ">= 1.2.0") spec.add_dependency("yard-sorbet")