From 12b94474eba778a4015d77cc8defa4aacf3f7388 Mon Sep 17 00:00:00 2001 From: Divyansh Singh <40380293+brc-dd@users.noreply.github.com> Date: Fri, 28 Aug 2026 02:50:44 +0530 Subject: [PATCH] chore: make the root tsconfig a self-contained editor project MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The root config had no include, so the editor program for any src file swallowed every file importing 'vitepress' (tests, docs configs) and with them dist/node/index.d.ts — whose bundled copies of the vite and default-theme augmentations collide with the source ones under different type identities (TS2717), alongside ~1200 phantom errors from test globals. The root project now covers only the sources and resolves 'vitepress' onto src the way tsconfig.client.json already does; every other config extends tsconfig.base.json directly (the root added nothing over it), leaving their programs byte-identical. Co-Authored-By: Claude Fable 5 --- __tests__/tsconfig.json | 2 +- docs/tsconfig.json | 2 +- tsconfig.client.json | 2 +- tsconfig.json | 23 ++++++++++++++++++++++- tsconfig.node.json | 2 +- tsconfig.shared.json | 2 +- 6 files changed, 27 insertions(+), 6 deletions(-) diff --git a/__tests__/tsconfig.json b/__tests__/tsconfig.json index 366c4ab8..83d5121c 100644 --- a/__tests__/tsconfig.json +++ b/__tests__/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../tsconfig.json", + "extends": "../tsconfig.base.json", "compilerOptions": { "noEmit": true, "isolatedModules": false, diff --git a/docs/tsconfig.json b/docs/tsconfig.json index 35cd2ee8..df2be3de 100644 --- a/docs/tsconfig.json +++ b/docs/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../tsconfig.json", + "extends": "../tsconfig.base.json", "compilerOptions": { "allowImportingTsExtensions": true, "noEmit": true, diff --git a/tsconfig.client.json b/tsconfig.client.json index 0e47095d..d625950b 100644 --- a/tsconfig.client.json +++ b/tsconfig.client.json @@ -1,5 +1,5 @@ { - "extends": "./tsconfig.json", + "extends": "./tsconfig.base.json", "compilerOptions": { "lib": ["ES2023", "DOM", "DOM.Iterable"], "types": ["./client.d.ts"], diff --git a/tsconfig.json b/tsconfig.json index ffcbb947..719f8eca 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,3 +1,24 @@ +// the editor's project for the sources. Self-contained: `vitepress` resolves +// onto src (same trick as tsconfig.client.json), so the built dist — whose +// bundled types re-declare the `vite` and default-theme augmentations under +// different type identities — never enters this program. Tests and docs have +// their own nearest tsconfigs and resolve the package normally. { - "extends": "./tsconfig.base.json" + "extends": "./tsconfig.base.json", + "compilerOptions": { + "paths": { + "vitepress": ["./src/client/index.ts"], + "vitepress/theme": ["./types/default-theme.d.ts"], + "@siteData": ["./src/client/shims.d.ts"], + "@theme/index": ["./src/client/shims.d.ts"], + "@localSearchIndex": ["./src/client/shims.d.ts"] + } + }, + "include": [ + "src", + "types", + "scripts", + "shared-globals.d.ts", + "tsdown.config.ts" + ] } diff --git a/tsconfig.node.json b/tsconfig.node.json index 3de1cdef..36330db4 100644 --- a/tsconfig.node.json +++ b/tsconfig.node.json @@ -1,5 +1,5 @@ { - "extends": "./tsconfig.json", + "extends": "./tsconfig.base.json", "compilerOptions": { "lib": ["ES2023"], "types": ["node"] diff --git a/tsconfig.shared.json b/tsconfig.shared.json index 0a9eb997..0956fe06 100644 --- a/tsconfig.shared.json +++ b/tsconfig.shared.json @@ -1,5 +1,5 @@ { - "extends": "./tsconfig.json", + "extends": "./tsconfig.base.json", "compilerOptions": { "lib": ["ES2023"], "types": [],