#!/usr/bin/env node /** * Version management and release-tag tooling. * * Version bumps remain explicit commands. Release commands share tag construction, * local/remote target verification, and annotated-tag creation semantics. */ interface VersionParts { major: number; minor: number; patch: number; } export interface ReleaseVersion extends VersionParts { raw: string; prerelease: boolean; timestamp?: string; } export interface CommandResult { status: number; stdout: string; stderr: string; } export interface CommandOptions { cwd: string; inherit?: boolean; } export type CommandRunner = (command: string, args: readonly string[], options: CommandOptions) => CommandResult; export type AutoTagOutcome = "no-version-change" | "non-production-version" | "verified-existing-tag" | "verified-recovered-tag" | "created" | "verified-race"; export interface AutoTagResult { outcome: AutoTagOutcome; releaseRequired: boolean; verified: boolean; tag: string; targetSha: string; } export interface ReleaseContext { verified: boolean; tag: string; version: string; baseVersion: string; targetSha: string; isPrerelease: boolean; } export interface TagAnnotation { message: string; taggerName: string; taggerEmail: string; } export interface RemoteReleaseTag { targetSha: string; annotation: TagAnnotation | null; } export interface ReleaseRepository { resolveCommit(ref: string): string; commitExists(ref: string): boolean; readFileAtCommit(commit: string, file: string): string; localTagTarget(tag: string): string | null; remoteTag(tag: string): RemoteReleaseTag | null; createAnnotatedTag(tag: string, message: string, targetSha: string): void; pushTag(tag: string): boolean; isClean(): boolean; } export interface AutomaticReleaseOptions { repository: ReleaseRepository; currentVersion: string; beforeSha?: string; githubSha: string; runProductionGate: () => void; } export declare const AUTOMATIC_RELEASE_TAGGER_NAME = "github-actions[bot]"; export declare const AUTOMATIC_RELEASE_TAGGER_EMAIL = "41898282+github-actions[bot]@users.noreply.github.com"; export declare const defaultCommandRunner: CommandRunner; export declare function isSemanticVersion(version: string): boolean; export declare function parseReleaseVersion(version: string): ReleaseVersion; export declare function compareReleaseVersions(left: string, right: string): number; export declare function productionTag(version: string): string; export declare function devTag(version: string, now?: Date): string; export declare function annotatedTagMessage(tag: string): string; export declare function parseTag(tag: string): Omit; export declare class GitReleaseRepository implements ReleaseRepository { private readonly cwd; private readonly runner; constructor(cwd: string, runner?: CommandRunner); private git; resolveCommit(ref: string): string; commitExists(ref: string): boolean; readFileAtCommit(commit: string, file: string): string; localTagTarget(tag: string): string | null; private fetchedTagAnnotation; remoteTag(tag: string): RemoteReleaseTag | null; remoteTagTarget(tag: string): string | null; createAnnotatedTag(tag: string, message: string, targetSha: string): void; pushTag(tag: string): boolean; isClean(): boolean; } export declare function isAutomaticReleaseTag(tag: string, remote: RemoteReleaseTag): boolean; export declare function runAutomaticRelease(options: AutomaticReleaseOptions): AutoTagResult; export declare function validateReleaseContext(repository: ReleaseRepository, tag: string, packageVersion: string, githubSha: string): ReleaseContext; export declare function runProductionGate(repository: ReleaseRepository, cwd?: string, runner?: CommandRunner): void; export declare function main(args?: string[]): number; export {}; //# sourceMappingURL=version.d.ts.map