dependency-cruiser
Advanced tools
Comparing version 1.10.0 to 1.10.1
{ | ||
"name": "dependency-cruiser", | ||
"version": "1.10.0", | ||
"version": "1.10.1", | ||
"description": "Validate and visualize dependencies. With your rules. JavaScript, TypeScript, CoffeeScript. ES6, CommonJS, AMD.", | ||
@@ -5,0 +5,0 @@ "bin": { |
@@ -10,6 +10,6 @@ # Dependency cruiser ![Dependency cruiser](https://raw.githubusercontent.com/sverweij/dependency-cruiser/master/doc/assets/ZKH-Dependency-recolored-160.png) | ||
- ... **report** violated rules | ||
- in text (for in your builds) | ||
- in graphics (for on your eyeballs) | ||
- in text (for your builds) | ||
- in graphics (for your eyeballs) | ||
As a side effect it can generate [**cool dependency graphs**](https://github.com/sverweij/dependency-cruiser/blob/master/doc/real-world-samples.md) | ||
As a side effect it can generate [**cool dependency graphs**](./doc/real-world-samples.md) | ||
you can stick on the wall to impress your grandma. | ||
@@ -32,3 +32,3 @@ | ||
```shell | ||
dependency-cruise --exclude "^node_modules" --output-type dot src | dot -T svg > dependencygraph.svg | ||
depcruise --exclude "^node_modules" --output-type dot src | dot -T svg > dependencygraph.svg | ||
``` | ||
@@ -41,5 +41,5 @@ | ||
options in the | ||
[command line interface](https://github.com/sverweij/dependency-cruiser/blob/master/doc/cli.md) | ||
[command line interface](./doc/cli.md) | ||
documentation. | ||
- _[Real world samples](https://github.com/sverweij/dependency-cruiser/blob/master/doc/real-world-samples.md)_ | ||
- _[Real world samples](./doc/real-world-samples.md)_ | ||
contains dependency cruises of some of the most used projects on npm. | ||
@@ -65,6 +65,6 @@ | ||
- To read more about writing rules check the | ||
[writing rules](https://github.com/sverweij/dependency-cruiser/blob/master/doc/rules.md) | ||
[writing rules](./doc/rules.md) | ||
section. | ||
- There is practical rules configuration to get you started | ||
[here](https://github.com/sverweij/dependency-cruiser/blob/master/doc/rules.starter.json) | ||
[here](./doc/rules.starter.json) | ||
@@ -84,3 +84,3 @@ #### Report them | ||
```sh | ||
dependency-cruise --validate my-rules.json --output-type err src | ||
depcruise --validate my-rules.json --output-type err src | ||
``` | ||
@@ -90,3 +90,3 @@ ![sample err output](https://raw.githubusercontent.com/sverweij/dependency-cruiser/master/doc/assets/sample-err-output.png) | ||
- Read more about the err, dot, but also the csv and html reporters in the | ||
[command line interface](https://github.com/sverweij/dependency-cruiser/blob/master/doc/cli.md) | ||
[command line interface](./doc/cli.md) | ||
documentation. | ||
@@ -100,5 +100,5 @@ - dependency-cruiser uses itself to check on itself in its own build process; | ||
- [Command line reference](https://github.com/sverweij/dependency-cruiser/blob/master/doc/cli.md) | ||
- [Writing rules](https://github.com/sverweij/dependency-cruiser/blob/master/doc/rules.md) | ||
- [Real world show cases](https://github.com/sverweij/dependency-cruiser/blob/master/doc/real-world-samples.md) | ||
- [Command line reference](./doc/cli.md) | ||
- [Writing rules](./doc/rules.md) | ||
- [Real world show cases](./doc/real-world-samples.md) | ||
- [Output format](./doc/output-format.md) | ||
@@ -123,2 +123,2 @@ - [API](./doc/api.md) | ||
[![npm stable version](https://img.shields.io/npm/v/dependency-cruiser.svg)](https://npmjs.com/package/dependency-cruiser) | ||
[![total downloads on npm](https://img.shields.io/npm/dt/dependency-cruiser.svg?maxAge=2592000)](https://npmjs.com/package/dependency-cruiser) | ||
[![total downloads on npm](https://img.shields.io/npm/dt/dependency-cruiser.svg?maxAge=2591999)](https://npmjs.com/package/dependency-cruiser) |
@@ -14,22 +14,19 @@ "use strict"; | ||
let lRetval = []; | ||
const lDependencies = extract(pFileName, pOptions); | ||
lRetval.push({ | ||
source: pFileName, | ||
dependencies: lDependencies | ||
}); | ||
lDependencies | ||
return lDependencies | ||
.filter(pDep => pDep.followable) | ||
.forEach( | ||
pDep => { | ||
.reduce( | ||
(pAll, pDep) => { | ||
if (!pVisited.has(pDep.resolved)){ | ||
lRetval = lRetval.concat( | ||
return pAll.concat( | ||
extractRecursive(pDep.resolved, pOptions, pVisited) | ||
); | ||
} | ||
} | ||
return pAll; | ||
}, [{ | ||
source: pFileName, | ||
dependencies: lDependencies | ||
}] | ||
); | ||
return lRetval; | ||
} | ||
@@ -36,0 +33,0 @@ |
@@ -10,3 +10,3 @@ { | ||
"type": "object", | ||
"required": ["violations", "error", "warn", "info", "optionsUsed"], | ||
"required": ["violations", "error", "warn", "info", "totalCruised", "optionsUsed"], | ||
"additionalProperties": false, | ||
@@ -32,2 +32,6 @@ "description": "Data summarizing the found dependencies", | ||
}, | ||
"totalCruised": { | ||
"type": "number", | ||
"description": "the number of modules cruised" | ||
}, | ||
"optionsUsed": { "$ref": "#/definitions/OptionsType" } | ||
@@ -34,0 +38,0 @@ } |
@@ -52,4 +52,7 @@ "use strict"; | ||
}, | ||
extractMetaData(lViolations) | ||
extractMetaData(lViolations), | ||
{ | ||
totalCruised: pDependencies.length | ||
} | ||
); | ||
}; |
@@ -26,3 +26,4 @@ "use strict"; | ||
function formatSummary(pMeta) { | ||
let lMessage = `\n${figures.cross} ${sumMeta(pMeta)} dependency violations (${formatMeta(pMeta)}) \n\n`; | ||
let lMessage = | ||
`\n${figures.cross} ${sumMeta(pMeta)} dependency violations (${formatMeta(pMeta)}). ${pMeta.totalCruised} modules cruised.\n\n`; | ||
@@ -38,3 +39,4 @@ return pMeta.error > 0 ? chalk.red(lMessage) : lMessage; | ||
{ | ||
dependencies: `\n${chalk.green(figures.tick)} no dependency violations found \n\n` | ||
dependencies: | ||
`\n${chalk.green(figures.tick)} no dependency violations found (${pInput.summary.totalCruised} modules cruised)\n\n` | ||
} | ||
@@ -58,1 +60,3 @@ ); | ||
}; | ||
/* eslint max-len: 0 */ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1886
431642