annotate .dependency-cruiser.js @ 131:077bd603664b

release v0.5.0
author drewp@bigasterisk.com
date Sat, 06 May 2023 13:53:48 -0700
parents 9a57f8c556d2
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
126
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
1 /** @type {import('dependency-cruiser').IConfiguration} */
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
2 module.exports = {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
3 forbidden: [
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
4 /* rules from the 'recommended' preset: */
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
5 {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
6 name: 'no-circular',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
7 severity: 'warn',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
8 comment:
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
9 'This dependency is part of a circular relationship. You might want to revise ' +
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
10 'your solution (i.e. use dependency inversion, make sure the modules have a single responsibility) ',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
11 from: {},
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
12 to: {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
13 circular: true
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
14 }
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
15 },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
16 {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
17 name: 'no-orphans',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
18 comment:
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
19 "This is an orphan module - it's likely not used (anymore?). Either use it or " +
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
20 "remove it. If it's logical this module is an orphan (i.e. it's a config file), " +
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
21 "add an exception for it in your dependency-cruiser configuration. By default " +
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
22 "this rule does not scrutinize dot-files (e.g. .eslintrc.js), TypeScript declaration " +
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
23 "files (.d.ts), tsconfig.json and some of the babel and webpack configs.",
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
24 severity: 'warn',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
25 from: {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
26 orphan: true,
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
27 pathNot: [
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
28 '(^|/)\\.[^/]+\\.(js|cjs|mjs|ts|json)$', // dot files
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
29 '\\.d\\.ts$', // TypeScript declaration files
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
30 '(^|/)tsconfig\\.json$', // TypeScript config
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
31 '(^|/)(babel|webpack)\\.config\\.(js|cjs|mjs|ts|json)$' // other configs
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
32 ]
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
33 },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
34 to: {},
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
35 },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
36 {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
37 name: 'no-deprecated-core',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
38 comment:
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
39 'A module depends on a node core module that has been deprecated. Find an alternative - these are ' +
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
40 "bound to exist - node doesn't deprecate lightly.",
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
41 severity: 'warn',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
42 from: {},
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
43 to: {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
44 dependencyTypes: [
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
45 'core'
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
46 ],
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
47 path: [
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
48 '^(v8\/tools\/codemap)$',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
49 '^(v8\/tools\/consarray)$',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
50 '^(v8\/tools\/csvparser)$',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
51 '^(v8\/tools\/logreader)$',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
52 '^(v8\/tools\/profile_view)$',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
53 '^(v8\/tools\/profile)$',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
54 '^(v8\/tools\/SourceMap)$',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
55 '^(v8\/tools\/splaytree)$',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
56 '^(v8\/tools\/tickprocessor-driver)$',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
57 '^(v8\/tools\/tickprocessor)$',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
58 '^(node-inspect\/lib\/_inspect)$',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
59 '^(node-inspect\/lib\/internal\/inspect_client)$',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
60 '^(node-inspect\/lib\/internal\/inspect_repl)$',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
61 '^(async_hooks)$',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
62 '^(punycode)$',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
63 '^(domain)$',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
64 '^(constants)$',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
65 '^(sys)$',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
66 '^(_linklist)$',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
67 '^(_stream_wrap)$'
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
68 ],
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
69 }
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
70 },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
71 {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
72 name: 'not-to-deprecated',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
73 comment:
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
74 'This module uses a (version of an) npm module that has been deprecated. Either upgrade to a later ' +
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
75 'version of that module, or find an alternative. Deprecated modules are a security risk.',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
76 severity: 'warn',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
77 from: {},
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
78 to: {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
79 dependencyTypes: [
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
80 'deprecated'
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
81 ]
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
82 }
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
83 },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
84 {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
85 name: 'no-non-package-json',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
86 severity: 'error',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
87 comment:
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
88 "This module depends on an npm package that isn't in the 'dependencies' section of your package.json. " +
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
89 "That's problematic as the package either (1) won't be available on live (2 - worse) will be " +
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
90 "available on live with an non-guaranteed version. Fix it by adding the package to the dependencies " +
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
91 "in your package.json.",
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
92 from: {},
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
93 to: {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
94 dependencyTypes: [
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
95 'npm-no-pkg',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
96 'npm-unknown'
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
97 ]
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
98 }
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
99 },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
100 {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
101 name: 'not-to-unresolvable',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
102 comment:
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
103 "This module depends on a module that cannot be found ('resolved to disk'). If it's an npm " +
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
104 'module: add it to your package.json. In all other cases you likely already know what to do.',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
105 severity: 'error',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
106 from: {},
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
107 to: {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
108 couldNotResolve: true
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
109 }
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
110 },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
111 {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
112 name: 'no-duplicate-dep-types',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
113 comment:
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
114 "Likely this module depends on an external ('npm') package that occurs more than once " +
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
115 "in your package.json i.e. bot as a devDependencies and in dependencies. This will cause " +
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
116 "maintenance problems later on.",
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
117 severity: 'warn',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
118 from: {},
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
119 to: {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
120 moreThanOneDependencyType: true,
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
121 // as it's pretty common to have a type import be a type only import
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
122 // _and_ (e.g.) a devDependency - don't consider type-only dependency
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
123 // types for this rule
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
124 dependencyTypesNot: ["type-only"]
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
125 }
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
126 },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
127
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
128 /* rules you might want to tweak for your specific situation: */
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
129 {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
130 name: 'not-to-spec',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
131 comment:
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
132 'This module depends on a spec (test) file. The sole responsibility of a spec file is to test code. ' +
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
133 "If there's something in a spec that's of use to other modules, it doesn't have that single " +
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
134 'responsibility anymore. Factor it out into (e.g.) a separate utility/ helper or a mock.',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
135 severity: 'error',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
136 from: {},
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
137 to: {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
138 path: '\\.(spec|test)\\.(js|mjs|cjs|ts|ls|coffee|litcoffee|coffee\\.md)$'
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
139 }
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
140 },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
141 {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
142 name: 'not-to-dev-dep',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
143 severity: 'error',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
144 comment:
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
145 "This module depends on an npm package from the 'devDependencies' section of your " +
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
146 'package.json. It looks like something that ships to production, though. To prevent problems ' +
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
147 "with npm packages that aren't there on production declare it (only!) in the 'dependencies'" +
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
148 'section of your package.json. If this module is development only - add it to the ' +
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
149 'from.pathNot re of the not-to-dev-dep rule in the dependency-cruiser configuration',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
150 from: {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
151 path: '^(src)',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
152 pathNot: '\\.(spec|test)\\.(js|mjs|cjs|ts|ls|coffee|litcoffee|coffee\\.md)$'
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
153 },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
154 to: {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
155 dependencyTypes: [
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
156 'npm-dev'
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
157 ]
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
158 }
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
159 },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
160 {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
161 name: 'optional-deps-used',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
162 severity: 'info',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
163 comment:
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
164 "This module depends on an npm package that is declared as an optional dependency " +
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
165 "in your package.json. As this makes sense in limited situations only, it's flagged here. " +
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
166 "If you're using an optional dependency here by design - add an exception to your" +
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
167 "dependency-cruiser configuration.",
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
168 from: {},
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
169 to: {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
170 dependencyTypes: [
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
171 'npm-optional'
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
172 ]
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
173 }
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
174 },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
175 {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
176 name: 'peer-deps-used',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
177 comment:
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
178 "This module depends on an npm package that is declared as a peer dependency " +
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
179 "in your package.json. This makes sense if your package is e.g. a plugin, but in " +
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
180 "other cases - maybe not so much. If the use of a peer dependency is intentional " +
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
181 "add an exception to your dependency-cruiser configuration.",
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
182 severity: 'warn',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
183 from: {},
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
184 to: {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
185 dependencyTypes: [
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
186 'npm-peer'
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
187 ]
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
188 }
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
189 }
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
190 ],
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
191 options: {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
192
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
193 /* conditions specifying which files not to follow further when encountered:
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
194 - path: a regular expression to match
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
195 - dependencyTypes: see https://github.com/sverweij/dependency-cruiser/blob/master/doc/rules-reference.md#dependencytypes-and-dependencytypesnot
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
196 for a complete list
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
197 */
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
198 doNotFollow: {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
199 path: 'node_modules'
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
200 },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
201
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
202 /* conditions specifying which dependencies to exclude
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
203 - path: a regular expression to match
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
204 - dynamic: a boolean indicating whether to ignore dynamic (true) or static (false) dependencies.
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
205 leave out if you want to exclude neither (recommended!)
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
206 */
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
207 exclude : {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
208 path: '.*\.test\.ts',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
209 // dynamic: true
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
210 },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
211
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
212 /* pattern specifying which files to include (regular expression)
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
213 dependency-cruiser will skip everything not matching this pattern
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
214 */
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
215 // includeOnly : '',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
216
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
217 /* dependency-cruiser will include modules matching against the focus
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
218 regular expression in its output, as well as their neighbours (direct
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
219 dependencies and dependents)
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
220 */
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
221 // focus : '',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
222
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
223 /* list of module systems to cruise */
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
224 // moduleSystems: ['amd', 'cjs', 'es6', 'tsd'],
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
225
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
226 /* prefix for links in html and svg output (e.g. 'https://github.com/you/yourrepo/blob/develop/'
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
227 to open it on your online repo or `vscode://file/${process.cwd()}/` to
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
228 open it in visual studio code),
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
229 */
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
230 // prefix: '',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
231
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
232 /* false (the default): ignore dependencies that only exist before typescript-to-javascript compilation
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
233 true: also detect dependencies that only exist before typescript-to-javascript compilation
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
234 "specify": for each dependency identify whether it only exists before compilation or also after
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
235 */
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
236 tsPreCompilationDeps: true,
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
237
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
238 /*
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
239 list of extensions to scan that aren't javascript or compile-to-javascript.
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
240 Empty by default. Only put extensions in here that you want to take into
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
241 account that are _not_ parsable.
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
242 */
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
243 // extraExtensionsToScan: [".json", ".jpg", ".png", ".svg", ".webp"],
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
244
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
245 /* if true combines the package.jsons found from the module up to the base
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
246 folder the cruise is initiated from. Useful for how (some) mono-repos
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
247 manage dependencies & dependency definitions.
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
248 */
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
249 // combinedDependencies: false,
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
250
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
251 /* if true leave symlinks untouched, otherwise use the realpath */
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
252 // preserveSymlinks: false,
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
253
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
254 /* TypeScript project file ('tsconfig.json') to use for
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
255 (1) compilation and
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
256 (2) resolution (e.g. with the paths property)
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
257
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
258 The (optional) fileName attribute specifies which file to take (relative to
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
259 dependency-cruiser's current working directory). When not provided
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
260 defaults to './tsconfig.json'.
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
261 */
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
262 tsConfig: {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
263 fileName: 'tsconfig.json'
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
264 },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
265
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
266 /* Webpack configuration to use to get resolve options from.
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
267
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
268 The (optional) fileName attribute specifies which file to take (relative
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
269 to dependency-cruiser's current working directory. When not provided defaults
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
270 to './webpack.conf.js'.
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
271
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
272 The (optional) `env` and `arguments` attributes contain the parameters to be passed if
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
273 your webpack config is a function and takes them (see webpack documentation
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
274 for details)
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
275 */
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
276 // webpackConfig: {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
277 // fileName: './webpack.config.js',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
278 // env: {},
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
279 // arguments: {},
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
280 // },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
281
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
282 /* Babel config ('.babelrc', '.babelrc.json', '.babelrc.json5', ...) to use
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
283 for compilation (and whatever other naughty things babel plugins do to
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
284 source code). This feature is well tested and usable, but might change
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
285 behavior a bit over time (e.g. more precise results for used module
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
286 systems) without dependency-cruiser getting a major version bump.
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
287 */
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
288 // babelConfig: {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
289 // fileName: './.babelrc'
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
290 // },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
291
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
292 /* List of strings you have in use in addition to cjs/ es6 requires
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
293 & imports to declare module dependencies. Use this e.g. if you've
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
294 re-declared require, use a require-wrapper or use window.require as
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
295 a hack.
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
296 */
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
297 // exoticRequireStrings: [],
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
298 /* options to pass on to enhanced-resolve, the package dependency-cruiser
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
299 uses to resolve module references to disk. You can set most of these
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
300 options in a webpack.conf.js - this section is here for those
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
301 projects that don't have a separate webpack config file.
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
302
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
303 Note: settings in webpack.conf.js override the ones specified here.
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
304 */
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
305 enhancedResolveOptions: {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
306 /* List of strings to consider as 'exports' fields in package.json. Use
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
307 ['exports'] when you use packages that use such a field and your environment
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
308 supports it (e.g. node ^12.19 || >=14.7 or recent versions of webpack).
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
309
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
310 If you have an `exportsFields` attribute in your webpack config, that one
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
311 will have precedence over the one specified here.
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
312 */
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
313 exportsFields: ["exports"],
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
314 /* List of conditions to check for in the exports field. e.g. use ['imports']
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
315 if you're only interested in exposed es6 modules, ['require'] for commonjs,
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
316 or all conditions at once `(['import', 'require', 'node', 'default']`)
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
317 if anything goes for you. Only works when the 'exportsFields' array is
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
318 non-empty.
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
319
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
320 If you have a 'conditionNames' attribute in your webpack config, that one will
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
321 have precedence over the one specified here.
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
322 */
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
323 conditionNames: ["import", "require", "node", "default"],
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
324 /*
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
325 The extensions, by default are the same as the ones dependency-cruiser
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
326 can access (run `npx depcruise --info` to see which ones that are in
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
327 _your_ environment. If that list is larger than what you need (e.g.
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
328 it contains .js, .jsx, .ts, .tsx, .cts, .mts - but you don't use
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
329 TypeScript you can pass just the extensions you actually use (e.g.
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
330 [".js", ".jsx"]). This can speed up the most expensive step in
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
331 dependency cruising (module resolution) quite a bit.
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
332 */
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
333 // extensions: [".js", ".jsx", ".ts", ".tsx", ".d.ts"],
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
334 /*
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
335 If your TypeScript project makes use of types specified in 'types'
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
336 fields in package.jsons of external dependencies, specify "types"
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
337 in addition to "main" in here, so enhanced-resolve (the resolver
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
338 dependency-cruiser uses) knows to also look there. You can also do
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
339 this if you're not sure, but still use TypeScript. In a future version
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
340 of dependency-cruiser this will likely become the default.
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
341 */
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
342 mainFields: ["main", "types"],
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
343 },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
344 reporterOptions: {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
345 dot: {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
346 /* pattern of modules that can be consolidated in the detailed
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
347 graphical dependency graph. The default pattern in this configuration
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
348 collapses everything in node_modules to one folder deep so you see
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
349 the external modules, but not the innards your app depends upon.
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
350 */
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
351 collapsePattern: 'node_modules/(@[^/]+/[^/]+|[^/]+)',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
352
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
353 /* Options to tweak the appearance of your graph.See
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
354 https://github.com/sverweij/dependency-cruiser/blob/master/doc/options-reference.md#reporteroptions
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
355 for details and some examples. If you don't specify a theme
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
356 don't worry - dependency-cruiser will fall back to the default one.
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
357 */
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
358 // theme: {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
359 // graph: {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
360 // /* use splines: "ortho" for straight lines. Be aware though
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
361 // graphviz might take a long time calculating ortho(gonal)
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
362 // routings.
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
363 // */
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
364 // splines: "true"
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
365 // },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
366 // modules: [
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
367 // {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
368 // criteria: { matchesFocus: true },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
369 // attributes: {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
370 // fillcolor: "lime",
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
371 // penwidth: 2,
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
372 // },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
373 // },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
374 // {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
375 // criteria: { matchesFocus: false },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
376 // attributes: {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
377 // fillcolor: "lightgrey",
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
378 // },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
379 // },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
380 // {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
381 // criteria: { matchesReaches: true },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
382 // attributes: {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
383 // fillcolor: "lime",
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
384 // penwidth: 2,
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
385 // },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
386 // },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
387 // {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
388 // criteria: { matchesReaches: false },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
389 // attributes: {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
390 // fillcolor: "lightgrey",
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
391 // },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
392 // },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
393 // {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
394 // criteria: { source: "^src/model" },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
395 // attributes: { fillcolor: "#ccccff" }
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
396 // },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
397 // {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
398 // criteria: { source: "^src/view" },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
399 // attributes: { fillcolor: "#ccffcc" }
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
400 // },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
401 // ],
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
402 // dependencies: [
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
403 // {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
404 // criteria: { "rules[0].severity": "error" },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
405 // attributes: { fontcolor: "red", color: "red" }
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
406 // },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
407 // {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
408 // criteria: { "rules[0].severity": "warn" },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
409 // attributes: { fontcolor: "orange", color: "orange" }
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
410 // },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
411 // {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
412 // criteria: { "rules[0].severity": "info" },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
413 // attributes: { fontcolor: "blue", color: "blue" }
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
414 // },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
415 // {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
416 // criteria: { resolved: "^src/model" },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
417 // attributes: { color: "#0000ff77" }
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
418 // },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
419 // {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
420 // criteria: { resolved: "^src/view" },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
421 // attributes: { color: "#00770077" }
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
422 // }
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
423 // ]
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
424 // }
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
425 },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
426 archi: {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
427 /* pattern of modules that can be consolidated in the high level
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
428 graphical dependency graph. If you use the high level graphical
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
429 dependency graph reporter (`archi`) you probably want to tweak
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
430 this collapsePattern to your situation.
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
431 */
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
432 collapsePattern: '^(packages|src|lib|app|bin|test(s?)|spec(s?))/[^/]+|node_modules/(@[^/]+/[^/]+|[^/]+)',
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
433
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
434 /* Options to tweak the appearance of your graph.See
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
435 https://github.com/sverweij/dependency-cruiser/blob/master/doc/options-reference.md#reporteroptions
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
436 for details and some examples. If you don't specify a theme
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
437 for 'archi' dependency-cruiser will use the one specified in the
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
438 dot section (see above), if any, and otherwise use the default one.
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
439 */
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
440 // theme: {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
441 // },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
442 },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
443 "text": {
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
444 "highlightFocused": true
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
445 },
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
446 }
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
447 }
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
448 };
9a57f8c556d2 add depgraph task
drewp@bigasterisk.com
parents:
diff changeset
449 // generated: dependency-cruiser@12.12.0 on 2023-05-05T19:06:19.143Z