/** * Write the API's description where git keeps it: contract/openapi.json, * from the routes' own `api` entries (src/openapi.ts). Run it after * changing a route or a cell of contract.json; the tests say when it is due. */ import { mkdirSync, writeFileSync } from "node:fs"; import { join } from "node:path"; import { emit } from "../src/openapi.ts"; const dir = join(import.meta.dir, "..", "contract"); mkdirSync(dir, { recursive: true }); writeFileSync(join(dir, "openapi.json"), emit()); console.log("wrote contract/openapi.json");