Skip to content

Commit af32746

Browse files
justin808claude
andauthored
Fix spec/dummy bin/dev to use correct route (#2029)
## Summary Replaces the `spec/dummy/bin/dev` symlink with a wrapper script that passes `--route=/` to the base dev script. ## Problem The `spec/dummy/bin/dev` was a symlink to the template script at `lib/generators/react_on_rails/templates/base/base/bin/dev`, which defaults to `DEFAULT_ROUTE = "hello_world"`. This is incorrect for the dummy app which needs to use the root route `/`. ## Solution Replace the symlink with a wrapper script that: - Calls the base dev script - Forces `--route=/` for the dummy app - Passes through all other command-line arguments ## Test Plan - Verified `bundle exec rubocop` passes with no offenses - Verified `bin/dev --help` works correctly in spec/dummy - Verified file is executable and has correct permissions Generated with Claude Code (https://claude.com/claude-code) <!-- Reviewable:start --> - - - This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/shakacode/react_on_rails/2029) <!-- Reviewable:end --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated internal development script configuration to improve development environment setup. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude <[email protected]>
1 parent ad73088 commit af32746

File tree

3 files changed

+27
-9
lines changed

3 files changed

+27
-9
lines changed

knip.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@ const config: KnipConfig = {
126126
'**/app-react16/**/*',
127127
// Playwright support files and helpers - generated by cypress-on-rails gem
128128
'e2e/playwright/support/**',
129+
// Components and files used dynamically by React on Rails (registered at runtime)
130+
'client/app/actions/**',
131+
'client/app/components/**',
132+
'client/app/routes/**',
133+
'client/app/startup/**',
134+
'client/app/store/**',
129135
],
130136
project: ['**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}!', 'config/webpack/*.js'],
131137
paths: {
@@ -156,6 +162,18 @@ const config: KnipConfig = {
156162
'url-loader',
157163
// Transitive dependency of shakapacker but listed as direct dependency
158164
'webpack-merge',
165+
// Dependencies not detected in production mode
166+
'@babel/runtime',
167+
'mini-css-extract-plugin',
168+
'css-loader',
169+
'sass',
170+
'sass-loader',
171+
// Dependencies used dynamically by React on Rails
172+
'create-react-class',
173+
'react-helmet',
174+
'@types/react-helmet',
175+
'react-redux',
176+
'react-router-dom',
159177
],
160178
},
161179
},
Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
#!/usr/bin/env bash
1+
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
23

3-
if ! command -v foreman &> /dev/null
4-
then
5-
echo "Installing foreman..."
6-
gem install foreman
7-
fi
8-
9-
foreman start -f Procfile.dev
4+
# This script calls the base dev script with a fixed route for the dummy app
5+
exec File.join(__dir__, "../../../../lib/generators/react_on_rails/templates/base/base/bin/dev"), "--route=/", *ARGV

spec/dummy/bin/dev

Lines changed: 0 additions & 1 deletion
This file was deleted.

spec/dummy/bin/dev

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
4+
# This script calls the base dev script with a fixed route for the dummy app
5+
exec File.join(__dir__, "../../../lib/generators/react_on_rails/templates/base/base/bin/dev"), "--route=/", *ARGV

0 commit comments

Comments
 (0)