@commitlint/format 9.1.2 → 12.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/CHANGELOG.md +49 -0
- package/README.md +9 -9
- package/lib/format.js +6 -5
- package/lib/format.js.map +1 -1
- package/lib/index.js +16 -5
- package/lib/index.js.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,55 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [12.0.1](https://github.com/conventional-changelog/commitlint/compare/v12.0.0...v12.0.1) (2021-02-23)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **types:** correct chalkColor type ([#2420](https://github.com/conventional-changelog/commitlint/issues/2420)) ([ef8bdad](https://github.com/conventional-changelog/commitlint/commit/ef8bdad96c9ee7c3ad67f8280818c7f49c1df1fe))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [12.0.0](https://github.com/conventional-changelog/commitlint/compare/v11.0.0...v12.0.0) (2021-01-18)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @commitlint/format
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# [11.0.0](https://github.com/conventional-changelog/commitlint/compare/v10.0.0...v11.0.0) (2020-09-05)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package @commitlint/format
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# [10.0.0](https://github.com/conventional-changelog/commitlint/compare/v9.1.2...v10.0.0) (2020-08-16)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
* refactor!: drop support for node 8 (#1999) ([751f39f](https://github.com/conventional-changelog/commitlint/commit/751f39f284ef232574a176c3c11b1982ee544166)), closes [#1999](https://github.com/conventional-changelog/commitlint/issues/1999)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### BREAKING CHANGES
|
|
40
|
+
|
|
41
|
+
* remove node 8 from circle-ci checks
|
|
42
|
+
|
|
43
|
+
also remove node 13 because we do not support experimental versions
|
|
44
|
+
|
|
45
|
+
* docs: update node v10 to latest LTS 10 version
|
|
46
|
+
|
|
47
|
+
Co-authored-by: Cedric van Putten <me@bycedric.com>
|
|
48
|
+
|
|
49
|
+
Co-authored-by: Cedric van Putten <me@bycedric.com>
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
6
55
|
## [9.1.2](https://github.com/conventional-changelog/commitlint/compare/v9.1.1...v9.1.2) (2020-07-13)
|
|
7
56
|
|
|
8
57
|
**Note:** Version bump only for package @commitlint/format
|
package/README.md
CHANGED
|
@@ -27,28 +27,28 @@ const output = format(
|
|
|
27
27
|
valid: false,
|
|
28
28
|
level: 2,
|
|
29
29
|
name: 'some-error',
|
|
30
|
-
message: 'This will show up red as it has level 2'
|
|
31
|
-
}
|
|
30
|
+
message: 'This will show up red as it has level 2',
|
|
31
|
+
},
|
|
32
32
|
],
|
|
33
33
|
warnings: [
|
|
34
34
|
{
|
|
35
35
|
valid: true,
|
|
36
36
|
level: 0,
|
|
37
37
|
name: 'some-hint',
|
|
38
|
-
message: 'This will not show up as it has level 0'
|
|
38
|
+
message: 'This will not show up as it has level 0',
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
valid: false,
|
|
42
42
|
level: 1,
|
|
43
43
|
name: 'some-warning',
|
|
44
|
-
message: 'This will show up yellow as it has level 1'
|
|
45
|
-
}
|
|
46
|
-
]
|
|
47
|
-
}
|
|
48
|
-
]
|
|
44
|
+
message: 'This will show up yellow as it has level 1',
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
|
-
color: false
|
|
51
|
+
color: false,
|
|
52
52
|
}
|
|
53
53
|
);
|
|
54
54
|
|
package/lib/format.js
CHANGED
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.formatResult = exports.format = void 0;
|
|
6
7
|
const chalk_1 = __importDefault(require("chalk"));
|
|
7
8
|
const DEFAULT_SIGNS = [' ', '⚠', '✖'];
|
|
8
9
|
const DEFAULT_COLORS = ['white', 'yellow', 'red'];
|
|
@@ -11,8 +12,8 @@ function format(report = {}, options = {}) {
|
|
|
11
12
|
const fi = (result) => formatInput(result, options);
|
|
12
13
|
const fr = (result) => formatResult(result, options);
|
|
13
14
|
return results
|
|
14
|
-
.filter(r => Array.isArray(r.warnings) || Array.isArray(r.errors))
|
|
15
|
-
.map(result => [...fi(result), ...fr(result)])
|
|
15
|
+
.filter((r) => Array.isArray(r.warnings) || Array.isArray(r.errors))
|
|
16
|
+
.map((result) => [...fi(result), ...fr(result)])
|
|
16
17
|
.reduce((acc, item) => (Array.isArray(item) ? [...acc, ...item] : [...acc, item]), [])
|
|
17
18
|
.join('\n');
|
|
18
19
|
}
|
|
@@ -33,9 +34,9 @@ function formatInput(result, options = {}) {
|
|
|
33
34
|
: [];
|
|
34
35
|
}
|
|
35
36
|
function formatResult(result = {}, options = {}) {
|
|
36
|
-
const { signs = DEFAULT_SIGNS, colors = DEFAULT_COLORS, color: enabled = true } = options;
|
|
37
|
+
const { signs = DEFAULT_SIGNS, colors = DEFAULT_COLORS, color: enabled = true, } = options;
|
|
37
38
|
const { errors = [], warnings = [] } = result;
|
|
38
|
-
const problems = [...errors, ...warnings].map(problem => {
|
|
39
|
+
const problems = [...errors, ...warnings].map((problem) => {
|
|
39
40
|
const sign = signs[problem.level] || '';
|
|
40
41
|
const color = colors[problem.level] || 'white';
|
|
41
42
|
const decoration = enabled ? chalk_1.default[color](sign) : sign;
|
|
@@ -60,7 +61,7 @@ function formatResult(result = {}, options = {}) {
|
|
|
60
61
|
hasProblems ? '' : undefined,
|
|
61
62
|
fmtSummary,
|
|
62
63
|
help,
|
|
63
|
-
help ? '' : undefined
|
|
64
|
+
help ? '' : undefined,
|
|
64
65
|
].filter((line) => typeof line === 'string');
|
|
65
66
|
}
|
|
66
67
|
exports.formatResult = formatResult;
|
package/lib/format.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.js","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAS1B,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAU,CAAC;AAC/C,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAU,CAAC;AAE3D,SAAgB,MAAM,CACrB,SAA4B,EAAE,EAC9B,UAAyB,EAAE;IAE3B,MAAM,EAAC,OAAO,GAAG,EAAE,EAAC,GAAG,MAAM,CAAC;IAC9B,MAAM,EAAE,GAAG,CAAC,MAAqC,EAAE,EAAE,CACpD,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,MAAM,EAAE,GAAG,CAAC,MAAyB,EAAE,EAAE,CAAC,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAExE,OAAO,OAAO;SACZ,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;SACnE,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE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C,MAAM,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;QACrC,OAAO,KAAK,CAAC;KACb;IACD,OAAO,CAAC,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC;AAC5D,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
}
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
14
|
+
};
|
|
5
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.default = void 0;
|
|
6
17
|
var format_1 = require("./format");
|
|
7
|
-
exports
|
|
8
|
-
|
|
18
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(format_1).default; } });
|
|
19
|
+
__exportStar(require("./format"), exports);
|
|
9
20
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mCAAiC;AAAzB,kHAAA,OAAO,OAAA;AACf,2CAAyB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commitlint/format",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.1",
|
|
4
4
|
"description": "Format commitlint reports",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"pkg": "pkg-check --skip-import"
|
|
13
13
|
},
|
|
14
14
|
"engines": {
|
|
15
|
-
"node": ">=
|
|
15
|
+
"node": ">=v10"
|
|
16
16
|
},
|
|
17
17
|
"repository": {
|
|
18
18
|
"type": "git",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
},
|
|
35
35
|
"license": "MIT",
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@commitlint/utils": "^
|
|
37
|
+
"@commitlint/utils": "^12.0.1"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@commitlint/types": "^
|
|
40
|
+
"@commitlint/types": "^12.0.1",
|
|
41
41
|
"chalk": "^4.0.0"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "610d2911bea066c87700155de3bf5bbecf266a8d"
|
|
44
44
|
}
|