Skip to content

fix: generate d.mts for .mjs files - #104

Merged
mathiasbynens merged 2 commits into
node-unicode:mainfrom
JLHwung:use-d-mts
Sep 10, 2026
Merged

mathiasbynens merged 2 commits into
node-unicode:mainfrom
JLHwung:use-d-mts

Conversation

@JLHwung

@JLHwung JLHwung commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

In abf6544 we shipped a breaking change that renames *.js to *.mjs, which leads to the following tsc error:

TS2307: Cannot find module '@unicode/unicode-16.0.0/Binary_Property/ID_Start/ranges.mjs' or its corresponding type declarations.

as tsc expects d.mts files for .mjs inputs.

@mathiasbynens
mathiasbynens merged commit 7d6687b into node-unicode:main Sep 10, 2026
1 check passed
@mathiasbynens

Copy link
Copy Markdown
Collaborator

Thanks!

@JLHwung
JLHwung deleted the use-d-mts branch September 10, 2026 12:38
@JLHwung

JLHwung commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

@mathiasbynens Could you tag a 2.0.6 release? Babel depends on this change.

@mathiasbynens

Copy link
Copy Markdown
Collaborator

@JLHwung On it!

@JLHwung

JLHwung commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor Author

Thank you. The published package now contains both .d.ts and .d.mts: https://github.com/node-unicode/unicode-18.0.0/tree/v2.0.6/Bidi_Class/Arabic_Letter

I will check if tsc is happy with that.

I guess we should uncomment this line the next time we publish:

#rm -rf -- output/*/*!(.git);

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