Skip to content
/ glad Public
forked from amzn/glad

Generate Layer Architecture Diagram from your Javascript, Typescript, Flutter, Dart source

License

Notifications You must be signed in to change notification settings

jpdup/glad

 
 

Repository files navigation

GLAD - Generate Layer Architecture Diagram

Automatically generate layer diagram view of your Javascript/Typescript/Dart source code dependencies.

Motivation

View and Keep your project source files layer dependencies clean. Avoid circular reference or referencing an upper layer from a lower layer.

Project type supported

  • NodeJS - source files of type JS & TS, simply launch the glad and open the resulting glad.svg file.
  • NEW - Now supports Flutter/Dart package dependencies

Example

example

Technologies used

Standard - JavaScript Style Guide

Features

  • Optional grouping of layers by folders.
  • Rendering views as Posters, Layers, or Grid.
  • Render with or without edges (arrow lines).

Installation

Globally

npm install -g .

DevDependencies

npm install -D @amazon/glad

As 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

glad

CLI Help

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]
      --externals         Show external dependencies  [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."

License

This project is licensed under the Apache-2.0 License.

About

Generate Layer Architecture Diagram from your Javascript, Typescript, Flutter, Dart source

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%