Skip to content

Commit 342ca3d

Browse files
committed
ci(console): put vitest.config.ts in a tsc program and drop the ghost include entry
`apps/console/vitest.config.ts` was in ZERO tsc programs. CI runs `turbo run type-check` — per package — and neither console tsconfig reached the file: `tsconfig.json` includes only `src`/`dev`/ `objectstack.config.ts`, and `tsconfig.node.json` listed only `vite.config.ts` and a `vitest.setup.ts` that does not exist. Add `vitest.config.ts` to `tsconfig.node.json`'s include. Its import of `../../vitest.config.mts` has to be listed too — a composite project must list every file in its program (TS6307) — which incidentally gives the root Vitest config the gate it also lacked. Drop the `vitest.setup.ts` entry rather than repoint it. A literal, glob-less include entry matching nothing is silently ignored by tsc, so it read as coverage that was never there. The setup file `vitest.config.ts` really uses (repo-root `vitest.setup.dom.tsx`) is passed to Vitest as a runtime path string, never imported, so this program has no type edge to it; naming it here was measured red (one TS6307 + four TS2882). No flag changes were needed: `allowImportingTsExtensions` + `emitDeclarationOnly` from #3475 already cover the `.ts`/`.mts` spellings. Refs #3476 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GTRjn8xBqp75dk7kFupVRt
1 parent f995a45 commit 342ca3d

1 file changed

Lines changed: 38 additions & 2 deletions

File tree

‎apps/console/tsconfig.node.json‎

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,42 @@
3434
/* `../../scripts/vite-*.ts` are the repo-level Vite plugins vite.config.ts
3535
imports. They must be listed here or each one is a TS6307 ("not listed
3636
within the file list of project") — the error that kept this project red,
37-
and therefore ungated. */
38-
"include": ["vite.config.ts", "vitest.setup.ts", "../../scripts/vite-*.ts"]
37+
and therefore ungated.
38+
39+
`vitest.config.ts` is listed for the same reason `vite.config.ts` is, and
40+
until objectui#3476 it was in ZERO tsc programs. CI runs
41+
`turbo run type-check`, i.e. per PACKAGE; the root `tsconfig.json` does
42+
list `apps` in its `include`, but no script ever runs it — it is the
43+
editor config. So the one console config that merges two config objects
44+
(`rootConfig` and `viteConfig`), which is precisely the shape a
45+
type-checker catches drift in, was the one an agent could break with no
46+
gate noticing.
47+
48+
`../../vitest.config.mts` follows it in by necessity, not by wish:
49+
`vitest.config.ts` imports it, and a composite project must list every
50+
file in its program or that import is a TS6307 as well. Covering the
51+
importer is impossible without it — and it is a bonus, since the root
52+
Vitest config was in no gated program either. One caveat that comes with
53+
it: its `@ts-expect-error` on the plain-JS `vitest-invocation-guard.mjs`
54+
import stays CORRECT here only because this project leaves `allowJs` at
55+
its default `false`. Turning `allowJs` on would make that directive unused
56+
and this project red with TS2578 — see `tsconfig.scripts.json`, which
57+
chose `allowJs: true` for `scripts/` and deliberately paid that price.
58+
59+
There is deliberately NO `vitest.setup.ts` entry. No such file has ever
60+
existed in this directory, and a literal, glob-less `include` entry that
61+
matches nothing is silently ignored by TypeScript — so it read as coverage
62+
that was never there (objectui#3476). Repointing it at the setup file
63+
`vitest.config.ts` actually uses (the repo-root `vitest.setup.dom.tsx`)
64+
was measured and rejected: that file is handed to Vitest as a RUNTIME PATH
65+
STRING, never imported, so this program has no type edge to it, and naming
66+
it here drags `vitest.setup.base.ts` plus four `@object-ui` side-effect
67+
imports into a Node build-config project that cannot resolve them
68+
(one TS6307 + four TS2882). It belongs to a test-oriented program. */
69+
"include": [
70+
"vite.config.ts",
71+
"vitest.config.ts",
72+
"../../vitest.config.mts",
73+
"../../scripts/vite-*.ts"
74+
]
3975
}

0 commit comments

Comments
 (0)