The open source coding agent.
TypeScript
ci: centralize Bun version to package.json to ensure consistent builds across CI and local development
Dax Raadd1cd7d0344f8
diff --git a/.github/actions/setup-bun/action.yml b/.github/actions/setup-bun/action.ymlindex 108a53df2b8..b637ee7b748 100644--- a/.github/actions/setup-bun/action.yml+++ b/.github/actions/setup-bun/action.yml@@ -5,6 +5,8 @@ runs:steps:- name: Setup Bunuses: oven-sh/setup-bun@v2+ with:+ bun-version-file: package.json- name: Cache ~/.bunid: cache-bundiff --git a/packages/script/src/index.ts b/packages/script/src/index.tsindex 9453c2526ab..f1f1e45974a 100644--- a/packages/script/src/index.ts+++ b/packages/script/src/index.ts@@ -1,7 +1,18 @@import { $ } from "bun"+import path from "path"-if (process.versions.bun !== "1.3.1") {- throw new Error("This script requires [email protected]")+const rootPkgPath = path.resolve(import.meta.dir, "../../../package.json")+const rootPkg = await Bun.file(rootPkgPath).json()+const expectedBunVersion = rootPkg.packageManager?.split("@")[1]++if (!expectedBunVersion) {+ throw new Error("packageManager field not found in root package.json")+}++if (process.versions.bun !== expectedBunVersion) {+ throw new Error(+ `This script requires bun@${expectedBunVersion}, but you are using bun@${process.versions.bun}`,+ )}const CHANNEL =