also looking at this
fix: validate complete workspace release before tagging
#365
5 files
+73
-33
Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.
| @@ -60,7 +60,7 @@ | ||
| 60 | 60 | "changelog:preview": "bun scripts/changelog-preview.ts", |
| 61 | 61 | "changelog:generate": "bun scripts/generate-release-changelog.ts", |
| 62 | 62 | "test:release": "bun test ./scripts/changelog-preview.test.ts ./scripts/release-workflow.test.ts ./scripts/release-manifest.test.ts ./scripts/verify-sbom.test.ts", |
| 63 | "release": "bun scripts/release-version.ts --preflight && bun x --bun @stacksjs/bumpx prompt --recursive", | |
| 63 | "release": "bun scripts/release-version.ts --preflight && bun x --bun @stacksjs/bumpx prompt --recursive --commit --tag --push --no-changelog --execute \"bun scripts/release-version.ts --pending && bun scripts/generate-release-changelog.ts && git add CHANGELOG.md\"", | |
| 64 | 64 | "release:patch": "bun scripts/release-version.ts --preflight && bun x --bun @stacksjs/bumpx patch --recursive --commit --tag --push --yes --no-changelog --execute \"bun scripts/release-version.ts --pending && bun scripts/generate-release-changelog.ts && git add CHANGELOG.md\"", |
| 65 | 65 | "release:version": "bun scripts/release-version.ts --preflight && bun x --bun @stacksjs/bumpx --recursive --commit --tag --push --yes --no-changelog --execute \"bun scripts/release-version.ts --pending && bun scripts/generate-release-changelog.ts && git add CHANGELOG.md\"" |
| 66 | 66 | }, |
| @@ -124,12 +124,14 @@ test('release notes can include changes since the last published release after a | ||
| 124 | 124 | |
| 125 | 125 | test('patch release uses the guarded changelog generator before committing', () => { |
| 126 | 126 | const project = JSON.parse(readFileSync(join(import.meta.dir, '..', 'package.json'), 'utf8')) |
| 127 | const command = project.scripts['release:patch'] as string | |
| 128 | 127 | expect(project.scripts['changelog:generate']).toBe('bun scripts/generate-release-changelog.ts') |
| 129 | expect(command).toContain('--no-changelog') | |
| 130 | expect(command).toContain('bun scripts/generate-release-changelog.ts') | |
| 131 | expect(command).not.toContain('--files') | |
| 132 | expect(command).toContain('bun scripts/release-version.ts --pending && bun scripts/generate-release-changelog.ts') | |
| 128 | for (const name of ['release', 'release:patch', 'release:version']) { | |
| 129 | const command = project.scripts[name] as string | |
| 130 | expect(command).toContain('bun scripts/release-version.ts --preflight') | |
| 131 | expect(command).toContain('--no-changelog') | |
| 132 | expect(command).not.toContain('--files') | |
| 133 | expect(command).toContain('bun scripts/release-version.ts --pending && bun scripts/generate-release-changelog.ts') | |
| 134 | } | |
| 133 | 135 | }) |
| 134 | 136 | |
| 135 | 137 | function nativeWorkspace(directory: string, git: (...args: string[]) => string): string[] { |