From 74e6c210c01004c612d7a4cafc134b205d459fbe Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 21 Feb 2026 17:48:21 +0100 Subject: [PATCH] fix: ignore prerelease suffixes in release-check plugin version checks --- scripts/release-check.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/release-check.ts b/scripts/release-check.ts index 0555cd66f03..7e2bd449044 100755 --- a/scripts/release-check.ts +++ b/scripts/release-check.ts @@ -21,6 +21,10 @@ type PackageJson = { version?: string; }; +function normalizePluginSyncVersion(version: string): string { + return version.replace(/[-+].*$/, ""); +} + function runPackDry(): PackResult[] { const raw = execSync("npm pack --dry-run --json --ignore-scripts", { encoding: "utf8", @@ -34,8 +38,9 @@ function checkPluginVersions() { const rootPackagePath = resolve("package.json"); const rootPackage = JSON.parse(readFileSync(rootPackagePath, "utf8")) as PackageJson; const targetVersion = rootPackage.version; + const targetBaseVersion = targetVersion ? normalizePluginSyncVersion(targetVersion) : null; - if (!targetVersion) { + if (!targetVersion || !targetBaseVersion) { console.error("release-check: root package.json missing version."); process.exit(1); } @@ -60,13 +65,15 @@ function checkPluginVersions() { continue; } - if (pkg.version !== targetVersion) { + if (normalizePluginSyncVersion(pkg.version) !== targetBaseVersion) { mismatches.push(`${pkg.name} (${pkg.version})`); } } if (mismatches.length > 0) { - console.error(`release-check: plugin versions must match ${targetVersion}:`); + console.error( + `release-check: plugin versions must match release base ${targetBaseVersion} (root ${targetVersion}):`, + ); for (const item of mismatches) { console.error(` - ${item}`); }