|  | 
|  | 1 | +Description: | 
|  | 2 | +    The `react_on_rails:doctor` generator diagnoses your React on Rails setup | 
|  | 3 | +    and identifies potential configuration issues. It performs comprehensive | 
|  | 4 | +    checks on your environment, dependencies, and configuration files. | 
|  | 5 | + | 
|  | 6 | +    This command is especially useful for: | 
|  | 7 | +    • Troubleshooting setup issues | 
|  | 8 | +    • Verifying installation after running react_on_rails:install | 
|  | 9 | +    • Ensuring compatibility after upgrades | 
|  | 10 | +    • Getting help with configuration problems | 
|  | 11 | + | 
|  | 12 | +Example: | 
|  | 13 | +    # Basic diagnosis | 
|  | 14 | +    rails generate react_on_rails:doctor | 
|  | 15 | + | 
|  | 16 | +    # Verbose output showing all checks | 
|  | 17 | +    rails generate react_on_rails:doctor --verbose | 
|  | 18 | + | 
|  | 19 | +    # Show help | 
|  | 20 | +    rails generate react_on_rails:doctor --help | 
|  | 21 | + | 
|  | 22 | +Checks performed: | 
|  | 23 | +    Environment Prerequisites: | 
|  | 24 | +    • Node.js installation and version compatibility | 
|  | 25 | +    • JavaScript package manager availability (npm, yarn, pnpm, bun) | 
|  | 26 | +    • Git working directory status | 
|  | 27 | + | 
|  | 28 | +    React on Rails Packages: | 
|  | 29 | +    • React on Rails gem installation | 
|  | 30 | +    • react-on-rails NPM package installation | 
|  | 31 | +    • Version synchronization between gem and NPM package | 
|  | 32 | +    • Shakapacker configuration and installation | 
|  | 33 | + | 
|  | 34 | +    Dependencies: | 
|  | 35 | +    • React and React DOM installation | 
|  | 36 | +    • Babel preset configuration | 
|  | 37 | +    • Required development dependencies | 
|  | 38 | + | 
|  | 39 | +    Rails Integration: | 
|  | 40 | +    • React on Rails initializer configuration | 
|  | 41 | +    • Route and controller setup (Hello World example) | 
|  | 42 | +    • View helper integration | 
|  | 43 | + | 
|  | 44 | +    Webpack Configuration: | 
|  | 45 | +    • Webpack config file existence and structure | 
|  | 46 | +    • React on Rails compatibility checks | 
|  | 47 | +    • Environment-specific configuration validation | 
|  | 48 | + | 
|  | 49 | +    Development Environment: | 
|  | 50 | +    • JavaScript bundle files | 
|  | 51 | +    • Procfile.dev for development workflow | 
|  | 52 | +    • .gitignore configuration for generated files | 
|  | 53 | + | 
|  | 54 | +Options: | 
|  | 55 | +    --verbose, -v: Show detailed output for all checks, including successful ones | 
|  | 56 | +    --fix, -f:     Attempt to fix simple issues automatically (planned feature) | 
|  | 57 | + | 
|  | 58 | +Exit codes: | 
|  | 59 | +    0: All checks passed or only warnings found | 
|  | 60 | +    1: Critical errors found that prevent React on Rails from working | 
|  | 61 | + | 
|  | 62 | +For more help: | 
|  | 63 | +    • Documentation: https://github.com/shakacode/react_on_rails | 
|  | 64 | +    • Issues: https://github.com/shakacode/react_on_rails/issues | 
|  | 65 | +    • Discord: https://discord.gg/reactrails | 
0 commit comments