Skip to content

Commit c19ad22

Browse files
fix(plugin-hono-server): skip lib check so the workspace typecheck fits the CI heap (#26356)
<!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9EAJiZeLXWud1DkCgLT5jVE)_ Fixes #26288 Clause-②: no Metadata-protocol: none ## 维护者速读 - **改了什么**:`plugin-hono-server` 的 tsconfig 加一行 `skipLibCheck: true`(附一段注释)。它是仓里唯一一个没设这个开关的包配置。 - **为什么改**:它的类型检查要连带检查依赖的全部 `.d.ts`(大头是 spec 的产物),峰值内存 4.36 GB,已顶到 CI 的 4136 MB 堆上限,动 spec 的 PR 会在没有类型错误的情况下 OOM 变红。改后峰值 0.98 GB,耗时 93 s 降到 7 s。 - **风险与回滚**:只改不发布的配置文件,构建产物 `dist/` 改前改后逐字节相同。回滚就是删掉这一行。 - **先看**:`packages/plugins/plugin-hono-server/tsconfig.json`。 - **两分钟验证**:`NODE_OPTIONS=--max-old-space-size=4136 pnpm --filter @objectstack/plugin-hono-server typecheck`,预期 0 错误、十几秒跑完。 - **需要你做的**:无,席位落地。 ## What changes One option in `packages/plugins/plugin-hono-server/tsconfig.json`: `"skipLibCheck": true`, with a comment saying why. `tsconfig.typecheck.json` and `tsconfig.test.json` extend this file, so all three tsc programs in the package's `typecheck` script pick it up. Why this option and not `extends: "../../../tsconfig.base.json"`: both options were built and measured (see Verification). - **`skipLibCheck: true`**: `dist/` stays byte-identical, with 0 type errors. - **Extending the base config**: this pulls in `lib: ["ES2020"]`, which drops the `DOM` lib that this package's default `target: ES2022` lib carries today. It also turns on `noUnusedLocals` / `noUnusedParameters`. The result is 73 errors: 58 × TS18046 and 10 × TS2571 (fetch `Response.json()` turns into `unknown`), 3 × TS6133, and 2 × TS2769. The tsup DTS build fails, so `dist/` loses `index.d.ts` and `index.d.mts`. The sibling `tsconfig.test.json` header already records the same `lib` trap. No published file changes: `files` is `dist`, `README.md` and `CHANGELOG.md`, and `dist/` is byte-identical. So this PR carries `skip-changeset`. ## Tests - `pnpm --filter @objectstack/plugin-hono-server build`: green. - `pnpm --filter @objectstack/plugin-hono-server test`: green, 35 test files and 448 tests passed. - `pnpm --filter @objectstack/plugin-hono-server typecheck` (all three programs plus `check:test-typecheck`) under `NODE_OPTIONS=--max-old-space-size=4136`: exit 0, 0 errors, on head `3db795be`. - This is a config-only diff, so there is no ablation (os-dev: no ablation for config). ## Acceptance notes - **The lib check hid nothing in this package.** With lib checking on, origin/main already had 0 errors in all three programs. So the flag hides no lib-check-only error class here. - **Sweep of the other workspace tsconfigs that extend nothing.** This was measure-only, with nothing edited. The card premise does not hold for them: every one already sets `skipLibCheck: true`. `plugin-hono-server` was the only one that did not. So instead of adding the flag, the sweep measured what turning it off (`--skipLibCheck false`) would expose. All runs used `NODE_OPTIONS=--max-old-space-size=4136` and TypeScript 6.0.3, with the dependency closure built. | config | peak RSS as configured | lib check on | |:--|--:|:--| | `apps/docs` (after `fumadocs-mdx && next typegen`) | 455,844 KB | exit 2, 1 error in a third-party `.d.ts`: fumadocs-mdx TS2307 `@fumadocs/satteri/preset` | | `examples/app-crm` | 1,435,644 KB | exit 134, heap OOM | | `examples/app-multi-package` | 730,248 KB | exit 0, 0 errors | | `examples/app-showcase` | 1,900,860 KB | exit 134, heap OOM | | `examples/app-todo` | 1,386,968 KB | exit 134, heap OOM | | `packages/cli` (`tsconfig.json`) | 1,898,856 KB | exit 2, 2 errors in third-party `.d.ts`: better-auth core TS2307 `bun:sqlite`, bundle-require TS7016 `load-tsconfig` | | `packages/cli` (`tsconfig.build.json`) | 1,485,560 KB | exit 2, the same 2 third-party errors | | `packages/create-objectstack` | 251,384 KB | exit 0, 0 errors | | `packages/create-objectstack/src/templates/blank` | 645,888 KB, exit 2 | exit 2, the same 4 errors as configured | | `packages/qa/dogfood` | 2,622,840 KB | exit 134, heap OOM | | `packages/qa/downstream-contract` | 807,228 KB | exit 0, 0 errors | - None of them is over 3 GB as configured. The highest is `packages/qa/dogfood` at 2.6 GB. - Every error that the lib check alone reports is inside a third-party package under `node_modules`, so none of them is ours to fix. - Where the lib-check run went OOM, its error list was not measured. - The blank template's 4 errors are TS2307 for `@objectstack/{verify,connector-rest,connector-openapi,connector-mcp}`. They happen in both modes because the template is not a workspace package and has no installed deps, so they are not lib-check errors. - The heap limit was not raised. - No path under `ui/`, `.github/**` or the root `ci.yml` was touched. ## Verification <details><summary>Before and after, plugin-hono-server, NODE_OPTIONS=--max-old-space-size=4136, GNU time -v</summary> Base origin/main `71580254`. Closure built with `turbo run build --filter='@objectstack/plugin-hono-server^...'`. Wall times are from a shared box, so the ratios count more than the absolute values. | program | before: peak RSS / wall | after: peak RSS / wall | |:--|:--|:--| | `tsc --noEmit -p tsconfig.json` | 4,362,676 KB / 93.5 s | 978,968 KB / 6.8 s | | `tsc --noEmit -p tsconfig.typecheck.json` | 585,696 KB / 6.4 s | 233,144 KB / 1.3 s | | `tsc --noEmit -p tsconfig.test.json` | 3,058,352 KB / 46.9 s | 732,384 KB / 5.4 s | | `pnpm run typecheck` (whole script) | 4,361,008 KB / 144.8 s | 975,420 KB / 15.1 s | - Every run exited 0 with 0 errors. - The 4136 MB heap is 4,235,264 KB. Before the change, the main program's peak RSS was already above that. After it, the peak is about 23% of the limit. - The program loads 527 files, about 31 MB of `.d.ts`. Of that, 98 files and 23.3 MB are `@objectstack/spec`'s dist. </details> <details><summary>dist byte-identity</summary> - `pnpm --filter @objectstack/plugin-hono-server build` on origin/main was run twice, and `diff -r` showed the two outputs identical, so the build is deterministic. - After the change, the build was run again on `16661e1f` and on the final head `3db795be`. Both times `diff -r` against the origin/main copy printed nothing. - Files: `index.{js,mjs,d.ts,d.mts,js.map,mjs.map}`. sha256 of the sorted file sums is `d464c12c…`. - Extending `tsconfig.base.json` instead fails the DTS build: `index.d.ts` and `index.d.mts` are missing from `dist/`. </details> <details><summary>Derived gate families on head 3db795b</summary> - `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 47 commands: 19 pnpm and 28 direct node. - All 47 exited 0. Each exit code was captured before any pipe, with stdin from `/dev/null`. The packages build ran first, for `check:dts-closure` and `check:dual-build-cjs-loads`. - `check-plugin-teardown-shape.mjs --self-test` first exited 3 (PREREQUISITE NOT MET, a pinned fixture commit missing from the shallow clone). After `git fetch --depth=1 origin 621a487…` it exited 0 with 48 cases passing. - `--ran` reconciliation: `47 derived, 47 run, 0 NOT-MEASURED, 0 UNRUN` (a derived zero). </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01BVeRMDCTHZCcrUPPJm5cFJ)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent aec5f7b commit c19ad22

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎packages/plugins/plugin-hono-server/tsconfig.json‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
"ignoreDeprecations": "6.0",
77
"strict": true,
88
"esModuleInterop": true,
9+
// Type-check this package's own code, not its dependencies' .d.ts. Without
10+
// it tsc re-checks every declaration file it loads (~31 MB, 23 MB of it
11+
// @objectstack/spec's dist), which took this program to ~4.4 GB peak RSS
12+
// against a 4136 MB CI heap. tsconfig.base.json sets the same flag for
13+
// every package that extends it.
14+
"skipLibCheck": true,
915
"declaration": true,
1016
"outDir": "./dist",
1117
"types": [

0 commit comments

Comments
 (0)