Skip to content

fix: Broken TypeScript declarations - #41

Merged
timfish merged 2 commits into
mainfrom
fix/types
Jul 21, 2026
Merged

fix: Broken TypeScript declarations#41
timfish merged 2 commits into
mainfrom
fix/types

Conversation

@timfish

@timfish timfish commented Jul 20, 2026

Copy link
Copy Markdown
Member

Publishing a dual cjs/esm package that supports both node10/node16 resolution is so painful 😭

@timfish
timfish requested review from AbhiPrasad, Lms24 and isaacs July 20, 2026 23:11

@Lms24 Lms24 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

naive question: would a simpler fix here be to redirect all the types entry points in package.json to the d.ts files instead of copying and emitting .d.mts and .d.cts files?

No objections though if this isn't possible/recommended, so ✅-ing to unblock

@timfish

timfish commented Jul 21, 2026

Copy link
Copy Markdown
Member Author

I found that I could avoid .d.mts and .d.cts if the source files all used .js extensions.

@timfish
timfish merged commit 8dffa5b into main Jul 21, 2026
1 check passed
@timfish
timfish deleted the fix/types branch July 21, 2026 14:32
@timfish timfish mentioned this pull request Jul 21, 2026
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.

.d.ts files contain TS errors

2 participants