Commit 6ffc964
Fix generator test failures by skipping validation and using exact versions
This commit fixes two issues that were causing generator tests to fail:
1. Version validation running during generator execution
- The engine initializer was validating npm package installation
- But generators hadn't installed packages yet (chicken-and-egg problem)
- Solution: Skip validation when Rails generators are running
2. Package installed with semver range instead of exact version
- package_json gem was adding packages with carets (^16.1.1)
- React on Rails requires exact version matching between gem and npm package
- Solution: Use npm install --save-exact directly for react-on-rails package
Changes:
- lib/react_on_rails/engine.rb: Skip validation during generator runs
- lib/generators/react_on_rails/install_generator.rb: Use --save-exact flag
Note: Filed issue with package_json gem to add exact version support:
shakacode/package_json#25
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 097a3ba commit 6ffc964
File tree
2 files changed
+9
-11
lines changed- lib
- generators/react_on_rails
- react_on_rails
2 files changed
+9
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
433 | | - | |
| 433 | + | |
| 434 | + | |
434 | 435 | | |
435 | | - | |
| 436 | + | |
436 | 437 | | |
437 | 438 | | |
438 | 439 | | |
439 | | - | |
| 440 | + | |
440 | 441 | | |
441 | 442 | | |
442 | 443 | | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
| 444 | + | |
450 | 445 | | |
451 | | - | |
| 446 | + | |
452 | 447 | | |
453 | 448 | | |
454 | 449 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| |||
0 commit comments