Skip to content

feat!: disable types when legacy isn't passed as well#685

Merged
sxzz merged 3 commits intorolldown:mainfrom
lishaduck:patch-1
Jan 3, 2026
Merged

feat!: disable types when legacy isn't passed as well#685
sxzz merged 3 commits intorolldown:mainfrom
lishaduck:patch-1

Conversation

@lishaduck
Copy link
Copy Markdown
Contributor

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

Description

Disables types when using exports.

Linked Issues

Additional context

Made this in the GitHub editor, test snapshots will likely need updating.

@netlify
Copy link
Copy Markdown

netlify bot commented Jan 2, 2026

Deploy Preview for tsdown ready!

Name Link
🔨 Latest commit 1beb4db
🔍 Latest deploy log https://app.netlify.com/projects/tsdown/deploys/6958d01978d8bf00084708a3
😎 Deploy Preview https://deploy-preview-685--tsdown.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 Jan 2, 2026

Open in StackBlitz

npm i https://pkg.pr.new/tsdown@685
npm i https://pkg.pr.new/create-tsdown@685
npm i https://pkg.pr.new/tsdown-migrate@685

commit: 1beb4db

Comment on lines +262 to +264
main: legacy ? main || module || pkg.main : undefined,
module: legacy ? module || pkg.module : undefined,
types: cjsTypes || esmTypes || pkg.types,
types: legacy ? cjsTypes || esmTypes || pkg.types : undefined,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the dance we did in the above packages was good and right, but if you disagree, we could also do:

Suggested change
main: legacy ? main || module || pkg.main : undefined,
module: legacy ? module || pkg.module : undefined,
types: cjsTypes || esmTypes || pkg.types,
types: legacy ? cjsTypes || esmTypes || pkg.types : undefined,
main: legacy ? main || module || pkg.main : pkg.main,
module: legacy ? module || pkg.module : pkg.module,
types: legacy ? cjsTypes || esmTypes || pkg.types : pkg.types,

I don't love that though, it feels a bit too magical and means we don't auto-migrate users anymore.

@sxzz
Copy link
Copy Markdown
Member

sxzz commented Jan 3, 2026

This may introduce potential issues:

  • Automatic detection of the dts option will no longer function.
  • While @vitejs/plugin-vue provides type declarations, they are not shown on npmjs.com because the site depends on the types field, which is missing from @vitejs/plugin-vue/package.json.

As a result, we will not be merging this PR at this time. For further discussion, please visit publint/publint#24

Copy link
Copy Markdown
Member

@sxzz sxzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to keep the types field for tsdown itself, but I agree that we should no longer auto-fill the types field if it was not present originally. This change will not affect the default value of the dts option.

@sxzz sxzz merged commit 7be6bad into rolldown:main Jan 3, 2026
16 checks passed
@lishaduck lishaduck deleted the patch-1 branch January 3, 2026 17:52
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