micro-contracts 0.13.0 → 0.14.1
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/README.md +15 -8
- package/cli-contract.yaml +736 -0
- package/dist/generator/index.d.ts +1 -1
- package/dist/generator/index.d.ts.map +1 -1
- package/dist/generator/linter.d.ts.map +1 -1
- package/dist/generator/linter.js +94 -3
- package/dist/generator/linter.js.map +1 -1
- package/dist/generator/templateProcessor.d.ts +32 -2
- package/dist/generator/templateProcessor.d.ts.map +1 -1
- package/dist/generator/templateProcessor.js +126 -6
- package/dist/generator/templateProcessor.js.map +1 -1
- package/dist/types.d.ts +48 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/docs/cli-reference.md +516 -0
- package/docs/micro-contracts-x-event-spec-change.md +731 -0
- package/docs/screen-spec.md +228 -47
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -123,7 +123,8 @@ Standard OpenAPI constructs can also define **frontend screen contracts** — br
|
|
|
123
123
|
Screen Spec (OpenAPI YAML)
|
|
124
124
|
├── ViewModel Types (from schemas — zero new template work)
|
|
125
125
|
├── Navigation Map (from response links → typed routing)
|
|
126
|
-
|
|
126
|
+
├── Event Hooks (from inline x-event → typed analytics)
|
|
127
|
+
└── Interaction Bindings (from x-interactions → typed in-page interactions)
|
|
127
128
|
```
|
|
128
129
|
|
|
129
130
|
Enable with `screen: true` in module config:
|
|
@@ -211,13 +212,15 @@ project/
|
|
|
211
212
|
|
|
212
213
|
Used in modules with `screen: true`. See **[Screen Spec](docs/screen-spec.md)** for details.
|
|
213
214
|
|
|
214
|
-
| Extension | Type | Description |
|
|
215
|
-
|
|
216
|
-
| `x-screen-const` | string | Stable constant name (e.g., `HOME`) |
|
|
217
|
-
| `x-screen-id` | string | Traceability ID (e.g., `SCR-001`) |
|
|
218
|
-
| `x-screen-name` | string | Generated symbol name (e.g., `HomePage`) |
|
|
219
|
-
| `x-back-navigation` | boolean | Supports history-based back navigation |
|
|
220
|
-
| `x-
|
|
215
|
+
| Extension | Type | Placement | Description |
|
|
216
|
+
|-----------|------|-----------|-------------|
|
|
217
|
+
| `x-screen-const` | string | GET operation | Stable constant name (e.g., `HOME`) |
|
|
218
|
+
| `x-screen-id` | string | GET operation | Traceability ID (e.g., `SCR-001`) |
|
|
219
|
+
| `x-screen-name` | string | GET operation | Generated symbol name (e.g., `HomePage`) |
|
|
220
|
+
| `x-back-navigation` | boolean | GET operation | Supports history-based back navigation |
|
|
221
|
+
| `x-event` | string \| object \| `$ref` | GET / links / post,put,patch,delete / x-interactions | Inline analytics event declaration (v0.14+) |
|
|
222
|
+
| `x-interactions` | array | GET operation | In-page interaction bindings with optional events (v0.14+) |
|
|
223
|
+
| `x-events` | array | GET operation | **Deprecated** — use inline `x-event` instead |
|
|
221
224
|
|
|
222
225
|
### Example
|
|
223
226
|
|
|
@@ -337,6 +340,8 @@ modules:
|
|
|
337
340
|
|
|
338
341
|
## CLI Reference
|
|
339
342
|
|
|
343
|
+
> **Machine-readable contract**: The full CLI specification is available as [`cli-contract.yaml`](cli-contract.yaml) ([CLI Contracts](https://www.npmjs.com/package/cli-contracts) format). For the detailed reference with exit codes, output contracts, and AI agent policies, see **[CLI Reference (full)](docs/cli-reference.md)**.
|
|
344
|
+
|
|
340
345
|
### generate
|
|
341
346
|
|
|
342
347
|
Generate code from OpenAPI specifications.
|
|
@@ -481,6 +486,8 @@ export class UserService implements UserServiceApi {
|
|
|
481
486
|
| Document | Description |
|
|
482
487
|
|----------|-------------|
|
|
483
488
|
| **[Examples](./examples/)** | Complete working project with multiple modules, overlays, and cross-module dependencies |
|
|
489
|
+
| **[CLI Reference](docs/cli-reference.md)** | Full CLI reference with exit codes, output contracts, and AI agent policies |
|
|
490
|
+
| **[CLI Contract](cli-contract.yaml)** | Machine-readable CLI specification ([CLI Contracts](https://www.npmjs.com/package/cli-contracts) format) |
|
|
484
491
|
| **[Screen Spec](docs/screen-spec.md)** | Frontend screen contracts — ViewModel, navigation, analytics events in OpenAPI |
|
|
485
492
|
| **[OpenAPI Overlays (Deep Dive)](docs/overlays-deep-dive.md)** | Complete overlay examples, JSONPath patterns, template context |
|
|
486
493
|
| **[Enforceable Guardrails (AI-ready)](docs/development-guardrails.md)** | CI integration, security checks, allowlist configuration |
|