@html-validate/commitlint-config 3.0.30 → 3.2.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.
- package/bin/commitlint.js +3 -0
- package/bin/install.js +3 -0
- package/dist/commitlint.js +264488 -0
- package/dist/commitlint.schema.json +105 -0
- package/dist/config.js +181 -0
- package/dist/formatter.js +565 -0
- package/dist/install.js +476 -0
- package/dist/parser-preset.js +518 -0
- package/dist/templates/commit.hbs +30 -0
- package/dist/templates/footer.hbs +0 -0
- package/dist/templates/header.hbs +9 -0
- package/dist/templates/template.hbs +23 -0
- package/package.json +20 -42
- package/cli.js +0 -3
- package/index.js +0 -6
- package/install.js +0 -59
|
@@ -0,0 +1,518 @@
|
|
|
1
|
+
|
|
2
|
+
import { dirname as _$_dirname } from "node:path";
|
|
3
|
+
import { createRequire as _$_createRequire } from "node:module";
|
|
4
|
+
import { fileURLToPath as _$_fileURLToPath } from "node:url";
|
|
5
|
+
|
|
6
|
+
const require = _$_createRequire(import.meta.url);
|
|
7
|
+
const __dirname = _$_dirname(_$_fileURLToPath(import.meta.url));
|
|
8
|
+
|
|
9
|
+
var __create = Object.create;
|
|
10
|
+
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 __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
16
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
17
|
+
}) : x)(function(x) {
|
|
18
|
+
if (typeof require !== "undefined")
|
|
19
|
+
return require.apply(this, arguments);
|
|
20
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
21
|
+
});
|
|
22
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
23
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
24
|
+
};
|
|
25
|
+
var __copyProps = (to, from, except, desc) => {
|
|
26
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
27
|
+
for (let key of __getOwnPropNames(from))
|
|
28
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
29
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
30
|
+
}
|
|
31
|
+
return to;
|
|
32
|
+
};
|
|
33
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
34
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
35
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
36
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
37
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
38
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
39
|
+
mod
|
|
40
|
+
));
|
|
41
|
+
|
|
42
|
+
// node_modules/conventional-changelog-conventionalcommits/constants.js
|
|
43
|
+
var require_constants = __commonJS({
|
|
44
|
+
"node_modules/conventional-changelog-conventionalcommits/constants.js"(exports) {
|
|
45
|
+
"use strict";
|
|
46
|
+
var DEFAULT_COMMIT_TYPES = Object.freeze([
|
|
47
|
+
{ type: "feat", section: "Features" },
|
|
48
|
+
{ type: "feature", section: "Features" },
|
|
49
|
+
{ type: "fix", section: "Bug Fixes" },
|
|
50
|
+
{ type: "perf", section: "Performance Improvements" },
|
|
51
|
+
{ type: "revert", section: "Reverts" },
|
|
52
|
+
{ type: "docs", section: "Documentation", hidden: true },
|
|
53
|
+
{ type: "style", section: "Styles", hidden: true },
|
|
54
|
+
{ type: "chore", section: "Miscellaneous Chores", hidden: true },
|
|
55
|
+
{ type: "refactor", section: "Code Refactoring", hidden: true },
|
|
56
|
+
{ type: "test", section: "Tests", hidden: true },
|
|
57
|
+
{ type: "build", section: "Build System", hidden: true },
|
|
58
|
+
{ type: "ci", section: "Continuous Integration", hidden: true }
|
|
59
|
+
].map(Object.freeze));
|
|
60
|
+
exports.DEFAULT_COMMIT_TYPES = DEFAULT_COMMIT_TYPES;
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// node_modules/conventional-changelog-conventionalcommits/utils.js
|
|
65
|
+
var require_utils = __commonJS({
|
|
66
|
+
"node_modules/conventional-changelog-conventionalcommits/utils.js"(exports, module) {
|
|
67
|
+
var breakingHeaderPattern = /^(\w*)(?:\((.*)\))?!: (.*)$/;
|
|
68
|
+
module.exports.breakingHeaderPattern = breakingHeaderPattern;
|
|
69
|
+
function addBangNotes(commit) {
|
|
70
|
+
const match = commit.header.match(breakingHeaderPattern);
|
|
71
|
+
if (match && commit.notes.length === 0) {
|
|
72
|
+
const noteText = match[3];
|
|
73
|
+
commit.notes.push({
|
|
74
|
+
text: noteText
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
module.exports.addBangNotes = addBangNotes;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
// node_modules/conventional-changelog-conventionalcommits/parserOpts.js
|
|
83
|
+
var require_parserOpts = __commonJS({
|
|
84
|
+
"node_modules/conventional-changelog-conventionalcommits/parserOpts.js"(exports, module) {
|
|
85
|
+
"use strict";
|
|
86
|
+
var { breakingHeaderPattern } = require_utils();
|
|
87
|
+
function createParserOpts(config) {
|
|
88
|
+
return {
|
|
89
|
+
headerPattern: /^(\w*)(?:\((.*)\))?!?: (.*)$/,
|
|
90
|
+
breakingHeaderPattern,
|
|
91
|
+
headerCorrespondence: [
|
|
92
|
+
"type",
|
|
93
|
+
"scope",
|
|
94
|
+
"subject"
|
|
95
|
+
],
|
|
96
|
+
noteKeywords: ["BREAKING CHANGE", "BREAKING-CHANGE"],
|
|
97
|
+
revertPattern: /^(?:Revert|revert:)\s"?([\s\S]+?)"?\s*This reverts commit (\w*)\./i,
|
|
98
|
+
revertCorrespondence: ["header", "hash"],
|
|
99
|
+
issuePrefixes: config?.issuePrefixes || ["#"]
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
module.exports.createParserOpts = createParserOpts;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
// node_modules/array-ify/index.js
|
|
107
|
+
var require_array_ify = __commonJS({
|
|
108
|
+
"node_modules/array-ify/index.js"(exports, module) {
|
|
109
|
+
"use strict";
|
|
110
|
+
module.exports = function(val) {
|
|
111
|
+
return Array.isArray(val) ? val : [val];
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
// node_modules/dot-prop/node_modules/is-obj/index.js
|
|
117
|
+
var require_is_obj = __commonJS({
|
|
118
|
+
"node_modules/dot-prop/node_modules/is-obj/index.js"(exports, module) {
|
|
119
|
+
"use strict";
|
|
120
|
+
module.exports = (value) => {
|
|
121
|
+
const type = typeof value;
|
|
122
|
+
return value !== null && (type === "object" || type === "function");
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
// node_modules/dot-prop/index.js
|
|
128
|
+
var require_dot_prop = __commonJS({
|
|
129
|
+
"node_modules/dot-prop/index.js"(exports, module) {
|
|
130
|
+
"use strict";
|
|
131
|
+
var isObj = require_is_obj();
|
|
132
|
+
var disallowedKeys = [
|
|
133
|
+
"__proto__",
|
|
134
|
+
"prototype",
|
|
135
|
+
"constructor"
|
|
136
|
+
];
|
|
137
|
+
var isValidPath = (pathSegments) => !pathSegments.some((segment) => disallowedKeys.includes(segment));
|
|
138
|
+
function getPathSegments(path) {
|
|
139
|
+
const pathArray = path.split(".");
|
|
140
|
+
const parts = [];
|
|
141
|
+
for (let i = 0; i < pathArray.length; i++) {
|
|
142
|
+
let p = pathArray[i];
|
|
143
|
+
while (p[p.length - 1] === "\\" && pathArray[i + 1] !== void 0) {
|
|
144
|
+
p = p.slice(0, -1) + ".";
|
|
145
|
+
p += pathArray[++i];
|
|
146
|
+
}
|
|
147
|
+
parts.push(p);
|
|
148
|
+
}
|
|
149
|
+
if (!isValidPath(parts)) {
|
|
150
|
+
return [];
|
|
151
|
+
}
|
|
152
|
+
return parts;
|
|
153
|
+
}
|
|
154
|
+
module.exports = {
|
|
155
|
+
get(object, path, value) {
|
|
156
|
+
if (!isObj(object) || typeof path !== "string") {
|
|
157
|
+
return value === void 0 ? object : value;
|
|
158
|
+
}
|
|
159
|
+
const pathArray = getPathSegments(path);
|
|
160
|
+
if (pathArray.length === 0) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
for (let i = 0; i < pathArray.length; i++) {
|
|
164
|
+
if (!Object.prototype.propertyIsEnumerable.call(object, pathArray[i])) {
|
|
165
|
+
return value;
|
|
166
|
+
}
|
|
167
|
+
object = object[pathArray[i]];
|
|
168
|
+
if (object === void 0 || object === null) {
|
|
169
|
+
if (i !== pathArray.length - 1) {
|
|
170
|
+
return value;
|
|
171
|
+
}
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return object;
|
|
176
|
+
},
|
|
177
|
+
set(object, path, value) {
|
|
178
|
+
if (!isObj(object) || typeof path !== "string") {
|
|
179
|
+
return object;
|
|
180
|
+
}
|
|
181
|
+
const root = object;
|
|
182
|
+
const pathArray = getPathSegments(path);
|
|
183
|
+
for (let i = 0; i < pathArray.length; i++) {
|
|
184
|
+
const p = pathArray[i];
|
|
185
|
+
if (!isObj(object[p])) {
|
|
186
|
+
object[p] = {};
|
|
187
|
+
}
|
|
188
|
+
if (i === pathArray.length - 1) {
|
|
189
|
+
object[p] = value;
|
|
190
|
+
}
|
|
191
|
+
object = object[p];
|
|
192
|
+
}
|
|
193
|
+
return root;
|
|
194
|
+
},
|
|
195
|
+
delete(object, path) {
|
|
196
|
+
if (!isObj(object) || typeof path !== "string") {
|
|
197
|
+
return false;
|
|
198
|
+
}
|
|
199
|
+
const pathArray = getPathSegments(path);
|
|
200
|
+
for (let i = 0; i < pathArray.length; i++) {
|
|
201
|
+
const p = pathArray[i];
|
|
202
|
+
if (i === pathArray.length - 1) {
|
|
203
|
+
delete object[p];
|
|
204
|
+
return true;
|
|
205
|
+
}
|
|
206
|
+
object = object[p];
|
|
207
|
+
if (!isObj(object)) {
|
|
208
|
+
return false;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
has(object, path) {
|
|
213
|
+
if (!isObj(object) || typeof path !== "string") {
|
|
214
|
+
return false;
|
|
215
|
+
}
|
|
216
|
+
const pathArray = getPathSegments(path);
|
|
217
|
+
if (pathArray.length === 0) {
|
|
218
|
+
return false;
|
|
219
|
+
}
|
|
220
|
+
for (let i = 0; i < pathArray.length; i++) {
|
|
221
|
+
if (isObj(object)) {
|
|
222
|
+
if (!(pathArray[i] in object)) {
|
|
223
|
+
return false;
|
|
224
|
+
}
|
|
225
|
+
object = object[pathArray[i]];
|
|
226
|
+
} else {
|
|
227
|
+
return false;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return true;
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
// node_modules/compare-func/index.js
|
|
237
|
+
var require_compare_func = __commonJS({
|
|
238
|
+
"node_modules/compare-func/index.js"(exports, module) {
|
|
239
|
+
"use strict";
|
|
240
|
+
var arrayify = require_array_ify();
|
|
241
|
+
var dotPropGet = require_dot_prop().get;
|
|
242
|
+
function compareFunc(prop) {
|
|
243
|
+
return function(a, b) {
|
|
244
|
+
var ret = 0;
|
|
245
|
+
arrayify(prop).some(function(el) {
|
|
246
|
+
var x;
|
|
247
|
+
var y;
|
|
248
|
+
if (typeof el === "function") {
|
|
249
|
+
x = el(a);
|
|
250
|
+
y = el(b);
|
|
251
|
+
} else if (typeof el === "string") {
|
|
252
|
+
x = dotPropGet(a, el);
|
|
253
|
+
y = dotPropGet(b, el);
|
|
254
|
+
} else {
|
|
255
|
+
x = a;
|
|
256
|
+
y = b;
|
|
257
|
+
}
|
|
258
|
+
if (x === y) {
|
|
259
|
+
ret = 0;
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
if (typeof x === "string" && typeof y === "string") {
|
|
263
|
+
ret = x.localeCompare(y);
|
|
264
|
+
return ret !== 0;
|
|
265
|
+
}
|
|
266
|
+
ret = x < y ? -1 : 1;
|
|
267
|
+
return true;
|
|
268
|
+
});
|
|
269
|
+
return ret;
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
module.exports = compareFunc;
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
// node_modules/conventional-changelog-conventionalcommits/writerOpts.js
|
|
277
|
+
var require_writerOpts = __commonJS({
|
|
278
|
+
"node_modules/conventional-changelog-conventionalcommits/writerOpts.js"(exports, module) {
|
|
279
|
+
"use strict";
|
|
280
|
+
var compareFunc = require_compare_func();
|
|
281
|
+
var { readFile } = __require("fs").promises;
|
|
282
|
+
var { resolve } = __require("path");
|
|
283
|
+
var { DEFAULT_COMMIT_TYPES } = require_constants();
|
|
284
|
+
var { addBangNotes } = require_utils();
|
|
285
|
+
var releaseAsRegex = /release-as:\s*\w*@?([0-9]+\.[0-9]+\.[0-9a-z]+(-[0-9a-z.]+)?)\s*/i;
|
|
286
|
+
var owner = "{{#if this.owner}}{{~this.owner}}{{else}}{{~@root.owner}}{{/if}}";
|
|
287
|
+
var host = "{{~@root.host}}";
|
|
288
|
+
var repository = "{{#if this.repository}}{{~this.repository}}{{else}}{{~@root.repository}}{{/if}}";
|
|
289
|
+
async function createWriterOpts(config) {
|
|
290
|
+
const finalConfig = {
|
|
291
|
+
types: DEFAULT_COMMIT_TYPES,
|
|
292
|
+
issueUrlFormat: "{{host}}/{{owner}}/{{repository}}/issues/{{id}}",
|
|
293
|
+
commitUrlFormat: "{{host}}/{{owner}}/{{repository}}/commit/{{hash}}",
|
|
294
|
+
compareUrlFormat: "{{host}}/{{owner}}/{{repository}}/compare/{{previousTag}}...{{currentTag}}",
|
|
295
|
+
userUrlFormat: "{{host}}/{{user}}",
|
|
296
|
+
issuePrefixes: ["#"],
|
|
297
|
+
...config
|
|
298
|
+
};
|
|
299
|
+
const commitUrlFormat = expandTemplate(finalConfig.commitUrlFormat, {
|
|
300
|
+
host,
|
|
301
|
+
owner,
|
|
302
|
+
repository
|
|
303
|
+
});
|
|
304
|
+
const compareUrlFormat = expandTemplate(finalConfig.compareUrlFormat, {
|
|
305
|
+
host,
|
|
306
|
+
owner,
|
|
307
|
+
repository
|
|
308
|
+
});
|
|
309
|
+
const issueUrlFormat = expandTemplate(finalConfig.issueUrlFormat, {
|
|
310
|
+
host,
|
|
311
|
+
owner,
|
|
312
|
+
repository,
|
|
313
|
+
id: "{{this.issue}}",
|
|
314
|
+
prefix: "{{this.prefix}}"
|
|
315
|
+
});
|
|
316
|
+
const [
|
|
317
|
+
template,
|
|
318
|
+
header,
|
|
319
|
+
commit,
|
|
320
|
+
footer
|
|
321
|
+
] = await Promise.all([
|
|
322
|
+
readFile(resolve(__dirname, "./templates/template.hbs"), "utf-8"),
|
|
323
|
+
readFile(resolve(__dirname, "./templates/header.hbs"), "utf-8"),
|
|
324
|
+
readFile(resolve(__dirname, "./templates/commit.hbs"), "utf-8"),
|
|
325
|
+
readFile(resolve(__dirname, "./templates/footer.hbs"), "utf-8")
|
|
326
|
+
]);
|
|
327
|
+
const writerOpts = getWriterOpts(finalConfig);
|
|
328
|
+
writerOpts.mainTemplate = template;
|
|
329
|
+
writerOpts.headerPartial = header.replace(/{{compareUrlFormat}}/g, compareUrlFormat);
|
|
330
|
+
writerOpts.commitPartial = commit.replace(/{{commitUrlFormat}}/g, commitUrlFormat).replace(/{{issueUrlFormat}}/g, issueUrlFormat);
|
|
331
|
+
writerOpts.footerPartial = footer;
|
|
332
|
+
return writerOpts;
|
|
333
|
+
}
|
|
334
|
+
module.exports.createWriterOpts = createWriterOpts;
|
|
335
|
+
function getWriterOpts(config) {
|
|
336
|
+
const commitGroupOrder = config.types.flatMap((t) => t.section).filter((t) => t);
|
|
337
|
+
return {
|
|
338
|
+
transform: (commit, context) => {
|
|
339
|
+
let discard = true;
|
|
340
|
+
const issues = [];
|
|
341
|
+
const entry = findTypeEntry(config.types, commit);
|
|
342
|
+
addBangNotes(commit);
|
|
343
|
+
if (commit.footer && releaseAsRegex.test(commit.footer) || commit.body && releaseAsRegex.test(commit.body)) {
|
|
344
|
+
discard = false;
|
|
345
|
+
}
|
|
346
|
+
commit.notes.forEach((note) => {
|
|
347
|
+
note.title = "BREAKING CHANGES";
|
|
348
|
+
discard = false;
|
|
349
|
+
});
|
|
350
|
+
if (discard && (entry === void 0 || entry.hidden))
|
|
351
|
+
return;
|
|
352
|
+
if (entry)
|
|
353
|
+
commit.type = entry.section;
|
|
354
|
+
if (commit.scope === "*") {
|
|
355
|
+
commit.scope = "";
|
|
356
|
+
}
|
|
357
|
+
if (typeof commit.hash === "string") {
|
|
358
|
+
commit.shortHash = commit.hash.substring(0, 7);
|
|
359
|
+
}
|
|
360
|
+
if (typeof commit.subject === "string") {
|
|
361
|
+
config.issuePrefixes.join("|");
|
|
362
|
+
const issueRegEx = "(" + config.issuePrefixes.join("|") + ")([a-z0-9]+)";
|
|
363
|
+
const re = new RegExp(issueRegEx, "g");
|
|
364
|
+
commit.subject = commit.subject.replace(re, (_, prefix, issue) => {
|
|
365
|
+
issues.push(prefix + issue);
|
|
366
|
+
const url = expandTemplate(config.issueUrlFormat, {
|
|
367
|
+
host: context.host,
|
|
368
|
+
owner: context.owner,
|
|
369
|
+
repository: context.repository,
|
|
370
|
+
id: issue,
|
|
371
|
+
prefix
|
|
372
|
+
});
|
|
373
|
+
return `[${prefix}${issue}](${url})`;
|
|
374
|
+
});
|
|
375
|
+
commit.subject = commit.subject.replace(/\B@([a-z0-9](?:-?[a-z0-9/]){0,38})/g, (_, user) => {
|
|
376
|
+
if (user.includes("/")) {
|
|
377
|
+
return `@${user}`;
|
|
378
|
+
}
|
|
379
|
+
const usernameUrl = expandTemplate(config.userUrlFormat, {
|
|
380
|
+
host: context.host,
|
|
381
|
+
owner: context.owner,
|
|
382
|
+
repository: context.repository,
|
|
383
|
+
user
|
|
384
|
+
});
|
|
385
|
+
return `[@${user}](${usernameUrl})`;
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
commit.references = commit.references.filter((reference) => {
|
|
389
|
+
if (issues.indexOf(reference.prefix + reference.issue) === -1) {
|
|
390
|
+
return true;
|
|
391
|
+
}
|
|
392
|
+
return false;
|
|
393
|
+
});
|
|
394
|
+
return commit;
|
|
395
|
+
},
|
|
396
|
+
groupBy: "type",
|
|
397
|
+
// the groupings of commit messages, e.g., Features vs., Bug Fixes, are
|
|
398
|
+
// sorted based on their probable importance:
|
|
399
|
+
commitGroupsSort: (a, b) => {
|
|
400
|
+
const gRankA = commitGroupOrder.indexOf(a.title);
|
|
401
|
+
const gRankB = commitGroupOrder.indexOf(b.title);
|
|
402
|
+
return gRankA - gRankB;
|
|
403
|
+
},
|
|
404
|
+
commitsSort: ["scope", "subject"],
|
|
405
|
+
noteGroupsSort: "title",
|
|
406
|
+
notesSort: compareFunc
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
function findTypeEntry(types, commit) {
|
|
410
|
+
const typeKey = (commit.revert ? "revert" : commit.type || "").toLowerCase();
|
|
411
|
+
return types.find((entry) => {
|
|
412
|
+
if (entry.type !== typeKey) {
|
|
413
|
+
return false;
|
|
414
|
+
}
|
|
415
|
+
if (entry.scope && entry.scope !== commit.scope) {
|
|
416
|
+
return false;
|
|
417
|
+
}
|
|
418
|
+
return true;
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
function expandTemplate(template, context) {
|
|
422
|
+
let expanded = template;
|
|
423
|
+
Object.keys(context).forEach((key) => {
|
|
424
|
+
expanded = expanded.replace(new RegExp(`{{${key}}}`, "g"), context[key]);
|
|
425
|
+
});
|
|
426
|
+
return expanded;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
|
|
431
|
+
// node_modules/conventional-changelog-conventionalcommits/conventionalChangelog.js
|
|
432
|
+
var require_conventionalChangelog = __commonJS({
|
|
433
|
+
"node_modules/conventional-changelog-conventionalcommits/conventionalChangelog.js"(exports, module) {
|
|
434
|
+
"use strict";
|
|
435
|
+
function createConventionalChangelogOpts(parserOpts, writerOpts) {
|
|
436
|
+
return {
|
|
437
|
+
parserOpts,
|
|
438
|
+
writerOpts
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
module.exports.createConventionalChangelogOpts = createConventionalChangelogOpts;
|
|
442
|
+
}
|
|
443
|
+
});
|
|
444
|
+
|
|
445
|
+
// node_modules/conventional-changelog-conventionalcommits/conventionalRecommendedBump.js
|
|
446
|
+
var require_conventionalRecommendedBump = __commonJS({
|
|
447
|
+
"node_modules/conventional-changelog-conventionalcommits/conventionalRecommendedBump.js"(exports, module) {
|
|
448
|
+
"use strict";
|
|
449
|
+
var { addBangNotes } = require_utils();
|
|
450
|
+
function createConventionalRecommendedBumpOpts(config, parserOpts) {
|
|
451
|
+
return {
|
|
452
|
+
parserOpts,
|
|
453
|
+
whatBump(commits) {
|
|
454
|
+
let level = 2;
|
|
455
|
+
let breakings = 0;
|
|
456
|
+
let features = 0;
|
|
457
|
+
commits.forEach((commit) => {
|
|
458
|
+
addBangNotes(commit);
|
|
459
|
+
if (commit.notes.length > 0) {
|
|
460
|
+
breakings += commit.notes.length;
|
|
461
|
+
level = 0;
|
|
462
|
+
} else if (commit.type === "feat" || commit.type === "feature") {
|
|
463
|
+
features += 1;
|
|
464
|
+
if (level === 2) {
|
|
465
|
+
level = 1;
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
});
|
|
469
|
+
if (config?.preMajor && level < 2) {
|
|
470
|
+
level++;
|
|
471
|
+
}
|
|
472
|
+
return {
|
|
473
|
+
level,
|
|
474
|
+
reason: breakings === 1 ? `There is ${breakings} BREAKING CHANGE and ${features} features` : `There are ${breakings} BREAKING CHANGES and ${features} features`
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
};
|
|
478
|
+
}
|
|
479
|
+
module.exports.createConventionalRecommendedBumpOpts = createConventionalRecommendedBumpOpts;
|
|
480
|
+
}
|
|
481
|
+
});
|
|
482
|
+
|
|
483
|
+
// node_modules/conventional-changelog-conventionalcommits/index.js
|
|
484
|
+
var require_conventional_changelog_conventionalcommits = __commonJS({
|
|
485
|
+
"node_modules/conventional-changelog-conventionalcommits/index.js"(exports, module) {
|
|
486
|
+
"use strict";
|
|
487
|
+
var { DEFAULT_COMMIT_TYPES } = require_constants();
|
|
488
|
+
var { createParserOpts } = require_parserOpts();
|
|
489
|
+
var { createWriterOpts } = require_writerOpts();
|
|
490
|
+
var { createConventionalChangelogOpts } = require_conventionalChangelog();
|
|
491
|
+
var { createConventionalRecommendedBumpOpts } = require_conventionalRecommendedBump();
|
|
492
|
+
async function createPreset(config) {
|
|
493
|
+
const parserOpts = createParserOpts(config);
|
|
494
|
+
const writerOpts = await createWriterOpts(config);
|
|
495
|
+
const recommendedBumpOpts = createConventionalRecommendedBumpOpts(config, parserOpts);
|
|
496
|
+
const conventionalChangelog = createConventionalChangelogOpts(parserOpts, writerOpts);
|
|
497
|
+
return {
|
|
498
|
+
gitRawCommitsOpts: {
|
|
499
|
+
ignore: config?.ignoreCommits,
|
|
500
|
+
noMerges: null
|
|
501
|
+
},
|
|
502
|
+
parserOpts,
|
|
503
|
+
writerOpts,
|
|
504
|
+
recommendedBumpOpts,
|
|
505
|
+
conventionalChangelog
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
module.exports = createPreset;
|
|
509
|
+
module.exports.DEFAULT_COMMIT_TYPES = DEFAULT_COMMIT_TYPES;
|
|
510
|
+
}
|
|
511
|
+
});
|
|
512
|
+
|
|
513
|
+
// src/parser-preset.ts
|
|
514
|
+
var import_conventional_changelog_conventionalcommits = __toESM(require_conventional_changelog_conventionalcommits(), 1);
|
|
515
|
+
var parser_preset_default = import_conventional_changelog_conventionalcommits.default;
|
|
516
|
+
export {
|
|
517
|
+
parser_preset_default as default
|
|
518
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
*{{#if scope}} **{{scope}}:**
|
|
2
|
+
{{~/if}} {{#if subject}}
|
|
3
|
+
{{~subject}}
|
|
4
|
+
{{~else}}
|
|
5
|
+
{{~header}}
|
|
6
|
+
{{~/if}}
|
|
7
|
+
|
|
8
|
+
{{~!-- commit link --}}{{~#if hash}} {{#if @root.linkReferences~}}
|
|
9
|
+
([{{shortHash}}]({{commitUrlFormat}}))
|
|
10
|
+
{{~else}}
|
|
11
|
+
{{~shortHash}}
|
|
12
|
+
{{~/if}}{{~/if}}
|
|
13
|
+
|
|
14
|
+
{{~!-- commit references --}}
|
|
15
|
+
{{~#if references~}}
|
|
16
|
+
, closes
|
|
17
|
+
{{~#each references}} {{#if @root.linkReferences~}}
|
|
18
|
+
[
|
|
19
|
+
{{~#if this.owner}}
|
|
20
|
+
{{~this.owner}}/
|
|
21
|
+
{{~/if}}
|
|
22
|
+
{{~this.repository}}{{this.prefix}}{{this.issue}}]({{issueUrlFormat}})
|
|
23
|
+
{{~else}}
|
|
24
|
+
{{~#if this.owner}}
|
|
25
|
+
{{~this.owner}}/
|
|
26
|
+
{{~/if}}
|
|
27
|
+
{{~this.repository}}{{this.prefix}}{{this.issue}}
|
|
28
|
+
{{~/if}}{{/each}}
|
|
29
|
+
{{~/if}}
|
|
30
|
+
|
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{{> header}}
|
|
2
|
+
|
|
3
|
+
{{#if noteGroups}}
|
|
4
|
+
{{#each noteGroups}}
|
|
5
|
+
|
|
6
|
+
### ⚠ {{title}}
|
|
7
|
+
|
|
8
|
+
{{#each notes}}
|
|
9
|
+
* {{#if commit.scope}}**{{commit.scope}}:** {{/if}}{{text}}
|
|
10
|
+
{{/each}}
|
|
11
|
+
{{/each}}
|
|
12
|
+
{{/if}}
|
|
13
|
+
{{#each commitGroups}}
|
|
14
|
+
|
|
15
|
+
{{#if title}}
|
|
16
|
+
### {{title}}
|
|
17
|
+
|
|
18
|
+
{{/if}}
|
|
19
|
+
{{#each commits}}
|
|
20
|
+
{{> commit root=@root}}
|
|
21
|
+
{{/each}}
|
|
22
|
+
|
|
23
|
+
{{/each}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@html-validate/commitlint-config",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "Commitlint sharable config used by the various HTML-validate packages",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"commitlint"
|
|
@@ -11,63 +11,41 @@
|
|
|
11
11
|
},
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
14
|
-
"url": "https://gitlab.com/html-validate/commitlint-config.git"
|
|
14
|
+
"url": "git+https://gitlab.com/html-validate/commitlint-config.git"
|
|
15
15
|
},
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"author": "David Sveningsson <ext@sidvind.com>",
|
|
18
|
-
"
|
|
18
|
+
"type": "module",
|
|
19
|
+
"main": "dist/config.js",
|
|
19
20
|
"bin": {
|
|
20
|
-
"commitlint": "
|
|
21
|
-
"commitlint-config": "install.js"
|
|
21
|
+
"commitlint": "bin/commitlint.js",
|
|
22
|
+
"commitlint-config": "bin/install.js"
|
|
22
23
|
},
|
|
23
24
|
"files": [
|
|
24
|
-
"
|
|
25
|
+
"bin",
|
|
26
|
+
"dist",
|
|
25
27
|
"gitmessage"
|
|
26
28
|
],
|
|
27
29
|
"scripts": {
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
+
"prebuild": "tsc",
|
|
31
|
+
"build": "node build.js ",
|
|
32
|
+
"postbuild": "cp -R node_modules/conventional-changelog-conventionalcommits/templates/ node_modules/@commitlint/config-validator/lib/commitlint.schema.json dist/",
|
|
33
|
+
"eslint": "eslint --cache .",
|
|
34
|
+
"eslint:fix": "eslint --cache --fix .",
|
|
35
|
+
"prepack": "release-prepack --bundle --retain-scripts && npm pkg set scripts.postinstall=\"node bin/install.js\"",
|
|
36
|
+
"postpack": "release-postpack",
|
|
37
|
+
"prepare": "husky && git config commit.template gitmessage",
|
|
38
|
+
"prepublishOnly": "release-prepublish --bundle --retain-scripts && npm pkg set scripts.postinstall=\"node bin/install.js\"",
|
|
30
39
|
"prettier:check": "prettier --check .",
|
|
31
40
|
"prettier:write": "prettier --write .",
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"extends": [
|
|
36
|
-
"."
|
|
37
|
-
]
|
|
38
|
-
},
|
|
39
|
-
"prettier": "@html-validate/prettier-config",
|
|
40
|
-
"release": {
|
|
41
|
-
"extends": "@html-validate/semantic-release-config"
|
|
42
|
-
},
|
|
43
|
-
"dependencies": {
|
|
44
|
-
"@commitlint/cli": "18.6.1",
|
|
45
|
-
"@commitlint/config-conventional": "18.6.2",
|
|
46
|
-
"is-ci": "^3.0.0"
|
|
47
|
-
},
|
|
48
|
-
"devDependencies": {
|
|
49
|
-
"@html-validate/prettier-config": "2.4.12",
|
|
50
|
-
"@html-validate/semantic-release-config": "6.2.0",
|
|
51
|
-
"husky": "9.0.11",
|
|
52
|
-
"npm-pkg-lint": "2.1.0"
|
|
41
|
+
"pretest": "npm run eslint && npm run prettier:check",
|
|
42
|
+
"test": "node bin/commitlint.js --help",
|
|
43
|
+
"postinstall": "node bin/install.js"
|
|
53
44
|
},
|
|
54
45
|
"engines": {
|
|
55
46
|
"node": ">= 18"
|
|
56
47
|
},
|
|
57
48
|
"publishConfig": {
|
|
58
49
|
"access": "public"
|
|
59
|
-
},
|
|
60
|
-
"renovate": {
|
|
61
|
-
"extends": [
|
|
62
|
-
"gitlab>html-validate/renovate-config"
|
|
63
|
-
],
|
|
64
|
-
"packageRules": [
|
|
65
|
-
{
|
|
66
|
-
"matchSourceUrlPrefixes": [
|
|
67
|
-
"https://github.com/conventional-changelog/commitlint"
|
|
68
|
-
],
|
|
69
|
-
"rangeStrategy": "pin"
|
|
70
|
-
}
|
|
71
|
-
]
|
|
72
50
|
}
|
|
73
51
|
}
|
package/cli.js
DELETED