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(report): adds basic d2 (https://d2lang.com/) reporter #857

Merged
merged 5 commits into from
Oct 29, 2023

Conversation

sverweij
Copy link
Owner

@sverweij sverweij commented Oct 29, 2023

Description

  • Adds a d2 reporter
  • 🏕️ minifies generated svg's in the documentation

Motivation and Context

d2 seems like a better engineered text-to-diagram tool than mermaid, and it produces nicer looking results. Compared to GraphViz: it's a lot slower to run, and the diagrams typically take quite a bit more space.

How Has This Been Tested?

  • green ci
  • additional integration tests

Screenshots

The new d2 output for the cache module in dependency-cruiser

tmp_paste_this

The same output, but done with graphviz dot

tmp_paste_this_too

The same, but with mermaid

flowchart LR

subgraph 0["src"]
subgraph 1["cache"]
2["cache.mjs"]
6["content-strategy.mjs"]
9["find-content-changes.mjs"]
A["helpers.mjs"]
O["metadata-strategy.mjs"]
S["options-compatible.mjs"]
end
subgraph F["graph-utl"]
G["match-facade.mjs"]
end
subgraph H["utl"]
I["bus.mjs"]
K["find-all-files.mjs"]
N["path-to-posix.mjs"]
end
subgraph T["extract"]
subgraph U["transpile"]
V["meta.mjs"]
W["try-import-available.mjs"]
end
end
10["meta.js"]
end
subgraph 3["fs"]
4["promises"]
end
subgraph 5["path"]
7["posix"]
end
8["util"]
B["crypto"]
subgraph C["node_modules"]
subgraph D["lodash"]
E["memoize.js"]
end
subgraph L["ignore"]
M["index.js"]
end
subgraph P["watskeburt"]
subgraph Q["dist"]
R["main.js"]
end
end
subgraph Y["semver"]
Z["index.js"]
end
end
J["events"]
X["module"]
2-->6
2-->O
2-->S
2-->V
2-->I
2-->4
2-->5
6-->9
6-->A
6-->7
6-->8
9-->A
9-->I
9-->K
9-->7
A-->G
A-->B
A-->3
A-->4
A-->E
A-->5
I-->J
K-->N
K-->3
K-->M
K-->5
N-->5
O-->A
O-->I
O-->8
O-->R
S-->8
V-->W
V-->10
W-->X
W-->7
W-->Z

style O fill:lime,color:black

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Documentation only change
  • Refactor (non-breaking change which fixes an issue without changing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • 📖

    • My change doesn't require a documentation update, or ...
    • it does and I have updated it
  • ⚖️

    • The contribution will be subject to The MIT license, and I'm OK with that.
    • The contribution is my own original work.
    • I am ok with the stuff in CONTRIBUTING.md.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR diff size of 5701 lines exceeds the maximum allowed for the inline comments feature.

Copy link

@codeclimate codeclimate bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR diff size of 5701 lines exceeds the maximum allowed for the inline comments feature.

@codeclimate
Copy link

codeclimate bot commented Oct 29, 2023

Code Climate has analyzed commit 06c1b85 and detected 0 issues on this pull request.

View more on Code Climate.

@sverweij sverweij merged commit 1ac6b2e into main Oct 29, 2023
7 checks passed
@sverweij sverweij deleted the feature/add-d2-reporter branch October 29, 2023 10:06
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.

None yet

1 participant