From 00c2b38533872174c1cf340537aaadc26415df9c Mon Sep 17 00:00:00 2001 From: Affaan Mustafa Date: Sun, 12 Apr 2026 02:39:53 -0700 Subject: [PATCH] fix: keep codex marketplace metadata version-synced --- .agents/plugins/marketplace.json | 1 + scripts/release.sh | 26 ++++++++++++++++++++++++-- tests/plugin-manifest.test.js | 5 +++++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/.agents/plugins/marketplace.json b/.agents/plugins/marketplace.json index 14abfa12..b088fe52 100644 --- a/.agents/plugins/marketplace.json +++ b/.agents/plugins/marketplace.json @@ -6,6 +6,7 @@ "plugins": [ { "name": "ecc", + "version": "1.10.0", "source": { "source": "local", "path": "../.." diff --git a/scripts/release.sh b/scripts/release.sh index 5b780818..c75f5747 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -12,6 +12,7 @@ AGENT_YAML="agent.yaml" VERSION_FILE="VERSION" PLUGIN_JSON=".claude-plugin/plugin.json" MARKETPLACE_JSON=".claude-plugin/marketplace.json" +CODEX_MARKETPLACE_JSON=".agents/plugins/marketplace.json" CODEX_PLUGIN_JSON=".codex-plugin/plugin.json" OPENCODE_PACKAGE_JSON=".opencode/package.json" OPENCODE_PACKAGE_LOCK_JSON=".opencode/package-lock.json" @@ -50,7 +51,7 @@ if ! git diff --quiet || ! git diff --cached --quiet; then fi # Verify versioned manifests exist -for FILE in "$ROOT_PACKAGE_JSON" "$PACKAGE_LOCK_JSON" "$ROOT_AGENTS_MD" "$AGENT_YAML" "$VERSION_FILE" "$PLUGIN_JSON" "$MARKETPLACE_JSON" "$CODEX_PLUGIN_JSON" "$OPENCODE_PACKAGE_JSON" "$OPENCODE_PACKAGE_LOCK_JSON" "$README_FILE"; do +for FILE in "$ROOT_PACKAGE_JSON" "$PACKAGE_LOCK_JSON" "$ROOT_AGENTS_MD" "$AGENT_YAML" "$VERSION_FILE" "$PLUGIN_JSON" "$MARKETPLACE_JSON" "$CODEX_MARKETPLACE_JSON" "$CODEX_PLUGIN_JSON" "$OPENCODE_PACKAGE_JSON" "$OPENCODE_PACKAGE_LOCK_JSON" "$README_FILE"; do if [[ ! -f "$FILE" ]]; then echo "Error: $FILE not found" exit 1 @@ -158,6 +159,26 @@ update_version_file() { printf '%s\n' "$VERSION" > "$VERSION_FILE" } +update_codex_marketplace_version() { + node -e ' + const fs = require("fs"); + const file = process.argv[1]; + const version = process.argv[2]; + const marketplace = JSON.parse(fs.readFileSync(file, "utf8")); + if (!marketplace || typeof marketplace !== "object" || !Array.isArray(marketplace.plugins)) { + console.error(`Error: ${file} does not contain a marketplace plugins array`); + process.exit(1); + } + const plugin = marketplace.plugins.find(entry => entry && entry.name === "ecc"); + if (!plugin || typeof plugin !== "object") { + console.error(`Error: could not find ecc plugin entry in ${file}`); + process.exit(1); + } + plugin.version = version; + fs.writeFileSync(file, `${JSON.stringify(marketplace, null, 2)}\n`); + ' "$CODEX_MARKETPLACE_JSON" "$VERSION" +} + # Update all shipped package/plugin manifests update_version "$ROOT_PACKAGE_JSON" "s|\"version\": *\"[^\"]*\"|\"version\": \"$VERSION\"|" update_package_lock_version "$PACKAGE_LOCK_JSON" @@ -166,13 +187,14 @@ update_agent_yaml_version update_version_file update_version "$PLUGIN_JSON" "s|\"version\": *\"[^\"]*\"|\"version\": \"$VERSION\"|" update_version "$MARKETPLACE_JSON" "0,/\"version\": *\"[^\"]*\"/s|\"version\": *\"[^\"]*\"|\"version\": \"$VERSION\"|" +update_codex_marketplace_version update_version "$CODEX_PLUGIN_JSON" "s|\"version\": *\"[^\"]*\"|\"version\": \"$VERSION\"|" update_version "$OPENCODE_PACKAGE_JSON" "s|\"version\": *\"[^\"]*\"|\"version\": \"$VERSION\"|" update_package_lock_version "$OPENCODE_PACKAGE_LOCK_JSON" update_readme_version_row # Stage, commit, tag, and push -git add "$ROOT_PACKAGE_JSON" "$PACKAGE_LOCK_JSON" "$ROOT_AGENTS_MD" "$AGENT_YAML" "$VERSION_FILE" "$PLUGIN_JSON" "$MARKETPLACE_JSON" "$CODEX_PLUGIN_JSON" "$OPENCODE_PACKAGE_JSON" "$OPENCODE_PACKAGE_LOCK_JSON" "$README_FILE" +git add "$ROOT_PACKAGE_JSON" "$PACKAGE_LOCK_JSON" "$ROOT_AGENTS_MD" "$AGENT_YAML" "$VERSION_FILE" "$PLUGIN_JSON" "$MARKETPLACE_JSON" "$CODEX_MARKETPLACE_JSON" "$CODEX_PLUGIN_JSON" "$OPENCODE_PACKAGE_JSON" "$OPENCODE_PACKAGE_LOCK_JSON" "$README_FILE" git commit -m "chore: bump plugin version to $VERSION" git tag "v$VERSION" git push origin main "v$VERSION" diff --git a/tests/plugin-manifest.test.js b/tests/plugin-manifest.test.js index 300c93d2..0722f8a0 100644 --- a/tests/plugin-manifest.test.js +++ b/tests/plugin-manifest.test.js @@ -339,6 +339,7 @@ test('marketplace.json has plugins array with at least one entry', () => { test('marketplace.json plugin entries have required fields', () => { for (const plugin of marketplace.plugins) { assert.ok(plugin.name, `Plugin entry missing name`); + assert.ok(plugin.version, `Plugin "${plugin.name}" missing version`); assert.ok(plugin.source && plugin.source.source, `Plugin "${plugin.name}" missing source.source`); assert.ok(plugin.policy && plugin.policy.installation, `Plugin "${plugin.name}" missing policy.installation`); assert.ok(plugin.category, `Plugin "${plugin.name}" missing category`); @@ -349,6 +350,10 @@ test('marketplace.json plugin entry uses short plugin slug', () => { assert.strictEqual(marketplace.plugins[0].name, 'ecc'); }); +test('marketplace.json plugin version matches package.json', () => { + assert.strictEqual(marketplace.plugins[0].version, expectedVersion); +}); + test('marketplace local plugin path resolves to the repo-root Codex bundle', () => { for (const plugin of marketplace.plugins) { if (!plugin.source || plugin.source.source !== 'local') {