/** * release-cut, local release preparation ONLY. * * Per the CI/CD design's principle 4 (CI owns validation), this tool never * re-runs gates. It: guards a clean tree on the release branch, bumps the * version across the root and configured manifests, runs the repo's version- * sync commands, prepends a CHANGELOG section, commits, and creates an * annotated tag. Validation happened on the push CI run; the tag is cut from an * already-green tree and verified by-reference downstream. * * Re-running after a crash converges instead of double-applying: a release * commit already at HEAD is recognized by its commit subject, so the retry * finishes the interrupted cut (creates the missing tag) or reports the cut as * already complete, and never bumps a second version on top of the first. */ import type { Exec, Logger } from './effects.js'; import type { ReleaseCutConfig } from '../config.js'; export type BumpKind = 'patch' | 'minor' | 'major'; export interface Semver { readonly major: number; readonly minor: number; readonly patch: number; } /** Parse an exact X.Y.Z string; throws on anything else. */ export declare function parseSemver(version: string): Semver; /** Compute the next version for a bump kind. */ export declare function nextVersion(current: string, kind: BumpKind): string; /** Render a CHANGELOG section heading for a version. */ export declare function changelogHeading(version: string, style: 'bracket' | 'plain', date: string): string; /** Build a full CHANGELOG section body from a heading and notes/commit lines. */ export declare function buildChangelogSection(version: string, style: 'bracket' | 'plain', date: string, bodyLines: readonly string[]): string; /** * Insert a new section into changelog text. `top` prepends above the first * `## ` heading; `first-separator` inserts after the first `---` line. */ export declare function insertChangelogSection(changelog: string, section: string, marker: 'first-separator' | 'top'): string; export interface ReleaseCutOptions { readonly cwd: string; readonly bump: BumpKind; readonly config: ReleaseCutConfig; readonly notes?: readonly string[]; readonly date?: string; readonly dryRun?: boolean; readonly exec?: Exec; readonly logger?: Logger; } export interface ReleaseCutResult { readonly version: string; readonly tag: string; /** True when the repo holds the release commit AND its tag for `version` once this call returns. */ readonly committed: boolean; /** * True when this run found the cut for `version` already committed by an * earlier run and converged (completing or accepting it) instead of bumping * to a further version. */ readonly resumed: boolean; } /** * The commit subject every cut writes. Also how a re-run recognizes a cut left * behind by a previous run that died before tagging. */ export declare function releaseCommitMessage(version: string): string; /** * Perform a release cut. Uses real fs writes + the injected exec (git) against * `cwd`; tests drive it against a temp-dir git fixture. */ export declare function runReleaseCut(options: ReleaseCutOptions): ReleaseCutResult; //# sourceMappingURL=release-cut.d.ts.map