Commit 54cd716
test(server): catch a module no auto-import barrel mentions (#2408)
Adding `app/Jobs/ProbeStaleJob.ts` and committing without running
`buddy generate` leaves the barrel and the declarations stale together. They
agree with each other, so `generated-declarations.test.ts` - which asks whether
each DECLARED global exists at runtime - sees nothing, and the job silently is
not a global. Two stale files being consistent is what makes it invisible.
This asks the other direction: is there a module on disk that no barrel
mentions. Four barrels, 662 modules, all currently covered. Verified against the
issue's own scenario - the probe job above is named by the test and by file.
This is option 3 from #2408 and deliberately the weak one, so the issue stays
open. A real freshness check cannot work while generation is config-driven:
which files get emitted depends on `feature()` gates reading config reading env,
so CI without `.env.keys` legitimately emits a different set than a developer
machine, and the diff looks like staleness when nothing is stale. Options 1 and
2 there - generate under a canonical config, or stop committing these - are what
make the output reproducible, and both change what apps receive.
Matching is on the module's own name, because the barrel spells app modules
`../../../app/Jobs/X` and framework ones `../defaults/app/Jobs/X` and both are
right. Tests, `.d.ts` and `index.ts` are excluded: 76 of the 698 files under
`Actions/` are `.test.ts` and belong in no barrel.
Refs #2408
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 4ded068 commit 54cd716
1 file changed
Lines changed: 85 additions & 0 deletions
Lines changed: 85 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
0 commit comments