Releases: sverweij/dependency-cruiser
Releases · sverweij/dependency-cruiser
v1.6.1
- There's now a json schema for the (json) output - and there's automated tests in place to make sure dependency-cruiser keeps adhering to it.
- There's a json schema for the rules file format as well. In stead of silently ignoring unexpected content, dependency-cruiser will now stop with an error.
- The package published at npm lost some weight (~0.5Mb) because the .npmignore now contains more files that are not strictly necessary for using dependency-cruiser.
v1.6.0
Changes since v1.5.0:
- Support for typescript out of the box - no pre-processing/ transpilation necessary anymore (:boom:!)
- Other changes
- dot reporter:
- adds the violated rule in a tooltip
- adds a link to the source (for modules that could be resolved to files)
- err reporter:
- only exit with a non-zero exit code when there's at least one error (leaving warnings and informational message)
- small layout tweaks
- dot reporter:
v1.5.0
- support for new rules
- match a (to-) module against it being a
coreModule
or not - match a (to-) module against whether or not it could be resolved to an actual file on disk (
couldNotResolve
).
this makes it easy to weed out - negative matches against paths
- match a (to-) module against it being a
- changes in the validation format to enable more elaborate rules - see below for a list
- merged the --validate and --rules-file option: you can now just specify the (still optional) rule file with the --validate parameter
dependency-cruise -v my-dependency-rules.json -T err src
Changes to the validation config
note the utl/map-1-4-ruleset-to1-5.js
script takes a pre 1.5.0 ruleset and transforms it to a post 1.5.0 one:
node url/utl/map-1-4-ruleset-to1-5.js your-pre-1-5-0-ruleset.json
from
andto
are now objects so they can contain multiple properties to match against.- The properties for both
from
andto
:path
- a regular expression of a path to match againstpathNot
- match against all paths except the one matching this regular expression
-The properties useful only forto
:coreModule
- a boolean value indicating whether to match against node.js core modulescouldNotResolve
- a boolean value indicating whether to match against modules dependency cruiser could resolve them to something on disk (or a core module)
- The properties for both
level
renamed toseverity
- values for
severity
can now beerror
,warning
andinfo
v1.3.0
v1.2.3
- Adds the 'severity' of a violation into the html and csv reporter output
- html reporter:
- colors the cell according to the severity of the violation
- adds the violated rule into the title, so you can see it on hover
- csv reporter: when the cell is the intersection of a violation it'll contain the severity of that violation
- dot reporter:
- colors violating dependencies according to their severity (in stead of merely red)
- some layout tweaks to make output easier on the eye - see below for an 'after - before' comparison
after
before
v1.2.2
Changes since v1.1.0:
- Err reporter:
- make output better scannable (by adding spacing and coloring).
- Makes the violated rule + the severity of the violation visible (so it's easier to track what needs fixing)
- Nests nested packages in the dot reporter (in addition to just grouping them, which was already done in v1.1.0):
This command ...
bin/dependency-cruise -T dot -x "(node_modules|json$)" src | dot -T png > dependency-cruiser-cruised.png
v1.1.0
Changes since 1.0.4
- Dependency-cruiser now also runs on slightly older versions of nodejs (4 and up)
(tested, updated package.json - included a ci target for nodejs 4, 6 and latest) - The dot reporter now clusters modules to improve visual grepping - see below for a simple sample.
- Switched to github as main repository.
... which is what you get when you run this:
cd test/fixtures
dependency-cruise -T dot -r rules.sub-not-allowed.json -x "(node_modules|json$)" . | dot -T png > sample-dot-output.png
v1.0.4
'release' 1.0.1 - 1.0.4 are just documentation updates - pictures mostly (first I got them from gitlab - who apparently hadn't switched the project private -> public yet. Or I didn't switch enough switches for that. Secondly I got them from github, but made the classic mistake of not linking pictures to raw.githubusercontent but to github.com. Which works ask within github, but not outside of it. Like on npmjs.com. Or on gitlab.com :-/)
v1.0.0
Initial release
Features:
- Generates dependency information from any javascript code base:
- in html, dot, csv
- highlights for dependencies you have configured to be forbidden
- Configurable dependency validation (and a special bare bones reporter) to integrate into build systems.
- See Daphne's dependencies for a gentle introduction.
Pictures
Graphviz dot output
Build output
(only visible when there's something wrong wit your dependencies):
dependency-cruise -T err -v test/fixtures
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
make: *** [dependency-cruise] Error 3