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

feat: upgrade to unbuild@2 #161

Merged
merged 1 commit into from
Aug 28, 2023
Merged

feat: upgrade to unbuild@2 #161

merged 1 commit into from
Aug 28, 2023

Conversation

antfu
Copy link
Member

@antfu antfu commented Aug 28, 2023

Resolves #151

if (existsSync(dtsFile)) {
return
}

// Read generated module types
const moduleTypesFile = resolve(distDir, 'module.d.ts')
const moduleTypes = await fsp.readFile(moduleTypesFile, 'utf8').catch(() => '')
const typeExports = findExports(moduleTypes)
const typeExports = findExports(
// Replace `export { type Foo }` with `export { Foo }`
Copy link
Member Author

Choose a reason for hiding this comment

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

This is due to Swatinem/rollup-plugin-dts@1b228d0

I am uncertain if such a feature should be included in mlly as findExports is used to find non-type exports. While fineTypeExports finds types exports only. But in .d.ts actually, all exports are type exports with or without the type indicator.

@Hebilicious
Copy link
Member

Resolves #151

@danielroe danielroe merged commit 665b54b into main Aug 28, 2023
1 check passed
@danielroe danielroe deleted the feat/unbuild2 branch August 28, 2023 08:36
@@ -19,11 +19,14 @@ describe('module builder', () => {
expect(files).toMatchInlineSnapshot(`
[
"module.cjs",
"module.d.mts",
Copy link
Member

Choose a reason for hiding this comment

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

It would be great if out the box we would generate mts and cts 🙏🏽

Copy link
Member

Choose a reason for hiding this comment

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

what do you mean?

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.

[feature request] support mts and cts declaration files
3 participants