Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/amzn/glad

Generate Layer Diagram from your Javascript/Typescript app
https://github.com/amzn/glad

architecture diagram generator graph javascript layers nodejs npm typescript validation

Last synced: about 2 months ago
JSON representation

Generate Layer Diagram from your Javascript/Typescript app

Awesome Lists containing this project

README

        

# GLAD - Generate Layer Architecture Diagram

Automatically generate **layer diagram** view of your Javascript/Typescript 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.

Supports source files of type JS & TS, simply launch the ```glad``` and open the resulting ```glad.svg``` file.

## Example

![example](glad.svg)

## Technologies used

[](https://nodejs.org/)
[](https://npmjs.org/)
[](https://en.wikipedia.org/wiki/JavaScript)
[](https://en.wikipedia.org/wiki/JSON)
[](https://ts-morph.com/)
[](https://en.wikipedia.org/wiki/Scalable_Vector_Graphics)
[](https://eslint.org/)
[Standard - JavaScript Style Guide](https://standardjs.com/)

## Features

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

## Installation

### Globally

```bash
npm install -g .
```

### DevDependencies

```bash
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.

```JSon
{
"scripts": {
"build": "glad ."
}
}
```

## Execute

```bash
glad
```

## CLI Help

```text
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."
```

## License

This project is licensed under the Apache-2.0 License.

[](https://www.apache.org/licenses/LICENSE-2.0)