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 TypeScript types to support node16 and bundler moduleResolution modes #634

Conversation

aloisklink
Copy link
Member

📑 Summary

Currently, the TypeScript types for this module only support the node10 TypeScript module resolution mode.

Now, node10, node16 (ESM only), and bundler all work, according to https://arethetypeswrong.github.io/, see https://www.typescriptlang.org/docs/handbook/modules/theory.html#module-resolution

Resolves #628
Resolves #633

📏 Design Decisions

@andrewshawcare, I've listed you as a co-author for this commit since the content is from your recommended patch in #633! Let me know if you're not comfortable with this, or if you'd prefer to make your own PR for this contribution!

📋 Tasks

Make sure you

Currently, the TypeScript types for this module only support the
`node10` TypeScript module resolution mode.
Now, `node10`, `node16` (ESM only), and `bundler` all work,
according to https://arethetypeswrong.github.io/

Fixes: mermaid-js#628
Fixes: mermaid-js#633
Co-authored-by: Andrew Shaw Care <[email protected]>
@aloisklink aloisklink added the bug Something isn't working label Jan 7, 2024
@github-actions github-actions bot added the fix label Jan 7, 2024
@andrewshawcare
Copy link
Contributor

All good with me, thanks for doing this! 👍

@MindaugasLaganeckas MindaugasLaganeckas self-assigned this Jan 22, 2024
@MindaugasLaganeckas
Copy link
Member

@aloisklink Can this be merged? There is a new mermaid release and I would like your PR to be included into the next mermaid-cli release? Thank you 😄

@aloisklink aloisklink merged commit 5b60cb9 into mermaid-js:master Jan 22, 2024
8 checks passed
@aloisklink aloisklink deleted the fix/fix-types-for-module-resolution-node16 branch January 22, 2024 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add types for exports Unable to resolve types with TypeScript 5.3.3 / TSC 9.2.0
3 participants