diff --git a/apps/console/tsconfig.node.json b/apps/console/tsconfig.node.json index d4517d7bd..709cdf237 100644 --- a/apps/console/tsconfig.node.json +++ b/apps/console/tsconfig.node.json @@ -34,6 +34,42 @@ /* `../../scripts/vite-*.ts` are the repo-level Vite plugins vite.config.ts imports. They must be listed here or each one is a TS6307 ("not listed within the file list of project") — the error that kept this project red, - and therefore ungated. */ - "include": ["vite.config.ts", "vitest.setup.ts", "../../scripts/vite-*.ts"] + and therefore ungated. + + `vitest.config.ts` is listed for the same reason `vite.config.ts` is, and + until objectui#3476 it was in ZERO tsc programs. CI runs + `turbo run type-check`, i.e. per PACKAGE; the root `tsconfig.json` does + list `apps` in its `include`, but no script ever runs it — it is the + editor config. So the one console config that merges two config objects + (`rootConfig` and `viteConfig`), which is precisely the shape a + type-checker catches drift in, was the one an agent could break with no + gate noticing. + + `../../vitest.config.mts` follows it in by necessity, not by wish: + `vitest.config.ts` imports it, and a composite project must list every + file in its program or that import is a TS6307 as well. Covering the + importer is impossible without it — and it is a bonus, since the root + Vitest config was in no gated program either. One caveat that comes with + it: its `@ts-expect-error` on the plain-JS `vitest-invocation-guard.mjs` + import stays CORRECT here only because this project leaves `allowJs` at + its default `false`. Turning `allowJs` on would make that directive unused + and this project red with TS2578 — see `tsconfig.scripts.json`, which + chose `allowJs: true` for `scripts/` and deliberately paid that price. + + There is deliberately NO `vitest.setup.ts` entry. No such file has ever + existed in this directory, and a literal, glob-less `include` entry that + matches nothing is silently ignored by TypeScript — so it read as coverage + that was never there (objectui#3476). Repointing it at the setup file + `vitest.config.ts` actually uses (the repo-root `vitest.setup.dom.tsx`) + was measured and rejected: that file is handed to Vitest as a RUNTIME PATH + STRING, never imported, so this program has no type edge to it, and naming + it here drags `vitest.setup.base.ts` plus four `@object-ui` side-effect + imports into a Node build-config project that cannot resolve them + (one TS6307 + four TS2882). It belongs to a test-oriented program. */ + "include": [ + "vite.config.ts", + "vitest.config.ts", + "../../vitest.config.mts", + "../../scripts/vite-*.ts" + ] } diff --git a/turbo.json b/turbo.json index e33441983..61c94c0f1 100644 --- a/turbo.json +++ b/turbo.json @@ -44,7 +44,8 @@ "cache": true, "inputs": [ "$TURBO_DEFAULT$", - "$TURBO_ROOT$/scripts/vite-*.ts" + "$TURBO_ROOT$/scripts/vite-*.ts", + "$TURBO_ROOT$/vitest.config.mts" ] }, "clean": {