mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 16:50:43 +00:00
build: prepare external plugin beta publishing
This commit is contained in:
@@ -69,6 +69,35 @@ describe("collectClawHubPublishablePluginPackages", () => {
|
||||
"Demo Plugin: extension directory name must match",
|
||||
);
|
||||
});
|
||||
|
||||
it("validates only selected package names when filters are provided", () => {
|
||||
const repoDir = createTempPluginRepo({
|
||||
extraExtensionIds: ["broken-plugin"],
|
||||
});
|
||||
writeFileSync(
|
||||
join(repoDir, "extensions", "broken-plugin", "package.json"),
|
||||
JSON.stringify(
|
||||
{
|
||||
name: "@openclaw/broken-plugin",
|
||||
version: "2026.4.1",
|
||||
openclaw: {
|
||||
extensions: ["./index.ts"],
|
||||
release: {
|
||||
publishToClawHub: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
null,
|
||||
2,
|
||||
),
|
||||
);
|
||||
|
||||
expect(
|
||||
collectClawHubPublishablePluginPackages(repoDir, {
|
||||
packageNames: ["@openclaw/demo-plugin"],
|
||||
}).map((plugin) => plugin.packageName),
|
||||
).toEqual(["@openclaw/demo-plugin"]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("collectClawHubVersionGateErrors", () => {
|
||||
@@ -238,6 +267,38 @@ describe("collectPluginClawHubReleasePlan", () => {
|
||||
version: "2026.4.1",
|
||||
});
|
||||
});
|
||||
|
||||
it("plans selected packages without validating unrelated publishable packages", async () => {
|
||||
const repoDir = createTempPluginRepo({
|
||||
extraExtensionIds: ["broken-plugin"],
|
||||
});
|
||||
writeFileSync(
|
||||
join(repoDir, "extensions", "broken-plugin", "package.json"),
|
||||
JSON.stringify(
|
||||
{
|
||||
name: "@openclaw/broken-plugin",
|
||||
version: "2026.4.1",
|
||||
openclaw: {
|
||||
extensions: ["./index.ts"],
|
||||
release: {
|
||||
publishToClawHub: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
null,
|
||||
2,
|
||||
),
|
||||
);
|
||||
|
||||
const plan = await collectPluginClawHubReleasePlan({
|
||||
rootDir: repoDir,
|
||||
selection: ["@openclaw/demo-plugin"],
|
||||
fetchImpl: async () => new Response("{}", { status: 404 }),
|
||||
registryBaseUrl: "https://clawhub.ai",
|
||||
});
|
||||
|
||||
expect(plan.candidates.map((plugin) => plugin.packageName)).toEqual(["@openclaw/demo-plugin"]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("collectPluginClawHubReleasePathsFromGitRange", () => {
|
||||
|
||||
Reference in New Issue
Block a user