Commit 5682b3d
Simplify generator template precompile hook to minimal bash script
Reverted from the hacky bash grep approach back to a clean Ruby script.
The bash version had several problems:
1. Hacky grep parsing to detect config - fragile and error-prone
2. Duplicates logic that already exists in PacksGenerator
3. More complex (20+ lines vs 21 lines)
4. Harder to maintain
The Ruby version is superior because:
1. Leverages PacksGenerator.generate_packs_if_stale which already
knows when to generate vs skip
2. Simple and clean - just load Rails and call the method
3. Proper error handling with backtrace
4. Let the engine's built-in validation logic handle skipping
The engine already skips validation appropriately via:
- package_json_missing? check
- running_generator? check
So we don't need REACT_ON_RAILS_SKIP_VALIDATION here either.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent d584749 commit 5682b3d
File tree
1 file changed
+14
-13
lines changed- lib/generators/react_on_rails/templates/base/base/bin
1 file changed
+14
-13
lines changedLines changed: 14 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
2 | 4 | | |
3 | 5 | | |
4 | 6 | | |
5 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
6 | 10 | | |
7 | 11 | | |
8 | 12 | | |
9 | | - | |
| 13 | + | |
10 | 14 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
0 commit comments