dependency-cruiser 13.0.0 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dependency-cruiser",
3
- "version": "13.0.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",
@@ -46,19 +46,24 @@
46
46
  "main": "src/main/index.mjs",
47
47
  "exports": {
48
48
  ".": {
49
- "import": "./src/main/index.mjs"
49
+ "import": "./src/main/index.mjs",
50
+ "types": "./types/dependency-cruiser.d.ts"
50
51
  },
51
52
  "./config-utl/extract-babel-config": {
52
- "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"
53
55
  },
54
56
  "./config-utl/extract-depcruise-config": {
55
- "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"
56
59
  },
57
60
  "./config-utl/extract-ts-config": {
58
- "import": "./src/config-utl/extract-ts-config.mjs"
61
+ "import": "./src/config-utl/extract-ts-config.mjs",
62
+ "types": "./types/extract-ts-config.d.ts"
59
63
  },
60
64
  "./config-utl/extract-webpack-resolve-config": {
61
- "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"
62
67
  },
63
68
  "./sample-reporter-plugin": "./configs/plugins/stats-reporter-plugin.js",
64
69
  "./sample-3d-reporter-plugin": "./configs/plugins/3d-reporter-plugin.js",
@@ -88,10 +93,10 @@
88
93
  "depcruise:baseline": "node ./bin/depcruise-baseline.mjs src bin test configs types tools",
89
94
  "depcruise:explain": "node ./bin/dependency-cruise.mjs src bin test configs types tools --output-type err-long --progress none",
90
95
  "depcruise:graph:doc": "npm-run-all depcruise:graph:doc:json --parallel depcruise:graph:doc:fmt-* depcruise:graph:doc:samples",
91
- "depcruise:graph:doc:json": "node ./bin/dependency-cruise.mjs bin src test --output-type json --output-to tmp_graph_deps.json --progress",
92
- "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",
93
- "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",
94
- "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",
95
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 -",
96
101
  "depcruise:graph:doc:fmt-types": "cd types && node ../bin/dependency-cruise.mjs . --output-type dot | dot -T svg > overview.svg && cd -",
97
102
  "depcruise:graph:doc:samples": "sh tools/generate-samples.sh",
@@ -154,7 +159,7 @@
154
159
  "enhanced-resolve": "5.14.0",
155
160
  "figures": "5.0.0",
156
161
  "get-stream": "^6.0.1",
157
- "glob": "10.2.3",
162
+ "glob": "10.2.6",
158
163
  "handlebars": "4.7.7",
159
164
  "ignore": "5.2.4",
160
165
  "indent-string": "5.0.0",
@@ -169,25 +174,25 @@
169
174
  "semver-try-require": "6.2.2",
170
175
  "teamcity-service-messages": "0.1.14",
171
176
  "tsconfig-paths-webpack-plugin": "4.0.1",
172
- "watskeburt": "0.11.1",
177
+ "watskeburt": "0.11.2",
173
178
  "wrap-ansi": "8.1.0"
174
179
  },
175
180
  "devDependencies": {
176
181
  "@babel/core": "7.21.8",
177
182
  "@babel/plugin-transform-modules-commonjs": "7.21.5",
178
183
  "@babel/preset-typescript": "7.21.5",
179
- "@swc/core": "1.3.57",
184
+ "@swc/core": "1.3.59",
180
185
  "@types/lodash": "4.14.194",
181
- "@types/node": "20.1.3",
186
+ "@types/node": "20.2.1",
182
187
  "@types/prompts": "2.4.4",
183
- "@typescript-eslint/eslint-plugin": "5.59.5",
184
- "@typescript-eslint/parser": "5.59.5",
185
- "@vue/compiler-sfc": "3.3.2",
188
+ "@typescript-eslint/eslint-plugin": "5.59.6",
189
+ "@typescript-eslint/parser": "5.59.6",
190
+ "@vue/compiler-sfc": "3.3.4",
186
191
  "c8": "7.13.0",
187
192
  "chai": "4.3.7",
188
193
  "chai-json-schema": "1.5.1",
189
194
  "coffeescript": "2.7.0",
190
- "eslint": "8.40.0",
195
+ "eslint": "8.41.0",
191
196
  "eslint-config-moving-meadow": "4.0.2",
192
197
  "eslint-config-prettier": "8.8.0",
193
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
- *x
79
+ *
80
80
  * Silently fails if a supported @babel/core version can't be found
81
81
  *
82
82
  * @param {string} pBabelConfigFileName
83
- * @return {any} babel config as an object
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
@@ -34,8 +34,8 @@ const FORMAT_DIAGNOSTICS_HOST = {
34
34
  * Silently fails if a supported version of the typescript compiler isn't available
35
35
  *
36
36
  * @param {string} pTSConfigFileName
37
- * @return {any} tsconfig as an object
38
- * @throws {Error} when the tsconfig is invalid/ jas errors
37
+ * @return {import("typescript").ParsedCommandLine} tsconfig as an object
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
@@ -1,7 +1,7 @@
1
1
  /* generated - don't edit */
2
2
 
3
3
  module.exports = {
4
- version: "13.0.0",
4
+ version: "13.0.2",
5
5
  engines: {
6
6
  node: "^16.14||>=18",
7
7
  },
@@ -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>;
@@ -0,0 +1,16 @@
1
+ import { ParsedCommandLine } from "typescript";
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
+ */
14
+ export default function extractTSConfig(
15
+ pTSConfigFileName: string
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>;