@jpdup/glad
v1.4.1
Published
Generate a Layer Diagram view of your source layers
Maintainers
Readme
GLAD - Generate Layer Architecture Diagram
Automatically generate layer diagram view of your source code dependencies.
Supports JavaScript, TypeScript, Dart (Flutter), Swift, and DOT graph files.
Motivation
View and Keep your project source files layer dependencies clean. Avoid circular reference or referencing an upper layer from a lower layer.
Project types supported
- NodeJS - source files of type JS & TS
- Flutter/Dart - package dependencies
- Swift - iOS/macOS projects using Tree-Sitter parsing
- DOT - GraphViz DOT file input for custom diagrams
Simply launch the glad command and open the resulting glad.svg file.
Example
Technologies used
Features
- Optional grouping of layers by folders.
- Rendering views as Posters, Layers, or Grid.
- Render with or without edges connection lines.
- Orphan node detection - highlights files/folders with no dependencies.
Installation
Globally
npm install -g .DevDependencies
npm install -D @jpdup/gladAs part of your build script step
By adding "glad" to your build step, you will be alerted if you introduce a circular dependencies.
{
"scripts": {
"build": "glad ."
}
}Execute
gladCLI Help
glad -h
Usage: glad < path | file.dot > [options] "Generates an SVG layer diagram file based on your source code dependencies or DOT graph files"
Options:
-h, --help Show help [boolean]
--align Set the horizontal position of the nodes [string] [choices: "left", "center", "right"] [default: "center"]
--debug For tech support [boolean] [default: false]
-d, --details Show additional values for each folders [boolean] [default: false]
--dev Show Dev dependencies [boolean] [default: false]
--edges Type of rendering for all edges [string] [choices: "files", "folders"] [default: "files"]
-e, --exclude File glob patterns to exclude from the analysis, eg: "**/*.test.js" "**/AppLogger*" [array]
--externals, --ex Show external dependencies [boolean] [default: false]
-i, --input File path to scan [string]
--json Output the graph to file called glad.json [boolean] [default: false]
-l, --layers Display the layers background and numbers [boolean] [default: false]
--lineEffect, --le Special effect on the lines [string] [default: "flat"]
--lines Type of rendering for all edges [string] [choices: "curve", "strait", "elbow", "angle", "hide", "warnings"] [default: "curve"]
--listFiles List all input files found [boolean] [default: false]
--orphans List all orphan nodes (nodes with no edges) [boolean] [default: false]
-o, --output File path to output svg [string] [default: "./glad.svg"]
-s, --silent No output except for errors [boolean] [default: false]
--view Type of diagram to generate [string] [choices: "poster", "layers", "grid"] [default: "poster"]
-v, --version Show version number [boolean]
Examples:
glad . --view layers -l --edges -hide ">>> Produce a diagram with no edges, each layers are numbered."
glad myGraph.dot --view layers -l ">>> Generate layers diagram from DOT graph file."
for more information visit https://github.com/amzn/generate-layer-architecture-diagramLicense
This project is licensed under the Apache-2.0 License.
