@hyperfrontend/versioning/flow/stepssteps
Reusable flow-step factories — the building blocks that the flow/presets family composes into release pipelines.
createFetchRegistryStep, createAnalyzeCommitsStep, createCalculateBumpStep, createCheckIdempotencyStep, createGenerateChangelogStep, createWriteChangelogStep, createGitCommitStep, createTagStep, and createPushTagStep each return a FlowStep with a stable, exported step ID (FETCH_REGISTRY_STEP_ID, ANALYZE_COMMITS_STEP_ID, etc.) so consumers can reference, replace, or position individual steps inside custom flows. DEFAULT_COMMIT_TYPE_TO_SECTION is the conventional mapping from commit types to changelog sections used by the changelog-generation step.
API Reference
ƒ Functions
This step:
- Uses publishedCommit from npm registry (set by fetch-registry step)
- Verifies the commit is reachable from current HEAD
- Gets all commits since that commit (or recent commits if first release/fallback)
- Parses each commit using conventional commit format
- Classifies commits based on scope filtering strategy
- Filters to only release-worthy commits that belong to this project
- 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
FlowStepExample
Analyzing commits since last release
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' }, ...]This step:
- Analyzes commit types and breaking changes
- Determines the appropriate bump level
- Calculates the next version
- bumpType: 'major' | 'minor' | 'patch' | 'none'
- nextVersion: Calculated next version string
Returns
FlowStepExample
Running the calculate-bump step
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'This step cascades version updates to packages that depend on the updated package.
Returns
FlowStepExample
Updating dependent packages in a monorepo
import { createCascadeDependenciesStep, executeStep } from '@hyperfrontend/versioning'
const step = createCascadeDependenciesStep()
const result = await executeStep(step, contextWithTrackDeps)
// Dependent packages are updated
console.log(result.message)This step prevents redundant releases by checking if the calculated version is already published.
Returns
FlowStepExample
Preventing duplicate releases
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')
}This step:
- Queries the registry for the latest published version
- Reads the current version from package.json
- Determines if this is a first release
- publishedVersion: Latest version on registry (null if not published)
- currentVersion: Version from local package.json
- isFirstRelease: True if never published
Returns
FlowStepExample
Fetching published version from registry
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')
}This step:
- Groups commits by type/section
- Creates changelog items from commits
- Assembles a complete changelog entry
- changelogEntry: The generated ChangelogEntry
Returns
FlowStepExample
Generating a changelog entry from commits
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', 3This step:
- Stages modified files
- Creates a commit with the configured message
- commitHash: Hash of the created commit
Returns
FlowStepExample
Creating and staging a release commit
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...'Returns
FlowStepExample
Pushing the tag to remote
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'This step resolves repository configuration for compare URL generation. It supports multiple resolution modes:
undefinedor'disabled': No-op, backward compatible default'inferred': Auto-detect from package.json or git remoteRepositoryConfig: Direct repository configuration providedRepositoryResolution: Fine-grained control with mode and options
- repositoryConfig: Resolved repository configuration (if successful)
Returns
FlowStepExample
Configuring repository resolution modes
// Auto-detect repository
const flow = createFlow({
repository: 'inferred'
})
// Explicit repository
const flow = createFlow({
repository: {
platform: 'github',
baseUrl: 'https://github.com/owner/repo'
}
})This step:
- Creates an annotated git tag
- Uses the configured tag format
- tagName: Name of the created tag
Returns
FlowStepExample
Creating an annotated version tag
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'This step:
- Updates the version field in package.json
- Tracks the modified files
- modifiedFiles: Adds package.json to list
Returns
FlowStepExample
Updating the package.json version field
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']This step writes the generated changelog entry to CHANGELOG.md.
Returns
FlowStepExample
Writing the changelog entry to CHANGELOG.md
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'