refactor(sdk): remove local legacy package
This commit is contained in:
parent
28f4284bd7
commit
80865407e0
74 changed files with 46983 additions and 87229 deletions
18
packages/www/script/generate-openapi.ts
Normal file
18
packages/www/script/generate-openapi.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import { fileURLToPath } from "url"
|
||||
|
||||
const source = fileURLToPath(new URL("../../protocol/openapi.json", import.meta.url))
|
||||
const targets = ["../openapi.json", "../public/openapi.json"].map((path) =>
|
||||
fileURLToPath(new URL(path, import.meta.url)),
|
||||
)
|
||||
const document = await Bun.file(source).text()
|
||||
|
||||
if (process.argv.includes("--check")) {
|
||||
const stale = (await Promise.all(targets.map((path) => Bun.file(path).text()))).some((value) => value !== document)
|
||||
if (stale) {
|
||||
console.error("Generated OpenAPI documents are stale. Run `bun run generate` from packages/www.")
|
||||
process.exit(1)
|
||||
}
|
||||
process.exit(0)
|
||||
}
|
||||
|
||||
await Promise.all(targets.map((path) => Bun.write(path, document)))
|
||||
Loading…
Add table
Add a link
Reference in a new issue