Skip to content

Commit a6265ea

Browse files
committed
upgrade to latest bun
1 parent bb3f02b commit a6265ea

File tree

11 files changed

+40
-19
lines changed

11 files changed

+40
-19
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
- uses: oven-sh/setup-bun@v1
1919
with:
20-
bun-version: 1.2.19
20+
bun-version: 1.2.21
2121

2222
- run: bun install
2323

.github/workflows/format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Setup Bun
1919
uses: oven-sh/setup-bun@v1
2020
with:
21-
bun-version: 1.2.19
21+
bun-version: 1.2.21
2222

2323
- name: Install dependencies
2424
run: bun install

.github/workflows/publish-vscode.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
- uses: oven-sh/setup-bun@v2
2323
with:
24-
bun-version: 1.2.19
24+
bun-version: 1.2.21
2525

2626
- run: git fetch --force --tags
2727
- run: bun install -g @vscode/vsce

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737

3838
- uses: oven-sh/setup-bun@v2
3939
with:
40-
bun-version: 1.2.19
40+
bun-version: 1.2.21
4141

4242
- name: Cache ~/.bun
4343
id: cache-bun

.github/workflows/typecheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Setup Bun
1616
uses: oven-sh/setup-bun@v1
1717
with:
18-
bun-version: 1.2.19
18+
bun-version: 1.2.21
1919

2020
- name: Install dependencies
2121
run: bun install

bun.lock

Lines changed: 13 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"type": "module",
55
"private": true,
66
"devDependencies": {
7-
"@types/bun": "latest"
7+
"@types/bun": "catalog:"
88
},
99
"peerDependencies": {
1010
"typescript": "^5"

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "opencode",
44
"private": true,
55
"type": "module",
6-
"packageManager": "bun@1.2.19",
6+
"packageManager": "bun@1.2.21",
77
"scripts": {
88
"dev": "bun run --conditions=development packages/opencode/src/index.ts",
99
"typecheck": "bun run --filter='*' typecheck",
@@ -17,6 +17,7 @@
1717
"packages/sdk/js"
1818
],
1919
"catalog": {
20+
"@types/bun": "1.2.21",
2021
"@hono/zod-validator": "0.4.2",
2122
"@types/node": "22.13.9",
2223
"@tsconfig/node22": "22.0.2",

packages/opencode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"@octokit/webhooks-types": "7.6.1",
2020
"@standard-schema/spec": "1.0.0",
2121
"@tsconfig/bun": "1.0.7",
22-
"@types/bun": "latest",
22+
"@types/bun": "catalog:",
2323
"@types/turndown": "5.0.5",
2424
"@types/yargs": "17.0.33",
2525
"typescript": "catalog:",

packages/opencode/script/publish.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,20 @@ for (const [os, arch] of targets) {
3838
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(
3939
"../tui",
4040
)
41-
await $`bun build --define OPENCODE_TUI_PATH="'../../../dist/${name}/bin/tui'" --define OPENCODE_VERSION="'${version}'" --compile --target=bun-${os}-${arch} --outfile=dist/${name}/bin/opencode ./src/index.ts`
41+
await Bun.build({
42+
compile: {
43+
target: `bun-${os}-${arch}` as any,
44+
outfile: `dist/${name}/bin/opencode`,
45+
execArgv: [`--user-agent=opencode/${version}`],
46+
windows: {},
47+
},
48+
entrypoints: ["./src/index.ts"],
49+
define: {
50+
OPENCODE_VERSION: `'${version}'`,
51+
OPENCODE_TUI_PATH: `'../../../dist/${name}/bin/tui'`,
52+
},
53+
})
54+
// await $`bun build --define OPENCODE_TUI_PATH="'../../../dist/${name}/bin/tui'" --define OPENCODE_VERSION="'${version}'" --compile --target=bun-${os}-${arch} --outfile=dist/${name}/bin/opencode ./src/index.ts`
4255
// Run the binary only if it matches current OS/arch
4356
if (
4457
process.platform === (os === "windows" ? "win32" : os) &&

0 commit comments

Comments
 (0)