Commit 1cee1e5
Convert Ruby gem version format to npm semver format
Ruby gem versions use dots for pre-release versions (e.g., 16.2.0.beta.10)
while npm requires hyphens (16.2.0-beta.10) to match semver spec.
This commit fixes the generator to convert between the two formats so that
beta/RC/alpha versions are installed correctly.
Before this fix:
- Generator would try to install [email protected] (invalid npm version)
- This would fail to match any published version
- yalc link would work, but package.json would have wrong version
- Version checker would then fail due to version mismatch
After this fix:
- Generator converts 16.2.0.beta.10 → 16.2.0-beta.10
- npm installs the correct version
- Version checker validates successfully
The fix also handles both formats as input (dot or hyphen) and normalizes
to the correct npm format.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 4304d81 commit 1cee1e5
File tree
2 files changed
+43
-9
lines changed- lib/generators/react_on_rails
- spec/react_on_rails/generators
2 files changed
+43
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
127 | 130 | | |
128 | 131 | | |
129 | | - | |
130 | | - | |
131 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
132 | 135 | | |
133 | 136 | | |
134 | | - | |
135 | | - | |
136 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
137 | 153 | | |
138 | 154 | | |
139 | 155 | | |
| |||
Lines changed: 21 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | | - | |
| 211 | + | |
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
218 | 236 | | |
219 | 237 | | |
220 | 238 | | |
221 | 239 | | |
222 | 240 | | |
223 | | - | |
| 241 | + | |
224 | 242 | | |
225 | 243 | | |
226 | 244 | | |
| |||
0 commit comments