Skip to content

Publish prereleases

This guide shows how to publish prereleases of a scope, such as 1.1.0-alpha.0, then release it as stable. The SemVer and CalVer plugins provide the same pre command; the examples use SemVer.

List the channels in the order a release goes through them:

unirelman.config.ts
createSemverPlugin({
prereleaseChannels: ["alpha", "beta", "rc"],
});

Put the scope in prerelease mode:

Terminal window
npx unirelman semver pre --scope my-package --channel alpha

The command records the channel in .unirelman/semver/prerelease.json. Commit this file: version reads it.

From now on, each version run with changes gives a prerelease, such as 1.0.0 → 1.1.0-alpha.0 with a minor change, then 1.1.0-alpha.1. See the next version rules.

With fixed versioning, name the group with --group instead of --scope. See semver pre.

Terminal window
npx unirelman semver pre --scope my-package --channel beta

The next version run with changes gives 1.1.0-beta.0.

Exit prerelease mode:

Terminal window
npx unirelman semver pre --scope my-package --exit

The next version run releases the stable version, such as 1.1.0, even without new changesets.

  • npm publishes a prerelease under a dist-tag named after its channel, such as npm install my-package@beta. latest keeps pointing to the last stable version.
  • GitHub marks the release of a prerelease as a prerelease.