refactor(sdk): remove local legacy package
This commit is contained in:
parent
28f4284bd7
commit
80865407e0
74 changed files with 46983 additions and 87229 deletions
29592
packages/protocol/openapi.json
Normal file
29592
packages/protocol/openapi.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -20,6 +20,8 @@
|
|||
},
|
||||
"scripts": {
|
||||
"build": "bun run script/build.ts",
|
||||
"generate": "bun run script/generate-openapi.ts",
|
||||
"check:generated": "bun run script/generate-openapi.ts --check",
|
||||
"typecheck": "tsgo --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
|
|||
16
packages/protocol/script/generate-openapi.ts
Normal file
16
packages/protocol/script/generate-openapi.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import { OpenApi } from "effect/unstable/httpapi"
|
||||
import { fileURLToPath } from "url"
|
||||
import { ClientApi } from "../src/client.js"
|
||||
|
||||
const document = JSON.stringify(OpenApi.fromApi(ClientApi), null, 2) + "\n"
|
||||
const target = fileURLToPath(new URL("../openapi.json", import.meta.url))
|
||||
|
||||
if (process.argv.includes("--check")) {
|
||||
if ((await Bun.file(target).text()) !== document) {
|
||||
console.error("Generated OpenAPI document is stale. Run `bun run generate` from packages/protocol.")
|
||||
process.exit(1)
|
||||
}
|
||||
process.exit(0)
|
||||
}
|
||||
|
||||
await Bun.write(target, document)
|
||||
Loading…
Add table
Add a link
Reference in a new issue