@lerna-lite/core 1.8.0 → 1.10.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/dist/command.d.ts +1 -1
- package/dist/command.js +3 -4
- package/dist/command.js.map +1 -1
- package/dist/conventional-commits/get-changelog-config.d.ts +5 -6
- package/dist/conventional-commits/get-changelog-config.js +1 -1
- package/dist/conventional-commits/get-changelog-config.js.map +1 -1
- package/dist/conventional-commits/get-commits-since-last-release.d.ts +21 -0
- package/dist/conventional-commits/get-commits-since-last-release.js +56 -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 +3 -0
- package/dist/conventional-commits/index.js +3 -0
- package/dist/conventional-commits/index.js.map +1 -1
- package/dist/conventional-commits/update-changelog.d.ts +6 -5
- package/dist/conventional-commits/update-changelog.js +17 -49
- package/dist/conventional-commits/update-changelog.js.map +1 -1
- package/dist/conventional-commits/writer-opts-transform.d.ts +38 -0
- package/dist/conventional-commits/writer-opts-transform.js +73 -0
- package/dist/conventional-commits/writer-opts-transform.js.map +1 -0
- package/dist/models/command-options.d.ts +20 -7
- package/dist/models/interfaces.d.ts +46 -8
- package/dist/package-graph/package-graph.d.ts +7 -7
- package/dist/package-graph/package-graph.js +9 -10
- package/dist/package-graph/package-graph.js.map +1 -1
- package/dist/package.d.ts +12 -4
- package/dist/package.js +1 -1
- package/dist/package.js.map +1 -1
- package/dist/prompt.d.ts +3 -3
- package/dist/utils/collect-updates/__helpers__/build-graph.d.ts +3 -0
- package/dist/utils/collect-updates/__helpers__/build-graph.js +76 -0
- package/dist/utils/collect-updates/__helpers__/build-graph.js.map +1 -0
- 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 +2 -1
- package/dist/utils/collect-updates/lib/has-tags.js.map +1 -1
- package/dist/utils/query-graph.d.ts +1 -1
- package/dist/utils/run-lifecycle.js +39 -30
- package/dist/utils/run-lifecycle.js.map +1 -1
- package/package.json +9 -5
package/dist/command.d.ts
CHANGED
package/dist/command.js
CHANGED
|
@@ -7,6 +7,7 @@ exports.Command = void 0;
|
|
|
7
7
|
const clone_deep_1 = __importDefault(require("clone-deep"));
|
|
8
8
|
const dedent_1 = __importDefault(require("dedent"));
|
|
9
9
|
const execa_1 = __importDefault(require("execa"));
|
|
10
|
+
const is_ci_1 = __importDefault(require("is-ci"));
|
|
10
11
|
const npmlog_1 = __importDefault(require("npmlog"));
|
|
11
12
|
const os_1 = __importDefault(require("os"));
|
|
12
13
|
const clean_stack_1 = require("./utils/clean-stack");
|
|
@@ -109,12 +110,10 @@ class Command {
|
|
|
109
110
|
return [];
|
|
110
111
|
}
|
|
111
112
|
configureEnvironment() {
|
|
112
|
-
// eslint-disable-next-line global-require
|
|
113
|
-
const ci = require('is-ci');
|
|
114
113
|
let loglevel;
|
|
115
114
|
let progress;
|
|
116
115
|
/* istanbul ignore next */
|
|
117
|
-
if (
|
|
116
|
+
if (is_ci_1.default || !process.stderr.isTTY || process.env.TERM === 'dumb') {
|
|
118
117
|
npmlog_1.default.disableColor();
|
|
119
118
|
progress = false;
|
|
120
119
|
}
|
|
@@ -129,7 +128,7 @@ class Command {
|
|
|
129
128
|
}
|
|
130
129
|
Object.defineProperty(this, 'envDefaults', {
|
|
131
130
|
value: {
|
|
132
|
-
ci,
|
|
131
|
+
ci: is_ci_1.default,
|
|
133
132
|
progress,
|
|
134
133
|
loglevel,
|
|
135
134
|
},
|
package/dist/command.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":";;;;;;AAAA,4DAAmC;AACnC,oDAA4B;AAC5B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C,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE;oBAC9B,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;iBAC5B;aACF;SACF;KACF;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
+
import { ChangelogConfig, ChangelogPresetConfig } from '../models';
|
|
1
2
|
export declare class GetChangelogConfig {
|
|
2
3
|
static cfgCache: Map<string, any>;
|
|
3
|
-
static isFunction(config:
|
|
4
|
-
static resolveConfigPromise(presetPackageName: string, presetConfig:
|
|
4
|
+
static isFunction(config: ChangelogConfig): boolean;
|
|
5
|
+
static resolveConfigPromise(presetPackageName: string, presetConfig: ChangelogPresetConfig): Promise<ChangelogConfig>;
|
|
5
6
|
/**
|
|
6
|
-
* @param {
|
|
7
|
+
* @param {ChangelogPresetConfig} [changelogPreset]
|
|
7
8
|
* @param {string} [rootPath]
|
|
8
9
|
*/
|
|
9
|
-
static getChangelogConfig(changelogPreset?: string
|
|
10
|
-
name: string;
|
|
11
|
-
}, rootPath?: string): Promise<any>;
|
|
10
|
+
static getChangelogConfig(changelogPreset?: ChangelogPresetConfig, rootPath?: string): Promise<ChangelogConfig>;
|
|
12
11
|
}
|
|
@@ -29,7 +29,7 @@ class GetChangelogConfig {
|
|
|
29
29
|
return config;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
|
-
* @param {
|
|
32
|
+
* @param {ChangelogPresetConfig} [changelogPreset]
|
|
33
33
|
* @param {string} [rootPath]
|
|
34
34
|
*/
|
|
35
35
|
static getChangelogConfig(changelogPreset = 'conventional-changelog-angular', rootPath) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-changelog-config.js","sourceRoot":"","sources":["../../src/conventional-commits/get-changelog-config.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAyB;AACzB,gDAAwB;AACxB,sEAAkC;
|
|
1
|
+
{"version":3,"file":"get-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KAAK,iBAAiB,GAAG,CAAC,CAAC,CAAC,EACjE,EAAE,CACH,CAAC;aACH;SACF;QAED,8CAA8C;QAC9C,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC;;AAhHH,gDAiHC;AAhHQ,2BAAQ,GAAG,IAAI,GAAG,EAAe,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
* Find the oldest commit details since the last release tag or else if not tag exists then return first commit info
|
|
14
|
+
* @param {ExecOpts} [execOpts]
|
|
15
|
+
* @param {Boolean} [includeMergedTags]
|
|
16
|
+
* @returns {*} - oldest commit detail (hash, date)
|
|
17
|
+
*/
|
|
18
|
+
export declare function getOldestCommitSinceLastTag(execOpts?: ExecOpts, includeMergedTags?: boolean): {
|
|
19
|
+
commitHash: string;
|
|
20
|
+
commitDate: string;
|
|
21
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
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.getOldestCommitSinceLastTag = 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 { commitDate } = getOldestCommitSinceLastTag(execOpts, false);
|
|
24
|
+
switch (client) {
|
|
25
|
+
case 'github':
|
|
26
|
+
return (0, get_github_commits_1.getGithubCommits)(gitRemote, branchName, commitDate, 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
|
+
* Find the oldest commit details since the last release tag or else if not tag exists then return first commit info
|
|
35
|
+
* @param {ExecOpts} [execOpts]
|
|
36
|
+
* @param {Boolean} [includeMergedTags]
|
|
37
|
+
* @returns {*} - oldest commit detail (hash, date)
|
|
38
|
+
*/
|
|
39
|
+
function getOldestCommitSinceLastTag(execOpts, includeMergedTags) {
|
|
40
|
+
let commitResult = '';
|
|
41
|
+
const describeOptions = { ...execOpts };
|
|
42
|
+
const { lastTagName } = (0, describe_ref_1.describeRefSync)(describeOptions, includeMergedTags);
|
|
43
|
+
if (lastTagName) {
|
|
44
|
+
npmlog_1.default.silly('git', 'getCurrentBranchOldestCommitSinceLastTag');
|
|
45
|
+
const stdout = (0, child_process_1.execSync)('git', ['log', `${lastTagName}..HEAD`, '--format="%h %cI"', '--reverse'], execOpts);
|
|
46
|
+
[commitResult] = stdout.split('\n');
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
npmlog_1.default.silly('git', 'getCurrentBranchFirstCommit');
|
|
50
|
+
commitResult = (0, child_process_1.execSync)('git', ['log', '--oneline', '--format="%h %cI"', '--reverse', '--max-parents=0', 'HEAD'], execOpts);
|
|
51
|
+
}
|
|
52
|
+
const [, commitHash, commitDate] = /^"?([0-9a-f]+)\s([0-9\-T\:]*)"?$/.exec(commitResult) || [];
|
|
53
|
+
return { commitHash, commitDate };
|
|
54
|
+
}
|
|
55
|
+
exports.getOldestCommitSinceLastTag = getOldestCommitSinceLastTag;
|
|
56
|
+
//# 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,QAAmB;IAEnB,iFAAiF;IACjF,MAAM,EAAE,UAAU,EAAE,GAAG,2BAA2B,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAEpE,QAAQ,MAAM,EAAE;QACd,KAAK,QAAQ;YACX,OAAO,IAAA,qCAAgB,EAAC,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;QACvE,KAAK,QAAQ,CAAC;QACd;YACE,MAAM,IAAI,kCAAe,CACvB,SAAS,EACT,uIAAuI,CACxI,CAAC;KACL;AACH,CAAC;AAnBD,gEAmBC;AAED;;;;;GAKG;AACH,SAAgB,2BAA2B,CAAC,QAAmB,EAAE,iBAA2B;IAC1F,IAAI,YAAY,GAAG,EAAE,CAAC;IACtB,MAAM,eAAe,GAAuB,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC5D,MAAM,EAAE,WAAW,EAAE,GAAG,IAAA,8BAAe,EAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC;IAE5E,IAAI,WAAW,EAAE;QACf,gBAAG,CAAC,KAAK,CAAC,KAAK,EAAE,0CAA0C,CAAC,CAAC;QAC7D,MAAM,MAAM,GAAG,IAAA,wBAAQ,EAAC,KAAK,EAAE,CAAC,KAAK,EAAE,GAAG,WAAW,QAAQ,EAAE,mBAAmB,EAAE,WAAW,CAAC,EAAE,QAAQ,CAAC,CAAC;QAC5G,CAAC,YAAY,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;KACrC;SAAM;QACL,gBAAG,CAAC,KAAK,CAAC,KAAK,EAAE,6BAA6B,CAAC,CAAC;QAChD,YAAY,GAAG,IAAA,wBAAQ,EACrB,KAAK,EACL,CAAC,KAAK,EAAE,WAAW,EAAE,mBAAmB,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,CAAC,EACjF,QAAQ,CACT,CAAC;KACH;IAED,MAAM,CAAC,EAAE,UAAU,EAAE,UAAU,CAAC,GAAG,kCAAkC,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;IAC/F,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;AACpC,CAAC;AApBD,kEAoBC"}
|
|
@@ -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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
|
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';
|
|
6
8
|
export * from './update-changelog';
|
|
9
|
+
export * from './writer-opts-transform';
|
|
@@ -16,8 +16,11 @@ 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);
|
|
22
24
|
__exportStar(require("./update-changelog"), exports);
|
|
25
|
+
__exportStar(require("./writer-opts-transform"), exports);
|
|
23
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -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;AACnC,0DAAwC"}
|
|
@@ -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
11
|
newEntry: string;
|
|
11
12
|
}>;
|
|
@@ -12,17 +12,20 @@ const constants_1 = require("./constants");
|
|
|
12
12
|
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
|
+
const writer_opts_transform_1 = require("./writer-opts-transform");
|
|
15
16
|
/**
|
|
16
|
-
*
|
|
17
|
-
* @param {
|
|
18
|
-
* @param {
|
|
17
|
+
* Update changelog with the commits of the new release
|
|
18
|
+
* @param {Package} pkg
|
|
19
|
+
* @param {ChangelogType} type
|
|
20
|
+
* @param {UpdateChangelogOption} commandOptions
|
|
19
21
|
*/
|
|
20
22
|
async function updateChangelog(pkg, type, updateOptions) {
|
|
21
23
|
npmlog_1.default.silly(type, 'for %s at %s', pkg.name, pkg.location);
|
|
22
|
-
const { changelogPreset,
|
|
24
|
+
const { changelogPreset, changelogIncludeCommitsGitAuthor, changelogIncludeCommitsClientLogin, changelogHeaderMessage = '', changelogVersionMessage = '', commitsSinceLastRelease, rootPath, tagPrefix = 'v', version, } = updateOptions;
|
|
23
25
|
const config = await get_changelog_config_1.GetChangelogConfig.getChangelogConfig(changelogPreset, rootPath);
|
|
24
26
|
const options = {};
|
|
25
27
|
const context = {}; // pass as positional because cc-core's merge-config is wack
|
|
28
|
+
const writerOpts = {};
|
|
26
29
|
// cc-core mutates input :P
|
|
27
30
|
if (config.conventionalChangelog) {
|
|
28
31
|
// "new" preset API
|
|
@@ -34,13 +37,13 @@ async function updateChangelog(pkg, type, updateOptions) {
|
|
|
34
37
|
}
|
|
35
38
|
// NOTE: must pass as positional argument due to weird bug in merge-config
|
|
36
39
|
const gitRawCommitsOpts = Object.assign({}, options.config.gitRawCommitsOpts);
|
|
37
|
-
//
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
// are we including commit author name/email or remote client login name
|
|
41
|
+
if (changelogIncludeCommitsGitAuthor) {
|
|
42
|
+
(0, writer_opts_transform_1.setConfigChangelogCommitGitAuthor)(config, gitRawCommitsOpts, writerOpts, changelogIncludeCommitsGitAuthor);
|
|
43
|
+
}
|
|
44
|
+
else if (changelogIncludeCommitsClientLogin && commitsSinceLastRelease) {
|
|
45
|
+
// prettier-ignore
|
|
46
|
+
(0, writer_opts_transform_1.setConfigChangelogCommitClientLogin)(config, gitRawCommitsOpts, writerOpts, commitsSinceLastRelease, changelogIncludeCommitsClientLogin);
|
|
44
47
|
}
|
|
45
48
|
if (type === 'root') {
|
|
46
49
|
context.version = version;
|
|
@@ -65,23 +68,20 @@ async function updateChangelog(pkg, type, updateOptions) {
|
|
|
65
68
|
}
|
|
66
69
|
}
|
|
67
70
|
// generate the markdown for the upcoming release.
|
|
68
|
-
const changelogStream = (0, conventional_changelog_core_1.default)(options, context, gitRawCommitsOpts);
|
|
71
|
+
const changelogStream = (0, conventional_changelog_core_1.default)(options, context, gitRawCommitsOpts, undefined, writerOpts);
|
|
69
72
|
return Promise.all([
|
|
70
73
|
// prettier-ignore
|
|
71
74
|
(0, get_stream_1.default)(changelogStream).then((0, make_bump_only_filter_1.makeBumpOnlyFilter)(pkg)),
|
|
72
75
|
(0, read_existing_changelog_1.readExistingChangelog)(pkg),
|
|
73
76
|
]).then(([inputEntry, [changelogFileLoc, changelogContents]]) => {
|
|
74
|
-
|
|
75
|
-
const newEntry = changelogIncludeCommitAuthorFullname
|
|
76
|
-
? parseChangelogCommitAuthorFullName(inputEntry, changelogIncludeCommitAuthorFullname)
|
|
77
|
-
: inputEntry;
|
|
77
|
+
let newEntry = inputEntry;
|
|
78
78
|
npmlog_1.default.silly(type, 'writing new entry: %j', newEntry);
|
|
79
79
|
const changelogVersion = type === 'root' ? changelogVersionMessage : '';
|
|
80
80
|
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 : '') : '');
|
|
81
81
|
const content = [changelogHeader, changelogVersion, newEntry, changelogContents]
|
|
82
82
|
.join(constants_1.BLANK_LINE)
|
|
83
83
|
.trim()
|
|
84
|
-
.replace(/[\r\n]{2,}/gm, '\n\n');
|
|
84
|
+
.replace(/[\r\n]{2,}/gm, '\n\n'); // conventional-changelog adds way too many extra line breaks, let's remove a few of them
|
|
85
85
|
return fs_extra_1.default.writeFile(changelogFileLoc, content + constants_1.EOL).then(() => {
|
|
86
86
|
npmlog_1.default.verbose(type, 'wrote', changelogFileLoc);
|
|
87
87
|
return {
|
|
@@ -92,36 +92,4 @@ async function updateChangelog(pkg, type, updateOptions) {
|
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
94
|
exports.updateChangelog = updateChangelog;
|
|
95
|
-
/**
|
|
96
|
-
* From an input entry string that most often, not always, include commit author's name within defined tokens ">>author=AUTHOR_NAME<<"
|
|
97
|
-
* 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.
|
|
98
|
-
* You might be wondering, WHY is the commit author part of the commit url?
|
|
99
|
-
* Mainly because it seems that adding a `format` to the `conventional-changelog-core` of `gitRawCommitsOpts`
|
|
100
|
-
* 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
|
|
101
|
-
* https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/git-raw-commits/index.js#L27
|
|
102
|
-
*
|
|
103
|
-
* We will transform a string that looks like this:
|
|
104
|
-
* "deps: update all non-major dependencies ([ed1db35](https://github.com/ghiscoding/lerna-lite/commit/ed1db35>>author=Renovate Bot<<))"
|
|
105
|
-
* then extract the commit author's name and transform it into a new string that will look like below
|
|
106
|
-
* "deps: update all non-major dependencies ([ed1db35](https://github.com/ghiscoding/lerna-lite/commit/ed1db35)) (@Renovate-Bot)"
|
|
107
|
-
* @param changelogEntry - changelog entry of a version being released which can contain multiple line entries
|
|
108
|
-
* @returns
|
|
109
|
-
*/
|
|
110
|
-
function parseChangelogCommitAuthorFullName(changelogEntry, commitAuthorFullnameMessage) {
|
|
111
|
-
// to transform the string into what we want, we need to move the substring outside of the url and remove extra search tokens
|
|
112
|
-
// from this:
|
|
113
|
-
// "...ed1db35>>author=Renovate Bot<<))"
|
|
114
|
-
// into this:
|
|
115
|
-
// "...ed1db35)) (Renovate-Bot)"
|
|
116
|
-
// or as a custom message like this " by **%a**" into this:
|
|
117
|
-
// "...ed1db35)) by **Renovate-Bot**"
|
|
118
|
-
return changelogEntry.replace(/(.*)(>>author=)(.*)(<<)(.*)/g, (_, lineStart, _tokenStart, authorName, _tokenEnd, lineEnd) => {
|
|
119
|
-
// rebuild the commit string, we'll also replace any whitespaces to hypen in author's name to make it a valid "@" user ref
|
|
120
|
-
const commitMsg = `${lineStart}${lineEnd || ''}`;
|
|
121
|
-
const authorMsg = typeof commitAuthorFullnameMessage === 'string'
|
|
122
|
-
? commitAuthorFullnameMessage.replace(/%a/g, authorName || '')
|
|
123
|
-
: ` (${authorName})`;
|
|
124
|
-
return commitMsg + authorMsg;
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
95
|
//# sourceMappingURL=update-changelog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-changelog.js","sourceRoot":"","sources":["../../src/conventional-commits/update-changelog.ts"],"names":[],"mappings":";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AiGC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Context, GitRawCommitsOptions } from 'conventional-changelog-core';
|
|
2
|
+
import { Options as WriterOptions } from 'conventional-changelog-writer';
|
|
3
|
+
import { Commit } from 'conventional-commits-parser';
|
|
4
|
+
import { ChangelogConfig, RemoteCommit } from '../models';
|
|
5
|
+
/**
|
|
6
|
+
* Change the changelog config, we need to update the default format to include commit author name/email,
|
|
7
|
+
* Add a `format` to the `conventional-changelog-core` of `gitRawCommitsOpts` will make it available in the commit template
|
|
8
|
+
* https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/git-raw-commits/index.js#L27
|
|
9
|
+
* then no matter which changelog preset is loaded, we'll append the git author name to the commit template
|
|
10
|
+
* ie:: **deps:** update all non-major dependencies ([ed1db35](https://github.com/.../ed1db35)) (Renovate Bot)
|
|
11
|
+
* @param {ChangelogConfig} config
|
|
12
|
+
* @param {GitRawCommitsOptions} gitRawCommitsOpts
|
|
13
|
+
* @param {WriterOptions} writerOpts
|
|
14
|
+
* @param {string | boolean} [commitCustomFormat]
|
|
15
|
+
*/
|
|
16
|
+
export declare function setConfigChangelogCommitGitAuthor(config: ChangelogConfig, gitRawCommitsOpts: GitRawCommitsOptions, writerOpts: WriterOptions, commitCustomFormat?: string | boolean): void;
|
|
17
|
+
/**
|
|
18
|
+
* Change the changelog config, we need to update the default format to include remote client login name.
|
|
19
|
+
* We also need to extend the transform function and add remote client login (GitHub),
|
|
20
|
+
* and finally no matter which changelog preset is loaded, we'll append the client login to the commit template
|
|
21
|
+
* ie:: **deps:** update all non-major dependencies ([ed1db35](https://github.com/.../ed1db35)) (@renovate-bot)
|
|
22
|
+
* @param {ChangelogConfig} config
|
|
23
|
+
* @param {GitRawCommitsOptions} gitRawCommitsOpts
|
|
24
|
+
* @param {WriterOptions} writerOpts
|
|
25
|
+
* @param {RemoteCommit[]} commitsSinceLastRelease
|
|
26
|
+
* @param {string | boolean} [commitCustomFormat]
|
|
27
|
+
*/
|
|
28
|
+
export declare function setConfigChangelogCommitClientLogin(config: ChangelogConfig, gitRawCommitsOpts: GitRawCommitsOptions, writerOpts: WriterOptions, commitsSinceLastRelease: RemoteCommit[], commitCustomFormat?: string | boolean): void;
|
|
29
|
+
/**
|
|
30
|
+
* Extend the writerOpts transform function from whichever preset config is currently loaded
|
|
31
|
+
* We will execute the original writerOpts transform function, then from it we'll add extra properties to the commit object
|
|
32
|
+
* @param {Transform} originalTransform
|
|
33
|
+
* @param {RemoteCommit[]} commitsSinceLastRelease
|
|
34
|
+
* @param {Commit} commit
|
|
35
|
+
* @param {Context} context
|
|
36
|
+
* @returns
|
|
37
|
+
*/
|
|
38
|
+
export declare function writerOptsTransform(originalTransform: (cmt: Commit, ctx: Context) => Commit, commitsSinceLastRelease: RemoteCommit[], commit: Commit, context: Context): Commit<string | number | symbol>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.writerOptsTransform = exports.setConfigChangelogCommitClientLogin = exports.setConfigChangelogCommitGitAuthor = void 0;
|
|
4
|
+
// available formats can be found at Git's url: https://git-scm.com/docs/git-log#_pretty_formats
|
|
5
|
+
const GIT_COMMIT_WITH_AUTHOR_FORMAT = '%B%n-hash-%n%H%n-gitTags-%n%d%n-committerDate-%n%ci%n-authorName-%n%an%n-authorEmail-%n%ae%n-gpgStatus-%n%G?%n-gpgSigner-%n%GS';
|
|
6
|
+
/**
|
|
7
|
+
* Change the changelog config, we need to update the default format to include commit author name/email,
|
|
8
|
+
* Add a `format` to the `conventional-changelog-core` of `gitRawCommitsOpts` will make it available in the commit template
|
|
9
|
+
* https://github.com/conventional-changelog/conventional-changelog/blob/master/packages/git-raw-commits/index.js#L27
|
|
10
|
+
* then no matter which changelog preset is loaded, we'll append the git author name to the commit template
|
|
11
|
+
* ie:: **deps:** update all non-major dependencies ([ed1db35](https://github.com/.../ed1db35)) (Renovate Bot)
|
|
12
|
+
* @param {ChangelogConfig} config
|
|
13
|
+
* @param {GitRawCommitsOptions} gitRawCommitsOpts
|
|
14
|
+
* @param {WriterOptions} writerOpts
|
|
15
|
+
* @param {string | boolean} [commitCustomFormat]
|
|
16
|
+
*/
|
|
17
|
+
function setConfigChangelogCommitGitAuthor(config, gitRawCommitsOpts, writerOpts, commitCustomFormat) {
|
|
18
|
+
gitRawCommitsOpts.format = GIT_COMMIT_WITH_AUTHOR_FORMAT;
|
|
19
|
+
const extraCommitMsg = typeof commitCustomFormat === 'string'
|
|
20
|
+
? commitCustomFormat.replace(/%a/g, '{{authorName}}' || '').replace(/%e/g, '{{authorEmail}}' || '')
|
|
21
|
+
: `({{authorName}})`;
|
|
22
|
+
writerOpts.commitPartial =
|
|
23
|
+
config.writerOpts.commitPartial.replace(/\n*$/, '') + ` {{#if @root.linkReferences~}}${extraCommitMsg}{{~/if}}\n`;
|
|
24
|
+
}
|
|
25
|
+
exports.setConfigChangelogCommitGitAuthor = setConfigChangelogCommitGitAuthor;
|
|
26
|
+
/**
|
|
27
|
+
* Change the changelog config, we need to update the default format to include remote client login name.
|
|
28
|
+
* We also need to extend the transform function and add remote client login (GitHub),
|
|
29
|
+
* and finally no matter which changelog preset is loaded, we'll append the client login to the commit template
|
|
30
|
+
* ie:: **deps:** update all non-major dependencies ([ed1db35](https://github.com/.../ed1db35)) (@renovate-bot)
|
|
31
|
+
* @param {ChangelogConfig} config
|
|
32
|
+
* @param {GitRawCommitsOptions} gitRawCommitsOpts
|
|
33
|
+
* @param {WriterOptions} writerOpts
|
|
34
|
+
* @param {RemoteCommit[]} commitsSinceLastRelease
|
|
35
|
+
* @param {string | boolean} [commitCustomFormat]
|
|
36
|
+
*/
|
|
37
|
+
function setConfigChangelogCommitClientLogin(config, gitRawCommitsOpts, writerOpts, commitsSinceLastRelease, commitCustomFormat) {
|
|
38
|
+
gitRawCommitsOpts.format = GIT_COMMIT_WITH_AUTHOR_FORMAT;
|
|
39
|
+
const extraCommitMsg = typeof commitCustomFormat === 'string'
|
|
40
|
+
? commitCustomFormat
|
|
41
|
+
.replace(/%a/g, '{{authorName}}' || '')
|
|
42
|
+
.replace(/%e/g, '{{authorEmail}}' || '')
|
|
43
|
+
.replace(/%l/g, '{{userLogin}}' || '')
|
|
44
|
+
: `(@{{userLogin}})`;
|
|
45
|
+
writerOpts.commitPartial =
|
|
46
|
+
config.writerOpts.commitPartial.replace(/\n*$/, '') + ` {{#if @root.linkReferences~}}${extraCommitMsg}{{~/if}}\n`;
|
|
47
|
+
// add commits since last release into the transform function
|
|
48
|
+
writerOpts.transform = writerOptsTransform.bind(null, config.writerOpts.transform, commitsSinceLastRelease);
|
|
49
|
+
}
|
|
50
|
+
exports.setConfigChangelogCommitClientLogin = setConfigChangelogCommitClientLogin;
|
|
51
|
+
/**
|
|
52
|
+
* Extend the writerOpts transform function from whichever preset config is currently loaded
|
|
53
|
+
* We will execute the original writerOpts transform function, then from it we'll add extra properties to the commit object
|
|
54
|
+
* @param {Transform} originalTransform
|
|
55
|
+
* @param {RemoteCommit[]} commitsSinceLastRelease
|
|
56
|
+
* @param {Commit} commit
|
|
57
|
+
* @param {Context} context
|
|
58
|
+
* @returns
|
|
59
|
+
*/
|
|
60
|
+
function writerOptsTransform(originalTransform, commitsSinceLastRelease, commit, context) {
|
|
61
|
+
// execute original writerOpts transform
|
|
62
|
+
const extendedCommit = originalTransform(commit, context);
|
|
63
|
+
// add client remote detail (login)
|
|
64
|
+
if (extendedCommit) {
|
|
65
|
+
const remoteCommit = commitsSinceLastRelease.find((c) => c.shortHash === commit.shortHash);
|
|
66
|
+
if (remoteCommit === null || remoteCommit === void 0 ? void 0 : remoteCommit.login) {
|
|
67
|
+
commit.userLogin = remoteCommit.login;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return extendedCommit;
|
|
71
|
+
}
|
|
72
|
+
exports.writerOptsTransform = writerOptsTransform;
|
|
73
|
+
//# sourceMappingURL=writer-opts-transform.js.map
|