dependency-cruiser 17.3.6 → 17.3.7
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 +5 -2
- package/src/{enrich/enrich-modules.mjs → analyze/analyze-modules.mjs} +1 -1
- package/src/{enrich → analyze}/derive/dependents.mjs +14 -3
- package/src/{enrich → analyze}/index.mjs +3 -3
- package/src/config-utl/extract-depcruise-config/merge-configs.mjs +2 -2
- package/src/main/cruise.mjs +3 -3
- package/src/main/report-wrap.mjs +1 -1
- package/src/meta.cjs +1 -1
- /package/src/{enrich → analyze}/add-validations.mjs +0 -0
- /package/src/{enrich → analyze}/derive/circular.mjs +0 -0
- /package/src/{enrich → analyze}/derive/folders/aggregate-to-folders.mjs +0 -0
- /package/src/{enrich → analyze}/derive/folders/index.mjs +0 -0
- /package/src/{enrich → analyze}/derive/folders/utl.mjs +0 -0
- /package/src/{enrich → analyze}/derive/metrics/get-module-metrics.mjs +0 -0
- /package/src/{enrich → analyze}/derive/metrics/index.mjs +0 -0
- /package/src/{enrich → analyze}/derive/module-utl.mjs +0 -0
- /package/src/{enrich → analyze}/derive/orphan/index.mjs +0 -0
- /package/src/{enrich → analyze}/derive/orphan/is-orphan.mjs +0 -0
- /package/src/{enrich → analyze}/derive/reachable.mjs +0 -0
- /package/src/{enrich → analyze}/soften-known-violations.mjs +0 -0
- /package/src/{enrich → analyze}/summarize/add-rule-set-used.mjs +0 -0
- /package/src/{enrich → analyze}/summarize/get-stats.mjs +0 -0
- /package/src/{enrich → analyze}/summarize/index.mjs +0 -0
- /package/src/{enrich → analyze}/summarize/is-same-violation.mjs +0 -0
- /package/src/{enrich → analyze}/summarize/summarize-folders.mjs +0 -0
- /package/src/{enrich → analyze}/summarize/summarize-modules.mjs +0 -0
- /package/src/{enrich → analyze}/summarize/summarize-options.mjs +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dependency-cruiser",
|
|
3
|
-
"version": "17.3.
|
|
3
|
+
"version": "17.3.7",
|
|
4
4
|
"description": "Validate and visualize dependencies. With your rules. JavaScript, TypeScript, CoffeeScript. ES6, CommonJS, AMD.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"static analysis",
|
|
@@ -160,7 +160,10 @@
|
|
|
160
160
|
"safe-regex": "2.1.1",
|
|
161
161
|
"semver": "7.7.3",
|
|
162
162
|
"tsconfig-paths-webpack-plugin": "4.2.0",
|
|
163
|
-
"watskeburt": "5.0.
|
|
163
|
+
"watskeburt": "5.0.2"
|
|
164
|
+
},
|
|
165
|
+
"overrides": {
|
|
166
|
+
"baseline-browser-mapping": "^2.9.15"
|
|
164
167
|
},
|
|
165
168
|
"engines": {
|
|
166
169
|
"node": "^20.12||^22||>=24"
|
|
@@ -15,7 +15,7 @@ import { bus } from "#utl/bus.mjs";
|
|
|
15
15
|
* @param {IOptions} pOptions
|
|
16
16
|
* @returns {IModule[]}
|
|
17
17
|
*/
|
|
18
|
-
export default function
|
|
18
|
+
export default function analyzeModules(pModules, pOptions) {
|
|
19
19
|
bus.info("analyze: cycles");
|
|
20
20
|
|
|
21
21
|
let lModules = deriveCycles(pModules, {
|
|
@@ -27,12 +27,23 @@ export function hasDependentsRule(pRuleSet) {
|
|
|
27
27
|
(pRuleSet?.allowed ?? []).some(isDependentsRule)
|
|
28
28
|
);
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @param {Partial<import("../../../types/cruise-result.d.mts").IModule[]>} pModules
|
|
33
|
+
* @param {import("../../../types/options.d.mts").ICruiseOptions} options
|
|
34
|
+
* @returns
|
|
35
|
+
*/
|
|
31
36
|
export default function addDependents(
|
|
32
37
|
pModules,
|
|
33
|
-
{ skipAnalysisNotInRules, metrics, ruleSet },
|
|
38
|
+
{ skipAnalysisNotInRules, metrics, ruleSet, reaches, focus },
|
|
34
39
|
) {
|
|
35
|
-
if (
|
|
40
|
+
if (
|
|
41
|
+
!skipAnalysisNotInRules ||
|
|
42
|
+
metrics ||
|
|
43
|
+
reaches ||
|
|
44
|
+
focus ||
|
|
45
|
+
hasDependentsRule(ruleSet)
|
|
46
|
+
) {
|
|
36
47
|
// creating this optimized structure here might seem overkill, but on
|
|
37
48
|
// large graphs it pays off significantly - creation is a few centiseconds
|
|
38
49
|
// but it cuts analysis in half on large graphs (and even on smaller
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import analyzeModules from "./analyze-modules.mjs";
|
|
2
2
|
import aggregateToFolders from "./derive/folders/index.mjs";
|
|
3
3
|
import summarize from "./summarize/index.mjs";
|
|
4
4
|
import { bus } from "#utl/bus.mjs";
|
|
@@ -16,8 +16,8 @@ import { bus } from "#utl/bus.mjs";
|
|
|
16
16
|
* @param {string[]} pFileAndDirectoryArray
|
|
17
17
|
* @returns {import("../../types/dependency-cruiser.js").ICruiseResult}
|
|
18
18
|
*/
|
|
19
|
-
export default function
|
|
20
|
-
const lModules =
|
|
19
|
+
export default function analyze(pModules, pOptions, pFileAndDirectoryArray) {
|
|
20
|
+
const lModules = analyzeModules(pModules, pOptions);
|
|
21
21
|
bus.info("analyze: aggregate to folders");
|
|
22
22
|
const lFolders = aggregateToFolders(lModules, pOptions);
|
|
23
23
|
|
|
@@ -105,7 +105,7 @@ function mergeAllowedSeverities(pConfigExtended, pConfigBase) {
|
|
|
105
105
|
* @returns {Object} - The merged rule set
|
|
106
106
|
*/
|
|
107
107
|
// eslint-disable-next-line complexity
|
|
108
|
-
export default (pConfigExtended, pConfigBase)
|
|
108
|
+
export default function mergeConfigs(pConfigExtended, pConfigBase) {
|
|
109
109
|
const lForbidden = mergeRules(
|
|
110
110
|
pConfigExtended?.forbidden ?? [],
|
|
111
111
|
pConfigBase?.forbidden ?? [],
|
|
@@ -133,4 +133,4 @@ export default (pConfigExtended, pConfigBase) => {
|
|
|
133
133
|
pConfigBase?.options ?? {},
|
|
134
134
|
),
|
|
135
135
|
};
|
|
136
|
-
}
|
|
136
|
+
}
|
package/src/main/cruise.mjs
CHANGED
|
@@ -54,7 +54,7 @@ export default async function cruise(
|
|
|
54
54
|
{ default: normalizeFilesAndDirectories },
|
|
55
55
|
{ default: normalizeResolveOptions },
|
|
56
56
|
{ default: extract },
|
|
57
|
-
{ default:
|
|
57
|
+
{ default: analyze },
|
|
58
58
|
] = await Promise.all([
|
|
59
59
|
// despite rule set parsing being behind an if, it's the 'normal' use case
|
|
60
60
|
// for dependency-cruiser, so import it unconditionally nonetheless
|
|
@@ -63,7 +63,7 @@ export default async function cruise(
|
|
|
63
63
|
import("./files-and-dirs/normalize.mjs"),
|
|
64
64
|
import("./resolve-options/normalize.mjs"),
|
|
65
65
|
import("#extract/index.mjs"),
|
|
66
|
-
import("#
|
|
66
|
+
import("#analyze/index.mjs"),
|
|
67
67
|
]);
|
|
68
68
|
|
|
69
69
|
if (lCruiseOptions.ruleSet) {
|
|
@@ -93,7 +93,7 @@ export default async function cruise(
|
|
|
93
93
|
);
|
|
94
94
|
|
|
95
95
|
bus.summary("analyze", c(7));
|
|
96
|
-
const lCruiseResult =
|
|
96
|
+
const lCruiseResult = analyze(
|
|
97
97
|
lExtractionResult,
|
|
98
98
|
lCruiseOptions,
|
|
99
99
|
lNormalizedFileAndDirectoryArray,
|
package/src/main/report-wrap.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getReporter } from "#report/index.mjs";
|
|
2
|
-
import summarize from "#
|
|
2
|
+
import summarize from "#analyze/summarize/index.mjs";
|
|
3
3
|
import { applyFilters } from "#graph-utl/filter-bank.mjs";
|
|
4
4
|
import consolidateToPattern from "#graph-utl/consolidate-to-pattern.mjs";
|
|
5
5
|
import { compareModules } from "#graph-utl/compare.mjs";
|
package/src/meta.cjs
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|