#!/usr/bin/env bash # Regenerate the architecture dependency graph (WP-38) as a mermaid diagram embedded in a # markdown file, so it renders on the git host and can be linked from the docs. Contexts × # atomic layers; edges are real imports. Boundaries are enforced separately by `npm run # dep:check`. Run this after a structural change; commit the result. set -euo pipefail cd "$(dirname "$0")/.." OUT=docs/reference/architecture/dependency-graph.md { echo "# Dependency graph" echo echo "_Generated by \`npm run dep:graph\` — do not edit by hand._ Nodes are context × atomic" echo "layer (\`src/app//\`); edges are real imports. The allowed edges are" echo "enforced by \`npm run dep:check\` (dependency-cruiser); see [dependencies.md](./dependencies.md)." echo echo '```mermaid' npx depcruise src/app \ --config .dependency-cruiser.js \ --include-only "^src/app/" \ --collapse "^src/app/[^/]+/[^/]+" \ --output-type mermaid echo '```' } >"$OUT" echo "wrote $OUT"