@lerna-lite/core 1.14.1 → 1.15.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.
Files changed (71) hide show
  1. package/dist/constants.d.ts +1 -0
  2. package/dist/constants.js +5 -0
  3. package/dist/constants.js.map +1 -0
  4. package/dist/index.d.ts +1 -3
  5. package/dist/index.js +1 -3
  6. package/dist/index.js.map +1 -1
  7. package/dist/models/command-options.d.ts +19 -15
  8. package/dist/models/interfaces.d.ts +1 -92
  9. package/dist/project/lib/apply-extends.js +2 -1
  10. package/dist/project/lib/apply-extends.js.map +1 -1
  11. package/dist/utils/collect-updates/__helpers__/build-graph.js +0 -1
  12. package/dist/utils/collect-updates/__helpers__/build-graph.js.map +1 -1
  13. package/dist/utils/index.d.ts +1 -1
  14. package/dist/utils/index.js +1 -1
  15. package/dist/utils/index.js.map +1 -1
  16. package/dist/utils/npm-conf.js +24 -2
  17. package/dist/utils/npm-conf.js.map +1 -1
  18. package/dist/utils/query-graph.d.ts +1 -1
  19. package/dist/utils/query-graph.js.map +1 -1
  20. package/dist/utils/string-utils.d.ts +2 -0
  21. package/dist/utils/string-utils.js +10 -0
  22. package/dist/utils/string-utils.js.map +1 -0
  23. package/package.json +2 -18
  24. package/dist/conventional-commits/constants.d.ts +0 -4
  25. package/dist/conventional-commits/constants.js +0 -13
  26. package/dist/conventional-commits/constants.js.map +0 -1
  27. package/dist/conventional-commits/get-changelog-config.d.ts +0 -11
  28. package/dist/conventional-commits/get-changelog-config.js +0 -99
  29. package/dist/conventional-commits/get-changelog-config.js.map +0 -1
  30. package/dist/conventional-commits/get-commits-since-last-release.d.ts +0 -23
  31. package/dist/conventional-commits/get-commits-since-last-release.js +0 -71
  32. package/dist/conventional-commits/get-commits-since-last-release.js.map +0 -1
  33. package/dist/conventional-commits/get-github-commits.d.ts +0 -11
  34. package/dist/conventional-commits/get-github-commits.js +0 -67
  35. package/dist/conventional-commits/get-github-commits.js.map +0 -1
  36. package/dist/conventional-commits/index.d.ts +0 -9
  37. package/dist/conventional-commits/index.js +0 -26
  38. package/dist/conventional-commits/index.js.map +0 -1
  39. package/dist/conventional-commits/make-bump-only-filter.d.ts +0 -6
  40. package/dist/conventional-commits/make-bump-only-filter.js +0 -23
  41. package/dist/conventional-commits/make-bump-only-filter.js.map +0 -1
  42. package/dist/conventional-commits/read-existing-changelog.d.ts +0 -7
  43. package/dist/conventional-commits/read-existing-changelog.js +0 -33
  44. package/dist/conventional-commits/read-existing-changelog.js.map +0 -1
  45. package/dist/conventional-commits/recommend-version.d.ts +0 -12
  46. package/dist/conventional-commits/recommend-version.js +0 -87
  47. package/dist/conventional-commits/recommend-version.js.map +0 -1
  48. package/dist/conventional-commits/update-changelog.d.ts +0 -13
  49. package/dist/conventional-commits/update-changelog.js +0 -97
  50. package/dist/conventional-commits/update-changelog.js.map +0 -1
  51. package/dist/conventional-commits/writer-opts-transform.d.ts +0 -38
  52. package/dist/conventional-commits/writer-opts-transform.js +0 -72
  53. package/dist/conventional-commits/writer-opts-transform.js.map +0 -1
  54. package/dist/git-clients/GitLabClient.d.ts +0 -8
  55. package/dist/git-clients/GitLabClient.js +0 -39
  56. package/dist/git-clients/GitLabClient.js.map +0 -1
  57. package/dist/git-clients/github-client.d.ts +0 -4
  58. package/dist/git-clients/github-client.js +0 -39
  59. package/dist/git-clients/github-client.js.map +0 -1
  60. package/dist/git-clients/gitlab-client.d.ts +0 -6
  61. package/dist/git-clients/gitlab-client.js +0 -22
  62. package/dist/git-clients/gitlab-client.js.map +0 -1
  63. package/dist/git-clients/index.d.ts +0 -2
  64. package/dist/git-clients/index.js +0 -19
  65. package/dist/git-clients/index.js.map +0 -1
  66. package/dist/otplease.d.ts +0 -14
  67. package/dist/otplease.js +0 -109
  68. package/dist/otplease.js.map +0 -1
  69. package/dist/utils/temp-write.d.ts +0 -12
  70. package/dist/utils/temp-write.js +0 -50
  71. package/dist/utils/temp-write.js.map +0 -1
@@ -1,23 +0,0 @@
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 {Boolean} [isIndependent]
9
- * @param {ExecOpts} [execOpts]
10
- * @returns {Promise<RemoteCommit[]>}
11
- */
12
- export declare function getCommitsSinceLastRelease(client: RemoteClientType, gitRemote: string, branchName: string, isIndependent?: boolean, execOpts?: ExecOpts): Promise<RemoteCommit[]>;
13
- /**
14
- * Find the oldest commit details since the last release tag or else if not tag exists then return first commit info
15
- * @param {ExecOpts} [execOpts]
16
- * @param {Boolean} [includeMergedTags]
17
- * @param {Boolean} [isIndependent]
18
- * @returns {*} - oldest commit detail (hash, date)
19
- */
20
- export declare function getOldestCommitSinceLastTag(execOpts?: ExecOpts, isIndependent?: boolean, includeMergedTags?: boolean): {
21
- commitHash: string;
22
- commitDate: string;
23
- };
@@ -1,71 +0,0 @@
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 {Boolean} [isIndependent]
19
- * @param {ExecOpts} [execOpts]
20
- * @returns {Promise<RemoteCommit[]>}
21
- */
22
- async function getCommitsSinceLastRelease(client, gitRemote, branchName, isIndependent, execOpts) {
23
- // get the last release tag date or the first commit date if no release tag found
24
- const { commitDate } = getOldestCommitSinceLastTag(execOpts, isIndependent, false);
25
- switch (client) {
26
- case 'github':
27
- return (0, get_github_commits_1.getGithubCommits)(gitRemote, branchName, commitDate, execOpts);
28
- case 'gitlab':
29
- default:
30
- 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.');
31
- }
32
- }
33
- exports.getCommitsSinceLastRelease = getCommitsSinceLastRelease;
34
- /**
35
- * Find the oldest commit details since the last release tag or else if not tag exists then return first commit info
36
- * @param {ExecOpts} [execOpts]
37
- * @param {Boolean} [includeMergedTags]
38
- * @param {Boolean} [isIndependent]
39
- * @returns {*} - oldest commit detail (hash, date)
40
- */
41
- function getOldestCommitSinceLastTag(execOpts, isIndependent, includeMergedTags) {
42
- let commitResult = '';
43
- const describeOptions = { ...execOpts };
44
- if (isIndependent) {
45
- describeOptions.match = '*@*'; // independent tag pattern
46
- }
47
- const { lastTagName } = (0, describe_ref_1.describeRefSync)(describeOptions, includeMergedTags);
48
- if (lastTagName) {
49
- const gitCommandArgs = ['log', `${lastTagName}..HEAD`, '--format="%h %aI"', '--reverse'];
50
- npmlog_1.default.silly('git', 'getCurrentBranchOldestCommitSinceLastTag');
51
- npmlog_1.default.verbose('exec', `git ${gitCommandArgs.join(' ')}`);
52
- let stdout = (0, child_process_1.execSync)('git', gitCommandArgs, execOpts);
53
- if (!stdout) {
54
- // in some occasion the previous git command might return nothing, in that case we'll return the tag detail instead
55
- stdout = (0, child_process_1.execSync)('git', ['log', '-1', '--format="%h %aI"', lastTagName], execOpts);
56
- }
57
- [commitResult] = stdout.split('\n');
58
- }
59
- else {
60
- const gitCommandArgs = ['log', '--oneline', '--format="%h %aI"', '--reverse', '--max-parents=0', 'HEAD'];
61
- npmlog_1.default.silly('git', 'getCurrentBranchFirstCommit');
62
- npmlog_1.default.verbose('exec', `git ${gitCommandArgs.join(' ')}`);
63
- commitResult = (0, child_process_1.execSync)('git', gitCommandArgs, execOpts);
64
- }
65
- const [, commitHash, commitDate] = /^"?([0-9a-f]+)\s([0-9\-|\+T\:]*)"?$/.exec(commitResult) || [];
66
- // prettier-ignore
67
- npmlog_1.default.info('oldestCommitSinceLastTag', `commit found since last tag: ${lastTagName} - (SHA) ${commitHash} - ${commitDate}`);
68
- return { commitHash, commitDate };
69
- }
70
- exports.getOldestCommitSinceLastTag = getOldestCommitSinceLastTag;
71
- //# sourceMappingURL=get-commits-since-last-release.js.map
@@ -1 +0,0 @@
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;;;;;;;;;GASG;AACI,KAAK,UAAU,0BAA0B,CAC9C,MAAwB,EACxB,SAAiB,EACjB,UAAkB,EAClB,aAAuB,EACvB,QAAmB;IAEnB,iFAAiF;IACjF,MAAM,EAAE,UAAU,EAAE,GAAG,2BAA2B,CAAC,QAAQ,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC;IAEnF,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;AApBD,gEAoBC;AAED;;;;;;GAMG;AACH,SAAgB,2BAA2B,CAAC,QAAmB,EAAE,aAAuB,EAAE,iBAA2B;IACnH,IAAI,YAAY,GAAG,EAAE,CAAC;IACtB,MAAM,eAAe,GAAuB,EAAE,GAAG,QAAQ,EAAE,CAAC;IAC5D,IAAI,aAAa,EAAE;QACjB,eAAe,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,0BAA0B;KAC1D;IACD,MAAM,EAAE,WAAW,EAAE,GAAG,IA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gCAAgC,WAAW,YAAY,UAAU,MAAM,UAAU,EAAE,CAAC,CAAC;IAE1H,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;AACpC,CAAC;AA9BD,kEA8BC"}
@@ -1,11 +0,0 @@
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[]>;
@@ -1,67 +0,0 @@
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.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 utils_1 = require("../utils");
11
- const QUERY_PAGE_SIZE = 100; // GitHub API is restricting max of 100 per query
12
- /**
13
- * Get all commits from GitHub remote repository, using GitHub Graphql API, by providing a date to query from
14
- * https://docs.github.com/en/graphql/reference/objects#repository
15
- * @param {RemoteClientType} client
16
- * @param {String} gitRemote
17
- * @param {String} branchName
18
- * @param {ExecOpts} execOpts
19
- * @returns {Promise<RemoteCommit[]>}
20
- */
21
- async function getGithubCommits(gitRemote, branchName, sinceDate, execOpts) {
22
- var _a, _b, _c, _d, _e, _f;
23
- const repo = (0, git_clients_1.parseGitRepo)(gitRemote, execOpts);
24
- const octokit = (0, git_clients_1.createGitHubClient)();
25
- const remoteCommits = [];
26
- let afterCursor = '';
27
- let hasNextPage = false;
28
- do {
29
- const afterCursorStr = afterCursor ? `, after: "${afterCursor}"` : '';
30
- const queryStr = (0, dedent_1.default)(`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 = (0, utils_1.getComplexObjectValue)(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
- //# sourceMappingURL=get-github-commits.js.map
@@ -1 +0,0 @@
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;AAElE,oCAAiD;AAEjD,MAAM,eAAe,GAAG,GAAG,CAAC,CAAC,iDAAiD;AAE9E;;;;;;;;GAQG;AACI,KAAK,UAAU,gBAAgB,CACpC,SAAiB,EACjB,UAAkB,EAClB,SAAiB,EACjB,QAAmB;;IAEnB,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,GAAG,IAAA,gBAAM,EACrB;;;;4DAIsD,cAAc;;;eAG3D,CACV,CAAC,IAAI,EAAE,CAAC;QAET,MAAM,QAAQ,GAA4B,MAAM,OAAO,CAAC,OAAO,CAAC,QAAQ,EAAE;YACxE,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW;YACX,UAAU;YACV,QAAQ,EAAE,eAAe;YACzB,KAAK,EAAE,SAAS;SACjB,CAAC,CAAC;QAEH,MAAM,WAAW,GAAG,IAAA,6BAAqB,EAA2B,QAAQ,EAAE,+BAA+B,CAAC,CAAC;QAC/G,MAAM,QAAQ,GAAG,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,QAAQ,CAAC;QACvC,WAAW,GAAG,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,WAAW,mCAAI,KAAK,CAAC;QAC7C,WAAW,GAAG,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,SAAS,mCAAI,EAAE,CAAC;QAExC,IAAI,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,KAAK,EAAE;YACtB,KAAK,MAAM,MAAM,IAAI,WAAW,CAAC,KAAK,EAAE;gBACtC,IAAI,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,MAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,CAAA,EAAE;oBACjC,aAAa,CAAC,IAAI,CAAC;wBACjB,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC;wBACrC,UAAU,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,CAAC,IAAI;wBAC/B,KAAK,EAAE,MAAA,MAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,0CAAE,IAAI,0CAAE,KAAK,mCAAI,EAAE;wBACxC,OAAO,EAAE,MAAA,MAAM,aAAN,MAAM,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;AAxDD,4CAwDC"}
@@ -1,9 +0,0 @@
1
- export * from './constants';
2
- export * from './get-changelog-config';
3
- export * from './get-commits-since-last-release';
4
- export * from './get-github-commits';
5
- export * from './make-bump-only-filter';
6
- export * from './read-existing-changelog';
7
- export * from './recommend-version';
8
- export * from './update-changelog';
9
- export * from './writer-opts-transform';
@@ -1,26 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./constants"), exports);
18
- __exportStar(require("./get-changelog-config"), exports);
19
- __exportStar(require("./get-commits-since-last-release"), exports);
20
- __exportStar(require("./get-github-commits"), exports);
21
- __exportStar(require("./make-bump-only-filter"), exports);
22
- __exportStar(require("./read-existing-changelog"), exports);
23
- __exportStar(require("./recommend-version"), exports);
24
- __exportStar(require("./update-changelog"), exports);
25
- __exportStar(require("./writer-opts-transform"), exports);
26
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
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,6 +0,0 @@
1
- import { Package } from '../package';
2
- /**
3
- * @param {import("@lerna/package").Package} pkg
4
- * @return {(entry: string) => string}
5
- */
6
- export declare function makeBumpOnlyFilter(pkg: Package): (newEntry: string) => string;
@@ -1,23 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.makeBumpOnlyFilter = void 0;
4
- const constants_1 = require("./constants");
5
- /**
6
- * @param {import("@lerna/package").Package} pkg
7
- * @return {(entry: string) => string}
8
- */
9
- function makeBumpOnlyFilter(pkg) {
10
- return (newEntry) => {
11
- // When force publishing, it is possible that there will be no actual changes, only a version bump.
12
- if (!newEntry.split('\n').some((line) => line.startsWith('*'))) {
13
- // Add a note to indicate that only a version bump has occurred.
14
- // TODO: actually list the dependencies that were bumped
15
- const message = `**Note:** Version bump only for package ${pkg.name}`;
16
- // the extra blank lines preserve the whitespace delimiting releases
17
- return [newEntry.trim(), message, constants_1.BLANK_LINE].join(constants_1.BLANK_LINE);
18
- }
19
- return newEntry;
20
- };
21
- }
22
- exports.makeBumpOnlyFilter = makeBumpOnlyFilter;
23
- //# sourceMappingURL=make-bump-only-filter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"make-bump-only-filter.js","sourceRoot":"","sources":["../../src/conventional-commits/make-bump-only-filter.ts"],"names":[],"mappings":";;;AACA,2CAAyC;AAEzC;;;GAGG;AACH,SAAgB,kBAAkB,CAAC,GAAY;IAC7C,OAAO,CAAC,QAAgB,EAAE,EAAE;QAC1B,mGAAmG;QACnG,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE;YAC9D,gEAAgE;YAChE,wDAAwD;YACxD,MAAM,OAAO,GAAG,2CAA2C,GAAG,CAAC,IAAI,EAAE,CAAC;YAEtE,oEAAoE;YACpE,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,sBAAU,CAAC,CAAC,IAAI,CAAC,sBAAU,CAAC,CAAC;SAChE;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;AACJ,CAAC;AAdD,gDAcC"}
@@ -1,7 +0,0 @@
1
- import { Package } from '../package';
2
- /**
3
- * Read the existing changelog, if it exists.
4
- * @param {import("@lerna/package").Package} pkg
5
- * @returns {Promise<[string, string]>} A tuple of changelog location and contents
6
- */
7
- export declare function readExistingChangelog(pkg: Package): Promise<any>;
@@ -1,33 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.readExistingChangelog = void 0;
7
- const fs_extra_1 = __importDefault(require("fs-extra"));
8
- const path_1 = __importDefault(require("path"));
9
- const constants_1 = require("./constants");
10
- /**
11
- * Read the existing changelog, if it exists.
12
- * @param {import("@lerna/package").Package} pkg
13
- * @returns {Promise<[string, string]>} A tuple of changelog location and contents
14
- */
15
- async function readExistingChangelog(pkg) {
16
- const changelogFileLoc = path_1.default.join(pkg.location, 'CHANGELOG.md');
17
- let chain = Promise.resolve();
18
- // catch allows missing file to pass without breaking chain
19
- chain = chain.then(() => fs_extra_1.default.readFile(changelogFileLoc, 'utf8').catch(() => ''));
20
- chain = chain.then((changelogContents) => {
21
- // Remove the header if it exists, thus starting at the first entry.
22
- const headerIndex = changelogContents.indexOf(constants_1.COMMIT_GUIDELINE);
23
- if (headerIndex !== -1) {
24
- return changelogContents.substring(headerIndex + constants_1.COMMIT_GUIDELINE.length + constants_1.BLANK_LINE.length);
25
- }
26
- return changelogContents;
27
- });
28
- // consumer expects resolved tuple
29
- chain = chain.then((changelogContents) => [changelogFileLoc, changelogContents]);
30
- return chain;
31
- }
32
- exports.readExistingChangelog = readExistingChangelog;
33
- //# sourceMappingURL=read-existing-changelog.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"read-existing-changelog.js","sourceRoot":"","sources":["../../src/conventional-commits/read-existing-changelog.ts"],"names":[],"mappings":";;;;;;AAAA,wDAA0B;AAC1B,gDAAwB;AAExB,2CAA2D;AAG3D;;;;GAIG;AACI,KAAK,UAAU,qBAAqB,CAAC,GAAY;IACtD,MAAM,gBAAgB,GAAG,cAAI,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IAEjE,IAAI,KAAK,GAAiB,OAAO,CAAC,OAAO,EAAE,CAAC;IAE5C,2DAA2D;IAC3D,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,kBAAE,CAAC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAEhF,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,iBAAyB,EAAE,EAAE;QAC/C,oEAAoE;QACpE,MAAM,WAAW,GAAG,iBAAiB,CAAC,OAAO,CAAC,4BAAgB,CAAC,CAAC;QAEhE,IAAI,WAAW,KAAK,CAAC,CAAC,EAAE;YACtB,OAAO,iBAAiB,CAAC,SAAS,CAAC,WAAW,GAAG,4BAAgB,CAAC,MAAM,GAAG,sBAAU,CAAC,MAAM,CAAC,CAAC;SAC/F;QAED,OAAO,iBAAiB,CAAC;IAC3B,CAAC,CAAC,CAAC;IAEH,kCAAkC;IAClC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAEjF,OAAO,KAAK,CAAC;AACf,CAAC;AAvBD,sDAuBC"}
@@ -1,12 +0,0 @@
1
- import { BaseChangelogOptions, VersioningStrategy } from '../models';
2
- import { Package } from '../package';
3
- import { PackageGraphNode } from '../package-graph';
4
- /**
5
- * @param {import('@lerna/package').Package} pkg
6
- * @param {import('..').VersioningStrategy} type
7
- * @param {import('..').BaseChangelogOptions & { prereleaseId?: string }} commandOptions
8
- */
9
- export declare function recommendVersion(pkg: Package | PackageGraphNode, type: VersioningStrategy, recommendationOptions: BaseChangelogOptions & {
10
- prereleaseId?: string;
11
- conventionalBumpPrerelease?: boolean;
12
- }): Promise<string | null>;
@@ -1,87 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.recommendVersion = void 0;
7
- const conventional_recommended_bump_1 = __importDefault(require("conventional-recommended-bump"));
8
- const npmlog_1 = __importDefault(require("npmlog"));
9
- const semver_1 = __importDefault(require("semver"));
10
- const get_changelog_config_1 = require("./get-changelog-config");
11
- /**
12
- * @param {import('@lerna/package').Package} pkg
13
- * @param {import('..').VersioningStrategy} type
14
- * @param {import('..').BaseChangelogOptions & { prereleaseId?: string }} commandOptions
15
- */
16
- async function recommendVersion(pkg, type, recommendationOptions) {
17
- const { changelogPreset, rootPath, tagPrefix, prereleaseId, conventionalBumpPrerelease } = recommendationOptions;
18
- npmlog_1.default.silly(type, 'for %s at %s', pkg.name, pkg.location);
19
- const options = {
20
- path: pkg.location,
21
- };
22
- if (type === 'independent') {
23
- options.lernaPackage = pkg.name;
24
- }
25
- else {
26
- // only fixed mode can have a custom tag prefix
27
- options.tagPrefix = tagPrefix;
28
- }
29
- const shouldBumpPrerelease = (releaseType, version) => {
30
- if (!semver_1.default.prerelease(version)) {
31
- return true;
32
- }
33
- switch (releaseType) {
34
- case 'major':
35
- return semver_1.default.minor(version) !== 0 || semver_1.default.patch(version) !== 0;
36
- case 'minor':
37
- return semver_1.default.patch(version) !== 0;
38
- default:
39
- return false;
40
- }
41
- };
42
- // 'new' preset API
43
- options.config = (await get_changelog_config_1.GetChangelogConfig.getChangelogConfig(changelogPreset, rootPath));
44
- // Ensure potential ValidationError in getChangelogConfig() is propagated correctly
45
- return new Promise((resolve, reject) => {
46
- (0, conventional_recommended_bump_1.default)(options, (err, data) => {
47
- if (err) {
48
- return reject(err);
49
- }
50
- // result might be undefined because some presets are not consistent with angular
51
- // we still need to bump _something_ because lerna-lite saw a change here
52
- let releaseType = data.releaseType || 'patch';
53
- if (prereleaseId) {
54
- const shouldBump = conventionalBumpPrerelease || shouldBumpPrerelease(releaseType, pkg.version);
55
- const prereleaseType = shouldBump ? `pre${releaseType}` : 'prerelease';
56
- npmlog_1.default.verbose(type, 'increment %s by %s - %s', pkg.version, prereleaseType, pkg.name);
57
- resolve(semver_1.default.inc(pkg.version, prereleaseType, prereleaseId));
58
- }
59
- else {
60
- if (semver_1.default.major(pkg.version) === 0) {
61
- // According to semver, major version zero (0.y.z) is for initial
62
- // development. Anything MAY change at any time. The public API
63
- // SHOULD NOT be considered stable. The version 1.0.0 defines
64
- // the (initial stable) public API.
65
- //
66
- // To allow monorepos to use major version zero meaningfully,
67
- // the transition from 0.x to 1.x must be explicitly requested
68
- // by the user. Breaking changes MUST NOT automatically bump
69
- // the major version from 0.x to 1.x.
70
- //
71
- // The usual convention is to use semver-patch bumps for bugfix
72
- // releases and semver-minor for everything else, including
73
- // breaking changes. This matches the behavior of `^` operator
74
- // as implemented by `npm`.
75
- //
76
- if (releaseType === 'major') {
77
- releaseType = 'minor';
78
- }
79
- }
80
- npmlog_1.default.verbose(type, 'increment %s by %s - %s', pkg.version, releaseType, pkg.name);
81
- resolve(semver_1.default.inc(pkg.version, releaseType));
82
- }
83
- });
84
- });
85
- }
86
- exports.recommendVersion = recommendVersion;
87
- //# sourceMappingURL=recommend-version.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"recommend-version.js","sourceRoot":"","sources":["../../src/conventional-commits/recommend-version.ts"],"names":[],"mappings":";;;;;;AAAA,kGAAwE;AAExE,oDAAyB;AACzB,oDAA6C;AAG7C,iEAA4D;AAI5D;;;;GAIG;AACI,KAAK,UAAU,gBAAgB,CACpC,GAA+B,EAC/B,IAAwB,EACxB,qBAA6G;IAE7G,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,0BAA0B,EAAE,GAAG,qBAAqB,CAAC;IAEjH,gBAAG,CAAC,KAAK,CAAC,IAAI,EAAE,cAAc,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;IAExD,MAAM,OAAO,GAAwC;QACnD,IAAI,EAAE,GAAG,CAAC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UAAU,CAAC,CAAC,CAAC,MAAM,WAAW,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC;gBACpF,gBAAG,CAAC,OAAO,CAAC,IAAI,EAAE,yBAAyB,EAAE,GAAG,CAAC,OAAO,EAAE,cAAc,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;gBACpF,OAAO,CAAC,gBAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC,CAAC;aAChE;iBAAM;gBACL,IAAI,gBAAM,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;oBACnC,iEAAiE;oBACjE,+DAA+D;oBAC/D,6DAA6D;oBAC7D,mCAAmC;oBACnC,EAAE;oBACF,6DAA6D;oBAC7D,8DAA8D;oBAC9D,4DAA4D;oBAC5D,qCAAqC;oBACrC,EAAE;oBACF,+DAA+D;oBAC/D,2DAA2D;oBAC3D,8DAA8D;oBAC9D,2BAA2B;oBAC3B,EAAE;oBACF,IAAI,WAAW,KAAK,OAAO,EAAE;wBAC3B,WAAW,GAAG,OAAO,CAAC;qBACvB;iBACF;gBACD,gBAAG,CAAC,OAAO,CAAC,IAAI,EAAE,yBAAyB,EAAE,GAAG,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;gBACjF,OAAO,CAAC,gBAAM,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC;aAC/C;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAlFD,4CAkFC"}
@@ -1,13 +0,0 @@
1
- import { ChangelogType, UpdateChangelogOption } from '../models';
2
- import { Package } from '../package';
3
- /**
4
- * Update changelog with the commits of the new release
5
- * @param {Package} pkg
6
- * @param {ChangelogType} type
7
- * @param {UpdateChangelogOption} commandOptions
8
- */
9
- export declare function updateChangelog(pkg: Package, type: ChangelogType, updateOptions: UpdateChangelogOption): Promise<{
10
- logPath: any;
11
- content: string;
12
- newEntry: string;
13
- }>;
@@ -1,97 +0,0 @@
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.updateChangelog = void 0;
7
- const conventional_changelog_core_1 = __importDefault(require("conventional-changelog-core"));
8
- const fs_extra_1 = __importDefault(require("fs-extra"));
9
- const get_stream_1 = __importDefault(require("get-stream"));
10
- const npmlog_1 = __importDefault(require("npmlog"));
11
- const constants_1 = require("./constants");
12
- const get_changelog_config_1 = require("./get-changelog-config");
13
- const make_bump_only_filter_1 = require("./make-bump-only-filter");
14
- const read_existing_changelog_1 = require("./read-existing-changelog");
15
- const writer_opts_transform_1 = require("./writer-opts-transform");
16
- /**
17
- * Update changelog with the commits of the new release
18
- * @param {Package} pkg
19
- * @param {ChangelogType} type
20
- * @param {UpdateChangelogOption} commandOptions
21
- */
22
- async function updateChangelog(pkg, type, updateOptions) {
23
- npmlog_1.default.silly(type, 'for %s at %s', pkg.name, pkg.location);
24
- const { changelogPreset, changelogIncludeCommitsGitAuthor, changelogIncludeCommitsClientLogin, changelogHeaderMessage = '', changelogVersionMessage = '', commitsSinceLastRelease, rootPath, tagPrefix = 'v', version, } = updateOptions;
25
- const config = await get_changelog_config_1.GetChangelogConfig.getChangelogConfig(changelogPreset, rootPath);
26
- const options = {};
27
- const context = {}; // pass as positional because cc-core's merge-config is wack
28
- const writerOpts = {};
29
- // cc-core mutates input :P
30
- if (config.conventionalChangelog) {
31
- // "new" preset API
32
- options.config = Object.assign({}, config.conventionalChangelog);
33
- }
34
- else {
35
- // "old" preset API
36
- options.config = Object.assign({}, config);
37
- }
38
- // NOTE: must pass as positional argument due to weird bug in merge-config
39
- const gitRawCommitsOpts = Object.assign({}, options.config.gitRawCommitsOpts);
40
- // are we including commit author name/email or remote client login name
41
- if (changelogIncludeCommitsGitAuthor || changelogIncludeCommitsGitAuthor === '') {
42
- (0, writer_opts_transform_1.setConfigChangelogCommitGitAuthor)(config, gitRawCommitsOpts, writerOpts, changelogIncludeCommitsGitAuthor);
43
- }
44
- else if ((changelogIncludeCommitsClientLogin || changelogIncludeCommitsClientLogin === '') &&
45
- commitsSinceLastRelease) {
46
- // prettier-ignore
47
- (0, writer_opts_transform_1.setConfigChangelogCommitClientLogin)(config, gitRawCommitsOpts, writerOpts, commitsSinceLastRelease, changelogIncludeCommitsClientLogin);
48
- }
49
- if (type === 'root') {
50
- context.version = version;
51
- // preserve tagPrefix because cc-core can't find the currentTag otherwise
52
- context.currentTag = `${tagPrefix}${version}`;
53
- // root changelogs are only enabled in fixed mode, and need the proper tag prefix
54
- options.tagPrefix = tagPrefix;
55
- }
56
- else {
57
- // "fixed" or "independent"
58
- gitRawCommitsOpts.path = pkg.location;
59
- options.pkg = { path: pkg.manifestLocation };
60
- if (type === 'independent') {
61
- options.lernaPackage = pkg.name;
62
- }
63
- else {
64
- // only fixed mode can have a custom tag prefix
65
- options.tagPrefix = tagPrefix;
66
- // preserve tagPrefix because cc-core can't find the currentTag otherwise
67
- context.currentTag = `${tagPrefix}${pkg.version}`;
68
- context.version = pkg.version; // TODO investigate why Lerna doesn't have this line
69
- }
70
- }
71
- // generate the markdown for the upcoming release.
72
- const changelogStream = (0, conventional_changelog_core_1.default)(options, context, gitRawCommitsOpts, undefined, writerOpts);
73
- return Promise.all([
74
- // prettier-ignore
75
- (0, get_stream_1.default)(changelogStream).then((0, make_bump_only_filter_1.makeBumpOnlyFilter)(pkg)),
76
- (0, read_existing_changelog_1.readExistingChangelog)(pkg),
77
- ]).then(([inputEntry, [changelogFileLoc, changelogContents]]) => {
78
- let newEntry = inputEntry;
79
- npmlog_1.default.silly(type, 'writing new entry: %j', newEntry);
80
- const changelogVersion = type === 'root' ? changelogVersionMessage : '';
81
- const changelogHeader = constants_1.CHANGELOG_HEADER.replace(/%s/g, (changelogHeaderMessage === null || changelogHeaderMessage === void 0 ? void 0 : changelogHeaderMessage.length) > 0 ? changelogHeaderMessage + constants_1.EOL : '');
82
- const content = [changelogHeader, changelogVersion, newEntry, changelogContents]
83
- .join(constants_1.BLANK_LINE)
84
- .trim()
85
- .replace(/[\r\n]{2,}/gm, '\n\n'); // conventional-changelog adds way too many extra line breaks, let's remove a few of them
86
- return fs_extra_1.default.writeFile(changelogFileLoc, content + constants_1.EOL).then(() => {
87
- npmlog_1.default.verbose(type, 'wrote', changelogFileLoc);
88
- return {
89
- logPath: changelogFileLoc,
90
- content,
91
- newEntry,
92
- };
93
- });
94
- });
95
- }
96
- exports.updateChangelog = updateChangelog;
97
- //# sourceMappingURL=update-changelog.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-changelog.js","sourceRoot":"","sources":["../../src/conventional-commits/update-changelog.ts"],"names":[],"mappings":";;;;;;AAAA,8FAAiF;AAEjF,wDAA0B;AAC1B,4DAAmC;AACnC,oDAAyB;AAEzB,2CAAgE;AAChE,iEAA4D;AAC5D,mEAA6D;AAC7D,uEAAkE;AAGlE,mEAAiH;AAEjH;;;;;GAKG;AACI,KAAK,UAAU,eAAe,CAAC,GAAY,EAAE,IAAmB,EAAE,aAAoC;IAC3G,gBAAG,CAAC,KAAK,CAAC,IAAI,EAAE,cAAc,EAAE,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;IAExD,MAAM,EACJ,eAAe,EACf,gCAAgC,EAChC,kCAAkC,EAClC,sBAAsB,GAAG,EAAE,EAC3B,uBAAuB,GAAG,EAAE,EAC5B,uBAAuB,EACvB,QAAQ,EACR,SAAS,GAAG,GAAG,EACf,OAAO,GACR,GAAG,aAAa,CAAC;IAElB,MAAM,MAAM,GAAG,MAAM,yCAAkB,CAAC,kBAAkB,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC;IACtF,MAAM,OAAO,GAAG,EAAiG,CAAC;IAClH,MAAM,OAAO,GAAG,EAAa,CAAC,CAAC,4DAA4D;IAC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CAAC,sBAAU,CAAC;aAChB,IAAI,EAAE;aACN,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC,yFAAyF;QAE7H,OAAO,kBAAE,CAAC,SAAS,CAAC,gBAAgB,EAAE,OAAO,GAAG,eAAG,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;YAC7D,gBAAG,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAC;YAE7C,OAAO;gBACL,OAAO,EAAE,gBAAgB;gBACzB,OAAO;gBACP,QAAQ;aACT,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AArGD,0CAqGC"}
@@ -1,38 +0,0 @@
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>;