@html-validate/commitlint-config 3.6.3 → 3.6.5
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 +2050 -5327
- package/dist/formatter.js +100 -496
- package/package.json +1 -1
package/dist/formatter.js
CHANGED
|
@@ -6,503 +6,106 @@ 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
|
-
|
|
10
|
-
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
reset: [0, 0],
|
|
18
|
-
// 21 isn't widely supported and 22 does the same thing
|
|
19
|
-
bold: [1, 22],
|
|
20
|
-
dim: [2, 22],
|
|
21
|
-
italic: [3, 23],
|
|
22
|
-
underline: [4, 24],
|
|
23
|
-
overline: [53, 55],
|
|
24
|
-
inverse: [7, 27],
|
|
25
|
-
hidden: [8, 28],
|
|
26
|
-
strikethrough: [9, 29]
|
|
27
|
-
},
|
|
28
|
-
color: {
|
|
29
|
-
black: [30, 39],
|
|
30
|
-
red: [31, 39],
|
|
31
|
-
green: [32, 39],
|
|
32
|
-
yellow: [33, 39],
|
|
33
|
-
blue: [34, 39],
|
|
34
|
-
magenta: [35, 39],
|
|
35
|
-
cyan: [36, 39],
|
|
36
|
-
white: [37, 39],
|
|
37
|
-
// Bright color
|
|
38
|
-
blackBright: [90, 39],
|
|
39
|
-
gray: [90, 39],
|
|
40
|
-
// Alias of `blackBright`
|
|
41
|
-
grey: [90, 39],
|
|
42
|
-
// Alias of `blackBright`
|
|
43
|
-
redBright: [91, 39],
|
|
44
|
-
greenBright: [92, 39],
|
|
45
|
-
yellowBright: [93, 39],
|
|
46
|
-
blueBright: [94, 39],
|
|
47
|
-
magentaBright: [95, 39],
|
|
48
|
-
cyanBright: [96, 39],
|
|
49
|
-
whiteBright: [97, 39]
|
|
50
|
-
},
|
|
51
|
-
bgColor: {
|
|
52
|
-
bgBlack: [40, 49],
|
|
53
|
-
bgRed: [41, 49],
|
|
54
|
-
bgGreen: [42, 49],
|
|
55
|
-
bgYellow: [43, 49],
|
|
56
|
-
bgBlue: [44, 49],
|
|
57
|
-
bgMagenta: [45, 49],
|
|
58
|
-
bgCyan: [46, 49],
|
|
59
|
-
bgWhite: [47, 49],
|
|
60
|
-
// Bright color
|
|
61
|
-
bgBlackBright: [100, 49],
|
|
62
|
-
bgGray: [100, 49],
|
|
63
|
-
// Alias of `bgBlackBright`
|
|
64
|
-
bgGrey: [100, 49],
|
|
65
|
-
// Alias of `bgBlackBright`
|
|
66
|
-
bgRedBright: [101, 49],
|
|
67
|
-
bgGreenBright: [102, 49],
|
|
68
|
-
bgYellowBright: [103, 49],
|
|
69
|
-
bgBlueBright: [104, 49],
|
|
70
|
-
bgMagentaBright: [105, 49],
|
|
71
|
-
bgCyanBright: [106, 49],
|
|
72
|
-
bgWhiteBright: [107, 49]
|
|
73
|
-
}
|
|
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 __commonJS = (cb, mod) => function __require() {
|
|
16
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
74
17
|
};
|
|
75
|
-
var
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const codes = /* @__PURE__ */ new Map();
|
|
81
|
-
for (const [groupName, group] of Object.entries(styles)) {
|
|
82
|
-
for (const [styleName, style] of Object.entries(group)) {
|
|
83
|
-
styles[styleName] = {
|
|
84
|
-
open: `\x1B[${style[0]}m`,
|
|
85
|
-
close: `\x1B[${style[1]}m`
|
|
86
|
-
};
|
|
87
|
-
group[styleName] = styles[styleName];
|
|
88
|
-
codes.set(style[0], style[1]);
|
|
89
|
-
}
|
|
90
|
-
Object.defineProperty(styles, groupName, {
|
|
91
|
-
value: group,
|
|
92
|
-
enumerable: false
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
Object.defineProperty(styles, "codes", {
|
|
96
|
-
value: codes,
|
|
97
|
-
enumerable: false
|
|
98
|
-
});
|
|
99
|
-
styles.color.close = "\x1B[39m";
|
|
100
|
-
styles.bgColor.close = "\x1B[49m";
|
|
101
|
-
styles.color.ansi = wrapAnsi16();
|
|
102
|
-
styles.color.ansi256 = wrapAnsi256();
|
|
103
|
-
styles.color.ansi16m = wrapAnsi16m();
|
|
104
|
-
styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
105
|
-
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
106
|
-
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
107
|
-
Object.defineProperties(styles, {
|
|
108
|
-
rgbToAnsi256: {
|
|
109
|
-
value(red, green, blue) {
|
|
110
|
-
if (red === green && green === blue) {
|
|
111
|
-
if (red < 8) {
|
|
112
|
-
return 16;
|
|
113
|
-
}
|
|
114
|
-
if (red > 248) {
|
|
115
|
-
return 231;
|
|
116
|
-
}
|
|
117
|
-
return Math.round((red - 8) / 247 * 24) + 232;
|
|
118
|
-
}
|
|
119
|
-
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
120
|
-
},
|
|
121
|
-
enumerable: false
|
|
122
|
-
},
|
|
123
|
-
hexToRgb: {
|
|
124
|
-
value(hex) {
|
|
125
|
-
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
126
|
-
if (!matches) {
|
|
127
|
-
return [0, 0, 0];
|
|
128
|
-
}
|
|
129
|
-
let [colorString] = matches;
|
|
130
|
-
if (colorString.length === 3) {
|
|
131
|
-
colorString = [...colorString].map((character) => character + character).join("");
|
|
132
|
-
}
|
|
133
|
-
const integer = Number.parseInt(colorString, 16);
|
|
134
|
-
return [
|
|
135
|
-
/* eslint-disable no-bitwise */
|
|
136
|
-
integer >> 16 & 255,
|
|
137
|
-
integer >> 8 & 255,
|
|
138
|
-
integer & 255
|
|
139
|
-
/* eslint-enable no-bitwise */
|
|
140
|
-
];
|
|
141
|
-
},
|
|
142
|
-
enumerable: false
|
|
143
|
-
},
|
|
144
|
-
hexToAnsi256: {
|
|
145
|
-
value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
|
|
146
|
-
enumerable: false
|
|
147
|
-
},
|
|
148
|
-
ansi256ToAnsi: {
|
|
149
|
-
value(code) {
|
|
150
|
-
if (code < 8) {
|
|
151
|
-
return 30 + code;
|
|
152
|
-
}
|
|
153
|
-
if (code < 16) {
|
|
154
|
-
return 90 + (code - 8);
|
|
155
|
-
}
|
|
156
|
-
let red;
|
|
157
|
-
let green;
|
|
158
|
-
let blue;
|
|
159
|
-
if (code >= 232) {
|
|
160
|
-
red = ((code - 232) * 10 + 8) / 255;
|
|
161
|
-
green = red;
|
|
162
|
-
blue = red;
|
|
163
|
-
} else {
|
|
164
|
-
code -= 16;
|
|
165
|
-
const remainder = code % 36;
|
|
166
|
-
red = Math.floor(code / 36) / 5;
|
|
167
|
-
green = Math.floor(remainder / 6) / 5;
|
|
168
|
-
blue = remainder % 6 / 5;
|
|
169
|
-
}
|
|
170
|
-
const value = Math.max(red, green, blue) * 2;
|
|
171
|
-
if (value === 0) {
|
|
172
|
-
return 30;
|
|
173
|
-
}
|
|
174
|
-
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
175
|
-
if (value === 2) {
|
|
176
|
-
result += 60;
|
|
177
|
-
}
|
|
178
|
-
return result;
|
|
179
|
-
},
|
|
180
|
-
enumerable: false
|
|
181
|
-
},
|
|
182
|
-
rgbToAnsi: {
|
|
183
|
-
value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
|
|
184
|
-
enumerable: false
|
|
185
|
-
},
|
|
186
|
-
hexToAnsi: {
|
|
187
|
-
value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
|
|
188
|
-
enumerable: false
|
|
189
|
-
}
|
|
190
|
-
});
|
|
191
|
-
return styles;
|
|
192
|
-
}
|
|
193
|
-
var ansiStyles = assembleStyles();
|
|
194
|
-
var ansi_styles_default = ansiStyles;
|
|
195
|
-
|
|
196
|
-
// node_modules/chalk/source/vendor/supports-color/index.js
|
|
197
|
-
import process from "node:process";
|
|
198
|
-
import os from "node:os";
|
|
199
|
-
import tty from "node:tty";
|
|
200
|
-
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process.argv) {
|
|
201
|
-
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
202
|
-
const position = argv.indexOf(prefix + flag);
|
|
203
|
-
const terminatorPosition = argv.indexOf("--");
|
|
204
|
-
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
205
|
-
}
|
|
206
|
-
var { env } = process;
|
|
207
|
-
var flagForceColor;
|
|
208
|
-
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
209
|
-
flagForceColor = 0;
|
|
210
|
-
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
211
|
-
flagForceColor = 1;
|
|
212
|
-
}
|
|
213
|
-
function envForceColor() {
|
|
214
|
-
if ("FORCE_COLOR" in env) {
|
|
215
|
-
if (env.FORCE_COLOR === "true") {
|
|
216
|
-
return 1;
|
|
217
|
-
}
|
|
218
|
-
if (env.FORCE_COLOR === "false") {
|
|
219
|
-
return 0;
|
|
220
|
-
}
|
|
221
|
-
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
function translateLevel(level) {
|
|
225
|
-
if (level === 0) {
|
|
226
|
-
return false;
|
|
227
|
-
}
|
|
228
|
-
return {
|
|
229
|
-
level,
|
|
230
|
-
hasBasic: true,
|
|
231
|
-
has256: level >= 2,
|
|
232
|
-
has16m: level >= 3
|
|
233
|
-
};
|
|
234
|
-
}
|
|
235
|
-
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
236
|
-
const noFlagForceColor = envForceColor();
|
|
237
|
-
if (noFlagForceColor !== void 0) {
|
|
238
|
-
flagForceColor = noFlagForceColor;
|
|
239
|
-
}
|
|
240
|
-
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
241
|
-
if (forceColor === 0) {
|
|
242
|
-
return 0;
|
|
243
|
-
}
|
|
244
|
-
if (sniffFlags) {
|
|
245
|
-
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
246
|
-
return 3;
|
|
247
|
-
}
|
|
248
|
-
if (hasFlag("color=256")) {
|
|
249
|
-
return 2;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
if ("TF_BUILD" in env && "AGENT_NAME" in env) {
|
|
253
|
-
return 1;
|
|
254
|
-
}
|
|
255
|
-
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
256
|
-
return 0;
|
|
257
|
-
}
|
|
258
|
-
const min = forceColor || 0;
|
|
259
|
-
if (env.TERM === "dumb") {
|
|
260
|
-
return min;
|
|
261
|
-
}
|
|
262
|
-
if (process.platform === "win32") {
|
|
263
|
-
const osRelease = os.release().split(".");
|
|
264
|
-
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
265
|
-
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
266
|
-
}
|
|
267
|
-
return 1;
|
|
268
|
-
}
|
|
269
|
-
if ("CI" in env) {
|
|
270
|
-
if (["GITHUB_ACTIONS", "GITEA_ACTIONS", "CIRCLECI"].some((key) => key in env)) {
|
|
271
|
-
return 3;
|
|
272
|
-
}
|
|
273
|
-
if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
274
|
-
return 1;
|
|
275
|
-
}
|
|
276
|
-
return min;
|
|
277
|
-
}
|
|
278
|
-
if ("TEAMCITY_VERSION" in env) {
|
|
279
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
280
|
-
}
|
|
281
|
-
if (env.COLORTERM === "truecolor") {
|
|
282
|
-
return 3;
|
|
283
|
-
}
|
|
284
|
-
if (env.TERM === "xterm-kitty") {
|
|
285
|
-
return 3;
|
|
286
|
-
}
|
|
287
|
-
if (env.TERM === "xterm-ghostty") {
|
|
288
|
-
return 3;
|
|
289
|
-
}
|
|
290
|
-
if (env.TERM === "wezterm") {
|
|
291
|
-
return 3;
|
|
292
|
-
}
|
|
293
|
-
if ("TERM_PROGRAM" in env) {
|
|
294
|
-
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
295
|
-
switch (env.TERM_PROGRAM) {
|
|
296
|
-
case "iTerm.app": {
|
|
297
|
-
return version >= 3 ? 3 : 2;
|
|
298
|
-
}
|
|
299
|
-
case "Apple_Terminal": {
|
|
300
|
-
return 2;
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
if (/-256(color)?$/i.test(env.TERM)) {
|
|
305
|
-
return 2;
|
|
306
|
-
}
|
|
307
|
-
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
308
|
-
return 1;
|
|
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 });
|
|
309
23
|
}
|
|
310
|
-
|
|
311
|
-
return 1;
|
|
312
|
-
}
|
|
313
|
-
return min;
|
|
314
|
-
}
|
|
315
|
-
function createSupportsColor(stream, options = {}) {
|
|
316
|
-
const level = _supportsColor(stream, {
|
|
317
|
-
streamIsTTY: stream && stream.isTTY,
|
|
318
|
-
...options
|
|
319
|
-
});
|
|
320
|
-
return translateLevel(level);
|
|
321
|
-
}
|
|
322
|
-
var supportsColor = {
|
|
323
|
-
stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
|
|
324
|
-
stderr: createSupportsColor({ isTTY: tty.isatty(2) })
|
|
24
|
+
return to;
|
|
325
25
|
};
|
|
326
|
-
var
|
|
327
|
-
|
|
328
|
-
//
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
const substringLength = substring.length;
|
|
335
|
-
let endIndex = 0;
|
|
336
|
-
let returnValue = "";
|
|
337
|
-
do {
|
|
338
|
-
returnValue += string.slice(endIndex, index) + substring + replacer;
|
|
339
|
-
endIndex = index + substringLength;
|
|
340
|
-
index = string.indexOf(substring, endIndex);
|
|
341
|
-
} while (index !== -1);
|
|
342
|
-
returnValue += string.slice(endIndex);
|
|
343
|
-
return returnValue;
|
|
344
|
-
}
|
|
345
|
-
function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
|
|
346
|
-
let endIndex = 0;
|
|
347
|
-
let returnValue = "";
|
|
348
|
-
do {
|
|
349
|
-
const gotCR = string[index - 1] === "\r";
|
|
350
|
-
returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
351
|
-
endIndex = index + 1;
|
|
352
|
-
index = string.indexOf("\n", endIndex);
|
|
353
|
-
} while (index !== -1);
|
|
354
|
-
returnValue += string.slice(endIndex);
|
|
355
|
-
return returnValue;
|
|
356
|
-
}
|
|
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
|
+
));
|
|
357
34
|
|
|
358
|
-
// node_modules/
|
|
359
|
-
var
|
|
360
|
-
|
|
361
|
-
var
|
|
362
|
-
var
|
|
363
|
-
var
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
var
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
return function(...arguments_) {
|
|
424
|
-
const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
|
|
425
|
-
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
35
|
+
// node_modules/picocolors/picocolors.js
|
|
36
|
+
var require_picocolors = __commonJS({
|
|
37
|
+
"node_modules/picocolors/picocolors.js"(exports, module) {
|
|
38
|
+
var p = process || {};
|
|
39
|
+
var argv = p.argv || [];
|
|
40
|
+
var env = p.env || {};
|
|
41
|
+
var isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
42
|
+
var formatter = (open, close, replace = open) => (input) => {
|
|
43
|
+
let string = "" + input, index = string.indexOf(close, open.length);
|
|
44
|
+
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
45
|
+
};
|
|
46
|
+
var replaceClose = (string, close, replace, index) => {
|
|
47
|
+
let result = "", cursor = 0;
|
|
48
|
+
do {
|
|
49
|
+
result += string.substring(cursor, index) + replace;
|
|
50
|
+
cursor = index + close.length;
|
|
51
|
+
index = string.indexOf(close, cursor);
|
|
52
|
+
} while (~index);
|
|
53
|
+
return result + string.substring(cursor);
|
|
54
|
+
};
|
|
55
|
+
var createColors = (enabled = isColorSupported) => {
|
|
56
|
+
let f = enabled ? formatter : () => String;
|
|
57
|
+
return {
|
|
58
|
+
isColorSupported: enabled,
|
|
59
|
+
reset: f("\x1B[0m", "\x1B[0m"),
|
|
60
|
+
bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
61
|
+
dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
62
|
+
italic: f("\x1B[3m", "\x1B[23m"),
|
|
63
|
+
underline: f("\x1B[4m", "\x1B[24m"),
|
|
64
|
+
inverse: f("\x1B[7m", "\x1B[27m"),
|
|
65
|
+
hidden: f("\x1B[8m", "\x1B[28m"),
|
|
66
|
+
strikethrough: f("\x1B[9m", "\x1B[29m"),
|
|
67
|
+
black: f("\x1B[30m", "\x1B[39m"),
|
|
68
|
+
red: f("\x1B[31m", "\x1B[39m"),
|
|
69
|
+
green: f("\x1B[32m", "\x1B[39m"),
|
|
70
|
+
yellow: f("\x1B[33m", "\x1B[39m"),
|
|
71
|
+
blue: f("\x1B[34m", "\x1B[39m"),
|
|
72
|
+
magenta: f("\x1B[35m", "\x1B[39m"),
|
|
73
|
+
cyan: f("\x1B[36m", "\x1B[39m"),
|
|
74
|
+
white: f("\x1B[37m", "\x1B[39m"),
|
|
75
|
+
gray: f("\x1B[90m", "\x1B[39m"),
|
|
76
|
+
bgBlack: f("\x1B[40m", "\x1B[49m"),
|
|
77
|
+
bgRed: f("\x1B[41m", "\x1B[49m"),
|
|
78
|
+
bgGreen: f("\x1B[42m", "\x1B[49m"),
|
|
79
|
+
bgYellow: f("\x1B[43m", "\x1B[49m"),
|
|
80
|
+
bgBlue: f("\x1B[44m", "\x1B[49m"),
|
|
81
|
+
bgMagenta: f("\x1B[45m", "\x1B[49m"),
|
|
82
|
+
bgCyan: f("\x1B[46m", "\x1B[49m"),
|
|
83
|
+
bgWhite: f("\x1B[47m", "\x1B[49m"),
|
|
84
|
+
blackBright: f("\x1B[90m", "\x1B[39m"),
|
|
85
|
+
redBright: f("\x1B[91m", "\x1B[39m"),
|
|
86
|
+
greenBright: f("\x1B[92m", "\x1B[39m"),
|
|
87
|
+
yellowBright: f("\x1B[93m", "\x1B[39m"),
|
|
88
|
+
blueBright: f("\x1B[94m", "\x1B[39m"),
|
|
89
|
+
magentaBright: f("\x1B[95m", "\x1B[39m"),
|
|
90
|
+
cyanBright: f("\x1B[96m", "\x1B[39m"),
|
|
91
|
+
whiteBright: f("\x1B[97m", "\x1B[39m"),
|
|
92
|
+
bgBlackBright: f("\x1B[100m", "\x1B[49m"),
|
|
93
|
+
bgRedBright: f("\x1B[101m", "\x1B[49m"),
|
|
94
|
+
bgGreenBright: f("\x1B[102m", "\x1B[49m"),
|
|
95
|
+
bgYellowBright: f("\x1B[103m", "\x1B[49m"),
|
|
96
|
+
bgBlueBright: f("\x1B[104m", "\x1B[49m"),
|
|
97
|
+
bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
|
|
98
|
+
bgCyanBright: f("\x1B[106m", "\x1B[49m"),
|
|
99
|
+
bgWhiteBright: f("\x1B[107m", "\x1B[49m")
|
|
426
100
|
};
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
styles2[bgModel] = {
|
|
431
|
-
get() {
|
|
432
|
-
const { level } = this;
|
|
433
|
-
return function(...arguments_) {
|
|
434
|
-
const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
|
|
435
|
-
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
436
|
-
};
|
|
437
|
-
}
|
|
438
|
-
};
|
|
439
|
-
}
|
|
440
|
-
var proto = Object.defineProperties(() => {
|
|
441
|
-
}, {
|
|
442
|
-
...styles2,
|
|
443
|
-
level: {
|
|
444
|
-
enumerable: true,
|
|
445
|
-
get() {
|
|
446
|
-
return this[GENERATOR].level;
|
|
447
|
-
},
|
|
448
|
-
set(level) {
|
|
449
|
-
this[GENERATOR].level = level;
|
|
450
|
-
}
|
|
101
|
+
};
|
|
102
|
+
module.exports = createColors();
|
|
103
|
+
module.exports.createColors = createColors;
|
|
451
104
|
}
|
|
452
105
|
});
|
|
453
|
-
var createStyler = (open, close, parent) => {
|
|
454
|
-
let openAll;
|
|
455
|
-
let closeAll;
|
|
456
|
-
if (parent === void 0) {
|
|
457
|
-
openAll = open;
|
|
458
|
-
closeAll = close;
|
|
459
|
-
} else {
|
|
460
|
-
openAll = parent.openAll + open;
|
|
461
|
-
closeAll = close + parent.closeAll;
|
|
462
|
-
}
|
|
463
|
-
return {
|
|
464
|
-
open,
|
|
465
|
-
close,
|
|
466
|
-
openAll,
|
|
467
|
-
closeAll,
|
|
468
|
-
parent
|
|
469
|
-
};
|
|
470
|
-
};
|
|
471
|
-
var createBuilder = (self, _styler, _isEmpty) => {
|
|
472
|
-
const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
473
|
-
Object.setPrototypeOf(builder, proto);
|
|
474
|
-
builder[GENERATOR] = self;
|
|
475
|
-
builder[STYLER] = _styler;
|
|
476
|
-
builder[IS_EMPTY] = _isEmpty;
|
|
477
|
-
return builder;
|
|
478
|
-
};
|
|
479
|
-
var applyStyle = (self, string) => {
|
|
480
|
-
if (self.level <= 0 || !string) {
|
|
481
|
-
return self[IS_EMPTY] ? "" : string;
|
|
482
|
-
}
|
|
483
|
-
let styler = self[STYLER];
|
|
484
|
-
if (styler === void 0) {
|
|
485
|
-
return string;
|
|
486
|
-
}
|
|
487
|
-
const { openAll, closeAll } = styler;
|
|
488
|
-
if (string.includes("\x1B")) {
|
|
489
|
-
while (styler !== void 0) {
|
|
490
|
-
string = stringReplaceAll(string, styler.close, styler.open);
|
|
491
|
-
styler = styler.parent;
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
const lfIndex = string.indexOf("\n");
|
|
495
|
-
if (lfIndex !== -1) {
|
|
496
|
-
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
497
|
-
}
|
|
498
|
-
return openAll + string + closeAll;
|
|
499
|
-
};
|
|
500
|
-
Object.defineProperties(createChalk.prototype, styles2);
|
|
501
|
-
var chalk = createChalk();
|
|
502
|
-
var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
503
|
-
var source_default = chalk;
|
|
504
106
|
|
|
505
107
|
// node_modules/@commitlint/format/lib/format.js
|
|
108
|
+
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
506
109
|
var DEFAULT_SIGNS = [" ", "\u26A0", "\u2716"];
|
|
507
110
|
var DEFAULT_COLORS = ["white", "yellow", "red"];
|
|
508
111
|
function format(report = {}, options = {}) {
|
|
@@ -518,8 +121,8 @@ function formatInput(result, options = {}) {
|
|
|
518
121
|
return [""];
|
|
519
122
|
}
|
|
520
123
|
const sign = "\u29D7";
|
|
521
|
-
const decoration = enabled ?
|
|
522
|
-
const decoratedInput = enabled ?
|
|
124
|
+
const decoration = enabled ? import_picocolors.default.gray(sign) : sign;
|
|
125
|
+
const decoratedInput = enabled ? import_picocolors.default.bold(input) : input;
|
|
523
126
|
const hasProblems = errors.length > 0 || warnings.length > 0;
|
|
524
127
|
return options.verbose || hasProblems ? [`${decoration} input: ${decoratedInput}`] : [];
|
|
525
128
|
}
|
|
@@ -528,19 +131,20 @@ function formatResult(result = {}, options = {}) {
|
|
|
528
131
|
const { errors = [], warnings = [] } = result;
|
|
529
132
|
const problems = [...errors, ...warnings].map((problem) => {
|
|
530
133
|
const sign2 = signs[problem.level] || "";
|
|
531
|
-
const
|
|
532
|
-
const
|
|
533
|
-
const
|
|
134
|
+
const colorName2 = colors[problem.level] || "white";
|
|
135
|
+
const colorFn = import_picocolors.default[colorName2];
|
|
136
|
+
const decoration = enabled ? colorFn(sign2) : sign2;
|
|
137
|
+
const name = enabled ? import_picocolors.default.gray(`[${problem.name}]`) : `[${problem.name}]`;
|
|
534
138
|
return `${decoration} ${problem.message} ${name}`;
|
|
535
139
|
});
|
|
536
140
|
const sign = selectSign(result);
|
|
537
|
-
const
|
|
538
|
-
const deco = enabled ?
|
|
141
|
+
const colorName = selectColor(result);
|
|
142
|
+
const deco = enabled ? import_picocolors.default[colorName](sign) : sign;
|
|
539
143
|
const el = errors.length;
|
|
540
144
|
const wl = warnings.length;
|
|
541
145
|
const hasProblems = problems.length > 0;
|
|
542
146
|
const summary = options.verbose || hasProblems ? `${deco} found ${el} problems, ${wl} warnings` : void 0;
|
|
543
|
-
const fmtSummary = enabled && typeof summary === "string" ?
|
|
147
|
+
const fmtSummary = enabled && typeof summary === "string" ? import_picocolors.default.bold(summary) : summary;
|
|
544
148
|
const help = hasProblems && options.helpUrl ? `\u24D8 Get help: ${options.helpUrl}` : void 0;
|
|
545
149
|
return [
|
|
546
150
|
...problems,
|