Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(experimental-dts): only include exported declarations #1039

Merged
merged 5 commits into from Nov 20, 2023

Conversation

ocavue
Copy link
Sponsor Collaborator

@ocavue ocavue commented Nov 19, 2023

This PR fixes a bug when using the --experimental-dts.

Let's say we have the following file structure:

// src/shared.ts
export const declare1 = 'declare1'
export const declare2 = 'declare2'

// src/entry1.ts
export { declare1 } from './shared'

// src/entry2.ts
export { declare2 } from './shared'

In this example, entry1.ts and entry2.ts are public entry files. In the generated entry1.d.ts, it should only contain declare1, and entry2.d.ts should only contain declare2. However, the generated entry1.d.ts and entry2.d.ts incorrectly contain both declare1 and declare2.

This PR fixes this bug and adds a test case.

Copy link

vercel bot commented Nov 19, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tsup ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 19, 2023 4:09pm

Copy link

codesandbox bot commented Nov 19, 2023

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@ocavue ocavue marked this pull request as ready for review November 20, 2023 04:22
@ocavue ocavue requested review from sxzz and egoist November 20, 2023 04:22
@ocavue ocavue merged commit 731f43f into dev Nov 20, 2023
10 checks passed
@ocavue ocavue deleted the ocavue/fix-exp-dts branch November 20, 2023 07:45
Copy link

🎉 This PR is included in version 8.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant