Implementation:Cypress io Cypress GetNextVersionForBinary
Appearance
| Knowledge Sources | |
|---|---|
| Domains | Release_Engineering, Versioning |
| Last Updated | 2026-02-12 00:00 GMT |
Overview
Concrete tool for calculating the next semantic version from Git history provided by the Cypress release scripts.
Description
The getNextVersionForBinary function (scripts/get-next-version.js:L70-92) calls getNextVersionForPath with the binary package path. The underlying getNextVersionForPath (L14-68) uses conventional-recommended-bump to analyze Git commits and semver to compute the next version string.
Usage
Called during the release pipeline to determine the version number for the upcoming release.
Code Reference
Source Location
- Repository: cypress-io/cypress
- File: scripts/get-next-version.js
- Lines: L70-92 (getNextVersionForBinary), L14-68 (getNextVersionForPath)
Signature
async function getNextVersionForBinary() {
// Returns { nextVersion: string, commits: any[] }
return getNextVersionForPath('.')
}
async function getNextVersionForPath(path) {
// Uses conventional-recommended-bump to analyze commits
// Uses semver.inc() to compute next version
// Returns { nextVersion: string, commits: any[] }
}
Import
const { getNextVersionForBinary } = require('./get-next-version')
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| Git history | commits | Yes | Conventional commit messages since last tag |
| path | string | Yes (getNextVersionForPath) | Package path for version calculation |
Outputs
| Name | Type | Description |
|---|---|---|
| nextVersion | string | Computed next semantic version (e.g., "13.7.0") |
| commits | array | Relevant commits since last release |
Usage Examples
CLI Usage
# Determine next version
node scripts/get-next-version.js
# Output: Next version: 13.7.0
# Use in CI pipeline
VERSION=$(node -e "require('./scripts/get-next-version').getNextVersionForBinary().then(r => console.log(r.nextVersion))")
Related Pages
Implements Principle
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment