fix(release): remove stale release-as pin (#674)
This commit is contained in:
2
.github/release-please-config.json
vendored
2
.github/release-please-config.json
vendored
@@ -14,7 +14,6 @@
|
|||||||
".": {
|
".": {
|
||||||
"release-type": "simple",
|
"release-type": "simple",
|
||||||
"package-name": "cli",
|
"package-name": "cli",
|
||||||
"release-as": "3.0.2",
|
|
||||||
"exclude-paths": [
|
"exclude-paths": [
|
||||||
"AGENTS.md",
|
"AGENTS.md",
|
||||||
"CLAUDE.md",
|
"CLAUDE.md",
|
||||||
@@ -47,7 +46,6 @@
|
|||||||
"plugins/compound-engineering": {
|
"plugins/compound-engineering": {
|
||||||
"release-type": "simple",
|
"release-type": "simple",
|
||||||
"package-name": "compound-engineering",
|
"package-name": "compound-engineering",
|
||||||
"release-as": "3.0.2",
|
|
||||||
"extra-files": [
|
"extra-files": [
|
||||||
{
|
{
|
||||||
"type": "json",
|
"type": "json",
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import path from "path"
|
|||||||
type ReleasePleasePackageConfig = {
|
type ReleasePleasePackageConfig = {
|
||||||
"changelog-path"?: string
|
"changelog-path"?: string
|
||||||
"skip-changelog"?: boolean
|
"skip-changelog"?: boolean
|
||||||
|
"release-as"?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReleasePleaseConfig = {
|
type ReleasePleaseConfig = {
|
||||||
@@ -13,6 +14,13 @@ export function validateReleasePleaseConfig(config: ReleasePleaseConfig): string
|
|||||||
const errors: string[] = []
|
const errors: string[] = []
|
||||||
|
|
||||||
for (const [packagePath, packageConfig] of Object.entries(config.packages)) {
|
for (const [packagePath, packageConfig] of Object.entries(config.packages)) {
|
||||||
|
const releaseAs = packageConfig["release-as"]
|
||||||
|
if (releaseAs) {
|
||||||
|
errors.push(
|
||||||
|
`Package "${packagePath}" uses temporary release-as pin "${releaseAs}". Remove release-as after the pinned release ships so future releases can bump normally.`,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
const changelogPath = packageConfig["changelog-path"]
|
const changelogPath = packageConfig["changelog-path"]
|
||||||
if (!changelogPath) continue
|
if (!changelogPath) continue
|
||||||
|
|
||||||
|
|||||||
@@ -36,4 +36,23 @@ describe("release-please config validation", () => {
|
|||||||
|
|
||||||
expect(errors).toEqual([])
|
expect(errors).toEqual([])
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test("rejects checked-in release-as pins", () => {
|
||||||
|
const errors = validateReleasePleaseConfig({
|
||||||
|
packages: {
|
||||||
|
".": {
|
||||||
|
"release-as": "3.0.2",
|
||||||
|
},
|
||||||
|
"plugins/compound-engineering": {
|
||||||
|
"release-as": "3.0.2",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
expect(errors).toHaveLength(2)
|
||||||
|
expect(errors[0]).toContain('Package "."')
|
||||||
|
expect(errors[0]).toContain("release-as")
|
||||||
|
expect(errors[1]).toContain('Package "plugins/compound-engineering"')
|
||||||
|
expect(errors[1]).toContain("3.0.2")
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user