mermaid-js / mermaid-cli

Command line tool for the Mermaid library
MIT License
2.31k stars 223 forks source link

How to use zenuml in mmdc #564

Closed unizhu closed 1 year ago

unizhu commented 1 year ago

Help us help you!

When I try to use zenuml in mermaid, and it shows:

Error: Evaluation failed: UnknownDiagramError: No diagram type detected matching given configuration for text: zenuml
Yokozuna59 commented 1 year ago

zenuml has been added to mermaid@10.2.3, the current mermaid version that mermaid-cli uses is mermaid@10.0.0, bumping the version would resolve this.

Although it should be resolve by this PR #550. Apparently, dependabot update the lock without updating package.json.

CC @aloisklink @MindaugasLaganeckas

I guess you mainly maintain this repo, so I CCed you guys :)

Yokozuna59 commented 1 year ago

I think this should resolve the lock file update only: https://stackoverflow.com/a/66819358/16476610

But we need to update the current packages manually.

aloisklink commented 1 year ago

Actually, ZenUML currently requires the installation of a separate @mermaid-js/mermaid-zenuml pacakge, see docs at https://mermaid.js.org/syntax/zenuml.html#integrating-with-your-library-website

This would normally be quite a lot of work to add to the mermaid-cli package, but luckily, we already did something similar to add mindmap support, back when it was in a separate package! I've made a PR to add ZenUML support in https://github.com/mermaid-js/mermaid-cli/pull/566. It does make mermaid-cli larger by 700 KiB (200 KiB when gzipped), which is about a 10% increase, but I think that should be fine.

I think this should resolve the lock file update only: https://stackoverflow.com/a/66819358/16476610

Personally, I'm okay with it only updating our lock file (after all, that's what the lock file is there for, and generally mermaid-cli will still be compatible with older versions of packages), but if you think it's best that our package.json file is also updated, feel free to make a PR :smile:

Yokozuna59 commented 1 year ago

Personally, I'm okay with it only updating our lock file (after all, that's what the lock file is there for, and generally mermaid-cli will still be compatible with older versions of packages),

I'm not really familiar with JS/TS stuff yet, so not sure what the difference is :)