Skip to content

chore(type-check): site is not debt — its own next build type-checks it - #2924

Merged
os-zhuang merged 1 commit into
mainfrom
chore/site-typecheck-classification
Jul 28, 2026
Merged

chore(type-check): site is not debt — its own next build type-checks it#2924
os-zhuang merged 1 commit into
mainfrom
chore/site-typecheck-classification

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Follow-up off #2915 / #2919. Closes out the @object-ui/site entry by measuring it instead of assuming.

It was miscategorised — zero errors, not 7

The #2911 sweep recorded @object-ui/site as 7 errors of debt:

app/(home)/layout.tsx(4,46): error TS2304: Cannot find name 'LayoutProps'.
app/docs/[[...slug]]/page.tsx(9,43): error TS2304: Cannot find name 'PageProps'.
app/llms.mdx/docs/[[...slug]]/route.ts(6,54): error TS2304: Cannot find name 'RouteContext'.
...

Those are Next's generated types. apps/site/tsconfig.json includes them explicitly:

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

.next/types only exists after a build, and site is excluded from pnpm build (--filter=!@object-ui/site), so the sweep measured a package that had never been built. Build it and:

$ pnpm turbo run build --filter='@object-ui/site'   # generates .next/types
$ cd apps/site && tsc --noEmit
exit=0  errors=0

Zero. The phantom 7 were inflating the outstanding-error count by 28% (32 → 25), which matters because that number is meant to be read as a health signal.

And it doesn't need a type-check script

next build runs a full type-check unless typescript.ignoreBuildErrors is set — and apps/site/next.config.mjs does not set it. The docs CI job already runs that build. Adding a type-check script would run the compiler twice and pull a Next build into the Type Check job for no new coverage.

So the honest classification isn't "debt" or "exempt" — it's checked, by a different mechanism. New CHECKED_BY_OWN_BUILD category records exactly that.

The exemption is verified, not trusted

ignoreBuildErrors: true is a one-line flag that would silently turn this exemption into precisely the hole #2911 was about — a package that looks covered and isn't. So the guard checks it on every run. Three failure modes, each proven red before being trusted:

tampering result
ignoreBuildErrors: true added to next.config.mjs exit 1
site gains a type-check script (stale entry) exit 1
build script changes out from under the exemption exit 1

Baseline restores green afterwards, with no residual diff (restored via cp, not git checkout).

Recorded caveat

Noted in the code, because it's a genuine cost/coverage call rather than an oversight: the docs job runs the site build only when apps/site/ or content/ changed (plus every push to main). A PR that touches only a workspace package listed in transpilePackages therefore doesn't re-check the site until it lands. Closing that would mean paying a Next build on many more PRs — worth a deliberate decision, so I've left it visible rather than silently widening CI.

Verification

✅  type-check coverage: 36/45 via `type-check`, 1 via their own build,
    7 known-broken (25 errors outstanding), 1 not compiled.
  • node scripts/check-type-check-coverage.mjs — green, and red in all three tamper modes above
  • node scripts/check-changeset-fixed.mjs — green
  • No changeset: scripts-only change, no published package is affected

🤖 Generated with Claude Code

…s it

The #2911 sweep recorded `@object-ui/site` as 7 errors of debt. Measured: it is
zero. The 7 TS2304 on `LayoutProps`/`PageProps`/`RouteContext` were entirely an
artifact of never having built it — `apps/site/tsconfig.json` includes
`.next/types/**/*.ts`, and those types only exist after `next build`. Run the
build first and `tsc --noEmit` is exit 0.

So site was never broken; it was miscategorised, and its phantom 7 inflated the
outstanding-error count by 28% (32 -> 25).

It also does not need a `type-check` script: `next build` runs a full type-check
unless `typescript.ignoreBuildErrors` is set, and the `docs` CI job runs that
build. Adding a script would just run the compiler twice — and would pull a Next
build into the Type Check job.

New `CHECKED_BY_OWN_BUILD` category records that, and — because
`ignoreBuildErrors` is precisely how such an exemption would silently rot into
the #2911 hole — verifies it rather than trusting it. Three failure modes, all
proven red before being trusted:

  - `ignoreBuildErrors: true` added to next.config.mjs  -> exit 1
  - site gains a `type-check` script (stale entry)      -> exit 1
  - build script changes out from under the exemption   -> exit 1

Recorded caveat, since it is a real cost/coverage call rather than an oversight:
the `docs` job runs the site build only when `apps/site/` or `content/` changed
(plus every push to main), so a PR touching only a package in
`transpilePackages` does not re-check the site until it lands.

No changeset: scripts-only, no published package changes.

Refs #2911, #2915, #2919

Co-Authored-By: Claude <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectui Ignored Ignored Jul 28, 2026 12:13pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant