Skip to content

[finding] apps/docstypes:check is invoked by nothing, so the docs app is only ever type-checked without next typegen #10871

Description

@os-zhuang

What

apps/docs/package.json declares two near-identically named type-checking scripts:

"types:check": "fumadocs-mdx && next typegen && tsc --noEmit",
"typecheck": "tsc --noEmit"

types:check — the thorough one — is called by nothing. Measured on
origin/main @ 5886ee6d22:

grep -rn "types:check" .github/ scripts/ -> no matches

No workflow, no script, no turbo task references it. The one that actually runs is
typecheck, reached through the root turbo run typecheck.

Why it may be worth a card

apps/docs/tsconfig.json includes the generated route types:

"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx",
".next/types/**/*.ts", ".next/dev/types/**/*.ts"]

Those paths are produced by next typegen — which only types:check runs. So the
program typecheck actually checks depends on whether some earlier, unrelated
command happened to populate .next: a previous next build or next dev in the
same checkout. A clean checkout type-checks a strictly smaller program than a dirty
one, and neither is declared anywhere.

Measured directly while verifying #10782: with apps/docs/.next deleted,

pnpm --filter @objectstack/docs typecheck -> DOCS_TYPECHECK_EXIT=0

It passes without the generated route types existing at all. That is the
"reads green, verified less" shape — the failure is not that it goes red, but that
its coverage is set by incidental build state and nothing says so.

Two things a triage round might separate:

  1. the dead types:check script (either wire it up or delete it — ADR-0049's
    enforce-or-remove instinct applied to a package script); and
  2. whether the docs app's declared type-check should include next typegen, so
    coverage is a property of the script rather than of leftover .next state.

I have not verified whether the generated route types would actually catch anything
in this app today — that is the triage question, not a claim made here.

Found while working on #10782 (Next middleware -> proxy convention rename);
out of that card's file surface, so filed rather than fixed. Unassigned.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions