dependency-cruiser 10.3.0-beta-6 → 10.3.1-beta-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dependency-cruiser",
|
|
3
|
-
"version": "10.3.
|
|
3
|
+
"version": "10.3.1-beta-1",
|
|
4
4
|
"description": "Validate and visualize dependencies. With your rules. JavaScript, TypeScript, CoffeeScript. ES6, CommonJS, AMD.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"static analysis",
|
|
@@ -131,21 +131,21 @@
|
|
|
131
131
|
"version": "npm-run-all build depcruise:graph:doc scm:stage"
|
|
132
132
|
},
|
|
133
133
|
"dependencies": {
|
|
134
|
-
"acorn": "8.
|
|
134
|
+
"acorn": "8.5.0",
|
|
135
135
|
"acorn-jsx": "5.3.2",
|
|
136
136
|
"acorn-jsx-walk": "2.0.0",
|
|
137
|
-
"acorn-loose": "8.1
|
|
138
|
-
"acorn-walk": "8.
|
|
139
|
-
"ajv": "8.6.
|
|
137
|
+
"acorn-loose": "8.2.1",
|
|
138
|
+
"acorn-walk": "8.2.0",
|
|
139
|
+
"ajv": "8.6.3",
|
|
140
140
|
"chalk": "4.1.2",
|
|
141
|
-
"commander": "8.
|
|
141
|
+
"commander": "8.2.0",
|
|
142
142
|
"enhanced-resolve": "5.8.2",
|
|
143
143
|
"figures": "^3.2.0",
|
|
144
144
|
"get-stream": "^6.0.1",
|
|
145
145
|
"glob": "7.1.7",
|
|
146
146
|
"handlebars": "4.7.7",
|
|
147
147
|
"indent-string": "^4.0.0",
|
|
148
|
-
"inquirer": "8.1.
|
|
148
|
+
"inquirer": "8.1.5",
|
|
149
149
|
"json5": "2.2.0",
|
|
150
150
|
"lodash": "4.17.21",
|
|
151
151
|
"safe-regex": "2.1.1",
|
|
@@ -156,13 +156,13 @@
|
|
|
156
156
|
"wrap-ansi": "^7.0.0"
|
|
157
157
|
},
|
|
158
158
|
"devDependencies": {
|
|
159
|
-
"@babel/core": "7.15.
|
|
160
|
-
"@babel/plugin-transform-modules-commonjs": "7.15.
|
|
159
|
+
"@babel/core": "7.15.5",
|
|
160
|
+
"@babel/plugin-transform-modules-commonjs": "7.15.4",
|
|
161
161
|
"@babel/preset-typescript": "7.15.0",
|
|
162
|
-
"@swc/core": "1.2.
|
|
163
|
-
"@typescript-eslint/eslint-plugin": "4.
|
|
164
|
-
"@typescript-eslint/parser": "4.
|
|
165
|
-
"c8": "7.
|
|
162
|
+
"@swc/core": "1.2.88",
|
|
163
|
+
"@typescript-eslint/eslint-plugin": "4.31.1",
|
|
164
|
+
"@typescript-eslint/parser": "4.31.1",
|
|
165
|
+
"c8": "7.9.0",
|
|
166
166
|
"chai": "4.3.4",
|
|
167
167
|
"chai-json-schema": "1.5.1",
|
|
168
168
|
"coffeescript": "2.5.1",
|
|
@@ -174,18 +174,18 @@
|
|
|
174
174
|
"eslint-plugin-mocha": "9.0.0",
|
|
175
175
|
"eslint-plugin-node": "11.1.0",
|
|
176
176
|
"eslint-plugin-security": "1.4.0",
|
|
177
|
-
"eslint-plugin-unicorn": "
|
|
177
|
+
"eslint-plugin-unicorn": "36.0.0",
|
|
178
178
|
"husky": "^4.3.8",
|
|
179
179
|
"intercept-stdout": "0.1.2",
|
|
180
180
|
"lint-staged": "11.1.2",
|
|
181
181
|
"mocha": "9.1.1",
|
|
182
182
|
"normalize-newline": "4.1.0",
|
|
183
183
|
"npm-run-all": "4.1.5",
|
|
184
|
-
"prettier": "2.
|
|
184
|
+
"prettier": "2.4.1",
|
|
185
185
|
"shx": "0.3.3",
|
|
186
|
-
"svelte": "3.42.
|
|
186
|
+
"svelte": "3.42.6",
|
|
187
187
|
"symlink-dir": "5.0.1",
|
|
188
|
-
"typescript": "4.4.
|
|
188
|
+
"typescript": "4.4.3",
|
|
189
189
|
"upem": "^7.0.0",
|
|
190
190
|
"vue-template-compiler": "2.6.14",
|
|
191
191
|
"yarn": "1.22.11"
|
|
@@ -19,6 +19,25 @@ function softenModuleViolation(
|
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
function knownErrorMatchesViolation(pKnownError, pViolationKey) {
|
|
23
|
+
if (pKnownError.rule.name === pViolationKey.rule.name) {
|
|
24
|
+
if (pViolationKey.cycle && pKnownError.cycle) {
|
|
25
|
+
return (
|
|
26
|
+
pKnownError.cycle.length === pViolationKey.cycle.length &&
|
|
27
|
+
pKnownError.cycle.every((pModule) =>
|
|
28
|
+
pViolationKey.cycle.includes(pModule)
|
|
29
|
+
)
|
|
30
|
+
);
|
|
31
|
+
} else {
|
|
32
|
+
return (
|
|
33
|
+
pKnownError.from === pViolationKey.from &&
|
|
34
|
+
pKnownError.to === pViolationKey.to
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
|
|
22
41
|
function softenDependencyViolation(
|
|
23
42
|
pViolationKey,
|
|
24
43
|
pKnownDependencyViolations,
|
|
@@ -26,11 +45,8 @@ function softenDependencyViolation(
|
|
|
26
45
|
) {
|
|
27
46
|
return {
|
|
28
47
|
...pViolationKey.rule,
|
|
29
|
-
severity: pKnownDependencyViolations.some(
|
|
30
|
-
(pKnownError)
|
|
31
|
-
pKnownError.from === pViolationKey.from &&
|
|
32
|
-
pKnownError.to === pViolationKey.to &&
|
|
33
|
-
pKnownError.rule.name === pViolationKey.rule.name
|
|
48
|
+
severity: pKnownDependencyViolations.some((pKnownError) =>
|
|
49
|
+
knownErrorMatchesViolation(pKnownError, pViolationKey)
|
|
34
50
|
)
|
|
35
51
|
? pSoftenedSeverity
|
|
36
52
|
: pViolationKey.rule.severity,
|
|
@@ -48,7 +64,12 @@ function softenDependencyViolations(
|
|
|
48
64
|
...pDependency,
|
|
49
65
|
rules: pDependency.rules.map((pRule) =>
|
|
50
66
|
softenDependencyViolation(
|
|
51
|
-
{
|
|
67
|
+
{
|
|
68
|
+
rule: pRule,
|
|
69
|
+
from: pModuleSource,
|
|
70
|
+
to: pDependency.resolved,
|
|
71
|
+
cycle: pDependency.cycle,
|
|
72
|
+
},
|
|
52
73
|
pKnownDependencyViolations,
|
|
53
74
|
pSoftenedSeverity
|
|
54
75
|
)
|
|
@@ -129,10 +129,10 @@ function extractModuleViolations(pModules, pRuleSet) {
|
|
|
129
129
|
|
|
130
130
|
module.exports = function summarizeModules(pModules, pRuleSet) {
|
|
131
131
|
const lViolations = deDuplicateViolations(
|
|
132
|
-
extractDependencyViolations(pModules, pRuleSet)
|
|
133
|
-
extractModuleViolations(pModules, pRuleSet)
|
|
134
|
-
|
|
135
|
-
)
|
|
132
|
+
extractDependencyViolations(pModules, pRuleSet)
|
|
133
|
+
.concat(extractModuleViolations(pModules, pRuleSet))
|
|
134
|
+
.sort(compare.violations)
|
|
135
|
+
);
|
|
136
136
|
|
|
137
137
|
return {
|
|
138
138
|
violations: lViolations,
|