Explorar el Código

fix(sdk): build without legacy sources

Dax Raad hace 2 semanas
padre
commit
da35eac93f
Se han modificado 1 ficheros con 6 adiciones y 0 borrados
  1. 6 0
      packages/sdk/js/script/build.ts

+ 6 - 0
packages/sdk/js/script/build.ts

@@ -12,6 +12,12 @@ import { createClient } from "@hey-api/openapi-ts"
 const opencode = path.resolve(dir, "../../opencode")
 const client = path.resolve(dir, "../../client")
 
+if (!(await Bun.file(path.join(opencode, "package.json")).exists())) {
+  await $`rm -rf dist`
+  await $`bun tsc`
+  process.exit(0)
+}
+
 await $`bun dev generate > ${dir}/openapi.json`.cwd(opencode)
 await $`bun -e ${`
   import { OpenApi } from "effect/unstable/httpapi"