@lerna-lite/core 1.3.0 → 1.4.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/README.md +13 -12
- package/dist/child-process.d.ts +62 -62
- package/dist/child-process.js +165 -165
- package/dist/command.d.ts +37 -35
- package/dist/command.js +266 -266
- package/dist/command.js.map +1 -1
- package/dist/conventional-commits/constants.d.ts +4 -4
- package/dist/conventional-commits/constants.js +12 -12
- package/dist/conventional-commits/get-changelog-config.d.ts +12 -12
- package/dist/conventional-commits/get-changelog-config.js +98 -98
- package/dist/conventional-commits/index.d.ts +6 -6
- package/dist/conventional-commits/index.js +22 -22
- package/dist/conventional-commits/make-bump-only-filter.d.ts +6 -6
- package/dist/conventional-commits/make-bump-only-filter.js +22 -22
- package/dist/conventional-commits/read-existing-changelog.d.ts +7 -7
- package/dist/conventional-commits/read-existing-changelog.js +32 -32
- package/dist/conventional-commits/recommend-version.d.ts +11 -11
- package/dist/conventional-commits/recommend-version.js +86 -86
- package/dist/conventional-commits/update-changelog.d.ts +11 -11
- package/dist/conventional-commits/update-changelog.js +83 -83
- package/dist/git-clients/GitLabClient.d.ts +8 -8
- package/dist/git-clients/GitLabClient.js +39 -39
- package/dist/git-clients/github-client.d.ts +6 -6
- package/dist/git-clients/github-client.js +40 -40
- package/dist/git-clients/gitlab-client.d.ts +6 -6
- package/dist/git-clients/gitlab-client.js +21 -21
- package/dist/git-clients/index.d.ts +2 -2
- package/dist/git-clients/index.js +18 -18
- package/dist/index.d.ts +12 -12
- package/dist/index.js +30 -30
- package/dist/models/command-options.d.ts +206 -0
- package/dist/models/command-options.js +3 -0
- package/dist/models/command-options.js.map +1 -0
- package/dist/models/index.d.ts +2 -186
- package/dist/models/index.js +18 -2
- package/dist/models/index.js.map +1 -1
- package/dist/models/interfaces.d.ts +201 -0
- package/dist/models/interfaces.js +3 -0
- package/dist/models/interfaces.js.map +1 -0
- package/dist/otplease.d.ts +14 -14
- package/dist/otplease.js +108 -108
- package/dist/package-graph/index.d.ts +2 -2
- package/dist/package-graph/index.js +18 -18
- package/dist/package-graph/lib/cyclic-package-graph-node.d.ts +42 -42
- package/dist/package-graph/lib/cyclic-package-graph-node.js +97 -97
- package/dist/package-graph/lib/index.d.ts +3 -3
- package/dist/package-graph/lib/index.js +19 -19
- package/dist/package-graph/lib/package-graph-node.d.ts +33 -33
- package/dist/package-graph/lib/package-graph-node.js +58 -58
- package/dist/package-graph/lib/report-cycles.d.ts +1 -1
- package/dist/package-graph/lib/report-cycles.js +19 -19
- package/dist/package-graph/package-graph.d.ts +79 -79
- package/dist/package-graph/package-graph.js +276 -276
- package/dist/package.d.ts +91 -85
- package/dist/package.js +282 -276
- package/dist/package.js.map +1 -1
- package/dist/project/index.d.ts +2 -2
- package/dist/project/index.js +18 -18
- package/dist/project/lib/apply-extends.d.ts +10 -10
- package/dist/project/lib/apply-extends.js +37 -37
- package/dist/project/lib/index.d.ts +3 -3
- package/dist/project/lib/index.js +19 -19
- package/dist/project/lib/make-file-finder.d.ts +3 -3
- package/dist/project/lib/make-file-finder.js +71 -71
- package/dist/project/lib/shallow-extend.d.ts +11 -11
- package/dist/project/lib/shallow-extend.js +24 -24
- package/dist/project/project.d.ts +45 -45
- package/dist/project/project.js +195 -195
- package/dist/prompt.d.ts +23 -23
- package/dist/prompt.js +75 -75
- package/dist/utils/check-working-tree.d.ts +8 -8
- package/dist/utils/check-working-tree.js +41 -41
- package/dist/utils/clean-stack.d.ts +5 -5
- package/dist/utils/clean-stack.js +18 -18
- package/dist/utils/collect-uncommitted.d.ts +18 -18
- package/dist/utils/collect-uncommitted.js +40 -40
- package/dist/utils/collect-updates/collect-updates.d.ts +11 -11
- package/dist/utils/collect-updates/collect-updates.js +82 -82
- package/dist/utils/collect-updates/index.d.ts +2 -2
- package/dist/utils/collect-updates/index.js +18 -18
- package/dist/utils/collect-updates/lib/collect-dependents.d.ts +11 -11
- package/dist/utils/collect-updates/lib/collect-dependents.js +45 -45
- package/dist/utils/collect-updates/lib/collect-packages.d.ts +13 -13
- package/dist/utils/collect-updates/lib/collect-packages.js +33 -33
- package/dist/utils/collect-updates/lib/get-packages-for-option.d.ts +5 -5
- package/dist/utils/collect-updates/lib/get-packages-for-option.js +30 -30
- package/dist/utils/collect-updates/lib/has-tags.d.ts +5 -5
- package/dist/utils/collect-updates/lib/has-tags.js +26 -26
- package/dist/utils/collect-updates/lib/index.d.ts +5 -5
- package/dist/utils/collect-updates/lib/index.js +21 -21
- package/dist/utils/collect-updates/lib/make-diff-predicate.d.ts +7 -7
- package/dist/utils/collect-updates/lib/make-diff-predicate.js +64 -64
- package/dist/utils/conf.d.ts +25 -25
- package/dist/utils/conf.js +255 -255
- package/dist/utils/defaults.d.ts +1 -1
- package/dist/utils/defaults.js +182 -182
- package/dist/utils/defaults.js.map +1 -1
- package/dist/utils/describe-ref.d.ts +37 -37
- package/dist/utils/describe-ref.js +80 -80
- package/dist/utils/env-replace.d.ts +1 -1
- package/dist/utils/env-replace.js +22 -22
- package/dist/utils/find-prefix.d.ts +2 -2
- package/dist/utils/find-prefix.js +48 -48
- package/dist/utils/index.d.ts +23 -22
- package/dist/utils/index.js +39 -38
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/log-package-error.d.ts +5 -5
- package/dist/utils/log-package-error.js +35 -35
- package/dist/utils/nerf-dart.d.ts +1 -1
- package/dist/utils/nerf-dart.js +18 -18
- package/dist/utils/npm-conf.d.ts +4 -4
- package/dist/utils/npm-conf.js +55 -55
- package/dist/utils/output.d.ts +1 -1
- package/dist/utils/output.js +13 -13
- package/dist/utils/parse-field.d.ts +1 -1
- package/dist/utils/parse-field.js +65 -65
- package/dist/utils/prerelease-id-from-version.d.ts +5 -5
- package/dist/utils/prerelease-id-from-version.js +15 -15
- package/dist/utils/pulse-till-done.d.ts +1 -1
- package/dist/utils/pulse-till-done.js +40 -40
- package/dist/utils/query-graph.d.ts +36 -36
- package/dist/utils/query-graph.js +77 -77
- package/dist/utils/query-graph.js.map +1 -1
- package/dist/utils/run-lifecycle.d.ts +10 -10
- package/dist/utils/run-lifecycle.js +131 -107
- package/dist/utils/run-lifecycle.js.map +1 -1
- package/dist/utils/run-topologically.d.ts +12 -12
- package/dist/utils/run-topologically.js +36 -36
- package/dist/utils/temp-write.d.ts +13 -0
- package/dist/utils/temp-write.js +50 -0
- package/dist/utils/temp-write.js.map +1 -0
- package/dist/utils/types.d.ts +131 -129
- package/dist/utils/types.js +138 -138
- package/dist/utils/warn-if-hanging.d.ts +1 -1
- package/dist/utils/warn-if-hanging.js +17 -17
- package/dist/utils/write-log-file.d.ts +1 -1
- package/dist/utils/write-log-file.js +32 -32
- package/dist/validation-error.d.ts +4 -4
- package/dist/validation-error.js +18 -18
- package/package.json +14 -10
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.GetChangelogConfig = void 0;
|
|
7
|
-
const npmlog_1 = __importDefault(require("npmlog"));
|
|
8
|
-
const pify_1 = __importDefault(require("pify"));
|
|
9
|
-
const npm_package_arg_1 = __importDefault(require("npm-package-arg"));
|
|
10
|
-
const validation_error_1 = require("../validation-error");
|
|
11
|
-
class GetChangelogConfig {
|
|
12
|
-
static isFunction(config) {
|
|
13
|
-
return Object.prototype.toString.call(config) === '[object Function]';
|
|
14
|
-
}
|
|
15
|
-
static resolveConfigPromise(presetPackageName, presetConfig) {
|
|
16
|
-
npmlog_1.default.verbose('getChangelogConfig', 'Attempting to resolve preset %j', presetPackageName);
|
|
17
|
-
let config = require(presetPackageName);
|
|
18
|
-
npmlog_1.default.info('getChangelogConfig', 'Successfully resolved preset %j', presetPackageName);
|
|
19
|
-
if (this.isFunction(config)) {
|
|
20
|
-
try {
|
|
21
|
-
// try assuming config builder function first
|
|
22
|
-
config = config(presetConfig);
|
|
23
|
-
}
|
|
24
|
-
catch (_) {
|
|
25
|
-
// legacy presets export an errback function instead of Q.all()
|
|
26
|
-
config = (0, pify_1.default)(config)();
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return config;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* @param {import('..').ChangelogPresetConfig} [changelogPreset]
|
|
33
|
-
* @param {string} [rootPath]
|
|
34
|
-
*/
|
|
35
|
-
static getChangelogConfig(changelogPreset = 'conventional-changelog-angular', rootPath) {
|
|
36
|
-
const presetName = typeof changelogPreset === 'string' ? changelogPreset : changelogPreset.name;
|
|
37
|
-
const presetConfig = typeof changelogPreset === 'object' ? changelogPreset : {};
|
|
38
|
-
const cacheKey = `${presetName}${presetConfig ? JSON.stringify(presetConfig) : ''}`;
|
|
39
|
-
let config = GetChangelogConfig.cfgCache.get(cacheKey);
|
|
40
|
-
if (!config) {
|
|
41
|
-
let presetPackageName = presetName;
|
|
42
|
-
// https://github.com/npm/npm-package-arg#result-object
|
|
43
|
-
const parsed = (0, npm_package_arg_1.default)(presetPackageName, rootPath);
|
|
44
|
-
npmlog_1.default.verbose('getChangelogConfig', 'using preset %j', presetPackageName);
|
|
45
|
-
npmlog_1.default.silly('npa', parsed);
|
|
46
|
-
if (parsed.type === 'directory') {
|
|
47
|
-
if (parsed.raw[0] === '@') {
|
|
48
|
-
// npa parses scoped subpath reference as a directory
|
|
49
|
-
parsed.name = parsed.raw;
|
|
50
|
-
parsed.scope = parsed.raw.substring(0, parsed.raw.indexOf('/'));
|
|
51
|
-
// un-scoped subpath shorthand handled in first catch block
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
presetPackageName = parsed.fetchSpec;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
else if (parsed.type === 'git' && parsed.hosted && parsed.hosted.default === 'shortcut') {
|
|
58
|
-
// probably a shorthand subpath, e.g. 'foo/bar'
|
|
59
|
-
parsed.name = parsed.raw;
|
|
60
|
-
}
|
|
61
|
-
// Maybe it doesn't need an implicit 'conventional-changelog-' prefix?
|
|
62
|
-
try {
|
|
63
|
-
config = this.resolveConfigPromise(presetPackageName, presetConfig);
|
|
64
|
-
GetChangelogConfig.cfgCache.set(cacheKey, config);
|
|
65
|
-
// early exit, yay
|
|
66
|
-
return Promise.resolve(config);
|
|
67
|
-
}
|
|
68
|
-
catch (err) {
|
|
69
|
-
npmlog_1.default.verbose('getChangelogConfig', err.message);
|
|
70
|
-
npmlog_1.default.info('getChangelogConfig', 'Auto-prefixing conventional-changelog preset %j', presetName);
|
|
71
|
-
// probably a deep shorthand subpath :P
|
|
72
|
-
parsed.name = parsed.raw;
|
|
73
|
-
}
|
|
74
|
-
if (parsed.name.indexOf('conventional-changelog-') < 0) {
|
|
75
|
-
// implicit 'conventional-changelog-' prefix
|
|
76
|
-
const parts = parsed.name.split('/');
|
|
77
|
-
const start = parsed.scope ? 1 : 0;
|
|
78
|
-
// foo => conventional-changelog-foo
|
|
79
|
-
// @scope/foo => @scope/conventional-changelog-foo
|
|
80
|
-
parts.splice(start, 1, `conventional-changelog-${parts[start]}`);
|
|
81
|
-
// _technically_ supports 'foo/lib/bar.js', but that's gross
|
|
82
|
-
presetPackageName = parts.join('/');
|
|
83
|
-
}
|
|
84
|
-
try {
|
|
85
|
-
config = this.resolveConfigPromise(presetPackageName, presetConfig);
|
|
86
|
-
GetChangelogConfig.cfgCache.set(cacheKey, config);
|
|
87
|
-
}
|
|
88
|
-
catch (err) {
|
|
89
|
-
npmlog_1.default.warn('getChangelogConfig', err.message);
|
|
90
|
-
throw new validation_error_1.ValidationError('EPRESET', `Unable to load conventional-changelog preset "${presetName}"${presetName !== presetPackageName ? ` (${presetPackageName})` : ''}`);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
// the core presets are bloody Q.all() spreads
|
|
94
|
-
return Promise.resolve(config);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
exports.GetChangelogConfig = GetChangelogConfig;
|
|
98
|
-
GetChangelogConfig.cfgCache = new Map();
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.GetChangelogConfig = void 0;
|
|
7
|
+
const npmlog_1 = __importDefault(require("npmlog"));
|
|
8
|
+
const pify_1 = __importDefault(require("pify"));
|
|
9
|
+
const npm_package_arg_1 = __importDefault(require("npm-package-arg"));
|
|
10
|
+
const validation_error_1 = require("../validation-error");
|
|
11
|
+
class GetChangelogConfig {
|
|
12
|
+
static isFunction(config) {
|
|
13
|
+
return Object.prototype.toString.call(config) === '[object Function]';
|
|
14
|
+
}
|
|
15
|
+
static resolveConfigPromise(presetPackageName, presetConfig) {
|
|
16
|
+
npmlog_1.default.verbose('getChangelogConfig', 'Attempting to resolve preset %j', presetPackageName);
|
|
17
|
+
let config = require(presetPackageName);
|
|
18
|
+
npmlog_1.default.info('getChangelogConfig', 'Successfully resolved preset %j', presetPackageName);
|
|
19
|
+
if (this.isFunction(config)) {
|
|
20
|
+
try {
|
|
21
|
+
// try assuming config builder function first
|
|
22
|
+
config = config(presetConfig);
|
|
23
|
+
}
|
|
24
|
+
catch (_) {
|
|
25
|
+
// legacy presets export an errback function instead of Q.all()
|
|
26
|
+
config = (0, pify_1.default)(config)();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return config;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* @param {import('..').ChangelogPresetConfig} [changelogPreset]
|
|
33
|
+
* @param {string} [rootPath]
|
|
34
|
+
*/
|
|
35
|
+
static getChangelogConfig(changelogPreset = 'conventional-changelog-angular', rootPath) {
|
|
36
|
+
const presetName = typeof changelogPreset === 'string' ? changelogPreset : changelogPreset.name;
|
|
37
|
+
const presetConfig = typeof changelogPreset === 'object' ? changelogPreset : {};
|
|
38
|
+
const cacheKey = `${presetName}${presetConfig ? JSON.stringify(presetConfig) : ''}`;
|
|
39
|
+
let config = GetChangelogConfig.cfgCache.get(cacheKey);
|
|
40
|
+
if (!config) {
|
|
41
|
+
let presetPackageName = presetName;
|
|
42
|
+
// https://github.com/npm/npm-package-arg#result-object
|
|
43
|
+
const parsed = (0, npm_package_arg_1.default)(presetPackageName, rootPath);
|
|
44
|
+
npmlog_1.default.verbose('getChangelogConfig', 'using preset %j', presetPackageName);
|
|
45
|
+
npmlog_1.default.silly('npa', parsed);
|
|
46
|
+
if (parsed.type === 'directory') {
|
|
47
|
+
if (parsed.raw[0] === '@') {
|
|
48
|
+
// npa parses scoped subpath reference as a directory
|
|
49
|
+
parsed.name = parsed.raw;
|
|
50
|
+
parsed.scope = parsed.raw.substring(0, parsed.raw.indexOf('/'));
|
|
51
|
+
// un-scoped subpath shorthand handled in first catch block
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
presetPackageName = parsed.fetchSpec;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
else if (parsed.type === 'git' && parsed.hosted && parsed.hosted.default === 'shortcut') {
|
|
58
|
+
// probably a shorthand subpath, e.g. 'foo/bar'
|
|
59
|
+
parsed.name = parsed.raw;
|
|
60
|
+
}
|
|
61
|
+
// Maybe it doesn't need an implicit 'conventional-changelog-' prefix?
|
|
62
|
+
try {
|
|
63
|
+
config = this.resolveConfigPromise(presetPackageName, presetConfig);
|
|
64
|
+
GetChangelogConfig.cfgCache.set(cacheKey, config);
|
|
65
|
+
// early exit, yay
|
|
66
|
+
return Promise.resolve(config);
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
npmlog_1.default.verbose('getChangelogConfig', err.message);
|
|
70
|
+
npmlog_1.default.info('getChangelogConfig', 'Auto-prefixing conventional-changelog preset %j', presetName);
|
|
71
|
+
// probably a deep shorthand subpath :P
|
|
72
|
+
parsed.name = parsed.raw;
|
|
73
|
+
}
|
|
74
|
+
if (parsed.name.indexOf('conventional-changelog-') < 0) {
|
|
75
|
+
// implicit 'conventional-changelog-' prefix
|
|
76
|
+
const parts = parsed.name.split('/');
|
|
77
|
+
const start = parsed.scope ? 1 : 0;
|
|
78
|
+
// foo => conventional-changelog-foo
|
|
79
|
+
// @scope/foo => @scope/conventional-changelog-foo
|
|
80
|
+
parts.splice(start, 1, `conventional-changelog-${parts[start]}`);
|
|
81
|
+
// _technically_ supports 'foo/lib/bar.js', but that's gross
|
|
82
|
+
presetPackageName = parts.join('/');
|
|
83
|
+
}
|
|
84
|
+
try {
|
|
85
|
+
config = this.resolveConfigPromise(presetPackageName, presetConfig);
|
|
86
|
+
GetChangelogConfig.cfgCache.set(cacheKey, config);
|
|
87
|
+
}
|
|
88
|
+
catch (err) {
|
|
89
|
+
npmlog_1.default.warn('getChangelogConfig', err.message);
|
|
90
|
+
throw new validation_error_1.ValidationError('EPRESET', `Unable to load conventional-changelog preset "${presetName}"${presetName !== presetPackageName ? ` (${presetPackageName})` : ''}`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
// the core presets are bloody Q.all() spreads
|
|
94
|
+
return Promise.resolve(config);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
exports.GetChangelogConfig = GetChangelogConfig;
|
|
98
|
+
GetChangelogConfig.cfgCache = new Map();
|
|
99
99
|
//# sourceMappingURL=get-changelog-config.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './constants';
|
|
2
|
-
export * from './get-changelog-config';
|
|
3
|
-
export * from './make-bump-only-filter';
|
|
4
|
-
export * from './read-existing-changelog';
|
|
5
|
-
export * from './recommend-version';
|
|
6
|
-
export * from './update-changelog';
|
|
1
|
+
export * from './constants';
|
|
2
|
+
export * from './get-changelog-config';
|
|
3
|
+
export * from './make-bump-only-filter';
|
|
4
|
+
export * from './read-existing-changelog';
|
|
5
|
+
export * from './recommend-version';
|
|
6
|
+
export * from './update-changelog';
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./constants"), exports);
|
|
18
|
-
__exportStar(require("./get-changelog-config"), exports);
|
|
19
|
-
__exportStar(require("./make-bump-only-filter"), exports);
|
|
20
|
-
__exportStar(require("./read-existing-changelog"), exports);
|
|
21
|
-
__exportStar(require("./recommend-version"), exports);
|
|
22
|
-
__exportStar(require("./update-changelog"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./constants"), exports);
|
|
18
|
+
__exportStar(require("./get-changelog-config"), exports);
|
|
19
|
+
__exportStar(require("./make-bump-only-filter"), exports);
|
|
20
|
+
__exportStar(require("./read-existing-changelog"), exports);
|
|
21
|
+
__exportStar(require("./recommend-version"), exports);
|
|
22
|
+
__exportStar(require("./update-changelog"), exports);
|
|
23
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Package } from '../package';
|
|
2
|
-
/**
|
|
3
|
-
* @param {import("@lerna/package").Package} pkg
|
|
4
|
-
* @return {(entry: string) => string}
|
|
5
|
-
*/
|
|
6
|
-
export declare function makeBumpOnlyFilter(pkg: Package): (newEntry: string) => string;
|
|
1
|
+
import { Package } from '../package';
|
|
2
|
+
/**
|
|
3
|
+
* @param {import("@lerna/package").Package} pkg
|
|
4
|
+
* @return {(entry: string) => string}
|
|
5
|
+
*/
|
|
6
|
+
export declare function makeBumpOnlyFilter(pkg: Package): (newEntry: string) => string;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makeBumpOnlyFilter = void 0;
|
|
4
|
-
const constants_1 = require("./constants");
|
|
5
|
-
/**
|
|
6
|
-
* @param {import("@lerna/package").Package} pkg
|
|
7
|
-
* @return {(entry: string) => string}
|
|
8
|
-
*/
|
|
9
|
-
function makeBumpOnlyFilter(pkg) {
|
|
10
|
-
return (newEntry) => {
|
|
11
|
-
// When force publishing, it is possible that there will be no actual changes, only a version bump.
|
|
12
|
-
if (!newEntry.split('\n').some((line) => line.startsWith('*'))) {
|
|
13
|
-
// Add a note to indicate that only a version bump has occurred.
|
|
14
|
-
// TODO: actually list the dependencies that were bumped
|
|
15
|
-
const message = `**Note:** Version bump only for package ${pkg.name}`;
|
|
16
|
-
// the extra blank lines preserve the whitespace delimiting releases
|
|
17
|
-
return [newEntry.trim(), message, constants_1.BLANK_LINE].join(constants_1.BLANK_LINE);
|
|
18
|
-
}
|
|
19
|
-
return newEntry;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
exports.makeBumpOnlyFilter = makeBumpOnlyFilter;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeBumpOnlyFilter = void 0;
|
|
4
|
+
const constants_1 = require("./constants");
|
|
5
|
+
/**
|
|
6
|
+
* @param {import("@lerna/package").Package} pkg
|
|
7
|
+
* @return {(entry: string) => string}
|
|
8
|
+
*/
|
|
9
|
+
function makeBumpOnlyFilter(pkg) {
|
|
10
|
+
return (newEntry) => {
|
|
11
|
+
// When force publishing, it is possible that there will be no actual changes, only a version bump.
|
|
12
|
+
if (!newEntry.split('\n').some((line) => line.startsWith('*'))) {
|
|
13
|
+
// Add a note to indicate that only a version bump has occurred.
|
|
14
|
+
// TODO: actually list the dependencies that were bumped
|
|
15
|
+
const message = `**Note:** Version bump only for package ${pkg.name}`;
|
|
16
|
+
// the extra blank lines preserve the whitespace delimiting releases
|
|
17
|
+
return [newEntry.trim(), message, constants_1.BLANK_LINE].join(constants_1.BLANK_LINE);
|
|
18
|
+
}
|
|
19
|
+
return newEntry;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
exports.makeBumpOnlyFilter = makeBumpOnlyFilter;
|
|
23
23
|
//# sourceMappingURL=make-bump-only-filter.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Package } from '../package';
|
|
2
|
-
/**
|
|
3
|
-
* Read the existing changelog, if it exists.
|
|
4
|
-
* @param {import("@lerna/package").Package} pkg
|
|
5
|
-
* @returns {Promise<[string, string]>} A tuple of changelog location and contents
|
|
6
|
-
*/
|
|
7
|
-
export declare function readExistingChangelog(pkg: Package): Promise<any>;
|
|
1
|
+
import { Package } from '../package';
|
|
2
|
+
/**
|
|
3
|
+
* Read the existing changelog, if it exists.
|
|
4
|
+
* @param {import("@lerna/package").Package} pkg
|
|
5
|
+
* @returns {Promise<[string, string]>} A tuple of changelog location and contents
|
|
6
|
+
*/
|
|
7
|
+
export declare function readExistingChangelog(pkg: Package): Promise<any>;
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.readExistingChangelog = void 0;
|
|
7
|
-
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
|
-
const constants_1 = require("./constants");
|
|
10
|
-
/**
|
|
11
|
-
* Read the existing changelog, if it exists.
|
|
12
|
-
* @param {import("@lerna/package").Package} pkg
|
|
13
|
-
* @returns {Promise<[string, string]>} A tuple of changelog location and contents
|
|
14
|
-
*/
|
|
15
|
-
async function readExistingChangelog(pkg) {
|
|
16
|
-
const changelogFileLoc = path_1.default.join(pkg.location, 'CHANGELOG.md');
|
|
17
|
-
let chain = Promise.resolve();
|
|
18
|
-
// catch allows missing file to pass without breaking chain
|
|
19
|
-
chain = chain.then(() => fs_extra_1.default.readFile(changelogFileLoc, 'utf8').catch(() => ''));
|
|
20
|
-
chain = chain.then((changelogContents) => {
|
|
21
|
-
// Remove the header if it exists, thus starting at the first entry.
|
|
22
|
-
const headerIndex = changelogContents.indexOf(constants_1.COMMIT_GUIDELINE);
|
|
23
|
-
if (headerIndex !== -1) {
|
|
24
|
-
return changelogContents.substring(headerIndex + constants_1.COMMIT_GUIDELINE.length + constants_1.BLANK_LINE.length);
|
|
25
|
-
}
|
|
26
|
-
return changelogContents;
|
|
27
|
-
});
|
|
28
|
-
// consumer expects resolved tuple
|
|
29
|
-
chain = chain.then((changelogContents) => [changelogFileLoc, changelogContents]);
|
|
30
|
-
return chain;
|
|
31
|
-
}
|
|
32
|
-
exports.readExistingChangelog = readExistingChangelog;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.readExistingChangelog = void 0;
|
|
7
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const constants_1 = require("./constants");
|
|
10
|
+
/**
|
|
11
|
+
* Read the existing changelog, if it exists.
|
|
12
|
+
* @param {import("@lerna/package").Package} pkg
|
|
13
|
+
* @returns {Promise<[string, string]>} A tuple of changelog location and contents
|
|
14
|
+
*/
|
|
15
|
+
async function readExistingChangelog(pkg) {
|
|
16
|
+
const changelogFileLoc = path_1.default.join(pkg.location, 'CHANGELOG.md');
|
|
17
|
+
let chain = Promise.resolve();
|
|
18
|
+
// catch allows missing file to pass without breaking chain
|
|
19
|
+
chain = chain.then(() => fs_extra_1.default.readFile(changelogFileLoc, 'utf8').catch(() => ''));
|
|
20
|
+
chain = chain.then((changelogContents) => {
|
|
21
|
+
// Remove the header if it exists, thus starting at the first entry.
|
|
22
|
+
const headerIndex = changelogContents.indexOf(constants_1.COMMIT_GUIDELINE);
|
|
23
|
+
if (headerIndex !== -1) {
|
|
24
|
+
return changelogContents.substring(headerIndex + constants_1.COMMIT_GUIDELINE.length + constants_1.BLANK_LINE.length);
|
|
25
|
+
}
|
|
26
|
+
return changelogContents;
|
|
27
|
+
});
|
|
28
|
+
// consumer expects resolved tuple
|
|
29
|
+
chain = chain.then((changelogContents) => [changelogFileLoc, changelogContents]);
|
|
30
|
+
return chain;
|
|
31
|
+
}
|
|
32
|
+
exports.readExistingChangelog = readExistingChangelog;
|
|
33
33
|
//# sourceMappingURL=read-existing-changelog.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { BaseChangelogOptions, VersioningStrategy } from '../models';
|
|
2
|
-
import { Package } from '../package';
|
|
3
|
-
import { PackageGraphNode } from '../package-graph';
|
|
4
|
-
/**
|
|
5
|
-
* @param {import('@lerna/package').Package} pkg
|
|
6
|
-
* @param {import('..').VersioningStrategy} type
|
|
7
|
-
* @param {import('..').BaseChangelogOptions & { prereleaseId?: string }} commandOptions
|
|
8
|
-
*/
|
|
9
|
-
export declare function recommendVersion(pkg: Package | PackageGraphNode, type: VersioningStrategy, recommendationOptions: BaseChangelogOptions & {
|
|
10
|
-
prereleaseId?: string;
|
|
11
|
-
}): Promise<string | null>;
|
|
1
|
+
import { BaseChangelogOptions, VersioningStrategy } from '../models';
|
|
2
|
+
import { Package } from '../package';
|
|
3
|
+
import { PackageGraphNode } from '../package-graph';
|
|
4
|
+
/**
|
|
5
|
+
* @param {import('@lerna/package').Package} pkg
|
|
6
|
+
* @param {import('..').VersioningStrategy} type
|
|
7
|
+
* @param {import('..').BaseChangelogOptions & { prereleaseId?: string }} commandOptions
|
|
8
|
+
*/
|
|
9
|
+
export declare function recommendVersion(pkg: Package | PackageGraphNode, type: VersioningStrategy, recommendationOptions: BaseChangelogOptions & {
|
|
10
|
+
prereleaseId?: string;
|
|
11
|
+
}): Promise<string | null>;
|
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.recommendVersion = void 0;
|
|
7
|
-
const conventional_recommended_bump_1 = __importDefault(require("conventional-recommended-bump"));
|
|
8
|
-
const npmlog_1 = __importDefault(require("npmlog"));
|
|
9
|
-
const semver_1 = __importDefault(require("semver"));
|
|
10
|
-
const get_changelog_config_1 = require("./get-changelog-config");
|
|
11
|
-
/**
|
|
12
|
-
* @param {import('@lerna/package').Package} pkg
|
|
13
|
-
* @param {import('..').VersioningStrategy} type
|
|
14
|
-
* @param {import('..').BaseChangelogOptions & { prereleaseId?: string }} commandOptions
|
|
15
|
-
*/
|
|
16
|
-
async function recommendVersion(pkg, type, recommendationOptions) {
|
|
17
|
-
const { changelogPreset, rootPath, tagPrefix, prereleaseId } = recommendationOptions;
|
|
18
|
-
npmlog_1.default.silly(type, 'for %s at %s', pkg.name, pkg.location);
|
|
19
|
-
const options = {
|
|
20
|
-
path: pkg.location,
|
|
21
|
-
};
|
|
22
|
-
if (type === 'independent') {
|
|
23
|
-
options.lernaPackage = pkg.name;
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
// only fixed mode can have a custom tag prefix
|
|
27
|
-
options.tagPrefix = tagPrefix;
|
|
28
|
-
}
|
|
29
|
-
const shouldBumpPrerelease = (releaseType, version) => {
|
|
30
|
-
if (!semver_1.default.prerelease(version)) {
|
|
31
|
-
return true;
|
|
32
|
-
}
|
|
33
|
-
switch (releaseType) {
|
|
34
|
-
case 'major':
|
|
35
|
-
return semver_1.default.minor(version) !== 0 || semver_1.default.patch(version) !== 0;
|
|
36
|
-
case 'minor':
|
|
37
|
-
return semver_1.default.patch(version) !== 0;
|
|
38
|
-
default:
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
// 'new' preset API
|
|
43
|
-
options.config = await get_changelog_config_1.GetChangelogConfig.getChangelogConfig(changelogPreset, rootPath);
|
|
44
|
-
// Ensure potential ValidationError in getChangelogConfig() is propagated correctly
|
|
45
|
-
return new Promise((resolve, reject) => {
|
|
46
|
-
(0, conventional_recommended_bump_1.default)(options, (err, data) => {
|
|
47
|
-
if (err) {
|
|
48
|
-
return reject(err);
|
|
49
|
-
}
|
|
50
|
-
// result might be undefined because some presets are not consistent with angular
|
|
51
|
-
// we still need to bump _something_ because lerna-lite saw a change here
|
|
52
|
-
let releaseType = data.releaseType || 'patch';
|
|
53
|
-
if (prereleaseId) {
|
|
54
|
-
const shouldBump = shouldBumpPrerelease(releaseType, pkg.version);
|
|
55
|
-
const prereleaseType = shouldBump ? `pre${releaseType}` : 'prerelease';
|
|
56
|
-
npmlog_1.default.verbose(type, 'increment %s by %s - %s', pkg.version, prereleaseType, pkg.name);
|
|
57
|
-
resolve(semver_1.default.inc(pkg.version, prereleaseType, prereleaseId));
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
if (semver_1.default.major(pkg.version) === 0) {
|
|
61
|
-
// According to semver, major version zero (0.y.z) is for initial
|
|
62
|
-
// development. Anything MAY change at any time. The public API
|
|
63
|
-
// SHOULD NOT be considered stable. The version 1.0.0 defines
|
|
64
|
-
// the (initial stable) public API.
|
|
65
|
-
//
|
|
66
|
-
// To allow monorepos to use major version zero meaningfully,
|
|
67
|
-
// the transition from 0.x to 1.x must be explicitly requested
|
|
68
|
-
// by the user. Breaking changes MUST NOT automatically bump
|
|
69
|
-
// the major version from 0.x to 1.x.
|
|
70
|
-
//
|
|
71
|
-
// The usual convention is to use semver-patch bumps for bugfix
|
|
72
|
-
// releases and semver-minor for everything else, including
|
|
73
|
-
// breaking changes. This matches the behavior of `^` operator
|
|
74
|
-
// as implemented by `npm`.
|
|
75
|
-
//
|
|
76
|
-
if (releaseType === 'major') {
|
|
77
|
-
releaseType = 'minor';
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
npmlog_1.default.verbose(type, 'increment %s by %s - %s', pkg.version, releaseType, pkg.name);
|
|
81
|
-
resolve(semver_1.default.inc(pkg.version, releaseType));
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
exports.recommendVersion = recommendVersion;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.recommendVersion = void 0;
|
|
7
|
+
const conventional_recommended_bump_1 = __importDefault(require("conventional-recommended-bump"));
|
|
8
|
+
const npmlog_1 = __importDefault(require("npmlog"));
|
|
9
|
+
const semver_1 = __importDefault(require("semver"));
|
|
10
|
+
const get_changelog_config_1 = require("./get-changelog-config");
|
|
11
|
+
/**
|
|
12
|
+
* @param {import('@lerna/package').Package} pkg
|
|
13
|
+
* @param {import('..').VersioningStrategy} type
|
|
14
|
+
* @param {import('..').BaseChangelogOptions & { prereleaseId?: string }} commandOptions
|
|
15
|
+
*/
|
|
16
|
+
async function recommendVersion(pkg, type, recommendationOptions) {
|
|
17
|
+
const { changelogPreset, rootPath, tagPrefix, prereleaseId } = recommendationOptions;
|
|
18
|
+
npmlog_1.default.silly(type, 'for %s at %s', pkg.name, pkg.location);
|
|
19
|
+
const options = {
|
|
20
|
+
path: pkg.location,
|
|
21
|
+
};
|
|
22
|
+
if (type === 'independent') {
|
|
23
|
+
options.lernaPackage = pkg.name;
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
// only fixed mode can have a custom tag prefix
|
|
27
|
+
options.tagPrefix = tagPrefix;
|
|
28
|
+
}
|
|
29
|
+
const shouldBumpPrerelease = (releaseType, version) => {
|
|
30
|
+
if (!semver_1.default.prerelease(version)) {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
switch (releaseType) {
|
|
34
|
+
case 'major':
|
|
35
|
+
return semver_1.default.minor(version) !== 0 || semver_1.default.patch(version) !== 0;
|
|
36
|
+
case 'minor':
|
|
37
|
+
return semver_1.default.patch(version) !== 0;
|
|
38
|
+
default:
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
// 'new' preset API
|
|
43
|
+
options.config = await get_changelog_config_1.GetChangelogConfig.getChangelogConfig(changelogPreset, rootPath);
|
|
44
|
+
// Ensure potential ValidationError in getChangelogConfig() is propagated correctly
|
|
45
|
+
return new Promise((resolve, reject) => {
|
|
46
|
+
(0, conventional_recommended_bump_1.default)(options, (err, data) => {
|
|
47
|
+
if (err) {
|
|
48
|
+
return reject(err);
|
|
49
|
+
}
|
|
50
|
+
// result might be undefined because some presets are not consistent with angular
|
|
51
|
+
// we still need to bump _something_ because lerna-lite saw a change here
|
|
52
|
+
let releaseType = data.releaseType || 'patch';
|
|
53
|
+
if (prereleaseId) {
|
|
54
|
+
const shouldBump = shouldBumpPrerelease(releaseType, pkg.version);
|
|
55
|
+
const prereleaseType = shouldBump ? `pre${releaseType}` : 'prerelease';
|
|
56
|
+
npmlog_1.default.verbose(type, 'increment %s by %s - %s', pkg.version, prereleaseType, pkg.name);
|
|
57
|
+
resolve(semver_1.default.inc(pkg.version, prereleaseType, prereleaseId));
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
if (semver_1.default.major(pkg.version) === 0) {
|
|
61
|
+
// According to semver, major version zero (0.y.z) is for initial
|
|
62
|
+
// development. Anything MAY change at any time. The public API
|
|
63
|
+
// SHOULD NOT be considered stable. The version 1.0.0 defines
|
|
64
|
+
// the (initial stable) public API.
|
|
65
|
+
//
|
|
66
|
+
// To allow monorepos to use major version zero meaningfully,
|
|
67
|
+
// the transition from 0.x to 1.x must be explicitly requested
|
|
68
|
+
// by the user. Breaking changes MUST NOT automatically bump
|
|
69
|
+
// the major version from 0.x to 1.x.
|
|
70
|
+
//
|
|
71
|
+
// The usual convention is to use semver-patch bumps for bugfix
|
|
72
|
+
// releases and semver-minor for everything else, including
|
|
73
|
+
// breaking changes. This matches the behavior of `^` operator
|
|
74
|
+
// as implemented by `npm`.
|
|
75
|
+
//
|
|
76
|
+
if (releaseType === 'major') {
|
|
77
|
+
releaseType = 'minor';
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
npmlog_1.default.verbose(type, 'increment %s by %s - %s', pkg.version, releaseType, pkg.name);
|
|
81
|
+
resolve(semver_1.default.inc(pkg.version, releaseType));
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
exports.recommendVersion = recommendVersion;
|
|
87
87
|
//# sourceMappingURL=recommend-version.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { UpdateChangelogOption } from '../models';
|
|
2
|
-
import { Package } from '../package';
|
|
3
|
-
/**
|
|
4
|
-
* @param {import("@lerna/package").Package} pkg
|
|
5
|
-
* @param {import("..").ChangelogType} type
|
|
6
|
-
* @param {import("..").BaseChangelogOptions & { version?: string }} commandOptions
|
|
7
|
-
*/
|
|
8
|
-
export declare function updateChangelog(pkg: Package, type: 'root' | 'independent' | 'fixed', updateOptions: UpdateChangelogOption): Promise<{
|
|
9
|
-
logPath: any;
|
|
10
|
-
newEntry: any;
|
|
11
|
-
}>;
|
|
1
|
+
import { UpdateChangelogOption } from '../models';
|
|
2
|
+
import { Package } from '../package';
|
|
3
|
+
/**
|
|
4
|
+
* @param {import("@lerna/package").Package} pkg
|
|
5
|
+
* @param {import("..").ChangelogType} type
|
|
6
|
+
* @param {import("..").BaseChangelogOptions & { version?: string }} commandOptions
|
|
7
|
+
*/
|
|
8
|
+
export declare function updateChangelog(pkg: Package, type: 'root' | 'independent' | 'fixed', updateOptions: UpdateChangelogOption): Promise<{
|
|
9
|
+
logPath: any;
|
|
10
|
+
newEntry: any;
|
|
11
|
+
}>;
|