From cecd7ab92599f166fa25dfe6a456e14ed4a87dc3 Mon Sep 17 00:00:00 2001 From: lanyuanxiaoyao Date: Tue, 9 Jun 2026 18:01:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B7=BB=E5=8A=A0=20package.json=20vers?= =?UTF-8?q?ion=20=E5=AD=97=E6=AE=B5=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/release.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/release.ts b/scripts/release.ts index e3fbb89..761f215 100644 --- a/scripts/release.ts +++ b/scripts/release.ts @@ -66,6 +66,9 @@ async function selectBumpType(): Promise { async function stepBumpVersion(): Promise { const pkgPath = join(import.meta.dir, "..", "package.json"); const pkg = JSON.parse(readFileSync(pkgPath, "utf-8")) as { version: string }; + if (typeof pkg.version !== "string" || pkg.version.length === 0) { + throw new Error("package.json 中缺少有效的 version 字段"); + } const currentVersion = pkg.version; const bumpType = await selectBumpType();