fix(release): accept prerelease plugin min host floors · openclaw/openclaw@d43b985
steipete
·
2026-05-02
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -62,6 +62,10 @@ describe("min-host-version", () => {
|
62 | 62 | it("parses semver floors", () => { |
63 | 63 | expect(parseMinHostVersionRequirement(">=2026.3.22")).toEqual(MIN_HOST_REQUIREMENT); |
64 | 64 | expect(parseMinHostVersionRequirement(">=2026.5.1-beta.1")).toEqual(BETA_MIN_HOST_REQUIREMENT); |
| 65 | +expect(parseMinHostVersionRequirement(">=2026.5.1+20260501")).toEqual({ |
| 66 | +raw: ">=2026.5.1+20260501", |
| 67 | +minimumLabel: "2026.5.1+20260501", |
| 68 | +}); |
65 | 69 | }); |
66 | 70 | |
67 | 71 | it("can parse legacy bare semver floors for runtime upgrade compatibility", () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { isAtLeast, parseSemver } from "../infra/runtime-guard.js"; |
2 | 2 | |
3 | 3 | export const MIN_HOST_VERSION_FORMAT = |
4 | | -'openclaw.install.minHostVersion must use a semver floor in the form ">=x.y.z" or ">=x.y.z-prerelease"'; |
5 | | -const MIN_HOST_VERSION_RE = /^>=(\d+)\.(\d+)\.(\d+)(-[0-9A-Za-z.-]+)?$/; |
| 4 | +'openclaw.install.minHostVersion must use a semver floor in the form ">=x.y.z[-prerelease][+build]"'; |
| 5 | +const SEMVER_LABEL_RE = String.raw`\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?`; |
| 6 | +const MIN_HOST_VERSION_RE = new RegExp(`^>=(${SEMVER_LABEL_RE})$`); |
6 | 7 | const LEGACY_MIN_HOST_VERSION_RE = /^(\d+)\.(\d+)\.(\d+)$/; |
7 | 8 | |
8 | 9 | export type MinHostVersionRequirement = { |
@@ -40,7 +41,7 @@ export function parseMinHostVersionRequirement(
|
40 | 41 | if (!match) { |
41 | 42 | return null; |
42 | 43 | } |
43 | | -const minimumLabel = `${match[1]}.${match[2]}.${match[3]}${match[4] ?? ""}`; |
| 44 | +const minimumLabel = match.length >= 4 ? `${match[1]}.${match[2]}.${match[3]}` : (match[1] ?? ""); |
44 | 45 | if (!parseSemver(minimumLabel)) { |
45 | 46 | return null; |
46 | 47 | } |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -211,7 +211,7 @@ describe("collectBundledExtensionManifestErrors", () => {
|
211 | 211 | }, |
212 | 212 | ]), |
213 | 213 | ).toEqual([ |
214 | | -"bundled extension 'broken' manifest invalid | openclaw.install.minHostVersion must use a semver floor in the form \">=x.y.z\"", |
| 214 | +"bundled extension 'broken' manifest invalid | openclaw.install.minHostVersion must use a semver floor in the form \">=x.y.z[-prerelease][+build]\"", |
215 | 215 | ]); |
216 | 216 | }); |
217 | 217 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。