@lerna-lite/core 1.6.0 → 1.9.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/dist/command.d.ts +1 -1
- package/dist/conventional-commits/get-commits-since-last-release.d.ts +20 -0
- package/dist/conventional-commits/get-commits-since-last-release.js +53 -0
- package/dist/conventional-commits/get-commits-since-last-release.js.map +1 -0
- package/dist/conventional-commits/get-github-commits.d.ts +20 -0
- package/dist/conventional-commits/get-github-commits.js +82 -0
- package/dist/conventional-commits/get-github-commits.js.map +1 -0
- package/dist/conventional-commits/index.d.ts +2 -0
- package/dist/conventional-commits/index.js +2 -0
- package/dist/conventional-commits/index.js.map +1 -1
- package/dist/conventional-commits/update-changelog.d.ts +7 -6
- package/dist/conventional-commits/update-changelog.js +85 -6
- package/dist/conventional-commits/update-changelog.js.map +1 -1
- package/dist/models/command-options.d.ts +26 -5
- package/dist/models/interfaces.d.ts +33 -7
- package/dist/package.d.ts +12 -4
- package/dist/package.js +1 -1
- package/dist/package.js.map +1 -1
- package/dist/project/project.d.ts +2 -2
- package/dist/project/project.js +0 -2
- package/dist/project/project.js.map +1 -1
- package/dist/utils/collect-updates/collect-updates.js +10 -3
- package/dist/utils/collect-updates/collect-updates.js.map +1 -1
- package/dist/utils/collect-updates/lib/get-packages-for-option.d.ts +1 -1
- package/dist/utils/collect-updates/lib/get-packages-for-option.js.map +1 -1
- package/dist/utils/collect-updates/lib/has-tags.d.ts +3 -1
- package/dist/utils/collect-updates/lib/has-tags.js +8 -2
- package/dist/utils/collect-updates/lib/has-tags.js.map +1 -1
- package/dist/utils/describe-ref.js +12 -4
- package/dist/utils/describe-ref.js.map +1 -1
- package/dist/utils/run-lifecycle.js +39 -30
- package/dist/utils/run-lifecycle.js.map +1 -1
- package/package.json +11 -9
package/dist/command.d.ts
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ExecOpts, RemoteClientType, RemoteCommit } from '../models';
|
|
2
|
+
/**
|
|
3
|
+
* From the current branch, find all commits since the last tag release.
|
|
4
|
+
* The output will be an array which include every commit short hash & user login
|
|
5
|
+
* @param {RemoteClientType} client
|
|
6
|
+
* @param {String} gitRemote
|
|
7
|
+
* @param {String} branchName
|
|
8
|
+
* @param {ExecOpts} execOpts
|
|
9
|
+
* @returns {Promise<RemoteCommit[]>}
|
|
10
|
+
*/
|
|
11
|
+
export declare function getCommitsSinceLastRelease(client: RemoteClientType, gitRemote: string, branchName: string, execOpts: ExecOpts): Promise<RemoteCommit[]>;
|
|
12
|
+
/**
|
|
13
|
+
* From the current branch, we will return the last tag date, sha and ref count
|
|
14
|
+
* or else return it from the first commit of the current branch
|
|
15
|
+
*/
|
|
16
|
+
export declare function getLastTagDetails(execOpts: ExecOpts, includeMergedTags?: boolean): {
|
|
17
|
+
tagHash: string;
|
|
18
|
+
tagDate: string;
|
|
19
|
+
tagRefCount: string | number;
|
|
20
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
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.getLastTagDetails = exports.getCommitsSinceLastRelease = void 0;
|
|
7
|
+
const npmlog_1 = __importDefault(require("npmlog"));
|
|
8
|
+
const child_process_1 = require("../child-process");
|
|
9
|
+
const get_github_commits_1 = require("./get-github-commits");
|
|
10
|
+
const describe_ref_1 = require("../utils/describe-ref");
|
|
11
|
+
const validation_error_1 = require("../validation-error");
|
|
12
|
+
/**
|
|
13
|
+
* From the current branch, find all commits since the last tag release.
|
|
14
|
+
* The output will be an array which include every commit short hash & user login
|
|
15
|
+
* @param {RemoteClientType} client
|
|
16
|
+
* @param {String} gitRemote
|
|
17
|
+
* @param {String} branchName
|
|
18
|
+
* @param {ExecOpts} execOpts
|
|
19
|
+
* @returns {Promise<RemoteCommit[]>}
|
|
20
|
+
*/
|
|
21
|
+
async function getCommitsSinceLastRelease(client, gitRemote, branchName, execOpts) {
|
|
22
|
+
// get the last release tag date or the first commit date if no release tag found
|
|
23
|
+
const { tagDate } = getLastTagDetails(execOpts, false);
|
|
24
|
+
switch (client) {
|
|
25
|
+
case 'github':
|
|
26
|
+
return (0, get_github_commits_1.getGithubCommits)(gitRemote, branchName, tagDate, execOpts);
|
|
27
|
+
case 'gitlab':
|
|
28
|
+
default:
|
|
29
|
+
throw new validation_error_1.ValidationError('EREMOTE', 'Invalid remote client type, "github" is currently the only supported client with the option --changelog-include-commits-client-login.');
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.getCommitsSinceLastRelease = getCommitsSinceLastRelease;
|
|
33
|
+
/**
|
|
34
|
+
* From the current branch, we will return the last tag date, sha and ref count
|
|
35
|
+
* or else return it from the first commit of the current branch
|
|
36
|
+
*/
|
|
37
|
+
function getLastTagDetails(execOpts, includeMergedTags) {
|
|
38
|
+
let execResult = '';
|
|
39
|
+
const describeOptions = { ...execOpts };
|
|
40
|
+
const { refCount, lastTagName } = (0, describe_ref_1.describeRefSync)(describeOptions, includeMergedTags);
|
|
41
|
+
if (lastTagName) {
|
|
42
|
+
npmlog_1.default.silly('git', 'getCurrentBranchLastTagDateSha');
|
|
43
|
+
execResult = (0, child_process_1.execSync)('git', ['log', '-1', '--format="%h %cI"', lastTagName], execOpts);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
npmlog_1.default.silly('git', 'getCurrentBranchFirstCommitDateSha');
|
|
47
|
+
execResult = (0, child_process_1.execSync)('git', ['log', '--oneline', '--format="%h %cI"', '--reverse', '--max-parents=0', 'HEAD'], execOpts);
|
|
48
|
+
}
|
|
49
|
+
const [_, tagHash, tagDate] = /^"?([0-9a-f]+)\s([0-9\-T\:]*)"?$/.exec(execResult) || [];
|
|
50
|
+
return { tagHash, tagDate, tagRefCount: refCount };
|
|
51
|
+
}
|
|
52
|
+
exports.getLastTagDetails = getLastTagDetails;
|
|
53
|
+
//# sourceMappingURL=get-commits-since-last-release.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-commits-since-last-release.js","sourceRoot":"","sources":["../../src/conventional-commits/get-commits-since-last-release.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAyB;AAEzB,oDAA4C;AAC5C,6DAAwD;AAExD,wDAAwD;AACxD,0DAAsD;AAEtD;;;;;;;;GAQG;AACI,KAAK,UAAU,0BAA0B,CAC9C,MAAwB,EACxB,SAAiB,EACjB,UAAkB,EAClB,QAAkB;IAElB,iFAAiF;IACjF,MAAM,EAAE,OAAO,EAAE,GAAG,iBAAiB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAEvD,QAAQ,MAAM,EAAE;QACd,KAAK,QAAQ;YACX,OAAO,IAAA,qCAAgB,EAAC,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;QACpE,KAAK,QAAQ,CAAC;QACd;YACE,MAAM,IAAI,kCAAe,CACvB,SAAS,EACT,uIAAuI,CACxI,CAAC;KACL;AACH,CAAC;AAnBD,gEAmBC;AAED;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,QAAkB,EAAE,iBAA2B;IAC/E,IAAI,UAAU,GAAG,EAAE,CAAC;IACpB,MAAM,eAAe,GAAuB,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC5D,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,IAAA,8BAAe,EAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC;IAEtF,IAAI,WAAW,EAAE;QACf,gBAAG,CAAC,KAAK,CAAC,KAAK,EAAE,gCAAgC,CAAC,CAAC;QACnD,UAAU,GAAG,IAAA,wBAAQ,EAAC,KAAK,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,mBAAmB,EAAE,WAAW,CAAC,EAAE,QAAQ,CAAC,CAAC;KACzF;SAAM;QACL,gBAAG,CAAC,KAAK,CAAC,KAAK,EAAE,oCAAoC,CAAC,CAAC;QACvD,UAAU,GAAG,IAAA,wBAAQ,EACnB,KAAK,EACL,CAAC,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,CAAC,EACjF,QAAQ,CACT,CAAC;KACH;IAED,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,kCAAkC,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;IACxF,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;AACrD,CAAC;AAnBD,8CAmBC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ExecOpts, RemoteCommit } from '../models';
|
|
2
|
+
/**
|
|
3
|
+
* Get all commits from GitHub remote repository, using GitHub Graphql API, by providing a date to query from
|
|
4
|
+
* https://docs.github.com/en/graphql/reference/objects#repository
|
|
5
|
+
* @param {RemoteClientType} client
|
|
6
|
+
* @param {String} gitRemote
|
|
7
|
+
* @param {String} branchName
|
|
8
|
+
* @param {ExecOpts} execOpts
|
|
9
|
+
* @returns {Promise<RemoteCommit[]>}
|
|
10
|
+
*/
|
|
11
|
+
export declare function getGithubCommits(gitRemote: string, branchName: string, sinceDate: string, execOpts: ExecOpts): Promise<RemoteCommit[]>;
|
|
12
|
+
/**
|
|
13
|
+
* From a dot (.) notation path, find and return a property within an object given a complex object path
|
|
14
|
+
* Note that the object path does should not include the parent itself
|
|
15
|
+
* for example if we want to get `address.zip` from `user` object, we would call `getDescendantObjectProp(user, 'address.zip')`
|
|
16
|
+
* @param object - object to search from
|
|
17
|
+
* @param path - complex object path to find descendant property from, must be a string with dot (.) notation
|
|
18
|
+
* @returns outputValue - the object property value found if any
|
|
19
|
+
*/
|
|
20
|
+
export declare function getDescendantObjectProp<T>(object: any, path: string | undefined): T;
|
|
@@ -0,0 +1,82 @@
|
|
|
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.getDescendantObjectProp = exports.getGithubCommits = void 0;
|
|
7
|
+
const dedent_1 = __importDefault(require("dedent"));
|
|
8
|
+
const npmlog_1 = __importDefault(require("npmlog"));
|
|
9
|
+
const git_clients_1 = require("../git-clients");
|
|
10
|
+
const QUERY_PAGE_SIZE = 100; // GitHub API is restricting max of 100 per query
|
|
11
|
+
/**
|
|
12
|
+
* Get all commits from GitHub remote repository, using GitHub Graphql API, by providing a date to query from
|
|
13
|
+
* https://docs.github.com/en/graphql/reference/objects#repository
|
|
14
|
+
* @param {RemoteClientType} client
|
|
15
|
+
* @param {String} gitRemote
|
|
16
|
+
* @param {String} branchName
|
|
17
|
+
* @param {ExecOpts} execOpts
|
|
18
|
+
* @returns {Promise<RemoteCommit[]>}
|
|
19
|
+
*/
|
|
20
|
+
async function getGithubCommits(gitRemote, branchName, sinceDate, execOpts) {
|
|
21
|
+
var _a, _b, _c, _d, _e, _f;
|
|
22
|
+
const repo = (0, git_clients_1.parseGitRepo)(gitRemote, execOpts);
|
|
23
|
+
const octokit = (0, git_clients_1.createGitHubClient)();
|
|
24
|
+
const remoteCommits = [];
|
|
25
|
+
let afterCursor = '';
|
|
26
|
+
let hasNextPage = false;
|
|
27
|
+
do {
|
|
28
|
+
const afterCursorStr = afterCursor ? `, after: "${afterCursor}"` : '';
|
|
29
|
+
const queryStr = (0, dedent_1.default)(`
|
|
30
|
+
query getCommits($repo: String!, $owner: String!, $branchName: String!, $pageSize: Int!, $since: GitTimestamp!) {
|
|
31
|
+
repository(name: $repo, owner: $owner) {
|
|
32
|
+
ref(qualifiedName: $branchName) {
|
|
33
|
+
target { ... on Commit {
|
|
34
|
+
history(first: $pageSize, since: $since ${afterCursorStr}) {
|
|
35
|
+
nodes { oid, message, author { name, user { login }}}
|
|
36
|
+
pageInfo { hasNextPage, endCursor }
|
|
37
|
+
}}}}}}`).trim();
|
|
38
|
+
const response = await octokit.graphql(queryStr, {
|
|
39
|
+
owner: repo.owner,
|
|
40
|
+
repo: repo.name,
|
|
41
|
+
afterCursor,
|
|
42
|
+
branchName,
|
|
43
|
+
pageSize: QUERY_PAGE_SIZE,
|
|
44
|
+
since: sinceDate,
|
|
45
|
+
});
|
|
46
|
+
const historyData = getDescendantObjectProp(response, 'repository.ref.target.history');
|
|
47
|
+
const pageInfo = historyData === null || historyData === void 0 ? void 0 : historyData.pageInfo;
|
|
48
|
+
hasNextPage = (_a = pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.hasNextPage) !== null && _a !== void 0 ? _a : false;
|
|
49
|
+
afterCursor = (_b = pageInfo === null || pageInfo === void 0 ? void 0 : pageInfo.endCursor) !== null && _b !== void 0 ? _b : '';
|
|
50
|
+
if (historyData === null || historyData === void 0 ? void 0 : historyData.nodes) {
|
|
51
|
+
for (const commit of historyData.nodes) {
|
|
52
|
+
if ((commit === null || commit === void 0 ? void 0 : commit.oid) && (commit === null || commit === void 0 ? void 0 : commit.author)) {
|
|
53
|
+
remoteCommits.push({
|
|
54
|
+
shortHash: commit.oid.substring(0, 7),
|
|
55
|
+
authorName: commit === null || commit === void 0 ? void 0 : commit.author.name,
|
|
56
|
+
login: (_e = (_d = (_c = commit === null || commit === void 0 ? void 0 : commit.author) === null || _c === void 0 ? void 0 : _c.user) === null || _d === void 0 ? void 0 : _d.login) !== null && _e !== void 0 ? _e : '',
|
|
57
|
+
message: (_f = commit === null || commit === void 0 ? void 0 : commit.message) !== null && _f !== void 0 ? _f : '',
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
} while (hasNextPage);
|
|
63
|
+
npmlog_1.default.verbose('github', 'found %s commits since last release timestamp %s', remoteCommits.length, sinceDate);
|
|
64
|
+
return remoteCommits;
|
|
65
|
+
}
|
|
66
|
+
exports.getGithubCommits = getGithubCommits;
|
|
67
|
+
/**
|
|
68
|
+
* From a dot (.) notation path, find and return a property within an object given a complex object path
|
|
69
|
+
* Note that the object path does should not include the parent itself
|
|
70
|
+
* for example if we want to get `address.zip` from `user` object, we would call `getDescendantObjectProp(user, 'address.zip')`
|
|
71
|
+
* @param object - object to search from
|
|
72
|
+
* @param path - complex object path to find descendant property from, must be a string with dot (.) notation
|
|
73
|
+
* @returns outputValue - the object property value found if any
|
|
74
|
+
*/
|
|
75
|
+
function getDescendantObjectProp(object, path) {
|
|
76
|
+
if (!object || !path) {
|
|
77
|
+
return object;
|
|
78
|
+
}
|
|
79
|
+
return path.split('.').reduce((obj, prop) => obj && obj[prop], object);
|
|
80
|
+
}
|
|
81
|
+
exports.getDescendantObjectProp = getDescendantObjectProp;
|
|
82
|
+
//# sourceMappingURL=get-github-commits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-github-commits.js","sourceRoot":"","sources":["../../src/conventional-commits/get-github-commits.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAC5B,oDAAyB;AAEzB,gDAAkE;AAGlE,MAAM,eAAe,GAAG,GAAG,CAAC,CAAC,iDAAiD;AAE9E;;;;;;;;GAQG;AACI,KAAK,UAAU,gBAAgB,CACpC,SAAiB,EACjB,UAAkB,EAClB,SAAiB,EACjB,QAAkB;;IAElB,MAAM,IAAI,GAAG,IAAA,0BAAY,EAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAC/C,MAAM,OAAO,GAAG,IAAA,gCAAkB,GAAE,CAAC;IACrC,MAAM,aAAa,GAAwB,EAAE,CAAC;IAC9C,IAAI,WAAW,GAAG,EAAE,CAAC;IACrB,IAAI,WAAW,GAAG,KAAK,CAAC;IAExB,GAAG;QACD,MAAM,cAAc,GAAG,WAAW,CAAC,CAAC,CAAC,aAAa,WAAW,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACtE,MAAM,QAAQ,GA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,uBAAN,MAAM,CAAE,OAAO,mCAAI,EAAE;qBAC/B,CAAC,CAAC;iBACJ;aACF;SACF;KACF,QAAQ,WAAW,EAAE;IAEtB,gBAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,kDAAkD,EAAE,aAAa,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAE3G,OAAO,aAAa,CAAC;AACvB,CAAC;AAvDD,4CAuDC;AAED;;;;;;;GAOG;AACH,SAAgB,uBAAuB,CAAI,MAAW,EAAE,IAAwB;IAC9E,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE;QACpB,OAAO,MAAM,CAAC;KACf;IACD,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,IAAK,GAAW,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;AAClF,CAAC;AALD,0DAKC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from './constants';
|
|
2
2
|
export * from './get-changelog-config';
|
|
3
|
+
export * from './get-commits-since-last-release';
|
|
4
|
+
export * from './get-github-commits';
|
|
3
5
|
export * from './make-bump-only-filter';
|
|
4
6
|
export * from './read-existing-changelog';
|
|
5
7
|
export * from './recommend-version';
|
|
@@ -16,6 +16,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./constants"), exports);
|
|
18
18
|
__exportStar(require("./get-changelog-config"), exports);
|
|
19
|
+
__exportStar(require("./get-commits-since-last-release"), exports);
|
|
20
|
+
__exportStar(require("./get-github-commits"), exports);
|
|
19
21
|
__exportStar(require("./make-bump-only-filter"), exports);
|
|
20
22
|
__exportStar(require("./read-existing-changelog"), exports);
|
|
21
23
|
__exportStar(require("./recommend-version"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/conventional-commits/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,yDAAuC;AACvC,0DAAwC;AACxC,4DAA0C;AAC1C,sDAAoC;AACpC,qDAAmC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/conventional-commits/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,yDAAuC;AACvC,mEAAiD;AACjD,uDAAqC;AACrC,0DAAwC;AACxC,4DAA0C;AAC1C,sDAAoC;AACpC,qDAAmC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { UpdateChangelogOption } from '../models';
|
|
1
|
+
import { ChangelogType, UpdateChangelogOption } from '../models';
|
|
2
2
|
import { Package } from '../package';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* @param {
|
|
6
|
-
* @param {
|
|
4
|
+
* Update changelog with the commits of the new release
|
|
5
|
+
* @param {Package} pkg
|
|
6
|
+
* @param {ChangelogType} type
|
|
7
|
+
* @param {UpdateChangelogOption} commandOptions
|
|
7
8
|
*/
|
|
8
|
-
export declare function updateChangelog(pkg: Package, type:
|
|
9
|
+
export declare function updateChangelog(pkg: Package, type: ChangelogType, updateOptions: UpdateChangelogOption): Promise<{
|
|
9
10
|
logPath: any;
|
|
10
|
-
newEntry:
|
|
11
|
+
newEntry: string;
|
|
11
12
|
}>;
|
|
@@ -13,13 +13,14 @@ const get_changelog_config_1 = require("./get-changelog-config");
|
|
|
13
13
|
const make_bump_only_filter_1 = require("./make-bump-only-filter");
|
|
14
14
|
const read_existing_changelog_1 = require("./read-existing-changelog");
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
* @param {
|
|
18
|
-
* @param {
|
|
16
|
+
* Update changelog with the commits of the new release
|
|
17
|
+
* @param {Package} pkg
|
|
18
|
+
* @param {ChangelogType} type
|
|
19
|
+
* @param {UpdateChangelogOption} commandOptions
|
|
19
20
|
*/
|
|
20
21
|
async function updateChangelog(pkg, type, updateOptions) {
|
|
21
22
|
npmlog_1.default.silly(type, 'for %s at %s', pkg.name, pkg.location);
|
|
22
|
-
const { changelogPreset,
|
|
23
|
+
const { changelogPreset, changelogIncludeCommitsGitAuthor, changelogIncludeCommitsClientLogin, changelogHeaderMessage = '', changelogVersionMessage = '', commitsSinceLastRelease, rootPath, tagPrefix = 'v', version, } = updateOptions;
|
|
23
24
|
const config = await get_changelog_config_1.GetChangelogConfig.getChangelogConfig(changelogPreset, rootPath);
|
|
24
25
|
const options = {};
|
|
25
26
|
const context = {}; // pass as positional because cc-core's merge-config is wack
|
|
@@ -34,6 +35,14 @@ async function updateChangelog(pkg, type, updateOptions) {
|
|
|
34
35
|
}
|
|
35
36
|
// NOTE: must pass as positional argument due to weird bug in merge-config
|
|
36
37
|
const gitRawCommitsOpts = Object.assign({}, options.config.gitRawCommitsOpts);
|
|
38
|
+
// when including commit author's name, we need to change the conventional commit format
|
|
39
|
+
// available formats can be found at Git's url: https://git-scm.com/docs/git-log#_pretty_formats
|
|
40
|
+
// we will later extract a defined token from the string, of ">>author=%an<<",
|
|
41
|
+
// and reformat the string to get a commit string that would add (@authorName) to the end of the commit string, ie:
|
|
42
|
+
// **deps:** update all non-major dependencies ([ed1db35](https://github.com/.../ed1db35)) (@Renovate-Bot)
|
|
43
|
+
if (changelogIncludeCommitsGitAuthor) {
|
|
44
|
+
gitRawCommitsOpts.format = '%B%n-hash-%n%H>>author=%an<<';
|
|
45
|
+
}
|
|
37
46
|
if (type === 'root') {
|
|
38
47
|
context.version = version;
|
|
39
48
|
// preserve tagPrefix because cc-core can't find the currentTag otherwise
|
|
@@ -59,9 +68,18 @@ async function updateChangelog(pkg, type, updateOptions) {
|
|
|
59
68
|
// generate the markdown for the upcoming release.
|
|
60
69
|
const changelogStream = (0, conventional_changelog_core_1.default)(options, context, gitRawCommitsOpts);
|
|
61
70
|
return Promise.all([
|
|
62
|
-
|
|
71
|
+
// prettier-ignore
|
|
72
|
+
(0, get_stream_1.default)(changelogStream).then((0, make_bump_only_filter_1.makeBumpOnlyFilter)(pkg)),
|
|
63
73
|
(0, read_existing_changelog_1.readExistingChangelog)(pkg),
|
|
64
|
-
]).then(([
|
|
74
|
+
]).then(([inputEntry, [changelogFileLoc, changelogContents]]) => {
|
|
75
|
+
let newEntry = inputEntry;
|
|
76
|
+
// include commit author name or commit client login name
|
|
77
|
+
if (changelogIncludeCommitsGitAuthor) {
|
|
78
|
+
newEntry = parseChangelogCommitAuthorFullName(inputEntry, changelogIncludeCommitsGitAuthor);
|
|
79
|
+
}
|
|
80
|
+
else if (changelogIncludeCommitsClientLogin && commitsSinceLastRelease) {
|
|
81
|
+
newEntry = parseChangelogCommitClientLogin(inputEntry, commitsSinceLastRelease, changelogIncludeCommitsClientLogin);
|
|
82
|
+
}
|
|
65
83
|
npmlog_1.default.silly(type, 'writing new entry: %j', newEntry);
|
|
66
84
|
const changelogVersion = type === 'root' ? changelogVersionMessage : '';
|
|
67
85
|
const changelogHeader = constants_1.CHANGELOG_HEADER.replace(/%s/g, type === 'root' ? ((changelogHeaderMessage === null || changelogHeaderMessage === void 0 ? void 0 : changelogHeaderMessage.length) > 0 ? changelogHeaderMessage + constants_1.EOL : '') : '');
|
|
@@ -79,4 +97,65 @@ async function updateChangelog(pkg, type, updateOptions) {
|
|
|
79
97
|
});
|
|
80
98
|
}
|
|
81
99
|
exports.updateChangelog = updateChangelog;
|
|
100
|
+
/**
|
|
101
|
+
* From an input entry string that most often, not always, include commit author's name within defined tokens ">>author=AUTHOR_NAME<<"
|
|
102
|
+
* We will want to extract the author's name from the commit url and recreate the commit url string and add its author to the end of the string.
|
|
103
|
+
* You might be wondering, WHY is the commit author part of the commit url?
|
|
104
|
+
* Mainly because it seems that adding a `format` to the `conventional-changelog-core` of `gitRawCommitsOpts`
|
|
105
|
+
* will always include it as part of the final commit url because of this line where it parses the template and always seems to include whatever we add into the commit url
|
|
106
|
+
* https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/git-raw-commits/index.js#L27
|
|
107
|
+
*
|
|
108
|
+
* We will transform a string that looks like this:
|
|
109
|
+
* "deps: update all non-major dependencies ([ed1db35](https://github.com/.../ed1db35>>author=Whitesource Renovate<<))"
|
|
110
|
+
* then extract the commit author's name and transform it into a new string that will look like below
|
|
111
|
+
* "deps: update all non-major dependencies ([ed1db35](https://github.com/.../ed1db35)) (Whitesource Whitesource)"
|
|
112
|
+
* @param {String} changelogEntry - changelog entry of a version being released which can contain multiple line entries
|
|
113
|
+
* @param {String | Boolean} [commitCustomFormat]
|
|
114
|
+
* @returns
|
|
115
|
+
*/
|
|
116
|
+
function parseChangelogCommitAuthorFullName(changelogEntry, commitCustomFormat) {
|
|
117
|
+
// to transform the string into what we want, we need to move the substring outside of the url and remove extra search tokens
|
|
118
|
+
// from this:
|
|
119
|
+
// "...ed1db35>>author=Whitesource Renovate<<))"
|
|
120
|
+
// into this:
|
|
121
|
+
// "...ed1db35)) (Whitesource Renovate)"
|
|
122
|
+
// or as a custom message like this " by **%a**" into this:
|
|
123
|
+
// "...ed1db35)) by **Whitesource Renovate**"
|
|
124
|
+
return changelogEntry.replace(/(.*)(>>author=)(.*)(<<)(.*)/g, (_, lineStart, _tokenStart, authorName, _tokenEnd, lineEnd) => {
|
|
125
|
+
// rebuild the commit line entry string
|
|
126
|
+
const commitMsg = `${lineStart}${lineEnd || ''}`;
|
|
127
|
+
const authorMsg = typeof commitCustomFormat === 'string'
|
|
128
|
+
? commitCustomFormat.replace(/%a/g, authorName || '')
|
|
129
|
+
: ` (${authorName})`;
|
|
130
|
+
return commitMsg + authorMsg;
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* For each commit line entry, we will append the remote client login username for the first commit entry found, for example:
|
|
135
|
+
* "commit message ([ed1db35](https://github.com/.../ed1db35)) (@renovate-bot)"
|
|
136
|
+
* @param {String} changelogEntry - changelog entry of a version being released which can contain multiple line entries
|
|
137
|
+
* @param {Array<RemoteCommit>} commitsSinceLastRelease
|
|
138
|
+
* @param {String | Boolean} [commitCustomFormat]
|
|
139
|
+
* @returns
|
|
140
|
+
*/
|
|
141
|
+
function parseChangelogCommitClientLogin(changelogEntry, commitsSinceLastRelease, commitCustomFormat) {
|
|
142
|
+
const entriesOutput = [];
|
|
143
|
+
for (const lineEntry of changelogEntry.split('\n')) {
|
|
144
|
+
let lineEntryOutput = lineEntry;
|
|
145
|
+
const [_, __, shortSha] = lineEntry.match(/(\[([0-9a-f]{7})\])/) || []; // pull first commit match only
|
|
146
|
+
if (shortSha) {
|
|
147
|
+
const remoteCommit = commitsSinceLastRelease.find((c) => c.shortHash === shortSha);
|
|
148
|
+
if (remoteCommit) {
|
|
149
|
+
const clientLogin = typeof commitCustomFormat === 'string'
|
|
150
|
+
? commitCustomFormat.replace(/%l/g, remoteCommit.login || '').replace(/%a/g, remoteCommit.authorName || '')
|
|
151
|
+
: ` (@${remoteCommit.login})`;
|
|
152
|
+
// when we have a match, we need to remove any line breaks at the line ending only,
|
|
153
|
+
// then add our user info and finally add back a single line break
|
|
154
|
+
lineEntryOutput = lineEntry.replace(/\n*$/, '') + clientLogin;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
entriesOutput.push(lineEntryOutput);
|
|
158
|
+
}
|
|
159
|
+
return entriesOutput.join('\n');
|
|
160
|
+
}
|
|
82
161
|
//# sourceMappingURL=update-changelog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-changelog.js","sourceRoot":"","sources":["../../src/conventional-commits/update-changelog.ts"],"names":[],"mappings":";;;;;;AAAA,8FAAoE;AACpE,wDAA0B;AAC1B,4DAAmC;AACnC,oDAAyB;AAEzB,2CAAgE;AAChE,iEAA4D;AAC5D,mEAA6D;AAC7D,uEAAkE;AAIlE
|
|
1
|
+
{"version":3,"file":"update-changelog.js","sourceRoot":"","sources":["../../src/conventional-commits/update-changelog.ts"],"names":[],"mappings":";;;;;;AAAA,8FAAo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,KAAK,EAAE,YAAY,CAAC,UAAU,IAAI,EAAE,CAAC;oBAC3G,CAAC,CAAC,MAAM,YAAY,CAAC,KAAK,GAAG,CAAC;gBAElC,mFAAmF;gBACnF,kEAAkE;gBAClE,eAAe,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,WAAW,CAAC;aAC/D;SACF;QACD,aAAa,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;KACrC;IAED,OAAO,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RemoteClientType } from './interfaces';
|
|
1
2
|
export interface ChangedCommandOption {
|
|
2
3
|
/** use conventional-changelog to determine version bump and generate CHANGELOG. */
|
|
3
4
|
conventionalCommits?: boolean;
|
|
@@ -124,12 +125,29 @@ export interface VersionCommandOption {
|
|
|
124
125
|
conventionalGraduate?: boolean | string;
|
|
125
126
|
/** Version changed packages as prereleases when using --conventional-commits. */
|
|
126
127
|
conventionalPrerelease?: boolean | string;
|
|
127
|
-
/** Add a custom message at the top of your "changelog.md" which is located in the root of your project. This option only
|
|
128
|
+
/** Add a custom message at the top of your "changelog.md" which is located in the root of your project. This option is only available when using --conventional-commits with changelogs. */
|
|
128
129
|
changelogHeaderMessage?: string;
|
|
129
|
-
/**
|
|
130
|
+
/**
|
|
131
|
+
* Specify if we want to include the commit author's name, this option is only available when using --conventional-commits with changelogs.
|
|
132
|
+
* We can also optionally provide a custom message or else a default format will be used.
|
|
133
|
+
*/
|
|
134
|
+
changelogIncludeCommitsGitAuthor?: boolean | string;
|
|
135
|
+
/** @deprecated option renamed to `changelogIncludeCommitsGitAuthor` */
|
|
136
|
+
changelogIncludeCommitAuthorFullname?: boolean | string;
|
|
137
|
+
/**
|
|
138
|
+
* Specify if we want to include the commit remote client login name (ie GitHub username), this option is only available when using --conventional-commits with changelogs.
|
|
139
|
+
* We can also optionally provide a custom message or else a default format will be used.
|
|
140
|
+
*/
|
|
141
|
+
changelogIncludeCommitsClientLogin?: boolean | string;
|
|
142
|
+
/**
|
|
143
|
+
* Add a custom message as a prefix to each new version in your "changelog.md" which is located in the root of your project.
|
|
144
|
+
* This option is only available when using --conventional-commits with changelogs.
|
|
145
|
+
*/
|
|
130
146
|
changelogVersionMessage?: string;
|
|
131
147
|
/** Defaults 'angular', custom conventional-changelog preset. */
|
|
132
148
|
changelogPreset?: string;
|
|
149
|
+
/** Create an official GitHub or GitLab release for every version. */
|
|
150
|
+
createRelease?: RemoteClientType;
|
|
133
151
|
/** Specify cross-dependency version numbers exactly rather than with a caret (^). */
|
|
134
152
|
exact?: boolean;
|
|
135
153
|
/** Always include targeted packages in versioning operations, skipping default logic. */
|
|
@@ -138,8 +156,6 @@ export interface VersionCommandOption {
|
|
|
138
156
|
gitDryRun?: boolean;
|
|
139
157
|
/** Defaults to 'origin', push git changes to the specified remote. */
|
|
140
158
|
gitRemote: string;
|
|
141
|
-
/** Create an official GitHub or GitLab release for every version. */
|
|
142
|
-
createRelease?: 'gitlab' | 'github';
|
|
143
159
|
/**
|
|
144
160
|
* Ignore changes in files matched by glob(s) when detecting changed packages.
|
|
145
161
|
* Pass --no-ignore-changes to completely disable.
|
|
@@ -179,6 +195,8 @@ export interface VersionCommandOption {
|
|
|
179
195
|
push?: boolean;
|
|
180
196
|
/** Defaults to 'alpha', specify the prerelease identifier when versioning a prerelease */
|
|
181
197
|
preid?: string;
|
|
198
|
+
/** Remote git client, which client is used when reading commits from remote which is useful when associating client login for each changelog entry. */
|
|
199
|
+
remoteClient?: RemoteClientType;
|
|
182
200
|
/** Pass the `--gpg-sign` flag to `git commit`. */
|
|
183
201
|
signGitCommit?: boolean;
|
|
184
202
|
/** Pass the `--signoff` flag to `git commit`. */
|
|
@@ -195,7 +213,10 @@ export interface VersionCommandOption {
|
|
|
195
213
|
manuallyUpdateRootLockfile?: boolean;
|
|
196
214
|
/** Runs `npm install --package-lock-only` or equivalent depending on the package manager defined in `npmClient` */
|
|
197
215
|
syncWorkspaceLock?: boolean;
|
|
198
|
-
/**
|
|
216
|
+
/**
|
|
217
|
+
* @deprecated Strict match transform version numbers to an exact range (like "1.2.3") rather than with a caret (like ^1.2.3) when using `workspace:*`.
|
|
218
|
+
* Future version will make `workspace:` protocol as strict matching at all time, so this flag becomes redundant.
|
|
219
|
+
*/
|
|
199
220
|
workspaceStrictMatch?: boolean;
|
|
200
221
|
/** alias to '--yes' */
|
|
201
222
|
y?: boolean;
|
|
@@ -24,6 +24,7 @@ export interface DescribeRefOptions {
|
|
|
24
24
|
}
|
|
25
25
|
export interface DescribeRefFallbackResult {
|
|
26
26
|
isDirty: boolean;
|
|
27
|
+
lastVersion?: string;
|
|
27
28
|
lastTagName?: string;
|
|
28
29
|
refCount: number | string;
|
|
29
30
|
sha: string;
|
|
@@ -41,13 +42,19 @@ export interface ExecOpts {
|
|
|
41
42
|
maxBuffer?: number;
|
|
42
43
|
}
|
|
43
44
|
export interface LifecycleConfig {
|
|
44
|
-
|
|
45
|
+
access?: 'public' | 'restricted';
|
|
46
|
+
defaultTag?: string;
|
|
45
47
|
ignorePrepublish?: boolean;
|
|
46
48
|
ignoreScripts?: boolean;
|
|
49
|
+
log: log.Logger;
|
|
50
|
+
lernaCommand?: string;
|
|
47
51
|
nodeOptions?: string;
|
|
52
|
+
projectScope?: string | null;
|
|
48
53
|
scriptShell?: string;
|
|
49
54
|
scriptsPrependNodePath?: boolean;
|
|
50
55
|
snapshot?: any;
|
|
56
|
+
stdio?: string;
|
|
57
|
+
tag?: string;
|
|
51
58
|
unsafePerm?: boolean;
|
|
52
59
|
}
|
|
53
60
|
export interface Manifest {
|
|
@@ -60,18 +67,23 @@ export interface UpdateChangelogOption {
|
|
|
60
67
|
changelogHeaderMessage?: string;
|
|
61
68
|
changelogVersionMessage?: string;
|
|
62
69
|
changelogPreset?: string;
|
|
70
|
+
changelogIncludeCommitsGitAuthor?: boolean | string;
|
|
71
|
+
changelogIncludeCommitsClientLogin?: boolean | string;
|
|
72
|
+
commitsSinceLastRelease?: RemoteCommit[];
|
|
63
73
|
rootPath?: string;
|
|
64
74
|
tagPrefix?: string;
|
|
65
75
|
version?: string;
|
|
76
|
+
/** @deprecated this option was renamed to `changelogIncludeCommitsGitAuthor` */
|
|
77
|
+
changelogIncludeCommitAuthorFullname?: boolean | string;
|
|
66
78
|
}
|
|
67
79
|
export interface FetchConfig {
|
|
68
80
|
fetchRetries: number;
|
|
69
|
-
log:
|
|
81
|
+
log: log.Logger;
|
|
70
82
|
registry: string;
|
|
71
83
|
username: string;
|
|
72
84
|
}
|
|
73
85
|
export interface PackConfig {
|
|
74
|
-
log:
|
|
86
|
+
log: log.Logger;
|
|
75
87
|
lernaCommand?: string;
|
|
76
88
|
ignorePrepublish?: boolean;
|
|
77
89
|
}
|
|
@@ -124,7 +136,7 @@ export declare type NpaResolveResult = (npa.FileResult | npa.HostedGitResult | n
|
|
|
124
136
|
};
|
|
125
137
|
/** Passed between concurrent executions */
|
|
126
138
|
export interface OneTimePasswordCache {
|
|
127
|
-
otp?: string;
|
|
139
|
+
otp?: string | number;
|
|
128
140
|
}
|
|
129
141
|
export interface LernaConfig {
|
|
130
142
|
command?: {
|
|
@@ -149,7 +161,7 @@ export interface ProjectConfig extends LernaConfig, QueryGraphConfig {
|
|
|
149
161
|
lernaVersion: string;
|
|
150
162
|
progress?: boolean;
|
|
151
163
|
since?: string;
|
|
152
|
-
sort?:
|
|
164
|
+
sort?: boolean;
|
|
153
165
|
stream?: boolean;
|
|
154
166
|
useNx?: boolean;
|
|
155
167
|
onRejected?: (result: any) => void;
|
|
@@ -176,6 +188,17 @@ export interface ReleaseNote {
|
|
|
176
188
|
name: string;
|
|
177
189
|
notes?: string;
|
|
178
190
|
}
|
|
191
|
+
export declare type RemoteClientType = 'gitlab' | 'github';
|
|
192
|
+
export declare type RemoteCommit = {
|
|
193
|
+
/** git commit author name */
|
|
194
|
+
authorName: string;
|
|
195
|
+
/** remote client login (ie github login) */
|
|
196
|
+
login: string;
|
|
197
|
+
/** commit message headling (50 chars maxlen) */
|
|
198
|
+
message: string;
|
|
199
|
+
/** short commit hash (7 chars long) */
|
|
200
|
+
shortHash: string;
|
|
201
|
+
};
|
|
179
202
|
export interface UpdateCollectorOptions {
|
|
180
203
|
/** The semver bump keyword (patch/minor/major) or explicit version used */
|
|
181
204
|
bump?: string;
|
|
@@ -186,10 +209,13 @@ export interface UpdateCollectorOptions {
|
|
|
186
209
|
/** Whether or not to include the --first-parent flag when calling `git describe` (awkwardly, pass `true` to _omit_ the flag, the default is to include it) */
|
|
187
210
|
includeMergedTags?: boolean;
|
|
188
211
|
/** Which packages, if any, to always include. Force all packages to be versioned with `true`, or pass a list of globs that match package names */
|
|
189
|
-
forcePublish?: boolean | string[];
|
|
212
|
+
forcePublish?: boolean | string | string[];
|
|
190
213
|
/** Ref to use when querying git, defaults to most recent annotated tag */
|
|
191
214
|
since?: string;
|
|
215
|
+
/** are we using Lerna independent mode? */
|
|
216
|
+
isIndependent?: boolean;
|
|
217
|
+
/** are we using conventional commits? */
|
|
192
218
|
conventionalCommits?: boolean;
|
|
193
|
-
conventionalGraduate?: boolean;
|
|
219
|
+
conventionalGraduate?: boolean | string;
|
|
194
220
|
excludeDependents?: boolean;
|
|
195
221
|
}
|
package/dist/package.d.ts
CHANGED
|
@@ -45,10 +45,18 @@ export declare class Package {
|
|
|
45
45
|
});
|
|
46
46
|
get contents(): string;
|
|
47
47
|
set contents(subDirectory: string);
|
|
48
|
-
get dependencies():
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
get
|
|
48
|
+
get dependencies(): {
|
|
49
|
+
[depName: string]: string;
|
|
50
|
+
};
|
|
51
|
+
get devDependencies(): {
|
|
52
|
+
[depName: string]: string;
|
|
53
|
+
};
|
|
54
|
+
get optionalDependencies(): {
|
|
55
|
+
[depName: string]: string;
|
|
56
|
+
};
|
|
57
|
+
get peerDependencies(): {
|
|
58
|
+
[depName: string]: string;
|
|
59
|
+
};
|
|
52
60
|
get pkg(): Package;
|
|
53
61
|
/**
|
|
54
62
|
* Map-like retrieval of arbitrary values
|
package/dist/package.js
CHANGED
|
@@ -251,7 +251,7 @@ class Package {
|
|
|
251
251
|
// when using explicit `workspace:` protocol
|
|
252
252
|
if (resolved.explicitWorkspace) {
|
|
253
253
|
const workspaceTarget = (_a = resolved === null || resolved === void 0 ? void 0 : resolved.workspaceTarget) !== null && _a !== void 0 ? _a : '';
|
|
254
|
-
const [_, _wsTxt, operatorPrefix, rangePrefix] = workspaceTarget.match(/^(workspace:)?([<>=]{0,2})?([*^~])?(.*)$/);
|
|
254
|
+
const [_, _wsTxt, operatorPrefix, rangePrefix] = workspaceTarget.match(/^(workspace:)?([<>=]{0,2})?([*^~])?(.*)$/) || [];
|
|
255
255
|
if (operatorPrefix) {
|
|
256
256
|
// with workspace it might include an operator, if so use it like "workspace:>=1.2.3"
|
|
257
257
|
depCollection[depName] = `${operatorPrefix}${depVersion}`;
|
package/dist/package.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package.js","sourceRoot":"","sources":["../src/package.ts"],"names":[],"mappings":";;;;;;AAAA,oEAA0C;AAC1C,sEAAkC;AAClC,oDAA4B;
|
|
1
|
+
{"version":3,"file":"package.js","sourceRoot":"","sources":["../src/package.ts"],"names":[],"mappings":";;;;;;AAAA,oEAA0C;AAC1C,sEAAkC;AAClC,oDAA4B;AAC5B,gDAAwB;AACxB,0DAAiC;AAIjC,uCAAuC;AACvC,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AAE1B,iBAAiB;AACjB,MAAM,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AACrC,MAAM,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AACrC,MAAM,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AACrC,MAAM,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;AACnC,MAAM,SAAS,GA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|
|
18
|
+
constructor(cwd?: string);
|
|
19
19
|
/**
|
|
20
20
|
* @param {string} [cwd] Defaults to process.cwd()
|
|
21
21
|
*/
|
|
@@ -27,7 +27,7 @@ export declare class Project {
|
|
|
27
27
|
get version(): string;
|
|
28
28
|
set version(val: string);
|
|
29
29
|
get packageConfigs(): string[];
|
|
30
|
-
get packageParentDirs():
|
|
30
|
+
get packageParentDirs(): string[];
|
|
31
31
|
get manifest(): RawManifest;
|
|
32
32
|
get licensePath(): string;
|
|
33
33
|
get fileFinder(): (fileName: string, fileMapper: any, customGlobOpts?: any) => Promise<any>;
|
package/dist/project/project.js
CHANGED
|
@@ -196,6 +196,4 @@ Project.PACKAGE_GLOB = 'packages/*';
|
|
|
196
196
|
Project.LICENSE_GLOB = 'LICEN{S,C}E{,.*}';
|
|
197
197
|
Project.PACKAGE_GLOB = 'packages/*';
|
|
198
198
|
Project.LICENSE_GLOB = 'LICEN{S,C}E{,.*}';
|
|
199
|
-
module.exports.getPackages = Project.getPackages;
|
|
200
|
-
module.exports.getPackagesSync = Project.getPackagesSync;
|
|
201
199
|
//# sourceMappingURL=project.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/project/project.ts"],"names":[],"mappings":";;;;;;AAAA,6CAA8C;AAC9C,oDAA4B;AAC5B,oDAA+C;AAC/C,8DAAqC;AACrC,oDAAyB;AACzB,gDAAwB;AACxB,kDAAyB;AACzB,oEAA0C;AAC1C,sEAA4C;AAE5C,wCAAqC;AACrC,uDAAmD;AACnD,0DAAsD;AACtD,6DAA4E;AAG5E;;;;;GAKG;AACH,MAAa,OAAO;IAOlB;;OAEG;IACH,YAAY,
|
|
1
|
+
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../src/project/project.ts"],"names":[],"mappings":";;;;;;AAAA,6CAA8C;AAC9C,oDAA4B;AAC5B,oDAA+C;AAC/C,8DAAqC;AACrC,oDAAyB;AACzB,gDAAwB;AACxB,kDA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|
|
|
18
18
|
* @param {UpdateCollectorOptions} commandOptions
|
|
19
19
|
*/
|
|
20
20
|
function collectUpdates(filteredPackages, packageGraph, execOpts, commandOptions, gitDryRun = false) {
|
|
21
|
-
const { forcePublish, conventionalCommits, conventionalGraduate, excludeDependents } = commandOptions;
|
|
21
|
+
const { forcePublish, conventionalCommits, conventionalGraduate, excludeDependents, isIndependent } = commandOptions;
|
|
22
22
|
// If --conventional-commits and --conventional-graduate are both set, ignore --force-publish
|
|
23
23
|
const useConventionalGraduate = conventionalCommits && conventionalGraduate;
|
|
24
24
|
const forced = (0, get_packages_for_option_1.getPackagesForOption)(useConventionalGraduate ? conventionalGraduate : forcePublish);
|
|
@@ -26,9 +26,16 @@ function collectUpdates(filteredPackages, packageGraph, execOpts, commandOptions
|
|
|
26
26
|
? packageGraph
|
|
27
27
|
: new Map(filteredPackages.map(({ name }) => [name, packageGraph.get(name)]));
|
|
28
28
|
let committish = commandOptions.since;
|
|
29
|
-
|
|
29
|
+
const tagPattern = isIndependent ? '*@*' : '';
|
|
30
|
+
if ((0, has_tags_1.hasTags)(execOpts, tagPattern)) {
|
|
31
|
+
const describeOptions = {
|
|
32
|
+
...execOpts,
|
|
33
|
+
};
|
|
34
|
+
if (isIndependent) {
|
|
35
|
+
describeOptions.match = tagPattern;
|
|
36
|
+
}
|
|
30
37
|
// describe the last annotated tag in the current branch
|
|
31
|
-
const { sha, refCount, lastTagName } = (0, describe_ref_1.describeRefSync)(
|
|
38
|
+
const { sha, refCount, lastTagName } = (0, describe_ref_1.describeRefSync)(describeOptions, commandOptions.includeMergedTags, gitDryRun);
|
|
32
39
|
// TODO: warn about dirty tree?
|
|
33
40
|
if (refCount === '0' && forced.size === 0 && !committish) {
|
|
34
41
|
// no commits since previous release
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collect-updates.js","sourceRoot":"","sources":["../../../src/utils/collect-updates/collect-updates.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAyB;AAKzB,kD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AE,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC;QACrF,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,gBAAG,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC;QACjD,iBAAiB;KAClB,CAAC,CAAC;AACL,CAAC;AAlGD,wCAkGC"}
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* @param {boolean|string|string[]} option
|
|
3
3
|
* @returns {Set<string>} A set of package names (or wildcard) derived from option value.
|
|
4
4
|
*/
|
|
5
|
-
export declare function getPackagesForOption(option
|
|
5
|
+
export declare function getPackagesForOption(option?: boolean | string | string[]): Set<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-packages-for-option.js","sourceRoot":"","sources":["../../../../src/utils/collect-updates/lib/get-packages-for-option.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,
|
|
1
|
+
{"version":3,"file":"get-packages-for-option.js","sourceRoot":"","sources":["../../../../src/utils/collect-updates/lib/get-packages-for-option.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,MAAoC;IACvE,6CAA6C;IAC7C,qBAAqB;IACrB,IAAI,MAAM,GAAoB,IAAI,CAAC;IAEnC,IAAI,MAAM,KAAK,IAAI,EAAE;QACnB,+DAA+D;QAC/D,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC;KAChB;SAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;QACrC,qEAAqE;QACrE,oBAAoB;QACpB,sBAAsB;QACtB,0BAA0B;QAC1B,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;KAC5B;SAAM,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QAChC,6DAA6D;QAC7D,0CAA0C;QAC1C,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC;KACtB;IAED,OAAO,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;AACzB,CAAC;AArBD,oDAqBC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { ExecOpts } from '../../../models';
|
|
1
2
|
/**
|
|
2
3
|
* Determine if any git tags are reachable.
|
|
3
4
|
* @param {import("@lerna/child-process").ExecOpts} opts
|
|
5
|
+
* @param {string} tagPattern
|
|
4
6
|
*/
|
|
5
|
-
export declare function hasTags(opts
|
|
7
|
+
export declare function hasTags(opts?: ExecOpts, tagPattern?: string): boolean;
|
|
@@ -9,12 +9,18 @@ const child_process_1 = require("../../../child-process");
|
|
|
9
9
|
/**
|
|
10
10
|
* Determine if any git tags are reachable.
|
|
11
11
|
* @param {import("@lerna/child-process").ExecOpts} opts
|
|
12
|
+
* @param {string} tagPattern
|
|
12
13
|
*/
|
|
13
|
-
function hasTags(opts) {
|
|
14
|
+
function hasTags(opts, tagPattern) {
|
|
14
15
|
npmlog_1.default.silly('hasTags', '');
|
|
15
16
|
let result = false;
|
|
17
|
+
const args = ['tag'];
|
|
18
|
+
if (tagPattern) {
|
|
19
|
+
npmlog_1.default.verbose('hasTags', `filter for tags with '${tagPattern}' pattern`);
|
|
20
|
+
args.push('--list', tagPattern);
|
|
21
|
+
}
|
|
16
22
|
try {
|
|
17
|
-
result = !!(0, child_process_1.execSync)('git',
|
|
23
|
+
result = !!(0, child_process_1.execSync)('git', args, opts);
|
|
18
24
|
}
|
|
19
25
|
catch (err) {
|
|
20
26
|
npmlog_1.default.warn('ENOTAGS', 'No git tags were reachable from this branch!');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"has-tags.js","sourceRoot":"","sources":["../../../../src/utils/collect-updates/lib/has-tags.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAyB;AAEzB,0DAAkD;
|
|
1
|
+
{"version":3,"file":"has-tags.js","sourceRoot":"","sources":["../../../../src/utils/collect-updates/lib/has-tags.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAyB;AAEzB,0DAAkD;AAGlD;;;;GAIG;AACH,SAAgB,OAAO,CAAC,IAAe,EAAE,UAAmB;IAC1D,gBAAG,CAAC,KAAK,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IACzB,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;IAErB,IAAI,UAAU,EAAE;QACd,gBAAG,CAAC,OAAO,CAAC,SAAS,EAAE,yBAAyB,UAAU,WAAW,CAAC,CAAC;QACvE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;KACjC;IAED,IAAI;QACF,MAAM,GAAG,CAAC,CAAC,IAAA,wBAAQ,EAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;KACxC;IAAC,OAAO,GAAQ,EAAE;QACjB,gBAAG,CAAC,IAAI,CAAC,SAAS,EAAE,8CAA8C,CAAC,CAAC;QACpE,gBAAG,CAAC,OAAO,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC;KACnC;IAED,gBAAG,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;IAE1C,OAAO,MAAM,CAAC;AAChB,CAAC;AApBD,0BAoBC"}
|
|
@@ -41,8 +41,12 @@ function describeRef(options = {}, includeMergedTags, gitDryRun = false) {
|
|
|
41
41
|
const promise = (0, child_process_1.exec)('git', getArgs(options, includeMergedTags), options, gitDryRun);
|
|
42
42
|
return promise.then(({ stdout } = { stdout: '' }) => {
|
|
43
43
|
const result = parse(stdout, options.cwd);
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
if (options === null || options === void 0 ? void 0 : options.match) {
|
|
45
|
+
npmlog_1.default.verbose('git-describe', '%j => %j', options === null || options === void 0 ? void 0 : options.match, stdout);
|
|
46
|
+
}
|
|
47
|
+
if (stdout) {
|
|
48
|
+
npmlog_1.default.silly('git-describe', 'parsed => %j', result);
|
|
49
|
+
}
|
|
46
50
|
return result;
|
|
47
51
|
});
|
|
48
52
|
}
|
|
@@ -54,8 +58,12 @@ exports.describeRef = describeRef;
|
|
|
54
58
|
function describeRefSync(options = {}, includeMergedTags, gitDryRun = false) {
|
|
55
59
|
const stdout = (0, child_process_1.execSync)('git', getArgs(options, includeMergedTags), options, gitDryRun);
|
|
56
60
|
const result = parse(stdout, options.cwd);
|
|
57
|
-
|
|
58
|
-
|
|
61
|
+
if (options === null || options === void 0 ? void 0 : options.match) {
|
|
62
|
+
npmlog_1.default.verbose('git-describe.sync', '%j => %j', options === null || options === void 0 ? void 0 : options.match, stdout);
|
|
63
|
+
}
|
|
64
|
+
if (stdout) {
|
|
65
|
+
npmlog_1.default.silly('git-describe', 'parsed => %j', result);
|
|
66
|
+
}
|
|
59
67
|
return result;
|
|
60
68
|
}
|
|
61
69
|
exports.describeRefSync = describeRefSync;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describe-ref.js","sourceRoot":"","sources":["../../src/utils/describe-ref.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAyB;AAGzB,oDAAkD;AAElD;;;;GAIG;AACH,SAAS,OAAO,CAAC,OAA2B,EAAE,iBAA2B;IACvE,IAAI,IAAI,GAAG;QACT,UAAU;QACV,2CAA2C;QAC3C,UAAU;QACV,6DAA6D;QAC7D,QAAQ;QACR,0CAA0C;QAC1C,SAAS;QACT,6CAA6C;QAC7C,gBAAgB;KACjB,CAAC;IAEF,IAAI,OAAO,CAAC,KAAK,EAAE;QACjB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;KACrC;IAED,IAAI,iBAAiB,EAAE;QACrB,0DAA0D;QAC1D,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,gBAAgB,CAAC,CAAC;KACvD;IAED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E;IACD,IAAI,MAAM,EAAE;QACV,gBAAG,CAAC,KAAK,CAAC,cAAc,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC;KACnD;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AA2BqB,0CAAe;AAzBrC;;;;;GAKG;AACH,SAAS,KAAK,CAAC,MAAc,EAAE,GAAY;IACzC,MAAM,eAAe,GAAG,6BAA6B,CAAC;IACtD,0EAA0E;IAC1E,IAAI,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;QAChC,4BAA4B;QAC5B,MAAM,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,eAAe,CAAC,IAAI,CAAC,MAAM,CAAQ,CAAC;QAE7D,kDAAkD;QAClD,MAAM,QAAQ,GAAG,IAAA,wBAAQ,EAAC,KAAK,EAAE,CAAC,UAAU,EAAE,SAAS,EAAE,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;QAExE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;KACrD;IAED,MAAM,CAAC,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,CAAC,GACxD,8CAA8C,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IAEpE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;AAChF,CAAC"}
|
|
@@ -7,6 +7,8 @@ exports.createRunner = exports.runLifecycle = void 0;
|
|
|
7
7
|
const npmlog_1 = __importDefault(require("npmlog"));
|
|
8
8
|
const run_script_1 = __importDefault(require("@npmcli/run-script"));
|
|
9
9
|
const npm_conf_1 = require("../utils/npm-conf");
|
|
10
|
+
const p_queue_1 = __importDefault(require("p-queue"));
|
|
11
|
+
const queue = new p_queue_1.default({ concurrency: 1 });
|
|
10
12
|
/**
|
|
11
13
|
* Alias dash-cased npmConf to camelCase
|
|
12
14
|
* @param {LifecycleConfig} obj
|
|
@@ -45,6 +47,7 @@ function runLifecycle(pkg, stage, options) {
|
|
|
45
47
|
options = options.snapshot;
|
|
46
48
|
}
|
|
47
49
|
const opts = {
|
|
50
|
+
// @ts-ignore
|
|
48
51
|
log: npmlog_1.default,
|
|
49
52
|
unsafePerm: true,
|
|
50
53
|
...flattenOptions(options),
|
|
@@ -87,40 +90,46 @@ function runLifecycle(pkg, stage, options) {
|
|
|
87
90
|
opts.log.info('lifecycle', `${id}~${stage}: ${id}`);
|
|
88
91
|
/**
|
|
89
92
|
* In order to match the previous behavior of 'npm-lifecycle', we have to disable the writing
|
|
90
|
-
* to the parent process and print the command banner
|
|
93
|
+
* to the parent process and print the command banner ourselves, unless overridden by the options.
|
|
91
94
|
*/
|
|
92
|
-
const stdio = 'pipe';
|
|
95
|
+
const stdio = opts.stdio || 'pipe';
|
|
93
96
|
if (npmlog_1.default.level !== 'silent') {
|
|
94
97
|
printCommandBanner(id, stage, pkg.scripts[stage], dir);
|
|
95
98
|
}
|
|
96
|
-
return (
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
99
|
+
return queue.add(async () => {
|
|
100
|
+
try {
|
|
101
|
+
const { stdout } = await (0, run_script_1.default)({
|
|
102
|
+
event: stage,
|
|
103
|
+
path: dir,
|
|
104
|
+
pkg,
|
|
105
|
+
args: [],
|
|
106
|
+
stdio,
|
|
107
|
+
banner: false,
|
|
108
|
+
scriptShell: config.scriptShell,
|
|
109
|
+
});
|
|
110
|
+
if (stdout) {
|
|
111
|
+
/**
|
|
112
|
+
* This adjustment is based on trying to match the existing integration test outputs when migrating
|
|
113
|
+
* from "npm-lifecycle" to "@npmcli/run-script".
|
|
114
|
+
*/
|
|
115
|
+
// eslint-disable-next-line no-console
|
|
116
|
+
console.log(stdout.toString().trimEnd());
|
|
117
|
+
}
|
|
118
|
+
opts.log.silly('lifecycle', '%j finished in %j', stage, pkg.name);
|
|
119
|
+
}
|
|
120
|
+
catch (err) {
|
|
121
|
+
// propagate the exit code
|
|
122
|
+
const exitCode = err.code || 1;
|
|
123
|
+
// error logging has already occurred on stderr, but we need to stop the chain
|
|
124
|
+
npmlog_1.default.error('lifecycle', '%j errored in %j, exiting %d', stage, pkg.name, exitCode);
|
|
125
|
+
// ensure clean logging, avoiding spurious log dump
|
|
126
|
+
err.name = 'ValidationError';
|
|
127
|
+
// our yargs.fail() handler expects a numeric .exitCode, not .errno
|
|
128
|
+
err.exitCode = exitCode;
|
|
129
|
+
process.exitCode = exitCode;
|
|
130
|
+
// stop the chain
|
|
131
|
+
throw err;
|
|
132
|
+
}
|
|
124
133
|
});
|
|
125
134
|
}
|
|
126
135
|
exports.runLifecycle = runLifecycle;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-lifecycle.js","sourceRoot":"","sources":["../../src/utils/run-lifecycle.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAyB;AACzB,oEAA2C;AAE3C,gDAA4C;
|
|
1
|
+
{"version":3,"file":"run-lifecycle.js","sourceRoot":"","sources":["../../src/utils/run-lifecycle.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAyB;AACzB,oEAA2C;AAE3C,gDAA4C;AAG5C,sDAA6B;AAE7B,MAAM,KAAK,GAAG,IAAI,iBAAM,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,CAAC;AAE7C;;;;GAIG;AACH,SAAS,cAAc,CAAC,GAAoB;IA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O,CAAC,QAAQ,GAAG,QAAQ,CAAC;YAE5B,iBAAiB;YACjB,MAAM,GAAG,CAAC;SACX;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AA9GD,oCA8GC;AAED,SAAgB,YAAY,CAAC,cAAmB;IAC9C,MAAM,GAAG,GAAI,IAAA,kBAAO,EAAC,cAAc,CAAS,CAAC,QAAQ,CAAC;IAEtD,OAAO,CAAC,GAAY,EAAE,KAAa,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;AACxE,CAAC;AAJD,oCAIC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lerna-lite/core",
|
|
3
3
|
"description": "Lerna-Lite core implementation module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.9.1",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"typings": "dist/index.d.ts",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"npm": ">=8.0.0"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@npmcli/run-script": "^4.1.
|
|
34
|
+
"@npmcli/run-script": "^4.1.7",
|
|
35
35
|
"@octokit/plugin-enterprise-rest": "^6.0.1",
|
|
36
|
-
"@octokit/rest": "^
|
|
36
|
+
"@octokit/rest": "^19.0.3",
|
|
37
37
|
"async": "^3.2.4",
|
|
38
38
|
"chalk": "^4.1.2",
|
|
39
39
|
"clone-deep": "^4.0.1",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"execa": "^5.1.1",
|
|
47
47
|
"fs-extra": "^10.1.0",
|
|
48
48
|
"get-stream": "^6.0.1",
|
|
49
|
-
"git-url-parse": "^
|
|
49
|
+
"git-url-parse": "^12.0.0",
|
|
50
50
|
"glob-parent": "^6.0.2",
|
|
51
51
|
"globby": "^11.1.0",
|
|
52
52
|
"graceful-fs": "^4.2.10",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"minimatch": "^5.1.0",
|
|
61
61
|
"node-fetch": "^2.6.7",
|
|
62
62
|
"npm-package-arg": "^9.1.0",
|
|
63
|
-
"npm-packlist": "^5.1.
|
|
64
|
-
"npm-registry-fetch": "^13.
|
|
63
|
+
"npm-packlist": "^5.1.1",
|
|
64
|
+
"npm-registry-fetch": "^13.3.0",
|
|
65
65
|
"npmlog": "^6.0.2",
|
|
66
66
|
"os": "^0.1.2",
|
|
67
67
|
"p-map": "^4.0.0",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"yargs": "^17.5.1"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
|
-
"@types/async": "^3.2.
|
|
89
|
+
"@types/async": "^3.2.15",
|
|
90
90
|
"@types/clone-deep": "^4.0.1",
|
|
91
91
|
"@types/conventional-changelog-core": "^4.2.1",
|
|
92
92
|
"@types/conventional-recommended-bump": "^6.1.0",
|
|
@@ -97,17 +97,19 @@
|
|
|
97
97
|
"@types/glob-parent": "^5.1.1",
|
|
98
98
|
"@types/inquirer": "^8.2.1",
|
|
99
99
|
"@types/load-json-file": "^5.1.0",
|
|
100
|
+
"@types/minimatch": "^3.0.5",
|
|
100
101
|
"@types/npm-package-arg": "^6.1.1",
|
|
101
102
|
"@types/p-map": "^2.0.0",
|
|
102
103
|
"@types/semver": "^7.3.10",
|
|
103
104
|
"@types/strong-log-transformer": "^1.0.0",
|
|
104
105
|
"@types/write-file-atomic": "^4.0.0",
|
|
105
106
|
"@types/write-json-file": "^3.2.1",
|
|
106
|
-
"@types/write-pkg": "^4.0.0"
|
|
107
|
+
"@types/write-pkg": "^4.0.0",
|
|
108
|
+
"yargs-parser": "^21.0.1"
|
|
107
109
|
},
|
|
108
110
|
"funding": {
|
|
109
111
|
"type": "ko_fi",
|
|
110
112
|
"url": "https://ko-fi.com/ghiscoding"
|
|
111
113
|
},
|
|
112
|
-
"gitHead": "
|
|
114
|
+
"gitHead": "8d619173b15515874f342d9825e565bfd944bfcc"
|
|
113
115
|
}
|