Files
stanp-opencode/scripts/build.ts
T
StanPonomarev c48fe99b96
Release / release (push) Failing after 5s
chore: update opencode api to v2
2026-09-12 10:29:24 +02:00

29 lines
802 B
TypeScript

import solidPlugin from "@opentui/solid/bun-plugin";
export async function build() {
const results = await Promise.all([
Bun.build({
entrypoints: ["src/index.ts", "src/quota-rpc.ts"],
outdir: "dist",
target: "bun",
format: "esm",
}),
Bun.build({
entrypoints: ["src/tui.tsx"],
outdir: "dist",
target: "bun",
format: "esm",
external: ["@opencode/plugin/tui", "@opentui/solid", "solid-js"],
plugins: [solidPlugin],
}),
]);
for (const result of results) {
if (result.success) continue;
for (const log of result.logs) console.error(log);
throw new Error("Build failed");
}
}
if (import.meta.main) await build();