You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
build(types): type-check this package's tests, so the spec-derivation guards actually run (objectstack#4074) (#3009)
`spec-derived-unions.test.ts` — the file that exists to stop a spec-derived
union from being re-forked into a hand-written copy — was not being compiled by
anything. Its header claimed the `satisfies` checks in it "are the real
enforcement"; measured, not assumed: reverting `ActionParamFieldType` from the
spec's `FieldType` back to a hand-written subset produced ZERO type errors.
It now produces TS1360 on the `satisfies` line.
`tsconfig.json` excludes test files — correctly, since it is the package build
(`rootDir` / `composite` / `declaration`), so tests would emit into dist — and
no other `tsc` invocation read them. The sibling guards over `ChartType`,
`ReportType`, `ActionType` and `PageType` were inert for the same reason, so the
anti-regression mechanism left behind by #2944 / #2901 was not running in CI.
The fix is `packages/types/tsconfig.test.json`, chained from the package's
`type-check` script — the shape this package already uses for
`tsconfig.examples.json`: a separate, emit-free project. Kept separate rather
than deleting the exclude so the BUILD stays honest: the reexport guard's source
scan needs `types: ["node"]`, and folding that into `tsconfig.json` would let
package source reference Node APIs and still compile, in a package that ships
to browsers.
Turning it on surfaced 39 pre-existing errors:
- `p2-spec-exports.test.ts` (22): imported eight `…Schema` names as types that
#2561 decision (a) removed — contradicting the sibling guard that asserts
their absence — and typed parse-INPUT fixtures as parsed OUTPUT (these
schemas `.default()` several fields). Now `z.input<>`, the distinction spec
itself draws with `ActionInput`.
- `app-creation-types` / `system-fields` (3): imported the package by its own
name; turbo's `type-check` is `dependsOn: ["^build"]`, so the package's own
dist does not exist when it runs. Now the relative import all siblings use.
- `p1-spec-alignment.test.ts` (14): excluded WITH a written reason — real debt,
not hygiene. Every error sits in a test named "should accept <shape>" whose
purpose is asserting the type accepts that shape, and the type rejects it;
the shapes are real and handled (core's `foldSharing` et al.) but only as
untyped input. Tracked on objectstack#4074.
Also corrects an overstatement in #3003: 33 of 41 package tsconfigs exclude
tests, not all — 5 packages already type-check theirs.
Refs objectstack#4074, #3003, #2561, #2944, #2901, #2911
Co-Authored-By: Claude <noreply@anthropic.com>
0 commit comments