apps/glyph Public The code is public; the app answers only to 1 person who can change it and the crew.
Files 308f4625e0ac59206bd37f1f78c4ecba8ca65968
| 1 | /** |
| 2 | * Write the API's description where git keeps it: contract/openapi.json, |
| 3 | * from the routes' own `api` entries (src/openapi.ts). Run it after |
| 4 | * changing a route or a cell of contract.json; the tests say when it is due. |
| 5 | */ |
| 6 | |
| 7 | import { mkdirSync, writeFileSync } from "node:fs"; |
| 8 | import { join } from "node:path"; |
| 9 | import { emit } from "../src/openapi.ts"; |
| 10 | |
| 11 | const dir = join(import.meta.dir, "..", "contract"); |
| 12 | mkdirSync(dir, { recursive: true }); |
| 13 | writeFileSync(join(dir, "openapi.json"), emit()); |
| 14 | console.log("wrote contract/openapi.json"); |