This message was imported from the Ruby/Rails Modularity Slack server. Find more info in the import thread.
Message originally sent by slack user U7835KE8YO1
we just started our modularity journey at HackerOne with packwerk! one of the things we’re experimenting with is visualizing our packs. in an effort to make it easily shareable in our merge request/markdown i made a tool to generate mermaid diagrams: https://github.com/bwillis/packwerk_mermaid i’ve also made a PoC to have the diagram posted to our merge requests when packs are changing, unsure if it’ll be useful or noisy
it’s fairly basic now, so happy to collaborate with others if they find it useful
I‘ve been thinking about how to visualize dependency changes in PRs. Curious what you are planning to do - render the whole graph?
I am not actively working on this right now but was looking into graph diffs. Choice of appropriate local scale / granularity is a hard problem for that though.
A mermaid option to visualize packs would be very cool. I have held off on implementing that because I needed more expressive power in the diagrams than mermaid has today
@iMacTia i’m aware of vizualize_packs, but it didn’t have mermaid support and i didn’t want to have a dependency on graph viz as we didn’t want to add this to our toolchain. happy to converge on a solution if possible.
I’ve been thinking about how to visualize dependency changes in PRs. Curious what you are planning to do - render the whole graph?
likely were going to start with rendering the nodes from the changed files in the MR, maybe allow for configurable levels beyond that. still early though
visualize_packs used to depend on graphviz but doesn’t anymore. To add mermaid support all we’d need is the option and to add an ERB template for it.
At first glance (of the diagram on the homepage) D2 is powerful enough. However, I believe the main draw for mermaid is that it has github markdown support.
On support in github readmes… If you use visualize packs with URLs and output and link to the SVG from a readme, the SVG is clickable and can link to the various packs
the UX on a mermaid text is pretty valuable, being able to just edit and create/remove nodes, rename things especially when directly when making a comment is quite nice