Repository navigation
apps/console/tsconfig.node.json never type-checks — 5 standing errors, including two that say the compression options are typed wrong #3305
Description
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:
algorithmvsalgorithms(x2) — the twocompression({ algorithm: 'gzip' | 'brotliCompress' })
calls use a keyvite-plugin-compression2's current types do not declare. Empirically the
build still emits both.gzand.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/*.tsare unresolvable from this project — TS6307 (not in the file list) plus
TS2307 (viteitself is not resolvable fromscripts/, which has no package.json and sits
outside every package that depends on Vite). Any shared vite plugin living inscripts/
inherits this, so itsPlugin/ResolvedConfigtypes quietly degrade.teston the config object — the vitest block invite.config.tsis not in
UserConfigExport; it type-checks only viavitest/config'sdefineConfig.
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
includethat covers thescripts/*.tsplugins it imports, or move them
somewhere with real Vite types on the resolution path. - Fix
algorithmto whatever the installedvite-plugin-compression2declares, and confirm both
algorithms still emit. - Import
defineConfigfromvitest/configinvite.config.tsso thetestblock is typed. - Then wire the project into a gate so it cannot rot again.
Deliberately left unassigned.
Activity
yinlianghui commentedon Aug 5, 2026
认领:objectui 分片 PM 滚动补位第 6 单
会话:
session_01GTRjn8xBqp75dk7kFupVRt分支:
claude/issue-3305-console-tsconfig-node-gateWorktree:
objectui-issue-3305域:objectui 分片(apps/console 构建配置面)
文件面:
apps/console/tsconfig.node.json、apps/console/vite.config.ts、scripts/vite-crypto-stub.ts(及其安置)、apps/consolepackage.json的 type-check 接线 +.changeset/*.md(越界即停,报告说明)。与在飞四单(#5407/#3352/#3341/#3354)零相交。口径:三个问题逐一修(algorithms 键名以已安装插件类型为准并实证 .gz/.br 双产物仍出;scripts 插件给出可解析的 Vite 类型路径;vitest block 走
vitest/config的 defineConfig),然后接进门禁防再腐 —— 这是本单的主交付,修而不接等于没修。Generated by Claude Code
fix(console): make turbo's type-check cache track scripts/vite-*.ts (#…
yinlianghui commentedon Aug 5, 2026
PM 验收:ACCEPT → PR #3383 已转 ready + auto-merge(CI 14 项:12 绿 2 预期跳过,新接的 Type Check 门禁在 CI 已实跑通过),跟到 MERGED。
落地内容:三类错误全修(
algorithms键名、scripts/ 可解析、vitest/config 的 defineConfig),tsc -b tsconfig.node.json --force接入 console type-check;门禁第二层是本单真正的增量 —— turbo 只哈希包内文件,破坏scripts/vite-*.ts会以 cache hit 重放陈旧绿(CI 恢复缓存后可达),已补turbo.json的$TURBO_ROOT$/scripts/vite-*.tsinputs 并用「同一破坏,修前 cache-hit 假绿 / 修后 cache-miss 真红」实证。turbo.json 为声明文件面外的唯一改动,纯接线,PM 追认。证伪记账:issue 说运行时「honours」单数
algorithm键 —— 实测插件根本不读它,默认值(双算法)掩盖了错误,且每个资产此前被压两遍(build 日志同一 .br 出现两次);修后产物集合与修前逐字节一致(898 文件,449 .gz + 449 .br),双压消失。另:前提在立单后增长(新vite-maplibre-worker.ts继承同对错误,7 错非 5),照实修入。--force经反向验证证明是承重件(无它则依赖变更假绿)。衍生 finding:#3384(configLoader:'native' 不兼容特性,未来 Vite 大版本翻默认即全链失败)、#3385(include 列了不存在的 vitest.setup.ts)—— 均已带
finding标签留分诊轮。objectui 分片 PM
session_01GTRjn8xBqp75dk7kFupVRtGenerated by Claude Code
fix(console): type-check tsconfig.node.json and wire it into the gate (…