Skip to content

Commit ae6bb3a

Browse files
yinlianghuiclaude
andauthored
chore(type-check): retire the narrow typetests projects in graduated packages (#4291) (#4345)
`tsconfig.typetests.json` is the objectui#3181 rescue hatch: a package whose test tree was still in `check-type-check-coverage.mjs`'s TEST_DEBT could compile the one file whose whole value is compile-time assertions, instead of waiting for its whole backlog. As #4040's tranches landed full `tsconfig.test.json` projects, the hatch went redundant wherever the package graduated — the full project already compiles the same file, so the repo carried two spellings of what gets compiled plus one extra tsc per run. Retired in auth, plugin-chatbot, plugin-detail, plugin-form, plugin-grid and plugin-list, each with its `type-check` chain entry. Per package, the full project's `--listFiles` was checked to contain the exact file the narrow project named, and a provably-false `Assert` appended to that file turned the FULL project red (TS2344, exit 2) — the coverage moved rather than vanished. app-shell, components, core and react are still in TEST_DEBT and keep theirs. The gate now makes this a ratchet rather than a one-time sweep: a narrow project on a package whose full test project already compiles everything is reported as redundant, so the seventh cannot reappear. Section 5½ had no test coverage at all — the gate keeping the rescue hatch honest was itself unchecked — so it gains a fixture suite plus a real-repository pin. Refs #4040, #3032, objectstack-ai/objectstack#4118 Claude-Session: https://claude.ai/code/session_017Qqyix2QcnpUC9XeYVDzx3 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 734d186 commit ae6bb3a

26 files changed

Lines changed: 255 additions & 241 deletions
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
---
3+
4+
Retire the narrow `tsconfig.typetests.json` projects in the six packages that have graduated out of `TEST_DEBT`
5+
6+
`tsconfig.typetests.json` is a rescue hatch (objectui#3181): a package whose test tree was still in `scripts/check-type-check-coverage.mjs`'s `TEST_DEBT` could compile the one file whose whole value is compile-time assertions — `Assert< Equal< Local, Spec > >` is a `tsc` error or it is nothing — instead of waiting for its whole backlog to compile. As objectui#4040's tranches landed full `tsconfig.test.json` projects, that hatch became redundant in the packages that graduated: the full project already compiles the same file, so the repo carried two spellings of what gets checked plus one extra `tsc` per `type-check` run.
7+
8+
Retired in `@object-ui/auth`, `@object-ui/plugin-chatbot`, `@object-ui/plugin-detail`, `@object-ui/plugin-form`, `@object-ui/plugin-grid` and `@object-ui/plugin-list`, each with its `type-check` chain entry. For every one, `tsc -p tsconfig.test.json --listFiles` was checked to contain the exact file the narrow project named, and a provably-false `Assert` appended to that file turned the FULL project red (TS2344, exit 2) — so the coverage moved rather than vanished. The four packages still in `TEST_DEBT` that have a narrow project (`app-shell`, `components`, `core`, `react`) keep theirs untouched.
9+
10+
`scripts/check-type-check-coverage.mjs` now makes this a ratchet rather than a one-time sweep: a `tsconfig.typetests.json` on a package whose full test project already compiles everything is reported as redundant, so the seventh cannot reappear. Section 5½ had no test coverage at all before this change — the gate keeping the rescue hatch honest was itself unchecked — so it gains a fixture suite plus a real-repository pin on the six retirements.
11+
12+
No published behaviour changes: only `type-check` scripts, checking-only tsconfig projects, test-file comments and a CI gate.

‎packages/auth/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"build": "tsc",
3131
"clean": "rm -rf dist",
3232
"test": "vitest run",
33-
"type-check": "tsc --noEmit && tsc -p tsconfig.typetests.json && tsc -p tsconfig.test.json",
33+
"type-check": "tsc --noEmit && tsc -p tsconfig.test.json",
3434
"lint": "eslint ."
3535
},
3636
"peerDependencies": {

‎packages/auth/tsconfig.test.json‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@
44
// the build correctly keeps tests out of `dist`, but nothing else compiled
55
// them, so a test could assert a contract the compiler never checked.
66
//
7-
// `tsconfig.typetests.json` next door is the narrow rescue this supersedes for
8-
// this package: it compiles `auth-spec-parity.test.ts` alone, because that one
9-
// file's whole value is compile-time assertions and it could not wait for the
10-
// rest of the tree to compile (objectui#3181). It stays chained — the file is
11-
// now read by both projects, which costs one extra compile and keeps the
12-
// narrow project's reasoning where it was written.
7+
// This project is now the ONLY one that compiles `auth-spec-parity.test.ts`,
8+
// whose whole value is compile-time assertions (objectui#3181). It used to be
9+
// rescued by a narrow `tsconfig.typetests.json` next door, which named that one
10+
// file while the rest of the tree was still in TEST_DEBT; the package graduated
11+
// in objectui#4040 and the narrow project was retired in objectui#4291, after
12+
// `--listFiles` showed this project reads the same file and a provably-false
13+
// `Assert` appended to it turned this project red. Keep the file compiling
14+
// here: those assertions are erased at runtime, so vitest proves nothing
15+
// about them and `tsc` is the only thing that can.
1316
"extends": "../../tsconfig.json",
1417
"compilerOptions": {
1518
"noEmit": true,

‎packages/auth/tsconfig.typetests.json‎

Lines changed: 0 additions & 34 deletions
This file was deleted.

‎packages/plugin-chatbot/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"build": "vite build",
2828
"test": "vitest run",
2929
"test:watch": "vitest",
30-
"type-check": "tsc --noEmit && tsc -p tsconfig.typetests.json && tsc -p tsconfig.test.json",
30+
"type-check": "tsc --noEmit && tsc -p tsconfig.test.json",
3131
"lint": "eslint ."
3232
},
3333
"dependencies": {

‎packages/plugin-chatbot/src/__tests__/spec-symbol-batch6.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@ describe('the vendored directory stays vendored', () => {
205205

206206
/* -------------------------------------------------------------------------- */
207207
/* Compile-time pins. A violation is a `tsc` error, not a runtime failure. */
208-
/* Compiled by this package's `tsconfig.typetests.json` (objectui#3181). */
208+
/* Compiled by this package's `tsconfig.test.json` (objectui#3181; the narrow */
209+
/* project that named this file alone was retired in objectui#4291). */
209210
/* -------------------------------------------------------------------------- */
210211

211212
type Assert<T extends true> = T;

‎packages/plugin-chatbot/tsconfig.test.json‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@
44
// the build correctly keeps tests out of `dist`, but nothing else compiled
55
// them, so a test could assert a contract the compiler never checked.
66
//
7-
// `tsconfig.typetests.json` next door is the narrow rescue this supersedes for
8-
// this package: it compiles `spec-symbol-batch6.test.ts` alone, because that
9-
// one file's whole value is compile-time assertions and it could not wait for
10-
// the rest of the tree to compile (objectui#3181). It stays chained — the file
11-
// is now read by both projects, which costs one extra compile and keeps the
12-
// narrow project's reasoning where it was written.
7+
// This project is now the ONLY one that compiles `spec-symbol-batch6.test.ts`,
8+
// whose whole value is compile-time assertions (objectui#3181). It used to be
9+
// rescued by a narrow `tsconfig.typetests.json` next door, which named that one
10+
// file while the rest of the tree was still in TEST_DEBT; the package graduated
11+
// in objectui#4040 and the narrow project was retired in objectui#4291, after
12+
// `--listFiles` showed this project reads the same file and a provably-false
13+
// `Assert` appended to it turned this project red. Keep the file compiling
14+
// here: those assertions are erased at runtime, so vitest proves nothing
15+
// about them and `tsc` is the only thing that can.
1316
"extends": "../../tsconfig.json",
1417
"compilerOptions": {
1518
"noEmit": true,

‎packages/plugin-chatbot/tsconfig.typetests.json‎

Lines changed: 0 additions & 34 deletions
This file was deleted.

‎packages/plugin-detail/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"build": "vite build",
2828
"test": "vitest run",
2929
"test:watch": "vitest",
30-
"type-check": "tsc --noEmit && tsc -p tsconfig.typetests.json && tsc -p tsconfig.test.json",
30+
"type-check": "tsc --noEmit && tsc -p tsconfig.test.json",
3131
"lint": "eslint ."
3232
},
3333
"dependencies": {

‎packages/plugin-detail/src/__tests__/spec-symbol-batch7.test.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ describe('FeedFilterMode is the spec enum, at runtime as well as in types', () =
4646
});
4747

4848
/* -------------------------------------------------------------------------- */
49-
/* Compile-time pins — compiled by tsconfig.typetests.json, chained off */
50-
/* "type-check" (this package's test tree is still in TEST_DEBT). */
49+
/* Compile-time pins — compiled by tsconfig.test.json, chained off */
50+
/* "type-check" (objectui#4291 retired the narrow project that named this */
51+
/* file alone, once the package left TEST_DEBT in objectui#4040). */
5152
/* -------------------------------------------------------------------------- */
5253

5354
type Assert<T extends true> = T;

0 commit comments

Comments
 (0)