Repository navigation
Commit 7c02a45
`apps/docs` declared two near-identical type-check scripts:
"types:check": "fumadocs-mdx && next typegen && tsc --noEmit"
"typecheck": "tsc --noEmit"
`types:check` -- the thorough one -- was invoked by nothing (`git grep`
over `.github/`, `scripts/`, `turbo.json` and the root `package.json`
returns only its own declaration). The one CI actually runs is
`typecheck`, reached through `turbo run typecheck --filter='./apps/*'`.
That mattered because `tsconfig.json` includes `.next/types/**/*.ts`,
which only `next typegen` produces. So the program CI type-checked was
set by whether some earlier, unrelated command had populated `.next` --
and on a fresh checkout it had not. Measured with `.next` deleted, the
bare script exits 0 while compiling none of the generated route types.
Wiring the thorough command under the name CI already runs makes the
check a function of source: it generates `.next/types/**` and
`next-env.d.ts` itself before tsc reads them, and short-circuits loudly
if typegen fails. Typegen costs ~1s and needs no build.
Measured coverage delta (empty `.next`, `tsc --listFiles`): 1225 -> 1231
files. The six are `.next/types/validator.ts` (160 lines validating 13
route entry points), `routes.d.ts`, `root-params.d.ts`,
`cache-life.d.ts`, `next-env.d.ts` and, through it,
`next/image-types/global.d.ts` -- so the bare run was also type-checking
a Next app without Next's own ambient declarations.
Ablation, to show the added coverage is real: giving
`app/[lang]/docs/layout.tsx` a `params` shape the route cannot supply
leaves the old script green (exit 0, 0 errors) and makes the new one
fail with TS2344 at `.next/types/validator.ts`, naming the layout and
the missing param.
`include` is deliberately left alone. Next writes both `.next` globs
itself and re-adds either one on the next `next dev` / `next build`;
running `writeConfigurationDefaults` against a narrowed copy put the
`dev` glob straight back and rewrote the file. The rationale is recorded
in `tsconfig.json` where the next reader would try to tidy it.
Claude-Session: https://claude.ai/code/session_01DdCnBGcHeufjrq7drTD3wt
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 3854376 commit 7c02a45
2 files changed
Lines changed: 25 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | | - | |
| 13 | + | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 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 | + | |
37 | 61 | | |
38 | 62 | | |
39 | 63 | | |
| |||
0 commit comments