Skip to content

Commit

Permalink
feat: copy dependency graph visualizer from SES-shim (#1650)
Browse files Browse the repository at this point in the history
  • Loading branch information
erights authored Aug 31, 2020
1 parent 517041d commit 94f1216
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,5 @@ bundle-*.js
.DS_Store
.vscode/
.idea/

/packages.png
22 changes: 22 additions & 0 deletions scripts/graph.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
# scripts/graph.sh generates packages.png, a visualization of the internal
# package dependency graph.
set -ueo pipefail
DIR=$(dirname -- "${BASH_SOURCE[0]}")
{
echo 'digraph {'
echo 'rankdir=LR'
cat "$DIR"/../packages/*/package.json | jq -r --slurp '
. as $all |
[.[] | {(.name): true}] | add as $locals |
$all[] |
.name as $from |
(.dependencies // {}) |
keys[] |
{$from, to: .} |
select($locals[.from] and $locals[.to]) |
"\"\(.from)\" -> \"\(.to)\""
'
echo '}'
} | dot -Tpng > "$DIR"/../packages.png

0 comments on commit 94f1216

Please sign in to comment.