versionary 0.14.0 → 0.14.1

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.
@@ -51,6 +51,28 @@ function groupCommitLines(commits, repoUrl) {
51
51
  const features = [];
52
52
  const fixes = [];
53
53
  const reverts = [];
54
+ const getRevertedSubject = (commit) => {
55
+ const normalizedDescription = (commit.description ?? "")
56
+ .trim()
57
+ .replace(/^"(.*)"$/u, "$1");
58
+ if (normalizedDescription.length > 0) {
59
+ return normalizedDescription;
60
+ }
61
+ const quoted = commit.subject.match(/^revert:\s+"(.+)"$/iu);
62
+ if (quoted) {
63
+ return quoted[1].trim();
64
+ }
65
+ const plain = commit.subject.match(/^revert:\s+(.+)$/iu);
66
+ return plain ? plain[1].trim() : "";
67
+ };
68
+ const shouldIncludeRevert = (commit) => {
69
+ const revertedSubject = getRevertedSubject(commit);
70
+ if (revertedSubject.length === 0) {
71
+ return true;
72
+ }
73
+ const revertedCommit = (0, commits_js_1.parseConventionalCommitMessage)(revertedSubject);
74
+ return (0, commits_js_1.inferReleaseTypeFromParsedCommit)(revertedCommit) !== null;
75
+ };
54
76
  for (const commit of commits) {
55
77
  const type = (0, commits_js_1.inferReleaseTypeFromParsedCommit)(commit);
56
78
  if (!type) {
@@ -67,6 +89,9 @@ function groupCommitLines(commits, repoUrl) {
67
89
  const commitType = (commit.type ?? "").toLowerCase();
68
90
  const isBreaking = type === "major";
69
91
  if (commit.isRevert) {
92
+ if (!shouldIncludeRevert(commit)) {
93
+ continue;
94
+ }
70
95
  reverts.push(line);
71
96
  continue;
72
97
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "versionary",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "description": "Automatic release framework based on conventional commits and semantic versioning",
5
5
  "keywords": [
6
6
  "releasing",