chore(opencode): Use Bun.semver instead of node-semver (#9773)
This commit is contained in:
parent
96e9c89cc6
commit
0f979bb87c
3 changed files with 3 additions and 8 deletions
|
|
@ -3,8 +3,7 @@
|
|||
"name": "@opencode-ai/script",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/bun": "catalog:",
|
||||
"@types/semver": "catalog:"
|
||||
"@types/bun": "catalog:"
|
||||
},
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import { $ } from "bun"
|
||||
import { $, semver } from "bun"
|
||||
import path from "path"
|
||||
import { satisfies } from "semver"
|
||||
|
||||
const rootPkgPath = path.resolve(import.meta.dir, "../../../package.json")
|
||||
const rootPkg = await Bun.file(rootPkgPath).json()
|
||||
|
|
@ -13,7 +12,7 @@ if (!expectedBunVersion) {
|
|||
// relax version requirement
|
||||
const expectedBunVersionRange = `^${expectedBunVersion}`
|
||||
|
||||
if (!satisfies(process.versions.bun, expectedBunVersionRange)) {
|
||||
if (!semver.satisfies(process.versions.bun, expectedBunVersionRange)) {
|
||||
throw new Error(`This script requires bun@${expectedBunVersionRange}, but you are using bun@${process.versions.bun}`)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue