@html-validate/commitlint-config 4.0.3 → 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.
@@ -10895,7 +10895,7 @@ var require_int = __commonJS({
10895
10895
  if (ch !== "0" && ch !== "1") return false;
10896
10896
  hasDigits = true;
10897
10897
  }
10898
- return hasDigits && Number.isFinite(parseYamlInteger(data));
10898
+ return hasDigits && isFinite(parseYamlInteger(data));
10899
10899
  }
10900
10900
  if (ch === "x") {
10901
10901
  index++;
@@ -10903,7 +10903,7 @@ var require_int = __commonJS({
10903
10903
  if (!isHexCode(data.charCodeAt(index))) return false;
10904
10904
  hasDigits = true;
10905
10905
  }
10906
- return hasDigits && Number.isFinite(parseYamlInteger(data));
10906
+ return hasDigits && isFinite(parseYamlInteger(data));
10907
10907
  }
10908
10908
  if (ch === "o") {
10909
10909
  index++;
@@ -10911,7 +10911,7 @@ var require_int = __commonJS({
10911
10911
  if (!isOctCode(data.charCodeAt(index))) return false;
10912
10912
  hasDigits = true;
10913
10913
  }
10914
- return hasDigits && Number.isFinite(parseYamlInteger(data));
10914
+ return hasDigits && isFinite(parseYamlInteger(data));
10915
10915
  }
10916
10916
  }
10917
10917
  for (; index < max; index++) {
@@ -10921,7 +10921,7 @@ var require_int = __commonJS({
10921
10921
  hasDigits = true;
10922
10922
  }
10923
10923
  if (!hasDigits) return false;
10924
- return Number.isFinite(parseYamlInteger(data));
10924
+ return isFinite(parseYamlInteger(data));
10925
10925
  }
10926
10926
  function parseYamlInteger(data) {
10927
10927
  let value = data;
@@ -10994,7 +10994,7 @@ var require_float = __commonJS({
10994
10994
  if (!YAML_FLOAT_PATTERN.test(data)) {
10995
10995
  return false;
10996
10996
  }
10997
- if (Number.isFinite(parseFloat(data, 10))) {
10997
+ if (isFinite(parseFloat(data, 10))) {
10998
10998
  return true;
10999
10999
  }
11000
11000
  return YAML_FLOAT_SPECIAL_PATTERN.test(data);
@@ -11518,7 +11518,7 @@ var require_loader = __commonJS({
11518
11518
  this.json = options["json"] || false;
11519
11519
  this.listener = options["listener"] || null;
11520
11520
  this.maxDepth = typeof options["maxDepth"] === "number" ? options["maxDepth"] : 100;
11521
- this.maxMergeSeqLength = typeof options["maxMergeSeqLength"] === "number" ? options["maxMergeSeqLength"] : 20;
11521
+ this.maxTotalMergeKeys = typeof options["maxTotalMergeKeys"] === "number" ? options["maxTotalMergeKeys"] : 1e4;
11522
11522
  this.implicitTypes = this.schema.compiledImplicit;
11523
11523
  this.typeMap = this.schema.compiledTypeMap;
11524
11524
  this.length = input.length;
@@ -11527,6 +11527,7 @@ var require_loader = __commonJS({
11527
11527
  this.lineStart = 0;
11528
11528
  this.lineIndent = 0;
11529
11529
  this.depth = 0;
11530
+ this.totalMergeKeys = 0;
11530
11531
  this.firstTabInLine = -1;
11531
11532
  this.documents = [];
11532
11533
  this.anchorMapTransactions = [];
@@ -11686,6 +11687,9 @@ var require_loader = __commonJS({
11686
11687
  const sourceKeys = Object.keys(source);
11687
11688
  for (let index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
11688
11689
  const key = sourceKeys[index];
11690
+ if (state.maxTotalMergeKeys !== -1 && ++state.totalMergeKeys > state.maxTotalMergeKeys) {
11691
+ throwError(state, "merge keys exceeded maxTotalMergeKeys (" + state.maxTotalMergeKeys + ")");
11692
+ }
11689
11693
  if (!_hasOwnProperty.call(destination, key)) {
11690
11694
  setProperty(destination, key, source[key]);
11691
11695
  overridableKeys[key] = true;
@@ -11713,15 +11717,8 @@ var require_loader = __commonJS({
11713
11717
  }
11714
11718
  if (keyTag === "tag:yaml.org,2002:merge") {
11715
11719
  if (Array.isArray(valueNode)) {
11716
- if (valueNode.length > state.maxMergeSeqLength) {
11717
- throwError(state, "merge sequence length exceeded maxMergeSeqLength (" + state.maxMergeSeqLength + ")");
11718
- }
11719
- const seen = /* @__PURE__ */ new Set();
11720
11720
  for (let index = 0, quantity = valueNode.length; index < quantity; index += 1) {
11721
- const src = valueNode[index];
11722
- if (seen.has(src)) continue;
11723
- seen.add(src);
11724
- mergeMappings(state, _result, src, overridableKeys);
11721
+ mergeMappings(state, _result, valueNode[index], overridableKeys);
11725
11722
  }
11726
11723
  } else {
11727
11724
  mergeMappings(state, _result, valueNode, overridableKeys);
@@ -6,285 +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
- try {
17
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
18
- } catch (e) {
19
- throw mod = 0, e;
20
- }
21
- };
22
- var __copyProps = (to, from, except, desc) => {
23
- if (from && typeof from === "object" || typeof from === "function") {
24
- for (let key of __getOwnPropNames(from))
25
- if (!__hasOwnProp.call(to, key) && key !== except)
26
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
27
- }
28
- return to;
10
+ var __export = (target, all) => {
11
+ for (var name in all)
12
+ __defProp(target, name, { get: all[name], enumerable: true });
29
13
  };
30
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
31
- // If the importer is in node compatibility mode or this is not an ESM
32
- // file that has been converted to a CommonJS file using a Babel-
33
- // compatible transform (i.e. "__esModule" has not been set), then set
34
- // "default" to the CommonJS "module.exports" for node compatibility.
35
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
36
- mod
37
- ));
38
14
 
39
- // node_modules/array-ify/index.js
40
- var require_array_ify = __commonJS({
41
- "node_modules/array-ify/index.js"(exports, module) {
42
- "use strict";
43
- module.exports = function(val) {
44
- return Array.isArray(val) ? val : [val];
45
- };
46
- }
47
- });
48
-
49
- // node_modules/is-obj/index.js
50
- var require_is_obj = __commonJS({
51
- "node_modules/is-obj/index.js"(exports, module) {
52
- "use strict";
53
- module.exports = (value) => {
54
- const type = typeof value;
55
- return value !== null && (type === "object" || type === "function");
56
- };
57
- }
58
- });
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
+ }
59
31
 
60
- // node_modules/dot-prop/index.js
61
- var require_dot_prop = __commonJS({
62
- "node_modules/dot-prop/index.js"(exports, module) {
63
- "use strict";
64
- var isObj = require_is_obj();
65
- var disallowedKeys = [
66
- "__proto__",
67
- "prototype",
68
- "constructor"
69
- ];
70
- var isValidPath = (pathSegments) => !pathSegments.some((segment) => disallowedKeys.includes(segment));
71
- function getPathSegments(path) {
72
- const pathArray = path.split(".");
73
- const parts = [];
74
- for (let i = 0; i < pathArray.length; i++) {
75
- let p = pathArray[i];
76
- while (p[p.length - 1] === "\\" && pathArray[i + 1] !== void 0) {
77
- p = p.slice(0, -1) + ".";
78
- p += pathArray[++i];
79
- }
80
- parts.push(p);
81
- }
82
- if (!isValidPath(parts)) {
83
- return [];
84
- }
85
- 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;
86
74
  }
87
- module.exports = {
88
- get(object, path, value) {
89
- if (!isObj(object) || typeof path !== "string") {
90
- return value === void 0 ? object : value;
91
- }
92
- const pathArray = getPathSegments(path);
93
- if (pathArray.length === 0) {
94
- return;
95
- }
96
- for (let i = 0; i < pathArray.length; i++) {
97
- if (!Object.prototype.propertyIsEnumerable.call(object, pathArray[i])) {
98
- return value;
99
- }
100
- object = object[pathArray[i]];
101
- if (object === void 0 || object === null) {
102
- if (i !== pathArray.length - 1) {
103
- return value;
104
- }
105
- break;
106
- }
107
- }
108
- return object;
109
- },
110
- set(object, path, value) {
111
- if (!isObj(object) || typeof path !== "string") {
112
- return object;
113
- }
114
- const root = object;
115
- const pathArray = getPathSegments(path);
116
- for (let i = 0; i < pathArray.length; i++) {
117
- const p = pathArray[i];
118
- if (!isObj(object[p])) {
119
- object[p] = {};
120
- }
121
- if (i === pathArray.length - 1) {
122
- object[p] = value;
123
- }
124
- object = object[p];
125
- }
126
- return root;
127
- },
128
- delete(object, path) {
129
- if (!isObj(object) || typeof path !== "string") {
130
- return false;
131
- }
132
- const pathArray = getPathSegments(path);
133
- for (let i = 0; i < pathArray.length; i++) {
134
- const p = pathArray[i];
135
- if (i === pathArray.length - 1) {
136
- delete object[p];
137
- return true;
138
- }
139
- object = object[p];
140
- if (!isObj(object)) {
141
- return false;
142
- }
143
- }
144
- },
145
- has(object, path) {
146
- if (!isObj(object) || typeof path !== "string") {
147
- return false;
148
- }
149
- const pathArray = getPathSegments(path);
150
- if (pathArray.length === 0) {
151
- return false;
152
- }
153
- for (let i = 0; i < pathArray.length; i++) {
154
- if (isObj(object)) {
155
- if (!(pathArray[i] in object)) {
156
- return false;
157
- }
158
- object = object[pathArray[i]];
159
- } else {
160
- return false;
161
- }
162
- }
163
- return true;
164
- }
165
- };
166
- }
167
- });
75
+ const segment = String(part).replace(/^\/+|\/+$/g, "");
76
+ return acc ? `${acc}/${segment}` : segment;
77
+ }, "");
78
+ }
168
79
 
169
- // node_modules/compare-func/index.js
170
- var require_compare_func = __commonJS({
171
- "node_modules/compare-func/index.js"(exports, module) {
172
- "use strict";
173
- var arrayify = require_array_ify();
174
- var dotPropGet = require_dot_prop().get;
175
- function compareFunc2(prop) {
176
- return function(a, b) {
177
- var ret = 0;
178
- arrayify(prop).some(function(el) {
179
- var x;
180
- var y;
181
- if (typeof el === "function") {
182
- x = el(a);
183
- y = el(b);
184
- } else if (typeof el === "string") {
185
- x = dotPropGet(a, el);
186
- y = dotPropGet(b, el);
187
- } else {
188
- x = a;
189
- y = b;
190
- }
191
- if (x === y) {
192
- ret = 0;
193
- return;
194
- }
195
- if (typeof x === "string" && typeof y === "string") {
196
- ret = x.localeCompare(y);
197
- return ret !== 0;
198
- }
199
- ret = x < y ? -1 : 1;
200
- return true;
201
- });
202
- return ret;
203
- };
204
- }
205
- 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);
206
84
  }
207
- });
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
+ }
208
104
 
209
105
  // node_modules/conventional-changelog-conventionalcommits/src/constants.js
210
106
  var DEFAULT_COMMIT_TYPES = Object.freeze([
211
107
  {
212
108
  type: "feat",
213
- section: "Features"
109
+ section: "Features",
110
+ effect: "bump"
214
111
  },
215
112
  {
216
113
  type: "feature",
217
- section: "Features"
114
+ section: "Features",
115
+ effect: "bump"
218
116
  },
219
117
  {
220
118
  type: "fix",
221
- section: "Bug Fixes"
119
+ section: "Bug Fixes",
120
+ effect: "bump"
222
121
  },
223
122
  {
224
123
  type: "perf",
225
- section: "Performance Improvements"
124
+ section: "Performance Improvements",
125
+ effect: "bump"
226
126
  },
227
127
  {
228
128
  type: "revert",
229
- section: "Reverts"
129
+ section: "Reverts",
130
+ effect: "bump"
230
131
  },
231
132
  {
232
133
  type: "docs",
233
134
  section: "Documentation",
234
- hidden: true
135
+ effect: "hidden"
235
136
  },
236
137
  {
237
138
  type: "style",
238
139
  section: "Styles",
239
- hidden: true
140
+ effect: "hidden"
240
141
  },
241
142
  {
242
143
  type: "chore",
243
144
  section: "Miscellaneous Chores",
244
- hidden: true
145
+ effect: "hidden"
245
146
  },
246
147
  {
247
148
  type: "refactor",
248
149
  section: "Code Refactoring",
249
- hidden: true
150
+ effect: "hidden"
250
151
  },
251
152
  {
252
153
  type: "test",
253
154
  section: "Tests",
254
- hidden: true
155
+ effect: "hidden"
255
156
  },
256
157
  {
257
158
  type: "build",
258
159
  section: "Build System",
259
- hidden: true
160
+ effect: "hidden"
260
161
  },
261
162
  {
262
163
  type: "ci",
263
164
  section: "Continuous Integration",
264
- hidden: true
165
+ effect: "hidden"
265
166
  }
266
167
  ].map(Object.freeze));
267
168
 
268
- // node_modules/conventional-changelog-conventionalcommits/src/parser.js
269
- function createParserOpts(config) {
270
- return {
271
- headerPattern: /^(\w*)(?:\((.*)\))?!?: (.*)$/,
272
- breakingHeaderPattern: /^(\w*)(?:\((.*)\))?!: (.*)$/,
273
- headerCorrespondence: [
274
- "type",
275
- "scope",
276
- "subject"
277
- ],
278
- noteKeywords: ["BREAKING CHANGE", "BREAKING-CHANGE"],
279
- revertPattern: /^(?:Revert|revert:)\s"?([\s\S]+?)"?\s*This reverts commit (\w*)\./i,
280
- revertCorrespondence: ["header", "hash"],
281
- issuePrefixes: config?.issuePrefixes || ["#"]
282
- };
283
- }
284
-
285
- // node_modules/conventional-changelog-conventionalcommits/src/writer.js
286
- var import_compare_func = __toESM(require_compare_func(), 1);
287
-
288
169
  // node_modules/conventional-changelog-conventionalcommits/src/utils.js
289
170
  function hasIntersection(a, b) {
290
171
  if (!a || !b) {
@@ -311,113 +192,180 @@ function matchScope(config = {}, commit) {
311
192
  );
312
193
  return !targetScope || scopeOnly && includesScope || !scopeOnly && (!commit.scope || includesScope);
313
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
+ }
314
210
 
315
211
  // node_modules/conventional-changelog-conventionalcommits/src/templates.js
316
- var mainTemplate = `{{> header}}
317
- {{#if noteGroups}}
318
- {{#each noteGroups}}
319
-
320
- ### \u26A0 {{title}}
321
-
322
- {{#each notes}}
323
- * {{#if commit.scope}}**{{commit.scope}}:** {{/if}}{{text}}
324
- {{/each}}
325
- {{/each}}
326
- {{/if}}
327
- {{#each commitGroups}}
328
-
329
- {{#if title}}
330
- ### {{title}}
331
-
332
- {{/if}}
333
- {{#each commits}}
334
- {{> commit root=@root}}
335
- {{/each}}
336
- {{/each}}
337
- {{> footer}}
338
- `;
339
- var headerPartial = `## {{#if @root.linkCompare~}}
340
- [{{version}}]({{compareUrlFormat}})
341
- {{~else}}
342
- {{~version}}
343
- {{~/if}}
344
- {{~#if title}} "{{title}}"
345
- {{~/if}}
346
- {{~#if date}} ({{date}})
347
- {{/if}}
348
- `;
349
- var commitPartial = `*{{#if scope}} **{{scope}}:**
350
- {{~/if}} {{#if subject}}
351
- {{~subject}}
352
- {{~else}}
353
- {{~header}}
354
- {{~/if}}
355
-
356
- {{~!-- commit link --}}{{~#if hash}} {{#if @root.linkReferences~}}
357
- ([{{shortHash}}]({{commitUrlFormat}}))
358
- {{~else}}
359
- {{~shortHash}}
360
- {{~/if}}{{~/if}}
361
-
362
- {{~!-- commit references --}}
363
- {{~#if references~}}
364
- , closes
365
- {{~#each references}} {{#if @root.linkReferences~}}
366
- [
367
- {{~#if this.owner}}
368
- {{~this.owner}}/
369
- {{~/if}}
370
- {{~this.repository}}{{this.prefix}}{{this.issue}}]({{issueUrlFormat}})
371
- {{~else}}
372
- {{~#if this.owner}}
373
- {{~this.owner}}/
374
- {{~/if}}
375
- {{~this.repository}}{{this.prefix}}{{this.issue}}
376
- {{~/if}}{{/each}}
377
- {{~/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
+ }
378
323
 
379
- `;
380
- 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
+ }
381
348
 
382
349
  // node_modules/conventional-changelog-conventionalcommits/src/writer.js
383
350
  var COMMIT_HASH_LENGTH = 7;
384
351
  var releaseAsRegex = /release-as:\s*\w*@?([0-9]+\.[0-9]+\.[0-9a-z]+(-[0-9a-z.]+)?)\s*/i;
385
- var owner = "{{#if this.owner}}{{~this.owner}}{{else}}{{~@root.owner}}{{/if}}";
386
- var host = "{{~@root.host}}";
387
- 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
+ }
388
355
  function createWriterOpts(config) {
389
356
  const finalConfig = {
390
357
  types: DEFAULT_COMMIT_TYPES,
391
- issueUrlFormat: "{{host}}/{{owner}}/{{repository}}/issues/{{id}}",
392
- commitUrlFormat: "{{host}}/{{owner}}/{{repository}}/commit/{{hash}}",
393
- compareUrlFormat: "{{host}}/{{owner}}/{{repository}}/compare/{{previousTag}}...{{currentTag}}",
394
- userUrlFormat: "{{host}}/{{user}}",
395
358
  issuePrefixes: ["#"],
359
+ ...format_exports,
396
360
  ...config
397
361
  };
398
- const commitUrlFormat = expandTemplate(finalConfig.commitUrlFormat, {
399
- host,
400
- owner,
401
- repository
402
- });
403
- const compareUrlFormat = expandTemplate(finalConfig.compareUrlFormat, {
404
- host,
405
- owner,
406
- repository
407
- });
408
- const issueUrlFormat = expandTemplate(finalConfig.issueUrlFormat, {
409
- host,
410
- owner,
411
- repository,
412
- id: "{{this.issue}}",
413
- prefix: "{{this.prefix}}"
414
- });
415
- const commitGroupOrder = finalConfig.types.flatMap((t) => t.section).filter((t) => t);
362
+ const commitGroupOrder = finalConfig.types.map((t) => t.section).filter(Boolean);
416
363
  return {
417
- mainTemplate,
418
- headerPartial: headerPartial.replace(/{{compareUrlFormat}}/g, compareUrlFormat),
419
- commitPartial: commitPartial.replace(/{{commitUrlFormat}}/g, commitUrlFormat).replace(/{{issueUrlFormat}}/g, issueUrlFormat),
420
- footerPartial,
364
+ template,
365
+ headerPartial: headerPartial.bind(finalConfig),
366
+ preamblePartial: preamblePartial.bind(finalConfig),
367
+ commitPartial: commitPartial.bind(finalConfig),
368
+ footerPartial: footerPartial.bind(finalConfig),
421
369
  transform: (commit, context) => {
422
370
  let discard = true;
423
371
  const issues = [];
@@ -434,7 +382,7 @@ function createWriterOpts(config) {
434
382
  });
435
383
  if (
436
384
  // breaking changes attached to any type are still displayed.
437
- discard && (entry === void 0 || entry.hidden) || !matchScope(finalConfig, commit)
385
+ discard && (entry === void 0 || isTypeEffect(entry, "hidden")) || !matchScope(finalConfig, commit)
438
386
  ) {
439
387
  return void 0;
440
388
  }
@@ -447,14 +395,11 @@ function createWriterOpts(config) {
447
395
  const re = new RegExp(issueRegEx, "g");
448
396
  subject = subject.replace(re, (_, prefix, issue) => {
449
397
  issues.push(prefix + issue);
450
- const url = expandTemplate(finalConfig.issueUrlFormat, {
451
- host: context.host,
452
- owner: context.owner,
453
- repository: context.repository,
454
- id: issue,
398
+ const issueUrl = finalConfig.formatIssueUrl(context, {
399
+ issue,
455
400
  prefix
456
401
  });
457
- return `[${prefix}${issue}](${url})`;
402
+ return link(`${prefix}${issue}`, issueUrl);
458
403
  });
459
404
  subject = subject.replace(/`[^`]*`|\B@([a-z0-9](?:-?[a-z0-9/]){0,38})/g, (match, user) => {
460
405
  if (!user) {
@@ -463,16 +408,11 @@ function createWriterOpts(config) {
463
408
  if (user.includes("/")) {
464
409
  return `@${user}`;
465
410
  }
466
- const usernameUrl = expandTemplate(finalConfig.userUrlFormat, {
467
- host: context.host,
468
- owner: context.owner,
469
- repository: context.repository,
470
- user
471
- });
472
- return `[@${user}](${usernameUrl})`;
411
+ const usernameUrl = finalConfig.formatUserUrl(context, user);
412
+ return link(`@${user}`, usernameUrl);
473
413
  });
474
414
  }
475
- 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));
476
416
  return {
477
417
  notes,
478
418
  type,
@@ -492,66 +432,42 @@ function createWriterOpts(config) {
492
432
  },
493
433
  commitsSort: ["scope", "subject"],
494
434
  noteGroupsSort: "title",
495
- notesSort: import_compare_func.default
435
+ notesSort: compareNotes
496
436
  };
497
437
  }
498
- function findTypeEntry(types, commit) {
499
- const typeKey = (commit.revert ? "revert" : commit.type || "").toLowerCase();
500
- return types.find((entry) => {
501
- if (entry.type !== typeKey) {
502
- return false;
503
- }
504
- if (entry.scope && entry.scope !== commit.scope) {
505
- return false;
506
- }
507
- return true;
508
- });
509
- }
510
- function expandTemplate(template, context) {
511
- let expanded = template;
512
- Object.keys(context).forEach((key) => {
513
- expanded = expanded.replace(new RegExp(`{{${key}}}`, "g"), context[key]);
514
- });
515
- return expanded;
516
- }
517
438
 
518
439
  // node_modules/conventional-changelog-conventionalcommits/src/whatBump.js
519
440
  function createWhatBump(config = {}) {
520
- const {
521
- types = DEFAULT_COMMIT_TYPES,
522
- bumpStrict = false
523
- } = config;
524
- const hiddenTypes = bumpStrict && types.reduce((hiddenTypes2, type) => {
525
- if (type.hidden) {
526
- hiddenTypes2.push(type.type);
527
- }
528
- return hiddenTypes2;
529
- }, []);
441
+ const { types = DEFAULT_COMMIT_TYPES } = config;
530
442
  return function whatBump(commits) {
531
- let level = 2;
443
+ let level = null;
532
444
  let breakings = 0;
533
445
  let features = 0;
534
- let bugfixes = 0;
535
446
  commits.forEach((commit) => {
536
447
  if (!matchScope(config, commit)) {
537
448
  return;
538
449
  }
450
+ const entry = findTypeEntry(types, commit);
539
451
  if (commit.notes.length > 0) {
540
452
  breakings += commit.notes.length;
541
453
  level = 0;
542
- } else if (commit.type === "feat" || commit.type === "feature") {
543
- features += 1;
544
- if (level === 2) {
545
- 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
+ }
546
463
  }
547
- } else if (bumpStrict && !hiddenTypes.includes(commit.type)) {
548
- bugfixes += 1;
549
464
  }
550
465
  });
466
+ if (level === null) {
467
+ return null;
468
+ }
551
469
  if (config?.preMajor && level < 2) {
552
470
  level++;
553
- } else if (bumpStrict && level === 2 && !breakings && !features && !bugfixes) {
554
- return null;
555
471
  }
556
472
  return {
557
473
  level,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@html-validate/commitlint-config",
3
- "version": "4.0.3",
3
+ "version": "4.1.0",
4
4
  "description": "Commitlint sharable config used by the various HTML-validate packages",
5
5
  "keywords": [
6
6
  "commitlint"
@@ -48,10 +48,5 @@
48
48
  },
49
49
  "publishConfig": {
50
50
  "access": "public"
51
- },
52
- "allowScripts": {
53
- "esbuild": true,
54
- "fsevents": false,
55
- "unrs-resolver": true
56
51
  }
57
52
  }