dependency-cruiser 12.12.0 → 12.12.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/README.md CHANGED
@@ -1,10 +1,10 @@
1
- # Dependency cruiser ![Dependency cruiser](https://raw.githubusercontent.com/sverweij/dependency-cruiser/master/doc/assets/ZKH-Dependency-recolored-160.png)
1
+ # Dependency cruiser ![Dependency cruiser](https://raw.githubusercontent.com/sverweij/dependency-cruiser/v12/doc/assets/ZKH-Dependency-recolored-160.png)
2
2
 
3
3
  _Validate and visualise dependencies. With your rules._ JavaScript. TypeScript. CoffeeScript. ES6, CommonJS, AMD.
4
4
 
5
5
  ## What's this do?
6
6
 
7
- ![Snazzy dot output to whet your appetite](https://raw.githubusercontent.com/sverweij/dependency-cruiser/master/doc/assets/sample-dot-output.png)
7
+ ![Snazzy dot output to whet your appetite](https://raw.githubusercontent.com/sverweij/dependency-cruiser/v12/doc/assets/sample-dot-output.png)
8
8
 
9
9
  This runs through the dependencies in any JavaScript, TypeScript, LiveScript or CoffeeScript project and ...
10
10
 
@@ -112,7 +112,7 @@ npx depcruise --config .dependency-cruiser.js src
112
112
 
113
113
  This will validate against your rules and shows any violations in an eslint-like format:
114
114
 
115
- ![sample err output](https://raw.githubusercontent.com/sverweij/dependency-cruiser/master/doc/assets/sample-err-output.png)
115
+ ![sample err output](https://raw.githubusercontent.com/sverweij/dependency-cruiser/v12/doc/assets/sample-err-output.png)
116
116
 
117
117
  There's more ways to report validations; in a graph (like the one on top of this
118
118
  readme) or in an self-containing `html` file.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dependency-cruiser",
3
- "version": "12.12.0",
3
+ "version": "12.12.2",
4
4
  "description": "Validate and visualize dependencies. With your rules. JavaScript, TypeScript, CoffeeScript. ES6, CommonJS, AMD.",
5
5
  "keywords": [
6
6
  "static analysis",
@@ -87,8 +87,8 @@
87
87
  "depcruise:graph:doc:samples": "sh tools/generate-samples.sh",
88
88
  "depcruise:graph:mermaid": "node ./bin/dependency-cruise.js bin src --include-only ^src/ --config --collapse 2 --output-type mermaid",
89
89
  "depcruise:graph:mermaid:diff": "node ./bin/dependency-cruise.js bin src test types tools --config configs/.dependency-cruiser-unlimited.json --output-type mermaid --reaches \"$(watskeburt $SHA)\"",
90
- "depcruise:graph:view": "node ./bin/dependency-cruise.js bin src --prefix vscode://file/$(pwd)/ --config configs/.dependency-cruiser-show-metrics-config.json --output-type dot --progress cli-feedback --highlight \"$(watskeburt develop)\" | dot -T svg | node ./bin/wrap-stream-in-html.js | browser",
91
- "depcruise:graph:view:diff": "node ./bin/dependency-cruise.js bin src test --prefix vscode://file/$(pwd)/ --config configs/.dependency-cruiser-unlimited.json --output-type dot --progress cli-feedback --reaches \"$(watskeburt develop)\" | dot -T svg | node ./bin/wrap-stream-in-html.js | browser",
90
+ "depcruise:graph:view": "node ./bin/dependency-cruise.js bin src --prefix vscode://file/$(pwd)/ --config configs/.dependency-cruiser-show-metrics-config.json --output-type dot --progress cli-feedback --highlight \"$(watskeburt v12)\" | dot -T svg | node ./bin/wrap-stream-in-html.js | browser",
91
+ "depcruise:graph:view:diff": "node ./bin/dependency-cruise.js bin src test --prefix vscode://file/$(pwd)/ --config configs/.dependency-cruiser-unlimited.json --output-type dot --progress cli-feedback --reaches \"$(watskeburt v12)\" | dot -T svg | node ./bin/wrap-stream-in-html.js | browser",
92
92
  "depcruise:report": "node ./bin/dependency-cruise.js src bin test configs types --output-type err-html --config configs/.dependency-cruiser-show-metrics-config.json --output-to dependency-violations.html",
93
93
  "depcruise:report:view": "node ./bin/dependency-cruise.js src bin test configs types --output-type err-html --config configs/.dependency-cruiser-show-metrics-config.json --output-to - | browser",
94
94
  "depcruise:focus": "node ./bin/dependency-cruise.js src bin test configs types tools --progress --config --output-type text --focus",
@@ -149,7 +149,7 @@
149
149
  "ajv": "8.12.0",
150
150
  "chalk": "^4.1.2",
151
151
  "commander": "10.0.1",
152
- "enhanced-resolve": "5.13.0",
152
+ "enhanced-resolve": "5.14.0",
153
153
  "figures": "^3.2.0",
154
154
  "get-stream": "^6.0.1",
155
155
  "glob": "7.2.0",
@@ -171,21 +171,21 @@
171
171
  "wrap-ansi": "^7.0.0"
172
172
  },
173
173
  "devDependencies": {
174
- "@babel/core": "7.21.5",
174
+ "@babel/core": "7.21.8",
175
175
  "@babel/plugin-transform-modules-commonjs": "7.21.5",
176
176
  "@babel/preset-typescript": "7.21.5",
177
- "@swc/core": "1.3.56",
177
+ "@swc/core": "1.3.57",
178
178
  "@types/lodash": "4.14.194",
179
- "@types/node": "18.16.3",
179
+ "@types/node": "20.1.3",
180
180
  "@types/prompts": "2.4.4",
181
- "@typescript-eslint/eslint-plugin": "5.59.1",
182
- "@typescript-eslint/parser": "5.59.1",
183
- "@vue/compiler-sfc": "3.2.47",
181
+ "@typescript-eslint/eslint-plugin": "5.59.5",
182
+ "@typescript-eslint/parser": "5.59.5",
183
+ "@vue/compiler-sfc": "3.3.2",
184
184
  "c8": "7.13.0",
185
185
  "chai": "4.3.7",
186
186
  "chai-json-schema": "1.5.1",
187
187
  "coffeescript": "2.7.0",
188
- "eslint": "8.39.0",
188
+ "eslint": "8.40.0",
189
189
  "eslint-config-moving-meadow": "4.0.2",
190
190
  "eslint-config-prettier": "8.8.0",
191
191
  "eslint-plugin-budapestian": "5.0.1",
@@ -194,7 +194,7 @@
194
194
  "eslint-plugin-mocha": "10.1.0",
195
195
  "eslint-plugin-node": "11.1.0",
196
196
  "eslint-plugin-security": "1.7.1",
197
- "eslint-plugin-unicorn": "^46.0.0",
197
+ "eslint-plugin-unicorn": "^47.0.0",
198
198
  "husky": "8.0.3",
199
199
  "intercept-stdout": "0.1.2",
200
200
  "lint-staged": "13.2.2",
@@ -204,7 +204,7 @@
204
204
  "prettier": "2.8.8",
205
205
  "proxyquire": "2.1.3",
206
206
  "shx": "0.3.4",
207
- "svelte": "3.58.0",
207
+ "svelte": "3.59.1",
208
208
  "symlink-dir": "5.1.1",
209
209
  "typescript": "5.0.4",
210
210
  "upem": "7.3.2",
@@ -26,10 +26,10 @@ const SHAREABLE_OPTIONS = [
26
26
  "reaches",
27
27
  "reporterOptions",
28
28
  "rulesFile",
29
+ "tsConfig",
29
30
  "tsPreCompilationDeps",
30
31
  "webpackConfig",
31
32
  // "progress", TODO: could be enabled
32
- // "tsConfig", TODO: should be enabled
33
33
  ];
34
34
 
35
35
  function makeOptionsPresentable(pOptions) {
package/src/meta.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /* generated - don't edit */
2
2
 
3
3
  module.exports = {
4
- version: "12.12.0",
4
+ version: "12.12.2",
5
5
  engines: {
6
6
  node: "^14||^16||>=18",
7
7
  },
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Returns the results of a cruise in JSON
2
+ * Returns the results of a cruise _only_ in an exitCode
3
3
  *
4
4
  * @param {import("../../types/cruise-result").ICruiseResult} pResults
5
5
  * @returns {import("../../types/dependency-cruiser").IReporterOutput}
@@ -358,51 +358,8 @@ export interface IOptions extends ICruiseOptions {
358
358
  * The rules file used to validate the dependencies (if any)
359
359
  */
360
360
  rulesFile?: string;
361
- /**
362
- * The TypeScript configuration file used (if any)
363
- */
364
- tsConfig?: ITsConfig;
365
- /**
366
- * The webpack configuration options used for the cruise
367
- */
368
- webpackConfig?: IWebpackConfig;
369
- /**
370
- * The Babel configuration file used (if any)
371
- */
372
- babelConfig?: IBabelConfig;
373
361
  }
374
362
 
375
- export interface ITsConfig {
376
- fileName?: string;
377
- }
378
-
379
- export interface IBabelConfig {
380
- fileName?: string;
381
- }
382
-
383
- /**
384
- * The webpack configuration options used for the cruise
385
- */
386
- export interface IWebpackConfig {
387
- /**
388
- * The arguments used
389
- */
390
- arguments?: { [key: string]: any };
391
- /**
392
- * The 'env' parameters passed
393
- */
394
- env?: WebpackEnvType;
395
- /**
396
- * The name of the webpack configuration file used
397
- */
398
- fileName?: string;
399
- }
400
-
401
- /**
402
- * The 'env' parameters passed
403
- */
404
- export type WebpackEnvType = { [key: string]: any } | string;
405
-
406
363
  export interface IFolderDependency {
407
364
  /**
408
365
  * the (resolved) name of the dependency
@@ -124,7 +124,7 @@ export function futureCruise(
124
124
  * Given a cruise result, formats it with the given reporter (pOutputType)
125
125
  *
126
126
  * @param pResult A javascript object that contains the result of a cruise. Must adhere
127
- * to the [dependency-cruiser results schema](https://github.com/sverweij/dependency-cruiser/blob/develop/src/schema/cruise-result.json)
127
+ * to the [dependency-cruiser results schema](https://github.com/sverweij/dependency-cruiser/blob/v12/src/schema/cruise-result.json)
128
128
  * @param pOutputType Which reporter to use to format the cruise result with
129
129
  */
130
130
  export function format(
@@ -19,6 +19,37 @@ export type ProgressType =
19
19
  | "ndjson"
20
20
  | "none";
21
21
 
22
+ export interface ITsConfig {
23
+ fileName?: string;
24
+ }
25
+
26
+ export interface IBabelConfig {
27
+ fileName?: string;
28
+ }
29
+
30
+ /**
31
+ * The 'env' parameters passed to webpack, if any
32
+ */
33
+ export type WebpackEnvType = { [key: string]: any } | string;
34
+
35
+ /**
36
+ * The webpack configuration options used for the cruise
37
+ */
38
+ export interface IWebpackConfig {
39
+ /**
40
+ * The arguments used
41
+ */
42
+ arguments?: { [key: string]: any };
43
+ /**
44
+ * The 'env' parameters passed
45
+ */
46
+ env?: WebpackEnvType;
47
+ /**
48
+ * The name of the webpack configuration file used
49
+ */
50
+ fileName?: string;
51
+ }
52
+
22
53
  export interface ICruiseOptions {
23
54
  /**
24
55
  * if true, will attempt to validate with the rules in ruleSet.
@@ -175,7 +206,7 @@ export interface ICruiseOptions {
175
206
  /*
176
207
  * List of strings you have in use in addition to cjs/ es6 requires
177
208
  * & imports to declare module dependencies. Use this e.g. if you've
178
- * redeclared require (`const want = require`), use a require-wrapper
209
+ * re-declared require (`const want = require`), use a require-wrapper
179
210
  * (like semver-try-require) or use window.require as a hack
180
211
  *
181
212
  * Defaults to `[]`
@@ -186,6 +217,31 @@ export interface ICruiseOptions {
186
217
  */
187
218
  reporterOptions?: IReporterOptions;
188
219
 
220
+ /**
221
+ * TypeScript project file ('tsconfig.json') to use for (1) compilation
222
+ * and (2) resolution (e.g. with the paths property)",
223
+ */
224
+ tsConfig?: ITsConfig;
225
+
226
+ /**
227
+ * Webpack configuration to use to get resolve options from
228
+ */
229
+ webpackConfig?: IWebpackConfig;
230
+
231
+ /**
232
+ * Babel configuration (e.g. '.babelrc.json') to use.
233
+ */
234
+ babelConfig?: IBabelConfig;
235
+
236
+ /**
237
+ * Overrides the parser dependency-cruiser will use - EXPERIMENTAL
238
+ *
239
+ * Note that you'll _very_ likely not need this - dependency-cruiser will
240
+ * typically sort out what the best parser for the job is out of the ones
241
+ * available
242
+ */
243
+ parser?: "acorn" | "tsc" | "swc";
244
+
189
245
  /**
190
246
  * Options used in module resolution that for dependency-cruiser's
191
247
  * use cannot go in a webpack config.
@@ -218,6 +274,18 @@ export interface ICruiseOptions {
218
274
  * tsconfig contains paths/ aliases.
219
275
  */
220
276
  extensions?: string[];
277
+ /**
278
+ * A list of main fields in manifests (package.json s). Typically you'd want
279
+ * to keep leave this this on its default (['main']) , but if you e.g. use
280
+ * external packages that only expose types, and you still want references
281
+ * to these types to be resolved you could expand this to ['main', 'types']
282
+ */
283
+ mainFields?: string[];
284
+ /**
285
+ * A list of files to consider 'main' files, defaults to ['index']. Only set
286
+ * this when you have really special needs that warrant it.
287
+ */
288
+ mainFiles?: string[];
221
289
  /**
222
290
  * Options to pass to the resolver (webpack's 'enhanced resolve') regarding
223
291
  * caching.
@@ -240,6 +308,7 @@ export interface ICruiseOptions {
240
308
  cacheDuration: number;
241
309
  };
242
310
  };
311
+
243
312
  /**
244
313
  * Whether or not to show progress feedback when the command line
245
314
  * app is running.
@@ -259,11 +328,13 @@ export interface ICruiseOptions {
259
328
  */
260
329
  maximumLevel?: -1 | 40 | 50 | 60 | 70 | 80 | 99;
261
330
  };
331
+
262
332
  /**
263
333
  * When this flag is set to true, dependency-cruiser will calculate (stability) metrics
264
334
  * for all modules and folders. Defaults to false.
265
335
  */
266
336
  metrics?: boolean;
337
+
267
338
  /**
268
339
  * - false: don't use caching.
269
340
  * - true or empty object: use caching with the default settings
@@ -60,7 +60,7 @@ export interface IAnonReporterOptions {
60
60
  * patterned after the original file name in stead. The list is empty
61
61
  * by default.
62
62
  *
63
- * Read more in https://github.com/sverweij/dependency-cruiser/blob/develop/doc/cli.md#anon---obfuscated-json",
63
+ * Read more in https://github.com/sverweij/dependency-cruiser/blob/v12/doc/cli.md#anon---obfuscated-json",
64
64
  */
65
65
  wordlist?: string[];
66
66
  }