Skip to content

Rename canary command to prerelease; simplify ChangeType#1224

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/update-beachball-prerelease-handling
Draft

Rename canary command to prerelease; simplify ChangeType#1224
Copilot wants to merge 3 commits intomainfrom
copilot/update-beachball-prerelease-handling

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 29, 2026

Reworks prerelease publishing per the revised plan: renames the canary command, removes overlapping options, and shrinks the ChangeType union.

Command and option changes

  • beachball canarybeachball prerelease (no alias).
  • canaryName removed; prereleasePrefix is now the suffix used by beachball prerelease (e.g. "beta", "pr30") and defaults to "prerelease".
  • prereleasePrefix no longer affects bump/publish.

ChangeType shrunk to 'patch' | 'minor' | 'major' | 'none'

  • Change files using premajor/preminor/prepatch are auto-coerced to major/minor/patch with a warning at read time.
  • Change files using type: "prerelease" produce a hard error directing the user to recreate the file and use beachball prerelease.
  • Same migration applied to --type / --dependent-change-type CLI args.

Prerelease versioning algorithm

New pure helper bump/getPrereleaseVersion.ts:

  1. Strip any prerelease component from currentVersion.
  2. Apply changeType (or pass through for 'none') to get the target release.
  3. Use listPackageVersions to find the highest existing ${target}-${prereleasePrefix}.<n> and return <n+1> (or start from identifierBase: '0' default, '1', or false for no counter).

This replaces the old do { semver.inc(v, 'prerelease', name) } while (versionExists) loop and fixes the 0.2.0 + minor → 0.3.0-beta.0 case (issue #676).

Prerelease → release promotion (assumption E)

bumpPackageInfoVersion strips any prerelease component from the current version before applying semver.inc, so a patch change against 1.0.0-beta.0 produces 1.0.1 rather than another prerelease.

Docs

New docs/cli/prerelease.md; sidebar updated; --prerelease-prefix rows removed from bump.md/publish.md; prereleasePrefix row in configuration.md rewritten; "Prereleases" subsection added to change-types.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants