opencode/packages/cli-rs/script/generate.ts
Simon Klee 271fc7c26d
feat(cli-rs): scaffold the Rust client workspace
Add packages/cli-rs: a Cargo workspace with the 14 crates of the plan,
module stubs for api, local, service, store, and ui, and the expected
third-party crates in [workspace.dependencies]. opentui is a path
dependency on the local opentui-rust checkout, linked statically.

script/opentui-lib.sh copies native artifacts whose header matches the
bindings into ~/.cache/opencode-rs/opentui, where .cargo/config.toml
points OPENTUI_LIB_DIR. opencode-rs --version runs; script/live.sh
runs it against the elected background service.
2026-11-04 17:52:34 +01:00

10 lines
556 B
TypeScript

// Runs every generator in script/gen in name order. Each writes its own output under crates/.
const root = new URL("..", import.meta.url).pathname
const scripts = Array.from(new Bun.Glob("script/gen/*.ts").scanSync({ cwd: root })).sort()
for (const script of scripts) {
console.log(`generate: ${script}`)
const proc = Bun.spawnSync(["bun", "run", script], { cwd: root, stdout: "inherit", stderr: "inherit" })
if (proc.exitCode !== 0) process.exit(proc.exitCode ?? 1)
}
if (scripts.length === 0) console.log("generate: no generators in script/gen")