@appport/generators
v1.0.1
Published
Manifest-driven client and type generation for AppPort.
Readme
@appport/generators
Manifest-driven code generation.
manifest -> generator -> typed clientimport { generateClient } from "@appport/generators";
const source = generateClient(manifest);or, from the CLI:
appport generateThe generated module contains input and output types per capability version, event payload types, a contract interface, the capability versions to send, the list of stream capabilities, and a typed client factory:
import { createDocumentsClient } from "./appport/generated/client.ts";
const client = createDocumentsClient({ transport });
const { version } = await client.capabilities.documents.save({ documentId, content });Types are derived from the published JSON Schema rather than from the server's TypeScript, so the same generator works against any conformant implementation — including one written in another language.
