micro-contracts 0.14.3 → 0.15.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/cli-contract.yaml CHANGED
@@ -1,9 +1,9 @@
1
1
  # yaml-language-server: $schema=./node_modules/cli-contracts/schemas/cli-contract.schema.json
2
- cliContracts: 0.1.0
2
+ cli_contracts: 0.1.0
3
3
 
4
4
  info:
5
5
  title: micro-contracts CLI
6
- version: 0.14.2
6
+ version: 0.15.0
7
7
  description: >-
8
8
  Contract-first OpenAPI toolchain for TypeScript Web/API systems.
9
9
  Generates contract packages, server routes, and frontend clients
@@ -14,12 +14,29 @@ info:
14
14
  name: foo-ogawa
15
15
  url: https://github.com/foo-ogawa/micro-contracts
16
16
 
17
- commandSets:
17
+ artifact_slots:
18
+ openapi-specs:
19
+ direction: read
20
+ description: OpenAPI specification files
21
+ config:
22
+ direction: read
23
+ description: micro-contracts.config.yaml configuration
24
+ generated-packages:
25
+ direction: write
26
+ description: Generated contract packages, server routes, and frontend clients
27
+ guardrails-config:
28
+ direction: read
29
+ description: guardrails.yaml configuration
30
+ manifest:
31
+ direction: write
32
+ description: Generated manifest (.generated-manifest.json)
33
+
34
+ command_sets:
18
35
  micro-contracts:
19
36
  summary: Contract-first OpenAPI toolchain for TypeScript.
20
37
  executable: micro-contracts
21
38
 
22
- globalOptions:
39
+ global_options:
23
40
  - name: version
24
41
  aliases: [V]
25
42
  description: Print version and exit.
@@ -52,19 +69,19 @@ commandSets:
52
69
  - name: config
53
70
  aliases: [c]
54
71
  description: Path to config file (micro-contracts.config.yaml).
55
- valueName: path
72
+ value_name: path
56
73
  schema:
57
74
  type: string
58
75
  file:
59
76
  mode: read
60
77
  exists: false
61
- mediaType: application/yaml
78
+ media_type: application/yaml
62
79
  encoding: utf-8
63
80
 
64
81
  - name: module
65
82
  aliases: [m]
66
83
  description: Module names, comma-separated. Generates all modules if omitted.
67
- valueName: names
84
+ value_name: names
68
85
  schema:
69
86
  type: string
70
87
 
@@ -108,7 +125,7 @@ commandSets:
108
125
 
109
126
  - name: manifest-dir
110
127
  description: Directory for manifest output.
111
- valueName: path
128
+ value_name: path
112
129
  schema:
113
130
  type: string
114
131
  default: packages/
@@ -135,12 +152,12 @@ commandSets:
135
152
  files:
136
153
  - path: packages/contract/{module}/**/*.ts
137
154
  required: true
138
- mediaType: text/x-typescript
155
+ media_type: text/x-typescript
139
156
  encoding: utf-8
140
157
  description: Generated contract packages.
141
158
  - path: packages/contract-published/{module}/**/*.ts
142
159
  required: false
143
- mediaType: text/x-typescript
160
+ media_type: text/x-typescript
144
161
  encoding: utf-8
145
162
  description: Generated public contract packages.
146
163
 
@@ -150,12 +167,12 @@ commandSets:
150
167
  format: text
151
168
 
152
169
  x-agent:
153
- riskLevel: medium
154
- requiresConfirmation: false
170
+ risk_level: medium
171
+ requires_confirmation: false
155
172
  idempotent: true
156
- sideEffects:
173
+ side_effects:
157
174
  - file_write
158
- recommendedBeforeUse:
175
+ recommended_before_use:
159
176
  - Ensure micro-contracts.config.yaml exists.
160
177
  - Verify OpenAPI specs are valid.
161
178
 
@@ -179,7 +196,7 @@ commandSets:
179
196
  file:
180
197
  mode: read
181
198
  exists: true
182
- mediaType: application/yaml
199
+ media_type: application/yaml
183
200
  encoding: utf-8
184
201
 
185
202
  options:
@@ -201,10 +218,10 @@ commandSets:
201
218
  format: text
202
219
 
203
220
  x-agent:
204
- riskLevel: low
205
- requiresConfirmation: false
221
+ risk_level: low
222
+ requires_confirmation: false
206
223
  idempotent: true
207
- sideEffects: []
224
+ side_effects: []
208
225
 
209
226
  # ── init ─────────────────────────────────────────
210
227
  init:
@@ -232,7 +249,7 @@ commandSets:
232
249
  - name: dir
233
250
  aliases: [d]
234
251
  description: Base directory for server/frontend files.
235
- valueName: path
252
+ value_name: path
236
253
  schema:
237
254
  type: string
238
255
  default: src
@@ -240,19 +257,19 @@ commandSets:
240
257
  - name: openapi
241
258
  aliases: [i]
242
259
  description: OpenAPI spec to process (auto-adds x-micro-contracts-service/method extensions).
243
- valueName: path
260
+ value_name: path
244
261
  schema:
245
262
  type: string
246
263
  file:
247
264
  mode: read
248
265
  exists: true
249
- mediaType: application/yaml
266
+ media_type: application/yaml
250
267
  encoding: utf-8
251
268
 
252
269
  - name: output
253
270
  aliases: [o]
254
271
  description: Output path for processed OpenAPI. Defaults to spec/{name}/openapi/{name}.yaml.
255
- valueName: path
272
+ value_name: path
256
273
  schema:
257
274
  type: string
258
275
 
@@ -276,17 +293,17 @@ commandSets:
276
293
  files:
277
294
  - path: spec/{name}/openapi/{name}.yaml
278
295
  required: false
279
- mediaType: application/yaml
296
+ media_type: application/yaml
280
297
  encoding: utf-8
281
298
  description: OpenAPI spec (created when --openapi provided or --screens used).
282
299
  - path: spec/default/templates/*.hbs
283
300
  required: false
284
- mediaType: text/x-handlebars-template
301
+ media_type: text/x-handlebars-template
285
302
  encoding: utf-8
286
303
  description: Starter Handlebars templates.
287
304
  - path: micro-contracts.config.yaml
288
305
  required: false
289
- mediaType: application/yaml
306
+ media_type: application/yaml
290
307
  encoding: utf-8
291
308
  description: Config file (created if not already present).
292
309
 
@@ -296,10 +313,10 @@ commandSets:
296
313
  format: text
297
314
 
298
315
  x-agent:
299
- riskLevel: medium
300
- requiresConfirmation: false
316
+ risk_level: medium
317
+ requires_confirmation: false
301
318
  idempotent: true
302
- sideEffects:
319
+ side_effects:
303
320
  - file_write
304
321
  - directory_create
305
322
 
@@ -321,19 +338,19 @@ commandSets:
321
338
  options:
322
339
  - name: only
323
340
  description: Run only specific checks (comma-separated check names).
324
- valueName: checks
341
+ value_name: checks
325
342
  schema:
326
343
  type: string
327
344
 
328
345
  - name: skip
329
346
  description: Skip specific checks (comma-separated check names).
330
- valueName: checks
347
+ value_name: checks
331
348
  schema:
332
349
  type: string
333
350
 
334
351
  - name: gate
335
352
  description: Run checks for specific gates only (comma-separated, 1-5).
336
- valueName: gates
353
+ value_name: gates
337
354
  schema:
338
355
  type: string
339
356
 
@@ -353,32 +370,32 @@ commandSets:
353
370
  - name: guardrails
354
371
  aliases: [g]
355
372
  description: Path to guardrails.yaml.
356
- valueName: path
373
+ value_name: path
357
374
  schema:
358
375
  type: string
359
376
  file:
360
377
  mode: read
361
378
  exists: false
362
- mediaType: application/yaml
379
+ media_type: application/yaml
363
380
  encoding: utf-8
364
381
 
365
382
  - name: generated-dir
366
383
  aliases: [d]
367
384
  description: Path to generated files directory.
368
- valueName: path
385
+ value_name: path
369
386
  schema:
370
387
  type: string
371
388
  default: packages/
372
389
 
373
390
  - name: changed-files
374
391
  description: Path to file containing list of changed files (for CI).
375
- valueName: path
392
+ value_name: path
376
393
  schema:
377
394
  type: string
378
395
  file:
379
396
  mode: read
380
397
  exists: true
381
- mediaType: text/plain
398
+ media_type: text/plain
382
399
  encoding: utf-8
383
400
 
384
401
  - name: list
@@ -408,11 +425,11 @@ commandSets:
408
425
  format: text
409
426
 
410
427
  x-agent:
411
- riskLevel: low
412
- requiresConfirmation: false
428
+ risk_level: low
429
+ requires_confirmation: false
413
430
  idempotent: true
414
- sideEffects: []
415
- recommendedBeforeUse:
431
+ side_effects: []
432
+ recommended_before_use:
416
433
  - Run generate first so generated files exist.
417
434
 
418
435
  # ── pipeline ─────────────────────────────────────
@@ -433,13 +450,13 @@ commandSets:
433
450
  - name: config
434
451
  aliases: [c]
435
452
  description: Path to config file (micro-contracts.config.yaml).
436
- valueName: path
453
+ value_name: path
437
454
  schema:
438
455
  type: string
439
456
  file:
440
457
  mode: read
441
458
  exists: false
442
- mediaType: application/yaml
459
+ media_type: application/yaml
443
460
  encoding: utf-8
444
461
 
445
462
  - name: verbose
@@ -451,7 +468,7 @@ commandSets:
451
468
 
452
469
  - name: skip
453
470
  description: Skip specific checks (comma-separated).
454
- valueName: checks
471
+ value_name: checks
455
472
  schema:
456
473
  type: string
457
474
 
@@ -464,19 +481,19 @@ commandSets:
464
481
  - name: guardrails
465
482
  aliases: [g]
466
483
  description: Path to guardrails.yaml.
467
- valueName: path
484
+ value_name: path
468
485
  schema:
469
486
  type: string
470
487
  file:
471
488
  mode: read
472
489
  exists: false
473
- mediaType: application/yaml
490
+ media_type: application/yaml
474
491
  encoding: utf-8
475
492
 
476
493
  - name: generated-dir
477
494
  aliases: [d]
478
495
  description: Path to generated files directory.
479
- valueName: path
496
+ value_name: path
480
497
  schema:
481
498
  type: string
482
499
  default: packages/
@@ -548,12 +565,12 @@ commandSets:
548
565
  format: text
549
566
 
550
567
  x-agent:
551
- riskLevel: medium
552
- requiresConfirmation: false
568
+ risk_level: medium
569
+ requires_confirmation: false
553
570
  idempotent: true
554
- sideEffects:
571
+ side_effects:
555
572
  - file_write
556
- recommendedBeforeUse:
573
+ recommended_before_use:
557
574
  - Ensure micro-contracts.config.yaml and guardrails.yaml exist.
558
575
  - Verify OpenAPI specs are valid.
559
576
 
@@ -576,19 +593,19 @@ commandSets:
576
593
  - name: config
577
594
  aliases: [c]
578
595
  description: Path to config file.
579
- valueName: path
596
+ value_name: path
580
597
  schema:
581
598
  type: string
582
599
  file:
583
600
  mode: read
584
601
  exists: false
585
- mediaType: application/yaml
602
+ media_type: application/yaml
586
603
  encoding: utf-8
587
604
 
588
605
  - name: module
589
606
  aliases: [m]
590
607
  description: Module to analyze.
591
- valueName: name
608
+ value_name: name
592
609
  schema:
593
610
  type: string
594
611
 
@@ -600,13 +617,13 @@ commandSets:
600
617
 
601
618
  - name: impact
602
619
  description: Analyze impact of changing a specific API (e.g., core.User.getUsers).
603
- valueName: ref
620
+ value_name: ref
604
621
  schema:
605
622
  type: string
606
623
 
607
624
  - name: who-depends-on
608
625
  description: Find modules that depend on a specific API.
609
- valueName: ref
626
+ value_name: ref
610
627
  schema:
611
628
  type: string
612
629
 
@@ -628,10 +645,10 @@ commandSets:
628
645
  format: text
629
646
 
630
647
  x-agent:
631
- riskLevel: low
632
- requiresConfirmation: false
648
+ risk_level: low
649
+ requires_confirmation: false
633
650
  idempotent: true
634
- sideEffects: []
651
+ side_effects: []
635
652
 
636
653
  # ── guardrails-init ──────────────────────────────
637
654
  guardrails-init:
@@ -648,7 +665,7 @@ commandSets:
648
665
  - name: output
649
666
  aliases: [o]
650
667
  description: Output path for guardrails.yaml.
651
- valueName: path
668
+ value_name: path
652
669
  schema:
653
670
  type: string
654
671
  default: guardrails.yaml
@@ -661,7 +678,7 @@ commandSets:
661
678
  files:
662
679
  - path: '{options.output}'
663
680
  required: true
664
- mediaType: application/yaml
681
+ media_type: application/yaml
665
682
  encoding: utf-8
666
683
 
667
684
  '1':
@@ -670,10 +687,10 @@ commandSets:
670
687
  format: text
671
688
 
672
689
  x-agent:
673
- riskLevel: low
674
- requiresConfirmation: false
690
+ risk_level: low
691
+ requires_confirmation: false
675
692
  idempotent: false
676
- sideEffects:
693
+ side_effects:
677
694
  - file_write
678
695
 
679
696
  # ── manifest ─────────────────────────────────────
@@ -693,7 +710,7 @@ commandSets:
693
710
  - name: dir
694
711
  aliases: [d]
695
712
  description: Directory to scan.
696
- valueName: path
713
+ value_name: path
697
714
  schema:
698
715
  type: string
699
716
  default: packages/
@@ -707,7 +724,7 @@ commandSets:
707
724
  - name: output
708
725
  aliases: [o]
709
726
  description: Output manifest path. Defaults to {dir}/.generated-manifest.json.
710
- valueName: path
727
+ value_name: path
711
728
  schema:
712
729
  type: string
713
730
 
@@ -719,7 +736,7 @@ commandSets:
719
736
  files:
720
737
  - path: '{options.dir}/.generated-manifest.json'
721
738
  required: false
722
- mediaType: application/json
739
+ media_type: application/json
723
740
  encoding: utf-8
724
741
  description: Generated manifest (not created in verify mode).
725
742
 
@@ -729,8 +746,8 @@ commandSets:
729
746
  format: text
730
747
 
731
748
  x-agent:
732
- riskLevel: low
733
- requiresConfirmation: false
749
+ risk_level: low
750
+ requires_confirmation: false
734
751
  idempotent: true
735
- sideEffects:
752
+ side_effects:
736
753
  - file_write
@@ -2,7 +2,7 @@
2
2
 
3
3
  Contract-first OpenAPI toolchain for TypeScript Web/API systems. Generates contract packages, server routes, and frontend clients from OpenAPI specifications with enforceable guardrails.
4
4
 
5
- **Version:** 0.14.2
5
+ **Version:** 0.15.0
6
6
 
7
7
  ## Table of Contents
8
8
 
@@ -87,12 +87,12 @@ micro-contracts generate --force
87
87
 
88
88
  ```yaml
89
89
  x-agent:
90
- riskLevel: medium
91
- requiresConfirmation: false
90
+ risk_level: medium
91
+ requires_confirmation: false
92
92
  idempotent: true
93
- sideEffects:
93
+ side_effects:
94
94
  - file_write
95
- recommendedBeforeUse:
95
+ recommended_before_use:
96
96
  - Ensure micro-contracts.config.yaml exists.
97
97
  - Verify OpenAPI specs are valid.
98
98
  ```
@@ -140,10 +140,10 @@ micro-contracts lint spec/core/openapi/core.yaml --strict
140
140
 
141
141
  ```yaml
142
142
  x-agent:
143
- riskLevel: low
144
- requiresConfirmation: false
143
+ risk_level: low
144
+ requires_confirmation: false
145
145
  idempotent: true
146
- sideEffects:
146
+ side_effects:
147
147
 
148
148
  ```
149
149
 
@@ -205,10 +205,10 @@ micro-contracts init users --skip-templates
205
205
 
206
206
  ```yaml
207
207
  x-agent:
208
- riskLevel: medium
209
- requiresConfirmation: false
208
+ risk_level: medium
209
+ requires_confirmation: false
210
210
  idempotent: true
211
- sideEffects:
211
+ side_effects:
212
212
  - file_write
213
213
  - directory_create
214
214
  ```
@@ -273,12 +273,12 @@ micro-contracts check --list-gates
273
273
 
274
274
  ```yaml
275
275
  x-agent:
276
- riskLevel: low
277
- requiresConfirmation: false
276
+ risk_level: low
277
+ requires_confirmation: false
278
278
  idempotent: true
279
- sideEffects:
279
+ side_effects:
280
280
 
281
- recommendedBeforeUse:
281
+ recommended_before_use:
282
282
  - Run generate first so generated files exist.
283
283
  ```
284
284
 
@@ -340,12 +340,12 @@ micro-contracts pipeline --contracts-only --skip-lint
340
340
 
341
341
  ```yaml
342
342
  x-agent:
343
- riskLevel: medium
344
- requiresConfirmation: false
343
+ risk_level: medium
344
+ requires_confirmation: false
345
345
  idempotent: true
346
- sideEffects:
346
+ side_effects:
347
347
  - file_write
348
- recommendedBeforeUse:
348
+ recommended_before_use:
349
349
  - Ensure micro-contracts.config.yaml and guardrails.yaml exist.
350
350
  - Verify OpenAPI specs are valid.
351
351
  ```
@@ -404,10 +404,10 @@ micro-contracts deps --validate
404
404
 
405
405
  ```yaml
406
406
  x-agent:
407
- riskLevel: low
408
- requiresConfirmation: false
407
+ risk_level: low
408
+ requires_confirmation: false
409
409
  idempotent: true
410
- sideEffects:
410
+ side_effects:
411
411
 
412
412
  ```
413
413
 
@@ -451,10 +451,10 @@ micro-contracts guardrails-init -o custom-guardrails.yaml
451
451
 
452
452
  ```yaml
453
453
  x-agent:
454
- riskLevel: low
455
- requiresConfirmation: false
454
+ risk_level: low
455
+ requires_confirmation: false
456
456
  idempotent: false
457
- sideEffects:
457
+ side_effects:
458
458
  - file_write
459
459
  ```
460
460
 
@@ -506,10 +506,10 @@ micro-contracts manifest -o custom-manifest.json
506
506
 
507
507
  ```yaml
508
508
  x-agent:
509
- riskLevel: low
510
- requiresConfirmation: false
509
+ risk_level: low
510
+ requires_confirmation: false
511
511
  idempotent: true
512
- sideEffects:
512
+ side_effects:
513
513
  - file_write
514
514
  ```
515
515
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "micro-contracts",
3
- "version": "0.14.3",
3
+ "version": "0.15.0",
4
4
  "description": "Contract-first OpenAPI toolchain that keeps TypeScript UI and microservices aligned via code generation",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -56,7 +56,7 @@
56
56
  "devDependencies": {
57
57
  "@types/js-yaml": "^4.0.9",
58
58
  "@types/node": "^20.11.0",
59
- "cli-contracts": "^0.1.1",
59
+ "cli-contracts": "^0.30.2",
60
60
  "embedoc": "^0.9.0",
61
61
  "tsx": "^4.7.0",
62
62
  "typescript": "^5.3.3",