dependency-cruiser 16.10.0 → 16.10.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 +10 -7
- package/src/cli/init-config/environment-helpers.mjs +8 -2
- package/src/cli/normalize-cli-options.mjs +2 -2
- package/src/cli/utl/assert-file-existence.mjs +2 -2
- package/src/enrich/derive/reachable.mjs +10 -4
- package/src/extract/resolve/resolve-amd.mjs +2 -2
- package/src/meta.cjs +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dependency-cruiser",
|
|
3
|
-
"version": "16.10.
|
|
3
|
+
"version": "16.10.2",
|
|
4
4
|
"description": "Validate and visualize dependencies. With your rules. JavaScript, TypeScript, CoffeeScript. ES6, CommonJS, AMD.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"static analysis",
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"Richard Musiol (https://github.com/neelance)",
|
|
57
57
|
"Sharang Pai (https://sharangpai.me)",
|
|
58
58
|
"Stefan Gojan (https://stefan-gojan.de)",
|
|
59
|
+
"Valentin Semirulnik (https://github.com/7rulnik)",
|
|
59
60
|
"Tharun Rajendran (https://github.com/tharun208)",
|
|
60
61
|
"electrovir (https://github.com/electrovir)",
|
|
61
62
|
"fusheng (https://github.com/lin-hun)",
|
|
@@ -139,19 +140,19 @@
|
|
|
139
140
|
"README.md"
|
|
140
141
|
],
|
|
141
142
|
"dependencies": {
|
|
142
|
-
"acorn": "^8.14.
|
|
143
|
+
"acorn": "^8.14.1",
|
|
143
144
|
"acorn-jsx": "^5.3.2",
|
|
144
145
|
"acorn-jsx-walk": "^2.0.0",
|
|
145
|
-
"acorn-loose": "^8.
|
|
146
|
+
"acorn-loose": "^8.5.0",
|
|
146
147
|
"acorn-walk": "^8.3.4",
|
|
147
148
|
"ajv": "^8.17.1",
|
|
148
149
|
"commander": "^13.1.0",
|
|
149
150
|
"enhanced-resolve": "^5.18.1",
|
|
150
|
-
"ignore": "^7.0.
|
|
151
|
+
"ignore": "^7.0.4",
|
|
151
152
|
"interpret": "^3.1.1",
|
|
152
153
|
"is-installed-globally": "^1.0.0",
|
|
153
154
|
"json5": "^2.2.3",
|
|
154
|
-
"memoize": "^10.
|
|
155
|
+
"memoize": "^10.1.0",
|
|
155
156
|
"picocolors": "^1.1.1",
|
|
156
157
|
"picomatch": "^4.0.2",
|
|
157
158
|
"prompts": "^2.4.2",
|
|
@@ -163,10 +164,12 @@
|
|
|
163
164
|
"watskeburt": "^4.2.3"
|
|
164
165
|
},
|
|
165
166
|
"overrides": {
|
|
166
|
-
"cross-spawn": ">=6.0.6"
|
|
167
|
+
"cross-spawn": ">=6.0.6",
|
|
168
|
+
"nanoid": "^3.3.8"
|
|
167
169
|
},
|
|
168
170
|
"resolutions": {
|
|
169
|
-
"cross-spawn": ">=6.0.6"
|
|
171
|
+
"cross-spawn": ">=6.0.6",
|
|
172
|
+
"nanoid": "^3.3.8"
|
|
170
173
|
},
|
|
171
174
|
"engines": {
|
|
172
175
|
"node": "^18.17||>=20"
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
readFileSync,
|
|
3
|
+
readdirSync,
|
|
4
|
+
accessSync,
|
|
5
|
+
statSync,
|
|
6
|
+
constants,
|
|
7
|
+
} from "node:fs";
|
|
2
8
|
import { join } from "node:path";
|
|
3
9
|
import { DEFAULT_CONFIG_FILE_NAME } from "../defaults.mjs";
|
|
4
10
|
|
|
@@ -31,7 +37,7 @@ export function readManifest(pManifestFileName = "./package.json") {
|
|
|
31
37
|
*/
|
|
32
38
|
export function fileExists(pFile) {
|
|
33
39
|
try {
|
|
34
|
-
accessSync(pFile, R_OK);
|
|
40
|
+
accessSync(pFile, constants.R_OK);
|
|
35
41
|
} catch (pError) {
|
|
36
42
|
return false;
|
|
37
43
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { accessSync,
|
|
1
|
+
import { accessSync, constants } from "node:fs";
|
|
2
2
|
import { isAbsolute } from "node:path";
|
|
3
3
|
import {
|
|
4
4
|
RULES_FILE_NAME_SEARCH_ARRAY,
|
|
@@ -43,7 +43,7 @@ function normalizeConfigFileName(pCliOptions, pConfigWrapperName, pDefault) {
|
|
|
43
43
|
|
|
44
44
|
function fileExists(pFileName) {
|
|
45
45
|
try {
|
|
46
|
-
accessSync(pFileName, R_OK);
|
|
46
|
+
accessSync(pFileName, constants.R_OK);
|
|
47
47
|
return true;
|
|
48
48
|
} catch (pError) {
|
|
49
49
|
return false;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { accessSync,
|
|
1
|
+
import { accessSync, constants } from "node:fs";
|
|
2
2
|
|
|
3
3
|
export default function assertFileExistence(pDirectoryOrFile) {
|
|
4
4
|
try {
|
|
5
|
-
accessSync(pDirectoryOrFile, R_OK);
|
|
5
|
+
accessSync(pDirectoryOrFile, constants.R_OK);
|
|
6
6
|
} catch (pError) {
|
|
7
7
|
throw new Error(
|
|
8
8
|
`Can't open '${pDirectoryOrFile}' for reading. Does it exist?\n`,
|
|
@@ -139,11 +139,15 @@ function addReachesToModule(pModule, pGraph, pIndexedGraph, pReachableRule) {
|
|
|
139
139
|
return pModule;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
function addReachableToModule(
|
|
143
|
-
|
|
142
|
+
function addReachableToModule(
|
|
143
|
+
pModule,
|
|
144
|
+
pIndexedGraph,
|
|
145
|
+
pReachableRule,
|
|
146
|
+
pFilteredFromModules,
|
|
147
|
+
) {
|
|
144
148
|
let lFound = false;
|
|
145
149
|
|
|
146
|
-
for (let lFromModule of
|
|
150
|
+
for (let lFromModule of pFilteredFromModules) {
|
|
147
151
|
if (
|
|
148
152
|
!lFound &&
|
|
149
153
|
pModule.source !== lFromModule.source &&
|
|
@@ -164,6 +168,8 @@ function addReachableToModule(pModule, pGraph, pIndexedGraph, pReachableRule) {
|
|
|
164
168
|
}
|
|
165
169
|
|
|
166
170
|
function addReachabilityToGraph(pGraph, pIndexedGraph, pReachableRule) {
|
|
171
|
+
const lFromModules = pGraph.filter(isModuleInRuleFrom(pReachableRule));
|
|
172
|
+
|
|
167
173
|
return pGraph.map((pModule) => {
|
|
168
174
|
let lClonedModule = structuredClone(pModule);
|
|
169
175
|
|
|
@@ -178,9 +184,9 @@ function addReachabilityToGraph(pGraph, pIndexedGraph, pReachableRule) {
|
|
|
178
184
|
if (shouldAddReachable(pReachableRule, lClonedModule, pGraph)) {
|
|
179
185
|
lClonedModule = addReachableToModule(
|
|
180
186
|
lClonedModule,
|
|
181
|
-
pGraph,
|
|
182
187
|
pIndexedGraph,
|
|
183
188
|
pReachableRule,
|
|
189
|
+
lFromModules,
|
|
184
190
|
);
|
|
185
191
|
}
|
|
186
192
|
return lClonedModule;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { accessSync,
|
|
1
|
+
import { accessSync, constants } from "node:fs";
|
|
2
2
|
import { relative, join } from "node:path";
|
|
3
3
|
import memoize, { memoizeClear } from "memoize";
|
|
4
4
|
import { isBuiltin } from "./is-built-in.mjs";
|
|
@@ -6,7 +6,7 @@ import pathToPosix from "#utl/path-to-posix.mjs";
|
|
|
6
6
|
|
|
7
7
|
const fileExists = memoize((pFile) => {
|
|
8
8
|
try {
|
|
9
|
-
accessSync(pFile, R_OK);
|
|
9
|
+
accessSync(pFile, constants.R_OK);
|
|
10
10
|
} catch (pError) {
|
|
11
11
|
return false;
|
|
12
12
|
}
|