#!/usr/bin/env node import { mkdirSync, readFileSync, writeFileSync } from "node:fs"; import { dirname, join } from "node:path"; import { fileURLToPath } from "node:url"; const rootDir = dirname(dirname(fileURLToPath(import.meta.url))); const swaggerSource = join(rootDir, "swagger.yaml"); const publicSwaggerYaml = join(rootDir, "public", "swagger.yaml"); const publicSwaggerHtml = join(rootDir, "public", "swagger.html"); const docsSwaggerYaml = join(rootDir, "docs", "api", "swagger.yaml"); const docsSwaggerHtml = join(rootDir, "docs", "api", "swagger.html"); const swaggerYaml = readFileSync(swaggerSource, "utf8"); function createSwaggerHtml({ specUrl }) { return `