Skip to content

Commit ea89df3

Browse files
build(tsconfig): split the shared base out of the root tsconfig (#26092 part 1) (#26203)
<!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9LfZ5QdBw85EmeKfVNFm1YF)_ Part of #26092 (PR 1 of 2: the tsconfig half; the vitest preset follows as PR 2). Clause-②: no Metadata-protocol: none ## What changes - **`tsconfig.base.json`** (new) holds the compiler options the root `tsconfig.json` used to carry, unchanged. The 72 package/app/example configs that extended the root now extend it. - **Root `tsconfig.json`** is now only the type-check program for `scripts/` and the top-level configs: it extends the base, adds `types: ["node"]`, keeps its `exclude`. - **`tsconfig.test.base.json`** (new) holds the vitest module semantics (`noEmit`, `module: esnext`, `moduleResolution: bundler`, `lib: ["ES2022"]`). 36 of the 42 `tsconfig.test.json` files now spell `"extends": ["./tsconfig.json", "REL/tsconfig.test.base.json"]` and keep only what differs (`DOM` in `lib`, `types`). The other 6 do not re-set module semantics this way and are untouched. - **Module re-sets:** the two configs that re-set `NodeNext` identically to the base (`packages/adapters/hono`, `packages/qa/http-conformance`) drop the duplicate; the seven `ES2020`/`bundler` configs keep it with a one-line reason (four drivers: no `"type": "module"`, so NodeNext compiles their sources as CommonJS and refuses `import.meta`, TS1470 measured; `embedder-openai` / `knowledge-memory` / `knowledge-ragflow`: tsup-bundled, no `"type": "module"`). - **turbo.json** `globalDependencies` gains both bases, so a change to either invalidates every cached build the way a change to the root did; **`.github/workflows/ci.yml`** `core:` filter lists both verbatim, which `check-ci-filter-parity` requires (measured: FAIL naming both files without these two lines). - **Ledgers:** the three empty `test-typecheck-debt.json` files (`packages/rest`, `packages/client`, `packages/plugins/knowledge-ragflow`) are deleted (`check-test-typecheck.mts` reads a missing ledger as empty); the graduation history inside the empty `TEST_DEBT` object is deleted, keeping the closed-ledger rule. - **Comments:** 63 mentions of "the root config" across 53 tsconfig comments now say "the base config". ## No semantic change, measured `tsc --showConfig -p FILE` for every non-ui `tsconfig*.json` (143 files), before (main 95294be) and after: **142 byte-identical**, file lists included. The root differs by exactly `types: ["node"]`. Strictness is not loosened anywhere. ## The card's premise on the root DEBT entry does not hold Root program errors, `tsc --noEmit -p tsconfig.json` with the import closure built: **26 before, 26 after** `types: ["node"]`. The TS2591/TS2584 pile the entry's note blamed on the missing Node types was already gone. What stands: `scripts/analytics-reconcile` imports `@objectstack/*` and example sources the root program cannot resolve (TS2307 x17, plus TS7006 x7 they cascade into), `Object.hasOwn` under lib ES2020 in `scripts/check-test-typecheck.mts` (TS2550), and an unused local in `examples/app-showcase` pulled in by import (TS6133). So the `@objectstack/spec-monorepo` DEBT entry stays at 26 and its note is rewritten to that composition (the stale `compositionAt: 80` is dropped). Graduating it also needs a `typecheck:root` script and its step in `.github/workflows/lint.yml`: separate work, not in this PR. The card's acceptance line about deleting the entry is not met by design. ## Landing Tier H: `.github/workflows/ci.yml` is a governed surface, so this needs the maintainer's approval. The maintainer chose this shape (one PR carrying the two filter lines) on the thread decision card. Root `ci.yml` is also under a short hold for other in-flight work; land after that clears. ## Verification (head 07de412) - `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived **117** commands on this head; all 117 ran, each exit captured before any pipe: **117 exit 0**. `--ran` reconciliation: 117 derived, 117 run, 0 NOT-MEASURED, 0 UNRUN. - Earlier on this branch five of them first refused on prerequisites (exit 2/3: shallow clone, unbuilt dists); after `git fetch --unshallow` and a build of every non-ui package they ran and exited 0, and they are in the 117 above. - `node scripts/check-ci-filter-parity.mjs`: FAIL without the two ci.yml lines, exit 0 with them. - `turbo run typecheck --force` over rest, client, knowledge-ragflow (the three deleted ledgers, whose `typecheck` runs `check:test-typecheck`), core, driver-sql, hono, http-conformance, spec: 49/49 tasks successful (before the main merge; the merge touched no non-ui tsconfig). - Effective-config diff: see above. `tsc -b` was not used for the before/after count: the root config has no `noEmit` or `outDir`, so `tsc -b` would emit next to `scripts/`; the count is `tsc --noEmit -p`, which is what `check:type-check-debt` measures. - Changed lines: well under the 3000 human-merge threshold. No changeset: no published package ships a tsconfig, and every package's effective compiler configuration is unchanged (`skip-changeset`). ## Acceptance notes - `os create --in-repo` (`rootTsconfigExtends` in `packages/cli/src/commands/create.ts`) still points new in-repo scaffolds at the root `tsconfig.json`, which is now the scripts program, so a new scaffold would inherit `types: ["node"]` and the root `exclude`. Not changed here (outside this card's file surface); the CLI tests pin the root path. - `packages/drivers/driver-memory/tsconfig.json` sets `noUnusedLocals: false`, a pre-existing loosening against the base; untouched. - `embedder-openai`, `knowledge-memory`, `knowledge-ragflow` type-check with 0 errors under NodeNext, so their `bundler` re-set could be dropped later; kept here to keep the change semantics-free. - The deleted `packages/rest` ledger's `_note` carried a re-derivation grep for `any`-typed response fixtures; it is in git history. --- _Generated by [Claude Code](https://claude.ai/code/session_01EaorEqkvnJBed5uX9BjSUG)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent f2e7083 commit ea89df3

138 files changed

Lines changed: 254 additions & 632 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/ci.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,8 @@ jobs:
277277
- 'package.json'
278278
- 'pnpm-lock.yaml'
279279
- 'tsconfig.json'
280+
- 'tsconfig.base.json'
281+
- 'tsconfig.test.base.json'
280282
- '.github/workflows/ci.yml'
281283
# BUILD INPUTS outside every package (#21202): turbo.json itself,
282284
# its `globalDependencies`, and each `$TURBO_ROOT$/…` input of a

‎examples/embed-objectql/tsconfig.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../../tsconfig.json",
2+
"extends": "../../tsconfig.base.json",
33
"include": ["src/**/*", "test/**/*"],
44
"exclude": ["node_modules", "dist"],
55
"compilerOptions": {

‎packages/adapters/hono/tsconfig.json‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
{
2-
"extends": "../../../tsconfig.json",
2+
"extends": "../../../tsconfig.base.json",
33
"compilerOptions": {
44
"outDir": "./dist",
55
"rootDir": "./src",
6-
"module": "NodeNext",
7-
"moduleResolution": "NodeNext",
86
"esModuleInterop": true,
97
"skipLibCheck": true,
108
"lib": [

‎packages/adapters/hono/tsconfig.test.json‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,8 @@
6363
// ledger to be added to -- the same call `metadata-fs` and
6464
// `trigger-record-change` recorded.
6565
{
66-
"extends": "./tsconfig.json",
66+
"extends": ["./tsconfig.json", "../../../tsconfig.test.base.json"],
6767
"compilerOptions": {
68-
"noEmit": true,
69-
"module": "esnext",
70-
"moduleResolution": "bundler",
7168
"lib": ["ES2022", "DOM", "DOM.Iterable"]
7269
},
7370
"include": ["src/**/*"],

‎packages/apps/account/tsconfig.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../../../tsconfig.json",
2+
"extends": "../../../tsconfig.base.json",
33
"compilerOptions": {
44
"outDir": "./dist",
55
"rootDir": "./src",

‎packages/apps/setup/tsconfig.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../../../tsconfig.json",
2+
"extends": "../../../tsconfig.base.json",
33
"compilerOptions": {
44
"outDir": "./dist",
55
"rootDir": "./src",

‎packages/apps/studio/tsconfig.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../../../tsconfig.json",
2+
"extends": "../../../tsconfig.base.json",
33
"compilerOptions": {
44
"outDir": "./dist",
55
"rootDir": "./src",

‎packages/cli/tsconfig.test.json‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,9 @@
118118
// than incidental: any error any one of them ever gains is red on arrival. That
119119
// is the half of this gate that starts working today.
120120
{
121-
"extends": "./tsconfig.json",
121+
"extends": ["./tsconfig.json", "../../tsconfig.test.base.json"],
122122
"compilerOptions": {
123-
"noEmit": true,
124123
"rootDir": "../..",
125-
"module": "esnext",
126-
"moduleResolution": "bundler",
127124
"lib": ["ES2022", "DOM", "DOM.Iterable"],
128125
"types": ["node"],
129126
// [#15004, #15229] FIVE bare-name rules, no star, for the five workspace

‎packages/client-react/tsconfig.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "../../tsconfig.json",
2+
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
44
"outDir": "./dist",
55
"rootDir": "./src",

‎packages/client/test-typecheck-debt.json‎

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)