Skip to content

feat(exports): add bin to publishConfig when devExports is enabled#911

Merged
sxzz merged 2 commits intomainfrom
issue-908-v1
Apr 14, 2026
Merged

feat(exports): add bin to publishConfig when devExports is enabled#911
sxzz merged 2 commits intomainfrom
issue-908-v1

Conversation

@sxzz
Copy link
Copy Markdown
Member

@sxzz sxzz commented Apr 14, 2026

  • This PR contains AI-generated code, but I have carefully reviewed it myself. Otherwise, my PR may be closed.

Description

When devExports is enabled, exports correctly puts source paths in the main field and dist paths in publishConfig.exports. However, bin only wrote dist paths directly without the same dev/publish split. This PR adds the same treatment to bin: source paths go to the main bin field, and dist paths go to publishConfig.bin.

Adds a devExports parameter to generateBin and calls it twice (mirroring the genSubExport pattern) — once for dev, once for publish.

Linked Issues

Closes #908

Additional context

Tests cover all three bin forms (true, string, object) combined with devExports: true.

When `devExports` is enabled, `exports` puts source paths in
the main field and dist paths in `publishConfig.exports`. However,
`bin` only wrote dist paths directly without the same dev/publish
split.

Add a `devExports` parameter to `generateBin`. When true, it returns
source paths instead of dist paths. Call `generateBin` twice in
`generateExports` (mirroring the `genSubExport` pattern): once with
`devExports` for the main `bin` field, and once with `false` for
`publishBin`. Write `publishBin` to `publishConfig.bin` in
`writeExports`.

Closes #908
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 14, 2026

Deploy Preview for tsdown-main ready!

Name Link
🔨 Latest commit 6a93d31
🔍 Latest deploy log https://app.netlify.com/projects/tsdown-main/deploys/69ddf955cfce6a00085a8023
😎 Deploy Preview https://deploy-preview-911--tsdown-main.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 14, 2026

Open in StackBlitz

tsdown

pnpm add https://pkg.pr.new/tsdown@911 -D
npm i https://pkg.pr.new/tsdown@911 -D
yarn add https://pkg.pr.new/tsdown@911.tgz -D

create-tsdown

pnpm add https://pkg.pr.new/create-tsdown@911 -D
npm i https://pkg.pr.new/create-tsdown@911 -D
yarn add https://pkg.pr.new/create-tsdown@911.tgz -D

@tsdown/css

pnpm add https://pkg.pr.new/@tsdown/css@911 -D
npm i https://pkg.pr.new/@tsdown/css@911 -D
yarn add https://pkg.pr.new/@tsdown/css@911.tgz -D

@tsdown/exe

pnpm add https://pkg.pr.new/@tsdown/exe@911 -D
npm i https://pkg.pr.new/@tsdown/exe@911 -D
yarn add https://pkg.pr.new/@tsdown/exe@911.tgz -D

tsdown-migrate

pnpm add https://pkg.pr.new/tsdown-migrate@911 -D
npm i https://pkg.pr.new/tsdown-migrate@911 -D
yarn add https://pkg.pr.new/tsdown-migrate@911.tgz -D

commit: 6a93d31

@sxzz sxzz merged commit 60592ef into main Apr 14, 2026
15 checks passed
@sxzz sxzz deleted the issue-908-v1 branch April 14, 2026 08:27
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.

devExports: add bin to publishConfig

1 participant