fix(catalog): preserve channel ClawHub specs

This commit is contained in:
Vincent Koc
2026-05-03 02:59:49 -07:00
parent a4c1c28a17
commit 961575ddf7
3 changed files with 42 additions and 3 deletions

View File

@@ -168,6 +168,40 @@ describe("buildOfficialChannelCatalog", () => {
expect(installSource.warnings).toEqual(["npm-spec-floating", "npm-spec-missing-integrity"]);
});
it("preserves ClawHub specs when generating publishable channel catalog entries", () => {
const repoRoot = makeRepoRoot("openclaw-official-channel-catalog-clawhub-");
writeJson(path.join(repoRoot, "extensions", "storepack-chat", "package.json"), {
name: "@openclaw/storepack-chat",
openclaw: {
channel: {
id: "storepack-chat",
label: "Storepack Chat",
selectionLabel: "Storepack Chat",
docsPath: "/channels/storepack-chat",
blurb: "storepack-first channel",
},
install: {
clawhubSpec: "clawhub:@openclaw/storepack-chat",
npmSpec: "@openclaw/storepack-chat",
defaultChoice: "clawhub",
},
release: {
publishToNpm: true,
},
},
});
const entry = buildOfficialChannelCatalog({ repoRoot }).entries.find(
(candidate) => candidate.openclaw?.channel?.id === "storepack-chat",
);
expect(entry?.openclaw?.install).toEqual({
clawhubSpec: "clawhub:@openclaw/storepack-chat",
npmSpec: "@openclaw/storepack-chat",
defaultChoice: "clawhub",
});
});
it("writes the official catalog under dist", () => {
const repoRoot = makeRepoRoot("openclaw-official-channel-catalog-write-");
writeJson(path.join(repoRoot, "extensions", "whatsapp", "package.json"), {