/** * Version bump - config-driven version bumping across project files. * * Reads release.versionBump from .cleo/config.json and updates all * configured files with the new version. Supports strategies: * plain - Overwrite entire file (e.g., VERSION) * json - Update a JSON field (e.g., package.json .version) * toml - Update a TOML key (e.g., Cargo.toml) * sed - Custom regex substitution * * @task T4454 * @epic T4454 */ import { type BumpResult, type BumpType, type BumpVersionFromConfigResult, type EcosystemHint, type ProjectContext, type ProjectType, type ResolveVersionBumpTargetsResult, type VersionBumpStrategy, type VersionBumpTarget, type VersionBumpTargetSource } from '@cleocode/contracts'; export type { BumpResult, BumpType, BumpVersionFromConfigResult, EcosystemHint, ProjectContext, ProjectType, ResolveVersionBumpTargetsResult, VersionBumpStrategy, VersionBumpTarget, VersionBumpTargetSource, }; /** Validate version format (semver X.Y.Z or CalVer YYYY.M.patch, with optional pre-release). */ export declare function validateVersionFormat(version: string): boolean; /** Check if a version string is CalVer format. */ export declare function isCalVer(version: string): boolean; /** Calculate new version from current + bump type. */ export declare function calculateNewVersion(current: string, bump: BumpType | string): string; /** Get version bump configuration, mapping config field names to VersionBumpTarget. */ export declare function getVersionBumpConfig(cwd?: string): VersionBumpTarget[]; /** Check if version bump is configured. */ export declare function isVersionBumpConfigured(cwd?: string): boolean; /** * Auto-discover version-bump targets for the project's ecosystem(s). * * Reads `.cleo/project-context.json` via the canonical * {@link loadProjectContext} loader and uses the recorded * {@link ProjectContext.projectTypes} / {@link ProjectContext.primaryType} * to decide which discoverers to run. When the context is missing, falls * back to probing filesystem markers (`package.json`, `Cargo.toml`) * directly — same signals the canonical * {@link import('../store/project-detect.js').detectProjectType} uses. * * For a multi-language monorepo (e.g. `projectTypes: ["node", "rust"]`), * targets from each ecosystem are merged so a single release commit keeps * every workspace package in sync. * * Returns `[]` when no ecosystem is recognised — callers should treat that * as "no auto-bump possible" and either fall back to an explicit config or * skip bumping entirely. */ export declare function discoverWorkspacePackageJsonFiles(cwd?: string): VersionBumpTarget[]; /** * Resolve version-bump targets with workspace auto-discovery fallback. * * Order of preference: * 1. Explicit `release.versionBump.files` from `.cleo/config.json` (most precise) * 2. Auto-discovered workspace targets when `release.versionBump.autoDiscover` * is not explicitly disabled (default: enabled) * 3. Empty — caller decides whether to skip or error * * The `source` field on the returned envelope lets callers log *how* targets * were resolved, which matters when diagnosing why a release commit did or * did not include version files. */ export declare function resolveVersionBumpTargets(cwd?: string): ResolveVersionBumpTargetsResult; /** Options passed to {@link bumpVersionFromConfig}. */ export interface BumpVersionFromConfigOptions { dryRun?: boolean; } /** Bump version in all configured files. */ export declare function bumpVersionFromConfig(newVersion: string, options?: BumpVersionFromConfigOptions, cwd?: string): BumpVersionFromConfigResult; //# sourceMappingURL=version-bump.d.ts.map