autorel 2.2.13-next.1 → 2.2.13-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +6 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -77,15 +77,15 @@ async function autorel(args) {
77
77
  throw new Error(`Invalid last stable tag: ${lastStableTag}`);
78
78
  if (highestTag && !semver.isValidTag(highestTag))
79
79
  throw new Error(`Invalid highest tag: ${highestTag}`);
80
+ if (lastChannelTag && !highestTag)
81
+ throw new Error('Last channel tag exists, but highest tag does not.');
82
+ const tagFromWhichToFindCommits = prereleaseChannel && lastChannelTag
83
+ ? semver.highestVersion(semver.fromTag(lastChannelTag), semver.fromTag(lastStableTag ?? 'v0.0.0'))
84
+ : lastStableTag;
80
85
  !!lastChannelTag && output_1.default.log(`The last pre-release channel version (${prereleaseChannel}) is: ${color.bold(lastChannelTag)}`);
81
86
  output_1.default.log(`The last stable/production version is: ${lastStableTag ? color.bold(lastStableTag) : color.grey('none')}`);
82
87
  output_1.default.log(`The current/highest version is: ${highestTag ? color.bold(highestTag) : color.grey('none')}`);
83
- if (prereleaseChannel) {
84
- output_1.default.log(`Fetching commits since ${lastChannelTag || 'the beginning of the repository'}...`);
85
- }
86
- else {
87
- output_1.default.log(`Fetching commits since ${lastStableTag || 'the beginning of the repository'}...`);
88
- }
88
+ output_1.default.log(`Fetching commits since ${tagFromWhichToFindCommits || 'the beginning of the repository'}...`);
89
89
  const commits = git.getCommitsSinceLastTag(prereleaseChannel ? lastChannelTag : lastStableTag);
90
90
  output_1.default.log(`Found ${color.bold(commits.length.toString())} commit(s).`);
91
91
  const parsedCommits = commits.map((commit) => convCom.parseConventionalCommit(commit.message, commit.hash))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autorel",
3
- "version": "2.2.13-next.1",
3
+ "version": "2.2.13-next.2",
4
4
  "description": "Automate semantic releases based on conventional commits. Similar to semantic-release but much simpler.",
5
5
  "license": "MIT",
6
6
  "author": "Marc H. Weiner <mhweiner234@gmail.com> (https://mhweiner.com)",