浏览代码

chore(opencode): Use Bun.semver instead of node-semver (#9773)

Michael H 2 月之前
父节点
当前提交
0f979bb87c
共有 3 个文件被更改,包括 3 次插入8 次删除
  1. 0 3
      bun.lock
  2. 1 2
      packages/script/package.json
  3. 2 3
      packages/script/src/index.ts

+ 0 - 3
bun.lock

@@ -376,7 +376,6 @@
       "name": "@opencode-ai/script",
       "devDependencies": {
         "@types/bun": "catalog:",
-        "@types/semver": "catalog:",
       },
     },
     "packages/sdk/js": {
@@ -1855,8 +1854,6 @@
 
     "@types/scheduler": ["@types/[email protected]", "", {}, "sha512-WFHp9YUJQ6CKshqoC37iOlHnQSmxNc795UhB26CyBBttrN9svdIrUjl/NjnNmfcwtncN0h/0PPAFWv9ovP8mLA=="],
 
-    "@types/semver": ["@types/[email protected]", "", {}, "sha512-FmgJfu+MOcQ370SD0ev7EI8TlCAfKYU+B4m5T3yXc1CiRN94g/SZPtsCkk506aUDtlMnFZvasDwHHUcZUEaYuA=="],
-
     "@types/send": ["@types/[email protected]", "", { "dependencies": { "@types/mime": "^1", "@types/node": "*" } }, "sha512-Uqt8rPBE8SY0RK8JB1EzVOIZ32uqy8HwdxCnoCOsYrvnswqmFZ/k+9Ikidlk/ImhsdvBsloHbAlewb2IEBV/Og=="],
 
     "@types/serve-static": ["@types/[email protected]", "", { "dependencies": { "@types/http-errors": "*", "@types/node": "*", "@types/send": "<1" } }, "sha512-tRs1dB+g8Itk72rlSI2ZrW6vZg0YrLI81iQSTkMmOqnqCaNr/8Ek4VwWcN5vZgCYWbg/JJSGBlUaYGAOP73qBw=="],

+ 1 - 2
packages/script/package.json

@@ -3,8 +3,7 @@
   "name": "@opencode-ai/script",
   "license": "MIT",
   "devDependencies": {
-    "@types/bun": "catalog:",
-    "@types/semver": "catalog:"
+    "@types/bun": "catalog:"
   },
   "exports": {
     ".": "./src/index.ts"

+ 2 - 3
packages/script/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}`)
 }