Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
158 commits
Select commit Hold shift + click to select a range
e9d84e6
generator: switch install prerequisite from yarn to npm and update specs
ihabadham Sep 9, 2025
283c1a3
generator: auto-install Shakapacker if not installed
ihabadham Sep 9, 2025
6fa7185
generator: adopt example bin/dev in generator and dummy app
ihabadham Sep 9, 2025
d8b725a
enable auto-registered bundles by default - set components_subdirecto…
ihabadham Sep 9, 2025
e0a5efc
ci: fix failures because of ARGV and exits
ihabadham Sep 9, 2025
e47ed9d
ci: correct rubocop offenses
ihabadham Sep 9, 2025
a6dba4a
disable auto_load_bundle by default
ihabadham Sep 9, 2025
827aade
Resolve conflicts with Justin's PR #1769 before rebase
ihabadham Sep 10, 2025
bbb9d7e
let shakapacker handle package manager for us
ihabadham Sep 10, 2025
56bf816
refactor: convert Procfile templates from dynamic to static shakapack…
ihabadham Sep 10, 2025
999cbdc
fix: add missing Procfile variants to spec/dummy
ihabadham Sep 10, 2025
061c383
rename webpackConfig to generateWebpackConfigs (#1772)
Judahmeek Sep 10, 2025
b83ce88
generator: refactor templates to default to auto registration
ihabadham Sep 11, 2025
966a14b
ci: linting js
ihabadham Sep 11, 2025
9c21731
ci: fix redux generator still creates components in the old structure
ihabadham Sep 11, 2025
814ad1b
linting
ihabadham Sep 11, 2025
4b39590
ci
ihabadham Sep 11, 2025
32d8ead
Fix CI failures: update generator tests and Redux auto-registration
ihabadham Sep 11, 2025
e9b808e
ci: fix import paths
ihabadham Sep 11, 2025
3c3d3d5
linting
ihabadham Sep 11, 2025
c1bd223
fix: remove double registration from server-bundle.js template
ihabadham Sep 12, 2025
19d4d43
refactor: adopt client/server component structure per documentation
ihabadham Sep 12, 2025
047583a
fix: remove unused Procfile.dev-static and fix backward compatibility
ihabadham Sep 12, 2025
7df07c2
fix: improve error handling in bin/dev scripts per CodeRabbit feedback
ihabadham Sep 14, 2025
933f988
fix redux generator for auto-registration
ihabadham Sep 14, 2025
b4dec75
refactor generators: eliminate wasteful cleanup
ihabadham Sep 14, 2025
0ed2e37
linting
ihabadham Sep 14, 2025
763638d
ci: fix old import paths and generator examples
ihabadham Sep 14, 2025
f27559b
ci: fix incomplete bin/dev script test execution by adding missing mocks
ihabadham Sep 14, 2025
3b7054f
ci: linting
ihabadham Sep 14, 2025
0ccd1dc
ci: fix import paths
ihabadham Sep 14, 2025
5ba84c4
refactor: replace duplicate bin/dev with symlink to generator template
justin808 Sep 14, 2025
8944925
feat: refactor bin/dev and add kill command
justin808 Sep 15, 2025
15ae5ff
fix: clean up overmind socket file in bin/dev kill command
justin808 Sep 15, 2025
2518d05
fix: auto-clean stale overmind sockets on startup
justin808 Sep 15, 2025
00db160
improve: expand stale file cleanup to include Rails server.pid
justin808 Sep 15, 2025
2e4205b
improve: smart webpack.config.js handling in generator
justin808 Sep 15, 2025
5c45269
fix: implement robust Shakapacker webpack.config.js detection
justin808 Sep 15, 2025
57e0918
fix: eliminate webpack.config.js conflict prompt for standard configs
justin808 Sep 15, 2025
d88904b
Refactor bin/dev to use ReactOnRails::Dev classes with clear Procfile…
justin808 Sep 15, 2025
26a7ddd
Fix spec_helper require in ReactOnRails::Dev spec files
justin808 Sep 15, 2025
26cc1cf
Add proper spec_helper require to ReactOnRails::Dev specs
justin808 Sep 15, 2025
1bafcc8
Fix specs and add verbose option for pack generation
justin808 Sep 15, 2025
8562962
Fix CI module loading and linting issues
justin808 Sep 15, 2025
81c57eb
Fix bin/dev script test expectations
justin808 Sep 15, 2025
3ff5b8b
Fix line length violations in Dev specs
justin808 Sep 15, 2025
7ff75b9
Fix file existence checks in adapt_for_older_shakapacker_generator
justin808 Sep 15, 2025
b57cbb8
Fix CSS module configuration issues in generator examples
justin808 Sep 15, 2025
cc117ad
Improve CSS loader configuration in webpack common config
justin808 Sep 15, 2025
b8b8b6b
Fix RuboCop style issues with guard clauses
justin808 Sep 15, 2025
81150b0
Simplify CSS loader configuration in webpack common config
justin808 Sep 15, 2025
e8bf5ed
Remove CSS imports to fix webpack compilation issues
justin808 Sep 15, 2025
d738877
Add RuboCop overrides for justified Dev module violations
justin808 Sep 15, 2025
fdfa18b
Refactor Dev modules for better code quality and fix post-install mes…
justin808 Sep 15, 2025
6b4668e
Fix timing race condition in locales_to_js_spec.rb
justin808 Sep 15, 2025
ac1bd43
Fix Net::ReadTimeout error in selenium_logger.rb
justin808 Sep 15, 2025
dd892bf
Fix test logic for up-to-date file detection in locales_to_js_spec.rb
justin808 Sep 15, 2025
ada8f37
Address PR review comments
justin808 Sep 15, 2025
0c5552b
Fix CSS modules implementation based on review feedback
justin808 Sep 15, 2025
575f98a
Fix CSS modules support in generators
justin808 Sep 15, 2025
2eb42f7
Add proper CSS modules webpack configuration
justin808 Sep 15, 2025
cc61a09
Make webpack CSS configuration resilient to missing dependencies
justin808 Sep 15, 2025
de14a6b
Add fallback CSS handling for tests without CSS loaders
justin808 Sep 15, 2025
cbb1698
Fix CSS modules fallback with identity proxy loader
justin808 Sep 15, 2025
6f95bd6
Fix CSS modules webpack loader syntax error
justin808 Sep 15, 2025
2ed3b21
Fix CSS modules export compatibility for ES6 imports
justin808 Sep 15, 2025
87f6a39
Revert webpack CSS modules configuration changes
justin808 Sep 15, 2025
f4785ec
Fix CSS dependency installation timing in generator
justin808 Sep 15, 2025
9e3d736
Add debug output to install_js_dependencies method
justin808 Sep 15, 2025
60d39a6
Add comprehensive debug output to understand generator method execution
justin808 Sep 15, 2025
9d1ee53
Fix generator method visibility - move add_js_dependencies before pri…
justin808 Sep 15, 2025
6d2d01e
Clean up generator code - remove debug output
justin808 Sep 15, 2025
4fe3b11
Fix webpack config backup bug - copy actual file instead of template
justin808 Sep 15, 2025
943b74d
Update spec/dummy/spec/support/selenium_logger.rb
justin808 Sep 15, 2025
88f88e0
Security fixes and generator improvements
justin808 Sep 15, 2025
bcd05e4
Fix CI linting and syntax errors
justin808 Sep 15, 2025
a07a626
Fix shakapacker.yml template to include standard defaults
justin808 Sep 15, 2025
1d39ee5
Fix bin/dev duplication and API issues
justin808 Sep 15, 2025
bd37d16
Improve Shakapacker auto-installation with better messaging and options
justin808 Sep 15, 2025
9302d01
Update generator tests for new Shakapacker installation implementation
justin808 Sep 15, 2025
89946d6
Fix package.json loading crash in generators
justin808 Sep 15, 2025
fa9ee38
Fix bin/dev test to match updated API
justin808 Sep 15, 2025
98a136b
Fix all RuboCop violations in generators
justin808 Sep 15, 2025
608e13a
Improve post-install message with all requested enhancements
justin808 Sep 15, 2025
bcc4907
Change Redux description from 'Advanced Usage' to 'Optional'
justin808 Sep 15, 2025
3451c4b
Fix Redux terminology: 'gems' β†’ 'package'
justin808 Sep 15, 2025
55ba46b
Improve git uncommitted changes error message
justin808 Sep 15, 2025
6c5b1eb
Improve generator output and fix Shakapacker detection
justin808 Sep 15, 2025
9fa7a3d
Update generator description to focus on React frontend and SSR
justin808 Sep 15, 2025
0d53442
Fix typos and grammar errors in shakapacker.yml template
justin808 Sep 15, 2025
80cc5fe
Reorganize generator messages for better UX
justin808 Sep 15, 2025
72a9017
Improve Shakapacker installation message clarity
justin808 Sep 15, 2025
6deaa58
Implement seamless Shakapacker integration for React on Rails v15+
justin808 Sep 16, 2025
1f4151d
Remove PropTypes and fix webpack CSS configuration
justin808 Sep 16, 2025
76d75db
Enable HMR in shakapacker.yml template
justin808 Sep 16, 2025
666fcff
Fix RuboCop violations in base_generator.rb
justin808 Sep 16, 2025
ddd3c6a
Fix React Refresh babel plugin configuration for HMR
justin808 Sep 16, 2025
a50ea3d
Improve React Refresh error handling and documentation
justin808 Sep 16, 2025
06b7a5a
Move React Refresh troubleshooting to bin/dev help command
justin808 Sep 16, 2025
57fd464
Make bin/dev work with both HMR enabled and disabled
justin808 Sep 16, 2025
c297c3c
Fix React Refresh overlay configuration error
justin808 Sep 16, 2025
cc38e5d
Update to modern JSX transform
justin808 Sep 16, 2025
b2bf2b5
Restrict React Refresh to HMR mode only
justin808 Sep 16, 2025
29e4637
Fix HMR by always enabling React Refresh webpack plugin in development
justin808 Sep 16, 2025
de09508
Fix React Refresh to work only in HMR mode, eliminating static mode w…
justin808 Sep 16, 2025
91c0ebb
Fix RuboCop violations and add exclusions for generator complexity
justin808 Sep 16, 2025
31199d3
Complete RuboCop exclusions for install generator complexity
justin808 Sep 16, 2025
9f6f6fd
Fix CI failures for Shakapacker 8+ compatibility
justin808 Sep 16, 2025
cfc9f5b
Fix CI failures: Update to Shakapacker 8.2.0 and improve test stubbing
justin808 Sep 16, 2025
44749ad
Fix rake task loading in Rails engine
justin808 Sep 16, 2025
a7a377b
Fix test stubbing issues for CI compatibility
justin808 Sep 16, 2025
604673a
Fix Redux template to use CSS modules consistently
justin808 Sep 16, 2025
c9c5a42
Fix remaining test failures for CI compatibility
justin808 Sep 16, 2025
62e9e56
Final test fixes for remaining CI failures
justin808 Sep 16, 2025
24af064
Fix examples to use Shakapacker 8.2+ compatibility
justin808 Sep 16, 2025
9de81a7
Fix ESLint errors in React component templates for React 19
justin808 Sep 16, 2025
e1b0e79
Remove FileManager test (was new, not existing test failure)
justin808 Sep 16, 2025
0488119
Fix ProcessManager test stubbing for system calls
justin808 Sep 16, 2025
b99e74d
Fix ServerManager test stubbing for Open3.capture2
justin808 Sep 16, 2025
ab12753
Use >= 8.2.0 instead of ~> 8.2.0 for shakapacker in examples
justin808 Sep 16, 2025
580d65a
Fix Bundler conflict in install generator
justin808 Sep 16, 2025
8b12230
Improve shakapacker detection with robust multi-strategy approach
justin808 Sep 16, 2025
35db1cb
Fix RuboCop violations in install generator and test files
justin808 Sep 16, 2025
6436c4e
Add package manager prerequisite check and improve error handling
justin808 Sep 16, 2025
dbe1f64
Remove webpacker support and require Shakapacker 8.2+
justin808 Sep 16, 2025
364fbfd
Simplify and modernize CI matrix configuration
justin808 Sep 16, 2025
612e2b0
Update CHANGELOG.md with breaking changes for v15.1
justin808 Sep 16, 2025
c8e3086
Fix webpack config issues and RuboCop violations
justin808 Sep 16, 2025
095f3ae
Trigger CI
justin808 Sep 16, 2025
1258eae
Fix install generator to respect --ignore-warnings for Shakapacker setup
justin808 Sep 16, 2025
2fbbaa4
Add comprehensive error handling for JavaScript dependency installation
justin808 Sep 16, 2025
4cbbc26
Fix RuboCop violations and refactor complex methods
justin808 Sep 16, 2025
a2c19eb
Fix RuboCop redundant return violations
justin808 Sep 16, 2025
b1427a1
Fix test stubs for node version checking
justin808 Sep 16, 2025
702d54a
Fix helpful message tests by mocking Shakapacker installation
justin808 Sep 16, 2025
05ff132
Fix helpful message tests with flexible assertions
justin808 Sep 16, 2025
9cc0847
Fix helpful message test assertions - use consistent expected text
justin808 Sep 16, 2025
8f4e895
Apply PR #1784 improvements - clear messages and flexible package man…
justin808 Sep 16, 2025
e53e50c
Fix RuboCop Performance/ConstantRegexp violation
justin808 Sep 16, 2025
33d74e5
Fix Ruby version compatibility in tests - final fixes
justin808 Sep 16, 2025
e9487ba
Fix PrerenderError test regex - handle single quotes vs backticks
justin808 Sep 16, 2025
7f7d497
Fix RuboCop line length violation in PrerenderError test
justin808 Sep 16, 2025
c261b81
Fix critical regression - Shakapacker installation when not already i…
justin808 Sep 16, 2025
dadd3df
Fix regression: Only check Gemfile text for Shakapacker presence
justin808 Sep 16, 2025
9329d30
Fix indentation in TESTING SETUP section
justin808 Sep 16, 2025
eaaf0eb
Fix heredoc indentation in testing setup section
justin808 Sep 16, 2025
75c3361
Add blank lines before URLs and colorize them for better visibility
justin808 Sep 16, 2025
bd4210b
Revert "Add blank lines before URLs and colorize them for better visi…
justin808 Sep 16, 2025
171b9e8
Document yalc requirement for testing generator with new Rails apps
justin808 Sep 16, 2025
3750762
Document console output differences across development modes
justin808 Sep 16, 2025
bc69dcd
Fix React on Rails v15 generator and restore colorized output
justin808 Sep 17, 2025
3974fc2
Improve CONTRIBUTING.md with comprehensive generator testing document…
justin808 Sep 17, 2025
6e8d443
Fix generator to produce proper client/server split React component s…
justin808 Sep 17, 2025
f36e40d
Improve docs and print statements
justin808 Sep 17, 2025
a9a7732
Fix CI failures: RuboCop violations and add AI coding agent best prac…
justin808 Sep 17, 2025
ed3bda3
Improve Shakapacker compatibility and add autofix command
justin808 Sep 17, 2025
37917e5
Enable server-side rendering by default in generator template
justin808 Sep 17, 2025
a05c43f
Improve docs
justin808 Sep 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 20 additions & 9 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,21 @@ jobs:
strategy:
fail-fast: false
matrix:
versions: ['oldest', 'newest']
ruby-version: ['3.2', '3.4']
dependency-level: ['minimum', 'latest']
include:
- ruby-version: '3.2'
dependency-level: 'minimum'
- ruby-version: '3.4'
dependency-level: 'latest'
exclude:
- ruby-version: '3.2'
dependency-level: 'latest'
- ruby-version: '3.4'
dependency-level: 'minimum'
env:
SKIP_YARN_COREPACK_CHECK: 0
BUNDLE_FROZEN: ${{ matrix.versions == 'oldest' && 'false' || 'true' }}
BUNDLE_FROZEN: ${{ matrix.dependency-level == 'minimum' && 'false' || 'true' }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand All @@ -40,7 +51,7 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.versions == 'oldest' && '3.0' || '3.3' }}
ruby-version: ${{ matrix.ruby-version }}
bundler: 2.5.9
- name: Setup Node
uses: actions/setup-node@v4
Expand All @@ -58,18 +69,18 @@ jobs:
echo "Yarn version: "; yarn --version
echo "Bundler version: "; bundle --version
- name: run conversion script to support shakapacker v6
if: matrix.versions == 'oldest'
if: matrix.dependency-level == 'minimum'
run: script/convert
- name: Save root ruby gems to cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-${{ matrix.versions }}
key: package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
- id: get-sha
run: echo "sha=\"$(git rev-parse HEAD)\"" >> "$GITHUB_OUTPUT"
- name: Install Node modules with Yarn for renderer package
run: |
yarn install --no-progress --no-emoji ${{ matrix.versions == 'newest' && '--frozen-lockfile' || '' }}
yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }}
sudo yarn global add yalc
- name: yalc publish for react-on-rails
run: yalc publish
Expand All @@ -95,12 +106,12 @@ jobs:
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- name: Set packer version environment variable
run: |
echo "CI_PACKER_VERSION=${{ matrix.versions }}" >> $GITHUB_ENV
echo "CI_DEPENDENCY_LEVEL=${{ matrix.dependency-level }}" >> $GITHUB_ENV
- name: Main CI
if: steps.changed-files.outputs.any_changed == 'true'
run: bundle exec rake run_rspec:${{ matrix.versions == 'oldest' && 'web' || 'shaka' }}packer_examples
run: bundle exec rake run_rspec:shakapacker_examples
- name: Store test results
uses: actions/upload-artifact@v4
with:
name: main-rspec-${{ github.run_id }}-${{ github.job }}-${{ matrix.versions }}
name: main-rspec-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
path: ~/rspec
74 changes: 50 additions & 24 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,20 @@ jobs:
build-dummy-app-webpack-test-bundles:
strategy:
matrix:
versions: ['oldest', 'newest']
ruby-version: ['3.2', '3.4']
node-version: ['20', '22']
include:
- ruby-version: '3.2'
node-version: '20'
dependency-level: 'minimum'
- ruby-version: '3.4'
node-version: '22'
dependency-level: 'latest'
exclude:
- ruby-version: '3.2'
node-version: '22'
- ruby-version: '3.4'
node-version: '20'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand All @@ -19,7 +32,7 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.versions == 'oldest' && '3.0' || '3.3' }}
ruby-version: ${{ matrix.ruby-version }}
bundler: 2.5.9
# libyaml-dev is needed for psych v5
# this gem depends on sdoc which depends on rdoc which depends on psych
Expand All @@ -28,7 +41,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.versions == 'oldest' && '16' || '20' }}
node-version: ${{ matrix.node-version }}
cache: yarn
cache-dependency-path: '**/yarn.lock'
- name: Print system information
Expand All @@ -41,23 +54,23 @@ jobs:
echo "Yarn version: "; yarn --version
echo "Bundler version: "; bundle --version
- name: run conversion script to support shakapacker v6
if: matrix.versions == 'oldest'
if: matrix.dependency-level == 'minimum'
run: script/convert
- name: Install Node modules with Yarn for renderer package
run: |
yarn install --no-progress --no-emoji ${{ matrix.versions == 'newest' && '--frozen-lockfile' || '' }}
yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }}
sudo yarn global add yalc
- name: yalc publish for react-on-rails
Comment on lines +61 to 63
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Dummy app still uses Yarn; migrate these steps to npm to meet PR objective.

The PR description says: β€œSwitch generator and dummy app to use npm (remove Yarn requirement).” These steps keep a hard Yarn dependency.

Proposed diffs:

Renderer/package install step:

- yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }}
- sudo yarn global add yalc
+ npm ci --no-audit --no-fund
+ sudo npm i -g yalc

Dummy app install step:

- run: cd spec/dummy && yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }}
+ run: cd spec/dummy && npm ci --no-audit --no-fund

Build step:

- run: cd spec/dummy && rm -rf public/webpack/test && yarn run build:rescript && RAILS_ENV="test" NODE_ENV="test" bin/shakapacker
+ run: cd spec/dummy && rm -rf public/webpack/test && npm run build:rescript && RAILS_ENV="test" NODE_ENV="test" bin/shakapacker

Also change setup-node cache to npm (see previous comment) and artifact naming that references Yarn logs (see below).

Also applies to: 68-68, 84-84

πŸ€– Prompt for AI Agents
.github/workflows/main.yml lines 61-63 (also applies to lines 68 and 84): these
workflow steps still use Yarn; change them to use npm to complete the
migrationβ€”replace "yarn install --no-progress --no-emoji ..." with the npm
equivalent (use npm ci when lockfile present or npm install otherwise, honoring
the matrix dependency-level condition), replace "sudo yarn global add yalc" with
"npm install -g yalc", rename the step titles from Yarn to npm where
appropriate, update the setup-node cache keys to use npm cache, and adjust any
artifact names or log file references that mention Yarn to reference npm
instead.

run: yalc publish
- name: yalc add react-on-rails
run: cd spec/dummy && yalc add react-on-rails
- name: Install Node modules with Yarn for dummy app
run: cd spec/dummy && yarn install --no-progress --no-emoji ${{ matrix.versions == 'newest' && '--frozen-lockfile' || '' }}
run: cd spec/dummy && yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }}
- name: Save dummy app ruby gems to cache
uses: actions/cache@v4
with:
path: spec/dummy/vendor/bundle
key: dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}-${{ matrix.versions }}
key: dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
- name: Install Ruby Gems for dummy app
run: |
cd spec/dummy
Expand All @@ -68,21 +81,34 @@ jobs:
- name: generate file system-based packs
run: cd spec/dummy && RAILS_ENV="test" bundle exec rake react_on_rails:generate_packs
- name: Build test bundles for dummy app
run: cd spec/dummy && rm -rf public/webpack/test && yarn run build:rescript && RAILS_ENV="test" NODE_ENV="test" bin/${{ matrix.versions == 'oldest' && 'web' || 'shaka' }}packer
run: cd spec/dummy && rm -rf public/webpack/test && yarn run build:rescript && RAILS_ENV="test" NODE_ENV="test" bin/shakapacker
- id: get-sha
run: echo "sha=\"$(git rev-parse HEAD)\"" >> "$GITHUB_OUTPUT"
- name: Save test Webpack bundles to cache (for build number checksum used by RSpec job)
uses: actions/cache/save@v4
with:
path: spec/dummy/public/webpack
key: dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}-${{ matrix.versions }}
key: dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}

dummy-app-integration-tests:
needs: build-dummy-app-webpack-test-bundles
strategy:
fail-fast: false
matrix:
versions: ['oldest', 'newest']
ruby-version: ['3.2', '3.4']
node-version: ['20', '22']
include:
- ruby-version: '3.2'
node-version: '20'
dependency-level: 'minimum'
- ruby-version: '3.4'
node-version: '22'
dependency-level: 'latest'
exclude:
- ruby-version: '3.2'
node-version: '22'
- ruby-version: '3.4'
node-version: '20'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand All @@ -91,12 +117,12 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.versions == 'oldest' && '3.0' || '3.3' }}
ruby-version: ${{ matrix.ruby-version }}
bundler: 2.5.9
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.versions == 'oldest' && '16' || '20' }}
node-version: ${{ matrix.node-version }}
cache: yarn
cache-dependency-path: '**/yarn.lock'
- name: Print system information
Expand All @@ -109,35 +135,35 @@ jobs:
echo "Yarn version: "; yarn --version
echo "Bundler version: "; bundle --version
- name: run conversion script to support shakapacker v6
if: matrix.versions == 'oldest'
if: matrix.dependency-level == 'minimum'
run: script/convert
- name: Save root ruby gems to cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-${{ matrix.versions }}
key: package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
- name: Save dummy app ruby gems to cache
uses: actions/cache@v4
with:
path: spec/dummy/vendor/bundle
key: dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}-${{ matrix.versions }}
key: dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
- id: get-sha
run: echo "sha=\"$(git rev-parse HEAD)\"" >> "$GITHUB_OUTPUT"
- name: Save test Webpack bundles to cache (for build number checksum used by RSpec job)
uses: actions/cache@v4
with:
path: spec/dummy/public/webpack
key: dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}-${{ matrix.versions }}
key: dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
- name: Install Node modules with Yarn
run: |
yarn install --no-progress --no-emoji ${{ matrix.versions == 'newest' && '--frozen-lockfile' || '' }}
yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }}
sudo yarn global add yalc
- name: yalc publish for react-on-rails
Comment on lines 158 to 161
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ› οΈ Refactor suggestion

Integration job: update JS steps to npm as well.

Mirror the Yarn→npm changes here for consistency.

Proposed diffs:

Root install:

- yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }}
- sudo yarn global add yalc
+ npm ci --no-audit --no-fund
+ sudo npm i -g yalc

Dummy app install:

- run: cd spec/dummy && yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }}
+ run: cd spec/dummy && npm ci --no-audit --no-fund

Dummy JS tests:

- yarn run test:js
+ npm run test:js

Update setup-node cache in this job similarly to npm and package-lock.json.

Also applies to: 166-167, 170-170

πŸ€– Prompt for AI Agents
.github/workflows/main.yml lines ~158-161 (and also update at 166-167 and 170):
the job still runs Yarn commands and only caches Yarn artifacts; change the JS
steps to use npm equivalents and update caching to include npm and
package-lock.json. Replace the root and dummy-app Yarn install steps with npm
install/ci commands consistent with the other workflow changes, switch Yarn
global yalc install to the npm global install equivalent, update the dummy JS
test step to run via npm scripts, and modify the setup-node/cache configuration
in this job to use npm and package-lock.json keys so caching aligns with npm
usage. Ensure the same npm changes are applied at the referenced lines 166-167
and 170.

run: yalc publish
- name: yalc add react-on-rails
run: cd spec/dummy && yalc add react-on-rails
- name: Install Node modules with Yarn for dummy app
run: cd spec/dummy && yarn install --no-progress --no-emoji ${{ matrix.versions == 'newest' && '--frozen-lockfile' || '' }}
run: cd spec/dummy && yarn install --no-progress --no-emoji ${{ matrix.dependency-level == 'latest' && '--frozen-lockfile' || '' }}
- name: Dummy JS tests
run: |
cd spec/dummy
Expand Down Expand Up @@ -172,34 +198,34 @@ jobs:
- name: generate file system-based packs
run: cd spec/dummy && RAILS_ENV="test" bundle exec rake react_on_rails:generate_packs
- name: Git Stuff
if: matrix.versions == 'oldest'
if: matrix.dependency-level == 'minimum'
run: |
git config user.email "you@example.com"
git config user.name "Your Name"
git commit -am "stop generators from complaining about uncommitted code"
- run: cd spec/dummy && bundle info shakapacker
- name: Set packer version environment variable
run: |
echo "CI_PACKER_VERSION=${{ matrix.versions }}" >> $GITHUB_ENV
echo "CI_DEPENDENCY_LEVEL=ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}" >> $GITHUB_ENV
- name: Main CI
run: bundle exec rake run_rspec:all_dummy
- name: Store test results
uses: actions/upload-artifact@v4
with:
name: main-rspec-${{ github.run_id }}-${{ github.job }}-${{ matrix.versions }}
name: main-rspec-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
path: ~/rspec
- name: Store artifacts
uses: actions/upload-artifact@v4
with:
name: dummy-app-capybara-${{ github.run_id }}-${{ github.job }}-${{ matrix.versions }}
name: dummy-app-capybara-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
path: spec/dummy/tmp/capybara
- name: Store artifacts
uses: actions/upload-artifact@v4
with:
name: dummy-app-test-log-${{ github.run_id }}-${{ github.job }}-${{ matrix.versions }}
name: dummy-app-test-log-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
path: spec/dummy/log/test.log
- name: Store artifacts
uses: actions/upload-artifact@v4
with:
name: dummy-app-yarn-log-${{ github.run_id }}-${{ github.job }}-${{ matrix.versions }}
name: dummy-app-yarn-log-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
path: spec/dummy/yarn-error.log
8 changes: 4 additions & 4 deletions .github/workflows/package-js-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
build:
strategy:
matrix:
versions: ['oldest', 'newest']
node-version: ['20', '22']
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand All @@ -19,7 +19,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.versions == 'oldest' && '16' || '20' }}
node-version: ${{ matrix.node-version }}
cache: yarn
cache-dependency-path: '**/yarn.lock'
- name: Print system information
Expand All @@ -30,11 +30,11 @@ jobs:
echo "Node version: "; node -v
echo "Yarn version: "; yarn --version
- name: run conversion script
if: matrix.versions == 'oldest'
if: matrix.node-version == '20'
run: script/convert
- name: Install Node modules with Yarn for renderer package
run: |
yarn install --no-progress --no-emoji ${{ matrix.versions == 'newest' && '--frozen-lockfile' || '' }}
yarn install --no-progress --no-emoji ${{ matrix.node-version == '22' && '--frozen-lockfile' || '' }}
sudo yarn global add yalc
- name: Run JS unit tests for Renderer package
run: yarn test
23 changes: 12 additions & 11 deletions .github/workflows/rspec-package-specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ jobs:
strategy:
fail-fast: false
matrix:
versions: ['oldest', 'newest']
ruby-version: ['3.2', '3.4']
dependency-level: ['minimum', 'latest']
env:
BUNDLE_FROZEN: ${{ matrix.versions == 'oldest' && 'false' || 'true' }}
BUNDLE_FROZEN: ${{ matrix.dependency-level == 'minimum' && 'false' || 'true' }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand All @@ -22,7 +23,7 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.versions == 'oldest' && '3.0' || '3.3' }}
ruby-version: ${{ matrix.ruby-version }}
bundler: 2.5.9
- name: Print system information
run: |
Expand All @@ -33,34 +34,34 @@ jobs:
echo "Node version: "; node -v
echo "Yarn version: "; yarn --version
echo "Bundler version: "; bundle --version
- name: run conversion script to support shakapacker v6
if: matrix.versions == 'oldest'
- name: run conversion script to use minimum supported dependency versions
if: matrix.dependency-level == 'minimum'
run: script/convert
- name: Save root ruby gems to cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-${{ matrix.versions }}
key: package-app-gem-cache-${{ hashFiles('Gemfile.lock') }}-${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
- name: Install Ruby Gems for package
run: bundle check --path=vendor/bundle || bundle _2.5.9_ install --path=vendor/bundle --jobs=4 --retry=3
- name: Git Stuff
if: matrix.versions == 'oldest'
if: matrix.dependency-level == 'minimum'
run: |
git config user.email "you@example.com"
git config user.name "Your Name"
git commit -am "stop generators from complaining about uncommitted code"
- name: Set packer version environment variable
- name: Set dependency level environment variable
run: |
echo "CI_PACKER_VERSION=${{ matrix.versions }}" >> $GITHUB_ENV
echo "CI_DEPENDENCY_LEVEL=${{ matrix.dependency-level }}" >> $GITHUB_ENV
- name: Run rspec tests
run: bundle exec rspec spec/react_on_rails
- name: Store test results
uses: actions/upload-artifact@v4
with:
name: main-rspec-${{ github.run_id }}-${{ github.job }}-${{ matrix.versions }}
name: main-rspec-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
path: ~/rspec
- name: Store artifacts
uses: actions/upload-artifact@v4
with:
name: main-test-log-${{ github.run_id }}-${{ github.job }}-${{ matrix.versions }}
name: main-test-log-${{ github.run_id }}-${{ github.job }}-ruby${{ matrix.ruby-version }}-${{ matrix.dependency-level }}
path: log/test.log
4 changes: 3 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ spec/dummy/public
**/*generated*
*.res.js

# Prettier doesn't understand ERB syntax in YAML files
# Prettier doesn't understand ERB syntax in YAML files and can damage templates
.rubocop.yml
*.yml
*.yaml
# Intentionally invalid
spec/react_on_rails/fixtures/i18n/locales_symbols/
Loading
Loading