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
Changes from 1 commit
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
Prev Previous commit
Next Next commit
debug/fix for packageManager key
Judahmeek committed Jun 26, 2024
commit 196dd26ab4956cd4607ba8c51c1eb95ec7b701dc
3 changes: 3 additions & 0 deletions lib/generators/react_on_rails/base_generator.rb
Original file line number Diff line number Diff line change
@@ -76,6 +76,9 @@ def add_base_gems_to_gemfile
end

def add_yarn_dependencies
`cat package.json`
gsub_file("package.json", /^"packageManager": ".*"(,?)$/, '^"packageManager": "[email protected]"\1$')
`cat package.json`
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

Review and confirm Yarn dependencies handling in add_yarn_dependencies.

The gsub_file operation intended to update the packageManager field to "[email protected]" does not seem to be working as expected. The package.json file does not contain the packageManager field after running the operation. Please manually verify the syntax and execution of the gsub_file command to ensure it correctly updates the packageManager field.

Analysis chain

Review and confirm Yarn dependencies handling in add_yarn_dependencies.

This method updates Yarn dependencies handling. Ensure that the version handling and updates to dependencies are correct and align with the project's requirements.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the Yarn dependencies.

# Test: Check the package.json for correct dependency versions. Expect: Versions should match the project's requirements.
cat package.json | grep "react-on-rails"

Length of output: 142



Script:

#!/bin/bash
# Description: Verify the Yarn package manager version in package.json.

# Test: Check the packageManager field for the correct version.
cat package.json | grep '"packageManager": "[email protected]"'

Length of output: 60



Script:

#!/bin/bash
# Description: Verify the content of package.json after the gsub_file operation.

# Display the entire content of package.json to see if any changes are made.
cat package.json

Length of output: 2851

major_minor_patch_only = /\A\d+\.\d+\.\d+\z/
if ReactOnRails::VERSION.match?(major_minor_patch_only)
run "yarn add react-on-rails@#{ReactOnRails::VERSION} --exact"