Skip to content

fix(devframe): keep whenexpr types external in dts bundling#100

Merged
antfu merged 1 commit into
mainfrom
fix/tsdown-whenexpr-dts-bundle
Jul 16, 2026
Merged

fix(devframe): keep whenexpr types external in dts bundling#100
antfu merged 1 commit into
mainfrom
fix/tsdown-whenexpr-dts-bundle

Conversation

@antfubot

Copy link
Copy Markdown
Collaborator

Summary

CI (and the release workflow) was red on main: devframe's combined dts build failed with

[MISSING_EXPORT] "WhenExpression" is not exported by ".../whenexpr@0.1.2/.../dist/index.d.mts".

whenexpr is listed in deps.onlyBundle so its runtime code gets inlined into dist/. That same config also drove the dts build, so rolldown's dts bundler tried to inline whenexpr's declaration file too — and choked on its mixed type/value named-export list (export { type WhenExpression, evaluateWhen, ... }), dropping the type modifier off the re-exported WhenExpression alias and then failing to resolve it as a value export.

Fix

Use tsdown's deps.dts.neverBundle override (added in tsdown v0.22.1) to keep whenexpr's types external while its runtime code is still inlined via onlyBundle. The generated .d.mts now imports WhenExpression straight from the published whenexpr package instead of re-bundling it.

Verified locally: pnpm build, pnpm lint, pnpm typecheck, and pnpm test (665 tests) all pass.


Created with the help of an agent.

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.
@netlify

netlify Bot commented Jul 16, 2026

Copy link
Copy Markdown

Deploy Preview for devfra ready!

Name Link
🔨 Latest commit 3e6d08e
🔍 Latest deploy log https://app.netlify.com/projects/devfra/deploys/6a5833d7ba489300085166c7
😎 Deploy Preview https://deploy-preview-100--devfra.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@antfu antfu merged commit aa391e3 into main Jul 16, 2026
12 checks passed
@antfu antfu deleted the fix/tsdown-whenexpr-dts-bundle branch July 16, 2026 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants