From 3e6d08ecd1ab238e93b791ed98e5ffe2d5e12c88 Mon Sep 17 00:00:00 2001 From: "Anthony Fu (via agent)" Date: Thu, 16 Jul 2026 01:28:21 +0000 Subject: [PATCH] fix(devframe): keep whenexpr types external in dts bundling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bundling whenexpr's declaration file into the combined dts build made rolldown's dts bundler choke on its mixed type/value named export list (export { type WhenExpression, evaluateWhen, ... }) — it dropped the type modifier off the re-exported WhenExpression alias and then failed to resolve it as a value export, breaking devframe's build (and every downstream CI job that depends on it). whenexpr's runtime code still gets inlined via onlyBundle; only its .d.ts is now left external via the new deps.dts.neverBundle override, so tsdown resolves WhenExpression straight from the published package's types instead of re-bundling them. --- packages/devframe/tsdown.config.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/devframe/tsdown.config.ts b/packages/devframe/tsdown.config.ts index d357750..1ca9eee 100644 --- a/packages/devframe/tsdown.config.ts +++ b/packages/devframe/tsdown.config.ts @@ -23,6 +23,17 @@ const deps = { 'terser', '@jridgewell/trace-mapping', ], + // `whenexpr` is runtime-only bundled (see `onlyBundle` below); its + // declaration file mixes type-only and value named exports + // (`export { type WhenExpression, evaluateWhen, ... }`) in a way that + // trips up rolldown's dts bundler when it tries to inline the type + // graph too (spuriously drops the `type` modifier off the merged + // re-export, then can't find `WhenExpression` as a value export). Leave + // `whenexpr`'s types external and let dts consumers resolve them + // straight from the published package. + dts: { + neverBundle: ['whenexpr'], + }, onlyBundle: [ 'acorn', 'bundle-name',