@html-validate/commitlint-config 4.0.2 → 4.1.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.
@@ -6,281 +6,166 @@ import { fileURLToPath as _$_fileURLToPath } from "node:url";
6
6
  const require = _$_createRequire(import.meta.url);
7
7
  const __dirname = _$_dirname(_$_fileURLToPath(import.meta.url));
8
8
 
9
- var __create = Object.create;
10
9
  var __defProp = Object.defineProperty;
11
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
- var __getOwnPropNames = Object.getOwnPropertyNames;
13
- var __getProtoOf = Object.getPrototypeOf;
14
- var __hasOwnProp = Object.prototype.hasOwnProperty;
15
- var __commonJS = (cb, mod) => function __require() {
16
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ var __export = (target, all) => {
11
+ for (var name in all)
12
+ __defProp(target, name, { get: all[name], enumerable: true });
17
13
  };
18
- var __copyProps = (to, from, except, desc) => {
19
- if (from && typeof from === "object" || typeof from === "function") {
20
- for (let key of __getOwnPropNames(from))
21
- if (!__hasOwnProp.call(to, key) && key !== except)
22
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
- }
24
- return to;
25
- };
26
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
27
- // If the importer is in node compatibility mode or this is not an ESM
28
- // file that has been converted to a CommonJS file using a Babel-
29
- // compatible transform (i.e. "__esModule" has not been set), then set
30
- // "default" to the CommonJS "module.exports" for node compatibility.
31
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
32
- mod
33
- ));
34
-
35
- // node_modules/array-ify/index.js
36
- var require_array_ify = __commonJS({
37
- "node_modules/array-ify/index.js"(exports, module) {
38
- "use strict";
39
- module.exports = function(val) {
40
- return Array.isArray(val) ? val : [val];
41
- };
42
- }
43
- });
44
14
 
45
- // node_modules/is-obj/index.js
46
- var require_is_obj = __commonJS({
47
- "node_modules/is-obj/index.js"(exports, module) {
48
- "use strict";
49
- module.exports = (value) => {
50
- const type = typeof value;
51
- return value !== null && (type === "object" || type === "function");
52
- };
53
- }
54
- });
15
+ // node_modules/conventional-changelog-conventionalcommits/src/parser.js
16
+ function createParserOpts(config) {
17
+ return {
18
+ headerPattern: /^(\w*)(?:\((.*)\))?!?: (.*)$/,
19
+ breakingHeaderPattern: /^(\w*)(?:\((.*)\))?!: (.*)$/,
20
+ headerCorrespondence: [
21
+ "type",
22
+ "scope",
23
+ "subject"
24
+ ],
25
+ noteKeywords: ["BREAKING CHANGE", "BREAKING-CHANGE"],
26
+ revertPattern: /^(?:Revert|revert:)\s"?([\s\S]+?)"?\s*This reverts commit (\w*)\./i,
27
+ revertCorrespondence: ["header", "hash"],
28
+ issuePrefixes: config?.issuePrefixes || ["#"]
29
+ };
30
+ }
55
31
 
56
- // node_modules/dot-prop/index.js
57
- var require_dot_prop = __commonJS({
58
- "node_modules/dot-prop/index.js"(exports, module) {
59
- "use strict";
60
- var isObj = require_is_obj();
61
- var disallowedKeys = [
62
- "__proto__",
63
- "prototype",
64
- "constructor"
65
- ];
66
- var isValidPath = (pathSegments) => !pathSegments.some((segment) => disallowedKeys.includes(segment));
67
- function getPathSegments(path) {
68
- const pathArray = path.split(".");
69
- const parts = [];
70
- for (let i = 0; i < pathArray.length; i++) {
71
- let p = pathArray[i];
72
- while (p[p.length - 1] === "\\" && pathArray[i + 1] !== void 0) {
73
- p = p.slice(0, -1) + ".";
74
- p += pathArray[++i];
75
- }
76
- parts.push(p);
77
- }
78
- if (!isValidPath(parts)) {
79
- return [];
80
- }
81
- return parts;
32
+ // node_modules/@conventional-changelog/template/dist/elements.js
33
+ function toString(value) {
34
+ return typeof value === "number" || value ? String(value) : "";
35
+ }
36
+ function each(array, callback, separator = newline()) {
37
+ return array ? array.reduce((acc, item) => {
38
+ const rendered = toString(callback(item)).trim();
39
+ return `${acc}${acc && rendered ? separator : ""}${rendered}`;
40
+ }, "") : "";
41
+ }
42
+ function heading(level, text) {
43
+ return `${"#".repeat(level)} ${text}`;
44
+ }
45
+ function link(text, url2) {
46
+ return `[${text}](${url2})`;
47
+ }
48
+ function list(array, callback) {
49
+ return each(array, (item) => {
50
+ const rendered = toString(callback(item)).trim();
51
+ const itemText = rendered.split(/\r?\n/).map((line, index) => index > 0 && line ? ` ${line}` : line).join("\n");
52
+ return rendered ? `* ${itemText}` : "";
53
+ });
54
+ }
55
+ function bold(text) {
56
+ return `**${text}**`;
57
+ }
58
+ function newline(times = 1) {
59
+ return "\n".repeat(times);
60
+ }
61
+ function strings(...values) {
62
+ return each(values, (value) => value, "");
63
+ }
64
+ function segments(...values) {
65
+ return each(values, (value) => value, newline(2));
66
+ }
67
+ function words(...values) {
68
+ return each(values, (value) => value, " ");
69
+ }
70
+ function url(...parts) {
71
+ return parts.reduce((acc, part) => {
72
+ if (typeof part !== "number" && !part) {
73
+ return acc;
82
74
  }
83
- module.exports = {
84
- get(object, path, value) {
85
- if (!isObj(object) || typeof path !== "string") {
86
- return value === void 0 ? object : value;
87
- }
88
- const pathArray = getPathSegments(path);
89
- if (pathArray.length === 0) {
90
- return;
91
- }
92
- for (let i = 0; i < pathArray.length; i++) {
93
- if (!Object.prototype.propertyIsEnumerable.call(object, pathArray[i])) {
94
- return value;
95
- }
96
- object = object[pathArray[i]];
97
- if (object === void 0 || object === null) {
98
- if (i !== pathArray.length - 1) {
99
- return value;
100
- }
101
- break;
102
- }
103
- }
104
- return object;
105
- },
106
- set(object, path, value) {
107
- if (!isObj(object) || typeof path !== "string") {
108
- return object;
109
- }
110
- const root = object;
111
- const pathArray = getPathSegments(path);
112
- for (let i = 0; i < pathArray.length; i++) {
113
- const p = pathArray[i];
114
- if (!isObj(object[p])) {
115
- object[p] = {};
116
- }
117
- if (i === pathArray.length - 1) {
118
- object[p] = value;
119
- }
120
- object = object[p];
121
- }
122
- return root;
123
- },
124
- delete(object, path) {
125
- if (!isObj(object) || typeof path !== "string") {
126
- return false;
127
- }
128
- const pathArray = getPathSegments(path);
129
- for (let i = 0; i < pathArray.length; i++) {
130
- const p = pathArray[i];
131
- if (i === pathArray.length - 1) {
132
- delete object[p];
133
- return true;
134
- }
135
- object = object[p];
136
- if (!isObj(object)) {
137
- return false;
138
- }
139
- }
140
- },
141
- has(object, path) {
142
- if (!isObj(object) || typeof path !== "string") {
143
- return false;
144
- }
145
- const pathArray = getPathSegments(path);
146
- if (pathArray.length === 0) {
147
- return false;
148
- }
149
- for (let i = 0; i < pathArray.length; i++) {
150
- if (isObj(object)) {
151
- if (!(pathArray[i] in object)) {
152
- return false;
153
- }
154
- object = object[pathArray[i]];
155
- } else {
156
- return false;
157
- }
158
- }
159
- return true;
160
- }
161
- };
162
- }
163
- });
75
+ const segment = String(part).replace(/^\/+|\/+$/g, "");
76
+ return acc ? `${acc}/${segment}` : segment;
77
+ }, "");
78
+ }
164
79
 
165
- // node_modules/compare-func/index.js
166
- var require_compare_func = __commonJS({
167
- "node_modules/compare-func/index.js"(exports, module) {
168
- "use strict";
169
- var arrayify = require_array_ify();
170
- var dotPropGet = require_dot_prop().get;
171
- function compareFunc2(prop) {
172
- return function(a, b) {
173
- var ret = 0;
174
- arrayify(prop).some(function(el) {
175
- var x;
176
- var y;
177
- if (typeof el === "function") {
178
- x = el(a);
179
- y = el(b);
180
- } else if (typeof el === "string") {
181
- x = dotPropGet(a, el);
182
- y = dotPropGet(b, el);
183
- } else {
184
- x = a;
185
- y = b;
186
- }
187
- if (x === y) {
188
- ret = 0;
189
- return;
190
- }
191
- if (typeof x === "string" && typeof y === "string") {
192
- ret = x.localeCompare(y);
193
- return ret !== 0;
194
- }
195
- ret = x < y ? -1 : 1;
196
- return true;
197
- });
198
- return ret;
199
- };
200
- }
201
- module.exports = compareFunc2;
80
+ // node_modules/@conventional-changelog/template/dist/templates.js
81
+ function repositoryUrl(context) {
82
+ if (context.repository) {
83
+ return url(context.host, context.owner, context.repository);
202
84
  }
203
- });
85
+ return context.repoUrl || "";
86
+ }
87
+ function referenceRepositoryUrl(context, reference2) {
88
+ if (!context.repository) {
89
+ return context.repoUrl || "";
90
+ }
91
+ if (reference2.repository) {
92
+ return url(context.host, reference2.owner, reference2.repository);
93
+ }
94
+ return url(context.host, context.owner, context.repository);
95
+ }
96
+ function compareUrl(context) {
97
+ const previousTag = encodeURIComponent(context.previousTag || "");
98
+ const currentTag = encodeURIComponent(context.currentTag || "");
99
+ return url(repositoryUrl(context), "compare", `${previousTag}...${currentTag}`);
100
+ }
101
+ function reference(reference2) {
102
+ return strings(reference2.owner && `${reference2.owner}/`, reference2.repository, reference2.issue && `${reference2.prefix || "#"}${reference2.issue}`);
103
+ }
204
104
 
205
105
  // node_modules/conventional-changelog-conventionalcommits/src/constants.js
206
106
  var DEFAULT_COMMIT_TYPES = Object.freeze([
207
107
  {
208
108
  type: "feat",
209
- section: "Features"
109
+ section: "Features",
110
+ effect: "bump"
210
111
  },
211
112
  {
212
113
  type: "feature",
213
- section: "Features"
114
+ section: "Features",
115
+ effect: "bump"
214
116
  },
215
117
  {
216
118
  type: "fix",
217
- section: "Bug Fixes"
119
+ section: "Bug Fixes",
120
+ effect: "bump"
218
121
  },
219
122
  {
220
123
  type: "perf",
221
- section: "Performance Improvements"
124
+ section: "Performance Improvements",
125
+ effect: "bump"
222
126
  },
223
127
  {
224
128
  type: "revert",
225
- section: "Reverts"
129
+ section: "Reverts",
130
+ effect: "bump"
226
131
  },
227
132
  {
228
133
  type: "docs",
229
134
  section: "Documentation",
230
- hidden: true
135
+ effect: "hidden"
231
136
  },
232
137
  {
233
138
  type: "style",
234
139
  section: "Styles",
235
- hidden: true
140
+ effect: "hidden"
236
141
  },
237
142
  {
238
143
  type: "chore",
239
144
  section: "Miscellaneous Chores",
240
- hidden: true
145
+ effect: "hidden"
241
146
  },
242
147
  {
243
148
  type: "refactor",
244
149
  section: "Code Refactoring",
245
- hidden: true
150
+ effect: "hidden"
246
151
  },
247
152
  {
248
153
  type: "test",
249
154
  section: "Tests",
250
- hidden: true
155
+ effect: "hidden"
251
156
  },
252
157
  {
253
158
  type: "build",
254
159
  section: "Build System",
255
- hidden: true
160
+ effect: "hidden"
256
161
  },
257
162
  {
258
163
  type: "ci",
259
164
  section: "Continuous Integration",
260
- hidden: true
165
+ effect: "hidden"
261
166
  }
262
167
  ].map(Object.freeze));
263
168
 
264
- // node_modules/conventional-changelog-conventionalcommits/src/parser.js
265
- function createParserOpts(config) {
266
- return {
267
- headerPattern: /^(\w*)(?:\((.*)\))?!?: (.*)$/,
268
- breakingHeaderPattern: /^(\w*)(?:\((.*)\))?!: (.*)$/,
269
- headerCorrespondence: [
270
- "type",
271
- "scope",
272
- "subject"
273
- ],
274
- noteKeywords: ["BREAKING CHANGE", "BREAKING-CHANGE"],
275
- revertPattern: /^(?:Revert|revert:)\s"?([\s\S]+?)"?\s*This reverts commit (\w*)\./i,
276
- revertCorrespondence: ["header", "hash"],
277
- issuePrefixes: config?.issuePrefixes || ["#"]
278
- };
279
- }
280
-
281
- // node_modules/conventional-changelog-conventionalcommits/src/writer.js
282
- var import_compare_func = __toESM(require_compare_func(), 1);
283
-
284
169
  // node_modules/conventional-changelog-conventionalcommits/src/utils.js
285
170
  function hasIntersection(a, b) {
286
171
  if (!a || !b) {
@@ -307,113 +192,180 @@ function matchScope(config = {}, commit) {
307
192
  );
308
193
  return !targetScope || scopeOnly && includesScope || !scopeOnly && (!commit.scope || includesScope);
309
194
  }
195
+ function findTypeEntry(types, commit) {
196
+ const typeKey = (commit.revert ? "revert" : commit.type || "").toLowerCase();
197
+ return types.find((entry) => {
198
+ if (entry.type !== typeKey) {
199
+ return false;
200
+ }
201
+ if (entry.scope && entry.scope !== commit.scope) {
202
+ return false;
203
+ }
204
+ return true;
205
+ });
206
+ }
207
+ function isTypeEffect(type, effect) {
208
+ return (type.effect || "bump") === effect;
209
+ }
310
210
 
311
211
  // node_modules/conventional-changelog-conventionalcommits/src/templates.js
312
- var mainTemplate = `{{> header}}
313
- {{#if noteGroups}}
314
- {{#each noteGroups}}
315
-
316
- ### \u26A0 {{title}}
317
-
318
- {{#each notes}}
319
- * {{#if commit.scope}}**{{commit.scope}}:** {{/if}}{{text}}
320
- {{/each}}
321
- {{/each}}
322
- {{/if}}
323
- {{#each commitGroups}}
324
-
325
- {{#if title}}
326
- ### {{title}}
327
-
328
- {{/if}}
329
- {{#each commits}}
330
- {{> commit root=@root}}
331
- {{/each}}
332
- {{/each}}
333
- {{> footer}}
334
- `;
335
- var headerPartial = `## {{#if @root.linkCompare~}}
336
- [{{version}}]({{compareUrlFormat}})
337
- {{~else}}
338
- {{~version}}
339
- {{~/if}}
340
- {{~#if title}} "{{title}}"
341
- {{~/if}}
342
- {{~#if date}} ({{date}})
343
- {{/if}}
344
- `;
345
- var commitPartial = `*{{#if scope}} **{{scope}}:**
346
- {{~/if}} {{#if subject}}
347
- {{~subject}}
348
- {{~else}}
349
- {{~header}}
350
- {{~/if}}
351
-
352
- {{~!-- commit link --}}{{~#if hash}} {{#if @root.linkReferences~}}
353
- ([{{shortHash}}]({{commitUrlFormat}}))
354
- {{~else}}
355
- {{~shortHash}}
356
- {{~/if}}{{~/if}}
357
-
358
- {{~!-- commit references --}}
359
- {{~#if references~}}
360
- , closes
361
- {{~#each references}} {{#if @root.linkReferences~}}
362
- [
363
- {{~#if this.owner}}
364
- {{~this.owner}}/
365
- {{~/if}}
366
- {{~this.repository}}{{this.prefix}}{{this.issue}}]({{issueUrlFormat}})
367
- {{~else}}
368
- {{~#if this.owner}}
369
- {{~this.owner}}/
370
- {{~/if}}
371
- {{~this.repository}}{{this.prefix}}{{this.issue}}
372
- {{~/if}}{{/each}}
373
- {{~/if}}
212
+ function headerPartial(context) {
213
+ const {
214
+ linkCompare,
215
+ version,
216
+ title,
217
+ date
218
+ } = context;
219
+ const versionText = linkCompare ? link(version, this.formatCompareUrl(context)) : version;
220
+ return heading(
221
+ 2,
222
+ words(
223
+ versionText,
224
+ title && `"${title}"`,
225
+ date && `(${date})`
226
+ )
227
+ );
228
+ }
229
+ function preamblePartial(context) {
230
+ return strings(context.preamble);
231
+ }
232
+ function renderReferences(context, references, filter) {
233
+ return each(
234
+ references?.filter(filter),
235
+ (commitReference) => {
236
+ if (context.linkReferences) {
237
+ return link(
238
+ reference(commitReference),
239
+ this.formatIssueUrl(context, commitReference)
240
+ );
241
+ }
242
+ return reference(commitReference);
243
+ },
244
+ " "
245
+ );
246
+ }
247
+ function commitPartial(context, commit) {
248
+ const { linkReferences } = context;
249
+ const {
250
+ scope,
251
+ subject,
252
+ header,
253
+ shortHash,
254
+ hash,
255
+ references
256
+ } = commit;
257
+ const commitLink = hash ? linkReferences ? `(${link(shortHash, this.formatCommitUrl(context, commit))})` : shortHash : "";
258
+ const closingReferences = renderReferences.call(
259
+ this,
260
+ context,
261
+ references,
262
+ (commitReference) => commitReference.action
263
+ );
264
+ const otherReferences = renderReferences.call(
265
+ this,
266
+ context,
267
+ references,
268
+ (commitReference) => !commitReference.action
269
+ );
270
+ return strings(
271
+ words(
272
+ scope && bold(`${scope}:`),
273
+ subject || header || "",
274
+ commitLink
275
+ ),
276
+ closingReferences && `, closes ${closingReferences}`,
277
+ otherReferences && `, references ${otherReferences}`
278
+ );
279
+ }
280
+ function footerPartial() {
281
+ return "";
282
+ }
283
+ function template(context) {
284
+ const {
285
+ headerPartial: headerPartial2,
286
+ preamblePartial: preamblePartial2,
287
+ commitPartial: commitPartial2,
288
+ footerPartial: footerPartial2,
289
+ noteGroups,
290
+ commitGroups
291
+ } = context;
292
+ return segments(
293
+ headerPartial2(context),
294
+ preamblePartial2(context),
295
+ each(
296
+ noteGroups,
297
+ (group) => segments(
298
+ heading(3, words("\u26A0", group.title)),
299
+ list(
300
+ group.notes,
301
+ (note) => words(
302
+ note.commit.scope && bold(`${note.commit.scope}:`),
303
+ note.text
304
+ )
305
+ )
306
+ ),
307
+ newline(2)
308
+ ),
309
+ each(
310
+ commitGroups,
311
+ (group) => segments(
312
+ group.title && heading(3, group.title),
313
+ list(
314
+ group.commits,
315
+ (commit) => commitPartial2(context, commit)
316
+ )
317
+ ),
318
+ newline(2)
319
+ ),
320
+ footerPartial2(context)
321
+ );
322
+ }
374
323
 
375
- `;
376
- var footerPartial = ``;
324
+ // node_modules/conventional-changelog-conventionalcommits/src/format.js
325
+ var format_exports = {};
326
+ __export(format_exports, {
327
+ formatCommitUrl: () => formatCommitUrl,
328
+ formatCompareUrl: () => formatCompareUrl,
329
+ formatIssueUrl: () => formatIssueUrl,
330
+ formatUserUrl: () => formatUserUrl
331
+ });
332
+ function formatIssueUrl(context, reference2) {
333
+ return url(
334
+ referenceRepositoryUrl(context, reference2),
335
+ "issues",
336
+ reference2.issue
337
+ );
338
+ }
339
+ function formatCommitUrl(context, commit) {
340
+ return url(repositoryUrl(context), context.commit || "commit", commit.hash);
341
+ }
342
+ function formatCompareUrl(context) {
343
+ return compareUrl(context);
344
+ }
345
+ function formatUserUrl(context, user) {
346
+ return url(context.host, user);
347
+ }
377
348
 
378
349
  // node_modules/conventional-changelog-conventionalcommits/src/writer.js
379
350
  var COMMIT_HASH_LENGTH = 7;
380
351
  var releaseAsRegex = /release-as:\s*\w*@?([0-9]+\.[0-9]+\.[0-9a-z]+(-[0-9a-z.]+)?)\s*/i;
381
- var owner = "{{#if this.owner}}{{~this.owner}}{{else}}{{~@root.owner}}{{/if}}";
382
- var host = "{{~@root.host}}";
383
- var repository = "{{#if this.repository}}{{~this.repository}}{{else}}{{~@root.repository}}{{/if}}";
352
+ function compareNotes(a, b) {
353
+ return (a.title || "").localeCompare(b.title || "") || (a.text || "").localeCompare(b.text || "");
354
+ }
384
355
  function createWriterOpts(config) {
385
356
  const finalConfig = {
386
357
  types: DEFAULT_COMMIT_TYPES,
387
- issueUrlFormat: "{{host}}/{{owner}}/{{repository}}/issues/{{id}}",
388
- commitUrlFormat: "{{host}}/{{owner}}/{{repository}}/commit/{{hash}}",
389
- compareUrlFormat: "{{host}}/{{owner}}/{{repository}}/compare/{{previousTag}}...{{currentTag}}",
390
- userUrlFormat: "{{host}}/{{user}}",
391
358
  issuePrefixes: ["#"],
359
+ ...format_exports,
392
360
  ...config
393
361
  };
394
- const commitUrlFormat = expandTemplate(finalConfig.commitUrlFormat, {
395
- host,
396
- owner,
397
- repository
398
- });
399
- const compareUrlFormat = expandTemplate(finalConfig.compareUrlFormat, {
400
- host,
401
- owner,
402
- repository
403
- });
404
- const issueUrlFormat = expandTemplate(finalConfig.issueUrlFormat, {
405
- host,
406
- owner,
407
- repository,
408
- id: "{{this.issue}}",
409
- prefix: "{{this.prefix}}"
410
- });
411
- const commitGroupOrder = finalConfig.types.flatMap((t) => t.section).filter((t) => t);
362
+ const commitGroupOrder = finalConfig.types.map((t) => t.section).filter(Boolean);
412
363
  return {
413
- mainTemplate,
414
- headerPartial: headerPartial.replace(/{{compareUrlFormat}}/g, compareUrlFormat),
415
- commitPartial: commitPartial.replace(/{{commitUrlFormat}}/g, commitUrlFormat).replace(/{{issueUrlFormat}}/g, issueUrlFormat),
416
- footerPartial,
364
+ template,
365
+ headerPartial: headerPartial.bind(finalConfig),
366
+ preamblePartial: preamblePartial.bind(finalConfig),
367
+ commitPartial: commitPartial.bind(finalConfig),
368
+ footerPartial: footerPartial.bind(finalConfig),
417
369
  transform: (commit, context) => {
418
370
  let discard = true;
419
371
  const issues = [];
@@ -430,7 +382,7 @@ function createWriterOpts(config) {
430
382
  });
431
383
  if (
432
384
  // breaking changes attached to any type are still displayed.
433
- discard && (entry === void 0 || entry.hidden) || !matchScope(finalConfig, commit)
385
+ discard && (entry === void 0 || isTypeEffect(entry, "hidden")) || !matchScope(finalConfig, commit)
434
386
  ) {
435
387
  return void 0;
436
388
  }
@@ -443,14 +395,11 @@ function createWriterOpts(config) {
443
395
  const re = new RegExp(issueRegEx, "g");
444
396
  subject = subject.replace(re, (_, prefix, issue) => {
445
397
  issues.push(prefix + issue);
446
- const url = expandTemplate(finalConfig.issueUrlFormat, {
447
- host: context.host,
448
- owner: context.owner,
449
- repository: context.repository,
450
- id: issue,
398
+ const issueUrl = finalConfig.formatIssueUrl(context, {
399
+ issue,
451
400
  prefix
452
401
  });
453
- return `[${prefix}${issue}](${url})`;
402
+ return link(`${prefix}${issue}`, issueUrl);
454
403
  });
455
404
  subject = subject.replace(/`[^`]*`|\B@([a-z0-9](?:-?[a-z0-9/]){0,38})/g, (match, user) => {
456
405
  if (!user) {
@@ -459,16 +408,11 @@ function createWriterOpts(config) {
459
408
  if (user.includes("/")) {
460
409
  return `@${user}`;
461
410
  }
462
- const usernameUrl = expandTemplate(finalConfig.userUrlFormat, {
463
- host: context.host,
464
- owner: context.owner,
465
- repository: context.repository,
466
- user
467
- });
468
- return `[@${user}](${usernameUrl})`;
411
+ const usernameUrl = finalConfig.formatUserUrl(context, user);
412
+ return link(`@${user}`, usernameUrl);
469
413
  });
470
414
  }
471
- const references = commit.references.filter((reference) => !issues.includes(reference.prefix + reference.issue));
415
+ const references = commit.references.filter((reference2) => !issues.includes(reference2.prefix + reference2.issue));
472
416
  return {
473
417
  notes,
474
418
  type,
@@ -488,66 +432,42 @@ function createWriterOpts(config) {
488
432
  },
489
433
  commitsSort: ["scope", "subject"],
490
434
  noteGroupsSort: "title",
491
- notesSort: import_compare_func.default
435
+ notesSort: compareNotes
492
436
  };
493
437
  }
494
- function findTypeEntry(types, commit) {
495
- const typeKey = (commit.revert ? "revert" : commit.type || "").toLowerCase();
496
- return types.find((entry) => {
497
- if (entry.type !== typeKey) {
498
- return false;
499
- }
500
- if (entry.scope && entry.scope !== commit.scope) {
501
- return false;
502
- }
503
- return true;
504
- });
505
- }
506
- function expandTemplate(template, context) {
507
- let expanded = template;
508
- Object.keys(context).forEach((key) => {
509
- expanded = expanded.replace(new RegExp(`{{${key}}}`, "g"), context[key]);
510
- });
511
- return expanded;
512
- }
513
438
 
514
439
  // node_modules/conventional-changelog-conventionalcommits/src/whatBump.js
515
440
  function createWhatBump(config = {}) {
516
- const {
517
- types = DEFAULT_COMMIT_TYPES,
518
- bumpStrict = false
519
- } = config;
520
- const hiddenTypes = bumpStrict && types.reduce((hiddenTypes2, type) => {
521
- if (type.hidden) {
522
- hiddenTypes2.push(type.type);
523
- }
524
- return hiddenTypes2;
525
- }, []);
441
+ const { types = DEFAULT_COMMIT_TYPES } = config;
526
442
  return function whatBump(commits) {
527
- let level = 2;
443
+ let level = null;
528
444
  let breakings = 0;
529
445
  let features = 0;
530
- let bugfixes = 0;
531
446
  commits.forEach((commit) => {
532
447
  if (!matchScope(config, commit)) {
533
448
  return;
534
449
  }
450
+ const entry = findTypeEntry(types, commit);
535
451
  if (commit.notes.length > 0) {
536
452
  breakings += commit.notes.length;
537
453
  level = 0;
538
- } else if (commit.type === "feat" || commit.type === "feature") {
539
- features += 1;
540
- if (level === 2) {
541
- level = 1;
454
+ } else if (entry && isTypeEffect(entry, "bump")) {
455
+ if (level === null) {
456
+ level = 2;
457
+ }
458
+ if (commit.type === "feat" || commit.type === "feature") {
459
+ features += 1;
460
+ if (level > 1) {
461
+ level = 1;
462
+ }
542
463
  }
543
- } else if (bumpStrict && !hiddenTypes.includes(commit.type)) {
544
- bugfixes += 1;
545
464
  }
546
465
  });
466
+ if (level === null) {
467
+ return null;
468
+ }
547
469
  if (config?.preMajor && level < 2) {
548
470
  level++;
549
- } else if (bumpStrict && level === 2 && !breakings && !features && !bugfixes) {
550
- return null;
551
471
  }
552
472
  return {
553
473
  level,