dependency-cruiser 10.0.2 → 10.0.6
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/bin/depcruise-fmt.js +3 -3
- package/bin/dependency-cruise.js +3 -3
- package/bin/wrap-stream-in-html.js +1 -5
- package/package.json +32 -55
- package/src/cli/defaults.js +15 -0
- package/src/cli/format.js +0 -1
- package/src/cli/index.js +1 -1
- package/src/cli/init-config/config.js.template.js +1 -106
- package/src/cli/init-config/index.js +3 -2
- package/src/cli/init-config/normalize-init-options.js +2 -2
- package/src/cli/init-config/write-config.js +3 -2
- package/src/cli/init-config/write-run-scripts-to-manifest.js +1 -1
- package/src/cli/normalize-options.js +1 -1
- package/src/cli/tools/wrap-stream-in-html.js +25 -20
- package/src/cli/validate-node-environment.js +3 -3
- package/src/config-utl/extract-babel-config.js +2 -3
- package/src/config-utl/extract-ts-config.js +5 -7
- package/src/enrich/derive/reachable/index.js +2 -8
- package/src/extract/ast-extractors/extract-typescript-deps.js +4 -7
- package/src/extract/ast-extractors/swc-dependency-visitor.js +14 -11
- package/src/extract/parse/to-swc-ast.js +3 -4
- package/src/extract/parse/to-typescript-ast.js +3 -4
- package/src/extract/transpile/babel-wrap.js +2 -2
- package/src/extract/transpile/coffeescript-wrap.js +5 -4
- package/src/extract/transpile/livescript-wrap.js +5 -5
- package/src/extract/transpile/meta.js +1 -1
- package/src/extract/transpile/svelte-wrap.js +3 -1
- package/src/extract/transpile/typescript-wrap.js +3 -4
- package/src/extract/transpile/vue-template-wrap.js +3 -1
- package/src/main/index.js +1 -1
- package/src/main/options/defaults.js +10 -0
- package/src/main/options/normalize.js +1 -1
- package/src/main/rule-set/validate.js +1 -1
- package/src/meta.js +18 -0
- package/src/report/dot/default-theme.js +145 -0
- package/src/report/dot/dot.template.js +1 -199
- package/src/report/dot/theming.js +3 -3
- package/src/report/error-html/error-html.template.js +1 -132
- package/src/report/error-html/utl.js +1 -1
- package/src/report/html/html.template.js +1 -118
- package/src/schema/README.md +2 -2
- package/src/schema/configuration.schema.js +441 -0
- package/src/schema/cruise-result.schema.js +595 -0
- package/src/cli/defaults.json +0 -15
- package/src/main/options/defaults.json +0 -10
- package/src/report/dot/default-theme.json +0 -145
- package/src/schema/configuration.schema.json +0 -697
- package/src/schema/cruise-result.schema.json +0 -988
|
@@ -1,697 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"title": "dependency-cruiser configuration",
|
|
3
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
-
"$id": "https://dependency-cruiser.js.org/schema/configuration.schema.json",
|
|
5
|
-
"description": "A set of properties describing what dependencies are forbidden and what dependencies are allowed + options on how to cruise through the code",
|
|
6
|
-
"type": "object",
|
|
7
|
-
"additionalProperties": false,
|
|
8
|
-
"properties": {
|
|
9
|
-
"$schema": { "type": "string" },
|
|
10
|
-
"forbidden": {
|
|
11
|
-
"type": "array",
|
|
12
|
-
"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.",
|
|
13
|
-
"items": { "$ref": "#/definitions/ForbiddenRuleType" }
|
|
14
|
-
},
|
|
15
|
-
"allowed": {
|
|
16
|
-
"type": "array",
|
|
17
|
-
"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.",
|
|
18
|
-
"items": { "$ref": "#/definitions/AllowedRuleType" }
|
|
19
|
-
},
|
|
20
|
-
"allowedSeverity": {
|
|
21
|
-
"$ref": "#/definitions/SeverityType",
|
|
22
|
-
"description": "Severity to use when a dependency is not in the 'allowed' set of rules. Defaults to 'warn'"
|
|
23
|
-
},
|
|
24
|
-
"required": {
|
|
25
|
-
"type": "array",
|
|
26
|
-
"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",
|
|
27
|
-
"items": { "$ref": "#/definitions/RequiredRuleType" }
|
|
28
|
-
},
|
|
29
|
-
"options": { "$ref": "#/definitions/OptionsType" },
|
|
30
|
-
"extends": { "$ref": "#/definitions/ExtendsType" }
|
|
31
|
-
},
|
|
32
|
-
"definitions": {
|
|
33
|
-
"RuleSetType": {
|
|
34
|
-
"type": "object",
|
|
35
|
-
"additionalProperties": false,
|
|
36
|
-
"properties": {
|
|
37
|
-
"forbidden": {
|
|
38
|
-
"type": "array",
|
|
39
|
-
"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.",
|
|
40
|
-
"items": { "$ref": "#/definitions/ForbiddenRuleType" }
|
|
41
|
-
},
|
|
42
|
-
"allowed": {
|
|
43
|
-
"type": "array",
|
|
44
|
-
"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.",
|
|
45
|
-
"items": { "$ref": "#/definitions/AllowedRuleType" }
|
|
46
|
-
},
|
|
47
|
-
"allowedSeverity": {
|
|
48
|
-
"$ref": "#/definitions/SeverityType",
|
|
49
|
-
"description": "Severity to use when a dependency is not in the 'allowed' set of rules. Defaults to 'warn'"
|
|
50
|
-
},
|
|
51
|
-
"required": {
|
|
52
|
-
"type": "array",
|
|
53
|
-
"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",
|
|
54
|
-
"items": { "$ref": "#/definitions/RequiredRuleType" }
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
"AllowedRuleType": {
|
|
59
|
-
"oneOf": [
|
|
60
|
-
{ "$ref": "#/definitions/RegularAllowedRuleType" },
|
|
61
|
-
{ "$ref": "#/definitions/ReachabilityAllowedRuleType" }
|
|
62
|
-
]
|
|
63
|
-
},
|
|
64
|
-
"RegularAllowedRuleType": {
|
|
65
|
-
"type": "object",
|
|
66
|
-
"required": ["from", "to"],
|
|
67
|
-
"additionalProperties": false,
|
|
68
|
-
"properties": {
|
|
69
|
-
"comment": { "type": "string" },
|
|
70
|
-
"from": { "$ref": "#/definitions/FromRestrictionType" },
|
|
71
|
-
"to": { "$ref": "#/definitions/ToRestrictionType" }
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
"ReachabilityAllowedRuleType": {
|
|
75
|
-
"type": "object",
|
|
76
|
-
"required": ["from", "to"],
|
|
77
|
-
"additionalProperties": false,
|
|
78
|
-
"properties": {
|
|
79
|
-
"comment": { "type": "string" },
|
|
80
|
-
"from": { "$ref": "#/definitions/ReachabilityFromRestrictionType" },
|
|
81
|
-
"to": { "$ref": "#/definitions/ReachabilityToRestrictionType" }
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
"ForbiddenRuleType": {
|
|
85
|
-
"oneOf": [
|
|
86
|
-
{ "$ref": "#/definitions/RegularForbiddenRuleType" },
|
|
87
|
-
{ "$ref": "#/definitions/ReachabilityForbiddenRuleType" },
|
|
88
|
-
{ "$ref": "#/definitions/DependentsForbiddenRuleType" }
|
|
89
|
-
]
|
|
90
|
-
},
|
|
91
|
-
"RegularForbiddenRuleType": {
|
|
92
|
-
"type": "object",
|
|
93
|
-
"required": ["from", "to"],
|
|
94
|
-
"additionalProperties": false,
|
|
95
|
-
"properties": {
|
|
96
|
-
"name": {
|
|
97
|
-
"type": "string",
|
|
98
|
-
"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."
|
|
99
|
-
},
|
|
100
|
-
"severity": { "$ref": "#/definitions/SeverityType" },
|
|
101
|
-
"comment": {
|
|
102
|
-
"type": "string",
|
|
103
|
-
"description": "You can use this field to document why the rule is there."
|
|
104
|
-
},
|
|
105
|
-
"from": { "$ref": "#/definitions/FromRestrictionType" },
|
|
106
|
-
"to": { "$ref": "#/definitions/ToRestrictionType" }
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
"DependentsForbiddenRuleType": {
|
|
110
|
-
"type": "object",
|
|
111
|
-
"required": ["module", "from"],
|
|
112
|
-
"additionalProperties": false,
|
|
113
|
-
"properties": {
|
|
114
|
-
"name": { "type": "string" },
|
|
115
|
-
"severity": { "$ref": "#/definitions/SeverityType" },
|
|
116
|
-
"comment": { "type": "string" },
|
|
117
|
-
"module": { "$ref": "#/definitions/DependentsModuleRestrictionType" },
|
|
118
|
-
"from": { "$ref": "#/definitions/DependentsFromRestrictionType" }
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
"ReachabilityForbiddenRuleType": {
|
|
122
|
-
"type": "object",
|
|
123
|
-
"required": ["from", "to"],
|
|
124
|
-
"additionalProperties": false,
|
|
125
|
-
"properties": {
|
|
126
|
-
"name": { "type": "string" },
|
|
127
|
-
"severity": { "$ref": "#/definitions/SeverityType" },
|
|
128
|
-
"comment": { "type": "string" },
|
|
129
|
-
"from": { "$ref": "#/definitions/ReachabilityFromRestrictionType" },
|
|
130
|
-
"to": { "$ref": "#/definitions/ReachabilityToRestrictionType" }
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
"RequiredRuleType": {
|
|
134
|
-
"type": "object",
|
|
135
|
-
"required": ["module", "to"],
|
|
136
|
-
"additionalProperties": false,
|
|
137
|
-
"properties": {
|
|
138
|
-
"name": { "type": "string" },
|
|
139
|
-
"severity": { "$ref": "#/definitions/SeverityType" },
|
|
140
|
-
"comment": { "type": "string" },
|
|
141
|
-
"module": { "$ref": "#/definitions/RequiredModuleRestrictionType" },
|
|
142
|
-
"to": { "$ref": "#/definitions/RequiredToRestrictionType" }
|
|
143
|
-
}
|
|
144
|
-
},
|
|
145
|
-
"FromRestrictionType": {
|
|
146
|
-
"type": "object",
|
|
147
|
-
"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.",
|
|
148
|
-
"additionalProperties": false,
|
|
149
|
-
"properties": {
|
|
150
|
-
"path": {
|
|
151
|
-
"description": "A regular expression or an array of regular expressions an end of a dependency should match to be caught by this rule.",
|
|
152
|
-
"$ref": "#/definitions/REAsStringsType"
|
|
153
|
-
},
|
|
154
|
-
"pathNot": {
|
|
155
|
-
"description": "A regular expression or an array of regular expressions an end of a dependency should NOT match to be caught by this rule.",
|
|
156
|
-
"$ref": "#/definitions/REAsStringsType"
|
|
157
|
-
},
|
|
158
|
-
"orphan": {
|
|
159
|
-
"type": "boolean",
|
|
160
|
-
"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."
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
"ReachabilityFromRestrictionType": {
|
|
165
|
-
"type": "object",
|
|
166
|
-
"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.",
|
|
167
|
-
"additionalProperties": false,
|
|
168
|
-
"properties": {
|
|
169
|
-
"path": {
|
|
170
|
-
"description": "A regular expression or an array of regular expressions an end of a dependency should match to be caught by this rule.",
|
|
171
|
-
"$ref": "#/definitions/REAsStringsType"
|
|
172
|
-
},
|
|
173
|
-
"pathNot": {
|
|
174
|
-
"description": "A regular expression or an array of regular expressions an end of a dependency should NOT match to be caught by this rule.",
|
|
175
|
-
"$ref": "#/definitions/REAsStringsType"
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
},
|
|
179
|
-
"ToRestrictionType": {
|
|
180
|
-
"type": "object",
|
|
181
|
-
"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.",
|
|
182
|
-
"additionalProperties": false,
|
|
183
|
-
"properties": {
|
|
184
|
-
"path": {
|
|
185
|
-
"description": "A regular expression or an array of regular expressions an end of a dependency should match to be caught by this rule.",
|
|
186
|
-
"$ref": "#/definitions/REAsStringsType"
|
|
187
|
-
},
|
|
188
|
-
"pathNot": {
|
|
189
|
-
"description": "A regular expression or an array of regular expressions an end of a dependency should NOT match to be caught by this rule.",
|
|
190
|
-
"$ref": "#/definitions/REAsStringsType"
|
|
191
|
-
},
|
|
192
|
-
"couldNotResolve": {
|
|
193
|
-
"type": "boolean",
|
|
194
|
-
"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."
|
|
195
|
-
},
|
|
196
|
-
"circular": {
|
|
197
|
-
"type": "boolean",
|
|
198
|
-
"description": "Whether or not to match when following to the to will ultimately end up in the from."
|
|
199
|
-
},
|
|
200
|
-
"dynamic": {
|
|
201
|
-
"type": "boolean",
|
|
202
|
-
"description": "Whether or not to match when the dependency is a dynamic one."
|
|
203
|
-
},
|
|
204
|
-
"exoticallyRequired": {
|
|
205
|
-
"type": "boolean",
|
|
206
|
-
"description": "Whether or not to match when the dependency is exotically required."
|
|
207
|
-
},
|
|
208
|
-
"exoticRequire": {
|
|
209
|
-
"description": "A regular expression to match against any 'exotic' require strings",
|
|
210
|
-
"$ref": "#/definitions/REAsStringsType"
|
|
211
|
-
},
|
|
212
|
-
"exoticRequireNot": {
|
|
213
|
-
"description": "A regular expression to match against any 'exotic' require strings - when it should NOT be caught by the rule",
|
|
214
|
-
"$ref": "#/definitions/REAsStringsType"
|
|
215
|
-
},
|
|
216
|
-
"preCompilationOnly": {
|
|
217
|
-
"type": "boolean",
|
|
218
|
-
"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'."
|
|
219
|
-
},
|
|
220
|
-
"dependencyTypes": {
|
|
221
|
-
"type": "array",
|
|
222
|
-
"description": "Whether or not to match modules of any of these types (leaving out matches any of them)",
|
|
223
|
-
"items": { "$ref": "#/definitions/DependencyTypeType" }
|
|
224
|
-
},
|
|
225
|
-
"moreThanOneDependencyType": {
|
|
226
|
-
"type": "boolean",
|
|
227
|
-
"description": "If true matches dependencies with more than one dependency type (e.g. defined in _both_ npm and npm-dev)"
|
|
228
|
-
},
|
|
229
|
-
"license": {
|
|
230
|
-
"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\"",
|
|
231
|
-
"$ref": "#/definitions/REAsStringsType"
|
|
232
|
-
},
|
|
233
|
-
"licenseNot": {
|
|
234
|
-
"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",
|
|
235
|
-
"$ref": "#/definitions/REAsStringsType"
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
},
|
|
239
|
-
"DependentsModuleRestrictionType": {
|
|
240
|
-
"description": "Criteria to select the module(s) this restriction should apply to",
|
|
241
|
-
"required": [],
|
|
242
|
-
"type": "object",
|
|
243
|
-
"additionalProperties": false,
|
|
244
|
-
"properties": {
|
|
245
|
-
"path": {
|
|
246
|
-
"description": "A regular expression or an array of regular expressions an end of a dependency should match to be caught by this rule.",
|
|
247
|
-
"$ref": "#/definitions/REAsStringsType"
|
|
248
|
-
},
|
|
249
|
-
"pathNot": {
|
|
250
|
-
"description": "A regular expression or an array of regular expressions an end of a dependency should NOT match to be caught by this rule.",
|
|
251
|
-
"$ref": "#/definitions/REAsStringsType"
|
|
252
|
-
},
|
|
253
|
-
"numberOfDependentsLessThan": {
|
|
254
|
-
"type": "integer",
|
|
255
|
-
"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.",
|
|
256
|
-
"minimum": 0,
|
|
257
|
-
"maximum": 100
|
|
258
|
-
},
|
|
259
|
-
"numberOfDependentsMoreThan": {
|
|
260
|
-
"type": "integer",
|
|
261
|
-
"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.",
|
|
262
|
-
"minimum": 0,
|
|
263
|
-
"maximum": 100
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
},
|
|
267
|
-
"DependentsFromRestrictionType": {
|
|
268
|
-
"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.",
|
|
269
|
-
"required": [],
|
|
270
|
-
"type": "object",
|
|
271
|
-
"additionalProperties": false,
|
|
272
|
-
"properties": {
|
|
273
|
-
"path": {
|
|
274
|
-
"description": "A regular expression or an array of regular expressions an end of a dependency should match to be caught by this rule.",
|
|
275
|
-
"$ref": "#/definitions/REAsStringsType"
|
|
276
|
-
},
|
|
277
|
-
"pathNot": {
|
|
278
|
-
"description": "A regular expression or an array of regular expressions an end of a dependency should NOT match to be caught by this rule.",
|
|
279
|
-
"$ref": "#/definitions/REAsStringsType"
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
},
|
|
283
|
-
"ReachabilityToRestrictionType": {
|
|
284
|
-
"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.",
|
|
285
|
-
"required": ["reachable"],
|
|
286
|
-
"type": "object",
|
|
287
|
-
"additionalProperties": false,
|
|
288
|
-
"properties": {
|
|
289
|
-
"path": {
|
|
290
|
-
"description": "A regular expression or an array of regular expressions an end of a dependency should match to be caught by this rule.",
|
|
291
|
-
"$ref": "#/definitions/REAsStringsType"
|
|
292
|
-
},
|
|
293
|
-
"pathNot": {
|
|
294
|
-
"description": "A regular expression or an array of regular expressions an end of a dependency should NOT match to be caught by this rule.",
|
|
295
|
-
"$ref": "#/definitions/REAsStringsType"
|
|
296
|
-
},
|
|
297
|
-
"reachable": {
|
|
298
|
-
"type": "boolean",
|
|
299
|
-
"description": "Whether or not to match modules that aren't reachable from the from part of the rule."
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
},
|
|
303
|
-
"RequiredModuleRestrictionType": {
|
|
304
|
-
"description": "Criteria to select the module(s) this restriction should apply to",
|
|
305
|
-
"required": [],
|
|
306
|
-
"type": "object",
|
|
307
|
-
"additionalProperties": false,
|
|
308
|
-
"properties": {
|
|
309
|
-
"path": {
|
|
310
|
-
"description": "A regular expression or an array of regular expressions an end of a dependency should match to be caught by this rule.",
|
|
311
|
-
"$ref": "#/definitions/REAsStringsType"
|
|
312
|
-
},
|
|
313
|
-
"pathNot": {
|
|
314
|
-
"description": "A regular expression or an array of regular expressions an end of a dependency should NOT match to be caught by this rule.",
|
|
315
|
-
"$ref": "#/definitions/REAsStringsType"
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
},
|
|
319
|
-
"RequiredToRestrictionType": {
|
|
320
|
-
"description": "Criteria for modules the associated module must depend on.",
|
|
321
|
-
"required": [],
|
|
322
|
-
"type": "object",
|
|
323
|
-
"additionalProperties": false,
|
|
324
|
-
"properties": {
|
|
325
|
-
"path": {
|
|
326
|
-
"description": "Criteria at least one dependency of each matching module mustadhere to.",
|
|
327
|
-
"$ref": "#/definitions/REAsStringsType"
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
},
|
|
331
|
-
"DependencyTypeType": {
|
|
332
|
-
"type": "string",
|
|
333
|
-
"enum": [
|
|
334
|
-
"aliased",
|
|
335
|
-
"core",
|
|
336
|
-
"deprecated",
|
|
337
|
-
"local",
|
|
338
|
-
"localmodule",
|
|
339
|
-
"npm",
|
|
340
|
-
"npm-bundled",
|
|
341
|
-
"npm-dev",
|
|
342
|
-
"npm-no-pkg",
|
|
343
|
-
"npm-optional",
|
|
344
|
-
"npm-peer",
|
|
345
|
-
"npm-unknown",
|
|
346
|
-
"undetermined",
|
|
347
|
-
"unknown"
|
|
348
|
-
]
|
|
349
|
-
},
|
|
350
|
-
"REAsStringsType": {
|
|
351
|
-
"oneOf": [
|
|
352
|
-
{ "type": "string" },
|
|
353
|
-
{ "type": "array", "items": { "type": "string" } }
|
|
354
|
-
]
|
|
355
|
-
},
|
|
356
|
-
"SeverityType": {
|
|
357
|
-
"type": "string",
|
|
358
|
-
"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.",
|
|
359
|
-
"enum": ["error", "warn", "info", "ignore"]
|
|
360
|
-
},
|
|
361
|
-
"OptionsType": {
|
|
362
|
-
"type": "object",
|
|
363
|
-
"description": "Runtime configuration options",
|
|
364
|
-
"additionalProperties": false,
|
|
365
|
-
"properties": {
|
|
366
|
-
"doNotFollow": {
|
|
367
|
-
"description": "a regular expression for modules to include, but not follow further",
|
|
368
|
-
"oneOf": [
|
|
369
|
-
{ "$ref": "#/definitions/REAsStringsType" },
|
|
370
|
-
{ "$ref": "#/definitions/CompoundDoNotFollowType" }
|
|
371
|
-
]
|
|
372
|
-
},
|
|
373
|
-
"exclude": {
|
|
374
|
-
"description": "a regular expression for modules to exclude from being cruised",
|
|
375
|
-
"oneOf": [
|
|
376
|
-
{ "$ref": "#/definitions/REAsStringsType" },
|
|
377
|
-
{ "$ref": "#/definitions/CompoundExcludeType" }
|
|
378
|
-
]
|
|
379
|
-
},
|
|
380
|
-
"includeOnly": {
|
|
381
|
-
"description": "a regular expression for modules to cruise; anything outside it will be skipped",
|
|
382
|
-
"oneOf": [
|
|
383
|
-
{ "$ref": "#/definitions/REAsStringsType" },
|
|
384
|
-
{ "$ref": "#/definitions/CompoundIncludeOnlyType" }
|
|
385
|
-
]
|
|
386
|
-
},
|
|
387
|
-
"focus": {
|
|
388
|
-
"description": "dependency-cruiser will include modules matching this regular expression in its output, as well as their neighbours (direct dependencies and dependents)",
|
|
389
|
-
"oneOf": [
|
|
390
|
-
{ "$ref": "#/definitions/REAsStringsType" },
|
|
391
|
-
{ "$ref": "#/definitions/CompoundFocusType" }
|
|
392
|
-
]
|
|
393
|
-
},
|
|
394
|
-
"collapse": {
|
|
395
|
-
"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.",
|
|
396
|
-
"oneOf": [
|
|
397
|
-
{ "type": "string" },
|
|
398
|
-
{ "type": "integer", "minimum": 1, "maximum": 9 }
|
|
399
|
-
]
|
|
400
|
-
},
|
|
401
|
-
"maxDepth": {
|
|
402
|
-
"type": "integer",
|
|
403
|
-
"minimum": 0,
|
|
404
|
-
"maximum": 99,
|
|
405
|
-
"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."
|
|
406
|
-
},
|
|
407
|
-
"moduleSystems": { "$ref": "#/definitions/ModuleSystemsType" },
|
|
408
|
-
"prefix": { "type": "string" },
|
|
409
|
-
"preserveSymlinks": {
|
|
410
|
-
"type": "boolean",
|
|
411
|
-
"description": "if true leave symlinks untouched, otherwise use the realpath. Defaults to `false` (which is also nodejs's default behavior since version 6)"
|
|
412
|
-
},
|
|
413
|
-
"combinedDependencies": {
|
|
414
|
-
"type": "boolean",
|
|
415
|
-
"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`."
|
|
416
|
-
},
|
|
417
|
-
"tsConfig": {
|
|
418
|
-
"type": "object",
|
|
419
|
-
"additionalProperties": false,
|
|
420
|
-
"description": "TypeScript project file ('tsconfig.json') to use for (1) compilation and (2) resolution (e.g. with the paths property)",
|
|
421
|
-
"properties": {
|
|
422
|
-
"fileName": {
|
|
423
|
-
"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'.",
|
|
424
|
-
"type": "string"
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
},
|
|
428
|
-
"tsPreCompilationDeps": {
|
|
429
|
-
"description": "if true detect dependencies that only exist before typescript-to-javascript compilation.",
|
|
430
|
-
"oneOf": [
|
|
431
|
-
{ "type": "boolean" },
|
|
432
|
-
{ "type": "string", "enum": ["specify"] }
|
|
433
|
-
]
|
|
434
|
-
},
|
|
435
|
-
"externalModuleResolutionStrategy": {
|
|
436
|
-
"type": "string",
|
|
437
|
-
"description": "What external module resolution strategy to use. Defaults to 'node_modules' (not used anymore - module resolution strategy determination is automatic now)",
|
|
438
|
-
"enum": ["node_modules", "yarn-pnp"]
|
|
439
|
-
},
|
|
440
|
-
"forceDeriveDependents": {
|
|
441
|
-
"type": "boolean",
|
|
442
|
-
"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."
|
|
443
|
-
},
|
|
444
|
-
"webpackConfig": {
|
|
445
|
-
"type": "object",
|
|
446
|
-
"additionalProperties": false,
|
|
447
|
-
"description": "Webpack configuration to use to get resolve options from",
|
|
448
|
-
"properties": {
|
|
449
|
-
"fileName": {
|
|
450
|
-
"type": "string",
|
|
451
|
-
"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'."
|
|
452
|
-
},
|
|
453
|
-
"env": {
|
|
454
|
-
"description": "Environment to pass if your config file returns a function",
|
|
455
|
-
"oneOf": [{ "type": "object" }, { "type": "string" }]
|
|
456
|
-
},
|
|
457
|
-
"arguments": {
|
|
458
|
-
"type": "object",
|
|
459
|
-
"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"
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
},
|
|
463
|
-
"enhancedResolveOptions": {
|
|
464
|
-
"type": "object",
|
|
465
|
-
"additionalProperties": false,
|
|
466
|
-
"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.",
|
|
467
|
-
"properties": {
|
|
468
|
-
"exportsFields": {
|
|
469
|
-
"type": "array",
|
|
470
|
-
"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).",
|
|
471
|
-
"items": { "type": "string" }
|
|
472
|
-
},
|
|
473
|
-
"conditionNames": {
|
|
474
|
-
"type": "array",
|
|
475
|
-
"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",
|
|
476
|
-
"items": { "type": "string" }
|
|
477
|
-
},
|
|
478
|
-
"extensions": {
|
|
479
|
-
"type": "array",
|
|
480
|
-
"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.",
|
|
481
|
-
"items": { "type": "string" }
|
|
482
|
-
},
|
|
483
|
-
"cachedInputFileSystem": {
|
|
484
|
-
"type": "object",
|
|
485
|
-
"description": "Options to pass to the resolver (webpack's 'enhanced resolve') regardingcaching.",
|
|
486
|
-
"additionalProperties": false,
|
|
487
|
-
"properties": {
|
|
488
|
-
"cacheDuration": {
|
|
489
|
-
"type": "integer",
|
|
490
|
-
"minimum": 0,
|
|
491
|
-
"maximum": 1800000,
|
|
492
|
-
"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."
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
},
|
|
498
|
-
"babelConfig": {
|
|
499
|
-
"type": "object",
|
|
500
|
-
"additionalProperties": false,
|
|
501
|
-
"description": "Babel configuration (e.g. '.babelrc.json') to use.",
|
|
502
|
-
"properties": {
|
|
503
|
-
"fileName": {
|
|
504
|
-
"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.",
|
|
505
|
-
"type": "string"
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
},
|
|
509
|
-
"parser": {
|
|
510
|
-
"type": "string",
|
|
511
|
-
"description": "overrides the parser dependency-cruiser will use - EXPERIMENTAL",
|
|
512
|
-
"enum": ["acorn", "swc", "tsc"]
|
|
513
|
-
},
|
|
514
|
-
"exoticRequireStrings": {
|
|
515
|
-
"type": "array",
|
|
516
|
-
"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",
|
|
517
|
-
"items": { "type": "string" }
|
|
518
|
-
},
|
|
519
|
-
"reporterOptions": { "$ref": "#/definitions/ReporterOptionsType" },
|
|
520
|
-
"progress": {
|
|
521
|
-
"type": "object",
|
|
522
|
-
"additionalProperties": false,
|
|
523
|
-
"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.",
|
|
524
|
-
"properties": {
|
|
525
|
-
"type": {
|
|
526
|
-
"type": "string",
|
|
527
|
-
"enum": ["cli-feedback", "performance-log", "none"]
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
},
|
|
531
|
-
"baseDir": {
|
|
532
|
-
"type": "string",
|
|
533
|
-
"description": "The directory dependency-cruiser should run its cruise from. Defaults to the current working directory."
|
|
534
|
-
}
|
|
535
|
-
}
|
|
536
|
-
},
|
|
537
|
-
"ModuleSystemType": {
|
|
538
|
-
"type": "string",
|
|
539
|
-
"enum": ["cjs", "es6", "amd", "tsd"]
|
|
540
|
-
},
|
|
541
|
-
"ModuleSystemsType": {
|
|
542
|
-
"type": "array",
|
|
543
|
-
"description": "List of module systems to cruise. Defaults to [amd, cjs, es6]",
|
|
544
|
-
"items": { "$ref": "#/definitions/ModuleSystemType" }
|
|
545
|
-
},
|
|
546
|
-
"CompoundExcludeType": {
|
|
547
|
-
"type": "object",
|
|
548
|
-
"description": "Criteria for dependencies to exclude",
|
|
549
|
-
"additionalProperties": false,
|
|
550
|
-
"properties": {
|
|
551
|
-
"path": {
|
|
552
|
-
"description": "a regular expression for modules to exclude from being cruised",
|
|
553
|
-
"$ref": "#/definitions/REAsStringsType"
|
|
554
|
-
},
|
|
555
|
-
"dynamic": {
|
|
556
|
-
"type": "boolean",
|
|
557
|
-
"description": "a boolean indicating whether or not to exclude dynamic dependencies"
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
},
|
|
561
|
-
"CompoundDoNotFollowType": {
|
|
562
|
-
"type": "object",
|
|
563
|
-
"description": "Criteria for modules to include, but not to follow further",
|
|
564
|
-
"additionalProperties": false,
|
|
565
|
-
"properties": {
|
|
566
|
-
"path": {
|
|
567
|
-
"description": "a regular expression for modules to include, but not follow further",
|
|
568
|
-
"$ref": "#/definitions/REAsStringsType"
|
|
569
|
-
},
|
|
570
|
-
"dependencyTypes": {
|
|
571
|
-
"type": "array",
|
|
572
|
-
"description": "an array of dependency types to include, but not follow further",
|
|
573
|
-
"items": { "$ref": "#/definitions/DependencyTypeType" }
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
},
|
|
577
|
-
"CompoundIncludeOnlyType": {
|
|
578
|
-
"type": "object",
|
|
579
|
-
"description": "Criteria for modules to only include",
|
|
580
|
-
"additionalProperties": false,
|
|
581
|
-
"properties": {
|
|
582
|
-
"path": {
|
|
583
|
-
"description": "dependency-cruiser will include modules matching this regular expression in its output, as well as their neighbours (direct dependencies and dependents)",
|
|
584
|
-
"$ref": "#/definitions/REAsStringsType"
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
},
|
|
588
|
-
"CompoundFocusType": {
|
|
589
|
-
"type": "object",
|
|
590
|
-
"description": "Criteria for modules to 'focus' on",
|
|
591
|
-
"additionalProperties": false,
|
|
592
|
-
"properties": {
|
|
593
|
-
"path": {
|
|
594
|
-
"description": "dependency-cruiser will include modules matching this regular expression in its output, as well as their neighbours (direct dependencies and dependents)",
|
|
595
|
-
"$ref": "#/definitions/REAsStringsType"
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
|
-
},
|
|
599
|
-
"ReporterOptionsType": {
|
|
600
|
-
"type": "object",
|
|
601
|
-
"description": "Options to tweak the output of reporters",
|
|
602
|
-
"additionalProperties": false,
|
|
603
|
-
"properties": {
|
|
604
|
-
"anon": { "$ref": "#/definitions/AnonReporterOptionsType" },
|
|
605
|
-
"archi": { "$ref": "#/definitions/DotReporterOptionsType" },
|
|
606
|
-
"dot": { "$ref": "#/definitions/DotReporterOptionsType" },
|
|
607
|
-
"ddot": { "$ref": "#/definitions/DotReporterOptionsType" },
|
|
608
|
-
"flat": { "$ref": "#/definitions/DotReporterOptionsType" }
|
|
609
|
-
}
|
|
610
|
-
},
|
|
611
|
-
"AnonReporterOptionsType": {
|
|
612
|
-
"type": "object",
|
|
613
|
-
"description": "Options to tweak the output of the anonymous reporter",
|
|
614
|
-
"additionalProperties": false,
|
|
615
|
-
"properties": {
|
|
616
|
-
"wordlist": {
|
|
617
|
-
"type": "array",
|
|
618
|
-
"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",
|
|
619
|
-
"items": { "type": "string" }
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
},
|
|
623
|
-
"DotReporterOptionsType": {
|
|
624
|
-
"type": "object",
|
|
625
|
-
"description": "Options to tweak the output of the dot reporters",
|
|
626
|
-
"additionalProperties": false,
|
|
627
|
-
"properties": {
|
|
628
|
-
"collapsePattern": {
|
|
629
|
-
"description": "Regular expressions to collapse to. For the \"dot\" reporter defaults to null, but \"node_modules/[^/]+\" is recommended for most use cases.",
|
|
630
|
-
"$ref": "#/definitions/REAsStringsType"
|
|
631
|
-
},
|
|
632
|
-
"filters": { "$ref": "#/definitions/ReporterFiltersType" },
|
|
633
|
-
"theme": { "$ref": "#/definitions/DotThemeType" }
|
|
634
|
-
}
|
|
635
|
-
},
|
|
636
|
-
"DotThemeType": {
|
|
637
|
-
"type": "object",
|
|
638
|
-
"description": "A bunch of criteria to conditionally theme the dot output",
|
|
639
|
-
"additionalProperties": false,
|
|
640
|
-
"properties": {
|
|
641
|
-
"replace": {
|
|
642
|
-
"type": "boolean",
|
|
643
|
-
"description": "If passed with the value 'true', the passed theme replaces the default one. In all other cases it extends the default theme."
|
|
644
|
-
},
|
|
645
|
-
"graph": {
|
|
646
|
-
"description": "Name- value pairs of GraphViz dot (global) attributes.",
|
|
647
|
-
"type": "object"
|
|
648
|
-
},
|
|
649
|
-
"node": {
|
|
650
|
-
"description": "Name- value pairs of GraphViz dot node attributes.",
|
|
651
|
-
"type": "object"
|
|
652
|
-
},
|
|
653
|
-
"edge": {
|
|
654
|
-
"description": "Name- value pairs of GraphViz dot edge attributes.",
|
|
655
|
-
"type": "object"
|
|
656
|
-
},
|
|
657
|
-
"modules": {
|
|
658
|
-
"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.",
|
|
659
|
-
"$ref": "#/definitions/DotThemeArrayType"
|
|
660
|
-
},
|
|
661
|
-
"dependencies": {
|
|
662
|
-
"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.",
|
|
663
|
-
"$ref": "#/definitions/DotThemeArrayType"
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
},
|
|
667
|
-
"DotThemeArrayType": {
|
|
668
|
-
"type": "array",
|
|
669
|
-
"items": { "$ref": "#/definitions/DotThemeEntryType" }
|
|
670
|
-
},
|
|
671
|
-
"DotThemeEntryType": {
|
|
672
|
-
"type": "object",
|
|
673
|
-
"additionalProperties": false,
|
|
674
|
-
"properties": {
|
|
675
|
-
"criteria": { "type": "object" },
|
|
676
|
-
"attributes": { "type": "object" }
|
|
677
|
-
}
|
|
678
|
-
},
|
|
679
|
-
"ReporterFiltersType": {
|
|
680
|
-
"type": "object",
|
|
681
|
-
"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)",
|
|
682
|
-
"additionalProperties": false,
|
|
683
|
-
"properties": {
|
|
684
|
-
"exclude": { "$ref": "#/definitions/CompoundExcludeType" },
|
|
685
|
-
"includeOnly": { "$ref": "#/definitions/CompoundIncludeOnlyType" },
|
|
686
|
-
"focus": { "$ref": "#/definitions/CompoundFocusType" }
|
|
687
|
-
}
|
|
688
|
-
},
|
|
689
|
-
"ExtendsType": {
|
|
690
|
-
"description": "A configuration (or an array of configurations) this configuration uses as a base",
|
|
691
|
-
"oneOf": [
|
|
692
|
-
{ "type": "string" },
|
|
693
|
-
{ "type": "array", "items": { "type": "string" } }
|
|
694
|
-
]
|
|
695
|
-
}
|
|
696
|
-
}
|
|
697
|
-
}
|