Skip to content

Commit 8d178ca

Browse files
justin808claude
andcommitted
Fix webpack config issues and RuboCop violations
- Fix script/convert to prevent incorrect webpack function replacements - Fix line length violations in pack_generator_spec.rb 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent fa86509 commit 8d178ca

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

script/convert

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ gsub_file_content(
5353
# move(file, file.gsub("-react16", ""))
5454
# end
5555

56-
gsub_file_content("../spec/dummy/config/webpack/commonWebpackConfig.js", /generateWebpackConfig(\(\))?/,
57-
"webpackConfig")
58-
59-
gsub_file_content("../spec/dummy/config/webpack/webpack.config.js", /generateWebpackConfig(\(\))?/, "webpackConfig")
56+
# These replacements were incorrect - generateWebpackConfig() is the correct function from shakapacker
57+
# gsub_file_content("../spec/dummy/config/webpack/commonWebpackConfig.js", /generateWebpackConfig(\(\))?/,
58+
# "webpackConfig")
59+
#
60+
# gsub_file_content("../spec/dummy/config/webpack/webpack.config.js", /generateWebpackConfig(\(\))?/, "webpackConfig")

spec/react_on_rails/dev/pack_generator_spec.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@
99
command = "bundle exec rake react_on_rails:generate_packs"
1010
allow(described_class).to receive(:system).with(command).and_return(true)
1111

12-
expect { described_class.generate(verbose: true) }.to output(/📦 Generating React on Rails packs.../).to_stdout_from_any_process
12+
expect { described_class.generate(verbose: true) }
13+
.to output(/📦 Generating React on Rails packs.../).to_stdout_from_any_process
1314
end
1415

1516
it "runs pack generation successfully in quiet mode" do
1617
command = "bundle exec rake react_on_rails:generate_packs > /dev/null 2>&1"
1718
allow(described_class).to receive(:system).with(command).and_return(true)
1819

19-
expect { described_class.generate(verbose: false) }.to output(/📦 Generating packs\.\.\. ✅/).to_stdout_from_any_process
20+
expect { described_class.generate(verbose: false) }
21+
.to output(/📦 Generating packs\.\.\. ✅/).to_stdout_from_any_process
2022
end
2123

2224
it "exits with error when pack generation fails" do

0 commit comments

Comments
 (0)