Skip to content

Commit

Permalink
📖 adds some documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
sverweij committed Nov 20, 2016
1 parent 101f64f commit 0050dac
Show file tree
Hide file tree
Showing 13 changed files with 650 additions and 21 deletions.
48 changes: 27 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
# dependency cruiser
Visualize and javascript dependencies against your own rules. ES6, CommonJS, AMD.
# Dependency cruiser ![Dependency cruiser](doc/assets/ZKH-Dependency-recolored-160.png)
_Visualize and validate javascript dependencies. With your rules._ ES6, CommonJS, AMD.

![Snazzy dot output to whet your appetite](doc/assets/sample-dot-output.png)

## Installation
Dependency cruiser works most comfortably if you install it globally

```
npm install --global dependency-cruiser
```

## Daphne's dependencies - a gentle introduction
Head over to **[Daphne's dependencies](doc/sample-output.md)** to get an
overview of all the output formats. And how Daphne uses it all. And how she
uses the awesome _validation_ in her workflow. Go on. Read it. Or would you
rather prefer continue the boring recount of a README written with _reference
doc_ in mind?

## Basic usage
To dump all the dependencies in `src` to into a dependency matrix you can
open in your browser:

```shell
dependency-cruise -T html -f deps.html src
```

Running with no parameters gets you help:
```
Usage: dependency-cruise [options] <directory-or-file>
Expand All @@ -16,20 +41,6 @@ Options:
-r, --rules-file <file> read rules from <file> (default: .dependency-cruiser.json)
```

## Installation
Dependency cruiser works most comfortably if you install it globally

```
npm install --global dependency-cruiser
```

## Basic usage
To dump all the dependencies in `src` to stdout in json format:

```shell
dependency-cruise src
```

## Output formats
### html
Write it to html with a dependency matrix instead:
Expand All @@ -46,9 +57,6 @@ and analyze from there.
Supplying `dot` as output type will make dependency-cruiser write
a GraphViz dot format directed graph.

### json
The default.

### err
For use in build scripts, in combination with `--validate` and/ or
`--rules-file` e.g.
Expand Down Expand Up @@ -131,13 +139,11 @@ A more elaborate configuration:
}
```


### --rules-file implies --validate
Because if you supply a rules file, you probably intend them to
be used in validation, dependency-cruiser assumes `--validate`
to be passed even if it wasn't.


## License
[MIT](LICENSE)

Expand Down
Binary file added doc/assets/ZKH-Dependency-recolored-160.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/assets/ZKH-Dependency-recolored-320.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
86 changes: 86 additions & 0 deletions doc/assets/ZKH-Dependency-recolored-320.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions doc/assets/sample-csv-output.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"","test/fixtures/cjs/one_only_one.js","test/fixtures/cjs/one_only_two.js","test/fixtures/cjs/root_one.js","test/fixtures/cjs/root_two.js","test/fixtures/cjs/shared.js","test/fixtures/cjs/sub/depindir.js","test/fixtures/cjs/sub/dir.js","test/fixtures/cjs/two_only_one.js",""
"test/fixtures/cjs/one_only_one.js","false","false","false","false","false","false","false","false",""
"test/fixtures/cjs/one_only_two.js","false","false","false","false","false","false","false","false",""
"test/fixtures/cjs/root_one.js","true","true","false","false","true","false","violation","false",""
"test/fixtures/cjs/root_two.js","false","false","false","false","true","false","false","true",""
"test/fixtures/cjs/shared.js","false","false","false","false","false","false","false","false",""
"test/fixtures/cjs/sub/depindir.js","false","false","false","false","false","false","false","false",""
"test/fixtures/cjs/sub/dir.js","false","false","false","false","false","violation","false","false",""
"test/fixtures/cjs/two_only_one.js","false","false","false","false","false","false","violation","false",""
Binary file added doc/assets/sample-csv-output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/assets/sample-dot-output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions doc/assets/sample-err-output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Dependency-cruiser found the following illegal dependencies:
test/fixtures/cjs/root_one.js => test/fixtures/cjs/sub/dir.js
test/fixtures/cjs/sub/dir.js => test/fixtures/cjs/sub/depindir.js
test/fixtures/cjs/two_only_one.js => test/fixtures/cjs/sub/dir.js
Loading

0 comments on commit 0050dac

Please sign in to comment.