-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharchunit.config.example.js
More file actions
170 lines (150 loc) · 3.22 KB
/
archunit.config.example.js
File metadata and controls
170 lines (150 loc) · 3.22 KB
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
/**
* Example ArchUnit-TS configuration file
*
* Place this file as `archunit.config.js` in your project root
* to customize default behavior
*/
module.exports = {
/**
* Base path for analysis
* @default './src'
*/
basePath: './src',
/**
* File patterns to analyze
* @default ['**\/*.ts', '**\/*.tsx', '**\/*.js', '**\/*.jsx']
*/
patterns: [
'**/*.ts',
'**/*.tsx',
'!**/*.test.ts',
'!**/*.spec.ts',
'!**/*.d.ts',
],
/**
* Paths to ignore
* @default ['node_modules', 'dist', 'build', 'coverage']
*/
ignore: [
'node_modules',
'dist',
'build',
'coverage',
'test',
'tests',
],
/**
* Custom architecture patterns
*/
patterns: {
/**
* Define common package patterns for your project
*/
controllers: 'controllers/**',
services: 'services/**',
repositories: 'repositories/**',
models: 'models/**',
entities: 'domain/entities/**',
infrastructure: 'infrastructure/**',
},
/**
* Predefined rules that will be checked
* Set to false to disable, or provide custom configuration
*/
rules: {
// Enforce naming conventions
namingConventions: {
enabled: true,
rules: [
{
pattern: 'controllers/**',
suffix: 'Controller',
},
{
pattern: 'services/**',
suffix: 'Service',
},
{
pattern: 'repositories/**',
suffix: 'Repository',
},
],
},
// Enforce layer dependencies
layerDependencies: {
enabled: true,
layers: {
controllers: {
mayOnlyAccessLayers: ['services', 'models'],
},
services: {
mayOnlyAccessLayers: ['repositories', 'models'],
},
repositories: {
mayOnlyAccessLayers: ['models'],
},
models: {
mayNotAccessLayers: ['controllers', 'services', 'repositories'],
},
},
},
// Enforce decorator usage
decorators: {
enabled: false,
rules: [
{
pattern: 'controllers/**',
decorator: 'Controller',
},
{
pattern: 'services/**',
decorator: 'Injectable',
},
],
},
// Detect circular dependencies
circularDependencies: {
enabled: true,
maxDepth: 10,
},
},
/**
* Reporting configuration
*/
reporting: {
// Output format: 'console' | 'json' | 'html'
format: 'console',
// Output file for json/html reports
outputFile: './architecture-violations.json',
// Show violation source code context
showContext: true,
// Number of context lines to show
contextLines: 3,
// Fail on any violation
failOnViolation: true,
// Verbose output
verbose: false,
},
/**
* Performance configuration
*/
performance: {
// Enable caching
cache: true,
// Cache directory
cacheDir: '.archunit-cache',
// Parallel processing
parallel: true,
// Max workers for parallel processing
maxWorkers: 4,
},
/**
* TypeScript configuration
*/
typescript: {
// Path to tsconfig.json
configPath: './tsconfig.json',
// Skip type checking
skipTypeCheck: false,
},
};