mermaid-js / mermaid-cli

Command line tool for the Mermaid library
MIT License
2.4k stars 227 forks source link

Fix TypeScript types to support `node16` and `bundler` `moduleResolution` modes #634

Closed aloisklink closed 8 months ago

aloisklink commented 9 months ago

:bookmark_tabs: 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 https://github.com/mermaid-js/mermaid-cli/issues/628 Resolves https://github.com/mermaid-js/mermaid-cli/issues/633

:straight_ruler: Design Decisions

@andrewshawcare, I've listed you as a co-author for this commit since the content is from your recommended patch in https://github.com/mermaid-js/mermaid-cli/issues/633! Let me know if you're not comfortable with this, or if you'd prefer to make your own PR for this contribution!

:clipboard: Tasks

Make sure you

andrewshawcare commented 9 months ago

All good with me, thanks for doing this! 👍

MindaugasLaganeckas commented 8 months ago

@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 😄