mirror of
https://github.com/addyosmani/agent-skills.git
synced 2026-10-26 15:05:04 +00:00
Merge #498: validate manifest versions against the root plugin.json
This commit is contained in:
2 files changed
+7
-13
No files matched your search
@@ -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");
|
||||
|
||||
@@ -18,12 +17,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(
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
const { execFileSync } = require("node:child_process");
|
||||
const { readFileSync } = require("node:fs");
|
||||
|
||||
const manifestPaths = [
|
||||
@@ -18,11 +17,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);
|
||||
|
||||
Reference in new issue
Block a user