fix: add cursor-marketplace as release-please component (#315)
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
{
|
{
|
||||||
"name": "compound-engineering",
|
"name": "compound-engineering",
|
||||||
"source": "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",
|
"name": "coding-tutor",
|
||||||
|
|||||||
3
.github/.release-please-manifest.json
vendored
3
.github/.release-please-manifest.json
vendored
@@ -2,5 +2,6 @@
|
|||||||
".": "2.44.0",
|
".": "2.44.0",
|
||||||
"plugins/compound-engineering": "2.44.0",
|
"plugins/compound-engineering": "2.44.0",
|
||||||
"plugins/coding-tutor": "1.2.1",
|
"plugins/coding-tutor": "1.2.1",
|
||||||
".claude-plugin": "1.0.2"
|
".claude-plugin": "1.0.2",
|
||||||
|
".cursor-plugin": "1.0.0"
|
||||||
}
|
}
|
||||||
|
|||||||
11
.github/release-please-config.json
vendored
11
.github/release-please-config.json
vendored
@@ -57,6 +57,17 @@
|
|||||||
"jsonpath": "$.metadata.version"
|
"jsonpath": "$.metadata.version"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
".cursor-plugin": {
|
||||||
|
"release-type": "simple",
|
||||||
|
"package-name": "cursor-marketplace",
|
||||||
|
"extra-files": [
|
||||||
|
{
|
||||||
|
"type": "json",
|
||||||
|
"path": "marketplace.json",
|
||||||
|
"jsonpath": "$.metadata.version"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
7
.github/workflows/release-preview.yml
vendored
7
.github/workflows/release-preview.yml
vendored
@@ -31,6 +31,12 @@ on:
|
|||||||
type: choice
|
type: choice
|
||||||
options: [auto, patch, minor, major]
|
options: [auto, patch, minor, major]
|
||||||
default: auto
|
default: auto
|
||||||
|
cursor_marketplace_bump:
|
||||||
|
description: "cursor-marketplace bump override"
|
||||||
|
required: false
|
||||||
|
type: choice
|
||||||
|
options: [auto, patch, minor, major]
|
||||||
|
default: auto
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
preview:
|
preview:
|
||||||
@@ -86,6 +92,7 @@ jobs:
|
|||||||
args+=(--override "compound-engineering=${{ github.event.inputs.compound_engineering_bump || 'auto' }}")
|
args+=(--override "compound-engineering=${{ github.event.inputs.compound_engineering_bump || 'auto' }}")
|
||||||
args+=(--override "coding-tutor=${{ github.event.inputs.coding_tutor_bump || 'auto' }}")
|
args+=(--override "coding-tutor=${{ github.event.inputs.coding_tutor_bump || 'auto' }}")
|
||||||
args+=(--override "marketplace=${{ github.event.inputs.marketplace_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
|
bun run scripts/release/preview.ts "${args[@]}" | tee /tmp/release-preview.txt
|
||||||
|
|
||||||
|
|||||||
@@ -4,12 +4,23 @@ import { validateReleasePleaseConfig } from "../../src/release/config"
|
|||||||
import { getCompoundEngineeringCounts, syncReleaseMetadata } from "../../src/release/metadata"
|
import { getCompoundEngineeringCounts, syncReleaseMetadata } from "../../src/release/metadata"
|
||||||
import { readJson } from "../../src/utils/files"
|
import { readJson } from "../../src/utils/files"
|
||||||
|
|
||||||
|
type ReleasePleaseManifest = Record<string, string>
|
||||||
|
|
||||||
const releasePleaseConfig = await readJson<{ packages: Record<string, unknown> }>(
|
const releasePleaseConfig = await readJson<{ packages: Record<string, unknown> }>(
|
||||||
path.join(process.cwd(), ".github", "release-please-config.json"),
|
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 configErrors = validateReleasePleaseConfig(releasePleaseConfig)
|
||||||
const counts = await getCompoundEngineeringCounts(process.cwd())
|
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)
|
const changed = result.updates.filter((update) => update.changed)
|
||||||
|
|
||||||
if (configErrors.length === 0 && changed.length === 0) {
|
if (configErrors.length === 0 && changed.length === 0) {
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ const RELEASE_COMPONENTS: ReleaseComponent[] = [
|
|||||||
"compound-engineering",
|
"compound-engineering",
|
||||||
"coding-tutor",
|
"coding-tutor",
|
||||||
"marketplace",
|
"marketplace",
|
||||||
|
"cursor-marketplace",
|
||||||
]
|
]
|
||||||
|
|
||||||
const FILE_COMPONENT_MAP: Array<{ component: ReleaseComponent; prefixes: string[] }> = [
|
const FILE_COMPONENT_MAP: Array<{ component: ReleaseComponent; prefixes: string[] }> = [
|
||||||
@@ -30,7 +31,11 @@ const FILE_COMPONENT_MAP: Array<{ component: ReleaseComponent; prefixes: string[
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
component: "marketplace",
|
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",
|
"compound-engineering": "compound-engineering",
|
||||||
"coding-tutor": "coding-tutor",
|
"coding-tutor": "coding-tutor",
|
||||||
marketplace: "marketplace",
|
marketplace: "marketplace",
|
||||||
|
"cursor-marketplace": "cursor-marketplace",
|
||||||
}
|
}
|
||||||
|
|
||||||
const NON_RELEASABLE_TYPES = new Set(["docs", "chore", "test", "ci", "build", "style"])
|
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 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 codingTutor = await readJson<PluginManifest>(`${cwd}/plugins/coding-tutor/.claude-plugin/plugin.json`)
|
||||||
const marketplace = await readJson<MarketplaceManifest>(`${cwd}/.claude-plugin/marketplace.json`)
|
const marketplace = await readJson<MarketplaceManifest>(`${cwd}/.claude-plugin/marketplace.json`)
|
||||||
|
const cursorMarketplace = await readJson<MarketplaceManifest>(`${cwd}/.cursor-plugin/marketplace.json`)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
cli: root.version,
|
cli: root.version,
|
||||||
"compound-engineering": ce.version,
|
"compound-engineering": ce.version,
|
||||||
"coding-tutor": codingTutor.version,
|
"coding-tutor": codingTutor.version,
|
||||||
marketplace: marketplace.metadata.version,
|
marketplace: marketplace.metadata.version,
|
||||||
|
"cursor-marketplace": cursorMarketplace.metadata.version,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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 codingTutorClaudePath = path.join(root, "plugins", "coding-tutor", ".claude-plugin", "plugin.json")
|
||||||
const codingTutorCursorPath = path.join(root, "plugins", "coding-tutor", ".cursor-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 marketplaceClaudePath = path.join(root, ".claude-plugin", "marketplace.json")
|
||||||
|
const marketplaceCursorPath = path.join(root, ".cursor-plugin", "marketplace.json")
|
||||||
|
|
||||||
const compoundClaude = await readJson<ClaudePluginManifest>(compoundClaudePath)
|
const compoundClaude = await readJson<ClaudePluginManifest>(compoundClaudePath)
|
||||||
const compoundCursor = await readJson<CursorPluginManifest>(compoundCursorPath)
|
const compoundCursor = await readJson<CursorPluginManifest>(compoundCursorPath)
|
||||||
const codingTutorClaude = await readJson<ClaudePluginManifest>(codingTutorClaudePath)
|
const codingTutorClaude = await readJson<ClaudePluginManifest>(codingTutorClaudePath)
|
||||||
const codingTutorCursor = await readJson<CursorPluginManifest>(codingTutorCursorPath)
|
const codingTutorCursor = await readJson<CursorPluginManifest>(codingTutorCursorPath)
|
||||||
const marketplaceClaude = await readJson<MarketplaceManifest>(marketplaceClaudePath)
|
const marketplaceClaude = await readJson<MarketplaceManifest>(marketplaceClaudePath)
|
||||||
|
const marketplaceCursor = await readJson<MarketplaceManifest>(marketplaceCursorPath)
|
||||||
const expectedCompoundVersion = resolveExpectedVersion(
|
const expectedCompoundVersion = resolveExpectedVersion(
|
||||||
versions["compound-engineering"],
|
versions["compound-engineering"],
|
||||||
compoundClaude.version,
|
compoundClaude.version,
|
||||||
@@ -211,5 +213,23 @@ export async function syncReleaseMetadata(options: SyncOptions = {}): Promise<Me
|
|||||||
updates.push({ path: marketplaceClaudePath, changed })
|
updates.push({ path: marketplaceClaudePath, changed })
|
||||||
if (write && changed) await writeJson(marketplaceClaudePath, marketplaceClaude)
|
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 }
|
return { updates }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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"
|
export type BumpLevel = "patch" | "minor" | "major"
|
||||||
|
|
||||||
|
|||||||
@@ -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"])
|
const components = detectComponentsFromFiles([".claude-plugin/marketplace.json"])
|
||||||
expect(components.get("marketplace")).toEqual([".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("compound-engineering")).toEqual([])
|
||||||
expect(components.get("coding-tutor")).toEqual([])
|
expect(components.get("coding-tutor")).toEqual([])
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ async function makeFixtureRoot(): Promise<string> {
|
|||||||
recursive: true,
|
recursive: true,
|
||||||
})
|
})
|
||||||
await mkdir(path.join(root, ".claude-plugin"), { recursive: true })
|
await mkdir(path.join(root, ".claude-plugin"), { recursive: true })
|
||||||
|
await mkdir(path.join(root, ".cursor-plugin"), { recursive: true })
|
||||||
|
|
||||||
await writeFile(
|
await writeFile(
|
||||||
path.join(root, "plugins", "compound-engineering", "agents", "review", "agent.md"),
|
path.join(root, "plugins", "compound-engineering", "agents", "review", "agent.md"),
|
||||||
@@ -82,6 +83,20 @@ async function makeFixtureRoot(): Promise<string> {
|
|||||||
2,
|
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
|
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, "plugins", "compound-engineering", ".cursor-plugin", "plugin.json"))
|
||||||
expect(changedPaths).toContain(path.join(root, ".claude-plugin", "marketplace.json"))
|
expect(changedPaths).toContain(path.join(root, ".claude-plugin", "marketplace.json"))
|
||||||
|
expect(changedPaths).toContain(path.join(root, ".cursor-plugin", "marketplace.json"))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user