diff --git a/changelog.d/legacy-types-resolution.fixed.md b/changelog.d/legacy-types-resolution.fixed.md new file mode 100644 index 0000000..2f1ec2f --- /dev/null +++ b/changelog.d/legacy-types-resolution.fixed.md @@ -0,0 +1 @@ +`@policyengine/ui-kit/legacy` types now resolve correctly under TypeScript `bundler` resolution. Same root cause as 0.8.1's main-entry fix: `src/legacy/index.ts` re-exported `'./tokens'` and `'./charts'`, but Vite's multi-entry build emits `dist/legacy/tokens.js` and `dist/legacy/charts.js` siblings to the tsc-emitted `dist/legacy/tokens/index.d.ts` and `dist/legacy/charts/index.d.ts` folders. With both shapes on disk, TS's `bundler` resolver picks the file (no types) over the folder. Pinning to `'./tokens/index'` and `'./charts/index'` forces folder resolution. diff --git a/src/legacy/index.ts b/src/legacy/index.ts index 392bd3b..f1df1dc 100644 --- a/src/legacy/index.ts +++ b/src/legacy/index.ts @@ -28,5 +28,10 @@ * This module will be removed in a future major release once consumers migrate. */ -export * from "./tokens"; -export * from "./charts"; +// Subpath re-exports use explicit `/index` to dodge the same +// file-shadowing-folder ambiguity fixed in src/index.ts. Without the +// `/index` pin, TypeScript's `bundler` resolution picks the Vite-emitted +// `dist/legacy/tokens.js` over the tsc-emitted `dist/legacy/tokens/index.d.ts` +// and silently drops the re-exports. +export * from "./tokens/index"; +export * from "./charts/index";