refactor: validate bundled extension release metadata

This commit is contained in:
Peter Steinberger
2026-03-08 17:00:47 +00:00
parent e53d840fed
commit f493b03202
2 changed files with 109 additions and 8 deletions

View File

@@ -1,6 +1,7 @@
import { describe, expect, it } from "vitest";
import {
collectAppcastSparkleVersionErrors,
collectBundledExtensionManifestErrors,
collectBundledExtensionRootDependencyGapErrors,
} from "../scripts/release-check.ts";
@@ -110,3 +111,42 @@ describe("collectBundledExtensionRootDependencyGapErrors", () => {
]);
});
});
describe("collectBundledExtensionManifestErrors", () => {
it("flags invalid bundled extension install metadata", () => {
expect(
collectBundledExtensionManifestErrors([
{
id: "broken",
packageJson: {
openclaw: {
install: { npmSpec: " " },
},
},
},
]),
).toEqual([
"bundled extension 'broken' manifest invalid | openclaw.install.npmSpec must be a non-empty string",
]);
});
it("flags invalid release-check allowlist metadata", () => {
expect(
collectBundledExtensionManifestErrors([
{
id: "broken",
packageJson: {
openclaw: {
install: { npmSpec: "@openclaw/broken" },
releaseChecks: {
rootDependencyMirrorAllowlist: ["ok", ""],
},
},
},
},
]),
).toEqual([
"bundled extension 'broken' manifest invalid | openclaw.releaseChecks.rootDependencyMirrorAllowlist must contain only non-empty strings",
]);
});
});