-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: copy dependency graph visualizer from SES-shim (#1650)
- Loading branch information
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,3 +59,5 @@ bundle-*.js | |
.DS_Store | ||
.vscode/ | ||
.idea/ | ||
|
||
/packages.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |