-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgrumpy.schema.json
More file actions
394 lines (394 loc) · 11.2 KB
/
grumpy.schema.json
File metadata and controls
394 lines (394 loc) · 11.2 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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/necodeIT/grumpy_context/refs/heads/main/grumpy.schema.json",
"title": "grumpy.yaml / grumpy.yml",
"description": "Configuration for grumpy_context project discovery and Mason brick defaults.",
"type": "object",
"additionalProperties": false,
"properties": {
"module_roots": {
"description": "Top-level directories that should be scanned for modules.",
"type": "array",
"items": {
"type": "string",
"minLength": 1
},
"minItems": 1,
"uniqueItems": true
},
"barrel_file_patterns": {
"description": "Basename patterns for barrel files that should be hidden from bucket file inventories. The special token {folder} expands to the immediate parent folder name.",
"$ref": "#/$defs/pathList"
},
"layers": {
"description": "The configured discovery paths for each supported architectural layer.",
"type": "object",
"additionalProperties": false,
"properties": {
"utils": {
"description": "Discovery paths for utility files.",
"oneOf": [
{
"$ref": "#/$defs/pathList"
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"paths": {
"description": "Explicit discovery paths for the utils layer.",
"$ref": "#/$defs/pathList"
}
}
}
]
},
"domain": {
"description": "Discovery paths for domain-layer buckets.",
"$ref": "#/$defs/domainLayer"
},
"infra": {
"description": "Discovery paths for infrastructure-layer buckets.",
"$ref": "#/$defs/infraLayer"
},
"presentation": {
"description": "Discovery paths for presentation-layer buckets.",
"$ref": "#/$defs/presentationLayer"
}
}
},
"defaults": {
"description": "Project-level defaults applied by Grumpy Mason brick pre_gen hooks before prompting.",
"$ref": "#/$defs/generationDefaults"
}
},
"$defs": {
"pathList": {
"description": "A non-empty list of relative discovery patterns or paths.",
"type": "array",
"items": {
"type": "string",
"minLength": 1
},
"minItems": 1,
"uniqueItems": true
},
"domainLayer": {
"description": "Domain-layer discovery configuration.",
"type": "object",
"additionalProperties": false,
"properties": {
"models": {
"description": "Discovery paths for domain model files.",
"$ref": "#/$defs/pathList"
},
"services": {
"description": "Discovery paths for domain service contract files.",
"$ref": "#/$defs/pathList"
},
"datasources": {
"description": "Discovery paths for domain datasource contract files.",
"$ref": "#/$defs/pathList"
}
}
},
"infraLayer": {
"description": "Infrastructure-layer discovery configuration.",
"type": "object",
"additionalProperties": false,
"properties": {
"services": {
"description": "Discovery paths for infrastructure service implementation files.",
"$ref": "#/$defs/pathList"
},
"datasources": {
"description": "Discovery paths for infrastructure datasource implementation files.",
"$ref": "#/$defs/pathList"
}
}
},
"presentationLayer": {
"description": "Presentation-layer discovery configuration.",
"type": "object",
"additionalProperties": false,
"properties": {
"components": {
"description": "Discovery paths for presentation component files.",
"$ref": "#/$defs/pathList"
},
"screens": {
"description": "Discovery paths for presentation screen files.",
"$ref": "#/$defs/pathList"
},
"repos": {
"description": "Discovery paths for presentation repository files.",
"$ref": "#/$defs/pathList"
},
"middleware": {
"description": "Discovery paths for presentation middleware or guard files.",
"$ref": "#/$defs/pathList"
}
}
},
"generationDefaults": {
"description": "Generation defaults shared across all units or scoped to a specific unit type.",
"type": "object",
"additionalProperties": false,
"properties": {
"common": {
"description": "Defaults merged into every unit before unit-specific defaults.",
"$ref": "#/$defs/generationDefaultsSection"
},
"unit": {
"description": "Defaults for the generic unit brick.",
"$ref": "#/$defs/generationDefaultsSection"
},
"module": {
"description": "Defaults for module generation.",
"$ref": "#/$defs/generationDefaultsSection"
},
"service": {
"description": "Defaults for service generation.",
"$ref": "#/$defs/generationDefaultsSection"
},
"datasource": {
"description": "Defaults for datasource generation.",
"$ref": "#/$defs/generationDefaultsSection"
},
"guard": {
"description": "Defaults for guard generation.",
"$ref": "#/$defs/generationDefaultsSection"
},
"middleware": {
"description": "Defaults for middleware generation.",
"$ref": "#/$defs/generationDefaultsSection"
},
"screen": {
"description": "Defaults for screen generation.",
"$ref": "#/$defs/generationDefaultsSection"
},
"component": {
"description": "Defaults for component generation.",
"$ref": "#/$defs/generationDefaultsSection"
},
"repository": {
"description": "Defaults for repository generation.",
"$ref": "#/$defs/generationDefaultsSection"
},
"model": {
"description": "Defaults for model generation.",
"$ref": "#/$defs/generationDefaultsSection"
}
}
},
"generationDefaultsSection": {
"description": "Supported generation option defaults. Explicit CLI or prompt values override these.",
"type": "object",
"additionalProperties": false,
"properties": {
"update_barrels": {
"type": "boolean"
},
"generate_test": {
"type": "boolean"
},
"module": {
"type": "string",
"minLength": 1
},
"target_directory": {
"type": "string",
"minLength": 1
},
"module_kind": {
"type": "string",
"enum": ["feature", "appRoot"]
},
"class_name": {
"type": "string",
"minLength": 1
},
"config_type": {
"type": "string",
"minLength": 1
},
"imports": {
"$ref": "#/$defs/stringList"
},
"route_mode": {
"type": "string",
"enum": ["none", "root", "child"]
},
"route_path": {
"type": "string",
"minLength": 1
},
"wire_target_file": {
"type": "string",
"minLength": 1
},
"folders": {
"$ref": "#/$defs/stringList"
},
"layer": {
"type": "string",
"enum": ["domain", "infra"]
},
"contract_name": {
"type": "string",
"minLength": 1
},
"implementation_prefix": {
"type": "string",
"minLength": 1
},
"singleton": {
"type": "boolean"
},
"lifecycle": {
"type": "boolean"
},
"dependencies": {
"$ref": "#/$defs/stringList"
},
"extra_mixins": {
"$ref": "#/$defs/stringList"
},
"state_type": {
"type": "string",
"minLength": 1
},
"repo_mixins": {
"type": "array",
"items": {
"type": "string",
"enum": [
"UseRepoMixin",
"DeferredRepoMixin",
"QueryMixin",
"QueryByIdMixin",
"FuzzyFindQueryMixin",
"PersistentRepoStateMixin",
"TransactionalMutationMixin"
]
},
"uniqueItems": true
},
"query_item_type": {
"type": "string",
"minLength": 1
},
"persistence_serialized_type": {
"type": "string",
"minLength": 1
},
"redirect_to": {
"type": "string",
"minLength": 1
},
"async_body": {
"type": "boolean"
},
"middleware": {
"$ref": "#/$defs/stringList"
},
"preview_mode": {
"type": "string",
"enum": ["manual", "sameAsContent", "customMixins"]
},
"wrap_local_barrel": {
"type": "boolean"
},
"component_kind": {
"type": "string",
"enum": ["stateless", "stateful", "query"]
},
"query_data_type": {
"type": "string",
"minLength": 1
},
"query_repo": {
"type": "string",
"minLength": 1
},
"query_state_mixins": {
"type": "array",
"items": {
"type": "string",
"enum": [
"StatefulQueryContent",
"StatefulQueryError",
"StatefulQueryLoader"
]
},
"uniqueItems": true
},
"model_style": {
"type": "string",
"enum": ["plain", "freezed", "freezedJson"]
},
"extends_model": {
"type": "boolean"
},
"fields": {
"$ref": "#/$defs/modelFields"
},
"extra_interfaces": {
"$ref": "#/$defs/stringList"
}
}
},
"modelFields": {
"type": "object",
"description": "Model field definitions keyed by field name.",
"propertyNames": {
"pattern": "^[A-Za-z_$][A-Za-z0-9_$]*$"
},
"additionalProperties": {
"$ref": "#/$defs/modelFieldSpec"
}
},
"modelFieldSpec": {
"type": "object",
"additionalProperties": false,
"required": ["type"],
"properties": {
"type": {
"type": "string",
"minLength": 1
},
"nullable": {
"type": "boolean"
},
"required": {
"type": "boolean"
},
"default": {
"description": "Raw Dart expression or scalar literal used as the field default value.",
"oneOf": [
{
"type": "string"
},
{
"type": "number"
},
{
"type": "boolean"
},
{
"type": "null"
}
]
}
}
},
"stringList": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
},
"uniqueItems": true
}
}
}