Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
137 commits
Select commit Hold shift + click to select a range
0eedc2c
generator: switch install prerequisite from yarn to npm and update specs
ihabadham Sep 9, 2025
e16317b
generator: auto-install Shakapacker if not installed
ihabadham Sep 9, 2025
0da52cb
generator: adopt example bin/dev in generator and dummy app
ihabadham Sep 9, 2025
d770bfc
enable auto-registered bundles by default - set components_subdirecto…
ihabadham Sep 9, 2025
a53a2f9
ci: fix failures because of ARGV and exits
ihabadham Sep 9, 2025
3d5bd8c
ci: correct rubocop offenses
ihabadham Sep 9, 2025
d65450d
disable auto_load_bundle by default
ihabadham Sep 9, 2025
6e41aa3
Resolve conflicts with Justin's PR #1769 before rebase
ihabadham Sep 10, 2025
fd76f8a
let shakapacker handle package manager for us
ihabadham Sep 10, 2025
4b479ef
refactor: convert Procfile templates from dynamic to static shakapack…
ihabadham Sep 10, 2025
aae4e71
fix: add missing Procfile variants to spec/dummy
ihabadham Sep 10, 2025
bc5ea6f
rename webpackConfig to generateWebpackConfigs (#1772)
Judahmeek Sep 10, 2025
adaf9a1
generator: refactor templates to default to auto registration
ihabadham Sep 11, 2025
3d3accb
ci: linting js
ihabadham Sep 11, 2025
5cc7d0d
ci: fix redux generator still creates components in the old structure
ihabadham Sep 11, 2025
f1b6579
linting
ihabadham Sep 11, 2025
246cb06
ci
ihabadham Sep 11, 2025
19904ac
Fix CI failures: update generator tests and Redux auto-registration
ihabadham Sep 11, 2025
e90494e
ci: fix import paths
ihabadham Sep 11, 2025
5b026a1
linting
ihabadham Sep 11, 2025
7921db4
fix: remove double registration from server-bundle.js template
ihabadham Sep 12, 2025
be9ade2
refactor: adopt client/server component structure per documentation
ihabadham Sep 12, 2025
e8aa8dd
fix: remove unused Procfile.dev-static and fix backward compatibility
ihabadham Sep 12, 2025
6620204
fix: improve error handling in bin/dev scripts per CodeRabbit feedback
ihabadham Sep 14, 2025
54fc803
fix redux generator for auto-registration
ihabadham Sep 14, 2025
26ddaa1
refactor generators: eliminate wasteful cleanup
ihabadham Sep 14, 2025
ca40694
linting
ihabadham Sep 14, 2025
6916389
ci: fix old import paths and generator examples
ihabadham Sep 14, 2025
f30f461
ci: fix incomplete bin/dev script test execution by adding missing mocks
ihabadham Sep 14, 2025
7be53cf
ci: linting
ihabadham Sep 14, 2025
b92b351
ci: fix import paths
ihabadham Sep 14, 2025
8c0e224
refactor: replace duplicate bin/dev with symlink to generator template
justin808 Sep 14, 2025
78c1ad2
feat: refactor bin/dev and add kill command
justin808 Sep 15, 2025
f1dee5b
fix: clean up overmind socket file in bin/dev kill command
justin808 Sep 15, 2025
4b853cd
fix: auto-clean stale overmind sockets on startup
justin808 Sep 15, 2025
3284099
improve: expand stale file cleanup to include Rails server.pid
justin808 Sep 15, 2025
ca2393d
improve: smart webpack.config.js handling in generator
justin808 Sep 15, 2025
1bd8d67
fix: implement robust Shakapacker webpack.config.js detection
justin808 Sep 15, 2025
5d21dd5
fix: eliminate webpack.config.js conflict prompt for standard configs
justin808 Sep 15, 2025
6065e42
Refactor bin/dev to use ReactOnRails::Dev classes with clear Procfile…
justin808 Sep 15, 2025
86651b3
Fix spec_helper require in ReactOnRails::Dev spec files
justin808 Sep 15, 2025
d54f68d
Add proper spec_helper require to ReactOnRails::Dev specs
justin808 Sep 15, 2025
857b89d
Fix specs and add verbose option for pack generation
justin808 Sep 15, 2025
a7a6747
Fix CI module loading and linting issues
justin808 Sep 15, 2025
bc2c103
Fix bin/dev script test expectations
justin808 Sep 15, 2025
a78fdf3
Fix line length violations in Dev specs
justin808 Sep 15, 2025
cf29a5b
Fix file existence checks in adapt_for_older_shakapacker_generator
justin808 Sep 15, 2025
8a46235
Fix CSS module configuration issues in generator examples
justin808 Sep 15, 2025
2873a21
Improve CSS loader configuration in webpack common config
justin808 Sep 15, 2025
b7b47ae
Fix RuboCop style issues with guard clauses
justin808 Sep 15, 2025
d1844f4
Simplify CSS loader configuration in webpack common config
justin808 Sep 15, 2025
d1ff388
Remove CSS imports to fix webpack compilation issues
justin808 Sep 15, 2025
bf8137e
Add RuboCop overrides for justified Dev module violations
justin808 Sep 15, 2025
278ec54
Refactor Dev modules for better code quality and fix post-install mes…
justin808 Sep 15, 2025
6e828d3
Fix timing race condition in locales_to_js_spec.rb
justin808 Sep 15, 2025
d1baa22
Fix Net::ReadTimeout error in selenium_logger.rb
justin808 Sep 15, 2025
5d71758
Fix test logic for up-to-date file detection in locales_to_js_spec.rb
justin808 Sep 15, 2025
68da9bb
Address PR review comments
justin808 Sep 15, 2025
57dd47a
Fix CSS modules implementation based on review feedback
justin808 Sep 15, 2025
d41b71f
Fix CSS modules support in generators
justin808 Sep 15, 2025
fb734c8
Add proper CSS modules webpack configuration
justin808 Sep 15, 2025
2e9e008
Make webpack CSS configuration resilient to missing dependencies
justin808 Sep 15, 2025
7e1c889
Add fallback CSS handling for tests without CSS loaders
justin808 Sep 15, 2025
2a2009a
Fix CSS modules fallback with identity proxy loader
justin808 Sep 15, 2025
068ec90
Fix CSS modules webpack loader syntax error
justin808 Sep 15, 2025
025b7ba
Fix CSS modules export compatibility for ES6 imports
justin808 Sep 15, 2025
33b7090
Revert webpack CSS modules configuration changes
justin808 Sep 15, 2025
deec2fc
Fix CSS dependency installation timing in generator
justin808 Sep 15, 2025
f135934
Add debug output to install_js_dependencies method
justin808 Sep 15, 2025
d127d8f
Add comprehensive debug output to understand generator method execution
justin808 Sep 15, 2025
36fa55a
Fix generator method visibility - move add_js_dependencies before pri…
justin808 Sep 15, 2025
005ac50
Clean up generator code - remove debug output
justin808 Sep 15, 2025
be4cc10
Fix webpack config backup bug - copy actual file instead of template
justin808 Sep 15, 2025
d41b99f
Update spec/dummy/spec/support/selenium_logger.rb
justin808 Sep 15, 2025
84ec576
Security fixes and generator improvements
justin808 Sep 15, 2025
1b29b3d
Fix CI linting and syntax errors
justin808 Sep 15, 2025
a521ca1
Fix shakapacker.yml template to include standard defaults
justin808 Sep 15, 2025
e1d397b
Fix bin/dev duplication and API issues
justin808 Sep 15, 2025
c25df16
Improve Shakapacker auto-installation with better messaging and options
justin808 Sep 15, 2025
bd5e4d3
Update generator tests for new Shakapacker installation implementation
justin808 Sep 15, 2025
98e96e6
Fix package.json loading crash in generators
justin808 Sep 15, 2025
2401cb9
Fix bin/dev test to match updated API
justin808 Sep 15, 2025
6f5049a
Fix all RuboCop violations in generators
justin808 Sep 15, 2025
751ad0f
Improve post-install message with all requested enhancements
justin808 Sep 15, 2025
d3949a6
Change Redux description from 'Advanced Usage' to 'Optional'
justin808 Sep 15, 2025
93a437d
Fix Redux terminology: 'gems' → 'package'
justin808 Sep 15, 2025
912a763
Improve git uncommitted changes error message
justin808 Sep 15, 2025
db2ff4d
Improve generator output and fix Shakapacker detection
justin808 Sep 15, 2025
2742549
Update generator description to focus on React frontend and SSR
justin808 Sep 15, 2025
b2cad7d
Fix typos and grammar errors in shakapacker.yml template
justin808 Sep 15, 2025
7e28b9e
Reorganize generator messages for better UX
justin808 Sep 15, 2025
d3f925c
Improve Shakapacker installation message clarity
justin808 Sep 15, 2025
974bc90
Implement seamless Shakapacker integration for React on Rails v15+
justin808 Sep 16, 2025
670a2ae
Remove PropTypes and fix webpack CSS configuration
justin808 Sep 16, 2025
c7001c6
Enable HMR in shakapacker.yml template
justin808 Sep 16, 2025
f21b2dc
Fix RuboCop violations in base_generator.rb
justin808 Sep 16, 2025
99b5ba8
Fix React Refresh babel plugin configuration for HMR
justin808 Sep 16, 2025
202cd2c
Improve React Refresh error handling and documentation
justin808 Sep 16, 2025
f8a3f6d
Move React Refresh troubleshooting to bin/dev help command
justin808 Sep 16, 2025
1cf4915
Make bin/dev work with both HMR enabled and disabled
justin808 Sep 16, 2025
a9234a3
Fix React Refresh overlay configuration error
justin808 Sep 16, 2025
87b3695
Update to modern JSX transform
justin808 Sep 16, 2025
12fc8a4
Restrict React Refresh to HMR mode only
justin808 Sep 16, 2025
b011da8
Fix HMR by always enabling React Refresh webpack plugin in development
justin808 Sep 16, 2025
664e5d9
Fix React Refresh to work only in HMR mode, eliminating static mode w…
justin808 Sep 16, 2025
7d637fb
Fix RuboCop violations and add exclusions for generator complexity
justin808 Sep 16, 2025
3502028
Complete RuboCop exclusions for install generator complexity
justin808 Sep 16, 2025
093e4fe
Fix CI failures for Shakapacker 8+ compatibility
justin808 Sep 16, 2025
aa22d8d
Fix CI failures: Update to Shakapacker 8.2.0 and improve test stubbing
justin808 Sep 16, 2025
3bad387
Fix rake task loading in Rails engine
justin808 Sep 16, 2025
dd9e6f8
Fix test stubbing issues for CI compatibility
justin808 Sep 16, 2025
37e3d43
Fix Redux template to use CSS modules consistently
justin808 Sep 16, 2025
cd2134f
Fix remaining test failures for CI compatibility
justin808 Sep 16, 2025
d42430e
Final test fixes for remaining CI failures
justin808 Sep 16, 2025
d7e946d
Fix examples to use Shakapacker 8.2+ compatibility
justin808 Sep 16, 2025
ae100a2
Fix ESLint errors in React component templates for React 19
justin808 Sep 16, 2025
39983c7
Remove FileManager test (was new, not existing test failure)
justin808 Sep 16, 2025
f319b5e
Fix ProcessManager test stubbing for system calls
justin808 Sep 16, 2025
486e296
Fix ServerManager test stubbing for Open3.capture2
justin808 Sep 16, 2025
a1a9953
Use >= 8.2.0 instead of ~> 8.2.0 for shakapacker in examples
justin808 Sep 16, 2025
d6ca545
Fix Bundler conflict in install generator
justin808 Sep 16, 2025
d5b153b
Improve shakapacker detection with robust multi-strategy approach
justin808 Sep 16, 2025
afcb7ac
Fix RuboCop violations in install generator and test files
justin808 Sep 16, 2025
b602d66
Add package manager prerequisite check and improve error handling
justin808 Sep 16, 2025
8a00131
Remove webpacker support and require Shakapacker 8.2+
justin808 Sep 16, 2025
171ee01
Simplify and modernize CI matrix configuration
justin808 Sep 16, 2025
fa86509
Update CHANGELOG.md with breaking changes for v15.1
justin808 Sep 16, 2025
8d178ca
Fix webpack config issues and RuboCop violations
justin808 Sep 16, 2025
d753ced
Trigger CI
justin808 Sep 16, 2025
3489d5f
Merge branch 'master' into update-generator-for-v15
justin808 Sep 16, 2025
07cbe04
Fix prettier formatting in CHANGELOG.md
justin808 Sep 16, 2025
c9fb999
Fix install generator to respect --ignore-warnings for Shakapacker setup
justin808 Sep 16, 2025
4add50a
Add comprehensive error handling for JavaScript dependency installation
justin808 Sep 16, 2025
b6c7a3d
Fix RuboCop violations and refactor complex methods
justin808 Sep 16, 2025
f6a3983
Fix failing install generator tests for Node.js detection and message…
ihabadham Sep 16, 2025
b0e2ce2
ci: fix ruby 3.4 compatibility failures
ihabadham Sep 16, 2025
3c9f64c
ci: fix test string formatting
ihabadham Sep 16, 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
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
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
Comment on lines 200 to 206
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

Prevent empty-commit failure.

git commit -am exits non‑zero when no changes; guard it.

-          git commit -am "stop generators from complaining about uncommitted code"
+          git diff --quiet || git commit -am "stop generators from complaining about uncommitted code"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- 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: Git Stuff
if: matrix.dependency-level == 'minimum'
run: |
git config user.email "you@example.com"
git config user.name "Your Name"
git diff --quiet || git commit -am "stop generators from complaining about uncommitted code"
- run: cd spec/dummy && bundle info shakapacker
🤖 Prompt for AI Agents
.github/workflows/main.yml around lines 200 to 206: the workflow unconditionally
runs `git commit -am ...` which fails when there are no staged changes; change
the step to first check for changes (for example, run `git status --porcelain`
or `git diff --quiet` and only run the commit when output/exit indicates
changes) or make the commit step tolerant (e.g., append `|| true`) so the job
does not fail on an empty commit attempt.

- 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
Comment on lines 35 to 38
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

Yarn flag may be incompatible on Node 22 without pinning Yarn 1

--frozen-lockfile is Yarn 1; on Node 22, Corepack may activate Yarn 4+, where --immutable is expected. Pin Yarn 1 or switch flags conditionally.

Apply this diff to pin Yarn 1 consistently (then you can keep --frozen-lockfile):

       - name: Setup Node
         uses: actions/setup-node@v4
         with:
           node-version: ${{ matrix.node-version }}
           cache: yarn
           cache-dependency-path: '**/yarn.lock'
+      - name: Ensure Yarn v1 via Corepack
+        run: |
+          corepack enable
+          corepack prepare yarn@1.22.22 --activate
+        shell: bash

Optional follow-up (if you prefer modern Yarn instead): use --immutable for Yarn ≥2 and drop pinning.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- 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: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: yarn
cache-dependency-path: '**/yarn.lock'
- name: Ensure Yarn v1 via Corepack
run: |
corepack enable
corepack prepare yarn@1.22.22 --activate
shell: bash
- name: Install Node modules with Yarn for renderer package
run: |
yarn install --no-progress --no-emoji ${{ matrix.node-version == '22' && '--frozen-lockfile' || '' }}
sudo yarn global add yalc
🤖 Prompt for AI Agents
In .github/workflows/package-js-tests.yml around lines 35 to 38, the workflow
uses the Yarn 1 flag --frozen-lockfile but on Node 22 Corepack may activate Yarn
4+, causing a flag mismatch; pin Yarn 1 before running yarn install so
--frozen-lockfile is valid (for example, run a command prior to yarn install to
activate Yarn 1 like corepack prepare yarn@1.22.19 --activate or npm install -g
yarn@1), then keep the conditional --frozen-lockfile flag as-is; alternatively,
implement a conditional branch that uses --immutable for Yarn ≥2 and
--frozen-lockfile for Yarn 1 if you prefer not to pin.

- 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
Comment on lines 47 to +53
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

Make “Git Stuff” resilient when there’s nothing to commit.

git commit -am ... fails and breaks the job if there are no changes. Guard or ignore failures.

Apply:

-      - name: Git Stuff
+      - name: Git Stuff
         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"
+          # Commit only if there are changes
+          if ! git diff --quiet; then
+            git commit -am "stop generators from complaining about uncommitted code"
+          fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- 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
- name: Git Stuff
if: matrix.dependency-level == 'minimum'
run: |
git config user.email "you@example.com"
git config user.name "Your Name"
# Commit only if there are changes
if ! git diff --quiet; then
git commit -am "stop generators from complaining about uncommitted code"
fi
- name: Set dependency level environment variable
🤖 Prompt for AI Agents
.github/workflows/rspec-package-specs.yml around lines 47 to 53: the "Git Stuff"
step runs git commit -am which fails the job when there are no staged changes;
update the step to first check for changes (e.g., run git diff --cached --quiet
or git status --porcelain and only run git commit if changes exist) or append a
safe fallback (e.g., || true) so the workflow does not fail when there is
nothing to commit.

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