Commit 3d89001
fix: Improve JsDependencyManager robustness and consistency
Address code review feedback to enhance error handling and consistency:
- Add exact: true flag to add_package method for consistency with add_npm_dependencies
- Add nil check for package_json in install_js_dependencies to prevent nil pointer errors
- Remove orphaned comment at end of module
- Update tests to verify exact: true flag is passed correctly
- Add test coverage for nil package_json scenario in install_js_dependencies
These changes improve code robustness while maintaining backward compatibility.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 6c6e1eb commit 3d89001
File tree
2 files changed
+28
-9
lines changed- lib/generators/react_on_rails
- spec/react_on_rails/generators
2 files changed
+28
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
282 | | - | |
| 282 | + | |
283 | 283 | | |
284 | | - | |
| 284 | + | |
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
| |||
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
312 | | - | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
313 | 319 | | |
314 | 320 | | |
315 | 321 | | |
| |||
323 | 329 | | |
324 | 330 | | |
325 | 331 | | |
326 | | - | |
327 | | - | |
328 | 332 | | |
329 | 333 | | |
330 | 334 | | |
| |||
Lines changed: 19 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
| 145 | + | |
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
152 | 157 | | |
153 | 158 | | |
154 | 159 | | |
| |||
171 | 176 | | |
172 | 177 | | |
173 | 178 | | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
174 | 189 | | |
175 | 190 | | |
176 | 191 | | |
| |||
190 | 205 | | |
191 | 206 | | |
192 | 207 | | |
193 | | - | |
| 208 | + | |
194 | 209 | | |
195 | 210 | | |
196 | 211 | | |
197 | 212 | | |
198 | 213 | | |
199 | | - | |
| 214 | + | |
200 | 215 | | |
201 | 216 | | |
202 | 217 | | |
| |||
0 commit comments