# increment

Version bumping: increment a [`SemVer`](https://www.hyperfrontend.dev/docs/libraries/versioning/semver/models/#api-SemVer) by a [`BumpType`](https://www.hyperfrontend.dev/docs/libraries/versioning/semver/models/#api-BumpType) and compute the diff between two versions.

`increment(version, bumpType)` produces the next version for [`major`](https://www.hyperfrontend.dev/docs/libraries/versioning/semver/models/#api-BumpType), [`minor`](https://www.hyperfrontend.dev/docs/libraries/versioning/semver/models/#api-BumpType), [`patch`](https://www.hyperfrontend.dev/docs/libraries/versioning/semver/models/#api-BumpType), and the equivalent prerelease bumps. [`incrementPrerelease`](https://www.hyperfrontend.dev/docs/libraries/versioning/semver/increment/#api-incrementPrerelease) is the dedicated helper for advancing `-rc.1` → `-rc.2` style identifiers without touching the numeric core. `diff(a, b)` returns the smallest [`BumpType`](https://www.hyperfrontend.dev/docs/libraries/versioning/semver/models/#api-BumpType) that explains the change between two versions, used by changelog and dependent-package logic to decide what kind of bump a downstream package needs.

---

Canonical page: https://www.hyperfrontend.dev/docs/libraries/versioning/semver/increment/
This file: https://www.hyperfrontend.dev/docs/libraries/versioning/semver/increment.md
Documentation index: https://www.hyperfrontend.dev/llms.txt
