-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgrumpy.schema.json
More file actions
478 lines (478 loc) · 17.3 KB
/
Copy pathgrumpy.schema.json
File metadata and controls
478 lines (478 loc) · 17.3 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
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
{
"$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"
},
"discovery": {
"description": "Discovery behavior flags used by context-aware generators.",
"$ref": "#/$defs/discoverySettings"
}
},
"$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": "Backward-compatible alias for defaults merged into every unit before unit-specific defaults.",
"$ref": "#/$defs/generationDefaultsSection"
},
"all": {
"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"
},
"query_component": {
"description": "Defaults for query 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": {
"description": "Whether generated files should be exported from local and parent barrel files when the brick supports barrel updates.",
"type": "boolean"
},
"generate_test": {
"description": "Whether module generation should also scaffold a test file when the brick supports it.",
"type": "boolean"
},
"module": {
"description": "The target module name to use when generation should skip module selection.",
"type": "string",
"minLength": 1
},
"target_directory": {
"description": "The explicit output directory for the generated file, relative to the project root.",
"type": "string",
"minLength": 1
},
"module_kind": {
"description": "The module brick variant to generate.",
"type": "string",
"enum": ["feature", "appRoot"]
},
"class_name": {
"description": "An explicit class name override for generators that otherwise derive the class name from the unit name.",
"type": "string",
"minLength": 1
},
"config_type": {
"description": "The application config type used by app modules, feature modules, guards, and middleware.",
"type": "string",
"minLength": 1
},
"imports": {
"description": "Additional import directives merged into the generated file.",
"$ref": "#/$defs/stringList"
},
"mixins": {
"description": "Mixin names merged into the generated type for supported unit kinds.",
"$ref": "#/$defs/stringList"
},
"route_mode": {
"description": "The routing mode used for generated screens or feature modules.",
"type": "string",
"enum": ["none", "root", "child"]
},
"route_path": {
"description": "The child route path to register when route_mode is set to child.",
"type": "string",
"minLength": 1
},
"wire_target_file": {
"description": "A target module or app file that should be updated to wire in the generated route or module.",
"type": "string",
"minLength": 1
},
"folders": {
"description": "The folder set a generated module should scaffold under its root.",
"$ref": "#/$defs/stringList"
},
"layer": {
"description": "The architectural layer to generate into for service and datasource bricks.",
"type": "string",
"enum": ["domain", "infra"]
},
"contract_name": {
"description": "The domain contract name used by infra service and datasource implementations.",
"type": "string",
"minLength": 1
},
"implementation_prefix": {
"description": "The prefix used when deriving infra implementation class names from a contract.",
"type": "string",
"minLength": 1
},
"singleton": {
"description": "Whether an infra service or datasource should be registered as a singleton.",
"type": "boolean"
},
"lifecycle": {
"description": "Whether lifecycle support should be enabled for supported service-like units.",
"type": "boolean"
},
"dependencies": {
"description": "Dependency unit names that should be constructor-injected and imported into the generated unit.",
"$ref": "#/$defs/stringList"
},
"extra_mixins": {
"description": "Additional mixins applied after any built-in or configured mixins.",
"$ref": "#/$defs/stringList"
},
"state_type": {
"description": "The repository state type used by generated repos.",
"type": "string",
"minLength": 1
},
"repo_mixins": {
"description": "The repository mixin set to apply for repo generation.",
"type": "array",
"items": {
"type": "string",
"enum": [
"UseRepoMixin",
"DeferredRepoMixin",
"QueryMixin",
"QueryByIdMixin",
"FuzzyFindQueryMixin",
"PersistentRepoStateMixin",
"TransactionalMutationMixin"
]
},
"uniqueItems": true
},
"query_item_type": {
"description": "The item type used by repository query helpers such as QueryByIdMixin or FuzzyFindQueryMixin.",
"type": "string",
"minLength": 1
},
"persistence_serialized_type": {
"description": "The serialized persistence payload type for PersistentRepoStateMixin repositories.",
"type": "string",
"minLength": 1
},
"redirect_to": {
"description": "The redirect target used by generated guards.",
"type": "string",
"minLength": 1
},
"async_body": {
"description": "Whether generated guard and middleware method bodies should be asynchronous.",
"type": "boolean"
},
"middleware": {
"description": "Middleware or guard names that should be attached to a generated screen route.",
"$ref": "#/$defs/stringList"
},
"preview_mode": {
"description": "The preview implementation strategy for generated screens.",
"type": "string",
"enum": ["manual", "sameAsContent", "customMixins"]
},
"wrap_local_barrel": {
"description": "Whether a generated screen should also update its local screens barrel file.",
"type": "boolean"
},
"component_kind": {
"description": "The component brick variant to generate.",
"type": "string",
"enum": ["stateless", "stateful", "query"]
},
"query_data_type": {
"description": "An explicit underlying result type for query components. This becomes the right-hand side of the generated typedef alias.",
"type": "string",
"minLength": 1
},
"query_result_type": {
"description": "The default underlying result type for query components. Use \"auto\" to defer to discovery; discovered or explicit values still map through the generated typedef alias.",
"type": "string",
"minLength": 1
},
"query_repo": {
"description": "The repository type a generated query component should call from its query method.",
"type": "string",
"minLength": 1
},
"query_state_mixins": {
"description": "The query-component mixins selected from framework, project, or config-defined candidates.",
"$ref": "#/$defs/stringList"
},
"model_style": {
"description": "The model code generation style to use.",
"type": "string",
"enum": ["plain", "freezed", "freezedJson"]
},
"extends_model": {
"description": "Whether generated models should extend or implement Model where supported by the chosen style.",
"type": "boolean"
},
"fields": {
"description": "Structured model field definitions keyed by field name.",
"$ref": "#/$defs/modelFields"
},
"extra_interfaces": {
"description": "Additional interface names implemented by generated models.",
"$ref": "#/$defs/stringList"
}
}
},
"discoverySettings": {
"description": "Feature flags that control how project analysis is used to infer generation defaults and output targets.",
"type": "object",
"additionalProperties": false,
"properties": {
"prefer_project_types": {
"description": "Prefer discovered project model types over leaving type-like values unresolved.",
"type": "boolean"
},
"infer_config_type": {
"description": "Infer the config type from discovered app or feature modules when possible.",
"type": "boolean"
},
"infer_query_component_repo": {
"description": "Infer a query component repository when one clear candidate exists.",
"type": "boolean"
},
"infer_query_component_result_type": {
"description": "Infer the underlying query component result type from discovered project models when possible.",
"type": "boolean"
},
"infer_repository_query_item_type": {
"description": "Infer repository query item types from discovered project models when possible.",
"type": "boolean"
},
"prefer_existing_directories": {
"description": "Prefer already-existing directories over fallback convention paths when choosing generation targets.",
"type": "boolean"
}
}
},
"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": {
"description": "A single model field specification.",
"type": "object",
"additionalProperties": false,
"required": ["type"],
"properties": {
"type": {
"description": "The Dart type of the field before nullability is applied.",
"type": "string",
"minLength": 1
},
"nullable": {
"description": "Whether the field type should be nullable.",
"type": "boolean"
},
"required": {
"description": "Whether the field should be required in generated constructors.",
"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": {
"description": "A unique list of non-empty strings.",
"type": "array",
"items": {
"type": "string",
"minLength": 1
},
"uniqueItems": true
}
}
}