/** * Shared utilities for version management across all components * * This module provides common functionality for: * - Changeset collection and parsing * - Version bumping logic * - Changelog generation * - Session archival * - Git operations * * Used by platform, client, and sndbrd version scripts. */ /** * Version bump types following semantic versioning */ export type VersionBumpType = 'major' | 'minor' | 'patch'; /** * Changeset structure parsed from YAML files */ export interface Changeset { /** Session directory name */ session: string; /** Component this changeset affects */ component: string; /** Type of version bump required */ type: VersionBumpType; /** High-level summary of changes */ summary: string; /** List of specific file changes */ changes?: string[]; /** Whether this introduces breaking changes */ breaking?: boolean; /** Deployment dependencies */ dependencies?: string[]; /** Migration instructions */ migration?: string; /** Related sessions (for cross-component work) */ related_session?: string; /** Related components (for cross-component work) */ related_components?: string[]; } /** * CLI arguments parsed from process.argv */ export interface CliArgs { /** Perform dry run without making changes */ isDryRun: boolean; /** Only generate changelog without version bump */ changelogOnly: boolean; /** Force specific version bump type */ forceType?: VersionBumpType; } /** * Configuration for version management */ export interface VersionConfig { /** Component name (platform, client, sndbrd) */ component: string; /** Path to unreleased sessions directory */ unreleasedDir: string; /** Path to released sessions directory */ releasedDir: string; /** Path to CHANGELOG.md */ changelogPath: string; /** Path to package.json */ packageJsonPath: string; /** Path to VERSION file */ versionFilePath: string; /** Root .ai directory for cross-component sessions */ rootAiDir?: string; } /** * Parse CLI arguments from process.argv */ export declare function parseCliArgs(args: string[]): CliArgs; /** * Collect all changesets from unreleased sessions directory * * @param config - Version configuration * @returns Array of parsed changesets */ export declare function collectChangesets(config: VersionConfig): Changeset[]; /** * Determine version bump type from changesets * Priority: major > minor > patch * * @param changesets - Array of changesets * @param forceType - Optional forced bump type * @returns Version bump type */ export declare function determineVersionBump(changesets: Changeset[], forceType?: VersionBumpType): VersionBumpType; /** * Bump version number according to semantic versioning * * Supports: * - Standard versions: 1.2.3 * - Legacy build suffix: 0.1.1-006 * - Beta versions: 0.1.2-beta.536 * * @param currentVersion - Current version string * @param bumpType - Type of bump to perform * @returns New version string */ export declare function bumpVersion(currentVersion: string, bumpType: VersionBumpType): string; /** * Generate changelog entry from changesets * * @param changesets - Array of changesets * @param newVersion - New version number * @returns Formatted changelog entry */ export declare function generateChangelogEntry(changesets: Changeset[], newVersion: string): string; /** * Update CHANGELOG.md with new entry * * @param config - Version configuration * @param changesets - Array of changesets * @param newVersion - New version number */ export declare function updateChangelog(config: VersionConfig, changesets: Changeset[], newVersion: string): void; /** * Archive sessions to released directory * * @param config - Version configuration * @param changesets - Array of changesets * @param newVersion - New version number */ export declare function archiveSessions(config: VersionConfig, changesets: Changeset[], newVersion: string): void; /** * Update package.json version * * @param config - Version configuration * @param newVersion - New version number */ export declare function updatePackageJson(config: VersionConfig, newVersion: string): void; /** * Update VERSION file * * @param config - Version configuration * @param newVersion - New version number */ export declare function updateVersionFile(config: VersionConfig, newVersion: string): void; /** * Create git tag for release * * @param component - Component name * @param newVersion - New version number */ export declare function createGitTag(component: string, newVersion: string): void; /** * Commit all changes * * @param component - Component name * @param newVersion - New version number */ export declare function commitChanges(component: string, newVersion: string): void; /** * Display release summary and next steps * * @param component - Component name * @param newVersion - New version number * @param changesets - Array of changesets */ export declare function displayReleaseSummary(component: string, newVersion: string, changesets: Changeset[]): void; //# sourceMappingURL=version-utils.d.ts.map