Skip to content

Commit 17c4202

Browse files
fix(opencode): Allow compatible Bun versions in packageManager field (#9597)
Co-authored-by: Aiden Cline <[email protected]> Co-authored-by: Aiden Cline <[email protected]>
1 parent 7170983 commit 17c4202

5 files changed

Lines changed: 12 additions & 3 deletions

File tree

bun.lock

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

nix/hashes.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"nodeModules": {
3-
"x86_64-linux": "sha256-80+b7FwUy4mRWTzEjPrBWuR5Um67I1Rn4U/n/s/lBjs=",
3+
"x86_64-linux": "sha256-AbPldHboLnT/sRYYEBKBx0EsQtA3uIOn85sl3rsg56s=",
44
"aarch64-linux": "sha256-xH/Grwh3b+HWsUkKN8LMcyMaMcmnIJYlgp38WJCat5E=",
55
"aarch64-darwin": "sha256-Izv6PE9gNaeYYfcqDwjTU/WYtD1y+j65annwvLzkMD8=",
66
"x86_64-darwin": "sha256-EG1Z0uAeyFiOeVsv0Sz1sa8/mdXuw/uvbYYrkFR3EAg="

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"@kobalte/core": "0.13.11",
2929
"@types/luxon": "3.7.1",
3030
"@types/node": "22.13.9",
31+
"@types/semver": "7.7.1",
3132
"@tsconfig/node22": "22.0.2",
3233
"@tsconfig/bun": "1.0.9",
3334
"@cloudflare/workers-types": "4.20251008.0",
@@ -66,6 +67,7 @@
6667
"@tsconfig/bun": "catalog:",
6768
"husky": "9.1.7",
6869
"prettier": "3.6.2",
70+
"semver": "^7.6.0",
6971
"sst": "3.17.23",
7072
"turbo": "2.5.6"
7173
},

packages/script/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"name": "@opencode-ai/script",
44
"license": "MIT",
55
"devDependencies": {
6-
"@types/bun": "catalog:"
6+
"@types/bun": "catalog:",
7+
"@types/semver": "catalog:"
78
},
89
"exports": {
910
".": "./src/index.ts"

packages/script/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { $ } from "bun"
22
import path from "path"
3+
import { satisfies } from "semver"
34

45
const rootPkgPath = path.resolve(import.meta.dir, "../../../package.json")
56
const rootPkg = await Bun.file(rootPkgPath).json()
@@ -9,7 +10,7 @@ if (!expectedBunVersion) {
910
throw new Error("packageManager field not found in root package.json")
1011
}
1112

12-
if (process.versions.bun !== expectedBunVersion) {
13+
if (!satisfies(process.versions.bun, expectedBunVersion)) {
1314
throw new Error(`This script requires bun@${expectedBunVersion}, but you are using bun@${process.versions.bun}`)
1415
}
1516

0 commit comments

Comments
 (0)