Skip to content

Commit 8d0e288

Browse files
committed
fix(release): sync marketplace.json version on release
The sync-release-metadata.ts script updated package.json, server.json, plugin.json, and README.md badges, but skipped marketplace.json — so its plugin entry stayed pinned at 1.1.0 while the rest of the package moved to 1.21.2. Adds marketplace.json to the script (matching the plugin entry by package.json name) and to the @semantic-release/git assets array so the file is actually committed on release. One-time bump 1.1.0 → 1.21.2 included to bring the manifest into sync now.
1 parent 16ea3cc commit 8d0e288

3 files changed

Lines changed: 52 additions & 19 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
{
2-
"name": "agent-comms",
3-
"owner": {
4-
"name": "ExaDev"
5-
},
6-
"metadata": {
7-
"description": "Cross-harness communication mesh for LLM agents",
8-
"homepage": "https://github.com/ExaDev/agent-comms#readme"
9-
},
10-
"plugins": [
11-
{
12-
"name": "agent-comms",
13-
"source": {
14-
"source": "url",
15-
"url": "https://github.com/ExaDev/agent-comms.git"
16-
},
17-
"description": "Cross-harness LLM agent communication mesh — rooms, DMs, and presence",
18-
"version": "1.1.0"
19-
}
20-
]
2+
"name": "agent-comms",
3+
"owner": {
4+
"name": "ExaDev"
5+
},
6+
"metadata": {
7+
"description": "Cross-harness communication mesh for LLM agents",
8+
"homepage": "https://github.com/ExaDev/agent-comms#readme"
9+
},
10+
"plugins": [
11+
{
12+
"name": "agent-comms",
13+
"source": {
14+
"source": "url",
15+
"url": "https://github.com/ExaDev/agent-comms.git"
16+
},
17+
"description": "Cross-harness LLM agent communication mesh — rooms, DMs, and presence",
18+
"version": "1.22.0"
19+
}
20+
]
2121
}

release.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ const config: GlobalConfig = {
5858
"package.json",
5959
"pnpm-lock.yaml",
6060
".claude-plugin/plugin.json",
61+
".claude-plugin/marketplace.json",
6162
"server.json",
6263
"CHANGELOG.md",
6364
"README.md",

scripts/sync-release-metadata.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ function stringifyJson(value: JsonObject): string {
3333
const root = process.cwd();
3434
const packagePath = path.join(root, "package.json");
3535
const pluginPath = path.join(root, ".claude-plugin/plugin.json");
36+
const marketplacePath = path.join(root, ".claude-plugin/marketplace.json");
3637
const serverPath = path.join(root, "server.json");
3738
const readmePath = path.join(root, "README.md");
3839

@@ -44,6 +45,10 @@ const pluginObject = parseJsonObject(
4445
await readFile(pluginPath, "utf8"),
4546
".claude-plugin/plugin.json",
4647
);
48+
const marketplaceObject = parseJsonObject(
49+
await readFile(marketplacePath, "utf8"),
50+
".claude-plugin/marketplace.json",
51+
);
4752
const serverObject = parseJsonObject(
4853
await readFile(serverPath, "utf8"),
4954
"server.json",
@@ -65,6 +70,28 @@ const pluginVersion = requireString(
6570
".claude-plugin/plugin.json version",
6671
);
6772

73+
// marketplace.json contains a `plugins` array — find the entry whose name
74+
// matches package.json `name` and bump its version. Throw if the plugin
75+
// isn't declared at all, since that would silently leave the manifest stale.
76+
const marketplacePluginsValue = marketplaceObject.plugins;
77+
if (!isUnknownArray(marketplacePluginsValue)) {
78+
throw new Error(
79+
".claude-plugin/marketplace.json must declare a plugins array",
80+
);
81+
}
82+
const marketplacePluginEntry = marketplacePluginsValue.find(
83+
(entry): entry is JsonObject => isRecord(entry) && entry.name === packageName,
84+
);
85+
if (!marketplacePluginEntry) {
86+
throw new Error(
87+
`.claude-plugin/marketplace.json has no plugin entry named "${packageName}"`,
88+
);
89+
}
90+
const marketplacePluginVersion = requireString(
91+
marketplacePluginEntry.version,
92+
`.claude-plugin/marketplace.json plugins[name=${packageName}].version`,
93+
);
94+
6895
if (serverName !== mcpName) {
6996
throw new Error(
7097
`server.json name (${serverName}) must match package.json mcpName (${mcpName})`,
@@ -103,6 +130,7 @@ if (identifier !== packageName) {
103130
serverObject.version = packageVersion;
104131
packageEntryValue.version = packageVersion;
105132
pluginObject.version = packageVersion;
133+
marketplacePluginEntry.version = packageVersion;
106134

107135
const readmeContent = await readFile(readmePath, "utf8");
108136
const updatedReadme = readmeContent
@@ -114,6 +142,7 @@ const updatedReadme = readmeContent
114142

115143
const needsServerWrite = serverVersion !== packageVersion;
116144
const needsPluginWrite = pluginVersion !== packageVersion;
145+
const needsMarketplaceWrite = marketplacePluginVersion !== packageVersion;
117146
const needsReadmeWrite = readmeContent !== updatedReadme;
118147

119148
if (needsServerWrite) {
@@ -122,6 +151,9 @@ if (needsServerWrite) {
122151
if (needsPluginWrite) {
123152
await writeFile(pluginPath, stringifyJson(pluginObject));
124153
}
154+
if (needsMarketplaceWrite) {
155+
await writeFile(marketplacePath, stringifyJson(marketplaceObject));
156+
}
125157
if (needsReadmeWrite) {
126158
await writeFile(readmePath, updatedReadme);
127159
}

0 commit comments

Comments
 (0)