@commitlint/load 13.2.0 → 15.0.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/CHANGELOG.md +47 -0
- package/lib/load.d.ts.map +1 -1
- package/lib/load.js +35 -43
- package/lib/load.js.map +1 -1
- package/lib/utils/load-config.d.ts.map +1 -1
- package/lib/utils/load-config.js +7 -2
- package/lib/utils/load-config.js.map +1 -1
- package/lib/utils/load-parser-opts.d.ts +2 -1
- package/lib/utils/load-parser-opts.d.ts.map +1 -1
- package/lib/utils/load-parser-opts.js +31 -19
- package/lib/utils/load-parser-opts.js.map +1 -1
- package/lib/utils/pick-config.d.ts +1 -2
- package/lib/utils/pick-config.d.ts.map +1 -1
- package/lib/utils/pick-config.js.map +1 -1
- package/package.json +13 -11
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,53 @@
|
|
|
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
|
+
# [15.0.0](https://github.com/conventional-changelog/commitlint/compare/v14.2.0...v15.0.0) (2021-11-17)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **types:** fix signature of QualifiedRuleConfig for async configurations ([#2868](https://github.com/conventional-changelog/commitlint/issues/2868)) ([#2869](https://github.com/conventional-changelog/commitlint/issues/2869)) ([c7f355b](https://github.com/conventional-changelog/commitlint/commit/c7f355b25e5baddab0b9559892f5ce4112e4f93a))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* simplify config resolution ([#2398](https://github.com/conventional-changelog/commitlint/issues/2398)) ([8a8384f](https://github.com/conventional-changelog/commitlint/commit/8a8384f3c18954447cb633e76a573e1db71a1440)), closes [#327](https://github.com/conventional-changelog/commitlint/issues/327)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [14.1.0](https://github.com/conventional-changelog/commitlint/compare/v14.0.0...v14.1.0) (2021-11-01)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* extend helpUrl from shareable config ([#2846](https://github.com/conventional-changelog/commitlint/issues/2846)) ([d7e2e2b](https://github.com/conventional-changelog/commitlint/commit/d7e2e2b943be383f99f4000b6b6bed0eab03bfcf))
|
|
28
|
+
* **load:** add support for `.commitlintrc.cjs` and `commitlint.config.cjs` files ([#2797](https://github.com/conventional-changelog/commitlint/issues/2797)) ([fabb495](https://github.com/conventional-changelog/commitlint/commit/fabb49509730609276ff9ef6357536c95a1f6bb1))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
# [14.0.0](https://github.com/conventional-changelog/commitlint/compare/v13.2.1...v14.0.0) (2021-10-26)
|
|
35
|
+
|
|
36
|
+
**Note:** Version bump only for package @commitlint/load
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
## [13.2.1](https://github.com/conventional-changelog/commitlint/compare/v13.2.0...v13.2.1) (2021-10-09)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### Bug Fixes
|
|
46
|
+
|
|
47
|
+
* **load:** added a direct dependency on typescript ([#2785](https://github.com/conventional-changelog/commitlint/issues/2785)) ([9c17f8d](https://github.com/conventional-changelog/commitlint/commit/9c17f8d423404b484f72df41358a18bd90014ecd)), closes [EndemolShineGroup/cosmiconfig-typescript-loader#147](https://github.com/EndemolShineGroup/cosmiconfig-typescript-loader/issues/147) [#2779](https://github.com/conventional-changelog/commitlint/issues/2779)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
6
53
|
# [13.2.0](https://github.com/conventional-changelog/commitlint/compare/v13.1.0...v13.2.0) (2021-09-28)
|
|
7
54
|
|
|
8
55
|
|
package/lib/load.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../src/load.ts"],"names":[],"mappings":"AAEA,OAAO,EACN,WAAW,
|
|
1
|
+
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../src/load.ts"],"names":[],"mappings":"AAEA,OAAO,EACN,WAAW,EACX,eAAe,EAGf,UAAU,EACV,MAAM,mBAAmB,CAAC;AAW3B,wBAA8B,IAAI,CACjC,IAAI,GAAE,UAAe,EACrB,OAAO,GAAE,WAAgB,GACvB,OAAO,CAAC,eAAe,CAAC,CA6F1B"}
|
package/lib/load.js
CHANGED
|
@@ -7,16 +7,13 @@ const execute_rule_1 = __importDefault(require("@commitlint/execute-rule"));
|
|
|
7
7
|
const resolve_extends_1 = __importDefault(require("@commitlint/resolve-extends"));
|
|
8
8
|
const isPlainObject_1 = __importDefault(require("lodash/isPlainObject"));
|
|
9
9
|
const merge_1 = __importDefault(require("lodash/merge"));
|
|
10
|
-
const
|
|
11
|
-
const pick_1 = __importDefault(require("lodash/pick"));
|
|
12
|
-
const union_1 = __importDefault(require("lodash/union"));
|
|
10
|
+
const uniq_1 = __importDefault(require("lodash/uniq"));
|
|
13
11
|
const path_1 = __importDefault(require("path"));
|
|
14
12
|
const resolve_from_1 = __importDefault(require("resolve-from"));
|
|
15
13
|
const load_config_1 = require("./utils/load-config");
|
|
16
14
|
const load_parser_opts_1 = require("./utils/load-parser-opts");
|
|
17
15
|
const load_plugin_1 = __importDefault(require("./utils/load-plugin"));
|
|
18
16
|
const pick_config_1 = require("./utils/pick-config");
|
|
19
|
-
const w = (_, b) => Array.isArray(b) ? b : undefined;
|
|
20
17
|
async function load(seed = {}, options = {}) {
|
|
21
18
|
const cwd = typeof options.cwd === 'undefined' ? process.cwd() : options.cwd;
|
|
22
19
|
const loaded = await (0, load_config_1.loadConfig)(cwd, options.file);
|
|
@@ -24,8 +21,11 @@ async function load(seed = {}, options = {}) {
|
|
|
24
21
|
// TODO: validate loaded.config against UserConfig type
|
|
25
22
|
// Might amount to breaking changes, defer until 9.0.0
|
|
26
23
|
// Merge passed config with file based options
|
|
27
|
-
const config = (0, pick_config_1.pickConfig)((0, merge_1.default)({
|
|
28
|
-
|
|
24
|
+
const config = (0, pick_config_1.pickConfig)((0, merge_1.default)({
|
|
25
|
+
extends: [],
|
|
26
|
+
plugins: [],
|
|
27
|
+
rules: {},
|
|
28
|
+
}, loaded ? loaded.config : null, seed));
|
|
29
29
|
// Resolve parserPreset key
|
|
30
30
|
if (typeof config.parserPreset === 'string') {
|
|
31
31
|
const resolvedParserPreset = (0, resolve_from_1.default)(base, config.parserPreset);
|
|
@@ -36,60 +36,52 @@ async function load(seed = {}, options = {}) {
|
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
// Resolve extends key
|
|
39
|
-
const extended = (0, resolve_extends_1.default)(
|
|
39
|
+
const extended = (0, resolve_extends_1.default)(config, {
|
|
40
40
|
prefix: 'commitlint-config',
|
|
41
41
|
cwd: base,
|
|
42
42
|
parserPreset: config.parserPreset,
|
|
43
43
|
});
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
// TODO: check if this is still necessary with the new factory based conventional changelog parsers
|
|
47
|
-
// config.extends = Array.isArray(config.extends) ? config.extends : [];
|
|
48
|
-
// Resolve parser-opts from preset
|
|
49
|
-
if (typeof preset.parserPreset === 'object') {
|
|
50
|
-
preset.parserPreset.parserOpts = await (0, load_parser_opts_1.loadParserOpts)(preset.parserPreset.name,
|
|
51
|
-
// TODO: fix the types for factory based conventional changelog parsers
|
|
52
|
-
preset.parserPreset);
|
|
44
|
+
if (!extended.formatter || typeof extended.formatter !== 'string') {
|
|
45
|
+
extended.formatter = '@commitlint/format';
|
|
53
46
|
}
|
|
54
|
-
|
|
55
|
-
if (typeof config.formatter === 'string') {
|
|
56
|
-
preset.formatter =
|
|
57
|
-
resolve_from_1.default.silent(base, config.formatter) || config.formatter;
|
|
58
|
-
}
|
|
59
|
-
// Read plugins from extends
|
|
47
|
+
let plugins = {};
|
|
60
48
|
if (Array.isArray(extended.plugins)) {
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
// resolve plugins
|
|
64
|
-
if (Array.isArray(config.plugins)) {
|
|
65
|
-
config.plugins.forEach((plugin) => {
|
|
49
|
+
(0, uniq_1.default)(extended.plugins || []).forEach((plugin) => {
|
|
66
50
|
if (typeof plugin === 'string') {
|
|
67
|
-
(0, load_plugin_1.default)(
|
|
51
|
+
plugins = (0, load_plugin_1.default)(plugins, plugin, process.env.DEBUG === 'true');
|
|
68
52
|
}
|
|
69
53
|
else {
|
|
70
|
-
|
|
54
|
+
plugins.local = plugin;
|
|
71
55
|
}
|
|
72
56
|
});
|
|
73
57
|
}
|
|
74
|
-
const rules =
|
|
75
|
-
|
|
58
|
+
const rules = (await Promise.all(Object.entries(extended.rules || {}).map((entry) => (0, execute_rule_1.default)(entry)))).reduce((registry, item) => {
|
|
59
|
+
// type of `item` can be null, but Object.entries always returns key pair
|
|
76
60
|
const [key, value] = item;
|
|
77
61
|
registry[key] = value;
|
|
78
62
|
return registry;
|
|
79
63
|
}, {});
|
|
80
|
-
const helpUrl = typeof
|
|
81
|
-
?
|
|
82
|
-
:
|
|
83
|
-
|
|
64
|
+
const helpUrl = typeof extended.helpUrl === 'string'
|
|
65
|
+
? extended.helpUrl
|
|
66
|
+
: typeof config.helpUrl === 'string'
|
|
67
|
+
? config.helpUrl
|
|
68
|
+
: 'https://github.com/conventional-changelog/commitlint/#what-is-commitlint';
|
|
69
|
+
const prompt = extended.prompt && (0, isPlainObject_1.default)(extended.prompt) ? extended.prompt : {};
|
|
84
70
|
return {
|
|
85
|
-
extends:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
71
|
+
extends: Array.isArray(extended.extends)
|
|
72
|
+
? extended.extends
|
|
73
|
+
: typeof extended.extends === 'string'
|
|
74
|
+
? [extended.extends]
|
|
75
|
+
: [],
|
|
76
|
+
// Resolve config-relative formatter module
|
|
77
|
+
formatter: resolve_from_1.default.silent(base, extended.formatter) || extended.formatter,
|
|
78
|
+
// Resolve parser-opts from preset
|
|
79
|
+
parserPreset: await (0, load_parser_opts_1.loadParserOpts)(extended.parserPreset),
|
|
80
|
+
ignores: extended.ignores,
|
|
81
|
+
defaultIgnores: extended.defaultIgnores,
|
|
82
|
+
plugins: plugins,
|
|
83
|
+
rules: rules,
|
|
84
|
+
helpUrl: helpUrl,
|
|
93
85
|
prompt,
|
|
94
86
|
};
|
|
95
87
|
}
|
package/lib/load.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load.js","sourceRoot":"","sources":["../src/load.ts"],"names":[],"mappings":";;;;;AAAA,4EAAmD;AACnD,kFAAyD;
|
|
1
|
+
{"version":3,"file":"load.js","sourceRoot":"","sources":["../src/load.ts"],"names":[],"mappings":";;;;;AAAA,4EAAmD;AACnD,kFAAyD;AAQzD,yEAAiD;AACjD,yDAAiC;AACjC,uDAA+B;AAC/B,gDAAwB;AACxB,gEAAuC;AACvC,qDAA+C;AAC/C,+DAAwD;AACxD,sEAA6C;AAC7C,qDAA+C;AAEhC,KAAK,UAAU,IAAI,CACjC,OAAmB,EAAE,EACrB,UAAuB,EAAE;IAEzB,MAAM,GAAG,GAAG,OAAO,OAAO,CAAC,GAAG,KAAK,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC;IAC7E,MAAM,MAAM,GAAG,MAAM,IAAA,wBAAU,EAAC,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,MAAM,IAAI,GAAG,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IAE7E,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L,2CAA2C;QAC3C,SAAS,EACR,sBAAW,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,SAAS,CAAC,IAAI,QAAQ,CAAC,SAAS;QACnE,kCAAkC;QAClC,YAAY,EAAE,MAAM,IAAA,iCAAc,EAAC,QAAQ,CAAC,YAAY,CAAC;QACzD,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,cAAc,EAAE,QAAQ,CAAC,cAAc;QACvC,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,KAAK;QACZ,OAAO,EAAE,OAAO;QAChB,MAAM;KACN,CAAC;AACH,CAAC;AAhGD,uBAgGC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-config.d.ts","sourceRoot":"","sources":["../../src/utils/load-config.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,gBAAgB;IAChC,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAsB,UAAU,CAC/B,GAAG,EAAE,MAAM,EACX,UAAU,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"load-config.d.ts","sourceRoot":"","sources":["../../src/utils/load-config.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,gBAAgB;IAChC,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAsB,UAAU,CAC/B,GAAG,EAAE,MAAM,EACX,UAAU,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAmClC"}
|
package/lib/utils/load-config.js
CHANGED
|
@@ -11,15 +11,20 @@ async function loadConfig(cwd, configPath) {
|
|
|
11
11
|
const moduleName = 'commitlint';
|
|
12
12
|
const explorer = (0, cosmiconfig_1.cosmiconfig)(moduleName, {
|
|
13
13
|
searchPlaces: [
|
|
14
|
+
// cosmiconfig overrides default searchPlaces if any new search place is added (For e.g. `*.ts` files),
|
|
15
|
+
// we need to manually merge default searchPlaces from https://github.com/davidtheclark/cosmiconfig#searchplaces
|
|
14
16
|
'package.json',
|
|
15
17
|
`.${moduleName}rc`,
|
|
16
18
|
`.${moduleName}rc.json`,
|
|
17
19
|
`.${moduleName}rc.yaml`,
|
|
18
20
|
`.${moduleName}rc.yml`,
|
|
19
|
-
`.${moduleName}rc.ts`,
|
|
20
21
|
`.${moduleName}rc.js`,
|
|
21
|
-
|
|
22
|
+
`.${moduleName}rc.cjs`,
|
|
22
23
|
`${moduleName}.config.js`,
|
|
24
|
+
`${moduleName}.config.cjs`,
|
|
25
|
+
// files supported by TypescriptLoader
|
|
26
|
+
`.${moduleName}rc.ts`,
|
|
27
|
+
`${moduleName}.config.ts`,
|
|
23
28
|
],
|
|
24
29
|
loaders: {
|
|
25
30
|
'.ts': cosmiconfig_typescript_loader_1.default,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-config.js","sourceRoot":"","sources":["../../src/utils/load-config.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,6CAAwC;AACxC,qHAAgF;AAQzE,KAAK,UAAU,UAAU,CAC/B,GAAW,EACX,UAAmB;IAEnB,MAAM,UAAU,GAAG,YAAY,CAAC;IAChC,MAAM,QAAQ,GAAG,IAAA,yBAAW,EAAC,UAAU,EAAE;QACxC,YAAY,EAAE;YACb,cAAc;YACd,IAAI,UAAU,IAAI;YAClB,IAAI,UAAU,SAAS;YACvB,IAAI,UAAU,SAAS;YACvB,IAAI,UAAU,QAAQ;YACtB,IAAI,UAAU,OAAO;YACrB,IAAI,UAAU,
|
|
1
|
+
{"version":3,"file":"load-config.js","sourceRoot":"","sources":["../../src/utils/load-config.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,6CAAwC;AACxC,qHAAgF;AAQzE,KAAK,UAAU,UAAU,CAC/B,GAAW,EACX,UAAmB;IAEnB,MAAM,UAAU,GAAG,YAAY,CAAC;IAChC,MAAM,QAAQ,GAAG,IAAA,yBAAW,EAAC,UAAU,EAAE;QACxC,YAAY,EAAE;YACb,uGAAuG;YACvG,gHAAgH;YAChH,cAAc;YACd,IAAI,UAAU,IAAI;YAClB,IAAI,UAAU,SAAS;YACvB,IAAI,UAAU,SAAS;YACvB,IAAI,UAAU,QAAQ;YACtB,IAAI,UAAU,OAAO;YACrB,IAAI,UAAU,QAAQ;YACtB,GAAG,UAAU,YAAY;YACzB,GAAG,UAAU,aAAa;YAE1B,sCAAsC;YACtC,IAAI,UAAU,OAAO;YACrB,GAAG,UAAU,YAAY;SACzB;QACD,OAAO,EAAE;YACR,KAAK,EAAE,uCAAgB;SACvB;KACD,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,UAAU,CAAC,CAAC,CAAC,cAAI,CAAC,OAAO,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC5E,MAAM,OAAO,GAAG,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC;IAC/D,MAAM,UAAU,GAAG,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC;IACrD,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;IAExC,IAAI,KAAK,EAAE;QACV,OAAO,KAAK,CAAC;KACb;IAED,OAAO,IAAI,CAAC;AACb,CAAC;AAtCD,gCAsCC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import { ParserPreset } from '@commitlint/types';
|
|
2
|
+
export declare function loadParserOpts(pendingParser: string | ParserPreset | Promise<ParserPreset> | undefined): Promise<ParserPreset | undefined>;
|
|
2
3
|
//# sourceMappingURL=load-parser-opts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-parser-opts.d.ts","sourceRoot":"","sources":["../../src/utils/load-parser-opts.ts"],"names":[],"mappings":"AAAA,wBAAsB,cAAc,CACnC,
|
|
1
|
+
{"version":3,"file":"load-parser-opts.d.ts","sourceRoot":"","sources":["../../src/utils/load-parser-opts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAc/C,wBAAsB,cAAc,CACnC,aAAa,EAAE,MAAM,GAAG,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,GAAG,SAAS,GACtE,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAsDnC"}
|
|
@@ -1,39 +1,51 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.loadParserOpts = void 0;
|
|
4
|
-
|
|
4
|
+
function isObjectLike(obj) {
|
|
5
|
+
return Boolean(obj) && typeof obj === 'object'; // typeof null === 'object'
|
|
6
|
+
}
|
|
7
|
+
function isParserOptsFunction(obj) {
|
|
8
|
+
return typeof obj.parserOpts === 'function';
|
|
9
|
+
}
|
|
10
|
+
async function loadParserOpts(pendingParser) {
|
|
11
|
+
if (!pendingParser || typeof pendingParser !== 'object') {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
5
14
|
// Await for the module, loaded with require
|
|
6
15
|
const parser = await pendingParser;
|
|
7
|
-
//
|
|
8
|
-
if (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
16
|
+
// exit early, no opts to resolve
|
|
17
|
+
if (!parser.parserOpts) {
|
|
18
|
+
return parser;
|
|
19
|
+
}
|
|
20
|
+
// Pull nested parserOpts, might happen if overwritten with a module in main config
|
|
21
|
+
if (typeof parser.parserOpts === 'object') {
|
|
22
|
+
// Await parser opts if applicable
|
|
23
|
+
parser.parserOpts = await parser.parserOpts;
|
|
24
|
+
if (isObjectLike(parser.parserOpts) &&
|
|
25
|
+
isObjectLike(parser.parserOpts.parserOpts)) {
|
|
26
|
+
parser.parserOpts = parser.parserOpts.parserOpts;
|
|
27
|
+
}
|
|
28
|
+
return parser;
|
|
12
29
|
}
|
|
13
30
|
// Create parser opts from factory
|
|
14
|
-
if (
|
|
15
|
-
typeof parser.
|
|
16
|
-
|
|
17
|
-
return
|
|
31
|
+
if (isParserOptsFunction(parser) &&
|
|
32
|
+
typeof parser.name === 'string' &&
|
|
33
|
+
parser.name.startsWith('conventional-changelog-')) {
|
|
34
|
+
return new Promise((resolve) => {
|
|
18
35
|
const result = parser.parserOpts((_, opts) => {
|
|
19
|
-
resolve(opts.parserOpts);
|
|
36
|
+
resolve(Object.assign(Object.assign({}, parser), { parserOpts: opts === null || opts === void 0 ? void 0 : opts.parserOpts }));
|
|
20
37
|
});
|
|
21
38
|
// If result has data or a promise, the parser doesn't support factory-init
|
|
22
39
|
// due to https://github.com/nodejs/promises-debugging/issues/16 it just quits, so let's use this fallback
|
|
23
40
|
if (result) {
|
|
24
41
|
Promise.resolve(result).then((opts) => {
|
|
25
|
-
resolve(opts.parserOpts);
|
|
42
|
+
resolve(Object.assign(Object.assign({}, parser), { parserOpts: opts === null || opts === void 0 ? void 0 : opts.parserOpts }));
|
|
26
43
|
});
|
|
27
44
|
}
|
|
45
|
+
return;
|
|
28
46
|
});
|
|
29
47
|
}
|
|
30
|
-
|
|
31
|
-
if (typeof parser === 'object' &&
|
|
32
|
-
typeof parser.parserOpts === 'object' &&
|
|
33
|
-
typeof parser.parserOpts.parserOpts === 'object') {
|
|
34
|
-
return parser.parserOpts.parserOpts;
|
|
35
|
-
}
|
|
36
|
-
return parser.parserOpts;
|
|
48
|
+
return parser;
|
|
37
49
|
}
|
|
38
50
|
exports.loadParserOpts = loadParserOpts;
|
|
39
51
|
//# sourceMappingURL=load-parser-opts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-parser-opts.js","sourceRoot":"","sources":["../../src/utils/load-parser-opts.ts"],"names":[],"m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E,IAAS,EAAE,EAAE;gBACxD,OAAO,iCACH,MAAM,KACT,UAAU,EAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,UAAU,IAC3B,CAAC;YACJ,CAAC,CAAC,CAAC;YAEH,2EAA2E;YAC3E,0GAA0G;YAC1G,IAAI,MAAM,EAAE;gBACX,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;oBACrC,OAAO,iCACH,MAAM,KACT,UAAU,EAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,UAAU,IAC3B,CAAC;gBACJ,CAAC,CAAC,CAAC;aACH;YACD,OAAO;QACR,CAAC,CAAC,CAAC;KACH;IAED,OAAO,MAAM,CAAC;AACf,CAAC;AAxDD,wCAwDC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pick-config.d.ts","sourceRoot":"","sources":["../../src/utils/pick-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pick-config.d.ts","sourceRoot":"","sources":["../../src/utils/pick-config.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,UAAW,OAAO,KAAG,OAAO,MAAM,EAAE,OAAO,CAYhE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pick-config.js","sourceRoot":"","sources":["../../src/utils/pick-config.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"pick-config.js","sourceRoot":"","sources":["../../src/utils/pick-config.ts"],"names":[],"mappings":";;;;;;AAAA,uDAA+B;AAExB,MAAM,UAAU,GAAG,CAAC,KAAc,EAA2B,EAAE,CACrE,IAAA,cAAI,EACH,KAAK,EACL,SAAS,EACT,OAAO,EACP,SAAS,EACT,cAAc,EACd,WAAW,EACX,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,QAAQ,CACR,CAAC;AAZU,QAAA,UAAU,cAYpB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commitlint/load",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.0.0",
|
|
4
4
|
"description": "Load shared commitlint configuration",
|
|
5
5
|
"main": "lib/load.js",
|
|
6
6
|
"types": "lib/load.d.ts",
|
|
@@ -16,12 +16,13 @@
|
|
|
16
16
|
},
|
|
17
17
|
"repository": {
|
|
18
18
|
"type": "git",
|
|
19
|
-
"url": "https://github.com/conventional-changelog/commitlint.git"
|
|
19
|
+
"url": "https://github.com/conventional-changelog/commitlint.git",
|
|
20
|
+
"directory": "@commitlint/load"
|
|
20
21
|
},
|
|
21
22
|
"bugs": {
|
|
22
23
|
"url": "https://github.com/conventional-changelog/commitlint/issues"
|
|
23
24
|
},
|
|
24
|
-
"homepage": "https://
|
|
25
|
+
"homepage": "https://commitlint.js.org/",
|
|
25
26
|
"keywords": [
|
|
26
27
|
"conventional-changelog",
|
|
27
28
|
"commitlint",
|
|
@@ -34,21 +35,22 @@
|
|
|
34
35
|
},
|
|
35
36
|
"license": "MIT",
|
|
36
37
|
"devDependencies": {
|
|
37
|
-
"@commitlint/test": "^
|
|
38
|
-
"@commitlint/utils": "^
|
|
39
|
-
"@types/lodash": "4.14.
|
|
38
|
+
"@commitlint/test": "^15.0.0",
|
|
39
|
+
"@commitlint/utils": "^15.0.0",
|
|
40
|
+
"@types/lodash": "4.14.177",
|
|
40
41
|
"conventional-changelog-atom": "^2.0.8",
|
|
41
42
|
"execa": "^5.0.0"
|
|
42
43
|
},
|
|
43
44
|
"dependencies": {
|
|
44
|
-
"@commitlint/execute-rule": "^
|
|
45
|
-
"@commitlint/resolve-extends": "^
|
|
46
|
-
"@commitlint/types": "^
|
|
45
|
+
"@commitlint/execute-rule": "^15.0.0",
|
|
46
|
+
"@commitlint/resolve-extends": "^15.0.0",
|
|
47
|
+
"@commitlint/types": "^15.0.0",
|
|
47
48
|
"@endemolshinegroup/cosmiconfig-typescript-loader": "^3.0.2",
|
|
48
49
|
"chalk": "^4.0.0",
|
|
49
50
|
"cosmiconfig": "^7.0.0",
|
|
50
51
|
"lodash": "^4.17.19",
|
|
51
|
-
"resolve-from": "^5.0.0"
|
|
52
|
+
"resolve-from": "^5.0.0",
|
|
53
|
+
"typescript": "^4.4.3"
|
|
52
54
|
},
|
|
53
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "399a0289356c670a87524387cc96d8fb0a33fdca"
|
|
54
56
|
}
|