Commit Graph

1 Commits

Author SHA1 Message Date
Jakob Wennberg fbf47649f2 chore(build): type-check what ships (tsconfig.build.json) and move to Next 16.3.1 (#1750)
* chore(build): type-check what ships (tsconfig.build.json) and move to Next 16.3.1

Groundwork for the 2026 shape of the build, companion to #1749.

- tsconfig.build.json extends tsconfig.json and excludes tests/, __tests__,
  __mocks__ and *.test.ts(x); next.config.ts selects it via
  typescript.tsconfigPath. tsconfig.json is untouched and stays the
  editor/ESLint view of the whole repo.
- next 16.2.12 -> 16.3.1 (+ eslint-config-next). 16.3 runs the project-local
  tsc CLI by default, which is what lets typescript@^7 (native) slot in once
  typescript-eslint supports the TS 7.1 API, and turns on Turbopack's on-disk
  cache for next build.

The split has to land with the bump: the 16.3 CLI checker checks the
complete project it is given, while the old API checker silently dropped
diagnostics from test files. A full tsc --noEmit of main reports 493 type
errors, all in tests (mostly route handlers called without the ctx
argument); vitest never type-checks, so nothing caught them. Excluding tests
from the build keeps that debt where it was instead of turning it into a
red deploy; a tests type-check job is the follow-up. Measured: tests are
~10% of the check's memory, so this is correctness, not the memory fix.

Lockfile regenerated with npm 10 (CI pins node 20); the only structural
change is npm 10 de-nesting next-intl/node_modules/@swc/helpers.

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

* fix(build): only write standalone output off-Vercel; Vercel's 16.3 adapter owns tracing

The #1750 preview failed after a green compile and type-check with
ENOENT .next/next-server.js.nft.json right after "Running onBuildComplete
from Vercel": writeStandaloneDirectory copies from that trace file, and on
Vercel (adapterPath set) Next 16.3 no longer produces it; the adapter traces
and packages functions itself. Vercel never reads .next/standalone; the
Docker image does. Keep standalone for every non-Vercel build.

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

---------

Co-authored-by: Jakob Wennberg <311770904+jakobwennberg-oss@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-20 15:27:13 +02:00