From ad2fcf477b1960c211b6c9c67f5a32028a3c5c62 Mon Sep 17 00:00:00 2001 From: Nikola Kalinov Date: Thu, 1 Feb 2024 18:36:30 +0200 Subject: [PATCH] fix(release): default to 'patch' for --first-release with conventional commits without relevant commits or previous versions --- .../js/src/generators/release-version/release-version.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/js/src/generators/release-version/release-version.ts b/packages/js/src/generators/release-version/release-version.ts index 23a17728cebb6..8e91f4ae47894 100644 --- a/packages/js/src/generators/release-version/release-version.ts +++ b/packages/js/src/generators/release-version/release-version.ts @@ -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.`