import { FlowConfig, VersionFlow, FlowStep } from '../models'; /** * Default configuration for conventional flow. */ declare const CONVENTIONAL_FLOW_CONFIG: FlowConfig; /** * Creates a conventional flow. * * This flow follows the standard conventional commits workflow: * 1. Fetch published version from registry * 2. Resolve repository configuration (for compare URLs) * 3. Analyze commits since last release * 4. Calculate version bump based on commit types * 5. Check if version already published (idempotency) * 6. Generate changelog entry (with compare URL if repository resolved) * 7. Update package.json version * 8. Write changelog to file * 9. Create git commit (optional) * 10. Create git tag (optional, typically after publish) * * @param config - Optional configuration overrides * @returns A VersionFlow configured for conventional commits * * @example Creating a conventional versioning flow * ```typescript * import { createConventionalFlow, executeFlow } from '@hyperfrontend/versioning' * * // Use defaults * const flow = createConventionalFlow() * * // With overrides * const customFlow = createConventionalFlow({ * skipTag: false, * releaseTypes: ['feat', 'fix'], * }) * * const result = await executeFlow(flow, 'lib-utils', '/workspace') * ``` */ declare function createConventionalFlow(config?: Partial): VersionFlow; /** * Creates a minimal flow for quick releases. * * Skips changelog and tag creation. * * @param config - Optional configuration overrides * @returns A minimal VersionFlow * * @example Creating a minimal release flow * ```typescript * import { createMinimalFlow, executeFlow } from '@hyperfrontend/versioning' * * const flow = createMinimalFlow() * const result = await executeFlow(flow, 'my-lib', '/workspace') * * // Quick release without changelog or tags * console.log('Released:', result.state.nextVersion) * ``` */ declare function createMinimalFlow(config?: Partial): VersionFlow; /** * Creates a changelog-only flow. * * Only generates changelog, no version bumps or git operations. * * @param config - Optional configuration overrides * @returns A VersionFlow that only updates changelog * * @example Creating a changelog-only flow * ```typescript * import { createChangelogOnlyFlow, executeFlow } from '@hyperfrontend/versioning' * * const flow = createChangelogOnlyFlow() * const result = await executeFlow(flow, 'my-lib', '/workspace') * * // Only changelog is updated, no version bump * console.log(result.state.changelogEntry) * ``` */ declare function createChangelogOnlyFlow(config?: Partial): VersionFlow; /** * Default configuration for independent flow. */ declare const INDEPENDENT_FLOW_CONFIG: FlowConfig; /** * Creates a step that checks for dependent package bumps. * * In independent versioning, when a dependency is bumped, * dependents may also need version bumps. * * @returns A FlowStep that checks dependent bumps * * @example Checking if dependent packages need bumps * ```typescript * import { createCheckDependentBumpsStep, executeStep } from '@hyperfrontend/versioning' * * const step = createCheckDependentBumpsStep() * const result = await executeStep(step, contextWithTrackDeps) * * // Result indicates if any dependents need bumps * console.log(result.message) * ``` */ declare function createCheckDependentBumpsStep(): FlowStep; /** * Creates an independent versioning flow. * * This flow is designed for monorepos where each package * is versioned independently: * * 1. Fetch published version from registry * 2. Analyze commits since last release * 3. Calculate version bump based on commit types * 4. Check for dependent package bumps (cascade) * 5. Check if version already published (idempotency) * 6. Generate changelog entry * 7. Update package.json version * 8. Cascade dependency updates * 9. Write changelog to file * 10. Create git commit * 11. Create git tag * * @param config - Optional configuration overrides * @returns A VersionFlow configured for independent versioning * * @example Creating an independent versioning flow * ```typescript * import { createIndependentFlow, executeFlow } from '@hyperfrontend/versioning' * * const flow = createIndependentFlow() * const result = await executeFlow(flow, 'lib-utils', '/workspace') * * // Inspect the version that was released * console.log(result.state.nextVersion) * ``` */ declare function createIndependentFlow(config?: Partial): VersionFlow; /** * Creates a flow for releasing multiple packages independently. * * This is a variant that skips commit/tag creation, intended * to be used when releasing multiple packages in sequence * with a single commit at the end. * * @param config - Optional configuration overrides * @returns A VersionFlow for batch independent releases * * @example Releasing multiple packages in batch * ```typescript * import { createBatchReleaseFlow, executeFlow } from '@hyperfrontend/versioning' * * // Release multiple packages without individual commits * for (const pkg of ['lib-a', 'lib-b', 'lib-c']) { * await executeFlow(createBatchReleaseFlow(), pkg, '/workspace') * } * // Then create a single combined commit * ``` */ declare function createBatchReleaseFlow(config?: Partial): VersionFlow; /** * Default configuration for synced flow. */ declare const SYNCED_FLOW_CONFIG: FlowConfig; /** * Creates a step that updates all workspace packages to the same version. * * @returns A FlowStep that syncs all package versions * * @example Syncing all packages to the same version * ```typescript * import { createSyncAllPackagesStep, executeStep } from '@hyperfrontend/versioning' * * const step = createSyncAllPackagesStep() * const result = await executeStep(step, context) * * // All packages updated to same version * console.log(result.stateUpdates?.modifiedFiles) * ``` */ declare function createSyncAllPackagesStep(): FlowStep; /** * Creates a step that generates a combined changelog for all packages. * * @returns A FlowStep that creates a combined changelog * * @example Generating a combined changelog for all packages * ```typescript * import { createCombinedChangelogStep, executeStep } from '@hyperfrontend/versioning' * * const step = createCombinedChangelogStep() * const result = await executeStep(step, context) * * // Single changelog for all packages * console.log(result.message) * ``` */ declare function createCombinedChangelogStep(): FlowStep; /** * Creates a synced versioning flow. * * This flow maintains the same version across all packages * in a monorepo. When any package changes, all packages * get the same new version. * * Flow steps: * 1. Fetch published version from registry * 2. Analyze commits across all packages * 3. Calculate version bump (highest needed) * 4. Check if version already published * 5. Sync all package versions * 6. Generate combined changelog * 7. Write changelog to root * 8. Create git commit * 9. Create single git tag * * @param config - Optional configuration overrides * @returns A VersionFlow configured for synced versioning * * @example Creating a synced versioning flow * ```typescript * import { createSyncedFlow, executeFlow } from '@hyperfrontend/versioning' * * const flow = createSyncedFlow() * const result = await executeFlow(flow, 'workspace', '/workspace') * * // All packages now share the same version * console.log(`Released v${result.state.nextVersion}`) * ``` */ declare function createSyncedFlow(config?: Partial): VersionFlow; /** * Creates a fixed versioning flow. * * Similar to synced, but uses a fixed version scheme * where the version is explicitly provided rather than * calculated from commits. * * @param version - The fixed version to use * @param config - Optional configuration overrides * @returns A VersionFlow with a fixed version * * @example Creating a fixed version release flow * ```typescript * import { createFixedVersionFlow, executeFlow } from '@hyperfrontend/versioning' * * // Release with explicit version, ignoring commit analysis * const flow = createFixedVersionFlow('2.0.0') * const result = await executeFlow(flow, 'workspace', '/workspace') * * console.log(result.state.nextVersion) * // => '2.0.0' * ``` */ declare function createFixedVersionFlow(version: string, config?: Partial): VersionFlow; export { CONVENTIONAL_FLOW_CONFIG, INDEPENDENT_FLOW_CONFIG, SYNCED_FLOW_CONFIG, createBatchReleaseFlow, createChangelogOnlyFlow, createCheckDependentBumpsStep, createCombinedChangelogStep, createConventionalFlow, createFixedVersionFlow, createIndependentFlow, createMinimalFlow, createSyncAllPackagesStep, createSyncedFlow };