dependency-cruiser 16.3.6 → 16.3.9
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": "16.3.
|
|
3
|
+
"version": "16.3.9",
|
|
4
4
|
"description": "Validate and visualize dependencies. With your rules. JavaScript, TypeScript, CoffeeScript. ES6, CommonJS, AMD.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"static analysis",
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
"acorn-jsx-walk": "2.0.0",
|
|
144
144
|
"acorn-loose": "8.4.0",
|
|
145
145
|
"acorn-walk": "8.3.3",
|
|
146
|
-
"ajv": "8.
|
|
146
|
+
"ajv": "8.17.1",
|
|
147
147
|
"commander": "12.1.0",
|
|
148
148
|
"enhanced-resolve": "5.17.0",
|
|
149
149
|
"ignore": "5.3.1",
|
|
@@ -157,18 +157,17 @@
|
|
|
157
157
|
"prompts": "2.4.2",
|
|
158
158
|
"rechoir": "^0.8.0",
|
|
159
159
|
"safe-regex": "2.1.1",
|
|
160
|
-
"semver": "^7.6.
|
|
160
|
+
"semver": "^7.6.3",
|
|
161
161
|
"teamcity-service-messages": "0.1.14",
|
|
162
162
|
"tsconfig-paths-webpack-plugin": "4.1.0",
|
|
163
|
-
"watskeburt": "4.1.0"
|
|
164
|
-
"wrap-ansi": "9.0.0"
|
|
163
|
+
"watskeburt": "4.1.0"
|
|
165
164
|
},
|
|
166
165
|
"overrides": {
|
|
167
|
-
"semver": "^7.6.
|
|
166
|
+
"semver": "^7.6.3",
|
|
168
167
|
"postcss": "^8.4.31"
|
|
169
168
|
},
|
|
170
169
|
"resolutions": {
|
|
171
|
-
"semver": "^7.6.
|
|
170
|
+
"semver": "^7.6.3",
|
|
172
171
|
"postcss": "^8.4.31"
|
|
173
172
|
},
|
|
174
173
|
"engines": {
|
|
@@ -11,7 +11,7 @@ import { isScoped, isRelativeModuleName } from "./module-classifiers.mjs";
|
|
|
11
11
|
*
|
|
12
12
|
* Some samples:
|
|
13
13
|
* - for unscoped packages this would be everything up to the first '/':
|
|
14
|
-
* - '
|
|
14
|
+
* - 'godash/fp' => 'godash'
|
|
15
15
|
* - 'mypackage/some/module' => 'mypackage'
|
|
16
16
|
* - for scoped packages this would be everything up to the second '/',
|
|
17
17
|
* if it's there (which should normaly be the case, but nevertheless we
|
|
@@ -49,8 +49,8 @@ export function getPackageRoot(pModule) {
|
|
|
49
49
|
return `${lPathElements[0]}/${lPathElements[1]}`;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
//
|
|
53
|
-
//
|
|
52
|
+
// godash
|
|
53
|
+
// godash/fp
|
|
54
54
|
return lPathElements[0];
|
|
55
55
|
}
|
|
56
56
|
|
package/src/meta.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* generated - don't edit */
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
|
-
version: "16.3.
|
|
4
|
+
version: "16.3.9",
|
|
5
5
|
engines: {
|
|
6
6
|
node: "^18.17||>=20",
|
|
7
7
|
},
|
|
@@ -10,7 +10,7 @@ module.exports = {
|
|
|
10
10
|
"coffee-script": ">=1.0.0 <2.0.0",
|
|
11
11
|
coffeescript: ">=1.0.0 <3.0.0",
|
|
12
12
|
livescript: ">=1.0.0 <2.0.0",
|
|
13
|
-
svelte: ">=3.0.0 <
|
|
13
|
+
svelte: ">=3.0.0 <5.0.0",
|
|
14
14
|
swc: ">=1.0.0 <2.0.0",
|
|
15
15
|
typescript: ">=2.0.0 <6.0.0",
|
|
16
16
|
"vue-template-compiler": ">=2.0.0 <3.0.0",
|
package/src/report/error.mjs
CHANGED
|
@@ -44,11 +44,11 @@ function formatReachabilityViolation(pViolation) {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
function formatInstabilityViolation(pViolation) {
|
|
47
|
-
return `${formatDependencyViolation(pViolation)}${EOL}${
|
|
48
|
-
|
|
47
|
+
return `${formatDependencyViolation(pViolation)}${EOL}${pc.dim(
|
|
48
|
+
wrapAndIndent(
|
|
49
49
|
`instability: ${formatPercentage(pViolation.metrics.from.instability)} → ${formatPercentage(pViolation.metrics.to.instability)}`,
|
|
50
|
+
EXTRA_PATH_INFORMATION_INDENT,
|
|
50
51
|
),
|
|
51
|
-
EXTRA_PATH_INFORMATION_INDENT,
|
|
52
52
|
)}`;
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -72,7 +72,7 @@ function formatViolation(pViolation) {
|
|
|
72
72
|
)} ${pViolation.rule.name}: ${lFormattedViolators}` +
|
|
73
73
|
`${
|
|
74
74
|
pViolation.comment
|
|
75
|
-
? `${EOL}${
|
|
75
|
+
? `${EOL}${pc.dim(wrapAndIndent(pViolation.comment))}${EOL}`
|
|
76
76
|
: ""
|
|
77
77
|
}`
|
|
78
78
|
);
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import wrapAnsi from "wrap-ansi";
|
|
2
|
-
|
|
3
1
|
const DEFAULT_INDENT = 4;
|
|
4
2
|
|
|
5
3
|
function indentString(pString, pCount) {
|
|
@@ -8,9 +6,51 @@ function indentString(pString, pCount) {
|
|
|
8
6
|
return pString.replace(lRegex, " ".repeat(pCount));
|
|
9
7
|
}
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
/**
|
|
10
|
+
* @param {string} pLine
|
|
11
|
+
* @param {number} pMaxWidth
|
|
12
|
+
*/
|
|
13
|
+
function splitLine(pLine, pMaxWidth) {
|
|
14
|
+
const lWords = pLine.split(" ");
|
|
15
|
+
const lWrappedLines = [];
|
|
16
|
+
let lCurrentLine = "";
|
|
17
|
+
let lCurrentWidth = 0;
|
|
18
|
+
|
|
19
|
+
for (const lWord of lWords) {
|
|
20
|
+
if (lCurrentWidth + lWord.length > pMaxWidth) {
|
|
21
|
+
lWrappedLines.push(lCurrentLine.trimEnd());
|
|
22
|
+
lCurrentLine = "";
|
|
23
|
+
lCurrentWidth = 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (lCurrentLine) {
|
|
27
|
+
lCurrentLine += " ";
|
|
28
|
+
lCurrentWidth += 1;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
lCurrentLine += lWord;
|
|
32
|
+
lCurrentWidth += lWord.length;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
lWrappedLines.push(lCurrentLine.trimEnd());
|
|
36
|
+
|
|
37
|
+
return lWrappedLines.join("\n");
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @param {string} pString - the string to wrap
|
|
42
|
+
* @param {number} pMaxWidth - the maximum width of the wrapped string
|
|
43
|
+
*/
|
|
44
|
+
function wrapString(pString, pMaxWidth) {
|
|
45
|
+
return pString
|
|
46
|
+
.split(/\r?\n/)
|
|
47
|
+
.map((pLine) => splitLine(pLine, pMaxWidth))
|
|
48
|
+
.join("\n");
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export default function wrapAndIndent(pString, pIndent = DEFAULT_INDENT) {
|
|
52
|
+
const lMaxConsoleWidth = 78;
|
|
53
|
+
const lMaxWidth = lMaxConsoleWidth - pIndent;
|
|
14
54
|
|
|
15
|
-
return indentString(
|
|
55
|
+
return indentString(wrapString(pString, lMaxWidth), pIndent);
|
|
16
56
|
}
|