git-release-manager 0.0.0 → 0.0.4
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/src/PackageJson.js +3 -0
- package/dist/src/PackageJson.js.map +1 -0
- package/dist/src/cli/types/ChangelogCliArgs.js +3 -0
- package/dist/src/cli/types/ChangelogCliArgs.js.map +1 -0
- package/dist/src/cli/types/ChnagelogCliArgs.js +3 -0
- package/dist/src/cli/types/ChnagelogCliArgs.js.map +1 -0
- package/dist/src/cli/types/CliArgs.js +3 -0
- package/dist/src/cli/types/CliArgs.js.map +1 -0
- package/dist/src/config/configLoader.js +61 -0
- package/dist/src/config/configLoader.js.map +1 -0
- package/dist/src/config/configManager.js +66 -0
- package/dist/src/config/configManager.js.map +1 -0
- package/dist/src/config/constants.js +10 -0
- package/dist/src/config/constants.js.map +1 -0
- package/dist/src/config/defaults/config.json +232 -0
- package/dist/src/config/types/ChannelType.js +3 -0
- package/dist/src/config/types/ChannelType.js.map +1 -0
- package/dist/src/config/types/CommitType.js +3 -0
- package/dist/src/config/types/CommitType.js.map +1 -0
- package/dist/src/config/types/Config.js +3 -0
- package/dist/src/config/types/Config.js.map +1 -0
- package/dist/src/config/types/FileGroups.js +3 -0
- package/dist/src/config/types/FileGroups.js.map +1 -0
- package/dist/src/config/types/LinkType.js +3 -0
- package/dist/src/config/types/LinkType.js.map +1 -0
- package/dist/src/config/types/MentionType.js +3 -0
- package/dist/src/config/types/MentionType.js.map +1 -0
- package/dist/src/config/types/NoteType.js +3 -0
- package/dist/src/config/types/NoteType.js.map +1 -0
- package/dist/src/config/types/Options.js +3 -0
- package/dist/src/config/types/Options.js.map +1 -0
- package/dist/src/core/app-old.js +35 -0
- package/dist/src/core/app-old.js.map +1 -0
- package/dist/src/core/app.js +19 -0
- package/dist/src/core/app.js.map +1 -0
- package/dist/src/core/changelog/app.js +19 -0
- package/dist/src/core/changelog/app.js.map +1 -0
- package/dist/src/core/gitOperations.js +95 -0
- package/dist/src/core/gitOperations.js.map +1 -0
- package/dist/src/core/rangeOperations.js +14 -0
- package/dist/src/core/rangeOperations.js.map +1 -0
- package/dist/src/core/templateOperations.js +157 -0
- package/dist/src/core/templateOperations.js.map +1 -0
- package/dist/src/core/types/ChangeInformation.js +3 -0
- package/dist/src/core/types/ChangeInformation.js.map +1 -0
- package/dist/src/core/types/Context.js +3 -0
- package/dist/src/core/types/Context.js.map +1 -0
- package/dist/src/core/types/RangeDetails.js +3 -0
- package/dist/src/core/types/RangeDetails.js.map +1 -0
- package/dist/src/core/types/RangeInfo.js +3 -0
- package/dist/src/core/types/RangeInfo.js.map +1 -0
- package/dist/src/core/types/ReferenceTypesEnum.js +12 -0
- package/dist/src/core/types/ReferenceTypesEnum.js.map +1 -0
- package/dist/src/core/types/Repository.js +3 -0
- package/dist/src/core/types/Repository.js.map +1 -0
- package/dist/src/git/commits/commitProcessor.js +52 -0
- package/dist/src/git/commits/commitProcessor.js.map +1 -0
- package/dist/src/git/commits/gitLogFetcher.js +27 -0
- package/dist/src/git/commits/gitLogFetcher.js.map +1 -0
- package/dist/src/git/commits/index.js +136 -0
- package/dist/src/git/commits/index.js.map +1 -0
- package/dist/src/git/commits/profileHandler.js +43 -0
- package/dist/src/git/commits/profileHandler.js.map +1 -0
- package/dist/src/git/commits/regexHandlers.js +27 -0
- package/dist/src/git/commits/regexHandlers.js.map +1 -0
- package/dist/src/git/commits.js +136 -0
- package/dist/src/git/commits.js.map +1 -0
- package/dist/src/git/context/branchHandler.js +23 -0
- package/dist/src/git/context/branchHandler.js.map +1 -0
- package/dist/src/git/context/commitHandler.js +30 -0
- package/dist/src/git/context/commitHandler.js.map +1 -0
- package/dist/src/git/context/index.js +31 -0
- package/dist/src/git/context/index.js.map +1 -0
- package/dist/src/git/context/remoteHandler.js +25 -0
- package/dist/src/git/context/remoteHandler.js.map +1 -0
- package/dist/src/git/context/statusHandler.js +21 -0
- package/dist/src/git/context/statusHandler.js.map +1 -0
- package/dist/src/git/context/tagHandler.js +21 -0
- package/dist/src/git/context/tagHandler.js.map +1 -0
- package/dist/src/git/context.js +95 -0
- package/dist/src/git/context.js.map +1 -0
- package/dist/src/git/types/Author.js +3 -0
- package/dist/src/git/types/Author.js.map +1 -0
- package/dist/src/git/types/BranchInfo.js +3 -0
- package/dist/src/git/types/BranchInfo.js.map +1 -0
- package/dist/src/git/types/CommitContent.js +3 -0
- package/dist/src/git/types/CommitContent.js.map +1 -0
- package/dist/src/git/types/CommitInfo.js +3 -0
- package/dist/src/git/types/CommitInfo.js.map +1 -0
- package/dist/src/git/types/CommitType.js +3 -0
- package/dist/src/git/types/CommitType.js.map +1 -0
- package/dist/src/git/types/CommitType2.js +3 -0
- package/dist/src/git/types/CommitType2.js.map +1 -0
- package/dist/src/git/types/GitCommit.js +3 -0
- package/dist/src/git/types/GitCommit.js.map +1 -0
- package/dist/src/git/types/GitContext.js +3 -0
- package/dist/src/git/types/GitContext.js.map +1 -0
- package/dist/src/git/types/Link.js +3 -0
- package/dist/src/git/types/Link.js.map +1 -0
- package/dist/src/git/types/LinkType-.js +3 -0
- package/dist/src/git/types/LinkType-.js.map +1 -0
- package/dist/src/git/types/LinkType.js +3 -0
- package/dist/src/git/types/LinkType.js.map +1 -0
- package/dist/src/git/types/Mention.js +3 -0
- package/dist/src/git/types/Mention.js.map +1 -0
- package/dist/src/git/types/MentionType-.js +3 -0
- package/dist/src/git/types/MentionType-.js.map +1 -0
- package/dist/src/git/types/MentionType.js +3 -0
- package/dist/src/git/types/MentionType.js.map +1 -0
- package/dist/src/git/types/Note.js +3 -0
- package/dist/src/git/types/Note.js.map +1 -0
- package/dist/src/git/types/RemoteInfo.js +3 -0
- package/dist/src/git/types/RemoteInfo.js.map +1 -0
- package/dist/src/git/types/StatusInfo.js +3 -0
- package/dist/src/git/types/StatusInfo.js.map +1 -0
- package/dist/src/git/types/TagInfo.js +3 -0
- package/dist/src/git/types/TagInfo.js.map +1 -0
- package/dist/src/git/utils/branchUtils.js +56 -0
- package/dist/src/git/utils/branchUtils.js.map +1 -0
- package/dist/src/git/utils/commitUtils.js +50 -0
- package/dist/src/git/utils/commitUtils.js.map +1 -0
- package/dist/src/git/utils/logUtils.js +18 -0
- package/dist/src/git/utils/logUtils.js.map +1 -0
- package/dist/src/git/utils/refUtils.js +41 -0
- package/dist/src/git/utils/refUtils.js.map +1 -0
- package/dist/src/git/utils/referenceUtils.js +138 -0
- package/dist/src/git/utils/referenceUtils.js.map +1 -0
- package/dist/src/git/utils/tagUtils.js +54 -0
- package/dist/src/git/utils/tagUtils.js.map +1 -0
- package/dist/src/index.js +90 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/main.js +16 -0
- package/dist/src/main.js.map +1 -0
- package/dist/src/modules/changelog/templateOperations.js +129 -0
- package/dist/src/modules/changelog/templateOperations.js.map +1 -0
- package/dist/src/modules/changes/types/ChangeInformation.js +3 -0
- package/dist/src/modules/changes/types/ChangeInformation.js.map +1 -0
- package/dist/src/modules/changes/types/Context.js +3 -0
- package/dist/src/modules/changes/types/Context.js.map +1 -0
- package/dist/src/modules/changes/types/RangeDetail.js +3 -0
- package/dist/src/modules/changes/types/RangeDetail.js.map +1 -0
- package/dist/src/modules/changes/types/RangeDetails.js +3 -0
- package/dist/src/modules/changes/types/RangeDetails.js.map +1 -0
- package/dist/src/modules/changes/types/RangeInfo.js +8 -0
- package/dist/src/modules/changes/types/RangeInfo.js.map +1 -0
- package/dist/src/modules/changes/types/RangeSummary.js +3 -0
- package/dist/src/modules/changes/types/RangeSummary.js.map +1 -0
- package/dist/src/modules/changes/types/ReferenceTypesEnum.js +12 -0
- package/dist/src/modules/changes/types/ReferenceTypesEnum.js.map +1 -0
- package/dist/src/modules/git/commits/commitProcessor.js +52 -0
- package/dist/src/modules/git/commits/commitProcessor.js.map +1 -0
- package/dist/src/modules/git/commits/gitLogFetcher.js +27 -0
- package/dist/src/modules/git/commits/gitLogFetcher.js.map +1 -0
- package/dist/src/modules/git/commits/index.js +136 -0
- package/dist/src/modules/git/commits/index.js.map +1 -0
- package/dist/src/modules/git/commits/profileHandler.js +45 -0
- package/dist/src/modules/git/commits/profileHandler.js.map +1 -0
- package/dist/src/modules/git/commits/regexHandlers.js +27 -0
- package/dist/src/modules/git/commits/regexHandlers.js.map +1 -0
- package/dist/src/modules/git/context/branchHandler.js +23 -0
- package/dist/src/modules/git/context/branchHandler.js.map +1 -0
- package/dist/src/modules/git/context/commitHandler.js +34 -0
- package/dist/src/modules/git/context/commitHandler.js.map +1 -0
- package/dist/src/modules/git/context/index.js +28 -0
- package/dist/src/modules/git/context/index.js.map +1 -0
- package/dist/src/modules/git/context/remoteHandler.js +25 -0
- package/dist/src/modules/git/context/remoteHandler.js.map +1 -0
- package/dist/src/modules/git/context/statusHandler.js +21 -0
- package/dist/src/modules/git/context/statusHandler.js.map +1 -0
- package/dist/src/modules/git/context/tagHandler.js +33 -0
- package/dist/src/modules/git/context/tagHandler.js.map +1 -0
- package/dist/src/modules/git/gitOperations.js +56 -0
- package/dist/src/modules/git/gitOperations.js.map +1 -0
- package/dist/src/modules/git/types/Author.js +3 -0
- package/dist/src/modules/git/types/Author.js.map +1 -0
- package/dist/src/modules/git/types/Branch.js +3 -0
- package/dist/src/modules/git/types/Branch.js.map +1 -0
- package/dist/src/modules/git/types/BranchInfo.js +3 -0
- package/dist/src/modules/git/types/BranchInfo.js.map +1 -0
- package/dist/src/modules/git/types/CommitContent.js +3 -0
- package/dist/src/modules/git/types/CommitContent.js.map +1 -0
- package/dist/src/modules/git/types/CommitInfo.js +3 -0
- package/dist/src/modules/git/types/CommitInfo.js.map +1 -0
- package/dist/src/modules/git/types/CommitType.js +3 -0
- package/dist/src/modules/git/types/CommitType.js.map +1 -0
- package/dist/src/modules/git/types/GitCommit.js +3 -0
- package/dist/src/modules/git/types/GitCommit.js.map +1 -0
- package/dist/src/modules/git/types/GitContext.js +3 -0
- package/dist/src/modules/git/types/GitContext.js.map +1 -0
- package/dist/src/modules/git/types/GitReference.js +3 -0
- package/dist/src/modules/git/types/GitReference.js.map +1 -0
- package/dist/src/modules/git/types/Link.js +3 -0
- package/dist/src/modules/git/types/Link.js.map +1 -0
- package/dist/src/modules/git/types/Mention.js +3 -0
- package/dist/src/modules/git/types/Mention.js.map +1 -0
- package/dist/src/modules/git/types/Note.js +3 -0
- package/dist/src/modules/git/types/Note.js.map +1 -0
- package/dist/src/modules/git/types/RemoteInfo.js +3 -0
- package/dist/src/modules/git/types/RemoteInfo.js.map +1 -0
- package/dist/src/modules/git/types/Repository.js +3 -0
- package/dist/src/modules/git/types/Repository.js.map +1 -0
- package/dist/src/modules/git/types/StatusInfo.js +3 -0
- package/dist/src/modules/git/types/StatusInfo.js.map +1 -0
- package/dist/src/modules/git/types/Tag.js +3 -0
- package/dist/src/modules/git/types/Tag.js.map +1 -0
- package/dist/src/modules/git/types/TagInfo.js +3 -0
- package/dist/src/modules/git/types/TagInfo.js.map +1 -0
- package/dist/src/modules/git/utils/branchUtils.js +56 -0
- package/dist/src/modules/git/utils/branchUtils.js.map +1 -0
- package/dist/src/modules/git/utils/commitUtils.js +50 -0
- package/dist/src/modules/git/utils/commitUtils.js.map +1 -0
- package/dist/src/modules/git/utils/logUtils.js +18 -0
- package/dist/src/modules/git/utils/logUtils.js.map +1 -0
- package/dist/src/modules/git/utils/rangeOperations.js +14 -0
- package/dist/src/modules/git/utils/rangeOperations.js.map +1 -0
- package/dist/src/modules/git/utils/refUtils.js +41 -0
- package/dist/src/modules/git/utils/refUtils.js.map +1 -0
- package/dist/src/modules/git/utils/referenceUtils.js +132 -0
- package/dist/src/modules/git/utils/referenceUtils.js.map +1 -0
- package/dist/src/modules/git/utils/tagUtils.js +54 -0
- package/dist/src/modules/git/utils/tagUtils.js.map +1 -0
- package/dist/src/modules/output/writer.js +46 -0
- package/dist/src/modules/output/writer.js.map +1 -0
- package/dist/src/modules/repository/types/Repository.js +3 -0
- package/dist/src/modules/repository/types/Repository.js.map +1 -0
- package/dist/src/modules/sections/contributors.js +50 -0
- package/dist/src/modules/sections/contributors.js.map +1 -0
- package/dist/src/modules/sections/grouping.js +64 -0
- package/dist/src/modules/sections/grouping.js.map +1 -0
- package/dist/src/modules/sections/index.js +19 -0
- package/dist/src/modules/sections/index.js.map +1 -0
- package/dist/src/modules/sections/summarizing.js +75 -0
- package/dist/src/modules/sections/summarizing.js.map +1 -0
- package/dist/src/modules/sections/types/Contributor.js +3 -0
- package/dist/src/modules/sections/types/Contributor.js.map +1 -0
- package/dist/src/modules/sections/types/Group.js +3 -0
- package/dist/src/modules/sections/types/Group.js.map +1 -0
- package/dist/src/modules/sections/types/SectionSummary.js +3 -0
- package/dist/src/modules/sections/types/SectionSummary.js.map +1 -0
- package/dist/src/modules/sections/types/Sections.js +3 -0
- package/dist/src/modules/sections/types/Sections.js.map +1 -0
- package/dist/src/modules/templates/constants.js +10 -0
- package/dist/src/modules/templates/constants.js.map +1 -0
- package/dist/src/modules/templates/defaults/changelog.detailed.ejs +111 -0
- package/dist/src/modules/templates/defaults/changelog.ejs +68 -0
- package/dist/src/modules/templates/templateRenderer.js +46 -0
- package/dist/src/modules/templates/templateRenderer.js.map +1 -0
- package/dist/src/modules/templates/templateResolver.js +70 -0
- package/dist/src/modules/templates/templateResolver.js.map +1 -0
- package/dist/src/output/writer.js +46 -0
- package/dist/src/output/writer.js.map +1 -0
- package/dist/src/sections/contributors.js +50 -0
- package/dist/src/sections/contributors.js.map +1 -0
- package/dist/src/sections/grouping.js +70 -0
- package/dist/src/sections/grouping.js.map +1 -0
- package/dist/src/sections/index.js +20 -0
- package/dist/src/sections/index.js.map +1 -0
- package/dist/src/sections/summarizing.js +79 -0
- package/dist/src/sections/summarizing.js.map +1 -0
- package/dist/src/sections/types/Contributor.js +15 -0
- package/dist/src/sections/types/Contributor.js.map +1 -0
- package/dist/src/sections/types/Group.js +3 -0
- package/dist/src/sections/types/Group.js.map +1 -0
- package/dist/src/sections/types/SectionSummary.js +13 -0
- package/dist/src/sections/types/SectionSummary.js.map +1 -0
- package/dist/src/sections/types/Sections.js +3 -0
- package/dist/src/sections/types/Sections.js.map +1 -0
- package/dist/src/templates/constants.js +10 -0
- package/dist/src/templates/constants.js.map +1 -0
- package/dist/src/templates/defaults/changelog.detailed.ejs +111 -0
- package/dist/src/templates/defaults/changelog.ejs +68 -0
- package/dist/src/templates/index.js +100 -0
- package/dist/src/templates/index.js.map +1 -0
- package/dist/src/templates/templateRenderer.js +46 -0
- package/dist/src/templates/templateRenderer.js.map +1 -0
- package/dist/src/templates/templateResolver.js +70 -0
- package/dist/src/templates/templateResolver.js.map +1 -0
- package/dist/src/types/PackageJson.js +3 -0
- package/dist/src/types/PackageJson.js.map +1 -0
- package/dist/src/utils/cmd.js +27 -0
- package/dist/src/utils/cmd.js.map +1 -0
- package/dist/src/utils/date.js +20 -0
- package/dist/src/utils/date.js.map +1 -0
- package/dist/src/utils/git-utils.js +279 -0
- package/dist/src/utils/git-utils.js.map +1 -0
- package/dist/src/utils/helpers.js +10 -0
- package/dist/src/utils/helpers.js.map +1 -0
- package/dist/test/config/configLoader/loadConfigFile.test.js +94 -0
- package/dist/test/config/configLoader/loadConfigFile.test.js.map +1 -0
- package/dist/test/config/configManager/readConfig.test.js +124 -0
- package/dist/test/config/configManager/readConfig.test.js.map +1 -0
- package/package.json +7 -7
|
@@ -0,0 +1,46 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.writeOutput = writeOutput;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
function writeOutput(data, output) {
|
|
39
|
+
if (!output || output === 'stdout') {
|
|
40
|
+
console.log(data);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
fs.writeFileSync(output, data + '\n');
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=writer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writer.js","sourceRoot":"","sources":["../../../../src/modules/output/writer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,kCAMC;AARD,uCAAwB;AAExB,SAAgB,WAAW,CAAC,IAAY,EAAE,MAAe;IACrD,IAAI,CAAC,MAAM,IAAI,MAAM,KAAK,QAAQ,EAAE,CAAC;QACjC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IACrB,CAAC;SAAM,CAAC;QACJ,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,IAAI,GAAG,IAAI,CAAC,CAAA;IACzC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Repository.js","sourceRoot":"","sources":["../../../../../src/modules/repository/types/Repository.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getContributors = getContributors;
|
|
4
|
+
function getContributors(commits, config) {
|
|
5
|
+
const contributors = {};
|
|
6
|
+
commits.forEach(commit => {
|
|
7
|
+
const allContributors = [commit.author, ...(commit.mentions || [])];
|
|
8
|
+
allContributors.forEach(contributor => {
|
|
9
|
+
var _a;
|
|
10
|
+
const key = contributor.email;
|
|
11
|
+
if (!contributors[key]) {
|
|
12
|
+
contributors[key] = {
|
|
13
|
+
...contributor,
|
|
14
|
+
groups: [],
|
|
15
|
+
files: [],
|
|
16
|
+
commits: [],
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
const normalizePath = (path) => path.replace(/\\/g, '/');
|
|
20
|
+
commit.files.forEach(file => {
|
|
21
|
+
var _a;
|
|
22
|
+
const normalizedFile = normalizePath(file);
|
|
23
|
+
Object.entries(config.fileGroups).forEach(([group, paths]) => {
|
|
24
|
+
var _a;
|
|
25
|
+
if (paths.some((path) => normalizedFile.startsWith(normalizePath(path)))) {
|
|
26
|
+
let groupObj = (_a = contributors[key].groups) === null || _a === void 0 ? void 0 : _a.find((g) => g.title === group);
|
|
27
|
+
if (!groupObj) {
|
|
28
|
+
groupObj = { title: group, files: [], commits: [] };
|
|
29
|
+
contributors[key].groups.push(groupObj);
|
|
30
|
+
}
|
|
31
|
+
if (!groupObj.files.includes(normalizedFile)) {
|
|
32
|
+
groupObj.files.push(normalizedFile);
|
|
33
|
+
}
|
|
34
|
+
if (!groupObj.commits.includes(commit)) {
|
|
35
|
+
groupObj.commits.push(commit);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
if (!((_a = contributors[key].files) === null || _a === void 0 ? void 0 : _a.includes(normalizedFile))) {
|
|
40
|
+
contributors[key].files.push(normalizedFile);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
if (!((_a = contributors[key].commits) === null || _a === void 0 ? void 0 : _a.includes(commit))) {
|
|
44
|
+
contributors[key].commits.push(commit);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
return Object.values(contributors);
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=contributors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contributors.js","sourceRoot":"","sources":["../../../../src/modules/sections/contributors.ts"],"names":[],"mappings":";;AAKA,0CAiDC;AAjDD,SAAgB,eAAe,CAAC,OAAwB,EAAE,MAAc;IACpE,MAAM,YAAY,GAAgC,EAAE,CAAA;IAEpD,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACrB,MAAM,eAAe,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAA;QAEnE,eAAe,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE;;YAClC,MAAM,GAAG,GAAG,WAAW,CAAC,KAAK,CAAA;YAE7B,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;gBACrB,YAAY,CAAC,GAAG,CAAC,GAAG;oBAChB,GAAG,WAAW;oBACd,MAAM,EAAE,EAAE;oBACV,KAAK,EAAE,EAAE;oBACT,OAAO,EAAE,EAAE;iBACd,CAAA;YACL,CAAC;YAED,MAAM,aAAa,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,CAA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CAAC,KAAK,0CAAE,QAAQ,CAAC,cAAc,CAAC,CAAA,EAAE,CAAC;oBACrD,YAAY,CAAC,GAAG,CAAC,CAAC,KAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;gBACjD,CAAC;YACL,CAAC,CAAC,CAAA;YAEF,IAAI,CAAC,CAAA,MAAA,YAAY,CAAC,GAAG,CAAC,CAAC,OAAO,0CAAE,QAAQ,CAAC,MAAM,CAAC,CAAA,EAAE,CAAC;gBAC/C,YAAY,CAAC,GAAG,CAAC,CAAC,OAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;YAC3C,CAAC;QACL,CAAC,CAAC,CAAA;IACN,CAAC,CAAC,CAAA;IAEF,OAAO,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;AACtC,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.groupBy = groupBy;
|
|
4
|
+
exports.groupByNotes = groupByNotes;
|
|
5
|
+
function groupBy(commits, key, config) {
|
|
6
|
+
if (!Array.isArray(commits)) {
|
|
7
|
+
throw new Error('Invalid input: commits must be an array');
|
|
8
|
+
}
|
|
9
|
+
const result = [];
|
|
10
|
+
const grouped = commits.reduce((acc, commit) => {
|
|
11
|
+
const groupKey = key.split('.').reduce((nested, part) => nested && nested[part], commit);
|
|
12
|
+
if (!acc[groupKey]) {
|
|
13
|
+
const matchingType = config.commitTypes.find(ct => ct.terms.includes(groupKey));
|
|
14
|
+
const typeTitle = matchingType ? matchingType.title : 'Other Changes';
|
|
15
|
+
const order = matchingType && matchingType.order !== undefined ? matchingType.order : Number.MAX_SAFE_INTEGER;
|
|
16
|
+
acc[groupKey] = {
|
|
17
|
+
type: matchingType ? matchingType.type : 'other',
|
|
18
|
+
title: typeTitle,
|
|
19
|
+
order: order,
|
|
20
|
+
items: [],
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
acc[groupKey].items.push(commit);
|
|
24
|
+
return acc;
|
|
25
|
+
}, {});
|
|
26
|
+
result.push(...Object.values(grouped));
|
|
27
|
+
result.sort((a, b) => (a.order || 0) - (b.order || 0));
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
function groupByNotes(array, config, includeUnmatched = true) {
|
|
31
|
+
if (!Array.isArray(array)) {
|
|
32
|
+
throw new Error('Invalid input: array must be an array');
|
|
33
|
+
}
|
|
34
|
+
const result = [];
|
|
35
|
+
const grouped = array.reduce((acc, item) => {
|
|
36
|
+
if (!item.notes || item.notes.length === 0)
|
|
37
|
+
return acc;
|
|
38
|
+
item.notes.forEach(note => {
|
|
39
|
+
const groupKey = note.type;
|
|
40
|
+
const matchingType = config.noteTypes.find(nt => nt.type === groupKey);
|
|
41
|
+
if (!matchingType && !includeUnmatched)
|
|
42
|
+
return;
|
|
43
|
+
if (!acc[groupKey]) {
|
|
44
|
+
const typeTitle = matchingType ? matchingType.title : groupKey;
|
|
45
|
+
const order = matchingType && matchingType.order !== undefined ? matchingType.order : Number.MAX_SAFE_INTEGER;
|
|
46
|
+
acc[groupKey] = {
|
|
47
|
+
type: groupKey,
|
|
48
|
+
title: typeTitle,
|
|
49
|
+
order: order,
|
|
50
|
+
items: [],
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
acc[groupKey].items.push({
|
|
54
|
+
note,
|
|
55
|
+
commit: item,
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
return acc;
|
|
59
|
+
}, {});
|
|
60
|
+
result.push(...Object.values(grouped));
|
|
61
|
+
result.sort((a, b) => (a.order || 0) - (b.order || 0));
|
|
62
|
+
return result;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=grouping.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grouping.js","sourceRoot":"","sources":["../../../../src/modules/sections/grouping.ts"],"names":[],"mappings":";;AAIA,0BAgCC;AAED,oCA0CC;AA5ED,S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Q,CAAA;gBAC9D,MAAM,KAAK,GAAG,YAAY,IAAI,YAAY,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAA;gBAE7G,GAAG,CAAC,QAAQ,CAAC,GAAG;oBACZ,IAAI,EAAE,QAAQ;oBACd,KAAK,EAAE,SAAS;oBAChB,KAAK,EAAE,KAAK;oBACZ,KAAK,EAAE,EAAE;iBACZ,CAAA;YACL,CAAC;YAED,GAAG,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;gBACrB,IAAI;gBACJ,MAAM,EAAE,IAAI;aACf,CAAC,CAAA;QACN,CAAC,CAAC,CAAA;QAEF,OAAO,GAAG,CAAA;IACd,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;IAEtC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAA;IAEtD,OAAO,MAAM,CAAA;AACjB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createSections = createSections;
|
|
4
|
+
const contributors_1 = require("./contributors");
|
|
5
|
+
const grouping_1 = require("./grouping");
|
|
6
|
+
const summarizing_1 = require("./summarizing");
|
|
7
|
+
function createSections(commits, config) {
|
|
8
|
+
const sections = {};
|
|
9
|
+
sections.commits = (0, grouping_1.groupBy)(commits, 'type', config);
|
|
10
|
+
sections.notes = (0, grouping_1.groupByNotes)(commits, config, false);
|
|
11
|
+
sections.contributors = (0, contributors_1.getContributors)(commits, config);
|
|
12
|
+
sections.summary = {
|
|
13
|
+
commits: (0, summarizing_1.summarizeCommits)(sections.commits, config),
|
|
14
|
+
notes: (0, summarizing_1.summarizeNotes)(sections.notes, config),
|
|
15
|
+
contributors: (0, summarizing_1.summarizeContributors)(sections.contributors, config),
|
|
16
|
+
};
|
|
17
|
+
return sections;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/sections/index.ts"],"names":[],"mappings":";;AAUA,wCAWC;AAnBD,iDAAgD;AAChD,yCAAkD;AAClD,+CAAuF;AAMvF,SAAgB,cAAc,CAAC,OAAwB,EAAE,MAAc;IACnE,MAAM,QAAQ,GAAsB,EAAE,CAAA;IACtC,QAAQ,CAAC,OAAO,GAAG,IAAA,kBAAO,EAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IACnD,QAAQ,CAAC,KAAK,GAAG,IAAA,uBAAY,EAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;IACrD,QAAQ,CAAC,YAAY,GAAG,IAAA,8BAAe,EAAC,OAAO,EAAE,MAAM,CAAC,CAAA;IACxD,QAAQ,CAAC,OAAO,GAAG;QACf,OAAO,EAAE,IAAA,8BAAgB,EAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACnD,KAAK,EAAE,IAAA,4BAAc,EAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAC7C,YAAY,EAAE,IAAA,mCAAqB,EAAC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;KACrE,CAAA;IACD,OAAO,QAAoB,CAAA;AAC/B,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.summarizeCommits = summarizeCommits;
|
|
4
|
+
exports.summarizeNotes = summarizeNotes;
|
|
5
|
+
exports.summarizeContributors = summarizeContributors;
|
|
6
|
+
function summarizeCommits(commits, config) {
|
|
7
|
+
if (!Array.isArray(commits)) {
|
|
8
|
+
throw new Error('Invalid input: commits must be an array');
|
|
9
|
+
}
|
|
10
|
+
const result = [];
|
|
11
|
+
const summary = commits.reduce((acc, commit) => {
|
|
12
|
+
const type = commit.type;
|
|
13
|
+
if (!acc[type]) {
|
|
14
|
+
const matchingType = config.commitTypes.find(ct => ct.type === type);
|
|
15
|
+
const typeTitle = matchingType ? matchingType.title : 'Other Changes';
|
|
16
|
+
const order = matchingType && matchingType.order !== undefined ? matchingType.order : Number.MAX_SAFE_INTEGER;
|
|
17
|
+
acc[type] = {
|
|
18
|
+
type: type,
|
|
19
|
+
title: typeTitle,
|
|
20
|
+
count: commit.items.length,
|
|
21
|
+
order: order,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
return acc;
|
|
25
|
+
}, {});
|
|
26
|
+
result.push(...Object.values(summary));
|
|
27
|
+
result.sort((a, b) => a.order - b.order);
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
function summarizeNotes(notes, config) {
|
|
31
|
+
if (!Array.isArray(notes)) {
|
|
32
|
+
throw new Error('Invalid input: notes must be an array');
|
|
33
|
+
}
|
|
34
|
+
const result = [];
|
|
35
|
+
const summary = notes.reduce((acc, note) => {
|
|
36
|
+
const type = note.type;
|
|
37
|
+
if (!acc[type]) {
|
|
38
|
+
const matchingType = config.noteTypes.find(nt => nt.type === type);
|
|
39
|
+
const typeTitle = matchingType ? matchingType.title : 'Other Notes';
|
|
40
|
+
const order = matchingType && matchingType.order !== undefined ? matchingType.order : Number.MAX_SAFE_INTEGER;
|
|
41
|
+
acc[type] = {
|
|
42
|
+
type: type,
|
|
43
|
+
title: typeTitle,
|
|
44
|
+
count: note.items.length,
|
|
45
|
+
order: order,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return acc;
|
|
49
|
+
}, {});
|
|
50
|
+
result.push(...Object.values(summary));
|
|
51
|
+
result.sort((a, b) => a.order - b.order);
|
|
52
|
+
return result;
|
|
53
|
+
}
|
|
54
|
+
function summarizeContributors(contributors, config) {
|
|
55
|
+
if (!Array.isArray(contributors)) {
|
|
56
|
+
throw new Error('Invalid input: contributors must be an array');
|
|
57
|
+
}
|
|
58
|
+
const result = [];
|
|
59
|
+
const summary = contributors.reduce((acc, contributor) => {
|
|
60
|
+
var _a;
|
|
61
|
+
const type = contributor.email;
|
|
62
|
+
if (!acc[type]) {
|
|
63
|
+
acc[type] = {
|
|
64
|
+
email: contributor.email,
|
|
65
|
+
name: contributor.name,
|
|
66
|
+
profileUrl: contributor.profileUrl,
|
|
67
|
+
count: ((_a = contributor.groups) === null || _a === void 0 ? void 0 : _a.length) || 0,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
return acc;
|
|
71
|
+
}, {});
|
|
72
|
+
result.push(...Object.values(summary));
|
|
73
|
+
return result;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=summarizing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summarizing.js","sourceRoot":"","sources":["../../../../src/modules/sections/summarizing.ts"],"names":[],"mappings":";;AAIA,4CA8BC;AAED,wCA8BC;AAED,sDAwBC;AAxFD,SAAgB,gBAAgB,CAAC,OAAyB,EAAE,MAAc;IACtE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAA;IAC9D,CAAC;IAED,MAAM,MAAM,GAAU,EAAE,CAAA;IAExB,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAsB,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE;QAChE,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAA;QACxB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACb,MAAM,YAAY,GAAG,MAAM,CAAC,WAAW,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,CAAC;YACb,GAAG,CAAC,IAAI,CAAC,GAAG;gBACR,KAAK,EAAE,WAAW,CAAC,KAAK;gBACxB,IAAI,EAAE,WAAW,CAAC,IAAI;gBACtB,UAAU,EAAE,WAAW,CAAC,UAAU;gBAClC,KAAK,EAAE,CAAA,MAAA,WAAW,CAAC,MAAM,0CAAE,MAAM,KAAI,CAAC;aACzC,CAAA;QACL,CAAC;QAED,OAAO,GAAG,CAAA;IACd,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;IAEtC,OAAO,MAAM,CAAA;AACjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Contributor.js","sourceRoot":"","sources":["../../../../../src/modules/sections/types/Contributor.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Group.js","sourceRoot":"","sources":["../../../../../src/modules/sections/types/Group.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SectionSummary.js","sourceRoot":"","sources":["../../../../../src/modules/sections/types/SectionSummary.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Sections.js","sourceRoot":"","sources":["../../../../../src/modules/sections/types/Sections.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
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.LOCAL_TEMPLATE_PATH = exports.DEFAULT_TEMPLATE_PATH = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
exports.DEFAULT_TEMPLATE_PATH = path_1.default.resolve(__dirname, 'defaults/changelog.ejs');
|
|
9
|
+
exports.LOCAL_TEMPLATE_PATH = path_1.default.resolve(process.cwd(), '.grm/templates/changelog.ejs');
|
|
10
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/modules/templates/constants.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAuB;AAEV,QAAA,qBAAqB,GAAG,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,wBAAwB,CAAC,CAAA;AACzE,QAAA,mBAAmB,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,8BAA8B,CAAC,CAAA"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# <%= config.appName %> <%= changeInfo.header %> Release Notes - <%= latestTag?.date?.split("T")[0] %>
|
|
2
|
+
|
|
3
|
+
## Summary:
|
|
4
|
+
<% sections.summary.commits.forEach(function(commit) { %>
|
|
5
|
+
- <%= commit.title %>: <%= commit.count %> <%= commit.count === 1 ? 'commit' : 'commits' %>
|
|
6
|
+
<% }) %>
|
|
7
|
+
<% sections.summary.notes.forEach(function(note) { %>
|
|
8
|
+
- <%= note.title %>: <%= note.count %> <%= note.count === 1 ? 'note' : 'notes' %>
|
|
9
|
+
<% }) %>
|
|
10
|
+
and <%= sections.summary.contributors.length %> <%= sections.summary.contributors.length === 1 ? '❤️ contributor' : '❤️ contributors' %>
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
<% if (sections.notes.length > 0) { %>
|
|
14
|
+
## Notes
|
|
15
|
+
<% sections.notes.forEach((note) => { %>
|
|
16
|
+
### <%= note.title %>
|
|
17
|
+
<% note.items.forEach(item => { %>
|
|
18
|
+
<%
|
|
19
|
+
const commitLinks = `[#${item.commit.raw.shortHash}](#commit-${item.commit.raw.shortHash})`;
|
|
20
|
+
%>
|
|
21
|
+
- <%= item.note.content %> (<%= commitLinks %>)
|
|
22
|
+
<% }) %>
|
|
23
|
+
<% }) %>
|
|
24
|
+
<% } %>
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
<% if (sections.commits.length > 0) { %>
|
|
28
|
+
## Changes
|
|
29
|
+
<% sections.commits.forEach((section) => { %>
|
|
30
|
+
### <%= section.title %>:
|
|
31
|
+
<%
|
|
32
|
+
// Scope'a göre commit'leri gruplama
|
|
33
|
+
const scopedCommits = {};
|
|
34
|
+
const unscopedCommits = [];
|
|
35
|
+
|
|
36
|
+
section.items.forEach(commit => {
|
|
37
|
+
if (commit.scope) {
|
|
38
|
+
if (!scopedCommits[commit.scope]) {
|
|
39
|
+
scopedCommits[commit.scope] = [];
|
|
40
|
+
}
|
|
41
|
+
scopedCommits[commit.scope].push(commit);
|
|
42
|
+
} else {
|
|
43
|
+
unscopedCommits.push(commit);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
%>
|
|
47
|
+
|
|
48
|
+
<% // Scope'lu commit'leri gösterme
|
|
49
|
+
Object.keys(scopedCommits).sort().forEach(scope => { %>
|
|
50
|
+
#### <%= scope %>
|
|
51
|
+
<% scopedCommits[scope].forEach(commit => {
|
|
52
|
+
const author = `[@${commit.author.name}](${commit.author.profileUrl})`;
|
|
53
|
+
const mentions = commit.mentions
|
|
54
|
+
? commit.mentions
|
|
55
|
+
.filter(mention => ['co-authored-by', 'helped-by'].includes(mention.type))
|
|
56
|
+
.map(mention => `[@${mention.name}](${mention.profileUrl})`)
|
|
57
|
+
.join(', ')
|
|
58
|
+
: '';
|
|
59
|
+
const authorText = mentions ? `${author} with ${mentions}` : author;
|
|
60
|
+
|
|
61
|
+
const commitLink = `[#${commit.raw.shortHash}](${repository.remote.repoUrl}/commit/${commit.raw.hash})`;
|
|
62
|
+
|
|
63
|
+
const issueLinks = commit.links && commit.links.length > 0
|
|
64
|
+
? ` (${commit.links.length === 1 ? 'Issue' : 'Issues'}: ${commit.links.map(link => `[#${link.id}](${repository.remote.repoUrl}/issues/${link.id})`).join(', ')})`
|
|
65
|
+
: '';
|
|
66
|
+
%>
|
|
67
|
+
- <a id="commit-<%= commit.raw.shortHash %>"></a><%= commitLink %>: <%= commit.summary %> (by <%= authorText %>) <%= issueLinks %>
|
|
68
|
+
<% if (commit.description) { %>
|
|
69
|
+
|
|
70
|
+
<%= commit.description?.split('\n').map(line => `\t${line.trim()}`).join('\n') %>
|
|
71
|
+
<% } %>
|
|
72
|
+
<% }); %>
|
|
73
|
+
<% }); %>
|
|
74
|
+
|
|
75
|
+
<% // Scope'suz commit'leri gösterme
|
|
76
|
+
unscopedCommits.forEach(commit => {
|
|
77
|
+
const author = `[@${commit.author.name}](${commit.author.profileUrl})`;
|
|
78
|
+
const mentions = commit.mentions
|
|
79
|
+
? commit.mentions
|
|
80
|
+
.filter(mention => ['co-authored-by', 'helped-by'].includes(mention.type))
|
|
81
|
+
.map(mention => `[@${mention.name}](${mention.profileUrl})`)
|
|
82
|
+
.join(', ')
|
|
83
|
+
: '';
|
|
84
|
+
const authorText = mentions ? `${author} with ${mentions}` : author;
|
|
85
|
+
|
|
86
|
+
const commitLink = `[#${commit.raw.shortHash}](${repository.remote.repoUrl}/commit/${commit.raw.hash})`;
|
|
87
|
+
|
|
88
|
+
const issueLinks = commit.links && commit.links.length > 0
|
|
89
|
+
? ` (${commit.links.length === 1 ? 'Issue' : 'Issues'}: ${commit.links.map(link => `[#${link.id}](${repository.remote.repoUrl}/issues/${link.id})`).join(', ')})`
|
|
90
|
+
: '';
|
|
91
|
+
%>
|
|
92
|
+
- <a id="commit-<%= commit.raw.shortHash %>"></a><%= commitLink %>: <%= commit.summary %> (by <%= authorText %>) <%= issueLinks %>
|
|
93
|
+
<% if (commit.description) { %>
|
|
94
|
+
|
|
95
|
+
<%= commit.description %>
|
|
96
|
+
<% } %>
|
|
97
|
+
<% }); %>
|
|
98
|
+
<% }) %>
|
|
99
|
+
<% } %>
|
|
100
|
+
|
|
101
|
+
## Useful Links
|
|
102
|
+
- 📜 [Full Changelog](<%= repository.remote.repoUrl %>/blob/main/CHANGELOG.md)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
<% if (sections.contributors.length > 0) { %>
|
|
107
|
+
## Contributors:
|
|
108
|
+
<% sections.contributors.forEach((contributor) => { %>
|
|
109
|
+
- [<%= contributor.name %>](<%= contributor.profileUrl %>) <% if (contributor.groups.length > 0) { %>(<%= contributor.groups.map(group => group.title).join(', ') %>)<% } %>
|
|
110
|
+
<% }) %>
|
|
111
|
+
<% } %>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# <%= config.appName %> <%= changeInfo.header %> Release Notes - <%= latestTag?.date?.split("T")[0] %>
|
|
2
|
+
|
|
3
|
+
## Summary:
|
|
4
|
+
<% sections.summary.commits.forEach(function(commit) { %>
|
|
5
|
+
- <%= commit.title %>: <%= commit.count %> <%= commit.count === 1 ? 'commit' : 'commits' %>
|
|
6
|
+
<% }) %>
|
|
7
|
+
<% sections.summary.notes.forEach(function(note) { %>
|
|
8
|
+
- <%= note.title %>: <%= note.count %> <%= note.count === 1 ? 'note' : 'notes' %>
|
|
9
|
+
<% }) %>
|
|
10
|
+
and <%= sections.summary.contributors.length %> <%= sections.summary.contributors.length === 1 ? '❤️ contributor' : '❤️ contributors' %>
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
<% if (sections.notes.length > 0) { %>
|
|
14
|
+
## Notes
|
|
15
|
+
<% sections.notes.forEach((note) => { %>
|
|
16
|
+
### <%= note.title %>
|
|
17
|
+
<% note.items.forEach(item => { %>
|
|
18
|
+
<%
|
|
19
|
+
const commitLinks = `[#${item.commit.raw.shortHash}](#commit-${item.commit.raw.shortHash})`;
|
|
20
|
+
%>
|
|
21
|
+
- <%= item.note.content %> (<%= commitLinks %>)
|
|
22
|
+
<% }) %>
|
|
23
|
+
<% }) %>
|
|
24
|
+
<% } %>
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
<% if (sections.commits.length > 0) { %>
|
|
28
|
+
## Changes
|
|
29
|
+
<% sections.commits.forEach((section) => { %>
|
|
30
|
+
### <%= section.title %>:
|
|
31
|
+
<%
|
|
32
|
+
section.items.forEach(commit => {
|
|
33
|
+
const author = `[@${commit.author.name}](${commit.author.profileUrl})`;
|
|
34
|
+
const mentions = commit.mentions
|
|
35
|
+
? commit.mentions
|
|
36
|
+
.filter(mention => ['co-authored-by', 'helped-by'].includes(mention.type))
|
|
37
|
+
.map(mention => `[@${mention.name}](${mention.profileUrl})`)
|
|
38
|
+
.join(', ')
|
|
39
|
+
: '';
|
|
40
|
+
const authorText = mentions ? `${author} with ${mentions}` : author;
|
|
41
|
+
|
|
42
|
+
const commitLink = `[#${commit.raw.shortHash}](${repository.remote.repoUrl}/commit/${commit.raw.hash})`;
|
|
43
|
+
|
|
44
|
+
const issueLinks = commit.links && commit.links.length > 0
|
|
45
|
+
? ` (${commit.links.length === 1 ? 'Issue' : 'Issues'}: ${commit.links.map(link => `[#${link.id}](${repository.remote.repoUrl}/issues/${link.id})`).join(', ')})`
|
|
46
|
+
: '';
|
|
47
|
+
|
|
48
|
+
const scopeText = commit.scope ? `**${commit.scope}** ` : '';
|
|
49
|
+
%>
|
|
50
|
+
- <a id="commit-<%= commit.raw.shortHash %>"></a><%= scopeText %><%= commitLink %>: <%= commit.summary %> (by <%= authorText %>) <%= issueLinks %>
|
|
51
|
+
<% if (commit.description) { %>
|
|
52
|
+
|
|
53
|
+
<%= commit.description?.split('\n').map(line => `\t${line.trim()}`).join('\n') %>
|
|
54
|
+
<% } %>
|
|
55
|
+
<% }); %>
|
|
56
|
+
<% }) %>
|
|
57
|
+
<% } %>
|
|
58
|
+
|
|
59
|
+
## Useful Links
|
|
60
|
+
- 📜 [Full Changelog](<%= repository.remote.repoUrl %>/blob/main/CHANGELOG.md)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
<% if (sections.contributors.length > 0) { %>
|
|
64
|
+
## Contributors:
|
|
65
|
+
<% sections.contributors.forEach((contributor) => { %>
|
|
66
|
+
- [<%= contributor.name %>](<%= contributor.profileUrl %>) <% if (contributor.groups.length > 0) { %>(<%= contributor.groups.map(group => group.title).join(', ') %>)<% } %>
|
|
67
|
+
<% }) %>
|
|
68
|
+
<% } %>
|
|
@@ -0,0 +1,46 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.renderTemplate = renderTemplate;
|
|
37
|
+
const ejs = __importStar(require("ejs"));
|
|
38
|
+
const fs = __importStar(require("fs"));
|
|
39
|
+
const templateResolver_1 = require("./templateResolver");
|
|
40
|
+
async function renderTemplate(templatePath, environment, data) {
|
|
41
|
+
const resolvedTemplatePath = await (0, templateResolver_1.resolveTemplatePath)(templatePath, environment);
|
|
42
|
+
const templateContent = fs.readFileSync(resolvedTemplatePath, 'utf-8');
|
|
43
|
+
const output = ejs.render(templateContent, { ...data });
|
|
44
|
+
return output;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=templateRenderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templateRenderer.js","sourceRoot":"","sources":["../../../../src/modules/templates/templateRenderer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,wCAOC;AAXD,yCAA0B;AAC1B,uCAAwB;AACxB,yDAAwD;AAEjD,KAAK,UAAU,cAAc,CAAC,YAAoB,EAAE,WAA0B,EAAE,IAAyB;IAC5G,MAAM,oBAAoB,GAAG,MAAM,IAAA,sCAAmB,EAAC,YAAY,EAAE,WAAW,CAAC,CAAA;IAEjF,MAAM,eAAe,GAAG,EAAE,CAAC,YAAY,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAA;IACtE,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,eAAe,EAAE,EAAE,GAAG,IAAI,EAAE,CAAC,CAAA;IAEvD,OAAO,MAAM,CAAA;AACjB,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.resolveTemplatePath = resolveTemplatePath;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
const constants_1 = require("./constants");
|
|
40
|
+
async function resolveTemplatePath(paramPath, environment = null) {
|
|
41
|
+
const envSuffix = environment ? `.${environment}` : '';
|
|
42
|
+
if (paramPath) {
|
|
43
|
+
const resolvedPath = path.resolve(paramPath.replace(/\.ejs$/, `${envSuffix}.ejs`));
|
|
44
|
+
if (fs.existsSync(resolvedPath)) {
|
|
45
|
+
return resolvedPath;
|
|
46
|
+
}
|
|
47
|
+
// Fallback to default template if environment-specific template is not found
|
|
48
|
+
const defaultParamPath = path.resolve(paramPath);
|
|
49
|
+
if (fs.existsSync(defaultParamPath)) {
|
|
50
|
+
return defaultParamPath;
|
|
51
|
+
}
|
|
52
|
+
throw new Error(`Template file not found at: ${resolvedPath} or ${defaultParamPath}`);
|
|
53
|
+
}
|
|
54
|
+
const localTemplatePath = constants_1.LOCAL_TEMPLATE_PATH.replace(/\.ejs$/, `${envSuffix}.ejs`);
|
|
55
|
+
if (fs.existsSync(localTemplatePath)) {
|
|
56
|
+
return localTemplatePath;
|
|
57
|
+
}
|
|
58
|
+
if (fs.existsSync(constants_1.LOCAL_TEMPLATE_PATH)) {
|
|
59
|
+
return constants_1.LOCAL_TEMPLATE_PATH;
|
|
60
|
+
}
|
|
61
|
+
const defaultTemplatePath = constants_1.DEFAULT_TEMPLATE_PATH.replace(/\.ejs$/, `${envSuffix}.ejs`);
|
|
62
|
+
if (fs.existsSync(defaultTemplatePath)) {
|
|
63
|
+
return defaultTemplatePath;
|
|
64
|
+
}
|
|
65
|
+
if (fs.existsSync(constants_1.DEFAULT_TEMPLATE_PATH)) {
|
|
66
|
+
return constants_1.DEFAULT_TEMPLATE_PATH;
|
|
67
|
+
}
|
|
68
|
+
throw new Error('No valid template file found');
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=templateResolver.js.map
|