Skip to content

Commit

Permalink
fix(release): default to 'patch' for --first-release with conventiona…
Browse files Browse the repository at this point in the history
…l commits without relevant commits or previous versions
  • Loading branch information
nkalinov committed Feb 1, 2024
1 parent f0d93d0 commit ad2fcf4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/js/src/generators/release-version/release-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,13 @@ To fix this you will either need to add a package.json file at that location, or
affectedProjects
);

// No changes detected.
// Pretty common for fresh repos created from a Web UI and where the first commits are usually something like "Initial commit".
// Make it a bit less confusing for such first releases by defaulting to patch.
if (!specifier && !latestMatchingGitTag && options.firstRelease) {
specifier = 'patch';
}

if (!specifier) {
log(
`🚫 No changes were detected using git history and the conventional commits standard.`
Expand Down

0 comments on commit ad2fcf4

Please sign in to comment.