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

feat(mermaid): add a new output format #151

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

phiz71
Copy link

@phiz71 phiz71 commented Apr 14, 2022

@ferstl
Copy link
Owner

ferstl commented Apr 20, 2022

Thanks a lot for this PR. I‘ll review it soon. Please be patient.

@christopwner
Copy link

this would be a great addition since mermaid can be embedded in github and gitlab. i installed this locally to test it out, and here's the output with following cmd:

christopwner@desktop:~/projects/depgraph-maven-plugin/src/test/projects/depgraph-maven-plugin-test/sub-parent/module-3$ mvn com.github.ferstl:depgraph-maven-plugin:4.0.2-SNAPSHOT:graph -DgraphFormat=mermaid

actual:

flowchart TD
  %% Node Definitions:
  com.github.ferstl:module-1:jar["module-1"]
  com.github.ferstl:module-2:zip["module-2"]
  com.github.ferstl:module-3:jar["module-3"]
  junit:junit:jar["junit<br/><font size=1>(test)</font>"]
  org.hamcrest:hamcrest-core:jar["hamcrest-core<br/><font size=1>(test)</font>"]
  com.github.ferstl:module-2:jar["module-2"]
  com.mysema.querydsl:querydsl-core:jar["querydsl-core"]
  com.google.guava:guava:jar["guava"]
  com.google.code.findbugs:jsr305:jar["jsr305"]
  com.mysema.commons:mysema-commons-lang:jar["mysema-commons-lang"]
  com.infradna.tool:bridge-method-annotation:jar["bridge-method-annotation"]

  %% Edge Definitions:
  com.github.ferstl:module-1:jar --> com.github.ferstl:module-2:zip
  com.github.ferstl:module-3:jar --> com.github.ferstl:module-1:jar
  junit:junit:jar --> org.hamcrest:hamcrest-core:jar
  com.github.ferstl:module-2:jar --> junit:junit:jar
  com.github.ferstl:module-3:jar --> com.github.ferstl:module-2:jar
  com.mysema.querydsl:querydsl-core:jar --> com.google.guava:guava:jar
  com.mysema.querydsl:querydsl-core:jar --> com.google.code.findbugs:jsr305:jar
  com.mysema.querydsl:querydsl-core:jar --> com.mysema.commons:mysema-commons-lang:jar
  com.mysema.querydsl:querydsl-core:jar --> com.infradna.tool:bridge-method-annotation:jar
  com.github.ferstl:module-3:jar --> com.mysema.querydsl:querydsl-core:jar
Loading

i see a few issues with graph based on the expectations file you added, src/test/projects/depgraph-maven-plugin-test/expectations/graph_module-3.mmd, see following:

expected:

flowchart TD
  %% Node Definitions:
  com.github.ferstl:module-1:jar["module-1"]
  commons-codec:commons-codec:jar["commons-codec"]
  org.apache.commons:commons-lang3:jar["commons-lang3"]
  com.github.ferstl:module-3:jar["module-3"]
  com.github.ferstl:module-2:jar["module-2"]
  com.google.guava:guava:jar["guava"]
  com.mysema.querydsl:querydsl-core:jar["querydsl-core"]
  com.google.code.findbugs:jsr305:jar["jsr305"]
  com.mysema.commons:mysema-commons-lang:jar["mysema-commons-lang"]
  com.infradna.tool:bridge-method-annotation:jar["bridge-method-annotation"]

  %% Edge Definitions:
  com.github.ferstl:module-1:jar --> commons-codec:commons-codec:jar
  com.github.ferstl:module-1:jar --> org.apache.commons:commons-lang3:jar
  com.github.ferstl:module-3:jar --> com.github.ferstl:module-1:jar
  com.github.ferstl:module-2:jar --> com.google.guava:guava:jar
  com.github.ferstl:module-3:jar --> com.github.ferstl:module-2:jar
  com.mysema.querydsl:querydsl-core:jar --> com.google.code.findbugs:jsr305:jar
  com.mysema.querydsl:querydsl-core:jar --> com.mysema.commons:mysema-commons-lang:jar
  com.mysema.querydsl:querydsl-core:jar --> com.infradna.tool:bridge-method-annotation:jar
  com.github.ferstl:module-3:jar --> com.mysema.querydsl:querydsl-core:jar
Loading

aside from the missing nodes like commons-codec and incorrect edges, i also found looking that two module-2 nodes are defined, one as jar and other zip in actual mmd output. i cleaned and reran to confirm issue was there (and not present in dot output). see following snippet from first graph:

  com.github.ferstl:module-2:zip["module-2"]
  com.github.ferstl:module-3:jar["module-3"]
  junit:junit:jar["junit<br/><font size=1>(test)</font>"]
  org.hamcrest:hamcrest-core:jar["hamcrest-core<br/><font size=1>(test)</font>"]
  com.github.ferstl:module-2:jar["module-2"]

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.

3 participants