Fix Redux generator creating unnecessary CSS in ror_components directory#1826
Fix Redux generator creating unnecessary CSS in ror_components directory#1826
Conversation
Pass redux option to base generator to prevent it from creating HelloWorld/ror_components directory and CSS files when Redux is used. The base generator now correctly receives the redux option and skips creating non-Redux component structure when --redux flag is used. Fixes #1821 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Add test to verify that Redux installations do not create the HelloWorld/ror_components directory that should only exist for non-Redux installations. This test prevents regression of issue #1821 where Redux generator was incorrectly creating CSS files in the wrong directory structure. The test runs in both JavaScript and TypeScript Redux contexts to ensure complete coverage. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
WalkthroughAdds redux: options.redux? to the base installer invocation when TypeScript is enabled and introduces tests ensuring non-Redux HelloWorld CSS/components aren’t generated under Redux paths. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer (CLI)
participant IG as InstallGenerator
participant BI as BaseInstaller
Dev->>IG: run install (with --typescript, --redux flags)
IG->>IG: Evaluate options (typescript?, redux?)
IG->>BI: invoke install(redux: options.redux?, typescript: true, ...)
Note right of BI: Receives redux flag regardless of TS path
BI-->>IG: Generate files per flags
IG-->>Dev: Installation complete
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (2){Gemfile,Rakefile,**/*.{rb,rake,gemspec,ru}}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
{Gemfile,Rakefile,**/*.{rb,rake,gemspec,ru,js,jsx,ts,tsx,json,yml,yaml,md,css,scss}}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🧠 Learnings (1)📚 Learning: 2025-09-16T08:01:11.146ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Code Review: Fix Redux generator creating unnecessary CSS in ror_components directory✅ SummaryThis is an excellent fix with high-quality implementation. The PR correctly identifies and solves the root cause of issue #1821. 🎯 Code Quality: ExcellentStrengths:
Architecture alignment:
🧪 Test Coverage: ExcellentStrengths:
Minor suggestion: it "does not create non-Redux HelloWorld ror_components directory" do
# Redux installations use HelloWorldApp, not HelloWorld base component
assert_no_directory "app/javascript/src/HelloWorld/ror_components"
assert_no_file "app/javascript/src/HelloWorld/ror_components/HelloWorld.module.css"
endHowever, this is purely optional - the test name is already quite clear. 🐛 Potential Issues: None Identified
⚡ Performance: No Impact
🔒 Security: No Concerns
📋 Suggestions for Improvement
✨ Final VerdictStatus: ✅ APPROVE - Ready to Merge This PR demonstrates:
The fix is minimal, correct, well-tested, and follows all project conventions. Great work! 🎉 Review performed by Claude Code following project guidelines in CLAUDE.md |
Summary
Problem
Issue #1821: Redux generator was creating CSS files in two incorrect locations:
HelloWorld/ror_components/HelloWorld.module.css(should not exist)HelloWorldApp/components/HelloWorld.module.css(legitimate, used by component chain)Root Cause
The install generator was not passing the
reduxoption to the base generator, causing it to run in non-Redux mode and create files it shouldn't.Solution
Fix #1: Pass Redux Option to Base Generator
Fix #2: Add Test Coverage
Added test in shared examples to verify Redux installations do NOT create
HelloWorld/ror_componentsdirectory. This test runs in both JavaScript and TypeScript Redux contexts.Testing
Impact
Fixes #1821
🤖 Generated with Claude Code
This change is
Summary by CodeRabbit
Bug Fixes
Tests