From a1554c7b37db5c9049ad7b4e8841367307cc4020 Mon Sep 17 00:00:00 2001 From: aoright <102943475+aoright@users.noreply.github.com> Date: Mon, 17 Aug 2026 09:59:25 +0800 Subject: [PATCH 1/2] fix(scripts): validate manifest versions against canonical root plugin.json Signed-off-by: aoright <102943475+aoright@users.noreply.github.com> --- scripts/validate-versions-test.js | 9 +++------ scripts/validate-versions.js | 9 ++++----- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/scripts/validate-versions-test.js b/scripts/validate-versions-test.js index e39f1049..813c00be 100644 --- a/scripts/validate-versions-test.js +++ b/scripts/validate-versions-test.js @@ -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( diff --git a/scripts/validate-versions.js b/scripts/validate-versions.js index 6f47248d..34128351 100644 --- a/scripts/validate-versions.js +++ b/scripts/validate-versions.js @@ -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); From 74b9892d3a4234bb31b0cb457052efba270a071b Mon Sep 17 00:00:00 2001 From: aoright <102943475+aoright@users.noreply.github.com> Date: Wed, 23 Sep 2026 18:06:59 +0800 Subject: [PATCH 2/2] fix(scripts): drop unused execFileSync imports Signed-off-by: aoright <102943475+aoright@users.noreply.github.com> --- scripts/validate-versions-test.js | 1 - scripts/validate-versions.js | 1 - 2 files changed, 2 deletions(-) diff --git a/scripts/validate-versions-test.js b/scripts/validate-versions-test.js index 813c00be..6814ad94 100644 --- a/scripts/validate-versions-test.js +++ b/scripts/validate-versions-test.js @@ -1,7 +1,6 @@ "use strict"; const assert = require("node:assert/strict"); -const { execFileSync } = require("node:child_process"); const { readFileSync } = require("node:fs"); const test = require("node:test"); diff --git a/scripts/validate-versions.js b/scripts/validate-versions.js index 34128351..68bf72ec 100644 --- a/scripts/validate-versions.js +++ b/scripts/validate-versions.js @@ -2,7 +2,6 @@ "use strict"; -const { execFileSync } = require("node:child_process"); const { readFileSync } = require("node:fs"); const manifestPaths = [