diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 38e48d2d3e..6dfdfc6e04 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -430,7 +430,7 @@ Run `rake` for testing the gem and `react_on_rails/spec/dummy`. Otherwise, the ` If you run `rspec` at the top level, you'll see this message: `require': cannot load such file -- rails_helper (LoadError)` -After running a test, you can view the coverage results SimpleCov reports by opening `coverage/index.html`. +If you run tests with `COVERAGE=true`, you can view the SimpleCov report at `coverage/index.html`. Turbolinks 5 is included in the test app, unless "DISABLE_TURBOLINKS" is set to YES in the environment. diff --git a/README.md b/README.md index e97d9b0a12..57632d92ce 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ --- -[![License](https://img.shields.io/badge/license-mit-green.svg)](LICENSE.md)[![Gem Version](https://badge.fury.io/rb/react_on_rails.svg)](https://badge.fury.io/rb/react_on_rails) [![npm version](https://badge.fury.io/js/react-on-rails.svg)](https://badge.fury.io/js/react-on-rails) [![Coverage Status](https://coveralls.io/repos/shakacode/react_on_rails/badge.svg?branch=main&service=github)](https://coveralls.io/github/shakacode/react_on_rails?branch=main) [![Gem Downloads](https://img.shields.io/gem/dt/react_on_rails)](https://rubygems.org/gems/react_on_rails) +[![License](https://img.shields.io/badge/license-mit-green.svg)](LICENSE.md)[![Gem Version](https://badge.fury.io/rb/react_on_rails.svg)](https://badge.fury.io/rb/react_on_rails) [![npm version](https://badge.fury.io/js/react-on-rails.svg)](https://badge.fury.io/js/react-on-rails) [![Gem Downloads](https://img.shields.io/gem/dt/react_on_rails)](https://rubygems.org/gems/react_on_rails) [![Integration Tests](https://github.com/shakacode/react_on_rails/actions/workflows/integration-tests.yml/badge.svg)](https://github.com/shakacode/react_on_rails/actions/workflows/integration-tests.yml) [![Gem Tests](https://github.com/shakacode/react_on_rails/actions/workflows/gem-tests.yml/badge.svg)](https://github.com/shakacode/react_on_rails/actions/workflows/gem-tests.yml) @@ -115,7 +115,8 @@ Start with the docs here: - [GitHub Discussions](https://github.com/shakacode/react_on_rails/discussions) for questions - [GitHub Issues](https://github.com/shakacode/react_on_rails/issues) for bugs -- [React + Rails Slack](https://invite.reactrails.com) for community chat +- [React + Rails Slack](https://reactrails.slack.com) for community chat + (existing members; non-members, please use GitHub Discussions above) - [Commercial support](mailto:react_on_rails@shakacode.com) for upgrades, consulting, and Pro guidance - [AI Agent User Guide](AGENTS_USER_GUIDE.md) for AI coding assistants diff --git a/docs/oss/deployment/troubleshooting.md b/docs/oss/deployment/troubleshooting.md index cdadd2a6bb..8cb5719f33 100644 --- a/docs/oss/deployment/troubleshooting.md +++ b/docs/oss/deployment/troubleshooting.md @@ -484,7 +484,7 @@ console.log(ReactOnRails.registeredComponents()); - **[GitHub Issues](https://github.com/shakacode/react_on_rails/issues)** - Bug reports and feature requests - **[GitHub Discussions](https://github.com/shakacode/react_on_rails/discussions)** - Questions and help -- **[React + Rails Slack](https://invite.reactrails.com)** - Real-time community support +- **[React + Rails Slack](https://reactrails.slack.com)** - Real-time community support ### Professional support diff --git a/docs/oss/getting-started/common-issues.md b/docs/oss/getting-started/common-issues.md index a2db760e37..f6d64ae58b 100644 --- a/docs/oss/getting-started/common-issues.md +++ b/docs/oss/getting-started/common-issues.md @@ -262,5 +262,5 @@ ls -la public/packs/ 1. **Check the detailed [Troubleshooting Guide](../deployment/troubleshooting.md)** 2. **Search [GitHub Issues](https://github.com/shakacode/react_on_rails/issues)** 3. **Ask in [GitHub Discussions](https://github.com/shakacode/react_on_rails/discussions)** -4. **Join [React + Rails Slack](https://invite.reactrails.com)** +4. **Join [React + Rails Slack](https://reactrails.slack.com)** 5. **Professional support**: [react_on_rails@shakacode.com](mailto:react_on_rails@shakacode.com) diff --git a/react_on_rails/Gemfile.development_dependencies b/react_on_rails/Gemfile.development_dependencies index 686b53d3ac..7b860ffdf3 100644 --- a/react_on_rails/Gemfile.development_dependencies +++ b/react_on_rails/Gemfile.development_dependencies @@ -48,7 +48,7 @@ end group :test do gem "capybara", "~> 3.40" gem "capybara-screenshot" - gem "coveralls", require: false + gem "simplecov", "~> 0.16.1", require: false gem "cypress-on-rails", "~> 1.19" gem "equivalent-xml" gem "generator_spec" diff --git a/react_on_rails/Gemfile.lock b/react_on_rails/Gemfile.lock index 6a95a82361..16e86adb4a 100644 --- a/react_on_rails/Gemfile.lock +++ b/react_on_rails/Gemfile.lock @@ -119,12 +119,6 @@ GEM coderay (1.1.3) concurrent-ruby (1.3.6) connection_pool (3.0.2) - coveralls (0.8.23) - json (>= 1.8, < 3) - simplecov (~> 0.16.1) - term-ansicolor (~> 1.3) - thor (>= 0.19.4, < 2.0) - tins (~> 1.6) crass (1.0.6) csv (3.3.5) cypress-on-rails (1.20.0) @@ -401,17 +395,11 @@ GEM uri (>= 0.12.0) stringio (3.2.0) strscan (3.1.0) - sync (0.5.0) - term-ansicolor (1.8.0) - tins (~> 1.0) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) thor (1.5.0) tilt (2.3.0) timeout (0.6.0) - tins (1.33.0) - bigdecimal - sync tsort (0.2.0) turbo-rails (2.0.20) actionpack (>= 7.1.0) @@ -448,7 +436,6 @@ DEPENDENCIES bootsnap capybara (~> 3.40) capybara-screenshot - coveralls cypress-on-rails (~> 1.19) debug equivalent-xml @@ -481,6 +468,7 @@ DEPENDENCIES sdoc selenium-webdriver (= 4.9.0) shakapacker (= 9.6.1) + simplecov (~> 0.16.1) spring (~> 4.0) sprockets (~> 4.0) sqlite3 (~> 1.6) diff --git a/react_on_rails/Rakefile b/react_on_rails/Rakefile index 1f12a57366..7c663dd1b8 100644 --- a/react_on_rails/Rakefile +++ b/react_on_rails/Rakefile @@ -6,12 +6,6 @@ tasks = %w[lint run_rspec] prepare_for_ci = %w[node_package dummy_apps] -if ENV["USE_COVERALLS"] == "TRUE" - require "coveralls/rake/task" - Coveralls::RakeTask.new - tasks << "coveralls:push" -end - desc "Run all tests and linting" task default: tasks diff --git a/react_on_rails/lib/generators/react_on_rails/dev_tests_generator.rb b/react_on_rails/lib/generators/react_on_rails/dev_tests_generator.rb index fdfd5f0c7c..a2aa84f99f 100644 --- a/react_on_rails/lib/generators/react_on_rails/dev_tests_generator.rb +++ b/react_on_rails/lib/generators/react_on_rails/dev_tests_generator.rb @@ -41,7 +41,7 @@ def add_test_related_gems_to_gemfile gem("rspec-rails", group: :test) # NOTE: chromedriver-helper was deprecated in 2019. Modern selenium-webdriver (4.x) # and GitHub Actions have built-in driver management, so no driver helper is needed. - gem("coveralls", require: false) + gem("simplecov", require: false, group: :test) end def replace_prerender_if_server_rendering diff --git a/react_on_rails/rakelib/run_rspec.rake b/react_on_rails/rakelib/run_rspec.rake index dbe778d71b..c09df8ee72 100644 --- a/react_on_rails/rakelib/run_rspec.rake +++ b/react_on_rails/rakelib/run_rspec.rake @@ -1,7 +1,5 @@ # frozen_string_literal: true -require "coveralls/rake/task" if ENV["USE_COVERALLS"] == "TRUE" - require "pathname" require "yaml" @@ -141,8 +139,6 @@ namespace :run_rspec do pinned_version_examples.each { |example_type| Rake::Task[example_type.rspec_task_name].invoke } end - Coveralls::RakeTask.new if ENV["USE_COVERALLS"] == "TRUE" - desc "run all tests no examples" task all_but_examples: %i[gem dummy_no_turbolinks dummy js_tests] do puts "Completed all RSpec tests" @@ -209,7 +205,6 @@ def run_tests_in(dir, options = {}) env_tokens = [] env_tokens << options.fetch(:env_vars, "").strip unless options.fetch(:env_vars, "").strip.empty? env_tokens << "TEST_ENV_COMMAND_NAME=\"#{command_name}\"" - env_tokens << "COVERAGE=true" if ENV["USE_COVERALLS"] env_vars = env_tokens.join(" ") command = "#{env_vars} bundle exec rspec #{rspec_args}" diff --git a/react_on_rails/rakelib/shakapacker_examples.rake b/react_on_rails/rakelib/shakapacker_examples.rake index cd8edbfec4..85caf7f82d 100644 --- a/react_on_rails/rakelib/shakapacker_examples.rake +++ b/react_on_rails/rakelib/shakapacker_examples.rake @@ -213,7 +213,7 @@ namespace :shakapacker_examples do # rubocop:disable Metrics/BlockLength # Use unbundled_sh_in_dir to ensure the generator uses the example app's # gem versions, not the parent workspace's cached bundle context. unbundled_sh_in_dir(example_type.dir, generator_commands) - # Re-run bundle install since dev_tests generator adds rspec-rails and coveralls to Gemfile + # Re-run bundle install since dev_tests generator adds rspec-rails and simplecov to Gemfile bundle_install_in(example_type.dir) # Apply specific React version for compatibility testing examples diff --git a/react_on_rails/spec/dummy/Gemfile.lock b/react_on_rails/spec/dummy/Gemfile.lock index 33796e5129..33c71b5ecf 100644 --- a/react_on_rails/spec/dummy/Gemfile.lock +++ b/react_on_rails/spec/dummy/Gemfile.lock @@ -115,12 +115,6 @@ GEM coderay (1.1.3) concurrent-ruby (1.3.6) connection_pool (3.0.2) - coveralls (0.8.23) - json (>= 1.8, < 3) - simplecov (~> 0.16.1) - term-ansicolor (~> 1.3) - thor (>= 0.19.4, < 2.0) - tins (~> 1.6) crass (1.0.6) csv (3.3.5) cypress-on-rails (1.19.0) @@ -391,16 +385,11 @@ GEM uri (>= 0.12.0) stringio (3.2.0) strscan (3.1.5) - sync (0.5.0) - term-ansicolor (1.7.1) - tins (~> 1.0) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) thor (1.5.0) tilt (2.2.0) timeout (0.4.3) - tins (1.32.1) - sync tsort (0.2.0) turbo-rails (2.0.6) actionpack (>= 6.0.0) @@ -439,7 +428,6 @@ DEPENDENCIES bootsnap capybara (~> 3.40) capybara-screenshot - coveralls cypress-on-rails (~> 1.19) debug equivalent-xml @@ -471,6 +459,7 @@ DEPENDENCIES sdoc selenium-webdriver (= 4.9.0) shakapacker (= 9.6.1) + simplecov (~> 0.16.1) spring (~> 4.0) sprockets (~> 4.0) sqlite3 (~> 1.6) diff --git a/react_on_rails/spec/dummy/bin/coveralls b/react_on_rails/spec/dummy/bin/coveralls deleted file mode 100755 index 3b7b06ec72..0000000000 --- a/react_on_rails/spec/dummy/bin/coveralls +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env ruby -# frozen_string_literal: true - -# -# This file was generated by Bundler. -# -# The application 'coveralls' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require "pathname" -ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -bundle_binstub = File.expand_path("../bundle", __FILE__) - -if File.file?(bundle_binstub) - if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/ - load(bundle_binstub) - else - abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. -Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") - end -end - -require "rubygems" -require "bundler/setup" - -load Gem.bin_path("coveralls", "coveralls") diff --git a/react_on_rails/spec/react_on_rails/generators/dev_tests_generator_spec.rb b/react_on_rails/spec/react_on_rails/generators/dev_tests_generator_spec.rb index 3a384584ea..c417c441ef 100644 --- a/react_on_rails/spec/react_on_rails/generators/dev_tests_generator_spec.rb +++ b/react_on_rails/spec/react_on_rails/generators/dev_tests_generator_spec.rb @@ -49,7 +49,7 @@ it "adds test-related gems to Gemfile" do assert_file("Gemfile") do |contents| expect(contents).to match("gem \"rspec-rails\", group: :test") - expect(contents).to match("gem \"coveralls\", require: false") + expect(contents).to match("gem \"simplecov\", require: false, group: :test") # chromedriver-helper was removed as it's deprecated since 2019 # Modern selenium-webdriver (4.x) handles driver management automatically end diff --git a/react_on_rails_pro/CONTRIBUTING.md b/react_on_rails_pro/CONTRIBUTING.md index 3a8b659dda..ba0625e535 100644 --- a/react_on_rails_pro/CONTRIBUTING.md +++ b/react_on_rails_pro/CONTRIBUTING.md @@ -347,7 +347,7 @@ bundle exec rspec If you run `rspec` at the top level, you'll see this message: `require': cannot load such file -- rails_helper (LoadError)` -After running a test, you can view the coverage results in SimpleCov reports by opening `coverage/index.html`. +If you run tests with `COVERAGE=true`, you can view the SimpleCov report at `coverage/index.html`. ### Debugging diff --git a/react_on_rails_pro/Gemfile.development_dependencies b/react_on_rails_pro/Gemfile.development_dependencies index 523dd03fea..4ac4ea7975 100644 --- a/react_on_rails_pro/Gemfile.development_dependencies +++ b/react_on_rails_pro/Gemfile.development_dependencies @@ -33,33 +33,33 @@ gem "amazing_print" group :development do # Access an interactive console on exception pages or by calling 'console' anywhere in the code. - gem 'web-console' - gem 'listen' + gem "web-console" + gem "listen" # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring - gem 'spring' - gem 'spring-watcher-listen' + gem "spring" + gem "spring-watcher-listen" end group :development, :test do - gem 'faker' - gem 'graphiql-rails' - gem 'pry', '>= 0.14.1' # Console with powerful introspection capabilities + gem "faker" + gem "graphiql-rails" + gem "pry", ">= 0.14.1" # Console with powerful introspection capabilities # Need to use master of pry-byebug to use latest pry version # Loaded manually in spec_helper.rb so specs can boot on readline-less Ruby builds. - gem 'pry-byebug', github: 'shakacode/pry-byebug', require: false # Integrates pry with byebug - gem 'pry-doc' # Provide MRI Core documentation - gem 'pry-rails' # Causes rails console to open pry. `DISABLE_PRY_RAILS=1 rails c` can still open with IRB - gem 'pry-theme' # An easy way to customize Pry colors via theme files + gem "pry-byebug", github: "shakacode/pry-byebug", require: false # Integrates pry with byebug + gem "pry-doc" # Provide MRI Core documentation + gem "pry-rails" # Causes rails console to open pry. `DISABLE_PRY_RAILS=1 rails c` can still open with IRB + gem "pry-theme" # An easy way to customize Pry colors via theme files gem "rbs", require: false gem "scss_lint", require: false - gem 'fakefs', require: 'fakefs/safe' + gem "fakefs", require: "fakefs/safe" end group :test do gem "capybara", ">= 3.38.0" gem "capybara-screenshot" - gem "coveralls", require: false + gem "simplecov", "~> 0.16.1", require: false gem "equivalent-xml" gem "generator_spec" gem "launchy" diff --git a/react_on_rails_pro/Gemfile.lock b/react_on_rails_pro/Gemfile.lock index d0a10d8476..9e82af50a0 100644 --- a/react_on_rails_pro/Gemfile.lock +++ b/react_on_rails_pro/Gemfile.lock @@ -149,12 +149,6 @@ GEM fiber-annotation fiber-local (~> 1.1) json - coveralls (0.8.23) - json (>= 1.8, < 3) - simplecov (~> 0.16.1) - term-ansicolor (~> 1.3) - thor (>= 0.19.4, < 2.0) - tins (~> 1.6) crack (1.0.0) bigdecimal rexml @@ -436,15 +430,9 @@ GEM sqlite3 (2.9.2-x86_64-darwin) sqlite3 (2.9.2-x86_64-linux-gnu) stringio (3.2.0) - sync (0.5.0) - term-ansicolor (1.11.3) - tins (~> 1) thor (1.5.0) tilt (2.4.0) timeout (0.4.4) - tins (1.33.0) - bigdecimal - sync traces (0.18.2) tsort (0.2.0) turbolinks (5.2.1) @@ -492,7 +480,6 @@ DEPENDENCIES capybara (>= 3.38.0) capybara-screenshot commonmarker - coveralls equivalent-xml fakefs faker @@ -527,6 +514,7 @@ DEPENDENCIES scss_lint selenium-webdriver (= 4.9.0) shakapacker (= 9.6.1) + simplecov (~> 0.16.1) spring spring-watcher-listen sprockets diff --git a/react_on_rails_pro/Rakefile b/react_on_rails_pro/Rakefile index 9c72fbeeae..2e7a6a8f37 100644 --- a/react_on_rails_pro/Rakefile +++ b/react_on_rails_pro/Rakefile @@ -3,11 +3,6 @@ # Rake will automatically load any *.rake files inside of the "rakelib" folder # See rakelib/ tasks = %w[run_rspec lint] -if ENV["USE_COVERALLS"] == "TRUE" - require "coveralls/rake/task" - Coveralls::RakeTask.new - tasks << "coveralls:push" -end desc "Run all tests and linting" task default: tasks diff --git a/react_on_rails_pro/rakelib/run_rspec.rake b/react_on_rails_pro/rakelib/run_rspec.rake index e929aa1539..486dfa7275 100644 --- a/react_on_rails_pro/rakelib/run_rspec.rake +++ b/react_on_rails_pro/rakelib/run_rspec.rake @@ -1,7 +1,6 @@ # frozen_string_literal: true # TODO: This file is not used for CI -require "coveralls/rake/task" if ENV["USE_COVERALLS"] == "TRUE" require "pathname" require "active_support/core_ext/string" @@ -23,13 +22,15 @@ namespace :run_rspec do run_tests_in(spec_dummy_dir) end - desc "(HACK) Run RSpec on spec/empty_spec in order to have SimpleCov generate a coverage report from cache" + desc "(HACK) Run RSpec on spec/empty_spec.rb — set COVERAGE=true to generate a SimpleCov report from cache" task :empty do - sh %(#{ENV['USE_COVERALLS'] ? 'COVERAGE=true' : ''} rspec spec/empty_spec.rb) + if ENV["COVERAGE"] == "true" + sh "bundle exec rspec spec/empty_spec.rb" + else + puts "Skipping run_rspec:empty (set COVERAGE=true to generate a SimpleCov report from cache)" + end end - Coveralls::RakeTask.new if ENV["USE_COVERALLS"] == "TRUE" - desc "run all tests" task run_rspec: %i[gem dummy empty js_tests] do puts "Completed all RSpec tests" @@ -71,7 +72,6 @@ def run_tests_in(dir, options = {}) command_name = options.fetch(:command_name, path.basename) rspec_args = options.fetch(:rspec_args, "") env_vars = +"#{options.fetch(:env_vars, '')} TEST_ENV_COMMAND_NAME=\"#{command_name}\"" - env_vars << "COVERAGE=true" if ENV["USE_COVERALLS"] sh_in_dir(path.realpath, "#{env_vars} bundle exec rspec #{rspec_args}") end diff --git a/react_on_rails_pro/spec/dummy/Gemfile.lock b/react_on_rails_pro/spec/dummy/Gemfile.lock index e56a14c54f..ee328c6939 100644 --- a/react_on_rails_pro/spec/dummy/Gemfile.lock +++ b/react_on_rails_pro/spec/dummy/Gemfile.lock @@ -146,12 +146,6 @@ GEM fiber-annotation fiber-local (~> 1.1) json - coveralls (0.8.23) - json (>= 1.8, < 3) - simplecov (~> 0.16.1) - term-ansicolor (~> 1.3) - thor (>= 0.19.4, < 2.0) - tins (~> 1.6) crack (1.0.0) bigdecimal rexml @@ -475,15 +469,9 @@ GEM sqlite3 (2.9.2-x86_64-linux-gnu) sqlite3 (2.9.2-x86_64-linux-musl) stringio (3.2.0) - sync (0.5.0) - term-ansicolor (1.11.3) - tins (~> 1) thor (1.5.0) tilt (2.4.0) timeout (0.6.0) - tins (1.33.0) - bigdecimal - sync traces (0.18.2) tsort (0.2.0) turbolinks (5.2.1) @@ -539,7 +527,6 @@ DEPENDENCIES bootsnap capybara (>= 3.38.0) capybara-screenshot - coveralls csso-rails (~> 1.0) equivalent-xml fakefs @@ -577,6 +564,7 @@ DEPENDENCIES scss_lint selenium-webdriver (= 4.9.0) shakapacker (= 9.6.1) + simplecov (~> 0.16.1) spring spring-watcher-listen sprockets diff --git a/react_on_rails_pro/spec/dummy/bin/coveralls b/react_on_rails_pro/spec/dummy/bin/coveralls deleted file mode 100755 index 5a8ac811e5..0000000000 --- a/react_on_rails_pro/spec/dummy/bin/coveralls +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env ruby -# -# This file was generated by Bundler. -# -# The application 'coveralls' is installed as part of a gem, and -# this file is here to facilitate running it. -# - -require 'pathname' -ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", - Pathname.new(__FILE__).realpath) - -require 'rubygems' -require 'bundler/setup' - -load Gem.bin_path('coveralls', 'coveralls')