camouf 0.1.0
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/LICENSE +21 -0
- package/README.md +346 -0
- package/dist/cli/commands/analyze.d.ts +8 -0
- package/dist/cli/commands/analyze.d.ts.map +1 -0
- package/dist/cli/commands/analyze.js +81 -0
- package/dist/cli/commands/analyze.js.map +1 -0
- package/dist/cli/commands/init.d.ts +9 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +104 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/report.d.ts +8 -0
- package/dist/cli/commands/report.d.ts.map +1 -0
- package/dist/cli/commands/report.js +63 -0
- package/dist/cli/commands/report.js.map +1 -0
- package/dist/cli/commands/validate.d.ts +9 -0
- package/dist/cli/commands/validate.d.ts.map +1 -0
- package/dist/cli/commands/validate.js +87 -0
- package/dist/cli/commands/validate.js.map +1 -0
- package/dist/cli/commands/watch.d.ts +9 -0
- package/dist/cli/commands/watch.d.ts.map +1 -0
- package/dist/cli/commands/watch.js +93 -0
- package/dist/cli/commands/watch.js.map +1 -0
- package/dist/cli/index.d.ts +9 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +48 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/version.d.ts +16 -0
- package/dist/cli/version.d.ts.map +1 -0
- package/dist/cli/version.js +16 -0
- package/dist/cli/version.js.map +1 -0
- package/dist/core/analyzer/architecture-visualizer.d.ts +25 -0
- package/dist/core/analyzer/architecture-visualizer.d.ts.map +1 -0
- package/dist/core/analyzer/architecture-visualizer.js +333 -0
- package/dist/core/analyzer/architecture-visualizer.js.map +1 -0
- package/dist/core/analyzer/dependency-analyzer.d.ts +49 -0
- package/dist/core/analyzer/dependency-analyzer.d.ts.map +1 -0
- package/dist/core/analyzer/dependency-analyzer.js +242 -0
- package/dist/core/analyzer/dependency-analyzer.js.map +1 -0
- package/dist/core/config/config-schema.d.ts +280 -0
- package/dist/core/config/config-schema.d.ts.map +1 -0
- package/dist/core/config/config-schema.js +199 -0
- package/dist/core/config/config-schema.js.map +1 -0
- package/dist/core/config/configuration-manager.d.ts +82 -0
- package/dist/core/config/configuration-manager.d.ts.map +1 -0
- package/dist/core/config/configuration-manager.js +306 -0
- package/dist/core/config/configuration-manager.js.map +1 -0
- package/dist/core/logger.d.ts +27 -0
- package/dist/core/logger.d.ts.map +1 -0
- package/dist/core/logger.js +86 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/parsers/go-parser.d.ts +16 -0
- package/dist/core/parsers/go-parser.d.ts.map +1 -0
- package/dist/core/parsers/go-parser.js +117 -0
- package/dist/core/parsers/go-parser.js.map +1 -0
- package/dist/core/parsers/java-parser.d.ts +22 -0
- package/dist/core/parsers/java-parser.d.ts.map +1 -0
- package/dist/core/parsers/java-parser.js +114 -0
- package/dist/core/parsers/java-parser.js.map +1 -0
- package/dist/core/parsers/javascript-parser.d.ts +14 -0
- package/dist/core/parsers/javascript-parser.d.ts.map +1 -0
- package/dist/core/parsers/javascript-parser.js +19 -0
- package/dist/core/parsers/javascript-parser.js.map +1 -0
- package/dist/core/parsers/parser-registry.d.ts +45 -0
- package/dist/core/parsers/parser-registry.d.ts.map +1 -0
- package/dist/core/parsers/parser-registry.js +121 -0
- package/dist/core/parsers/parser-registry.js.map +1 -0
- package/dist/core/parsers/parser.interface.d.ts +49 -0
- package/dist/core/parsers/parser.interface.d.ts.map +1 -0
- package/dist/core/parsers/parser.interface.js +7 -0
- package/dist/core/parsers/parser.interface.js.map +1 -0
- package/dist/core/parsers/python-parser.d.ts +22 -0
- package/dist/core/parsers/python-parser.d.ts.map +1 -0
- package/dist/core/parsers/python-parser.js +136 -0
- package/dist/core/parsers/python-parser.js.map +1 -0
- package/dist/core/parsers/rust-parser.d.ts +16 -0
- package/dist/core/parsers/rust-parser.d.ts.map +1 -0
- package/dist/core/parsers/rust-parser.js +176 -0
- package/dist/core/parsers/rust-parser.js.map +1 -0
- package/dist/core/parsers/typescript-parser.d.ts +29 -0
- package/dist/core/parsers/typescript-parser.d.ts.map +1 -0
- package/dist/core/parsers/typescript-parser.js +251 -0
- package/dist/core/parsers/typescript-parser.js.map +1 -0
- package/dist/core/reporter/report-generator.d.ts +31 -0
- package/dist/core/reporter/report-generator.d.ts.map +1 -0
- package/dist/core/reporter/report-generator.js +417 -0
- package/dist/core/reporter/report-generator.js.map +1 -0
- package/dist/core/reporter/violation-reporter.d.ts +62 -0
- package/dist/core/reporter/violation-reporter.d.ts.map +1 -0
- package/dist/core/reporter/violation-reporter.js +265 -0
- package/dist/core/reporter/violation-reporter.js.map +1 -0
- package/dist/core/rules/builtin/api-versioning.rule.d.ts +28 -0
- package/dist/core/rules/builtin/api-versioning.rule.d.ts.map +1 -0
- package/dist/core/rules/builtin/api-versioning.rule.js +103 -0
- package/dist/core/rules/builtin/api-versioning.rule.js.map +1 -0
- package/dist/core/rules/builtin/circular-dependencies.rule.d.ts +26 -0
- package/dist/core/rules/builtin/circular-dependencies.rule.d.ts.map +1 -0
- package/dist/core/rules/builtin/circular-dependencies.rule.js +99 -0
- package/dist/core/rules/builtin/circular-dependencies.rule.js.map +1 -0
- package/dist/core/rules/builtin/data-flow-integrity.rule.d.ts +27 -0
- package/dist/core/rules/builtin/data-flow-integrity.rule.d.ts.map +1 -0
- package/dist/core/rules/builtin/data-flow-integrity.rule.js +111 -0
- package/dist/core/rules/builtin/data-flow-integrity.rule.js.map +1 -0
- package/dist/core/rules/builtin/ddd-boundaries.rule.d.ts +31 -0
- package/dist/core/rules/builtin/ddd-boundaries.rule.d.ts.map +1 -0
- package/dist/core/rules/builtin/ddd-boundaries.rule.js +141 -0
- package/dist/core/rules/builtin/ddd-boundaries.rule.js.map +1 -0
- package/dist/core/rules/builtin/distributed-transactions.rule.d.ts +27 -0
- package/dist/core/rules/builtin/distributed-transactions.rule.d.ts.map +1 -0
- package/dist/core/rules/builtin/distributed-transactions.rule.js +134 -0
- package/dist/core/rules/builtin/distributed-transactions.rule.js.map +1 -0
- package/dist/core/rules/builtin/index.d.ts +16 -0
- package/dist/core/rules/builtin/index.d.ts.map +1 -0
- package/dist/core/rules/builtin/index.js +16 -0
- package/dist/core/rules/builtin/index.js.map +1 -0
- package/dist/core/rules/builtin/layer-dependencies.rule.d.ts +30 -0
- package/dist/core/rules/builtin/layer-dependencies.rule.d.ts.map +1 -0
- package/dist/core/rules/builtin/layer-dependencies.rule.js +102 -0
- package/dist/core/rules/builtin/layer-dependencies.rule.js.map +1 -0
- package/dist/core/rules/builtin/performance-antipatterns.rule.d.ts +29 -0
- package/dist/core/rules/builtin/performance-antipatterns.rule.d.ts.map +1 -0
- package/dist/core/rules/builtin/performance-antipatterns.rule.js +148 -0
- package/dist/core/rules/builtin/performance-antipatterns.rule.js.map +1 -0
- package/dist/core/rules/builtin/resilience-patterns.rule.d.ts +29 -0
- package/dist/core/rules/builtin/resilience-patterns.rule.d.ts.map +1 -0
- package/dist/core/rules/builtin/resilience-patterns.rule.js +123 -0
- package/dist/core/rules/builtin/resilience-patterns.rule.js.map +1 -0
- package/dist/core/rules/builtin/security-context.rule.d.ts +32 -0
- package/dist/core/rules/builtin/security-context.rule.d.ts.map +1 -0
- package/dist/core/rules/builtin/security-context.rule.js +145 -0
- package/dist/core/rules/builtin/security-context.rule.js.map +1 -0
- package/dist/core/rules/builtin/type-safety.rule.d.ts +32 -0
- package/dist/core/rules/builtin/type-safety.rule.d.ts.map +1 -0
- package/dist/core/rules/builtin/type-safety.rule.js +175 -0
- package/dist/core/rules/builtin/type-safety.rule.js.map +1 -0
- package/dist/core/rules/rule-engine.d.ts +72 -0
- package/dist/core/rules/rule-engine.d.ts.map +1 -0
- package/dist/core/rules/rule-engine.js +225 -0
- package/dist/core/rules/rule-engine.js.map +1 -0
- package/dist/core/rules/rule.interface.d.ts +169 -0
- package/dist/core/rules/rule.interface.d.ts.map +1 -0
- package/dist/core/rules/rule.interface.js +38 -0
- package/dist/core/rules/rule.interface.js.map +1 -0
- package/dist/core/scanner/project-detector.d.ts +51 -0
- package/dist/core/scanner/project-detector.d.ts.map +1 -0
- package/dist/core/scanner/project-detector.js +310 -0
- package/dist/core/scanner/project-detector.js.map +1 -0
- package/dist/core/scanner/project-scanner.d.ts +101 -0
- package/dist/core/scanner/project-scanner.d.ts.map +1 -0
- package/dist/core/scanner/project-scanner.js +321 -0
- package/dist/core/scanner/project-scanner.js.map +1 -0
- package/dist/core/watcher/file-watcher.d.ts +48 -0
- package/dist/core/watcher/file-watcher.d.ts.map +1 -0
- package/dist/core/watcher/file-watcher.js +124 -0
- package/dist/core/watcher/file-watcher.js.map +1 -0
- package/dist/types/config.types.d.ts +163 -0
- package/dist/types/config.types.d.ts.map +1 -0
- package/dist/types/config.types.js +36 -0
- package/dist/types/config.types.js.map +1 -0
- package/dist/types/core.types.d.ts +247 -0
- package/dist/types/core.types.d.ts.map +1 -0
- package/dist/types/core.types.js +7 -0
- package/dist/types/core.types.js.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +7 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +90 -0
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration Schema
|
|
3
|
+
*
|
|
4
|
+
* JSON Schema for validating Camouf configuration files.
|
|
5
|
+
*/
|
|
6
|
+
export declare const configSchema: {
|
|
7
|
+
$schema: string;
|
|
8
|
+
type: string;
|
|
9
|
+
required: string[];
|
|
10
|
+
properties: {
|
|
11
|
+
name: {
|
|
12
|
+
type: string;
|
|
13
|
+
description: string;
|
|
14
|
+
};
|
|
15
|
+
root: {
|
|
16
|
+
type: string;
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
languages: {
|
|
20
|
+
type: string;
|
|
21
|
+
items: {
|
|
22
|
+
type: string;
|
|
23
|
+
enum: string[];
|
|
24
|
+
};
|
|
25
|
+
minItems: number;
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
28
|
+
layers: {
|
|
29
|
+
type: string;
|
|
30
|
+
items: {
|
|
31
|
+
type: string;
|
|
32
|
+
required: string[];
|
|
33
|
+
properties: {
|
|
34
|
+
name: {
|
|
35
|
+
type: string;
|
|
36
|
+
};
|
|
37
|
+
type: {
|
|
38
|
+
type: string;
|
|
39
|
+
enum: string[];
|
|
40
|
+
};
|
|
41
|
+
directories: {
|
|
42
|
+
type: string;
|
|
43
|
+
items: {
|
|
44
|
+
type: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
allowedDependencies: {
|
|
48
|
+
type: string;
|
|
49
|
+
items: {
|
|
50
|
+
type: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
forbiddenDependencies: {
|
|
54
|
+
type: string;
|
|
55
|
+
items: {
|
|
56
|
+
type: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
description: string;
|
|
62
|
+
};
|
|
63
|
+
directories: {
|
|
64
|
+
type: string;
|
|
65
|
+
required: string[];
|
|
66
|
+
properties: {
|
|
67
|
+
client: {
|
|
68
|
+
type: string;
|
|
69
|
+
items: {
|
|
70
|
+
type: string;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
server: {
|
|
74
|
+
type: string;
|
|
75
|
+
items: {
|
|
76
|
+
type: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
shared: {
|
|
80
|
+
type: string;
|
|
81
|
+
items: {
|
|
82
|
+
type: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
tests: {
|
|
86
|
+
type: string;
|
|
87
|
+
items: {
|
|
88
|
+
type: string;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
custom: {
|
|
92
|
+
type: string;
|
|
93
|
+
additionalProperties: {
|
|
94
|
+
type: string;
|
|
95
|
+
items: {
|
|
96
|
+
type: string;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
rules: {
|
|
103
|
+
type: string;
|
|
104
|
+
properties: {
|
|
105
|
+
builtin: {
|
|
106
|
+
type: string;
|
|
107
|
+
additionalProperties: {
|
|
108
|
+
oneOf: ({
|
|
109
|
+
type: string;
|
|
110
|
+
enum: string[];
|
|
111
|
+
properties?: undefined;
|
|
112
|
+
required?: undefined;
|
|
113
|
+
} | {
|
|
114
|
+
type: string;
|
|
115
|
+
properties: {
|
|
116
|
+
level: {
|
|
117
|
+
type: string;
|
|
118
|
+
enum: string[];
|
|
119
|
+
};
|
|
120
|
+
options: {
|
|
121
|
+
type: string;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
required: string[];
|
|
125
|
+
enum?: undefined;
|
|
126
|
+
})[];
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
custom: {
|
|
130
|
+
type: string;
|
|
131
|
+
items: {
|
|
132
|
+
type: string;
|
|
133
|
+
required: string[];
|
|
134
|
+
properties: {
|
|
135
|
+
id: {
|
|
136
|
+
type: string;
|
|
137
|
+
};
|
|
138
|
+
name: {
|
|
139
|
+
type: string;
|
|
140
|
+
};
|
|
141
|
+
description: {
|
|
142
|
+
type: string;
|
|
143
|
+
};
|
|
144
|
+
level: {
|
|
145
|
+
type: string;
|
|
146
|
+
enum: string[];
|
|
147
|
+
};
|
|
148
|
+
path: {
|
|
149
|
+
type: string;
|
|
150
|
+
};
|
|
151
|
+
declarative: {
|
|
152
|
+
type: string;
|
|
153
|
+
required: string[];
|
|
154
|
+
properties: {
|
|
155
|
+
type: {
|
|
156
|
+
type: string;
|
|
157
|
+
enum: string[];
|
|
158
|
+
};
|
|
159
|
+
pattern: {
|
|
160
|
+
type: string;
|
|
161
|
+
};
|
|
162
|
+
target: {
|
|
163
|
+
type: string;
|
|
164
|
+
};
|
|
165
|
+
action: {
|
|
166
|
+
type: string;
|
|
167
|
+
enum: string[];
|
|
168
|
+
};
|
|
169
|
+
message: {
|
|
170
|
+
type: string;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
settings: {
|
|
178
|
+
type: string;
|
|
179
|
+
properties: {
|
|
180
|
+
maxCircularDepth: {
|
|
181
|
+
type: string;
|
|
182
|
+
minimum: number;
|
|
183
|
+
};
|
|
184
|
+
excludePatterns: {
|
|
185
|
+
type: string;
|
|
186
|
+
items: {
|
|
187
|
+
type: string;
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
parsers: {
|
|
195
|
+
type: string;
|
|
196
|
+
properties: {
|
|
197
|
+
typescript: {
|
|
198
|
+
type: string;
|
|
199
|
+
properties: {
|
|
200
|
+
tsConfigPath: {
|
|
201
|
+
type: string;
|
|
202
|
+
};
|
|
203
|
+
strict: {
|
|
204
|
+
type: string;
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
python: {
|
|
209
|
+
type: string;
|
|
210
|
+
properties: {
|
|
211
|
+
version: {
|
|
212
|
+
type: string;
|
|
213
|
+
enum: string[];
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
java: {
|
|
218
|
+
type: string;
|
|
219
|
+
properties: {
|
|
220
|
+
sourceVersion: {
|
|
221
|
+
type: string;
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
patterns: {
|
|
228
|
+
type: string;
|
|
229
|
+
required: string[];
|
|
230
|
+
properties: {
|
|
231
|
+
include: {
|
|
232
|
+
type: string;
|
|
233
|
+
items: {
|
|
234
|
+
type: string;
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
exclude: {
|
|
238
|
+
type: string;
|
|
239
|
+
items: {
|
|
240
|
+
type: string;
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
output: {
|
|
246
|
+
type: string;
|
|
247
|
+
properties: {
|
|
248
|
+
format: {
|
|
249
|
+
type: string;
|
|
250
|
+
enum: string[];
|
|
251
|
+
};
|
|
252
|
+
directory: {
|
|
253
|
+
type: string;
|
|
254
|
+
};
|
|
255
|
+
showCode: {
|
|
256
|
+
type: string;
|
|
257
|
+
};
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
advanced: {
|
|
261
|
+
type: string;
|
|
262
|
+
properties: {
|
|
263
|
+
cache: {
|
|
264
|
+
type: string;
|
|
265
|
+
};
|
|
266
|
+
cacheDirectory: {
|
|
267
|
+
type: string;
|
|
268
|
+
};
|
|
269
|
+
maxWorkers: {
|
|
270
|
+
type: string;
|
|
271
|
+
minimum: number;
|
|
272
|
+
};
|
|
273
|
+
debug: {
|
|
274
|
+
type: string;
|
|
275
|
+
};
|
|
276
|
+
};
|
|
277
|
+
};
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
//# sourceMappingURL=config-schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-schema.d.ts","sourceRoot":"","sources":["../../../src/core/config/config-schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgMxB,CAAC"}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration Schema
|
|
3
|
+
*
|
|
4
|
+
* JSON Schema for validating Camouf configuration files.
|
|
5
|
+
*/
|
|
6
|
+
export const configSchema = {
|
|
7
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
8
|
+
type: 'object',
|
|
9
|
+
required: ['root', 'languages', 'directories'],
|
|
10
|
+
properties: {
|
|
11
|
+
name: {
|
|
12
|
+
type: 'string',
|
|
13
|
+
description: 'Project name',
|
|
14
|
+
},
|
|
15
|
+
root: {
|
|
16
|
+
type: 'string',
|
|
17
|
+
description: 'Root directory of the project',
|
|
18
|
+
},
|
|
19
|
+
languages: {
|
|
20
|
+
type: 'array',
|
|
21
|
+
items: {
|
|
22
|
+
type: 'string',
|
|
23
|
+
enum: ['typescript', 'javascript', 'python', 'java', 'go', 'rust', 'csharp', 'kotlin'],
|
|
24
|
+
},
|
|
25
|
+
minItems: 1,
|
|
26
|
+
description: 'Languages to analyze',
|
|
27
|
+
},
|
|
28
|
+
layers: {
|
|
29
|
+
type: 'array',
|
|
30
|
+
items: {
|
|
31
|
+
type: 'object',
|
|
32
|
+
required: ['name', 'type', 'directories', 'allowedDependencies'],
|
|
33
|
+
properties: {
|
|
34
|
+
name: {
|
|
35
|
+
type: 'string',
|
|
36
|
+
},
|
|
37
|
+
type: {
|
|
38
|
+
type: 'string',
|
|
39
|
+
enum: ['presentation', 'application', 'domain', 'infrastructure', 'shared', 'custom'],
|
|
40
|
+
},
|
|
41
|
+
directories: {
|
|
42
|
+
type: 'array',
|
|
43
|
+
items: { type: 'string' },
|
|
44
|
+
},
|
|
45
|
+
allowedDependencies: {
|
|
46
|
+
type: 'array',
|
|
47
|
+
items: { type: 'string' },
|
|
48
|
+
},
|
|
49
|
+
forbiddenDependencies: {
|
|
50
|
+
type: 'array',
|
|
51
|
+
items: { type: 'string' },
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
description: 'Architecture layer definitions',
|
|
56
|
+
},
|
|
57
|
+
directories: {
|
|
58
|
+
type: 'object',
|
|
59
|
+
required: ['client', 'server', 'shared'],
|
|
60
|
+
properties: {
|
|
61
|
+
client: {
|
|
62
|
+
type: 'array',
|
|
63
|
+
items: { type: 'string' },
|
|
64
|
+
},
|
|
65
|
+
server: {
|
|
66
|
+
type: 'array',
|
|
67
|
+
items: { type: 'string' },
|
|
68
|
+
},
|
|
69
|
+
shared: {
|
|
70
|
+
type: 'array',
|
|
71
|
+
items: { type: 'string' },
|
|
72
|
+
},
|
|
73
|
+
tests: {
|
|
74
|
+
type: 'array',
|
|
75
|
+
items: { type: 'string' },
|
|
76
|
+
},
|
|
77
|
+
custom: {
|
|
78
|
+
type: 'object',
|
|
79
|
+
additionalProperties: {
|
|
80
|
+
type: 'array',
|
|
81
|
+
items: { type: 'string' },
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
rules: {
|
|
87
|
+
type: 'object',
|
|
88
|
+
properties: {
|
|
89
|
+
builtin: {
|
|
90
|
+
type: 'object',
|
|
91
|
+
additionalProperties: {
|
|
92
|
+
oneOf: [
|
|
93
|
+
{ type: 'string', enum: ['off', 'warn', 'error'] },
|
|
94
|
+
{
|
|
95
|
+
type: 'object',
|
|
96
|
+
properties: {
|
|
97
|
+
level: { type: 'string', enum: ['off', 'warn', 'error'] },
|
|
98
|
+
options: { type: 'object' },
|
|
99
|
+
},
|
|
100
|
+
required: ['level'],
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
custom: {
|
|
106
|
+
type: 'array',
|
|
107
|
+
items: {
|
|
108
|
+
type: 'object',
|
|
109
|
+
required: ['id', 'name', 'level'],
|
|
110
|
+
properties: {
|
|
111
|
+
id: { type: 'string' },
|
|
112
|
+
name: { type: 'string' },
|
|
113
|
+
description: { type: 'string' },
|
|
114
|
+
level: { type: 'string', enum: ['warn', 'error'] },
|
|
115
|
+
path: { type: 'string' },
|
|
116
|
+
declarative: {
|
|
117
|
+
type: 'object',
|
|
118
|
+
required: ['type', 'pattern', 'target', 'action', 'message'],
|
|
119
|
+
properties: {
|
|
120
|
+
type: { type: 'string', enum: ['import', 'dependency', 'naming', 'structure'] },
|
|
121
|
+
pattern: { type: 'string' },
|
|
122
|
+
target: { type: 'string' },
|
|
123
|
+
action: { type: 'string', enum: ['allow', 'deny'] },
|
|
124
|
+
message: { type: 'string' },
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
settings: {
|
|
131
|
+
type: 'object',
|
|
132
|
+
properties: {
|
|
133
|
+
maxCircularDepth: { type: 'number', minimum: 1 },
|
|
134
|
+
excludePatterns: {
|
|
135
|
+
type: 'array',
|
|
136
|
+
items: { type: 'string' },
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
parsers: {
|
|
143
|
+
type: 'object',
|
|
144
|
+
properties: {
|
|
145
|
+
typescript: {
|
|
146
|
+
type: 'object',
|
|
147
|
+
properties: {
|
|
148
|
+
tsConfigPath: { type: 'string' },
|
|
149
|
+
strict: { type: 'boolean' },
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
python: {
|
|
153
|
+
type: 'object',
|
|
154
|
+
properties: {
|
|
155
|
+
version: { type: 'string', enum: ['2', '3'] },
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
java: {
|
|
159
|
+
type: 'object',
|
|
160
|
+
properties: {
|
|
161
|
+
sourceVersion: { type: 'string' },
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
patterns: {
|
|
167
|
+
type: 'object',
|
|
168
|
+
required: ['include', 'exclude'],
|
|
169
|
+
properties: {
|
|
170
|
+
include: {
|
|
171
|
+
type: 'array',
|
|
172
|
+
items: { type: 'string' },
|
|
173
|
+
},
|
|
174
|
+
exclude: {
|
|
175
|
+
type: 'array',
|
|
176
|
+
items: { type: 'string' },
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
output: {
|
|
181
|
+
type: 'object',
|
|
182
|
+
properties: {
|
|
183
|
+
format: { type: 'string', enum: ['text', 'json', 'sarif', 'html'] },
|
|
184
|
+
directory: { type: 'string' },
|
|
185
|
+
showCode: { type: 'boolean' },
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
advanced: {
|
|
189
|
+
type: 'object',
|
|
190
|
+
properties: {
|
|
191
|
+
cache: { type: 'boolean' },
|
|
192
|
+
cacheDirectory: { type: 'string' },
|
|
193
|
+
maxWorkers: { type: 'number', minimum: 1 },
|
|
194
|
+
debug: { type: 'boolean' },
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
};
|
|
199
|
+
//# sourceMappingURL=config-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-schema.js","sourceRoot":"","sources":["../../../src/core/config/config-schema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,OAAO,EAAE,yCAAyC;IAClD,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,aAAa,CAAC;IAC9C,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,cAAc;SAC5B;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,+BAA+B;SAC7C;QACD,SAAS,EAAE;YACT,IAAI,EAAE,OAAO;YACb,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC;aACvF;YACD,QAAQ,EAAE,CAAC;YACX,WAAW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;oBACd,UAAU,EAAE;wBACV,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;qBAClC;iBACF;aACF;SACF;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC;YAChC,UAAU,EAAE;gBACV,OAAO,EAAE;oBACP,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;iBAC1B;gBACD,OAAO,EAAE;oBACP,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;iBAC1B;aACF;SACF;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE;gBACnE,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBAC7B,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;aAC9B;SACF;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;gBAC1B,cAAc,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBAClC,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EAAE;gBAC1C,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;aAC3B;SACF;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration Manager
|
|
3
|
+
*
|
|
4
|
+
* Handles loading, validating, and managing Camouf configuration.
|
|
5
|
+
* Supports multiple configuration formats and sources.
|
|
6
|
+
*/
|
|
7
|
+
import { CamoufConfig, SupportedLanguage } from '../../types/config.types.js';
|
|
8
|
+
interface ProjectDetection {
|
|
9
|
+
languages: SupportedLanguage[];
|
|
10
|
+
directories: {
|
|
11
|
+
client: string[];
|
|
12
|
+
server: string[];
|
|
13
|
+
shared: string[];
|
|
14
|
+
};
|
|
15
|
+
framework?: string;
|
|
16
|
+
}
|
|
17
|
+
interface ConfigAnswers {
|
|
18
|
+
useDetected: boolean;
|
|
19
|
+
languages?: SupportedLanguage[];
|
|
20
|
+
clientDir: string;
|
|
21
|
+
serverDir: string;
|
|
22
|
+
sharedDir: string;
|
|
23
|
+
rules: string[];
|
|
24
|
+
}
|
|
25
|
+
export declare class ConfigurationManager {
|
|
26
|
+
private config;
|
|
27
|
+
private configPath;
|
|
28
|
+
private explorer;
|
|
29
|
+
private ajv;
|
|
30
|
+
private validateSchema;
|
|
31
|
+
constructor();
|
|
32
|
+
/**
|
|
33
|
+
* Load configuration from file or search for it
|
|
34
|
+
*/
|
|
35
|
+
loadConfig(configPath?: string): Promise<CamoufConfig | null>;
|
|
36
|
+
/**
|
|
37
|
+
* Check if configuration exists in current directory
|
|
38
|
+
*/
|
|
39
|
+
configExists(): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Generate default configuration based on project detection
|
|
42
|
+
*/
|
|
43
|
+
generateDefaultConfig(detection: ProjectDetection): CamoufConfig;
|
|
44
|
+
/**
|
|
45
|
+
* Build configuration from user answers
|
|
46
|
+
*/
|
|
47
|
+
buildConfigFromAnswers(answers: ConfigAnswers, detection: ProjectDetection): CamoufConfig;
|
|
48
|
+
/**
|
|
49
|
+
* Write configuration to file
|
|
50
|
+
*/
|
|
51
|
+
writeConfig(config: CamoufConfig, filePath?: string): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* Get current configuration
|
|
54
|
+
*/
|
|
55
|
+
getConfig(): CamoufConfig | null;
|
|
56
|
+
/**
|
|
57
|
+
* Get configuration file path
|
|
58
|
+
*/
|
|
59
|
+
getConfigPath(): string | null;
|
|
60
|
+
/**
|
|
61
|
+
* Validate configuration against schema
|
|
62
|
+
*/
|
|
63
|
+
private validate;
|
|
64
|
+
/**
|
|
65
|
+
* Merge configuration with defaults
|
|
66
|
+
*/
|
|
67
|
+
private mergeWithDefaults;
|
|
68
|
+
/**
|
|
69
|
+
* Resolve relative paths in configuration
|
|
70
|
+
*/
|
|
71
|
+
private resolvePaths;
|
|
72
|
+
/**
|
|
73
|
+
* Generate layer configurations
|
|
74
|
+
*/
|
|
75
|
+
private generateLayers;
|
|
76
|
+
/**
|
|
77
|
+
* Get file include patterns based on languages
|
|
78
|
+
*/
|
|
79
|
+
private getIncludePatterns;
|
|
80
|
+
}
|
|
81
|
+
export {};
|
|
82
|
+
//# sourceMappingURL=configuration-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configuration-manager.d.ts","sourceRoot":"","sources":["../../../src/core/config/configuration-manager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,EAAE,YAAY,EAAiB,iBAAiB,EAAe,MAAM,6BAA6B,CAAC;AAO1G,UAAU,gBAAgB;IACxB,SAAS,EAAE,iBAAiB,EAAE,CAAC;IAC/B,WAAW,EAAE;QACX,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,MAAM,EAAE,MAAM,EAAE,CAAC;KAClB,CAAC;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,aAAa;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,MAAM,CAA6B;IAC3C,OAAO,CAAC,UAAU,CAAuB;IACzC,OAAO,CAAC,QAAQ,CAcb;IAEH,OAAO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