Browse Source

fix(protocol): stabilize OpenAPI generation

Kit Langton 1 day ago
parent
commit
04cf35b304

+ 1 - 0
bun.lock

@@ -613,6 +613,7 @@
         "@tsconfig/bun": "catalog:",
         "@tsconfig/bun": "catalog:",
         "@types/bun": "catalog:",
         "@types/bun": "catalog:",
         "@typescript/native-preview": "catalog:",
         "@typescript/native-preview": "catalog:",
+        "prettier": "3.6.2",
         "typescript": "catalog:",
         "typescript": "catalog:",
       },
       },
     },
     },

File diff suppressed because it is too large
+ 91 - 287
packages/protocol/openapi.json


+ 1 - 0
packages/protocol/package.json

@@ -33,6 +33,7 @@
     "@tsconfig/bun": "catalog:",
     "@tsconfig/bun": "catalog:",
     "@types/bun": "catalog:",
     "@types/bun": "catalog:",
     "@typescript/native-preview": "catalog:",
     "@typescript/native-preview": "catalog:",
+    "prettier": "3.6.2",
     "typescript": "catalog:"
     "typescript": "catalog:"
   }
   }
 }
 }

+ 2 - 1
packages/protocol/script/generate-openapi.ts

@@ -1,8 +1,9 @@
 import { OpenApi } from "effect/unstable/httpapi"
 import { OpenApi } from "effect/unstable/httpapi"
+import { format } from "prettier"
 import { fileURLToPath } from "url"
 import { fileURLToPath } from "url"
 import { ClientApi } from "../src/client.js"
 import { ClientApi } from "../src/client.js"
 
 
-const document = JSON.stringify(OpenApi.fromApi(ClientApi), null, 2) + "\n"
+const document = await format(JSON.stringify(OpenApi.fromApi(ClientApi), null, 2), { parser: "json", printWidth: 120 })
 const target = fileURLToPath(new URL("../openapi.json", import.meta.url))
 const target = fileURLToPath(new URL("../openapi.json", import.meta.url))
 
 
 if (process.argv.includes("--check")) {
 if (process.argv.includes("--check")) {

File diff suppressed because it is too large
+ 91 - 287
packages/www/openapi.json


File diff suppressed because it is too large
+ 91 - 287
packages/www/public/openapi.json


Some files were not shown because too many files changed in this diff