Share a dependency-cruiser report
Architecture rules fail quietly. Someone adds an import from the domain
layer to the HTTP layer, the rule fires in CI, the build goes red, and
the fastest path to green is to add an exception to
.dependency-cruiser.js. Nobody argues, because there is nowhere to
argue: the violation is a line in a log.
The graph is the argument. Put it somewhere people can point at it.
Publish it
npx depcruise src \
--output-type err-html --output-to depcruise.html || true
curl -fsS -X PATCH \
"https://commareports.com/api/v1/reports/$COMMA_REPORT_ID" \
-H "Authorization: Bearer $COMMA_API_TOKEN" \
-H "Content-Type: application/json" \
-d "$(jq -n --rawfile html depcruise.html \
--arg title "Module graph — $REPO — $(date +%F)" \
'{title: $title, html: $html}')"
For the visual version, render the graph to SVG and publish that instead:
npx depcruise src --include-only "^src" --output-type dot \
| dot -T svg > graph.svg
Wrap the SVG in a minimal HTML page and publish. It stays vector at the link — zoomable, selectable, and readable on a laptop — unlike the PNG screenshot of a graph that usually gets pasted into a design doc.