dependency-cruiser 12.0.0 → 12.1.0
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": "12.
|
|
3
|
+
"version": "12.1.0",
|
|
4
4
|
"description": "Validate and visualize dependencies. With your rules. JavaScript, TypeScript, CoffeeScript. ES6, CommonJS, AMD.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"static analysis",
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
"ajv": "8.11.2",
|
|
149
149
|
"chalk": "^4.1.2",
|
|
150
150
|
"commander": "9.4.1",
|
|
151
|
-
"enhanced-resolve": "5.
|
|
151
|
+
"enhanced-resolve": "5.12.0",
|
|
152
152
|
"figures": "^3.2.0",
|
|
153
153
|
"get-stream": "^6.0.1",
|
|
154
154
|
"glob": "7.2.0",
|
|
@@ -162,28 +162,28 @@
|
|
|
162
162
|
"rechoir": "^0.8.0",
|
|
163
163
|
"safe-regex": "2.1.1",
|
|
164
164
|
"semver": "^7.3.7",
|
|
165
|
-
"semver-try-require": "
|
|
165
|
+
"semver-try-require": "6.0.0",
|
|
166
166
|
"teamcity-service-messages": "0.1.14",
|
|
167
167
|
"tsconfig-paths-webpack-plugin": "4.0.0",
|
|
168
|
-
"watskeburt": "0.
|
|
168
|
+
"watskeburt": "0.9.0",
|
|
169
169
|
"wrap-ansi": "^7.0.0"
|
|
170
170
|
},
|
|
171
171
|
"devDependencies": {
|
|
172
172
|
"@babel/core": "7.20.2",
|
|
173
173
|
"@babel/plugin-transform-modules-commonjs": "7.19.6",
|
|
174
174
|
"@babel/preset-typescript": "7.18.6",
|
|
175
|
-
"@swc/core": "1.3.
|
|
176
|
-
"@types/lodash": "4.14.
|
|
175
|
+
"@swc/core": "1.3.20",
|
|
176
|
+
"@types/lodash": "4.14.190",
|
|
177
177
|
"@types/node": "18.11.9",
|
|
178
178
|
"@types/prompts": "2.4.1",
|
|
179
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
180
|
-
"@typescript-eslint/parser": "5.
|
|
179
|
+
"@typescript-eslint/eslint-plugin": "5.44.0",
|
|
180
|
+
"@typescript-eslint/parser": "5.44.0",
|
|
181
181
|
"@vue/compiler-sfc": "3.2.45",
|
|
182
182
|
"c8": "7.12.0",
|
|
183
183
|
"chai": "4.3.7",
|
|
184
184
|
"chai-json-schema": "1.5.1",
|
|
185
185
|
"coffeescript": "2.7.0",
|
|
186
|
-
"eslint": "8.
|
|
186
|
+
"eslint": "8.28.0",
|
|
187
187
|
"eslint-config-moving-meadow": "4.0.2",
|
|
188
188
|
"eslint-config-prettier": "8.5.0",
|
|
189
189
|
"eslint-plugin-budapestian": "5.0.1",
|
|
@@ -192,18 +192,18 @@
|
|
|
192
192
|
"eslint-plugin-mocha": "10.1.0",
|
|
193
193
|
"eslint-plugin-node": "11.1.0",
|
|
194
194
|
"eslint-plugin-security": "1.5.0",
|
|
195
|
-
"eslint-plugin-unicorn": "^
|
|
195
|
+
"eslint-plugin-unicorn": "^45.0.0",
|
|
196
196
|
"husky": "8.0.2",
|
|
197
197
|
"intercept-stdout": "0.1.2",
|
|
198
198
|
"lint-staged": "12.3.4",
|
|
199
199
|
"mocha": "10.1.0",
|
|
200
200
|
"normalize-newline": "^3.0.0",
|
|
201
201
|
"npm-run-all": "4.1.5",
|
|
202
|
-
"prettier": "2.
|
|
202
|
+
"prettier": "2.8.0",
|
|
203
203
|
"proxyquire": "2.1.3",
|
|
204
204
|
"shx": "0.3.4",
|
|
205
205
|
"svelte": "3.53.1",
|
|
206
|
-
"symlink-dir": "5.0
|
|
206
|
+
"symlink-dir": "5.1.0",
|
|
207
207
|
"typescript": "4.9.3",
|
|
208
208
|
"upem": "7.3.1",
|
|
209
209
|
"vue-template-compiler": "2.7.14",
|
package/src/cli/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const path = require("path");
|
|
1
2
|
const glob = require("glob");
|
|
2
3
|
const clone = require("lodash/clone");
|
|
3
4
|
const set = require("lodash/set");
|
|
@@ -89,14 +90,19 @@ function setUpListener(pCruiseOptions) {
|
|
|
89
90
|
}
|
|
90
91
|
|
|
91
92
|
function runCruise(pFileDirectoryArray, pCruiseOptions) {
|
|
92
|
-
pFileDirectoryArray
|
|
93
|
-
.filter((pFileOrDirectory) => !glob.hasMagic(pFileOrDirectory))
|
|
94
|
-
.forEach(validateFileExistence);
|
|
95
|
-
|
|
96
93
|
const lCruiseOptions = addKnownViolations(
|
|
97
94
|
normalizeCliOptions(pCruiseOptions)
|
|
98
95
|
);
|
|
99
96
|
|
|
97
|
+
pFileDirectoryArray
|
|
98
|
+
.filter((pFileOrDirectory) => !glob.hasMagic(pFileOrDirectory))
|
|
99
|
+
.map((pFileOrDirectory) =>
|
|
100
|
+
lCruiseOptions?.ruleSet?.options?.baseDir
|
|
101
|
+
? path.join(lCruiseOptions.ruleSet.options.baseDir, pFileOrDirectory)
|
|
102
|
+
: pFileOrDirectory
|
|
103
|
+
)
|
|
104
|
+
.forEach(validateFileExistence);
|
|
105
|
+
|
|
100
106
|
setUpListener(lCruiseOptions);
|
|
101
107
|
|
|
102
108
|
bus.emit("start");
|
package/src/meta.js
CHANGED
package/src/report/metrics.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
const { EOL } = require("os");
|
|
2
2
|
const chalk = require("chalk");
|
|
3
|
+
const utl = require("./utl");
|
|
3
4
|
|
|
4
5
|
const DECIMAL_BASE = 10;
|
|
5
6
|
const METRIC_WIDTH = 4;
|
|
6
|
-
const INSTABILITY_DECIMALS = 2;
|
|
7
|
-
const YADDUM = DECIMAL_BASE ** INSTABILITY_DECIMALS;
|
|
8
7
|
const COMPONENT_HEADER = "name";
|
|
9
8
|
|
|
10
9
|
function getHeader(pMaxNameWidth) {
|
|
@@ -12,7 +11,7 @@ function getHeader(pMaxNameWidth) {
|
|
|
12
11
|
METRIC_WIDTH + 1
|
|
13
12
|
)} ${"Ca".padStart(METRIC_WIDTH + 1)} ${"Ce".padStart(
|
|
14
13
|
METRIC_WIDTH + 1
|
|
15
|
-
)} ${"I".padEnd(METRIC_WIDTH + 1)}`;
|
|
14
|
+
)} ${"I (%)".padEnd(METRIC_WIDTH + 1)}`;
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
function getDemarcationLine(pMaxNameWidth) {
|
|
@@ -38,9 +37,10 @@ function getMetricsTable(pMetrics, pMaxNameWidth) {
|
|
|
38
37
|
.toString(DECIMAL_BASE)
|
|
39
38
|
.padStart(METRIC_WIDTH)} ${efferentCouplings
|
|
40
39
|
.toString(DECIMAL_BASE)
|
|
41
|
-
.padStart(METRIC_WIDTH)} ${
|
|
40
|
+
.padStart(METRIC_WIDTH)} ${utl
|
|
41
|
+
.formatInstability(instability)
|
|
42
42
|
.toString(DECIMAL_BASE)
|
|
43
|
-
.
|
|
43
|
+
.padStart(METRIC_WIDTH)}`
|
|
44
44
|
);
|
|
45
45
|
}
|
|
46
46
|
|