Automatically generate layer diagram view of your Javascript/Typescript source code dependencies.
View and Keep your project source files layer dependencies clean. Avoid circular reference or referencing an upper layer from a lower layer.
Supports source files of type JS & TS, simply launch the glad
and open the resulting glad.svg
file.
- Optional grouping of layers by folders.
- Rendering views as Posters, Layers, or Grid.
- Render with or without edges (arrow lines).
npm install -g .
npm install -D @amazon/glad
By adding "glad" to your build step, you will be alerted if you introduce a circular dependencies.
{
"scripts": {
"build": "glad ."
}
}
glad
glad -h
Usage: glad < path > [options] "Generates an SVG layer diagram file based on your TS & JS source files dependencies"
Options:
-h, --help Show help [boolean]
-i, --input File path to scan [string]
-o, --output File path to output svg [string] [default: "./glad.svg"]
-e, --exclude File glob to exclude from the analysis, eg: "**/*.test.js" [string]
--view Type of diagram to generate [string] [choices: "poster", "layers", "grid"] [default: "poster"]
--align Set the horizontal position of the nodes [string] [choices: "left", "center", "right"] [default: "center"]
--edges Type of rendering for all edges [string] [choices: "files", "folders"] [default: "files"]
--lines Type of rendering for all edges [string] [choices: "curve", "strait", "elbow", "angle", "hide", "warnings"] [default: "curve"]
--lineEffect, --le Special effect on the lines [string] [default: "flat"]
-l, --layers Display the layers background and numbers [boolean] [default: false]
-d, --details Show additional values for each folders [boolean] [default: false]
--json Output the graph to file called glad.json [boolean] [default: false]
--debug For tech support [boolean] [default: false]
--listFiles List all input files found [boolean] [default: false]
-s, --silent No output except for errors [boolean] [default: false]
-v, --version Show version number [boolean]
Examples:
glad . --view layers -l --edges -hide ">>> Produce a diagram with no edges, each layers are numbered."
This project is licensed under the Apache-2.0 License.