Found while working #3297 (console build config). Not fixed there — unrelated to that change, filing per PD #10.
What
apps/console/tsconfig.node.json is the project that covers vite.config.ts. Nothing runs it:
the console's build script is tsc && vite build && pnpm build:plugin, and plain tsc reads
tsconfig.json (include: ["src", "dev", "objectstack.config.ts"]), which does not build
project references. So the config file that decides how the console is bundled is the one file
in the app that no gate reads.
Running it directly on a clean origin/main (f44d8727f):
$ pnpm exec tsc -b apps/console/tsconfig.node.json --force
apps/console/vite.config.ts(6,32): error TS6307: File '.../scripts/vite-crypto-stub.ts' is not listed within the file list of project '.../apps/console/tsconfig.node.json'. Projects must list all files or use an 'include' pattern.
apps/console/vite.config.ts(183,9): error TS2561: Object literal may only specify known properties, but 'algorithm' does not exist in type 'ViteCompressionPluginOption'. Did you mean to write 'algorithms'?
apps/console/vite.config.ts(188,9): error TS2561: Object literal may only specify known properties, but 'algorithm' does not exist in type 'ViteCompressionPluginOption'. Did you mean to write 'algorithms'?
apps/console/vite.config.ts(286,3): error TS2769: No overload matches this call.
The last overload gave the following error.
Object literal may only specify known properties, and 'test' does not exist in type 'UserConfigExport'.
scripts/vite-crypto-stub.ts(1,29): error TS2307: Cannot find module 'vite' or its corresponding type declarations.
Three separate problems in one file:
algorithm vs algorithms (x2) — the two compression({ algorithm: 'gzip' | 'brotliCompress' })
calls use a key vite-plugin-compression2's current types do not declare. Empirically the
build still emits both .gz and .br, so the runtime honours it and this is a types/runtime
mismatch rather than broken compression — but nobody could tell from the config, and the day
the plugin drops the old key the console silently ships one algorithm twice.
scripts/*.ts are unresolvable from this project — TS6307 (not in the file list) plus
TS2307 (vite itself is not resolvable from scripts/, which has no package.json and sits
outside every package that depends on Vite). Any shared vite plugin living in scripts/
inherits this, so its Plugin/ResolvedConfig types quietly degrade.
test on the config object — the vitest block in vite.config.ts is not in
UserConfigExport; it type-checks only via vitest/config's defineConfig.
Why it matters
This is the same shape as the gap scripts/check-type-check-coverage.mjs was written to close:
a file everyone assumes is checked, that no command actually checks. Its own header says a package
without a type-check script "is not 'passing', it is unchecked" — that reasoning applies one
level down to a project reference nothing builds.
Suggested direction (not decided)
- Give the project an
include that covers the scripts/*.ts plugins it imports, or move them
somewhere with real Vite types on the resolution path.
- Fix
algorithm to whatever the installed vite-plugin-compression2 declares, and confirm both
algorithms still emit.
- Import
defineConfig from vitest/config in vite.config.ts so the test block is typed.
- Then wire the project into a gate so it cannot rot again.
Deliberately left unassigned.
Found while working #3297 (console build config). Not fixed there — unrelated to that change, filing per PD #10.
What
apps/console/tsconfig.node.jsonis the project that coversvite.config.ts. Nothing runs it:the console's
buildscript istsc && vite build && pnpm build:plugin, and plaintscreadstsconfig.json(include: ["src", "dev", "objectstack.config.ts"]), which does not buildproject references. So the config file that decides how the console is bundled is the one file
in the app that no gate reads.
Running it directly on a clean
origin/main(f44d8727f):Three separate problems in one file:
algorithmvsalgorithms(x2) — the twocompression({ algorithm: 'gzip' | 'brotliCompress' })calls use a key
vite-plugin-compression2's current types do not declare. Empirically thebuild still emits both
.gzand.br, so the runtime honours it and this is a types/runtimemismatch rather than broken compression — but nobody could tell from the config, and the day
the plugin drops the old key the console silently ships one algorithm twice.
scripts/*.tsare unresolvable from this project — TS6307 (not in the file list) plusTS2307 (
viteitself is not resolvable fromscripts/, which has no package.json and sitsoutside every package that depends on Vite). Any shared vite plugin living in
scripts/inherits this, so its
Plugin/ResolvedConfigtypes quietly degrade.teston the config object — the vitest block invite.config.tsis not inUserConfigExport; it type-checks only viavitest/config'sdefineConfig.Why it matters
This is the same shape as the gap
scripts/check-type-check-coverage.mjswas written to close:a file everyone assumes is checked, that no command actually checks. Its own header says a package
without a
type-checkscript "is not 'passing', it is unchecked" — that reasoning applies onelevel down to a project reference nothing builds.
Suggested direction (not decided)
includethat covers thescripts/*.tsplugins it imports, or move themsomewhere with real Vite types on the resolution path.
algorithmto whatever the installedvite-plugin-compression2declares, and confirm bothalgorithms still emit.
defineConfigfromvitest/configinvite.config.tsso thetestblock is typed.Deliberately left unassigned.