Skip to content

Commit

Permalink
chore(release): rearrange logging for case of no changes
Browse files Browse the repository at this point in the history
  • Loading branch information
fahslaj committed Oct 23, 2023
1 parent 3a24229 commit 3122420
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions packages/js/src/generators/release-version/release-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 3122420

Please sign in to comment.