egoist / tsup

The simplest and fastest way to bundle your TypeScript libraries.
https://tsup.egoist.dev
MIT License
8.48k stars 209 forks source link

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

Closed ocavue closed 7 months ago

ocavue commented 7 months ago

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.

vercel[bot] commented 7 months ago

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
codesandbox[bot] commented 7 months ago

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders
Open Preview

github-actions[bot] commented 7 months ago

:tada: This PR is included in version 8.0.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: