This commit is contained in:
Dax Raad
2026-03-26 20:40:28 -04:00
parent 282ab0f67d
commit 57f7d39281
6 changed files with 24 additions and 8 deletions

6
packages/opencode/script/build-node.ts Normal file → Executable file
View File

@@ -1,5 +1,6 @@
#!/usr/bin/env bun
import { $ } from "bun"
import fs from "fs"
import path from "path"
import { fileURLToPath } from "url"
@@ -40,12 +41,15 @@ const migrations = await Promise.all(
)
console.log(`Loaded ${migrations.length} migrations`)
await $`bun install --os="*" --cpu="*" @lydell/node-pty@1.2.0-beta.10`
await Bun.build({
target: "node",
entrypoints: ["./src/node.ts"],
outdir: "./dist",
format: "esm",
external: ["jsonc-parser", "node-pty"],
sourcemap: "linked",
external: ["jsonc-parser"],
define: {
OPENCODE_MIGRATIONS: JSON.stringify(migrations),
},