dependency-cruiser 13.0.1 → 13.0.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 +16 -13
- package/src/config-utl/extract-babel-config.mjs +2 -2
- package/src/config-utl/extract-ts-config.mjs +1 -1
- package/src/meta.js +1 -1
- package/types/extract-babel-config.d.ts +19 -0
- package/types/extract-depcruise-config.d.ts +24 -0
- package/types/extract-ts-config.d.ts +11 -0
- package/types/extract-webpack-resolve-config.d.ts +18 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dependency-cruiser",
|
|
3
|
-
"version": "13.0.
|
|
3
|
+
"version": "13.0.2",
|
|
4
4
|
"description": "Validate and visualize dependencies. With your rules. JavaScript, TypeScript, CoffeeScript. ES6, CommonJS, AMD.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"static analysis",
|
|
@@ -50,17 +50,20 @@
|
|
|
50
50
|
"types": "./types/dependency-cruiser.d.ts"
|
|
51
51
|
},
|
|
52
52
|
"./config-utl/extract-babel-config": {
|
|
53
|
-
"import": "./src/config-utl/extract-babel-config.mjs"
|
|
53
|
+
"import": "./src/config-utl/extract-babel-config.mjs",
|
|
54
|
+
"types": "./types/extract-babel-config.d.ts"
|
|
54
55
|
},
|
|
55
56
|
"./config-utl/extract-depcruise-config": {
|
|
56
|
-
"import": "./src/config-utl/extract-depcruise-config/index.mjs"
|
|
57
|
+
"import": "./src/config-utl/extract-depcruise-config/index.mjs",
|
|
58
|
+
"types": "./types/extract-depcruise-config.d.ts"
|
|
57
59
|
},
|
|
58
60
|
"./config-utl/extract-ts-config": {
|
|
59
61
|
"import": "./src/config-utl/extract-ts-config.mjs",
|
|
60
62
|
"types": "./types/extract-ts-config.d.ts"
|
|
61
63
|
},
|
|
62
64
|
"./config-utl/extract-webpack-resolve-config": {
|
|
63
|
-
"import": "./src/config-utl/extract-webpack-resolve-config.mjs"
|
|
65
|
+
"import": "./src/config-utl/extract-webpack-resolve-config.mjs",
|
|
66
|
+
"types": "./types/extract-webpack-resolve-config.d.ts"
|
|
64
67
|
},
|
|
65
68
|
"./sample-reporter-plugin": "./configs/plugins/stats-reporter-plugin.js",
|
|
66
69
|
"./sample-3d-reporter-plugin": "./configs/plugins/3d-reporter-plugin.js",
|
|
@@ -90,10 +93,10 @@
|
|
|
90
93
|
"depcruise:baseline": "node ./bin/depcruise-baseline.mjs src bin test configs types tools",
|
|
91
94
|
"depcruise:explain": "node ./bin/dependency-cruise.mjs src bin test configs types tools --output-type err-long --progress none",
|
|
92
95
|
"depcruise:graph:doc": "npm-run-all depcruise:graph:doc:json --parallel depcruise:graph:doc:fmt-* depcruise:graph:doc:samples",
|
|
93
|
-
"depcruise:graph:doc:json": "node ./bin/dependency-cruise.mjs bin src test --output-type json --output-to tmp_graph_deps.json --progress",
|
|
94
|
-
"depcruise:graph:doc:fmt-detail": "./bin/depcruise-fmt.mjs -T dot -f - tmp_graph_deps.json | dot -T svg | tee doc/real-world-samples/dependency-cruiser-without-node_modules.svg | node bin/wrap-stream-in-html.mjs > docs/dependency-cruiser-dependency-graph.html",
|
|
95
|
-
"depcruise:graph:doc:fmt-archi": "./bin/depcruise-fmt.mjs -T archi -f - tmp_graph_deps.json | dot -T svg -Gordering=in -Grankdir=TD | tee doc/real-world-samples/dependency-cruiser-archi-graph.svg | node bin/wrap-stream-in-html.mjs > docs/dependency-cruiser-archi-graph.html",
|
|
96
|
-
"depcruise:graph:doc:fmt-dir": "./bin/depcruise-fmt.mjs -T ddot -f - tmp_graph_deps.json | dot -T svg -Grankdir=TD | tee doc/real-world-samples/dependency-cruiser-dir-graph.svg | node bin/wrap-stream-in-html.mjs > docs/dependency-cruiser-dir-graph.html",
|
|
96
|
+
"depcruise:graph:doc:json": "node ./bin/dependency-cruise.mjs bin src test --output-type json --output-to node_modules/.cache/tmp_graph_deps.json --progress",
|
|
97
|
+
"depcruise:graph:doc:fmt-detail": "./bin/depcruise-fmt.mjs -T dot -f - node_modules/.cache/tmp_graph_deps.json | dot -T svg | tee doc/real-world-samples/dependency-cruiser-without-node_modules.svg | node bin/wrap-stream-in-html.mjs > docs/dependency-cruiser-dependency-graph.html",
|
|
98
|
+
"depcruise:graph:doc:fmt-archi": "./bin/depcruise-fmt.mjs -T archi -f - node_modules/.cache/tmp_graph_deps.json | dot -T svg -Gordering=in -Grankdir=TD | tee doc/real-world-samples/dependency-cruiser-archi-graph.svg | node bin/wrap-stream-in-html.mjs > docs/dependency-cruiser-archi-graph.html",
|
|
99
|
+
"depcruise:graph:doc:fmt-dir": "./bin/depcruise-fmt.mjs -T ddot -f - node_modules/.cache/tmp_graph_deps.json | dot -T svg -Grankdir=TD | tee doc/real-world-samples/dependency-cruiser-dir-graph.svg | node bin/wrap-stream-in-html.mjs > docs/dependency-cruiser-dir-graph.html",
|
|
97
100
|
"depcruise:graph:doc:fmt-schema": "cd tools/schema && node ../../bin/dependency-cruise.mjs . --output-type dot | dot -T svg | tee ../overview.svg | node ../../bin/wrap-stream-in-html.mjs > ../../docs/schema-overview.html && cd -",
|
|
98
101
|
"depcruise:graph:doc:fmt-types": "cd types && node ../bin/dependency-cruise.mjs . --output-type dot | dot -T svg > overview.svg && cd -",
|
|
99
102
|
"depcruise:graph:doc:samples": "sh tools/generate-samples.sh",
|
|
@@ -156,7 +159,7 @@
|
|
|
156
159
|
"enhanced-resolve": "5.14.0",
|
|
157
160
|
"figures": "5.0.0",
|
|
158
161
|
"get-stream": "^6.0.1",
|
|
159
|
-
"glob": "10.2.
|
|
162
|
+
"glob": "10.2.6",
|
|
160
163
|
"handlebars": "4.7.7",
|
|
161
164
|
"ignore": "5.2.4",
|
|
162
165
|
"indent-string": "5.0.0",
|
|
@@ -178,18 +181,18 @@
|
|
|
178
181
|
"@babel/core": "7.21.8",
|
|
179
182
|
"@babel/plugin-transform-modules-commonjs": "7.21.5",
|
|
180
183
|
"@babel/preset-typescript": "7.21.5",
|
|
181
|
-
"@swc/core": "1.3.
|
|
184
|
+
"@swc/core": "1.3.59",
|
|
182
185
|
"@types/lodash": "4.14.194",
|
|
183
|
-
"@types/node": "20.1
|
|
186
|
+
"@types/node": "20.2.1",
|
|
184
187
|
"@types/prompts": "2.4.4",
|
|
185
188
|
"@typescript-eslint/eslint-plugin": "5.59.6",
|
|
186
189
|
"@typescript-eslint/parser": "5.59.6",
|
|
187
|
-
"@vue/compiler-sfc": "3.3.
|
|
190
|
+
"@vue/compiler-sfc": "3.3.4",
|
|
188
191
|
"c8": "7.13.0",
|
|
189
192
|
"chai": "4.3.7",
|
|
190
193
|
"chai-json-schema": "1.5.1",
|
|
191
194
|
"coffeescript": "2.7.0",
|
|
192
|
-
"eslint": "8.
|
|
195
|
+
"eslint": "8.41.0",
|
|
193
196
|
"eslint-config-moving-meadow": "4.0.2",
|
|
194
197
|
"eslint-config-prettier": "8.8.0",
|
|
195
198
|
"eslint-plugin-budapestian": "5.0.1",
|
|
@@ -76,11 +76,11 @@ async function getConfig(pBabelConfigFileName) {
|
|
|
76
76
|
/**
|
|
77
77
|
* Reads the file with name `pBabelConfigFileName` and returns its parsed
|
|
78
78
|
* contents as an object
|
|
79
|
-
*
|
|
79
|
+
*
|
|
80
80
|
* Silently fails if a supported @babel/core version can't be found
|
|
81
81
|
*
|
|
82
82
|
* @param {string} pBabelConfigFileName
|
|
83
|
-
* @return {
|
|
83
|
+
* @return {object} babel config as an object
|
|
84
84
|
* @throws {Error} when the babel config has an unknown extension OR
|
|
85
85
|
* when the babel config is invalid OR
|
|
86
86
|
* when dependency-cruiser can't yet process it
|
|
@@ -35,7 +35,7 @@ const FORMAT_DIAGNOSTICS_HOST = {
|
|
|
35
35
|
*
|
|
36
36
|
* @param {string} pTSConfigFileName
|
|
37
37
|
* @return {import("typescript").ParsedCommandLine} tsconfig as an object
|
|
38
|
-
* @throws {Error} when the tsconfig is invalid/
|
|
38
|
+
* @throws {Error} when the tsconfig is invalid/ has errors
|
|
39
39
|
* @throws {TypeError} when the tsconfig is unreadable
|
|
40
40
|
*/
|
|
41
41
|
export default function extractTSConfig(pTSConfigFileName) {
|
package/src/meta.js
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reads the file with name `pBabelConfigFileName` and returns its parsed
|
|
3
|
+
* contents as an object
|
|
4
|
+
*x
|
|
5
|
+
* Silently fails if a supported @babel/core version can't be found
|
|
6
|
+
*
|
|
7
|
+
* @param pBabelConfigFileName
|
|
8
|
+
* @return babel config as an object
|
|
9
|
+
* @throws when the babel config has an unknown extension OR
|
|
10
|
+
* when the babel config is invalid OR
|
|
11
|
+
* when dependency-cruiser can't yet process it
|
|
12
|
+
*/
|
|
13
|
+
export default function extractBabelConfig(
|
|
14
|
+
pBabelConfigFileName: string
|
|
15
|
+
): Promise<object>;
|
|
16
|
+
|
|
17
|
+
// regarding the rather unspecific _object_ type - this is what's
|
|
18
|
+
// currently specified on definitelyTyped for @babel/core:
|
|
19
|
+
// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/b93ba16b8e482e66f7a82c426096ae31e1311710/types/babel__core/index.d.ts#L614
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ICruiseOptions } from "./options";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Reads the file with name `pConfigFileName` returns the parsed cruise
|
|
5
|
+
* options.
|
|
6
|
+
*
|
|
7
|
+
* You can safely ignore the optional parameters. Simply this should work (given
|
|
8
|
+
* `.dependency-cruiser.js` exists and contains a valid dependency-cruiser config)
|
|
9
|
+
*
|
|
10
|
+
* ```javascript
|
|
11
|
+
* const depcruiseConfig = extractDepcruiseConfig("./.dependency-cruiser.js")
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* @param pConfigFileName
|
|
15
|
+
* @param pAlreadyVisited
|
|
16
|
+
* @param pBaseDirectory
|
|
17
|
+
* @return dependency-cruiser options
|
|
18
|
+
* @throws when the config is not valid (/ does not exist/ isn't readable)
|
|
19
|
+
*/
|
|
20
|
+
export default function extractDepcruiseConfig(
|
|
21
|
+
pConfigFileName: string,
|
|
22
|
+
pAlreadyVisited?: Set<string>,
|
|
23
|
+
pBaseDirectory?: string
|
|
24
|
+
): Promise<ICruiseOptions>;
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import { ParsedCommandLine } from "typescript";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Reads the file with name `pTSConfigFileName` and returns its parsed
|
|
5
|
+
* contents as an object
|
|
6
|
+
*
|
|
7
|
+
* Silently fails if a supported version of the typescript compiler isn't available
|
|
8
|
+
*
|
|
9
|
+
* @param pTSConfigFileName
|
|
10
|
+
* @return tsconfig as an object
|
|
11
|
+
* @throws {Error} when the tsconfig is invalid/ has errors
|
|
12
|
+
* @throws {TypeError} when the tsconfig is unreadable
|
|
13
|
+
*/
|
|
3
14
|
export default function extractTSConfig(
|
|
4
15
|
pTSConfigFileName: string
|
|
5
16
|
): ParsedCommandLine;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reads the file with name `pWebpackConfigFilename` and (applying the
|
|
3
|
+
* environment `pEnvironment` and the arguments `pArguments` (which can
|
|
4
|
+
* either be a string or a keys-values object)) returns the resolve config
|
|
5
|
+
* from it as an object.
|
|
6
|
+
*
|
|
7
|
+
* @param pWebpackConfigFilename
|
|
8
|
+
* @param pEnvironment
|
|
9
|
+
* @param pArguments
|
|
10
|
+
* @return webpack resolve config as an object
|
|
11
|
+
* @throws when the webpack config isn't usable (e.g. because it
|
|
12
|
+
* doesn't exist, or because it's invalid)
|
|
13
|
+
*/
|
|
14
|
+
export default function extractWebpackResolveConfig(
|
|
15
|
+
pWebpackConfigFilename: string,
|
|
16
|
+
pEnvironment?: string,
|
|
17
|
+
pArguments?: string | any
|
|
18
|
+
): Promise<any>;
|