Expand description
fz client-ts (issue #155): a /__surface contract document in, the
files of a typed @cratefield/client package out, written to --out.
The other harness-free commands work on what a venture has — a
manifest (fz build), a migration directory, its environment
(fz push). This one works on what a venture serves: --surface
names the JSON the running venture publishes at /__surface, or -
to read the body off stdin, so a client can be generated without
checking the venture out at all:
curl -s https://venture.example/__surface | fz client-ts --surface - --out ./clientGeneration itself is cratefield_client_ts::generate — pure,
deterministic, no I/O — so this module is only the I/O around it: read
the document, write the files, and say which of the two failed in the
doctor’s coded shape (--json prints exactly one object on stdout,
every refusal carrying a stable code from crate::codes).
Structs§
- Generated
- What a successful run did: the generated package’s identity and the files it wrote, in write order.
- Refusal
- A refused run: its stable code from the catalogue (
crate::codes) plus the human message, which is exactly what the prose path prints afterfz:.
Constants§
- SCHEMA
- The
schemafield of thefz client-ts --jsonobject: consumers branch on it, so it only ever grows. The same wire contractfz doctor --jsoncarries (crate::doctor::REPORT_SCHEMA).
Functions§
- client_
ts - The whole command minus the argv plumbing: read the document, generate
the package, write it under
out. Public so the acceptance tests can pin the messages and the JSON payloads the two disciplines print without driving argv. - from_
document - Generates and writes from a document body — the seam
client_tsreaches once it has read--surface.describedis how a refusal should name the document (“the document on stdin”, or the path it was read from). - run
- Runs
fz client-tsin the prose discipline: the summary on stdout, a refusal as the messagefinishprints afterfz:.sourceis the--surfacevalue — a path, or-for stdin. - run_
json - Runs
fz client-ts --json: exactly one JSON object on stdout, nothing else on either stream, and the verdict as the exit code.