| 1 | /* oxlint-disable no-undef */ |
| 2 | import * as Fs from "fs/promises" |
| 3 | |
| 4 | const jsBundle = await fetch( |
| 5 | "https://unpkg.com/swagger-ui-dist/swagger-ui-bundle.js" |
| 6 | ).then((res) => res.text()) |
| 7 | const jsPreset = await fetch( |
| 8 | "https://unpkg.com/swagger-ui-dist/swagger-ui-standalone-preset.js" |
| 9 | ).then((res) => res.text()) |
| 10 | const css = await fetch( |
| 11 | "https://unpkg.com/swagger-ui-dist/swagger-ui.css" |
| 12 | ).then((res) => res.text()) |
| 13 | |
| 14 | const source = `/* oxlint-disable no-undef */ |
| 15 | |
| 16 | /** @internal */ |
| 17 | export const javascript = ${JSON.stringify(`${jsBundle}\n${jsPreset}`)} |
| 18 | |
| 19 | /** @internal */ |
| 20 | export const css = ${JSON.stringify(css)} |
| 21 | ` |
| 22 | |
| 23 | await Fs.writeFile("packages/effect/src/http-api/internal/httpApiSwagger.ts", source) |