@html-validate/commitlint-config 4.0.3 → 4.1.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.
- package/dist/commitlint.js +1089 -1196
- package/dist/parser-preset.js +288 -372
- package/package.json +1 -6
package/dist/parser-preset.js
CHANGED
|
@@ -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
|
|
12
|
-
var
|
|
13
|
-
|
|
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/
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
|
61
|
-
|
|
62
|
-
"
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
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
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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
|
-
|
|
135
|
+
effect: "hidden"
|
|
235
136
|
},
|
|
236
137
|
{
|
|
237
138
|
type: "style",
|
|
238
139
|
section: "Styles",
|
|
239
|
-
|
|
140
|
+
effect: "hidden"
|
|
240
141
|
},
|
|
241
142
|
{
|
|
242
143
|
type: "chore",
|
|
243
144
|
section: "Miscellaneous Chores",
|
|
244
|
-
|
|
145
|
+
effect: "hidden"
|
|
245
146
|
},
|
|
246
147
|
{
|
|
247
148
|
type: "refactor",
|
|
248
149
|
section: "Code Refactoring",
|
|
249
|
-
|
|
150
|
+
effect: "hidden"
|
|
250
151
|
},
|
|
251
152
|
{
|
|
252
153
|
type: "test",
|
|
253
154
|
section: "Tests",
|
|
254
|
-
|
|
155
|
+
effect: "hidden"
|
|
255
156
|
},
|
|
256
157
|
{
|
|
257
158
|
type: "build",
|
|
258
159
|
section: "Build System",
|
|
259
|
-
|
|
160
|
+
effect: "hidden"
|
|
260
161
|
},
|
|
261
162
|
{
|
|
262
163
|
type: "ci",
|
|
263
164
|
section: "Continuous Integration",
|
|
264
|
-
|
|
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
|
-
|
|
317
|
-
{
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
{
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
{
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
{
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
{
|
|
353
|
-
{
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
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
|
|
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
|
-
|
|
386
|
-
|
|
387
|
-
|
|
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
|
|
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
|
-
|
|
418
|
-
headerPartial: headerPartial.
|
|
419
|
-
|
|
420
|
-
|
|
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
|
|
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
|
|
451
|
-
|
|
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
|
|
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 =
|
|
467
|
-
|
|
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((
|
|
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:
|
|
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 =
|
|
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 (
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
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,
|