Skip to main content
Version: Latest - 0.0.1

cngpac prepare

Calculate the next version based on changenotes and write a prepare.json file that signals CI to perform the release.

Usage

cngpac prepare <type> [tag] [options]

Alias: prep

Arguments

ArgumentRequiredDescription
typeYesRelease type (see table below)
tagNoPre-release tag (e.g., alpha, beta). Defaults to alpha.

Release Types

TypeDescriptionExample
releaseStable release1.2.31.3.0
prereleaseIncrement pre-release counter1.3.0-alpha.11.3.0-alpha.2
prepatchPre-release patch1.2.31.2.4-alpha.1
preminorPre-release minor1.2.31.3.0-alpha.1
premajorPre-release major1.2.32.0.0-alpha.1

Options

OptionDescription
--commitCommit the prepare config after writing it
--pushPush to origin after committing (implies --commit)

How It Works

  1. Loads cngpac.config.ts to find the package path
  2. Reads all changenotes from .changenotes/
  3. Calculates the semantic version bump based on the highest bump field across all changenotes
  4. Applies the release type (stable or pre-release with tag)
  5. Prompts for confirmation: Prepare my-package: 1.2.3 → 1.3.0 ?
  6. Writes .changenotes/prepare.json with the target version
  7. Runs formatter plugins on the created file
  8. Optionally commits and pushes

The prepare.json File

{
"newVersion": "1.3.0",
"attempt": 1
}
FieldDescription
newVersionThe target version for the release
attemptAttempt counter (incremented by reprepare on retries)

Examples

Stable release

cngpac prepare release --push

Beta pre-release

cngpac prepare prerelease beta --push

Release prep without pushing

cngpac prepare release

CI Trigger

The generated CI workflow (.github/workflows/version.yml) watches for changes to .changenotes/prepare.json on the main branch. Pushing this file triggers the automated versioning pipeline.