fix: add cursor-marketplace as release-please component (#315)

This commit is contained in:
Trevin Chow
2026-03-18 18:47:00 -07:00
committed by GitHub
parent 88c89bc204
commit 838aeb79d0
10 changed files with 89 additions and 6 deletions

View File

@@ -14,7 +14,7 @@
{
"name": "compound-engineering",
"source": "compound-engineering",
"description": "AI-powered development tools that get smarter with every use. Includes specialized agents, commands, skills, and Context7 MCP."
"description": "AI-powered development tools that get smarter with every use. Make each unit of engineering work easier than the last."
},
{
"name": "coding-tutor",

View File

@@ -2,5 +2,6 @@
".": "2.44.0",
"plugins/compound-engineering": "2.44.0",
"plugins/coding-tutor": "1.2.1",
".claude-plugin": "1.0.2"
".claude-plugin": "1.0.2",
".cursor-plugin": "1.0.0"
}

View File

@@ -57,6 +57,17 @@
"jsonpath": "$.metadata.version"
}
]
},
".cursor-plugin": {
"release-type": "simple",
"package-name": "cursor-marketplace",
"extra-files": [
{
"type": "json",
"path": "marketplace.json",
"jsonpath": "$.metadata.version"
}
]
}
}
}

View File

@@ -31,6 +31,12 @@ on:
type: choice
options: [auto, patch, minor, major]
default: auto
cursor_marketplace_bump:
description: "cursor-marketplace bump override"
required: false
type: choice
options: [auto, patch, minor, major]
default: auto
jobs:
preview:
@@ -86,6 +92,7 @@ jobs:
args+=(--override "compound-engineering=${{ github.event.inputs.compound_engineering_bump || 'auto' }}")
args+=(--override "coding-tutor=${{ github.event.inputs.coding_tutor_bump || 'auto' }}")
args+=(--override "marketplace=${{ github.event.inputs.marketplace_bump || 'auto' }}")
args+=(--override "cursor-marketplace=${{ github.event.inputs.cursor_marketplace_bump || 'auto' }}")
bun run scripts/release/preview.ts "${args[@]}" | tee /tmp/release-preview.txt

View File

@@ -4,12 +4,23 @@ import { validateReleasePleaseConfig } from "../../src/release/config"
import { getCompoundEngineeringCounts, syncReleaseMetadata } from "../../src/release/metadata"
import { readJson } from "../../src/utils/files"
type ReleasePleaseManifest = Record<string, string>
const releasePleaseConfig = await readJson<{ packages: Record<string, unknown> }>(
path.join(process.cwd(), ".github", "release-please-config.json"),
)
const manifest = await readJson<ReleasePleaseManifest>(
path.join(process.cwd(), ".github", ".release-please-manifest.json"),
)
const configErrors = validateReleasePleaseConfig(releasePleaseConfig)
const counts = await getCompoundEngineeringCounts(process.cwd())
const result = await syncReleaseMetadata({ write: false })
const result = await syncReleaseMetadata({
write: false,
componentVersions: {
marketplace: manifest[".claude-plugin"],
"cursor-marketplace": manifest[".cursor-plugin"],
},
})
const changed = result.updates.filter((update) => update.changed)
if (configErrors.length === 0 && changed.length === 0) {

View File

@@ -13,6 +13,7 @@ const RELEASE_COMPONENTS: ReleaseComponent[] = [
"compound-engineering",
"coding-tutor",
"marketplace",
"cursor-marketplace",
]
const FILE_COMPONENT_MAP: Array<{ component: ReleaseComponent; prefixes: string[] }> = [
@@ -30,7 +31,11 @@ const FILE_COMPONENT_MAP: Array<{ component: ReleaseComponent; prefixes: string[
},
{
component: "marketplace",
prefixes: [".claude-plugin/marketplace.json", ".cursor-plugin/marketplace.json"],
prefixes: [".claude-plugin/marketplace.json"],
},
{
component: "cursor-marketplace",
prefixes: [".cursor-plugin/marketplace.json"],
},
]
@@ -40,6 +45,7 @@ const SCOPES_TO_COMPONENTS: Record<string, ReleaseComponent> = {
"compound-engineering": "compound-engineering",
"coding-tutor": "coding-tutor",
marketplace: "marketplace",
"cursor-marketplace": "cursor-marketplace",
}
const NON_RELEASABLE_TYPES = new Set(["docs", "chore", "test", "ci", "build", "style"])
@@ -179,12 +185,14 @@ export async function loadCurrentVersions(cwd = process.cwd()): Promise<VersionS
const ce = await readJson<PluginManifest>(`${cwd}/plugins/compound-engineering/.claude-plugin/plugin.json`)
const codingTutor = await readJson<PluginManifest>(`${cwd}/plugins/coding-tutor/.claude-plugin/plugin.json`)
const marketplace = await readJson<MarketplaceManifest>(`${cwd}/.claude-plugin/marketplace.json`)
const cursorMarketplace = await readJson<MarketplaceManifest>(`${cwd}/.cursor-plugin/marketplace.json`)
return {
cli: root.version,
"compound-engineering": ce.version,
"coding-tutor": codingTutor.version,
marketplace: marketplace.metadata.version,
"cursor-marketplace": cursorMarketplace.metadata.version,
}
}

View File

@@ -135,12 +135,14 @@ export async function syncReleaseMetadata(options: SyncOptions = {}): Promise<Me
const codingTutorClaudePath = path.join(root, "plugins", "coding-tutor", ".claude-plugin", "plugin.json")
const codingTutorCursorPath = path.join(root, "plugins", "coding-tutor", ".cursor-plugin", "plugin.json")
const marketplaceClaudePath = path.join(root, ".claude-plugin", "marketplace.json")
const marketplaceCursorPath = path.join(root, ".cursor-plugin", "marketplace.json")
const compoundClaude = await readJson<ClaudePluginManifest>(compoundClaudePath)
const compoundCursor = await readJson<CursorPluginManifest>(compoundCursorPath)
const codingTutorClaude = await readJson<ClaudePluginManifest>(codingTutorClaudePath)
const codingTutorCursor = await readJson<CursorPluginManifest>(codingTutorCursorPath)
const marketplaceClaude = await readJson<MarketplaceManifest>(marketplaceClaudePath)
const marketplaceCursor = await readJson<MarketplaceManifest>(marketplaceCursorPath)
const expectedCompoundVersion = resolveExpectedVersion(
versions["compound-engineering"],
compoundClaude.version,
@@ -211,5 +213,23 @@ export async function syncReleaseMetadata(options: SyncOptions = {}): Promise<Me
updates.push({ path: marketplaceClaudePath, changed })
if (write && changed) await writeJson(marketplaceClaudePath, marketplaceClaude)
changed = false
if (versions["cursor-marketplace"] && marketplaceCursor.metadata.version !== versions["cursor-marketplace"]) {
marketplaceCursor.metadata.version = versions["cursor-marketplace"]
changed = true
}
for (const plugin of marketplaceCursor.plugins) {
if (plugin.name === "compound-engineering") {
if (plugin.description !== compoundMarketplaceDescription) {
plugin.description = compoundMarketplaceDescription
changed = true
}
}
}
updates.push({ path: marketplaceCursorPath, changed })
if (write && changed) await writeJson(marketplaceCursorPath, marketplaceCursor)
return { updates }
}

View File

@@ -1,4 +1,4 @@
export type ReleaseComponent = "cli" | "compound-engineering" | "coding-tutor" | "marketplace"
export type ReleaseComponent = "cli" | "compound-engineering" | "coding-tutor" | "marketplace" | "cursor-marketplace"
export type BumpLevel = "patch" | "minor" | "major"

View File

@@ -34,9 +34,18 @@ describe("release component detection", () => {
])
})
test("maps marketplace metadata without bumping plugin components", () => {
test("maps claude marketplace metadata without bumping plugin components", () => {
const components = detectComponentsFromFiles([".claude-plugin/marketplace.json"])
expect(components.get("marketplace")).toEqual([".claude-plugin/marketplace.json"])
expect(components.get("cursor-marketplace")).toEqual([])
expect(components.get("compound-engineering")).toEqual([])
expect(components.get("coding-tutor")).toEqual([])
})
test("maps cursor marketplace metadata to cursor-marketplace component", () => {
const components = detectComponentsFromFiles([".cursor-plugin/marketplace.json"])
expect(components.get("cursor-marketplace")).toEqual([".cursor-plugin/marketplace.json"])
expect(components.get("marketplace")).toEqual([])
expect(components.get("compound-engineering")).toEqual([])
expect(components.get("coding-tutor")).toEqual([])
})

View File

@@ -39,6 +39,7 @@ async function makeFixtureRoot(): Promise<string> {
recursive: true,
})
await mkdir(path.join(root, ".claude-plugin"), { recursive: true })
await mkdir(path.join(root, ".cursor-plugin"), { recursive: true })
await writeFile(
path.join(root, "plugins", "compound-engineering", "agents", "review", "agent.md"),
@@ -82,6 +83,20 @@ async function makeFixtureRoot(): Promise<string> {
2,
),
)
await writeFile(
path.join(root, ".cursor-plugin", "marketplace.json"),
JSON.stringify(
{
metadata: { version: "1.0.0", description: "marketplace" },
plugins: [
{ name: "compound-engineering", version: "2.41.0", description: "old" },
{ name: "coding-tutor", version: "1.2.0", description: "old" },
],
},
null,
2,
),
)
return root
}
@@ -115,5 +130,6 @@ describe("release metadata", () => {
expect(changedPaths).toContain(path.join(root, "plugins", "compound-engineering", ".cursor-plugin", "plugin.json"))
expect(changedPaths).toContain(path.join(root, ".claude-plugin", "marketplace.json"))
expect(changedPaths).toContain(path.join(root, ".cursor-plugin", "marketplace.json"))
})
})