From 31224208965f41a79e3874a462dbc61c22c00b7c Mon Sep 17 00:00:00 2001 From: Austin Fahsl Date: Mon, 23 Oct 2023 11:45:08 -0600 Subject: [PATCH] chore(release): rearrange logging for case of no changes --- .../release-version/release-version.ts | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/packages/js/src/generators/release-version/release-version.ts b/packages/js/src/generators/release-version/release-version.ts index 541d878eb9a9e3..7eaca7094ebae5 100644 --- a/packages/js/src/generators/release-version/release-version.ts +++ b/packages/js/src/generators/release-version/release-version.ts @@ -184,6 +184,10 @@ To fix this you will either need to add a package.json file at that location, or ); } + if (options.specifier) { + log(`📄 Using the provided version specifier "${options.specifier}".`); + } + // if specifier is null, then we determined previously via conventional commits that no changes are necessary if (specifier === undefined) { const specifierSource = options.specifierSource; @@ -195,29 +199,29 @@ To fix this you will either need to add a package.json file at that location, or ); } - // Always assume that if the current version is a prerelease, then the next version should be a prerelease. - // Users must manually graduate from a prerelease to a release by providing an explicit specifier. - if (prerelease(currentVersion)) { - specifier = 'prerelease'; - log( - `📄 Resolved the specifier as "${specifier}" since the current version is a prerelease.` - ); - break; - } - specifier = await resolveSemverSpecifierFromConventionalCommits( latestMatchingGitTag.tag, options.projectGraph, projects.map((p) => p.name) ); - if (specifier) { + if (!specifier) { log( - `📄 Resolved the specifier as "${specifier}" using git history and the conventional commits standard.` + `🚫 No changes were detected using git history and the conventional commits standard.` + ); + break; + } + + // Always assume that if the current version is a prerelease, then the next version should be a prerelease. + // Users must manually graduate from a prerelease to a release by providing an explicit specifier. + if (prerelease(currentVersion)) { + specifier = 'prerelease'; + log( + `📄 Resolved the specifier as "${specifier}" since the current version is a prerelease.` ); } else { log( - `🚫 No changes were detected using git history and the conventional commits standard.` + `📄 Resolved the specifier as "${specifier}" using git history and the conventional commits standard.` ); } break;