@taiga-ui/auto-changelog-config 0.496.0 → 0.498.0

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 (3) hide show
  1. package/package.json +2 -2
  2. package/setup.js +11 -1
  3. package/template.hbs +16 -12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taiga-ui/auto-changelog-config",
3
- "version": "0.496.0",
3
+ "version": "0.498.0",
4
4
  "description": "Taiga UI auto-changelog config",
5
5
  "keywords": [
6
6
  "auto-changelog"
@@ -30,7 +30,7 @@
30
30
  ],
31
31
  "main": "index.json",
32
32
  "peerDependencies": {
33
- "auto-changelog": "2.5.0"
33
+ "auto-changelog": "^2.5.0"
34
34
  },
35
35
  "publishConfig": {
36
36
  "access": "public"
package/setup.js CHANGED
@@ -8,7 +8,9 @@ module.exports = function (Handlebars) {
8
8
  const escape = (value) => Handlebars.escapeExpression(String(value ?? ''));
9
9
 
10
10
  const commitPattern =
11
- /^(?:build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)\s?(?:\((?<scope>[^)]*)\))?!?: (?<title>.*)$/;
11
+ /^(?:build|chore|ci|docs|feat|fix|refactor|revert|style|test)\s?(?:\((?<scope>[^)]*)\))?!?: (?<title>.*)$/;
12
+
13
+ const publicChangePattern = /^(?:feat|fix)(?:\([^)]*\))?!?:/;
12
14
 
13
15
  const getPullRequestId = (href) => {
14
16
  const [, id = ''] =
@@ -171,4 +173,12 @@ module.exports = function (Handlebars) {
171
173
 
172
174
  return string.replace(/^v/, '');
173
175
  });
176
+
177
+ Handlebars.registerHelper('if-public-changes', function (commits, options) {
178
+ const hasPublicChanges = toArray(commits).some((commit) =>
179
+ publicChangePattern.test(firstNonEmptyString(commit.subject, commit.message)),
180
+ );
181
+
182
+ return hasPublicChanges ? options.fn(this) : options.inverse(this);
183
+ });
174
184
  };
package/template.hbs CHANGED
@@ -6,21 +6,25 @@
6
6
 
7
7
  {{#commit-parser merges commits}}
8
8
 
9
- {{#commit-list this heading='### ⚠️ BREAKING CHANGES' message='^(feat|fix|perf)(\([^)]*\))!:' }}
10
- - {{changelogEntry}}
11
- {{/commit-list}}
9
+ {{#if-public-changes this}}
12
10
 
13
- {{#commit-list this heading='### 🚀 Features' message='^feat:|^feat\(' exclude='^(feat|fix|perf)(\([^)]*\))!:'}}
14
- - {{changelogEntry}}
15
- {{/commit-list}}
11
+ {{#commit-list this heading='### 🚀 Features' message='^feat(?:\([^)]*\))?!?:' exclude='^(feat|fix)(\([^)]*\))!:'}}
12
+ - {{changelogEntry}}
13
+ {{/commit-list}}
16
14
 
17
- {{#commit-list this heading='### 🐞 Bug Fixes' message='^fix:|^fix\(' exclude='^(feat|fix|perf)(\([^)]*\))!:'}}
18
- - {{changelogEntry}}
19
- {{/commit-list}}
15
+ {{#commit-list this heading='### 🐞 Bug Fixes' message='^fix(?:\([^)]*\))?!?:' exclude='^(feat|fix)(\([^)]*\))!:'}}
16
+ - {{changelogEntry}}
17
+ {{/commit-list}}
20
18
 
21
- {{#commit-list this heading='### Performance Improvements' message='^perf:|^perf\(' exclude='^(feat|fix|perf)(\([^)]*\))!:'}}
22
- - {{changelogEntry}}
23
- {{/commit-list}}
19
+ {{#commit-list this heading='### ⚠️ BREAKING CHANGES' message='^(feat|fix)(\([^)]*\))!:'}}
20
+ - {{changelogEntry}}
21
+ {{/commit-list}}
22
+
23
+ {{else}}
24
+
25
+ This release contains internal technical improvements only. No changes to functionality, UI, or APIs.
26
+
27
+ {{/if-public-changes}}
24
28
 
25
29
  {{/commit-parser}}
26
30