Commit 81e717e
Fix beta/RC version handling in generator
The regex for detecting valid npm package versions only matched stable
releases (e.g., 16.2.0) but not pre-release versions (e.g., 16.2.0-beta.10).
This caused the generator to install 'react-on-rails' (latest stable)
instead of '[email protected]', leading to version mismatch
errors when running the generator with beta versions.
Changes:
- Updated regex from /\A\d+\.\d+\.\d+\z/ to /\A\d+\.\d+\.\d+(-[a-zA-Z0-9.]+)?\z/
- Now matches stable (16.2.0), beta (16.2.0-beta.10), RC (16.1.0-rc.1), etc.
- Updated comments to explain the regex and why exact versions are needed
- Improved warning message when version format is unrecognized
This fixes the version mismatch error seen in CI:
Package: 16.1.2 (latest stable from npm)
Gem: 16.2.0.beta.10 (current beta version)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 311d3a1 commit 81e717e
1 file changed
+12
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
131 | 136 | | |
132 | 137 | | |
133 | | - | |
| 138 | + | |
| 139 | + | |
134 | 140 | | |
135 | 141 | | |
136 | 142 | | |
| |||
0 commit comments