History

try fix openapi extraction

Rhys Sullivan committed 8 months ago

Commit 46cd2631 parent e3f60e21 file · +6 −3Browse files

Unified · Split

packages/management-api/src/openapi-extractor-wasm.ts+6−3
@@ -1,4 +1,5 @@
1import { readFile } from "node:fs/promises";1import { readFile } from "node:fs/promises";
2import { fileURLToPath } from "node:url";
2 3
3import initWasmExtractor, {4import initWasmExtractor, {
4 extract_manifest_json_wasm,5 extract_manifest_json_wasm,
@@ -8,9 +9,11 @@ let initPromise: Promise<void> | undefined; · 3 unmodified lines
8 9
9const ensureWasmReady = (): Promise<void> => {10const ensureWasmReady = (): Promise<void> => {
10 if (!initPromise) {11 if (!initPromise) {
11 initPromise = readFile(12 const wasmPath = fileURLToPath(
12 new URL("./openapi-extractor-wasm/openapi_extractor_bg.wasm", import.meta.url),13 new URL("./openapi-extractor-wasm/openapi_extractor_bg.wasm", import.meta.url).toString(),
13 ).then((wasmBytes) =>14 );
15
16 initPromise = readFile(wasmPath).then((wasmBytes) =>
14 initWasmExtractor({ module_or_path: wasmBytes }).then(() => undefined)17 initWasmExtractor({ module_or_path: wasmBytes }).then(() => undefined)
15 );18 );
16 }19 }