From b7bf339716b6e89de7f7a073feaef816766ed6b9 Mon Sep 17 00:00:00 2001 From: william garrity Date: Tue, 7 Apr 2026 21:08:37 -0400 Subject: [PATCH 1/2] fix(build): add tsconfig paths mapping for datavis submodule MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The DTS (type declaration) build was failing with TS2307 errors on all datavis/src/* imports in DataVisNITRO.tsx. The ESM/CJS build succeeded because tsup externalizes those imports via /^datavis\//, but TypeScript still needs to resolve the types for .d.ts generation. The root cause: TypeScript resolves datavis/src/* through pnpm's node_modules symlink chain, which can be fragile depending on the pnpm store state and link timing. Adding a paths mapping tells TypeScript to resolve directly to ./packages/datavis/src/*, bypassing the symlink entirely. Verified with a fresh clone: git clone → pnpm install → pnpm build produces ESM, CJS, and DTS output successfully. --- tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index a6622ab0..8c91665b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,7 +15,8 @@ "declaration": true, "declarationMap": true, "paths": { - "@/*": ["./src/*"] + "@/*": ["./src/*"], + "datavis/src/*": ["./packages/datavis/src/*"] }, "types": ["node"] }, From e6c578ae72be2555d3f812e279021919a4e9f0bb Mon Sep 17 00:00:00 2001 From: william garrity Date: Tue, 7 Apr 2026 21:21:20 -0400 Subject: [PATCH 2/2] fix(build): use separate tsconfig for DTS generation The DTS build was failing with TS2307 errors on all datavis/src/* imports in DataVisNITRO.tsx. The ESM/CJS build succeeded because tsup externalizes those imports via /^datavis\//, but TypeScript still needs to resolve the types for .d.ts generation. The fix uses a split tsconfig strategy: - tsconfig.json (unchanged): used by 'tsc --noEmit' (typecheck) and IDE tooling. Does NOT include datavis/src/* paths, so it won't crawl into the datavis submodule's full source tree and error on its transitive dependencies (react-i18next, @dnd-kit/*, etc.). - tsconfig.build.json (new): extends tsconfig.json and adds a paths mapping for datavis/src/* -> ./packages/datavis/src/*. This lets TypeScript resolve the deep submodule imports directly without relying on pnpm's symlink chain. - tsup.config.ts: now sets tsconfig: 'tsconfig.build.json' at the root level so DTS generation uses the build-specific config. Verified with fresh clone: git clone -> pnpm install -> pnpm typecheck (passes) -> pnpm build (ESM, CJS, DTS all succeed). --- tsconfig.build.json | 9 +++++++++ tsconfig.json | 3 +-- tsup.config.ts | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 tsconfig.build.json diff --git a/tsconfig.build.json b/tsconfig.build.json new file mode 100644 index 00000000..43152013 --- /dev/null +++ b/tsconfig.build.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "paths": { + "@/*": ["./src/*"], + "datavis/src/*": ["./packages/datavis/src/*"] + } + } +} diff --git a/tsconfig.json b/tsconfig.json index 8c91665b..a6622ab0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,8 +15,7 @@ "declaration": true, "declarationMap": true, "paths": { - "@/*": ["./src/*"], - "datavis/src/*": ["./packages/datavis/src/*"] + "@/*": ["./src/*"] }, "types": ["node"] }, diff --git a/tsup.config.ts b/tsup.config.ts index 88b3922c..a0a311d6 100644 --- a/tsup.config.ts +++ b/tsup.config.ts @@ -51,6 +51,7 @@ export default defineConfig({ format: ['esm', 'cjs'], target: 'es2022', dts: true, + tsconfig: 'tsconfig.build.json', sourcemap: true, clean: true, external: [