fix(scripts): validate manifest versions against canonical root plugin.json

Signed-off-by: aoright <102943475+aoright@users.noreply.github.com>
This commit is contained in:
aoright committed 2026-08-17 09:59:25 +08:00
1 parent df1edb2e05
commit a1554c7b37
2 files changed
+7 -11

No files matched your search

+3 -6
View File
@@ -18,12 +18,9 @@ function readManifestVersion(manifestPath) {
return manifest.version ?? manifest.plugins?.[0]?.version;
}
test("all plugin manifests use the latest release tag", () => {
const expectedVersion = execFileSync(
"git",
["describe", "--tags", "--abbrev=0"],
{ encoding: "utf8" },
).trim();
test("all plugin manifests use the root plugin.json version", () => {
const expectedVersion = readManifestVersion("plugin.json");
assert.ok(expectedVersion, "plugin.json must define a version");
for (const manifestPath of manifestPaths) {
assert.equal(
+4 -5
View File
@@ -18,11 +18,10 @@ function readManifestVersion(manifestPath) {
return manifest.version ?? manifest.plugins?.[0]?.version;
}
const expectedVersion = execFileSync(
"git",
["describe", "--tags", "--abbrev=0"],
{ encoding: "utf8" },
).trim();
const expectedVersion = readManifestVersion("plugin.json");
if (!expectedVersion) {
throw new Error("plugin.json is missing a version field");
}
for (const manifestPath of manifestPaths) {
const version = readManifestVersion(manifestPath);