Validate and visualize dependencies. Your rules. JavaScript, TypeScript, CoffeeScript. ES6, CommonJS, AMD.
MIT License
Bot releases are hidden (Show)
impact classification:
From this version dependency-cruiser pre-processes *.vue with the vue-template-compiler before passing it to the javascript parser. This will give a more reliable view on the dependencies of Vue Single File Components (SFC's):
<script>
section - and it ignores other ones. With this it can more reliably identify dependencies defined in there. Dependencies not showing up before might appear after the merge of this PR.<style>
section anymore, which might have yielded dependencies because of include
syntax of some stylesheet languages is close to es6's.There are codebases where modules aren't imported by regular means like es6 import
or commonjs require
. With this feature dependency-cruiser can detect the lion's share of these - just add them in the dependency-cruiser config in exoticRequireStrings
and Bob's your uncle.
If you want to restrict the use of these alternative/ exotic requires, you can do so with the new exoticRequire
and exoticRequireNot
conditions.
Thanks @tvolodimir for requesting this feature (in #206)
Published by sverweij about 5 years ago
Also some maintenance work:
Published by sverweij about 5 years ago
Functionality:
BREAKING
build(npm): only support node versions supported by Node.js (#175)BREAKING
refactor(report): remove the 'rcdot' alias for the dot reporter (#176)Developer experience:
BREAKING; internal API only
refactor(report): make reporters determine the exit code (#177)impact classification: low (unless you're still on a node version not supported by Node.js)
This change limits the support of node versions to ^8.10, ^10 and ^12, dropping
support for node versions ^6, ^7, ^9, ^11 and early versions of node 8.
If you still are on one of these versions, you have two options:
rcdot
alias for the dot
output type removedimpact classification: very low
The rcdot
alias for the dot
output type doesn't exist anymore.
It was already deprecated in an earlier minor version of the v4 range,
and wasn't listed as output type since.
If you were still using the rcdot
alias as an --output-type
(-T
) change it
to dot
itself.
depcruise --validate --output-type rcdot src | dot -T svg > dependency-graph.svg
depcruise --validate --output-type dot src | dot -T svg > dependency-graph.svg
impact classification: no impact for users of the cli, low for apps consuming the (internal) API
Where the cruise
function previously returned a cruise result, with the
reporter hacked into the modules
, it now returns an object with two attributes,
with the following interface:
export interface IReporterOutput {
/**
* The output proper of the reporter. For most reporters this will be
* a string, if no reporter was passed this will be the cruise output
* as a javascript object
*/
output: any;
/**
* The exit code - reporters can return a non-zero value when they find
* errors here. api consumers (like a cli) can use this to return a
* non-zero exit code, so the build breaks when something is wrong
*
* This is e.g. the default behavior of the `err` and `err-long` reporters.
*/
exitCode: number;
}
// if you wanted the dependency tree and/ or the cruise summary
// you did this:
const results = cruise(["src"])
// if you wanted the output of a reporter, you did this:
const resultsInADotProgram = cruise(["src"], {outputType: "dot"}).modules
// if you want the dependency tree and/ or the cruise summary
// you do this:
const results = cruise(["src").output
// if you want the output of a reporter, you do this:
const resultsInADotProgram = cruise(["src"], {outputType: "dot"}).output
A patch release to update dependencies - bumps up to stay secure, down to remain compatible with node 6 for those that might be using it still.
4.27 is definitely the last minor release in the 4 series; 4.27.3 might be the last one of the patch releases. Use it if you absolutely need to have dependency-cruiser run on node 6. If you haven't done that yet: upgrade to node >= 8.10 so you can use dependency-cruiser@^5.0.0, which is upcoming.
This is probably the last version with support for node 6 and 7, as many of the external modules dependency-cruiser depends upon don't support node 6 and 7.