Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. ๐ซ Status page with uptime monitoring & API monitoring as code ๐ซ openstatus.dev
bun drizzle-orm monitoring monitoring-as-code nextjs observability on-call open-source shadcn-ui status-page statuspage synthetic-monitoring tinybird turso uptime uptime-checker uptime-monitor
Something went wrong. Try again.
1.1 kB ยท 26 lines
TypeScript
123456789101112131415161718192021222324252627import { parse } from "jsr:@std/yaml@^1.0.9";
/** * `static/openapi.json` is a JSON rendering of `static/openapi.yaml`, which is * itself generated from the protos (`pnpm --filter @openstatus/proto buf:openapi`). * Agents and OpenAPI tooling overwhelmingly expect `/openapi.json`; hand-editing * either file drifts them apart, which `openapi.test.ts` fails on. * * `openapi-yaml.ts` embeds the YAML as a module because `deno bundle` flattens * `src/` into a single file: a path resolved from `import.meta.url` at runtime * would point at the bundle's directory, not the source module's. * * Run: `pnpm --filter @openstatus/server openapi:json` */const dir = new URL("../static/", import.meta.url);const yaml = await Deno.readTextFile(new URL("openapi.yaml", dir));await Deno.writeTextFile( new URL("openapi.json", dir), `${JSON.stringify(parse(yaml), null, 2)}\n`,);await Deno.writeTextFile( new URL("openapi-yaml.ts", dir), `// Generated from openapi.yaml โ run \`pnpm --filter @openstatus/server openapi:json\`.\nexport default ${JSON.stringify( yaml, )};\n`,);