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: node10 types and implementation resolution #922

Closed
wants to merge 2 commits into from

Conversation

userquin
Copy link
Contributor

@userquin userquin commented Feb 7, 2025

Description

This PR includes the following fixes for node10 module resolution:

/cc @antfu

About the *.mts typesVersions mapping in langs, langs-precompiled and theme packages, it is a hack to allow resolve both types and implementation correctly, I've send you a few DM at discord with some screenshots with the traces for both.

I also need to review a few repositories 😅

Linked Issues

Additional context

image
current cache-fs subpackage export

image
cache-fs subpackage export with this PR

Copy link

netlify bot commented Feb 7, 2025

Deploy Preview for shiki-matsu failed.

Name Link
🔨 Latest commit 6c3b65f
🔍 Latest deploy log https://app.netlify.com/sites/shiki-matsu/deploys/67a6cc2509e4d70008ba4563

Copy link

netlify bot commented Feb 7, 2025

Deploy Preview for shiki-next failed.

Name Link
🔨 Latest commit 6c3b65f
🔍 Latest deploy log https://app.netlify.com/sites/shiki-next/deploys/67a6cc2549bd410008244c00

@userquin userquin marked this pull request as draft February 8, 2025 02:47
@userquin
Copy link
Contributor Author

userquin commented Feb 8, 2025

I need to review why node10 resolving implementation to d.mts instead .mjs

@antfu
Copy link
Member

antfu commented Feb 8, 2025

Can we drop Node 10 already? 🤣

@userquin userquin marked this pull request as ready for review February 8, 2025 03:14
@userquin
Copy link
Contributor Author

userquin commented Feb 8, 2025

Can we drop Node 10 already? 🤣

Yeah, it is a pain... in fact your blog about Types for Submodules is wrong (@tmkx shared me), you shouldn't use the dts in typesVersions, the implementation resolution will resolve to the dts instead the implmentation (here to mjs files), you need to use .ts (if using compatible) or .mts (if using ESM only).

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