@commitlint/format 21.0.0 → 21.0.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/lib/format.d.ts.map +1 -1
- package/lib/format.js +8 -8
- package/lib/format.js.map +1 -1
- package/package.json +29 -29
package/lib/format.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AACA,OAAO,EAEN,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EAEjB,MAAM,mBAAmB,CAAC;AAS3B,wBAAgB,MAAM,
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AACA,OAAO,EAEN,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EAEjB,MAAM,mBAAmB,CAAC;AAS3B,wBAAgB,MAAM,CAAC,MAAM,GAAE,iBAAsB,EAAE,OAAO,GAAE,aAAkB,GAAG,MAAM,CAU1F;AA4BD,wBAAgB,YAAY,CAC3B,MAAM,GAAE,iBAAsB,EAC9B,OAAO,GAAE,aAAkB,GACzB,MAAM,EAAE,CAmCV;AAED,eAAe,MAAM,CAAC"}
|
package/lib/format.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import pc from "picocolors";
|
|
2
2
|
const DEFAULT_SIGNS = [" ", "⚠", "✖"];
|
|
3
|
-
const DEFAULT_COLORS = [
|
|
3
|
+
const DEFAULT_COLORS = [
|
|
4
|
+
"white",
|
|
5
|
+
"yellow",
|
|
6
|
+
"red",
|
|
7
|
+
];
|
|
4
8
|
export function format(report = {}, options = {}) {
|
|
5
9
|
const { results = [] } = report;
|
|
6
10
|
const fi = (result) => formatInput(result, options);
|
|
@@ -31,7 +35,7 @@ function formatInput(result, options = {}) {
|
|
|
31
35
|
return [`${decoration} --- input ---\n${decoratedInput}`];
|
|
32
36
|
}
|
|
33
37
|
export function formatResult(result = {}, options = {}) {
|
|
34
|
-
const { signs = DEFAULT_SIGNS, colors = DEFAULT_COLORS, color: enabled = true
|
|
38
|
+
const { signs = DEFAULT_SIGNS, colors = DEFAULT_COLORS, color: enabled = true } = options;
|
|
35
39
|
const { errors = [], warnings = [] } = result;
|
|
36
40
|
const problems = [...errors, ...warnings].map((problem) => {
|
|
37
41
|
const sign = signs[problem.level] || "";
|
|
@@ -47,13 +51,9 @@ export function formatResult(result = {}, options = {}) {
|
|
|
47
51
|
const el = errors.length;
|
|
48
52
|
const wl = warnings.length;
|
|
49
53
|
const hasProblems = problems.length > 0;
|
|
50
|
-
const summary = options.verbose || hasProblems
|
|
51
|
-
? `${deco} found ${el} problems, ${wl} warnings`
|
|
52
|
-
: undefined;
|
|
54
|
+
const summary = options.verbose || hasProblems ? `${deco} found ${el} problems, ${wl} warnings` : undefined;
|
|
53
55
|
const fmtSummary = enabled && typeof summary === "string" ? pc.bold(summary) : summary;
|
|
54
|
-
const help = hasProblems && options.helpUrl
|
|
55
|
-
? `ⓘ Get help: ${options.helpUrl}`
|
|
56
|
-
: undefined;
|
|
56
|
+
const help = hasProblems && options.helpUrl ? `ⓘ Get help: ${options.helpUrl}` : undefined;
|
|
57
57
|
return [
|
|
58
58
|
...problems,
|
|
59
59
|
hasProblems ? "" : undefined,
|
package/lib/format.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.js","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAS5B,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAU,CAAC;AAC/C,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAS5B,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAU,CAAC;AAC/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|
6
|
+
"keywords": [
|
|
7
|
+
"commitlint",
|
|
8
|
+
"conventional-changelog",
|
|
9
|
+
"core",
|
|
10
|
+
"library"
|
|
10
11
|
],
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
"
|
|
12
|
+
"homepage": "https://commitlint.js.org/",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/conventional-changelog/commitlint/issues"
|
|
14
15
|
},
|
|
15
|
-
"
|
|
16
|
-
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"author": {
|
|
18
|
+
"name": "Mario Nebl",
|
|
19
|
+
"email": "hello@herebecode.com"
|
|
17
20
|
},
|
|
18
21
|
"repository": {
|
|
19
22
|
"type": "git",
|
|
20
23
|
"url": "https://github.com/conventional-changelog/commitlint.git",
|
|
21
24
|
"directory": "@commitlint/format"
|
|
22
25
|
},
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
},
|
|
26
|
-
"homepage": "https://commitlint.js.org/",
|
|
27
|
-
"keywords": [
|
|
28
|
-
"conventional-changelog",
|
|
29
|
-
"commitlint",
|
|
30
|
-
"library",
|
|
31
|
-
"core"
|
|
26
|
+
"files": [
|
|
27
|
+
"lib/"
|
|
32
28
|
],
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"@commitlint/utils": "^21.0.0"
|
|
29
|
+
"type": "module",
|
|
30
|
+
"main": "lib/index.js",
|
|
31
|
+
"types": "lib/index.d.ts",
|
|
32
|
+
"scripts": {
|
|
33
|
+
"deps": "dep-check",
|
|
34
|
+
"pkg": "pkg-check --skip-import"
|
|
40
35
|
},
|
|
41
36
|
"dependencies": {
|
|
42
|
-
"@commitlint/types": "^21.0.
|
|
37
|
+
"@commitlint/types": "^21.0.1",
|
|
43
38
|
"picocolors": "^1.1.1"
|
|
44
39
|
},
|
|
45
|
-
"
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@commitlint/utils": "^21.0.1"
|
|
42
|
+
},
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">=22.12.0"
|
|
45
|
+
}
|
|
46
46
|
}
|