below is the dependency graph of the Nushell project
💡 Note
command to generate this, with thegraphviz
packagedot -T png -o nushell.png nushell.dot
i've used the script below and then tweaked the style and rank of the nodes manually 😋
let nushell = (http get https://raw.githubusercontent.com/nushell/nushell/main/Cargo.toml)
let graph = (
$nushell.dependencies | transpose name data | each {|dependency|
print -n $"(ansi erase_line)($dependency.name)\r"
let url = if ($dependency.name in ["reedline" "nu-ansi-term"]) {
$"https://raw.githubusercontent.com/nushell/($dependency.name)/main/Cargo.toml"
} else if ($dependency.name | str starts-with "nu-") {
$"https://raw.githubusercontent.com/nushell/nushell/main/crates/($dependency.name)/Cargo.toml"
}
if $url != null {
let dependencies = (
http get $url
| get dependencies
| transpose name data
| where {|it| $it.name | str starts-with "nu-"}
| get name
)
if not ($dependencies | is-empty) {
[
$' "($dependency.name)" -> {'
($dependencies | each { $' "($in)"' } | str join "\n")
$" }"
] | str join "\n"
}
}
}
)
$"digraph nushell {
($graph | str join "\n\n")
}" | save --force nushell.dot