autorel 2.2.13-next.2 → 2.2.13-next.3

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.
package/dist/index.js CHANGED
@@ -80,13 +80,13 @@ async function autorel(args) {
80
80
  if (lastChannelTag && !highestTag)
81
81
  throw new Error('Last channel tag exists, but highest tag does not.');
82
82
  const tagFromWhichToFindCommits = prereleaseChannel && lastChannelTag
83
- ? semver.highestVersion(semver.fromTag(lastChannelTag), semver.fromTag(lastStableTag ?? 'v0.0.0'))
83
+ ? semver.toTag(semver.highestVersion(semver.fromTag(lastChannelTag), semver.fromTag(lastStableTag ?? 'v0.0.0')))
84
84
  : lastStableTag;
85
85
  !!lastChannelTag && output_1.default.log(`The last pre-release channel version (${prereleaseChannel}) is: ${color.bold(lastChannelTag)}`);
86
86
  output_1.default.log(`The last stable/production version is: ${lastStableTag ? color.bold(lastStableTag) : color.grey('none')}`);
87
87
  output_1.default.log(`The current/highest version is: ${highestTag ? color.bold(highestTag) : color.grey('none')}`);
88
- output_1.default.log(`Fetching commits since ${tagFromWhichToFindCommits || 'the beginning of the repository'}...`);
89
- const commits = git.getCommitsSinceLastTag(prereleaseChannel ? lastChannelTag : lastStableTag);
88
+ output_1.default.log(`Fetching commits since ${tagFromWhichToFindCommits ?? 'the beginning of the repository'}...`);
89
+ const commits = git.getCommitsFromTag(tagFromWhichToFindCommits);
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))
92
92
  .filter((commit) => !!commit);
package/dist/lib/git.d.ts CHANGED
@@ -11,5 +11,5 @@ export declare function getRepo(): {
11
11
  owner: string;
12
12
  repository: string;
13
13
  };
14
- export declare function getCommitsSinceLastTag(lastTag?: string): Commit[];
14
+ export declare function getCommitsFromTag(tag?: string): Commit[];
15
15
  export declare function getCurrentBranch(): string;
package/dist/lib/git.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getCurrentBranch = exports.getCommitsSinceLastTag = exports.getRepo = exports.getLastStableTag = exports.getHighestTag = exports.getLastChannelTag = exports.createAndPushTag = exports.gitFetchTags = void 0;
3
+ exports.getCurrentBranch = exports.getCommitsFromTag = exports.getRepo = exports.getLastStableTag = exports.getHighestTag = exports.getLastChannelTag = exports.createAndPushTag = exports.gitFetchTags = void 0;
4
4
  const sh_1 = require("./sh");
5
5
  function gitFetchTags() {
6
6
  (0, sh_1.$) `git fetch`;
@@ -38,10 +38,10 @@ function getRepo() {
38
38
  return { owner: username, repository };
39
39
  }
40
40
  exports.getRepo = getRepo;
41
- function getCommitsSinceLastTag(lastTag) {
41
+ function getCommitsFromTag(tag) {
42
42
  const format = '<commit><hash>%h</hash><message>%B</message></commit>';
43
- const rawLog = lastTag
44
- ? (0, sh_1.$) `git log --pretty=format:"${format}" ${lastTag}..HEAD`
43
+ const rawLog = tag
44
+ ? (0, sh_1.$) `git log --pretty=format:"${format}" ${tag}..HEAD`
45
45
  : (0, sh_1.$) `git log --pretty=format:"${format}"`;
46
46
  const commitsXml = rawLog.match(/<commit>.*?<\/commit>/gs);
47
47
  if (!commitsXml)
@@ -52,7 +52,7 @@ function getCommitsSinceLastTag(lastTag) {
52
52
  return { hash, message };
53
53
  });
54
54
  }
55
- exports.getCommitsSinceLastTag = getCommitsSinceLastTag;
55
+ exports.getCommitsFromTag = getCommitsFromTag;
56
56
  function getCurrentBranch() {
57
57
  return (0, sh_1.$) `git rev-parse --abbrev-ref HEAD`;
58
58
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autorel",
3
- "version": "2.2.13-next.2",
3
+ "version": "2.2.13-next.3",
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)",