dependency-cruiser 18.7.1 → 18.7.2
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": "18.7.
|
|
3
|
+
"version": "18.7.2",
|
|
4
4
|
"description": "Validate and visualize dependencies. With your rules. JavaScript, TypeScript, CoffeeScript. ES6, CommonJS, AMD.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"static analysis",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"contributors": [
|
|
21
21
|
"0xflotus (https://github.com/0xflotus)",
|
|
22
22
|
"Álvaro Cuesta (https://github.com/alvaro-cuesta)",
|
|
23
|
+
"Arpit Jain (https://github.com/arpitjain099)",
|
|
23
24
|
"anna (https://github.com/annamooseity)",
|
|
24
25
|
"Bastian Hess (https://github.com/bashess)",
|
|
25
26
|
"Bin (https://github.com/soulhat)",
|
|
@@ -30,6 +31,7 @@
|
|
|
30
31
|
"Daniel Edholm Ignat (https://github.com/dignite)",
|
|
31
32
|
"Daniel Rodríguez Rivero (https://danielorodriguez.com)",
|
|
32
33
|
"davidparkagoda (https://github.com/davidparkagoda)",
|
|
34
|
+
"Dmytro Kurovskyi (https://github.com/kurovskyiii)",
|
|
33
35
|
"electrovir (https://github.com/electrovir)",
|
|
34
36
|
"Emily Marigold Klassen (https://forivall.com)",
|
|
35
37
|
"Frederik Schubert (https://github.com/ferdynator)",
|
|
@@ -40,6 +42,7 @@
|
|
|
40
42
|
"Ivan (https://github.com/Winner95)",
|
|
41
43
|
"Jeremy Magland (https://github.com/magland)",
|
|
42
44
|
"Jessica Kerr (https://jessitron.com)",
|
|
45
|
+
"João Ribeiro (https://github.com/JonnyBGod)",
|
|
43
46
|
"Jon Lauridsen (https://jonlauridsen.com)",
|
|
44
47
|
"Joshua T (https://github.com/radiantly)",
|
|
45
48
|
"KenjiroKubota (https://github.com/kubotak-is)",
|
|
@@ -55,12 +58,15 @@
|
|
|
55
58
|
"Radosław Kłos (https://klos.dev)",
|
|
56
59
|
"Richard Musiol (https://github.com/neelance)",
|
|
57
60
|
"Roy Swinkels (https://github.com/donroyco)",
|
|
61
|
+
"Samuel Gunter (https://github.com/Samathingamajig)",
|
|
62
|
+
"Sebastian Danielsson (https://github.com/sebdanielsson)",
|
|
58
63
|
"Sebastian Landwehr (https://sebastianlandwehr.com)",
|
|
59
64
|
"Sharang Pai (https://sharangpai.me)",
|
|
60
65
|
"Stefan Gojan (https://stefan-gojan.de)",
|
|
61
66
|
"Tharun Rajendran (https://github.com/tharun208)",
|
|
62
67
|
"TruongSinh Tran-Nguyen (https://truongsinh.pro)",
|
|
63
68
|
"Valentin Semirulnik (https://github.com/7rulnik)",
|
|
69
|
+
"Yohannes (https://github.com/Johannes7549)",
|
|
64
70
|
"Yuanhai He (https://bestmike007.com)",
|
|
65
71
|
"정건우 (https://www.zigae.com/)"
|
|
66
72
|
],
|
|
@@ -158,7 +164,7 @@
|
|
|
158
164
|
"prompts": "2.4.2",
|
|
159
165
|
"rechoir": "0.8.0",
|
|
160
166
|
"safe-regex": "2.1.1",
|
|
161
|
-
"semver": "7.8.
|
|
167
|
+
"semver": "7.8.6",
|
|
162
168
|
"tsconfig-paths-webpack-plugin": "4.2.0",
|
|
163
169
|
"watskeburt": "6.0.0"
|
|
164
170
|
},
|
|
@@ -89,17 +89,22 @@ function determineManifestDependencyTypes(
|
|
|
89
89
|
* an array, and not an object, hence needs different treatment
|
|
90
90
|
*/
|
|
91
91
|
function dependencyIsBundled(pModule, pPackageDeps) {
|
|
92
|
-
let lReturnValue = false;
|
|
93
|
-
|
|
94
92
|
if (pPackageDeps) {
|
|
95
93
|
const lBundledDependencies =
|
|
96
94
|
pPackageDeps.bundledDependencies || pPackageDeps.bundleDependencies;
|
|
95
|
+
// "bundledDependencies": true means: all production dependencies get
|
|
96
|
+
// bundled
|
|
97
|
+
if (lBundledDependencies === true) {
|
|
98
|
+
return Object.hasOwn(pPackageDeps.dependencies || {}, pModule);
|
|
99
|
+
}
|
|
97
100
|
|
|
98
101
|
if (lBundledDependencies) {
|
|
99
|
-
|
|
102
|
+
return lBundledDependencies.includes(pModule);
|
|
100
103
|
}
|
|
101
104
|
}
|
|
102
|
-
|
|
105
|
+
// false when there's no bundledDependencies or
|
|
106
|
+
// when bundledDependencies equals false
|
|
107
|
+
return false;
|
|
103
108
|
}
|
|
104
109
|
|
|
105
110
|
/**
|
|
@@ -116,9 +121,10 @@ function determineNodeModuleDependencyTypes(
|
|
|
116
121
|
pFileDirectory,
|
|
117
122
|
pResolveOptions,
|
|
118
123
|
) {
|
|
124
|
+
const lPackageRoot = getPackageRoot(pModuleName);
|
|
119
125
|
/** @type { DependencyType[] } */
|
|
120
126
|
const lReturnValue = determineManifestDependencyTypes(
|
|
121
|
-
|
|
127
|
+
lPackageRoot,
|
|
122
128
|
pPackageDeps,
|
|
123
129
|
pResolveOptions.modules,
|
|
124
130
|
);
|
|
@@ -128,7 +134,7 @@ function determineNodeModuleDependencyTypes(
|
|
|
128
134
|
) {
|
|
129
135
|
lReturnValue.push("deprecated");
|
|
130
136
|
}
|
|
131
|
-
if (dependencyIsBundled(
|
|
137
|
+
if (dependencyIsBundled(lPackageRoot, pPackageDeps)) {
|
|
132
138
|
lReturnValue.push("npm-bundled");
|
|
133
139
|
}
|
|
134
140
|
return lReturnValue;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { uniq } from "#utl/array-util.mjs";
|
|
2
2
|
|
|
3
3
|
/* eslint-disable security/detect-object-injection */
|
|
4
|
-
function
|
|
4
|
+
function normalizeBundleManifestKeys(pManifest) {
|
|
5
5
|
const lReturnValue = pManifest;
|
|
6
6
|
|
|
7
7
|
if (pManifest.bundleDependencies) {
|
|
@@ -10,6 +10,9 @@ function normalizeManifestKeys(pManifest) {
|
|
|
10
10
|
);
|
|
11
11
|
Reflect.deleteProperty(pManifest, "bundleDependencies");
|
|
12
12
|
}
|
|
13
|
+
if (pManifest.bundledDependencies === true) {
|
|
14
|
+
pManifest.bundledDependencies = Object.keys(pManifest.dependencies || {});
|
|
15
|
+
}
|
|
13
16
|
return lReturnValue;
|
|
14
17
|
}
|
|
15
18
|
|
|
@@ -64,8 +67,8 @@ function isAnArrayKey(pKey) {
|
|
|
64
67
|
*/
|
|
65
68
|
export default function mergeManifests(pClosestManifest, pFurtherManifest) {
|
|
66
69
|
return getJointUniqueDependencyKeys(
|
|
67
|
-
|
|
68
|
-
|
|
70
|
+
normalizeBundleManifestKeys(pClosestManifest),
|
|
71
|
+
normalizeBundleManifestKeys(pFurtherManifest),
|
|
69
72
|
)
|
|
70
73
|
.map((pKey) => ({
|
|
71
74
|
key: pKey,
|