import { FlowStep } from '../models'; import { ChangelogSectionType } from '../../changelog/models'; declare const ANALYZE_COMMITS_STEP_ID = "analyze-commits"; /** * Creates the analyze-commits step. * * This step: * 1. Uses publishedCommit from npm registry (set by fetch-registry step) * 2. Verifies the commit is reachable from current HEAD * 3. Gets all commits since that commit (or recent commits if first release/fallback) * 4. Parses each commit using conventional commit format * 5. Classifies commits based on scope filtering strategy * 6. Filters to only release-worthy commits that belong to this project * * State updates: * - effectiveBaseCommit: The verified base commit (null if fallback was used) * - commits: Array of parsed conventional commits (for backward compatibility) * - classificationResult: Full classification result with source attribution * * @returns A FlowStep that analyzes commits * * @example Analyzing commits since last release * ```typescript * import { createAnalyzeCommitsStep, executeStep } from '@hyperfrontend/versioning' * * const step = createAnalyzeCommitsStep() * const result = await executeStep(step, context) * * // Access analyzed commits * console.log(result.stateUpdates?.commits) * // => [{ type: 'feat', subject: 'add feature' }, ...] * ``` */ declare function createAnalyzeCommitsStep(): FlowStep; declare const CALCULATE_BUMP_STEP_ID = "calculate-bump"; /** * Creates the calculate-bump step. * * This step: * 1. Analyzes commit types and breaking changes * 2. Determines the appropriate bump level * 3. Calculates the next version * * State updates: * - bumpType: 'major' | 'minor' | 'patch' | 'none' * - nextVersion: Calculated next version string * * @returns A FlowStep that calculates version bump * * @example Running the calculate-bump step * ```typescript * import { createCalculateBumpStep, executeStep } from '@hyperfrontend/versioning' * * const step = createCalculateBumpStep() * const result = await executeStep(step, context) * * // Get the calculated bump * console.log(result.stateUpdates?.bumpType) * // => 'minor' * console.log(result.stateUpdates?.nextVersion) * // => '1.2.0' * ``` */ declare function createCalculateBumpStep(): FlowStep; /** * Creates a step that checks for idempotency. * * This step prevents redundant releases by checking if the * calculated version is already published. * * @returns A FlowStep that checks idempotency * * @example Preventing duplicate releases * ```typescript * import { createCheckIdempotencyStep, executeStep } from '@hyperfrontend/versioning' * * const step = createCheckIdempotencyStep() * const result = await executeStep(step, context) * * // If version already published, step skips with bumpType: 'none' * if (result.status === 'skipped') { * console.log('Version already published') * } * ``` */ declare function createCheckIdempotencyStep(): FlowStep; declare const CREATE_COMMIT_STEP_ID = "create-commit"; /** * Creates the create-commit step. * * This step: * 1. Stages modified files * 2. Creates a commit with the configured message * * State updates: * - commitHash: Hash of the created commit * * @returns A FlowStep that creates a git commit * * @example Creating and staging a release commit * ```typescript * import { createGitCommitStep, executeStep } from '@hyperfrontend/versioning' * * const step = createGitCommitStep() * const result = await executeStep(step, context) * * // Get the created commit hash * console.log(result.stateUpdates?.commitHash) * // => 'a1b2c3d4e5f6...' * ``` */ declare function createGitCommitStep(): FlowStep; declare const CREATE_TAG_STEP_ID = "create-tag"; /** * Creates the create-tag step. * * This step: * 1. Creates an annotated git tag * 2. Uses the configured tag format * * State updates: * - tagName: Name of the created tag * * @returns A FlowStep that creates a git tag * * @example Creating an annotated version tag * ```typescript * import { createTagStep, executeStep } from '@hyperfrontend/versioning' * * const step = createTagStep() * const result = await executeStep(step, context) * * // Get the created tag name * console.log(result.stateUpdates?.tagName) * // => 'my-lib@1.2.0' * ``` */ declare function createTagStep(): FlowStep; /** * Creates a step that pushes the created tag to remote. * * @returns A FlowStep that pushes the git tag * * @example Pushing the tag to remote * ```typescript * import { createPushTagStep, executeStep } from '@hyperfrontend/versioning' * * const step = createPushTagStep() * const result = await executeStep(step, context) * * // Tag is pushed to remote * console.log(result.message) * // => 'Pushed tag: my-lib@1.2.0' * ``` */ declare function createPushTagStep(): FlowStep; declare const FETCH_REGISTRY_STEP_ID = "fetch-registry"; /** * Creates the fetch-registry step. * * This step: * 1. Queries the registry for the latest published version * 2. Reads the current version from package.json * 3. Determines if this is a first release * * State updates: * - publishedVersion: Latest version on registry (null if not published) * - currentVersion: Version from local package.json * - isFirstRelease: True if never published * * @returns A FlowStep that fetches registry information * * @example Fetching published version from registry * ```typescript * import { createFetchRegistryStep, executeStep } from '@hyperfrontend/versioning' * * const step = createFetchRegistryStep() * const result = await executeStep(step, context) * * // Check if first release * if (result.stateUpdates?.isFirstRelease) { * console.log('First release detected') * } * ``` */ declare function createFetchRegistryStep(): FlowStep; declare const GENERATE_CHANGELOG_STEP_ID = "generate-changelog"; /** * Maps conventional commit types to changelog section types. */ declare const DEFAULT_COMMIT_TYPE_TO_SECTION: Record; /** * Creates the generate-changelog step. * * This step: * 1. Groups commits by type/section * 2. Creates changelog items from commits * 3. Assembles a complete changelog entry * * State updates: * - changelogEntry: The generated ChangelogEntry * * @returns A FlowStep that generates changelog * * @example Generating a changelog entry from commits * ```typescript * import { createGenerateChangelogStep, executeStep } from '@hyperfrontend/versioning' * * const step = createGenerateChangelogStep() * const result = await executeStep(step, context) * * // Access the generated changelog entry * const entry = result.stateUpdates?.changelogEntry * console.log(entry?.version, entry?.sections.length) * // => '1.2.0', 3 * ``` */ declare function createGenerateChangelogStep(): FlowStep; /** * Creates the write-changelog step. * * This step writes the generated changelog entry to CHANGELOG.md. * * @returns A FlowStep that writes changelog to file * * @example Writing the changelog entry to CHANGELOG.md * ```typescript * import { createWriteChangelogStep, executeStep } from '@hyperfrontend/versioning' * * const step = createWriteChangelogStep() * const result = await executeStep(step, context) * * // CHANGELOG.md is updated with the new entry * console.log(result.message) * // => 'Updated CHANGELOG.md with version 1.2.0' * ``` */ declare function createWriteChangelogStep(): FlowStep; declare const RESOLVE_REPOSITORY_STEP_ID = "resolve-repository"; /** * Creates the resolve-repository step. * * This step resolves repository configuration for compare URL generation. * It supports multiple resolution modes: * * - `undefined` or `'disabled'`: No-op, backward compatible default * - `'inferred'`: Auto-detect from package.json or git remote * - `RepositoryConfig`: Direct repository configuration provided * - `RepositoryResolution`: Fine-grained control with mode and options * * State updates: * - repositoryConfig: Resolved repository configuration (if successful) * * @returns A FlowStep that resolves repository configuration * * @example Configuring repository resolution modes * ```typescript * // Auto-detect repository * const flow = createFlow({ * repository: 'inferred' * }) * * // Explicit repository * const flow = createFlow({ * repository: { * platform: 'github', * baseUrl: 'https://github.com/owner/repo' * } * }) * ``` */ declare function createResolveRepositoryStep(): FlowStep; declare const UPDATE_PACKAGES_STEP_ID = "update-packages"; /** * Creates the update-packages step. * * This step: * 1. Updates the version field in package.json * 2. Tracks the modified files * * State updates: * - modifiedFiles: Adds package.json to list * * @returns A FlowStep that updates package.json * * @example Updating the package.json version field * ```typescript * import { createUpdatePackageStep, executeStep } from '@hyperfrontend/versioning' * * const step = createUpdatePackageStep() * const result = await executeStep(step, context) * * // package.json version field is updated * console.log(result.stateUpdates?.modifiedFiles) * // => ['/workspace/libs/my-lib/package.json'] * ``` */ declare function createUpdatePackageStep(): FlowStep; /** * Creates a step that updates dependent packages in a monorepo. * * This step cascades version updates to packages that depend * on the updated package. * * @returns A FlowStep that cascades dependency updates * * @example Updating dependent packages in a monorepo * ```typescript * import { createCascadeDependenciesStep, executeStep } from '@hyperfrontend/versioning' * * const step = createCascadeDependenciesStep() * const result = await executeStep(step, contextWithTrackDeps) * * // Dependent packages are updated * console.log(result.message) * ``` */ declare function createCascadeDependenciesStep(): FlowStep; export { ANALYZE_COMMITS_STEP_ID, CALCULATE_BUMP_STEP_ID, CREATE_COMMIT_STEP_ID, CREATE_TAG_STEP_ID, DEFAULT_COMMIT_TYPE_TO_SECTION, FETCH_REGISTRY_STEP_ID, GENERATE_CHANGELOG_STEP_ID, RESOLVE_REPOSITORY_STEP_ID, UPDATE_PACKAGES_STEP_ID, createAnalyzeCommitsStep, createCalculateBumpStep, createCascadeDependenciesStep, createCheckIdempotencyStep, createFetchRegistryStep, createGenerateChangelogStep, createGitCommitStep, createPushTagStep, createResolveRepositoryStep, createTagStep, createUpdatePackageStep, createWriteChangelogStep };