forked from sverweij/dependency-cruiser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfiguration.schema.json
793 lines (793 loc) · 38.2 KB
/
configuration.schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
{
"title": "dependency-cruiser configuration",
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://dependency-cruiser.js.org/schema/configuration.schema.json",
"description": "A set of properties describing what dependencies are forbidden and what dependencies are allowed + options on how to cruise through the code",
"type": "object",
"additionalProperties": false,
"properties": {
"$schema": { "type": "string" },
"forbidden": {
"type": "array",
"description": "A list of rules that describe dependencies that are not allowed. dependency-cruiser will emit a separate error (warning/ informational) messages for each violated rule.",
"items": { "$ref": "#/definitions/ForbiddenRuleType" }
},
"allowed": {
"type": "array",
"description": "A list of rules that describe dependencies that are allowed. dependency-cruiser will emit the warning message 'not-in-allowed' for each dependency that does not at least meet one of them.",
"items": { "$ref": "#/definitions/AllowedRuleType" }
},
"allowedSeverity": {
"$ref": "#/definitions/SeverityType",
"description": "Severity to use when a dependency is not in the 'allowed' set of rules. Defaults to 'warn'"
},
"required": {
"type": "array",
"description": "A list of rules that describe what dependencies modules _must_ have. E.g. - every controller needs to (directly) depend on a base controller. - each source file should be the dependency of a spec file with the same base name",
"items": { "$ref": "#/definitions/RequiredRuleType" }
},
"options": { "$ref": "#/definitions/OptionsType" },
"extends": { "$ref": "#/definitions/ExtendsType" }
},
"definitions": {
"RuleSetType": {
"type": "object",
"additionalProperties": false,
"properties": {
"forbidden": {
"type": "array",
"description": "A list of rules that describe dependencies that are not allowed. dependency-cruiser will emit a separate error (warning/ informational) messages for each violated rule.",
"items": { "$ref": "#/definitions/ForbiddenRuleType" }
},
"allowed": {
"type": "array",
"description": "A list of rules that describe dependencies that are allowed. dependency-cruiser will emit the warning message 'not-in-allowed' for each dependency that does not at least meet one of them.",
"items": { "$ref": "#/definitions/AllowedRuleType" }
},
"allowedSeverity": {
"$ref": "#/definitions/SeverityType",
"description": "Severity to use when a dependency is not in the 'allowed' set of rules. Defaults to 'warn'"
},
"required": {
"type": "array",
"description": "A list of rules that describe what dependencies modules _must_ have. E.g. - every controller needs to (directly) depend on a base controller. - each source file should be the dependency of a spec file with the same base name",
"items": { "$ref": "#/definitions/RequiredRuleType" }
}
}
},
"AllowedRuleType": {
"oneOf": [
{ "$ref": "#/definitions/RegularAllowedRuleType" },
{ "$ref": "#/definitions/ReachabilityAllowedRuleType" }
]
},
"RegularAllowedRuleType": {
"type": "object",
"required": ["from", "to"],
"additionalProperties": false,
"properties": {
"comment": { "type": "string" },
"from": { "$ref": "#/definitions/FromRestrictionType" },
"to": { "$ref": "#/definitions/ToRestrictionType" }
}
},
"ReachabilityAllowedRuleType": {
"type": "object",
"required": ["from", "to"],
"additionalProperties": false,
"properties": {
"comment": { "type": "string" },
"from": { "$ref": "#/definitions/ReachabilityFromRestrictionType" },
"to": { "$ref": "#/definitions/ReachabilityToRestrictionType" }
}
},
"ForbiddenRuleType": {
"oneOf": [
{ "$ref": "#/definitions/RegularForbiddenRuleType" },
{ "$ref": "#/definitions/ReachabilityForbiddenRuleType" },
{ "$ref": "#/definitions/DependentsForbiddenRuleType" }
]
},
"RegularForbiddenRuleType": {
"type": "object",
"required": ["from", "to"],
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"description": "A short name for the rule - will appear in reporters to enable customers to quickly identify a violated rule. Try to keep them short, eslint style. E.g. 'not-to-core' for a rule forbidding dependencies on core modules, or 'not-to-unresolvable' for one that prevents dependencies on modules that probably don't exist."
},
"severity": { "$ref": "#/definitions/SeverityType" },
"comment": {
"type": "string",
"description": "You can use this field to document why the rule is there."
},
"from": { "$ref": "#/definitions/FromRestrictionType" },
"to": { "$ref": "#/definitions/ToRestrictionType" }
}
},
"DependentsForbiddenRuleType": {
"type": "object",
"required": ["module", "from"],
"additionalProperties": false,
"properties": {
"name": { "type": "string" },
"severity": { "$ref": "#/definitions/SeverityType" },
"comment": { "type": "string" },
"module": { "$ref": "#/definitions/DependentsModuleRestrictionType" },
"from": { "$ref": "#/definitions/DependentsFromRestrictionType" }
}
},
"ReachabilityForbiddenRuleType": {
"type": "object",
"required": ["from", "to"],
"additionalProperties": false,
"properties": {
"name": { "type": "string" },
"severity": { "$ref": "#/definitions/SeverityType" },
"comment": { "type": "string" },
"from": { "$ref": "#/definitions/ReachabilityFromRestrictionType" },
"to": { "$ref": "#/definitions/ReachabilityToRestrictionType" }
}
},
"RequiredRuleType": {
"type": "object",
"required": ["module", "to"],
"additionalProperties": false,
"properties": {
"name": { "type": "string" },
"severity": { "$ref": "#/definitions/SeverityType" },
"comment": { "type": "string" },
"module": { "$ref": "#/definitions/RequiredModuleRestrictionType" },
"to": { "$ref": "#/definitions/RequiredToRestrictionType" }
}
},
"FromRestrictionType": {
"type": "object",
"description": "Criteria an end of a dependency should match to be caught by this rule. Leave it empty if you want any module to be matched.",
"additionalProperties": false,
"properties": {
"path": {
"description": "A regular expression or an array of regular expressions an end of a dependency should match to be caught by this rule.",
"$ref": "#/definitions/REAsStringsType"
},
"pathNot": {
"description": "A regular expression or an array of regular expressions an end of a dependency should NOT match to be caught by this rule.",
"$ref": "#/definitions/REAsStringsType"
},
"orphan": {
"type": "boolean",
"description": "Whether or not to match when the module is an orphan (= has no incoming or outgoing dependencies). When this property it is part of a rule, dependency-cruiser will ignore the 'to' part."
}
}
},
"ReachabilityFromRestrictionType": {
"type": "object",
"description": "Criteria an end of a dependency should match to be caught by this rule. Leave it empty if you want any module to be matched.",
"additionalProperties": false,
"properties": {
"path": {
"description": "A regular expression or an array of regular expressions an end of a dependency should match to be caught by this rule.",
"$ref": "#/definitions/REAsStringsType"
},
"pathNot": {
"description": "A regular expression or an array of regular expressions an end of a dependency should NOT match to be caught by this rule.",
"$ref": "#/definitions/REAsStringsType"
}
}
},
"ToRestrictionType": {
"type": "object",
"description": "Criteria the 'to' end of a dependency should match to be caught by this rule. Leave it empty if you want any module to be matched.",
"additionalProperties": false,
"properties": {
"path": {
"description": "A regular expression or an array of regular expressions an end of a dependency should match to be caught by this rule.",
"$ref": "#/definitions/REAsStringsType"
},
"pathNot": {
"description": "A regular expression or an array of regular expressions an end of a dependency should NOT match to be caught by this rule.",
"$ref": "#/definitions/REAsStringsType"
},
"couldNotResolve": {
"type": "boolean",
"description": "Whether or not to match modules dependency-cruiser could not resolve (and probably aren't on disk). For this one too: leave out if you don't care either way."
},
"circular": {
"type": "boolean",
"description": "Whether or not to match when following to the to will ultimately end up in the from."
},
"dynamic": {
"type": "boolean",
"description": "Whether or not to match when the dependency is a dynamic one."
},
"exoticallyRequired": {
"type": "boolean",
"description": "Whether or not to match when the dependency is exotically required."
},
"exoticRequire": {
"description": "A regular expression to match against any 'exotic' require strings",
"$ref": "#/definitions/REAsStringsType"
},
"exoticRequireNot": {
"description": "A regular expression to match against any 'exotic' require strings - when it should NOT be caught by the rule",
"$ref": "#/definitions/REAsStringsType"
},
"preCompilationOnly": {
"type": "boolean",
"description": "true if this dependency only exists before compilation (like type only imports), false in all other cases. Only returned when the tsPreCompilationDeps is set to 'specify'."
},
"dependencyTypes": {
"type": "array",
"description": "Whether or not to match modules of any of these types (leaving out matches any of them)",
"items": { "$ref": "#/definitions/DependencyTypeType" }
},
"dependencyTypesNot": {
"type": "array",
"description": "Whether or not to match modules NOT of any of these types (leaving out matches none of them)",
"items": { "$ref": "#/definitions/DependencyTypeType" }
},
"moreThanOneDependencyType": {
"type": "boolean",
"description": "If true matches dependencies with more than one dependency type (e.g. defined in _both_ npm and npm-dev)"
},
"license": {
"description": "Whether or not to match modules that were released under one of the mentioned licenses. E.g. to flag GPL-1.0, GPL-2.0 licensed modules (e.g. because your app is not compatible with the GPL) use \"GPL\"",
"$ref": "#/definitions/REAsStringsType"
},
"licenseNot": {
"description": "Whether or not to match modules that were NOT released under one of the mentioned licenses. E.g. to flag everyting non MIT use \"MIT\" here",
"$ref": "#/definitions/REAsStringsType"
},
"via": {
"description": "For circular dependencies - whether or not to match cycles that include include modules with this regular expression. E.g. to allow all cycles, except when they go through one specific module. Typically to temporarily disallow some cycles with a lower severity - setting up a rule with a viaNot that ignores them.",
"$ref": "#/definitions/REAsStringsType"
},
"viaNot": {
"description": "For circular dependencies - whether or not to match cycles that do NOT include modules with this regular expression. E.g. to disallow all cycles, except when they go through one specific module. Typically to temporarily allow some cycles until they're removed.",
"$ref": "#/definitions/REAsStringsType"
}
}
},
"DependentsModuleRestrictionType": {
"description": "Criteria to select the module(s) this restriction should apply to",
"required": [],
"type": "object",
"additionalProperties": false,
"properties": {
"path": {
"description": "A regular expression or an array of regular expressions an end of a dependency should match to be caught by this rule.",
"$ref": "#/definitions/REAsStringsType"
},
"pathNot": {
"description": "A regular expression or an array of regular expressions an end of a dependency should NOT match to be caught by this rule.",
"$ref": "#/definitions/REAsStringsType"
},
"numberOfDependentsLessThan": {
"type": "integer",
"description": "Matches when the number of times the 'to' module is used falls below (<) this number. Caveat: only works in concert with path and pathNot restrictions in the from and to parts of the rule; other conditions will be ignored.(somewhat experimental; - syntax can change over time without a major bump)E.g. to flag modules that are used only once or not at all, use 2 here.",
"minimum": 0,
"maximum": 100
},
"numberOfDependentsMoreThan": {
"type": "integer",
"description": "Matches when the number of times the 'to' module is used raises above (>) this number. Caveat: only works in concert with path and pathNot restrictions in the from and to parts of the rule; other conditions will be ignored.(somewhat experimental; - syntax can change over time without a major bump)E.g. to flag modules that are used more than 10 times, use 10 here.",
"minimum": 0,
"maximum": 100
}
}
},
"DependentsFromRestrictionType": {
"description": "Criteria the dependents of the module should adehere to be caught by this rule rule. Leave it empty if you want any dependent to be matched.",
"required": [],
"type": "object",
"additionalProperties": false,
"properties": {
"path": {
"description": "A regular expression or an array of regular expressions an end of a dependency should match to be caught by this rule.",
"$ref": "#/definitions/REAsStringsType"
},
"pathNot": {
"description": "A regular expression or an array of regular expressions an end of a dependency should NOT match to be caught by this rule.",
"$ref": "#/definitions/REAsStringsType"
}
}
},
"ReachabilityToRestrictionType": {
"description": "Criteria the 'to' end of a dependency should match to be caught by this rule. Leave it empty if you want any module to be matched.",
"required": ["reachable"],
"type": "object",
"additionalProperties": false,
"properties": {
"path": {
"description": "A regular expression or an array of regular expressions an end of a dependency should match to be caught by this rule.",
"$ref": "#/definitions/REAsStringsType"
},
"pathNot": {
"description": "A regular expression or an array of regular expressions an end of a dependency should NOT match to be caught by this rule.",
"$ref": "#/definitions/REAsStringsType"
},
"reachable": {
"type": "boolean",
"description": "Whether or not to match modules that aren't reachable from the from part of the rule."
}
}
},
"RequiredModuleRestrictionType": {
"description": "Criteria to select the module(s) this restriction should apply to",
"required": [],
"type": "object",
"additionalProperties": false,
"properties": {
"path": {
"description": "A regular expression or an array of regular expressions an end of a dependency should match to be caught by this rule.",
"$ref": "#/definitions/REAsStringsType"
},
"pathNot": {
"description": "A regular expression or an array of regular expressions an end of a dependency should NOT match to be caught by this rule.",
"$ref": "#/definitions/REAsStringsType"
}
}
},
"RequiredToRestrictionType": {
"description": "Criteria for modules the associated module must depend on.",
"required": [],
"type": "object",
"additionalProperties": false,
"properties": {
"path": {
"description": "Criteria at least one dependency of each matching module mustadhere to.",
"$ref": "#/definitions/REAsStringsType"
}
}
},
"DependencyTypeType": {
"type": "string",
"enum": [
"aliased",
"core",
"deprecated",
"local",
"localmodule",
"npm",
"npm-bundled",
"npm-dev",
"npm-no-pkg",
"npm-optional",
"npm-peer",
"npm-unknown",
"undetermined",
"unknown",
"type-only"
]
},
"REAsStringsType": {
"oneOf": [
{ "type": "string" },
{ "type": "array", "items": { "type": "string" } }
]
},
"SeverityType": {
"type": "string",
"description": "How severe a violation of a rule is. The 'error' severity will make some reporters return a non-zero exit code, so if you want e.g. a build to stop when there's a rule violated: use that.",
"enum": ["error", "warn", "info", "ignore"]
},
"OptionsType": {
"type": "object",
"description": "Runtime configuration options",
"additionalProperties": false,
"properties": {
"doNotFollow": {
"description": "a regular expression for modules to include, but not follow further",
"oneOf": [
{ "$ref": "#/definitions/REAsStringsType" },
{ "$ref": "#/definitions/CompoundDoNotFollowType" }
]
},
"exclude": {
"description": "a regular expression for modules to exclude from being cruised",
"oneOf": [
{ "$ref": "#/definitions/REAsStringsType" },
{ "$ref": "#/definitions/CompoundExcludeType" }
]
},
"includeOnly": {
"description": "a regular expression for modules to cruise; anything outside it will be skipped",
"oneOf": [
{ "$ref": "#/definitions/REAsStringsType" },
{ "$ref": "#/definitions/CompoundIncludeOnlyType" }
]
},
"focus": {
"description": "dependency-cruiser will include modules matching this regular expression in its output, as well as their neighbours (direct dependencies and dependents)",
"oneOf": [
{ "$ref": "#/definitions/REAsStringsType" },
{ "$ref": "#/definitions/CompoundFocusType" }
]
},
"knownViolations": {
"description": "baseline of known validations. Typically you'd specify these in a file called .dependency-cruiser-known-violations.json (which you'd generate with the --outputType 'baseline') - and which is easy to keep up to date. In a pinch you can specify them here as well. The known violations in .dependency-cruiser-known-violations.json always take precedence.",
"$ref": "#/definitions/ViolationsType"
},
"collapse": {
"description": "Collapse a to a folder depth by passing a single digit (e.g. 2). When passed a regex collapses to that pattern E.g. ^packages/[^/]+/ would collapse to modules/ folders directly under your packages folder.",
"oneOf": [
{ "type": "string" },
{ "type": "integer", "minimum": 1, "maximum": 9 }
]
},
"maxDepth": {
"type": "integer",
"minimum": 0,
"maximum": 99,
"description": "The maximum cruise depth specified. 0 means no maximum specified. While it might look attractive to regulate the size of the output, this is not the best option to do so. Filters (exclude, includeOnly, focus), the dot and archi reporter's collapsePattern and the collapse options offer better, more reliable and more understandable results."
},
"moduleSystems": { "$ref": "#/definitions/ModuleSystemsType" },
"prefix": { "type": "string" },
"preserveSymlinks": {
"type": "boolean",
"description": "if true leave symlinks untouched, otherwise use the realpath. Defaults to `false` (which is also nodejs's default behavior since version 6)"
},
"combinedDependencies": {
"type": "boolean",
"description": "if true combines the package.jsons found from the module up to the base folder the cruise is initiated from. Useful for how (some) mono-repos manage dependencies & dependency definitions. Defaults to `false`."
},
"tsConfig": {
"type": "object",
"additionalProperties": false,
"description": "TypeScript project file ('tsconfig.json') to use for (1) compilation and (2) resolution (e.g. with the paths property)",
"properties": {
"fileName": {
"description": "The TypeScript project file to use. The fileName is relative to dependency-cruiser's current working directory. When not provided defaults to './tsconfig.json'.",
"type": "string"
}
}
},
"tsPreCompilationDeps": {
"description": "if true detect dependencies that only exist before typescript-to-javascript compilation.",
"oneOf": [
{ "type": "boolean" },
{ "type": "string", "enum": ["specify"] }
]
},
"extraExtensionsToScan": {
"type": "array",
"description": "List of extensions to scan _in addition_ to the extensions already covered by any available parser. Dependency-cruiser will consider files ending in these extensions but it will _not_ examine its content or derive any of their dependencies Sample value: [\".jpg\", \".png\", \".json\"]",
"items": { "type": "string" }
},
"externalModuleResolutionStrategy": {
"type": "string",
"description": "What external module resolution strategy to use. Defaults to 'node_modules' (not used anymore - module resolution strategy determination is automatic now)",
"enum": ["node_modules", "yarn-pnp"]
},
"forceDeriveDependents": {
"type": "boolean",
"description": "When true includes denormalized dependents in the cruise-result, even though there's no rule in the rule set that requires them. Defaults to false."
},
"webpackConfig": {
"type": "object",
"additionalProperties": false,
"description": "Webpack configuration to use to get resolve options from",
"properties": {
"fileName": {
"type": "string",
"description": "The webpack conf file to use (typically something like 'webpack.conf.js'). The fileName is relative to dependency-cruiser's current working directory. When not provided defaults to './webpack.conf.js'."
},
"env": {
"description": "Environment to pass if your config file returns a function",
"oneOf": [{ "type": "object" }, { "type": "string" }]
},
"arguments": {
"type": "object",
"description": "Arguments to pass if your config file returns a function. E.g. {mode: 'production'} if you want to use webpack 4's 'mode' feature"
}
}
},
"enhancedResolveOptions": {
"type": "object",
"additionalProperties": false,
"description": "Options used in module resolution that for dependency-cruiser's use cannot go in a webpack config. For details please refer to the documentation of enhanced-resolve itself.",
"properties": {
"exportsFields": {
"type": "array",
"description": "List of strings to consider as 'exports' fields in package.json. Use ['exports'] when you use packages that use such a field and your environment supports it (e.g. node ^12.19 || >=14.7 or recent versions of webpack).",
"items": { "type": "string" }
},
"conditionNames": {
"type": "array",
"description": "List of conditions to check for in the exports field. e.g. use `['imports']` if you're only interested in exposed es6 modules, ['require'] for commonjs, or all conditions at once (['import', 'require', 'node', 'default']) if anything goes for you. Only works when the 'exportsFields' array is non-empty",
"items": { "type": "string" }
},
"extensions": {
"type": "array",
"description": "List of extensions to scan for when resolving. Typically you want to leave this alone as dependency-cruiser figures out what extensions to scan based on 1. what is available in your environment 2. in the order your environment (nodejs, typescript) applies the resolution itself. However, if you want it to scan less you can specify so with the extensions attribute. E.g. when you're 100% sure you _only_ have typescript & json and nothing else you can pass ['.ts', '.json'] - which can lead to performance gains on systems with slow i/o (like ms-windows), especially when your tsconfig contains paths/ aliasses.",
"items": { "type": "string" }
},
"cachedInputFileSystem": {
"type": "object",
"description": "Options to pass to the resolver (webpack's 'enhanced resolve') regardingcaching.",
"additionalProperties": false,
"properties": {
"cacheDuration": {
"type": "integer",
"minimum": 0,
"maximum": 1800000,
"description": "The number of milliseconds [enhanced-resolve](webpack/enhanced-resolve)'s cached file system should use for cache duration. Typicially you won't have to touch this - the default works well for repos up to 5000 modules/ 20000 dependencies, and likely for numbers above as well. If you experience memory problems on a (humongous) repository you can use the cacheDuration attribute to tame enhanced-resolve's memory usage by lowering the cache duration trading off against some (for values over 1000ms) or significant (for values below 500ms) performance. Dependency-cruiser currently uses 4000ms, and in the past has used 1000ms - both with good results."
}
}
}
}
},
"babelConfig": {
"type": "object",
"additionalProperties": false,
"description": "Babel configuration (e.g. '.babelrc.json') to use.",
"properties": {
"fileName": {
"description": "The Babel configuration file to use. The fileName is relative to dependency-cruiser's current working directory. When not provided defaults to './.babelrc.json'. Dependency-cruiser currently supports only the json variant. Support for (js|cjs|mjs) variants and configuration in package.json might follow in future releases.",
"type": "string"
}
}
},
"parser": {
"type": "string",
"description": "overrides the parser dependency-cruiser will use - EXPERIMENTAL",
"enum": ["acorn", "swc", "tsc"]
},
"exoticRequireStrings": {
"type": "array",
"description": "List of strings you have in use in addition to cjs/ es6 requires & imports to declare module dependencies. Use this e.g. if you've redeclared require (`const want = require`), use a require-wrapper (like semver-try-require) or use window.require as a hack to workaround something",
"items": { "type": "string" }
},
"reporterOptions": { "$ref": "#/definitions/ReporterOptionsType" },
"progress": {
"type": "object",
"additionalProperties": false,
"description": "When executing dependency-cruiser emits 'start', 'progress' and 'end' events on a bus. You can use these e.g. to show progress in any UI (e.g. the cli) attach loggers etc. We're still figuring out how to do expose this (if at all), so the listener feature is highly experimental and use in any environment outside playgrounds is discouraged. For now it's only possible to use one of the baked-in listeners.",
"properties": {
"type": {
"type": "string",
"enum": ["cli-feedback", "performance-log", "none"]
}
}
},
"metrics": {
"type": "boolean",
"description": "When this flag is set to true, dependency-cruiser will calculate (stability) metrics for all modules and folders. Defaults to false."
},
"baseDir": {
"type": "string",
"description": "The directory dependency-cruiser should run its cruise from. Defaults to the current working directory."
}
}
},
"ModuleSystemType": {
"type": "string",
"enum": ["cjs", "es6", "amd", "tsd"]
},
"ModuleSystemsType": {
"type": "array",
"description": "List of module systems to cruise. Defaults to [amd, cjs, es6]",
"items": { "$ref": "#/definitions/ModuleSystemType" }
},
"CompoundExcludeType": {
"type": "object",
"description": "Criteria for dependencies to exclude",
"additionalProperties": false,
"properties": {
"path": {
"description": "a regular expression for modules to exclude from being cruised",
"$ref": "#/definitions/REAsStringsType"
},
"dynamic": {
"type": "boolean",
"description": "a boolean indicating whether or not to exclude dynamic dependencies"
}
}
},
"CompoundDoNotFollowType": {
"type": "object",
"description": "Criteria for modules to include, but not to follow further",
"additionalProperties": false,
"properties": {
"path": {
"description": "a regular expression for modules to include, but not follow further",
"$ref": "#/definitions/REAsStringsType"
},
"dependencyTypes": {
"type": "array",
"description": "an array of dependency types to include, but not follow further",
"items": { "$ref": "#/definitions/DependencyTypeType" }
}
}
},
"CompoundIncludeOnlyType": {
"type": "object",
"description": "Criteria for modules to only include",
"additionalProperties": false,
"properties": {
"path": {
"description": "dependency-cruiser will include modules matching this regular expression in its output, as well as their neighbours (direct dependencies and dependents)",
"$ref": "#/definitions/REAsStringsType"
}
}
},
"CompoundFocusType": {
"type": "object",
"description": "Criteria for modules to 'focus' on",
"additionalProperties": false,
"properties": {
"path": {
"description": "dependency-cruiser will include modules matching this regular expression in its output, as well as their neighbours (direct dependencies and dependents)",
"$ref": "#/definitions/REAsStringsType"
}
}
},
"ReporterOptionsType": {
"type": "object",
"description": "Options to tweak the output of reporters",
"additionalProperties": false,
"properties": {
"anon": { "$ref": "#/definitions/AnonReporterOptionsType" },
"archi": { "$ref": "#/definitions/DotReporterOptionsType" },
"dot": { "$ref": "#/definitions/DotReporterOptionsType" },
"ddot": { "$ref": "#/definitions/DotReporterOptionsType" },
"flat": { "$ref": "#/definitions/DotReporterOptionsType" },
"metrics": { "$ref": "#/definitions/MetricsReporterOptionsType" }
}
},
"AnonReporterOptionsType": {
"type": "object",
"description": "Options to tweak the output of the anonymous reporter",
"additionalProperties": false,
"properties": {
"wordlist": {
"type": "array",
"description": "List of words to use to replace path elements of file names in the output with so the output isn't directly traceable to its intended purpose.When the list is exhausted, the anon reporter will use random strings patterned after the original file name in stead. The list is empty by default. Read more in https://github.com/sverweij/dependency-cruiser/blob/develop/doc/cli.md#anon---obfuscated-json",
"items": { "type": "string" }
}
}
},
"MetricsReporterOptionsType": {
"type": "object",
"description": "Options to tweak the output of the metrics reporter",
"additionalProperties": false,
"properties": {
"orderBy": {
"type": "string",
"enum": [
"instability",
"moduleCount",
"afferentCouplings",
"efferentCouplings",
"name"
],
"description": "By what attribute (in addition to the names of the folders/ modules) to order the metrics by. Defaults to 'instability'."
},
"hideModules": {
"type": "boolean",
"description": "When true hides module metrics from the report. Defaults to false"
},
"hideFolders": {
"type": "boolean",
"description": "When true hides folder metrics from the report. Defaults to false"
}
}
},
"DotReporterOptionsType": {
"type": "object",
"description": "Options to tweak the output of the dot reporters",
"additionalProperties": false,
"properties": {
"collapsePattern": {
"description": "Regular expressions to collapse to. For the \"dot\" reporter defaults to null, but \"node_modules/[^/]+\" is recommended for most use cases.",
"$ref": "#/definitions/REAsStringsType"
},
"filters": { "$ref": "#/definitions/ReporterFiltersType" },
"showMetrics": {
"description": "When passed the value 'true', shows instability metrics in the output if dependency-cruiser calculated them. Doesn't show them in all other cases. Defaults to false",
"type": "boolean"
},
"theme": { "$ref": "#/definitions/DotThemeType" }
}
},
"DotThemeType": {
"type": "object",
"description": "A bunch of criteria to conditionally theme the dot output",
"additionalProperties": false,
"properties": {
"replace": {
"type": "boolean",
"description": "If passed with the value 'true', the passed theme replaces the default one. In all other cases it extends the default theme."
},
"graph": {
"description": "Name- value pairs of GraphViz dot (global) attributes.",
"type": "object"
},
"node": {
"description": "Name- value pairs of GraphViz dot node attributes.",
"type": "object"
},
"edge": {
"description": "Name- value pairs of GraphViz dot edge attributes.",
"type": "object"
},
"modules": {
"description": "List of criteria and attributes to apply for modules when the criteria are met. Conditions can use any module attribute. Attributes can be any that are valid in GraphViz dot nodes.",
"$ref": "#/definitions/DotThemeArrayType"
},
"dependencies": {
"description": "List of criteria and attributes to apply for dependencies when the criteria are met. Conditions can use any dependency attribute. Attributes can be any that are valid in GraphViz dot edges.",
"$ref": "#/definitions/DotThemeArrayType"
}
}
},
"DotThemeArrayType": {
"type": "array",
"items": { "$ref": "#/definitions/DotThemeEntryType" }
},
"DotThemeEntryType": {
"type": "object",
"additionalProperties": false,
"properties": {
"criteria": { "type": "object" },
"attributes": { "type": "object" }
}
},
"ReporterFiltersType": {
"type": "object",
"description": "filters to apply to the reporter before rendering it (e.g. to leave out details from the graphical output that are not relevant for the goal of the report)",
"additionalProperties": false,
"properties": {
"exclude": { "$ref": "#/definitions/CompoundExcludeType" },
"includeOnly": { "$ref": "#/definitions/CompoundIncludeOnlyType" },
"focus": { "$ref": "#/definitions/CompoundFocusType" }
}
},
"ViolationsType": {
"type": "array",
"description": "A list of violations found in the dependencies. The dependencies themselves also contain this information, this summary is here for convenience.",
"items": { "$ref": "#/definitions/ViolationType" }
},
"ViolationType": {
"type": "object",
"required": ["from", "to", "rule"],
"additionalProperties": false,
"properties": {
"from": { "type": "string" },
"to": { "type": "string" },
"rule": { "$ref": "#/definitions/RuleSummaryType" },
"cycle": {
"type": "array",
"items": { "type": "string" },
"description": "The circular path if the violation is about circularity"
},
"via": {
"type": "array",
"items": { "type": "string" },
"description": "The path from the from to the to if the violation is transitive"
}
}
},
"RuleSummaryType": {
"type": "object",
"description": "If there was a rule violation (valid === false), this object contains the name of the rule and severity of violating it.",
"required": ["name", "severity"],
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"description": "The (short, eslint style) name of the violated rule. Typically something like 'no-core-punycode' or 'no-outside-deps'."
},
"severity": { "$ref": "#/definitions/SeverityType" }
}
},
"ExtendsType": {
"description": "A configuration (or an array of configurations) this configuration uses as a base",
"oneOf": [
{ "type": "string" },
{ "type": "array", "items": { "type": "string" } }
]
}
}
}