Contracts 1.0.0: generated JSON Schema for every contract

- schemas/: JSON Schema (draft 2020-12) generated from the zod schemas by
  npm run build (scripts/json-schemas.cjs), exported as
  @crosscode/contracts/schemas/*
- Test: files match the zod schemas, every sample passes them (Ajv)
- Version 1.0.0, CHANGELOG and README

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-04 14:30:37 +02:00
co-authored by Claude Opus 5.5
parent ea1575f716
commit 9e94c82502
35 changed files with 4330 additions and 5 deletions
+7 -1
View File
@@ -4,6 +4,8 @@ Each package and app has its own section and its own tags (`contracts@1.0.0`, `a
## Unreleased
## contracts@1.0.0 - 2026-11-04
### Monorepo
- Set up: npm workspaces (`packages/*`, `apps/*`), shared TypeScript, ESLint and Jest setup,
@@ -12,7 +14,7 @@ Each package and app has its own section and its own tags (`contracts@1.0.0`, `a
schema-name helpers every contract uses (`crosscode.<name>/<major>`).
- `packages/ui`, `apps/accounts`, `apps/website`, `apps/app`: placeholders.
### Contracts (towards 1.0.0)
### Contracts
- `crosscode.event/1` and `crosscode.event-feed/1`: the event, the feed response and the
`event.changed` webhook. Checks that `startsAt` / `endsAt` match the sessions and that only
@@ -30,3 +32,7 @@ Each package and app has its own section and its own tags (`contracts@1.0.0`, `a
products in the replies, `customerId` / `product` in the licence token.
- `@crosscode/contracts/signing` (Node only): the Hub's HMAC scheme for the Hub and product links.
- Sample payloads for every contract in `samples/`, checked by the tests.
- **JSON Schema** (draft 2020-12) for every contract in `schemas/`, generated from the zod
schemas by `npm run build` (`scripts/json-schemas.cjs`), for consumers that don't use
TypeScript or zod. A test checks the files match the zod schemas and that every sample passes
them (Ajv). Checks JSON Schema can't express (e.g. `startsAt` matching the sessions) only run in zod.