Commit 9eeca41
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 ef315c9 commit 9eeca41
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 | |
|---|---|---|---|
| |||
453 | 453 | | |
454 | 454 | | |
455 | 455 | | |
456 | | - | |
| 456 | + | |
| 457 | + | |
457 | 458 | | |
458 | | - | |
| 459 | + | |
459 | 460 | | |
460 | 461 | | |
461 | 462 | | |
462 | | - | |
| 463 | + | |
463 | 464 | | |
464 | 465 | | |
465 | 466 | | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
| 467 | + | |
473 | 468 | | |
474 | | - | |
| 469 | + | |
475 | 470 | | |
476 | 471 | | |
477 | 472 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| |||
0 commit comments