|
@@ -16,6 +16,7 @@ import pkg from "../package.json"
|
|
|
import { Script } from "@opencode-ai/script"
|
|
import { Script } from "@opencode-ai/script"
|
|
|
|
|
|
|
|
const singleFlag = process.argv.includes("--single")
|
|
const singleFlag = process.argv.includes("--single")
|
|
|
|
|
+const skipInstall = process.argv.includes("--skip-install")
|
|
|
|
|
|
|
|
const allTargets: {
|
|
const allTargets: {
|
|
|
os: string
|
|
os: string
|
|
@@ -83,8 +84,10 @@ const targets = singleFlag
|
|
|
await $`rm -rf dist`
|
|
await $`rm -rf dist`
|
|
|
|
|
|
|
|
const binaries: Record<string, string> = {}
|
|
const binaries: Record<string, string> = {}
|
|
|
-await $`bun install --os="*" --cpu="*" @opentui/core@${pkg.dependencies["@opentui/core"]}`
|
|
|
|
|
-await $`bun install --os="*" --cpu="*" @parcel/watcher@${pkg.dependencies["@parcel/watcher"]}`
|
|
|
|
|
|
|
+if (!skipInstall) {
|
|
|
|
|
+ await $`bun install --os="*" --cpu="*" @opentui/core@${pkg.dependencies["@opentui/core"]}`
|
|
|
|
|
+ await $`bun install --os="*" --cpu="*" @parcel/watcher@${pkg.dependencies["@parcel/watcher"]}`
|
|
|
|
|
+}
|
|
|
for (const item of targets) {
|
|
for (const item of targets) {
|
|
|
const name = [
|
|
const name = [
|
|
|
pkg.name,
|
|
pkg.name,
|
|
@@ -102,6 +105,10 @@ for (const item of targets) {
|
|
|
const parserWorker = fs.realpathSync(path.resolve(dir, "./node_modules/@opentui/core/parser.worker.js"))
|
|
const parserWorker = fs.realpathSync(path.resolve(dir, "./node_modules/@opentui/core/parser.worker.js"))
|
|
|
const workerPath = "./src/cli/cmd/tui/worker.ts"
|
|
const workerPath = "./src/cli/cmd/tui/worker.ts"
|
|
|
|
|
|
|
|
|
|
+ // Use platform-specific bunfs root path based on target OS
|
|
|
|
|
+ const bunfsRoot = item.os === "win32" ? "B:/~BUN/root/" : "/$bunfs/root/"
|
|
|
|
|
+ const workerRelativePath = path.relative(dir, parserWorker).replaceAll("\\", "/")
|
|
|
|
|
+
|
|
|
await Bun.build({
|
|
await Bun.build({
|
|
|
conditions: ["browser"],
|
|
conditions: ["browser"],
|
|
|
tsconfig: "./tsconfig.json",
|
|
tsconfig: "./tsconfig.json",
|
|
@@ -118,7 +125,7 @@ for (const item of targets) {
|
|
|
entrypoints: ["./src/index.ts", parserWorker, workerPath],
|
|
entrypoints: ["./src/index.ts", parserWorker, workerPath],
|
|
|
define: {
|
|
define: {
|
|
|
OPENCODE_VERSION: `'${Script.version}'`,
|
|
OPENCODE_VERSION: `'${Script.version}'`,
|
|
|
- OTUI_TREE_SITTER_WORKER_PATH: "/$bunfs/root/" + path.relative(dir, parserWorker).replaceAll("\\", "/"),
|
|
|
|
|
|
|
+ OTUI_TREE_SITTER_WORKER_PATH: bunfsRoot + workerRelativePath,
|
|
|
OPENCODE_WORKER_PATH: workerPath,
|
|
OPENCODE_WORKER_PATH: workerPath,
|
|
|
OPENCODE_CHANNEL: `'${Script.channel}'`,
|
|
OPENCODE_CHANNEL: `'${Script.channel}'`,
|
|
|
},
|
|
},
|