From 65a18700fa56f098ad30da01f0063c97ae78d2bf Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Sun, 21 Sep 2025 02:36:50 -0400 Subject: [PATCH] sync --- bun.lock | 1 + packages/opencode/package.json | 1 + packages/opencode/script/build.ts | 11 +++++++++++ 3 files changed, 13 insertions(+) diff --git a/bun.lock b/bun.lock index 8ed9e69bc5..a457455e56 100644 --- a/bun.lock +++ b/bun.lock @@ -177,6 +177,7 @@ "devDependencies": { "@ai-sdk/amazon-bedrock": "2.2.10", "@octokit/webhooks-types": "7.6.1", + "@opentui/core-win32-x64": "0.1.24", "@standard-schema/spec": "1.0.0", "@tsconfig/bun": "1.0.7", "@types/bun": "catalog:", diff --git a/packages/opencode/package.json b/packages/opencode/package.json index 85d442e698..b1dc2d1f00 100644 --- a/packages/opencode/package.json +++ b/packages/opencode/package.json @@ -18,6 +18,7 @@ "devDependencies": { "@ai-sdk/amazon-bedrock": "2.2.10", "@octokit/webhooks-types": "7.6.1", + "@opentui/core-win32-x64": "0.1.24", "@standard-schema/spec": "1.0.0", "@tsconfig/bun": "1.0.7", "@types/bun": "catalog:", diff --git a/packages/opencode/script/build.ts b/packages/opencode/script/build.ts index f54c8ab0df..3cf3370de2 100755 --- a/packages/opencode/script/build.ts +++ b/packages/opencode/script/build.ts @@ -1,7 +1,11 @@ #!/usr/bin/env bun + +import solidPlugin from "../../../node_modules/@opentui/solid/scripts/solid-plugin" + const dir = new URL("..", import.meta.url).pathname process.chdir(dir) import { $ } from "bun" +import path from "path" import pkg from "../package.json" @@ -32,7 +36,14 @@ for (const [os, arch] of targets) { await $`CGO_ENABLED=0 GOOS=${os} GOARCH=${GOARCH[arch]} go build -ldflags="-s -w -X main.Version=${version}" -o ../opencode/dist/${name}/bin/tui ../tui/cmd/opencode/main.go`.cwd( "../tui", ) + const opentui = `@opentui/core-${os === "windows" ? "win32" : os}-${arch.replace("-baseline", "")}` + await $`mkdir -p ../../node_modules/${opentui}` + await $`npm pack npm pack ${opentui}`.cwd(path.join(dir, "../../node_modules")) + await $`tar -xf ../../node_modules/${opentui.replace("@opentui/", "opentui-")}-*.tgz -C ../../node_modules/${opentui} --strip-components=1` await Bun.build({ + conditions: ["browser"], + tsconfig: "./tsconfig.json", + plugins: [solidPlugin], compile: { target: `bun-${os}-${arch}` as any, outfile: `dist/${name}/bin/opencode`,