Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replace Webpacker with Shakapacker #1622

Merged
merged 81 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from 70 commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
156df7f
fix: replace Webpacker with Shakapacker
adriangohjw May 20, 2024
6df4e8d
add changelog entry
Judahmeek May 21, 2024
5051a55
update gemfile to use shakapacker 8.0.0
adriangohjw May 21, 2024
6212747
Replace Webpacker with Shakapacker
adriangohjw May 21, 2024
39b32e2
Update WebpackerUtils to ShakapackerUtils
adriangohjw May 21, 2024
8c0d019
(spec) package.json - update shakapacker to v8 + add "packageManager"
adriangohjw May 21, 2024
7723165
fix specs - Update Webpacker to Shakapacker
adriangohjw May 21, 2024
797ea16
Fix rubocop linting error
adriangohjw May 21, 2024
f1c6fd7
remove post-install action for shakapacker < v7
adriangohjw May 21, 2024
8559b2c
fix: updated test description and context tag
adriangohjw May 21, 2024
d832db4
update min. shakapacker version to 7.2.1
adriangohjw May 21, 2024
4609d03
use adapter method for Shakapacker
Judahmeek Jun 14, 2023
812c94c
Ci fixes & linting
Judahmeek Jun 12, 2024
328aacb
per review
Judahmeek Jun 12, 2024
52c0ea8
Ci fix for changed-files
Judahmeek Jun 13, 2024
3711e9c
revert changes to install generator
Judahmeek Jun 13, 2024
7810da0
WIP
Judahmeek Jun 14, 2024
0d82c02
still wip
Judahmeek Jun 14, 2024
2ec90b8
getting there?
Judahmeek Jun 14, 2024
ae8fba8
more wip
Judahmeek Jun 14, 2024
bfaf244
remove appraisal and dynamically modify gemfiles
Judahmeek Jun 14, 2024
d33ad0a
wip again
Judahmeek Jun 14, 2024
446c090
more fixes
Judahmeek Jun 14, 2024
8a0003e
fixes more
Judahmeek Jun 14, 2024
15db710
still fixing
Judahmeek Jun 14, 2024
789958e
hopefully getting somewhere
Judahmeek Jun 14, 2024
96bcb5f
more fixes
Judahmeek Jun 15, 2024
e82d924
resolve install generator errors
Judahmeek Jun 25, 2024
6cc3d4f
additional fixes
Judahmeek Jun 25, 2024
25edd25
debugging integration failure
Judahmeek Jun 25, 2024
de5bfaf
add log statements
Judahmeek Jun 25, 2024
07f2e72
use info from log statements to resolve issues
Judahmeek Jun 26, 2024
19ddd8c
fix invalid job configurations
Judahmeek Jun 26, 2024
5cc7a81
add log statements to debug new issues
Judahmeek Jun 26, 2024
62c69db
further debugging
Judahmeek Jun 26, 2024
4fac40f
fix debug statement
Judahmeek Jun 26, 2024
4c9568a
fix other debug statement
Judahmeek Jun 26, 2024
32945f7
maybe fixes
Judahmeek Jun 26, 2024
0f3bdcd
fix maybes
Judahmeek Jun 26, 2024
861d544
resolve pack gen errors
Judahmeek Jun 26, 2024
60b0ec0
whatever
Judahmeek Jun 26, 2024
e2090b4
maybe maybe
Judahmeek Jun 26, 2024
1017815
all integration specs should be passing
Judahmeek Jun 26, 2024
f3be6af
linting
Judahmeek Jun 26, 2024
24c8d5a
further linting
Judahmeek Jun 26, 2024
00827e4
add example debug statement
Judahmeek Jun 26, 2024
0f6ddcb
add missing method
Judahmeek Jun 26, 2024
15cbe82
focus on generator job
Judahmeek Jun 26, 2024
b6d0201
debug yarn install
Judahmeek Jun 26, 2024
196dd26
debug/fix for packageManager key
Judahmeek Jun 26, 2024
6ba18dc
separate tasks by packer type
Judahmeek Jun 26, 2024
d6300a3
skip corepack check
Judahmeek Jun 26, 2024
8b673f2
debug more
Judahmeek Jun 26, 2024
2e94227
potential fix
Judahmeek Jun 26, 2024
321adf0
try again
Judahmeek Jun 26, 2024
6444653
closer
Judahmeek Jun 26, 2024
8162ee7
fail-fast false
Judahmeek Jun 26, 2024
a694c99
closer
Judahmeek Jun 26, 2024
2a5d78d
no point in matrix if shakapacker v6 doesn't support node 16
Judahmeek Jun 26, 2024
aaa2140
one more fix
Judahmeek Jun 26, 2024
afe89b3
Revert "focus on generator job"
Judahmeek Jun 26, 2024
428fd66
remove debug statements
Judahmeek Jun 27, 2024
ed3806f
Revert "no point in matrix if shakapacker v6 doesn't support node 16"
Judahmeek Jun 27, 2024
21fa4ea
revert 'one more fix'
Judahmeek Jun 27, 2024
43d15d0
remove all jobs except generators again
Judahmeek Jun 27, 2024
9b063e7
use Node v20 for all gen tests
Judahmeek Jun 27, 2024
6a640c5
add debug statement
Judahmeek Jun 27, 2024
2726d61
move example_type initialization logic to run_rspec file
Judahmeek Jun 27, 2024
4ca8cf1
linting & debug statement removal
Judahmeek Jun 27, 2024
a03e171
Revert "remove all jobs except generators again"
Judahmeek Jun 27, 2024
3a8df96
restore shakapacker to Gemfile & package.json
Judahmeek Jun 28, 2024
d77929e
restore dumy apps rake task
Judahmeek Jun 28, 2024
4c3cb9b
use shakapacker v8 by default
Judahmeek Jun 28, 2024
1915582
create a script to convert shakapacker support from v8 to v6
Judahmeek Jun 28, 2024
d08a465
use conversion script for CI
Judahmeek Jun 28, 2024
2061f3a
linting
Judahmeek Jun 28, 2024
82a2aa7
fixes?
Judahmeek Jun 28, 2024
b5e7939
final fixes?
Judahmeek Jun 28, 2024
4cce360
update Contributing doc
Judahmeek Jun 28, 2024
c96a47e
using_xpacker? > using_xpacker_const?
Judahmeek Jun 28, 2024
b8c5d28
linting
Judahmeek Jun 28, 2024
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
17 changes: 12 additions & 5 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@ on:

jobs:
examples:
env:
SKIP_YARN_COREPACK_CHECK: 0
strategy:
fail-fast: false
matrix:
versions: ['oldest', 'newest']
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Get changed files
id: changed-files-specific
id: changed-files
uses: tj-actions/changed-files@v44
with:
files: |
Expand All @@ -26,7 +32,7 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
ruby-version: ${{ matrix.versions == 'oldest' && '3.0' || '3.3' }}
bundler: 2.5.9
- name: Setup Node
uses: actions/setup-node@v3
Expand All @@ -50,16 +56,17 @@ jobs:
uses: actions/cache@v3
with:
path: vendor/bundle
key: v5-package-app-gem-cache-${{ hashFiles('react_on_rails.gemspec') }}
key: package-app-gem-cache-${{ hashFiles('react_on_rails.gemspec') }}-${{ hashFiles('Gemfile.development_dependencies') }}-${{ matrix.versions }}
- id: get-sha
run: echo "::set-output name=sha::$(git rev-parse HEAD)"
- name: Install Node modules with Yarn for renderer package
run: |
yarn install --no-progress --no-emoji
yarn run eslint -v
sudo yarn global add yalc
- name: yalc publish for react-on-rails
run: yalc publish
- name: Dynamically add the right shakapacker version to the Gemfile
run: echo "gem 'shakapacker', '~> ${{ matrix.versions == 'oldest' && '6.6.0' || '8.0.0' }}'" >> Gemfile
- name: Install Ruby Gems for package
run: bundle lock --add-platform 'x86_64-linux' && bundle check --path=vendor/bundle || bundle _2.5.9_ install --path=vendor/bundle --jobs=4 --retry=3
- name: Ensure minimum required Chrome version
Expand All @@ -78,7 +85,7 @@ jobs:
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- name: Main CI
if: steps.changed-files.outputs.any_changed == 'true'
run: bundle exec rake run_rspec:examples
run: bundle exec rake run_rspec:${{ matrix.versions == 'oldest' && 'web' || 'shaka' }}packer_examples
- name: Store test results
uses: actions/upload-artifact@v3
with:
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/lint-js-and-ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ on:

jobs:
build:
strategy:
matrix:
ruby: [3]
node: [20]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand All @@ -21,12 +17,12 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
ruby-version: 3
bundler: 2.5.9
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
node-version: 20
- name: Print system information
run: |
echo "Linux release: "; cat /etc/issue
Expand All @@ -45,12 +41,10 @@ jobs:
uses: actions/cache@v3
with:
path: vendor/bundle
key: v5-package-app-gem-cache-${{ hashFiles('react_on_rails.gemspec') }}
key: package-app-gem-cache-${{ hashFiles('react_on_rails.gemspec') }}-${{ hashFiles('Gemfile.development_dependencies') }}-oldest
- name: Install Node modules with Yarn for renderer package
run: |
yarn install --no-progress --no-emoji
yarn run eslint -v
sudo yarn global add yalc
- 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: Linting of Ruby
Expand Down
50 changes: 31 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ jobs:
build-dummy-app-webpack-test-bundles:
strategy:
matrix:
ruby: [3.0, 3.3]
node: [16, 20]
versions: ['oldest', 'newest']
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand All @@ -20,7 +19,7 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
ruby-version: ${{ matrix.versions == 'oldest' && '3.0' || '3.3' }}
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 @@ -29,7 +28,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
node-version: ${{ matrix.versions == 'oldest' && '16' || '20' }}
- name: Print system information
run: |
echo "Linux release: "; cat /etc/issue
Expand All @@ -55,36 +54,39 @@ jobs:
uses: actions/cache@v3
with:
path: spec/dummy/node_modules
key: v5-dummy-app-node-modules-cache-${{ hashFiles('spec/dummy/yarn.lock') }}
key: dummy-app-node-modules-cache-${{ hashFiles('spec/dummy/package.json') }}-${{ matrix.versions }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Inconsistent Caching Strategy Across Workflows

Upon reviewing the caching keys across different workflow files, we have identified multiple inconsistencies:

  • Redundant Keys: There are multiple entries for dummy-app-node-modules-cache-${{ hashFiles('spec/dummy/package.json') }}-${{ matrix.versions }} and v5-package-node-modules-cache-${{ hashFiles('yarn.lock') }} in main.yml.
  • Inconsistent Naming Conventions: Different naming conventions are used for similar caching purposes, which can lead to confusion and potential cache misses.

Please address the following:

  • Consolidate Redundant Keys: Ensure each cache key is unique and used consistently across workflows.
  • Standardize Naming Conventions: Adopt a consistent naming strategy for cache keys to reflect their purpose and dependencies clearly.

Files to review:

  • .github/workflows/main.yml
  • .github/workflows/rspec-package-specs.yml
  • .github/workflows/examples.yml
  • .github/workflows/package-js-tests.yml
  • .github/workflows/lint-js-and-ruby.yml
Analysis chain

Check consistency in caching strategy.

Ensure the caching keys are consistent across different workflows and reflect the actual dependencies being installed. This change appears correct, but verifying consistency across workflows would be beneficial.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Check consistency of caching strategy across workflows.

# Test: Search for cache key patterns across all workflow files.
rg --type yaml "key:" .github/workflows/

Length of output: 2126

- 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
- run: cd spec/dummy && yarn add "shakapacker@${{ matrix.versions == 'oldest' && '6.6.0' || '8.0.0' }}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Avoid non-idempotent script execution for adding Shakapacker.

Appending directly to the Gemfile in a CI script can lead to non-idempotent behavior if the script runs multiple times. Consider checking if the gem entry already exists before appending.

- echo "gem 'shakapacker', '~> ${{ matrix.versions == 'oldest' && '6.6.0' || '8.0.0' }}" >> spec/dummy/Gemfile
+ if ! grep -q "gem 'shakapacker'" spec/dummy/Gemfile; then
+   echo "gem 'shakapacker', '~> ${{ matrix.versions == 'oldest' && '6.6.0' || '8.0.0' }}" >> spec/dummy/Gemfile
+ fi

Also applies to: 147-147

- name: Save dummy app ruby gems to cache
uses: actions/cache@v3
with:
path: spec/dummy/vendor/bundle
key: v5-dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}
key: dummy-app-gem-cache-${{ hashFiles('react_on_rails.gemspec') }}-${{ hashFiles('Gemfile.development_dependencies') }}-${{ matrix.versions }}
- name: Dynamically add the right shakapacker version to the Gemfile
run: echo "gem 'shakapacker', '~> ${{ matrix.versions == 'oldest' && '6.6.0' || '8.0.0' }}'" >> spec/dummy/Gemfile
Copy link
Contributor

@coderabbitai coderabbitai bot Jun 27, 2024

Choose a reason for hiding this comment

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

Ensure dynamic Gemfile updates are idempotent.

Appending directly to the Gemfile in a CI script can lead to non-idempotent behavior if the script runs multiple times. Consider checking if the gem entry already exists before appending.

- echo "gem 'shakapacker', '~> ${{ matrix.versions == 'oldest' && '6.6.0' || '8.0.0' }}'" >> Gemfile
+ if ! grep -q "gem 'shakapacker'" Gemfile; then
+   echo "gem 'shakapacker', '~> ${{ matrix.versions == 'oldest' && '6.6.0' || '8.0.0' }}" >> Gemfile
+ 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
run: echo "gem 'shakapacker', '~> ${{ matrix.versions == 'oldest' && '6.6.0' || '8.0.0' }}'" >> spec/dummy/Gemfile
run: |
if ! grep -q "gem 'shakapacker'" spec/dummy/Gemfile; then
echo "gem 'shakapacker', '~> ${{ matrix.versions == 'oldest' && '6.6.0' || '8.0.0' }}" >> spec/dummy/Gemfile
fi

Copy link
Member

Choose a reason for hiding this comment

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

Let's have the latest version back in spec/dummy and have the CI script modify the gemfile to test the older version.

Copy link
Contributor

Choose a reason for hiding this comment

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

@justin808, I will adjust the CI script to ensure that the spec/dummy Gemfile defaults to the latest version of Shakapacker. The CI script will then conditionally modify the Gemfile to test the older version when necessary. Here's the updated script section:

- name: Set default Shakapacker version in Gemfile
  run: |
    if ! grep -q "gem 'shakapacker'" spec/dummy/Gemfile; then
      echo "gem 'shakapacker', '~> 8.0.0'" >> spec/dummy/Gemfile
    fi
- name: Conditionally use older Shakapacker version for testing
  if: matrix.versions == 'oldest'
  run: |
    sed -i "s/gem 'shakapacker', '~> 8.0.0'/gem 'shakapacker', '~> 6.6.0'/" spec/dummy/Gemfile

This setup ensures that the Gemfile initially sets the latest version of Shakapacker (8.0.0). If the CI is running with the 'oldest' matrix version, it will replace this with the older version (6.6.0). This approach maintains idempotency and aligns with the testing requirements.

- name: Install Ruby Gems for dummy app
run: cd spec/dummy && bundle lock --add-platform 'x86_64-linux' && bundle check --path=vendor/bundle || bundle _2.5.9_ install --path=vendor/bundle --jobs=4 --retry=3
- 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 && yarn run build:test
run: cd spec/dummy && rm -rf public/webpack/test && yarn build:rescript && RAILS_ENV=test NODE_ENV=test bin/${{ matrix.versions == 'oldest' && 'web' || 'shaka' }}packer
- id: get-sha
run: echo "::set-output name=sha::$(git rev-parse HEAD)"
- name: Save test webpack bundles to cache (for build number checksum used by rspec job)
uses: actions/cache/save@v3
with:
path: spec/dummy/public/webpack
key: v5-dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}
key: dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}-${{ matrix.versions }}

main:
dummy-app-integration-tests:
needs: build-dummy-app-webpack-test-bundles
strategy:
fail-fast: false
matrix:
ruby: [3.0, 3.3]
node: [16, 20]
versions: ['oldest', 'newest']
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand All @@ -93,12 +95,12 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
ruby-version: ${{ matrix.versions == 'oldest' && '3.0' || '3.3' }}
bundler: 2.5.9
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
node-version: ${{ matrix.versions == 'oldest' && '16' || '20' }}
Copy link
Member

Choose a reason for hiding this comment

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

22 not 20

- name: Print system information
run: |
echo "Linux release: "; cat /etc/issue
Expand All @@ -117,33 +119,37 @@ jobs:
uses: actions/cache@v3
with:
path: vendor/bundle
key: v5-package-app-gem-cache-${{ hashFiles('react_on_rails.gemspec') }}
key: package-app-gem-cache-${{ hashFiles('react_on_rails.gemspec') }}-${{ hashFiles('Gemfile.development_dependencies') }}-${{ matrix.versions }}
- name: Save dummy app ruby gems to cache
uses: actions/cache@v3
with:
path: spec/dummy/vendor/bundle
key: v5-dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}
key: dummy-app-gem-cache-${{ hashFiles('react_on_rails.gemspec') }}-${{ hashFiles('Gemfile.development_dependencies') }}-${{ matrix.versions }}
- name: Save spec/dummy/node_modules to cache
uses: actions/cache@v3
with:
path: spec/dummy/node_modules
key: v5-dummy-app-node-modules-cache-${{ hashFiles('spec/dummy/yarn.lock') }}
key: dummy-app-node-modules-cache-${{ hashFiles('spec/dummy/package.json') }}-${{ matrix.versions }}
- id: get-sha
run: echo "::set-output name=sha::$(git rev-parse HEAD)"
- name: Save test webpack bundles to cache (for build number checksum used by rspec job)
uses: actions/cache@v3
with:
path: spec/dummy/public/webpack
key: v5-dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}
key: dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}-${{ matrix.versions }}
- name: Install Node modules with Yarn for renderer package
run: |
yarn install --no-progress --no-emoji
yarn run eslint -v
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
- run: cd spec/dummy && yarn add "shakapacker@${{ matrix.versions == 'oldest' && '6.6.0' || '8.0.0' }}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Potential issue with Shakapacker version addition and dynamic Gemfile update.

The yarn add command is used twice in the workflow script. While yarn add is generally idempotent and should not introduce duplicate dependencies, the dynamic addition of Shakapacker versions in the Gemfile is not idempotent and results in multiple entries. This could lead to maintenance challenges and state inconsistencies across CI runs. Ensure that the Gemfile update process is idempotent.

  • File: .github/workflows/main.yml
  • Lines: 147-147, 149-149
Analysis chain

Potential issue with Shakapacker version addition and dynamic Gemfile update.

The repeated addition of Shakapacker versions and dynamic Gemfile updates could lead to maintenance challenges. Ensure that these operations are idempotent and do not introduce state inconsistencies across CI runs.

Also applies to: 149-149

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify idempotence of dynamic Gemfile updates.

# Test: Run the Gemfile update multiple times and check for duplicate entries.
for i in {1..3}; do
  echo "gem 'shakapacker', '~> 8.0.0'" >> Gemfile
done
grep "gem 'shakapacker'" Gemfile | wc -l

Length of output: 257



Script:

#!/bin/bash
# Description: Verify idempotence of `yarn add` in the workflow script.

# Check if `yarn add` is used in a way that could introduce duplicate dependencies.
grep -E "yarn add" .github/workflows/main.yml

Length of output: 263

- name: Dynamically add the right shakapacker version to Gemfiles
run: |
echo "gem 'shakapacker', '~> ${{ matrix.versions == 'oldest' && '6.6.0' || '8.0.0' }}'" >> Gemfile
Copy link
Member

Choose a reason for hiding this comment

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

Have https://github.com/shakacode/react_on_rails/blob/master/Gemfile.development_dependencies#L3 use the latest, and use a couple lines of bash code to change to the 6.6.0 when needed.

echo "gem 'shakapacker', '~> ${{ matrix.versions == 'oldest' && '6.6.0' || '8.0.0' }}'" >> spec/dummy/Gemfile
- name: Install Ruby Gems for package
run: bundle lock --add-platform 'x86_64-linux' && bundle check --path=vendor/bundle || bundle _2.5.9_ install --path=vendor/bundle --jobs=4 --retry=3
- name: Install Ruby Gems for dummy app
Expand All @@ -164,8 +170,14 @@ jobs:
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- name: generate file system-based packs
run: cd spec/dummy && RAILS_ENV=test bundle exec rake react_on_rails:generate_packs
- name: Git Stuff
run: |
git config user.email "[email protected]"
git config user.name "Your Name"
git commit -am "stop generators from complaining about uncommitted code"
- run: cd spec/dummy && bundle info shakapacker
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider the implications of committing within CI.

Committing changes within a CI workflow can lead to unexpected behavior and should generally be avoided unless specifically intended as part of the workflow.

- name: Main CI
run: bundle exec rake run_rspec:all_but_examples
run: bundle exec rake run_rspec:all_dummy
- name: Store test results
uses: actions/upload-artifact@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/package-js-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
build:
strategy:
matrix:
node: [16, 20]
versions: ['oldest', 'newest']
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand All @@ -20,7 +20,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
node-version: ${{ matrix.versions == 'oldest' && '16' || '20' }}
- name: Print system information
run: |
echo "Linux release: "; cat /etc/issue
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/rspec-package-specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ on:
pull_request:

jobs:
build:
rspec-package-tests:
strategy:
matrix:
ruby: [3.0, 3.3]
node: [16, 20]
versions: ['oldest', 'newest']
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand All @@ -20,7 +19,7 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
ruby-version: ${{ matrix.versions == 'oldest' && '3.0' || '3.3' }}
bundler: 2.5.9
- name: Print system information
run: |
Expand All @@ -35,9 +34,16 @@ jobs:
uses: actions/cache@v3
with:
path: vendor/bundle
key: v5-package-app-gem-cache-${{ hashFiles('react_on_rails.gemspec') }}
key: package-app-gem-cache-${{ hashFiles('react_on_rails.gemspec') }}-${{ matrix.versions }}
- name: Dynamically add the right shakapacker version to the Gemfile
run: echo "gem 'shakapacker', '~> ${{ matrix.versions == 'oldest' && '6.6.0' || '8.0.0' }}'" >> Gemfile
- 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
run: |
git config user.email "[email protected]"
git config user.name "Your Name"
git commit -am "stop generators from complaining about uncommitted code"
- name: Run rspec tests
run: bundle exec rspec spec/react_on_rails
- name: Store test results
Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@ Changes since the last non-beta release.
#### Fixed
Copy link
Contributor

Choose a reason for hiding this comment

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

Ensure proper spacing around headings and lists for better readability and markdown linting.

+ 
#### Fixed
- Resolves possible thrown error for precompile checks with Shakapacker. [PR 1622](https://github.com/shakacode/react_on_rails/pull/1622) by [adriangohjw](https://github.com/adriangohjw)
+ 

+ 
- Generator errors with Shakapacker v8+ fixed [PR 1629](https://github.com/shakacode/react_on_rails/pull/1629) by [vaukalak]
+ 

Also applies to: 27-27

Tools
Markdownlint

21-21: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines

- Address a number of typos and grammar mistakes [PR 1631](https://github.com/shakacode/react_on_rails/pull/1631) by [G-Rath](https://github.com/G-Rath)

#### Added

- Adds an adapter module & improves test suite to support all versions of Shakapacker. [PR 1622](https://github.com/shakacode/react_on_rails/pull/1622) by [adriangohjw](https://github.com/adriangohjw)

### [14.0.2] - 2024-06-11

#### Fixed
- Project initialization with Shakapacker v8+ fixed [PR 1629](https://github.com/shakacode/react_on_rails/pull/1629) by [vaukalak](https://github.com/vaukalak)
- Generator errors with Shakapacker v8+ fixed [PR 1629](https://github.com/shakacode/react_on_rails/pull/1629) by [vaukalak](https://github.com/vaukalak)
Copy link
Contributor

Choose a reason for hiding this comment

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

Ensure proper spacing around lists for better readability and markdown linting.

+ 
- Generator errors with Shakapacker v8+ fixed [PR 1629](https://github.com/shakacode/react_on_rails/pull/1629) by [vaukalak]
+
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
- Generator errors with Shakapacker v8+ fixed [PR 1629](https://github.com/shakacode/react_on_rails/pull/1629) by [vaukalak](https://github.com/vaukalak)
+
- Generator errors with Shakapacker v8+ fixed [PR 1629](https://github.com/shakacode/react_on_rails/pull/1629) by [vaukalak]
+
Tools
Markdownlint

31-31: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines


### [14.0.1] - 2024-05-16

Expand Down
21 changes: 8 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,6 @@ yarn
yarn build
```

Or run this which builds the yarn package, then the webpack files for spec/dummy, and runs tests in
spec/dummy.


```sh
# Optionally change default selenium_firefox driver
export DRIVER=selenium_firefox
cd react_on_rails/
yarn run dummy:spec
```

### Run NPM JS tests

```sh
Expand All @@ -153,11 +142,17 @@ yarn test
### Run spec/dummy tests

```sh
cd react_on_rails/spec/dummy
cd react_on_rails
npm -g i yalc
bundle && yarn
yalc publish
cd spec/dummy
bundle && yarn
yarn add shakapacker
Copy link
Member

Choose a reason for hiding this comment

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

remove

Copy link
Member

Choose a reason for hiding this comment

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

add instructions on how to locally test the older shakapacker

rspec
```

### Run most tests and linting
### Run package tests and linting
Copy link
Contributor

Choose a reason for hiding this comment

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

Adding a section for running package tests and linting enhances the documentation. Consider providing more details about what yarn run check does.

+ ### More on Running Package Tests and Linting
+ This section will cover what `yarn run check` includes, such as which tests and linters are run, and any additional setup required.
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
### Run package tests and linting
### Run package tests and linting
### More on Running Package Tests and Linting
This section will cover what `yarn run check` includes, such as which tests and linters are run, and any additional setup required.


```sh
cd react_on_rails/
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.development_dependencies
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# frozen_string_literal: true

gem "shakapacker", "7.2.1"
gem "bootsnap", require: false
gem "rails", "~> 7.1"
gem "rake", "~> 13.2.1"

gem "sqlite3", "~> 1.6"
gem "sass-rails", "~> 6.0"
Expand Down
Loading
Loading