-
-
Notifications
You must be signed in to change notification settings - Fork 632
Open
Labels
P0Merge this weekMerge this week
Description
Follow-up items from PR #2375 (create-react-on-rails-app CLI Phase 1).
Validation improvements
- App name validation: Require names start with a letter (
/^[a-zA-Z][a-zA-Z0-9_-]*$/) — names like123appor-myappwill causerails newto fail or behave poorly - Minimum Rails version check:
validateRailsonly checks presence, not version — Rails 5 or 6 would produce an incompatible app. Add minimum version check (e.g., Rails 6.1+ or 7.0+)
Code quality
- Unreachable else branch in
buildGeneratorArgs: Since--ignore-warningsis always pushed,args.length > 0is always true — simplify the ternary -
process.exit(1)increateAppprevents composability: Consider havingcreateAppthrow or return a result instead, so the CLI entry point handles the exit and the function is testable - Add JSDoc on
execLive/execLiveArgs: Document shell-injection contract — callers must ensure command is shell-safe -
rm -rfincleanscript is not cross-platform: Usenode -e "require('fs').rmSync('./lib',{recursive:true,force:true})"orrimraffor Windows compatibility
Testing
- Add
validateAllsuccess-case test: Current tests verify the failure path but don't assertallValid === truewhen all prerequisites pass - End-to-end test: Create an actual app with
npx create-react-on-rails-app test-appand verify it boots (marked incomplete in PR test plan)
Documentation
- Update proposal doc to match implementation: Listed dependencies (
chalk ^5.0.0,ora,prompts) diverge from actual implementation (chalk ^4.1.2for CJS, noora/prompts)
Future phases (from PR description and issue #1637)
- Yarn support: Original issue Proposal for New CLI Tool: create-react-on-rails-app to Streamline Project Initialization #1637 requested yarn_classic and yarn_berry — only npm/pnpm supported in Phase 1
- Redux templates
- Tailwind CSS integration
- Rspack bundler support:
--rspackflag is wired up but needs end-to-end testing - React on Rails Pro (
--proflag)
Build pipeline
- Consider topological build: Root
buildscript chains 4 sequentialpnpm --filter ... run buildcalls — if packages are independent,pnpm -r run buildwould be simpler
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P0Merge this weekMerge this week