mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-08-29 03:44:06 +08:00
fix(sdk): reject mismatched Bun generation
This commit is contained in:
@@ -9,6 +9,14 @@ import path from "path"
|
||||
|
||||
import { createClient } from "@hey-api/openapi-ts"
|
||||
|
||||
// kilocode_change start - prevent runtime-dependent generated SDK ordering
|
||||
const root = path.resolve(dir, "../../..")
|
||||
const pkg = await Bun.file(path.join(root, "package.json")).text()
|
||||
const version = pkg.match(/"packageManager":\s*"bun@([^"]+)"/)?.[1]
|
||||
if (!version) throw new Error("Root packageManager must specify bun@<version>")
|
||||
if (Bun.version !== version) throw new Error(`SDK generation requires Bun ${version}, but is running Bun ${Bun.version}`)
|
||||
// kilocode_change end
|
||||
|
||||
const opencode = path.resolve(dir, "../../opencode")
|
||||
|
||||
await $`bun dev generate > ${dir}/openapi.json`.cwd(opencode)
|
||||
|
||||
Reference in New Issue
Block a user