Commit ae5425b
Fix generator validation by using environment variable (#1923)
* Fix generator validation by using environment variable
The ARGV-based check for generator runtime was unreliable because Rails
can modify or clear ARGV during initialization. This caused version
validation to run during generator execution, before the react-on-rails
npm package was installed, resulting in validation errors.
This fix restores the ENV variable approach:
- Generator sets REACT_ON_RAILS_SKIP_VALIDATION=true at start
- Engine checks this ENV var first (before ARGV check)
- Generator clears ENV var in ensure block after completion
The ENV variable persists through Rails initialization, making it more
reliable than ARGV for detecting generator context.
Fixes failing CI tests in examples (3.2, minimum) and examples (3.4, latest)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>
* Add workflow_dispatch trigger to enable manual workflow runs
---------
Co-authored-by: Claude <[email protected]>1 parent a1c71ea commit ae5425b
File tree
5 files changed
+33
-0
lines changed- .github/workflows
- lib
- generators/react_on_rails
- react_on_rails
- spec/react_on_rails
5 files changed
+33
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
| |||
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
| 62 | + | |
58 | 63 | | |
59 | 64 | | |
60 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
23 | 29 | | |
24 | 30 | | |
25 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
16 | 36 | | |
17 | 37 | | |
18 | 38 | | |
| |||
0 commit comments