diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index ebbd3030..90d44064 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -17,7 +17,7 @@ jobs: - uses: oven-sh/setup-bun@v1 with: - bun-version: 1.2.19 + bun-version: 1.2.21 - run: bun install diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index f7f12c36..e7870230 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -18,7 +18,7 @@ jobs: - name: Setup Bun uses: oven-sh/setup-bun@v1 with: - bun-version: 1.2.19 + bun-version: 1.2.21 - name: Install dependencies run: bun install diff --git a/.github/workflows/publish-vscode.yml b/.github/workflows/publish-vscode.yml index 5cb406f6..f40c9379 100644 --- a/.github/workflows/publish-vscode.yml +++ b/.github/workflows/publish-vscode.yml @@ -21,7 +21,7 @@ jobs: - uses: oven-sh/setup-bun@v2 with: - bun-version: 1.2.19 + bun-version: 1.2.21 - run: git fetch --force --tags - run: bun install -g @vscode/vsce diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index cf9c547d..645a7b50 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -37,7 +37,7 @@ jobs: - uses: oven-sh/setup-bun@v2 with: - bun-version: 1.2.19 + bun-version: 1.2.21 - name: Cache ~/.bun id: cache-bun diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml index 01aa398b..2d24d45e 100644 --- a/.github/workflows/typecheck.yml +++ b/.github/workflows/typecheck.yml @@ -15,7 +15,7 @@ jobs: - name: Setup Bun uses: oven-sh/setup-bun@v1 with: - bun-version: 1.2.19 + bun-version: 1.2.21 - name: Install dependencies run: bun install diff --git a/bun.lock b/bun.lock index 8381e898..3846f2db 100644 --- a/bun.lock +++ b/bun.lock @@ -26,7 +26,7 @@ }, "cloud/core": { "name": "@opencode/cloud-core", - "version": "0.6.4", + "version": "0.6.10", "dependencies": { "@aws-sdk/client-sts": "3.782.0", "@opencode/cloud-resource": "workspace:*", @@ -43,7 +43,7 @@ }, "cloud/function": { "name": "@opencode/cloud-function", - "version": "0.6.4", + "version": "0.6.10", "dependencies": { "@ai-sdk/anthropic": "2.0.0", "@ai-sdk/openai": "2.0.2", @@ -69,7 +69,7 @@ }, "cloud/scripts": { "name": "@opencode/cloud-scripts", - "version": "0.6.4", + "version": "0.6.10", "dependencies": { "@opencode/cloud-core": "workspace:*", "tsx": "4.20.5", @@ -81,7 +81,7 @@ }, "packages/function": { "name": "@opencode/function", - "version": "0.6.4", + "version": "0.6.10", "dependencies": { "@octokit/auth-app": "8.0.1", "@octokit/rest": "22.0.0", @@ -96,7 +96,7 @@ }, "packages/opencode": { "name": "opencode", - "version": "0.6.4", + "version": "0.6.10", "bin": { "opencode": "./bin/opencode", }, @@ -136,7 +136,7 @@ "@octokit/webhooks-types": "7.6.1", "@standard-schema/spec": "1.0.0", "@tsconfig/bun": "1.0.7", - "@types/bun": "latest", + "@types/bun": "catalog:", "@types/turndown": "5.0.5", "@types/yargs": "17.0.33", "typescript": "catalog:", @@ -146,7 +146,7 @@ }, "packages/plugin": { "name": "@opencode-ai/plugin", - "version": "0.6.4", + "version": "0.6.10", "dependencies": { "@opencode-ai/sdk": "workspace:*", }, @@ -157,7 +157,7 @@ }, "packages/sdk/js": { "name": "@opencode-ai/sdk", - "version": "0.6.4", + "version": "0.6.10", "dependencies": { "@hey-api/openapi-ts": "0.81.0", }, @@ -169,7 +169,7 @@ }, "packages/web": { "name": "@opencode/web", - "version": "0.6.4", + "version": "0.6.10", "dependencies": { "@astrojs/cloudflare": "12.6.3", "@astrojs/markdown-remark": "6.3.1", @@ -217,6 +217,7 @@ "catalog": { "@hono/zod-validator": "0.4.2", "@tsconfig/node22": "22.0.2", + "@types/bun": "1.2.21", "@types/node": "22.13.9", "ai": "5.0.8", "hono": "4.7.10", @@ -492,7 +493,7 @@ "@hey-api/json-schema-ref-parser": ["@hey-api/json-schema-ref-parser@1.0.6", "", { "dependencies": { "@jsdevtools/ono": "^7.1.3", "@types/json-schema": "^7.0.15", "js-yaml": "^4.1.0", "lodash": "^4.17.21" } }, "sha512-yktiFZoWPtEW8QKS65eqKwA5MTKp88CyiL8q72WynrBs/73SAaxlSWlA2zW/DZlywZ5hX1OYzrCC0wFdvO9c2w=="], - "@hey-api/openapi-ts": ["@hey-api/openapi-ts@0.81.0", "", { "dependencies": { "@hey-api/json-schema-ref-parser": "1.0.6", "ansi-colors": "4.1.3", "c12": "2.0.1", "color-support": "1.1.3", "commander": "13.0.0", "handlebars": "4.7.8", "js-yaml": "4.1.0", "open": "10.1.2", "semver": "7.7.2" }, "peerDependencies": { "typescript": "^5.5.3" }, "bin": { "openapi-ts": "bin/index.cjs" } }, "sha512-PoJukNBkUfHOoMDpN33bBETX49TUhy7Hu8Sa0jslOvFndvZ5VjQr4Nl/Dzjb9LG1Lp5HjybyTJMA6a1zYk/q6A=="], + "@hey-api/openapi-ts": ["@hey-api/openapi-ts@0.80.1", "", { "dependencies": { "@hey-api/json-schema-ref-parser": "1.0.6", "ansi-colors": "4.1.3", "c12": "2.0.1", "color-support": "1.1.3", "commander": "13.0.0", "handlebars": "4.7.8", "open": "10.1.2", "semver": "7.7.2" }, "peerDependencies": { "typescript": "^5.5.3" }, "bin": { "openapi-ts": "bin/index.cjs" } }, "sha512-AC478kg36vmmrseLZNFonZ/cmXXmDzW5yWz4PVg1S8ebJsRtVRJ/QU+mtnXfzf9avN2P0pz/AO4WAe4jyFY2gA=="], "@hono/zod-validator": ["@hono/zod-validator@0.4.2", "", { "peerDependencies": { "hono": ">=3.9.0", "zod": "^3.19.1" } }, "sha512-1rrlBg+EpDPhzOV4hT9pxr5+xDVmKuz6YJl+la7VCwK6ass5ldyKm5fD+umJdV2zhHD6jROoCCv8NbTwyfhT0g=="], @@ -3082,6 +3083,8 @@ "@openauthjs/openauth/jose": ["jose@5.9.6", "", {}, "sha512-AMlnetc9+CV9asI19zHmrgS/WYsWUwCn2R7RzlbJWD7F9eWYUTGyBmU9o6PxngtLGOiDGPRu+Uc4fhKzbpteZQ=="], + "@opencode-ai/sdk/@hey-api/openapi-ts": ["@hey-api/openapi-ts@0.81.0", "", { "dependencies": { "@hey-api/json-schema-ref-parser": "1.0.6", "ansi-colors": "4.1.3", "c12": "2.0.1", "color-support": "1.1.3", "commander": "13.0.0", "handlebars": "4.7.8", "js-yaml": "4.1.0", "open": "10.1.2", "semver": "7.7.2" }, "peerDependencies": { "typescript": "^5.5.3" }, "bin": { "openapi-ts": "bin/index.cjs" } }, "sha512-PoJukNBkUfHOoMDpN33bBETX49TUhy7Hu8Sa0jslOvFndvZ5VjQr4Nl/Dzjb9LG1Lp5HjybyTJMA6a1zYk/q6A=="], + "@opencode/cloud-resource/@cloudflare/workers-types": ["@cloudflare/workers-types@4.20250830.0", "", {}, "sha512-uAGZFqEBFnCiwIokxMnrrtjIkT8qyGT1LACSScEUyW7nKmtD0Viykp9QZWrIlssyEp/MDB6XsdALF8y6upxpcg=="], "@opentelemetry/instrumentation-grpc/@opentelemetry/semantic-conventions": ["@opentelemetry/semantic-conventions@1.27.0", "", {}, "sha512-sAay1RrB+ONOem0OZanAR1ZI/k7yDpnOQSQmTMuGImUQb2y8EbSaCJ94FQluM74xoU03vlb2d2U90hZluL6nQg=="], diff --git a/github/package.json b/github/package.json index 3be63d33..06db814a 100644 --- a/github/package.json +++ b/github/package.json @@ -4,7 +4,7 @@ "type": "module", "private": true, "devDependencies": { - "@types/bun": "latest" + "@types/bun": "catalog:" }, "peerDependencies": { "typescript": "^5" diff --git a/package.json b/package.json index 78a0e543..68ca4f41 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "name": "opencode", "private": true, "type": "module", - "packageManager": "bun@1.2.19", + "packageManager": "bun@1.2.21", "scripts": { "dev": "bun run --conditions=development packages/opencode/src/index.ts", "typecheck": "bun run --filter='*' typecheck", @@ -17,6 +17,7 @@ "packages/sdk/js" ], "catalog": { + "@types/bun": "1.2.21", "@hono/zod-validator": "0.4.2", "@types/node": "22.13.9", "@tsconfig/node22": "22.0.2", diff --git a/packages/opencode/package.json b/packages/opencode/package.json index 4d86c23b..93045cda 100644 --- a/packages/opencode/package.json +++ b/packages/opencode/package.json @@ -19,7 +19,7 @@ "@octokit/webhooks-types": "7.6.1", "@standard-schema/spec": "1.0.0", "@tsconfig/bun": "1.0.7", - "@types/bun": "latest", + "@types/bun": "catalog:", "@types/turndown": "5.0.5", "@types/yargs": "17.0.33", "typescript": "catalog:", diff --git a/packages/opencode/script/publish.ts b/packages/opencode/script/publish.ts index 0de48fe6..44af7ad9 100755 --- a/packages/opencode/script/publish.ts +++ b/packages/opencode/script/publish.ts @@ -38,7 +38,20 @@ 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", ) - 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` + await Bun.build({ + compile: { + target: `bun-${os}-${arch}` as any, + outfile: `dist/${name}/bin/opencode`, + execArgv: [`--user-agent=opencode/${version}`], + windows: {}, + }, + entrypoints: ["./src/index.ts"], + define: { + OPENCODE_VERSION: `'${version}'`, + OPENCODE_TUI_PATH: `'../../../dist/${name}/bin/tui'`, + }, + }) + // 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` // Run the binary only if it matches current OS/arch if ( process.platform === (os === "windows" ? "win32" : os) && diff --git a/script/publish.ts b/script/publish.ts index c0f79bb9..9b3ea450 100755 --- a/script/publish.ts +++ b/script/publish.ts @@ -2,6 +2,10 @@ import { $ } from "bun" +if (process.versions.bun !== "1.2.21") { + throw new Error("This script requires bun@1.2.21") +} + console.log("=== publishing ===\n") const snapshot = process.env["OPENCODE_SNAPSHOT"] === "true"