git-release-manager 0.0.3 → 0.0.5
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/cli/types/BranchCliArgs.js +3 -0
- package/dist/cli/types/BranchCliArgs.js.map +1 -0
- package/dist/cli/types/ChangelogCliArgs.js +3 -0
- package/dist/cli/types/ChangelogCliArgs.js.map +1 -0
- package/dist/cli/types/CliArgs.js +3 -0
- package/dist/cli/types/CliArgs.js.map +1 -0
- package/dist/cli/types/VersionCliArgs.js +3 -0
- package/dist/cli/types/VersionCliArgs.js.map +1 -0
- package/dist/config/configLoader.js +61 -0
- package/dist/config/configLoader.js.map +1 -0
- package/dist/{src/config/index.js → config/configManager.js} +13 -33
- package/dist/config/configManager.js.map +1 -0
- package/dist/config/constants.js +10 -0
- package/dist/config/constants.js.map +1 -0
- package/dist/{src/config/defaultConfig.json → config/defaults/config.json} +231 -231
- package/dist/config/types/ChannelType.js +3 -0
- package/dist/config/types/ChannelType.js.map +1 -0
- package/dist/config/types/CommitType.js +3 -0
- package/dist/config/types/CommitType.js.map +1 -0
- package/dist/config/types/Config.js +3 -0
- package/dist/config/types/Config.js.map +1 -0
- package/dist/config/types/FileGroups.js +3 -0
- package/dist/config/types/FileGroups.js.map +1 -0
- package/dist/config/types/LinkType.js +3 -0
- package/dist/config/types/LinkType.js.map +1 -0
- package/dist/config/types/MentionType.js +3 -0
- package/dist/config/types/MentionType.js.map +1 -0
- package/dist/config/types/NoteType.js +3 -0
- package/dist/config/types/NoteType.js.map +1 -0
- package/dist/config/types/Options.js +3 -0
- package/dist/config/types/Options.js.map +1 -0
- package/dist/core/changelog/app.js +40 -0
- package/dist/core/changelog/app.js.map +1 -0
- package/dist/index.js +89 -0
- package/dist/index.js.map +1 -0
- package/dist/modules/branch/BranchController.js +62 -0
- package/dist/modules/branch/BranchController.js.map +1 -0
- package/dist/modules/branch/BranchManager.js +194 -0
- package/dist/modules/branch/BranchManager.js.map +1 -0
- package/dist/modules/changelog/ChangelogValidator.js +19 -0
- package/dist/modules/changelog/ChangelogValidator.js.map +1 -0
- package/dist/modules/changelog/templateOperations.js +144 -0
- package/dist/modules/changelog/templateOperations.js.map +1 -0
- package/dist/modules/changes/types/ChangeInformation.js +3 -0
- package/dist/modules/changes/types/ChangeInformation.js.map +1 -0
- package/dist/modules/changes/types/Context.js +3 -0
- package/dist/modules/changes/types/Context.js.map +1 -0
- package/dist/modules/changes/types/RangeInfo.js +8 -0
- package/dist/modules/changes/types/RangeInfo.js.map +1 -0
- package/dist/modules/changes/types/RangeSummary.js +3 -0
- package/dist/modules/changes/types/RangeSummary.js.map +1 -0
- package/dist/modules/changes/types/ReferenceTypesEnum.js +12 -0
- package/dist/modules/changes/types/ReferenceTypesEnum.js.map +1 -0
- package/dist/modules/git/commits/commitProcessor.js +50 -0
- package/dist/modules/git/commits/commitProcessor.js.map +1 -0
- package/dist/modules/git/commits/gitLogFetcher.js +27 -0
- package/dist/modules/git/commits/gitLogFetcher.js.map +1 -0
- package/dist/modules/git/commits/index.js +136 -0
- package/dist/modules/git/commits/index.js.map +1 -0
- package/dist/modules/git/commits/profileHandler.js +48 -0
- package/dist/modules/git/commits/profileHandler.js.map +1 -0
- package/dist/modules/git/commits/regexHandlers.js +27 -0
- package/dist/modules/git/commits/regexHandlers.js.map +1 -0
- package/dist/modules/git/context/branchHandler.js +18 -0
- package/dist/modules/git/context/branchHandler.js.map +1 -0
- package/dist/modules/git/context/commitHandler.js +29 -0
- package/dist/modules/git/context/commitHandler.js.map +1 -0
- package/dist/modules/git/context/index.js +26 -0
- package/dist/modules/git/context/index.js.map +1 -0
- package/dist/modules/git/context/remoteHandler.js +20 -0
- package/dist/modules/git/context/remoteHandler.js.map +1 -0
- package/dist/modules/git/context/statusHandler.js +16 -0
- package/dist/modules/git/context/statusHandler.js.map +1 -0
- package/dist/modules/git/context/tagHandler.js +28 -0
- package/dist/modules/git/context/tagHandler.js.map +1 -0
- package/dist/modules/git/gitOperations.js +56 -0
- package/dist/modules/git/gitOperations.js.map +1 -0
- package/dist/modules/git/types/Author.js +3 -0
- package/dist/modules/git/types/Author.js.map +1 -0
- package/dist/modules/git/types/Branch.js +3 -0
- package/dist/modules/git/types/Branch.js.map +1 -0
- package/dist/modules/git/types/BranchInfo.js +3 -0
- package/dist/modules/git/types/BranchInfo.js.map +1 -0
- package/dist/modules/git/types/CommitContent.js +3 -0
- package/dist/modules/git/types/CommitContent.js.map +1 -0
- package/dist/modules/git/types/CommitInfo.js +3 -0
- package/dist/modules/git/types/CommitInfo.js.map +1 -0
- package/dist/modules/git/types/CommitType.js +3 -0
- package/dist/modules/git/types/CommitType.js.map +1 -0
- package/dist/modules/git/types/GitCommit.js +3 -0
- package/dist/modules/git/types/GitCommit.js.map +1 -0
- package/dist/modules/git/types/GitReference.js +3 -0
- package/dist/modules/git/types/GitReference.js.map +1 -0
- package/dist/{src/core/types.js → modules/git/types/Link.js} +1 -1
- package/dist/modules/git/types/Link.js.map +1 -0
- package/dist/modules/git/types/Mention.js +3 -0
- package/dist/modules/git/types/Mention.js.map +1 -0
- package/dist/{src/config/types.js → modules/git/types/Note.js} +1 -1
- package/dist/modules/git/types/Note.js.map +1 -0
- package/dist/modules/git/types/RemoteInfo.js +3 -0
- package/dist/modules/git/types/RemoteInfo.js.map +1 -0
- package/dist/modules/git/types/Repository.js +3 -0
- package/dist/modules/git/types/Repository.js.map +1 -0
- package/dist/modules/git/types/StatusInfo.js +3 -0
- package/dist/modules/git/types/StatusInfo.js.map +1 -0
- package/dist/{src/utils/cli.js → modules/git/types/Tag.js} +1 -1
- package/dist/modules/git/types/Tag.js.map +1 -0
- package/dist/modules/git/types/TagInfo.js +3 -0
- package/dist/modules/git/types/TagInfo.js.map +1 -0
- package/dist/modules/git/utils/branchUtils.js +54 -0
- package/dist/modules/git/utils/branchUtils.js.map +1 -0
- package/dist/modules/git/utils/commitUtils.js +48 -0
- package/dist/modules/git/utils/commitUtils.js.map +1 -0
- package/dist/modules/git/utils/logUtils.js +18 -0
- package/dist/modules/git/utils/logUtils.js.map +1 -0
- package/dist/modules/git/utils/rangeOperations.js +14 -0
- package/dist/modules/git/utils/rangeOperations.js.map +1 -0
- package/dist/modules/git/utils/refUtils.js +41 -0
- package/dist/modules/git/utils/refUtils.js.map +1 -0
- package/dist/modules/git/utils/referenceUtils.js +135 -0
- package/dist/modules/git/utils/referenceUtils.js.map +1 -0
- package/dist/modules/git/utils/tagUtils.js +55 -0
- package/dist/modules/git/utils/tagUtils.js.map +1 -0
- package/dist/{src → modules}/output/writer.js +2 -2
- package/dist/modules/output/writer.js.map +1 -0
- package/dist/modules/sections/contributors.js +50 -0
- package/dist/modules/sections/contributors.js.map +1 -0
- package/dist/modules/sections/grouping.js +64 -0
- package/dist/modules/sections/grouping.js.map +1 -0
- package/dist/modules/sections/index.js +19 -0
- package/dist/modules/sections/index.js.map +1 -0
- package/dist/modules/sections/summarizing.js +75 -0
- package/dist/modules/sections/summarizing.js.map +1 -0
- package/dist/modules/sections/types/Contributor.js +3 -0
- package/dist/modules/sections/types/Contributor.js.map +1 -0
- package/dist/modules/sections/types/Group.js +3 -0
- package/dist/modules/sections/types/Group.js.map +1 -0
- package/dist/modules/sections/types/SectionSummary.js +3 -0
- package/dist/modules/sections/types/SectionSummary.js.map +1 -0
- package/dist/modules/sections/types/Sections.js +3 -0
- package/dist/modules/sections/types/Sections.js.map +1 -0
- package/dist/modules/version/GitVersionManager.js +153 -0
- package/dist/modules/version/GitVersionManager.js.map +1 -0
- package/dist/modules/version/ReleaseManager.js +69 -0
- package/dist/modules/version/ReleaseManager.js.map +1 -0
- package/dist/modules/version/VersionManager.js +77 -0
- package/dist/modules/version/VersionManager.js.map +1 -0
- package/dist/modules/version/VersionValidator.js +31 -0
- package/dist/modules/version/VersionValidator.js.map +1 -0
- package/dist/modules/version/types/const.js +3 -0
- package/dist/modules/version/types/const.js.map +1 -0
- package/dist/modules/version/versionFormatter.js +104 -0
- package/dist/modules/version/versionFormatter.js.map +1 -0
- package/dist/modules/version/versionHelper.js +9 -0
- package/dist/modules/version/versionHelper.js.map +1 -0
- package/dist/src/cli/types/BranchCliArgs.js +3 -0
- package/dist/src/cli/types/BranchCliArgs.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/CliArgs.js +3 -0
- package/dist/src/cli/types/CliArgs.js.map +1 -0
- package/dist/src/cli/types/VersionCliArgs.js +3 -0
- package/dist/src/cli/types/VersionCliArgs.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/changelog/app.js +20 -0
- package/dist/src/core/changelog/app.js.map +1 -0
- package/dist/src/index.js +139 -20
- package/dist/src/index.js.map +1 -1
- package/dist/src/modules/changelog/templateOperations.js +142 -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/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 +50 -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 +48 -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 +18 -0
- package/dist/src/modules/git/context/branchHandler.js.map +1 -0
- package/dist/src/modules/git/context/commitHandler.js +29 -0
- package/dist/src/modules/git/context/commitHandler.js.map +1 -0
- package/dist/src/modules/git/context/index.js +26 -0
- package/dist/src/modules/git/context/index.js.map +1 -0
- package/dist/src/modules/git/context/remoteHandler.js +20 -0
- package/dist/src/modules/git/context/remoteHandler.js.map +1 -0
- package/dist/src/modules/git/context/statusHandler.js +16 -0
- package/dist/src/modules/git/context/statusHandler.js.map +1 -0
- package/dist/src/modules/git/context/tagHandler.js +28 -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/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 +54 -0
- package/dist/src/modules/git/utils/branchUtils.js.map +1 -0
- package/dist/src/modules/git/utils/commitUtils.js +48 -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 +135 -0
- package/dist/src/modules/git/utils/referenceUtils.js.map +1 -0
- package/dist/src/modules/git/utils/tagUtils.js +55 -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/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/templates/constants.js +10 -0
- package/dist/src/templates/constants.js.map +1 -0
- package/dist/src/templates/{changelog.detailed.ejs → defaults/changelog.detailed.ejs} +110 -110
- package/dist/src/templates/{changelog.ejs → defaults/changelog.ejs} +67 -67
- package/dist/src/templates/templateRenderer.js +46 -0
- package/dist/src/templates/templateRenderer.js.map +1 -0
- package/dist/src/templates/{index.js → templateResolver.js} +8 -39
- 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 +15 -30
- package/dist/src/utils/cmd.js.map +1 -1
- package/dist/src/utils/date.js +20 -0
- package/dist/src/utils/date.js.map +1 -0
- package/dist/templates/constants.js +10 -0
- package/dist/templates/constants.js.map +1 -0
- package/dist/templates/defaults/changelog.detailed.ejs +111 -0
- package/dist/templates/defaults/changelog.ejs +68 -0
- package/dist/templates/templateRenderer.js +46 -0
- package/dist/templates/templateRenderer.js.map +1 -0
- package/dist/templates/templateResolver.js +70 -0
- package/dist/templates/templateResolver.js.map +1 -0
- package/dist/test/config/{loadConfigFile.test.js → configLoader/loadConfigFile.test.js} +24 -24
- package/dist/test/config/configLoader/loadConfigFile.test.js.map +1 -0
- package/dist/test/config/{readConfig.test.js → configManager/readConfig.test.js} +37 -38
- package/dist/test/config/configManager/readConfig.test.js.map +1 -0
- package/dist/types/PackageJson.js +3 -0
- package/dist/types/PackageJson.js.map +1 -0
- package/dist/utils/cmd.js +42 -0
- package/dist/utils/cmd.js.map +1 -0
- package/dist/utils/date.js +20 -0
- package/dist/utils/date.js.map +1 -0
- package/package.json +64 -61
- package/dist/src/config/index.js.map +0 -1
- package/dist/src/config/types.js.map +0 -1
- package/dist/src/core/app.js +0 -218
- package/dist/src/core/app.js.map +0 -1
- package/dist/src/core/types.js.map +0 -1
- package/dist/src/git/commits.js +0 -237
- package/dist/src/git/commits.js.map +0 -1
- package/dist/src/git/context.js +0 -95
- package/dist/src/git/context.js.map +0 -1
- package/dist/src/main.js +0 -22
- package/dist/src/main.js.map +0 -1
- package/dist/src/output/writer.js.map +0 -1
- package/dist/src/sections/index.js +0 -207
- package/dist/src/sections/index.js.map +0 -1
- package/dist/src/templates/index.js.map +0 -1
- package/dist/src/utils/cli.js.map +0 -1
- package/dist/src/utils/git-utils.js +0 -278
- package/dist/src/utils/git-utils.js.map +0 -1
- package/dist/src/utils/helpers.js +0 -50
- package/dist/src/utils/helpers.js.map +0 -1
- package/dist/test/config/loadConfigFile.test.js.map +0 -1
- package/dist/test/config/readConfig.test.js.map +0 -1
|
@@ -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 === null || matchingType === void 0 ? void 0 : 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 === null || matchingType === void 0 ? void 0 : 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, _b;
|
|
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: (_b = (_a = contributor.groups) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 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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E,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAA;IACnE,CAAC;IAED,MAAM,MAAM,GAAU,EAAE,CAAA;IAExB,MAAM,OAAO,GAAG,YAAY,CAAC,MAAM,CAAsB,CAAC,GAAG,EAAE,WAAW,EAAE,EAAE;;QAC1E,MAAM,IAAI,GAAG,WAAW,CAAC,KAAK,CAAA;QAC9B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,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,MAAA,MAAA,WAAW,CAAC,MAAM,0CAAE,MAAM,mCAAI,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/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"}
|
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
# <%= config.appName %> <%= changeInfo.header %> Release Notes - <%=
|
|
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
|
-
//
|
|
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
|
-
<% //
|
|
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
|
-
<% //
|
|
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
|
-
<% }) %>
|
|
1
|
+
# <%= config.appName %> <%= changeInfo.header %> Release Notes - <%= latestReference?.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
|
+
// Group commits by scope
|
|
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
|
+
<% // Show commits with scope
|
|
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
|
+
<% // Show commits without scope
|
|
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
111
|
<% } %>
|
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
# <%= config.appName %> <%= changeInfo.header %> Release Notes - <%=
|
|
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
|
-
<% }) %>
|
|
1
|
+
# <%= config.appName %> <%= changeInfo.header %> Release Notes - <%= latestReference?.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
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/templates/templateRenderer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,wCAOC;AAZD,yCAA0B;AAC1B,uCAAwB;AACxB,yDAAwD;AAGjD,KAAK,UAAU,cAAc,CAAC,YAAoB,EAAE,WAA0B,EAAE,IAAa;IAChG,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"}
|
|
@@ -34,34 +34,9 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.resolveTemplatePath = resolveTemplatePath;
|
|
37
|
-
exports.renderTemplate = renderTemplate;
|
|
38
|
-
const ejs = __importStar(require("ejs"));
|
|
39
37
|
const fs = __importStar(require("fs"));
|
|
40
38
|
const path = __importStar(require("path"));
|
|
41
|
-
const
|
|
42
|
-
const LOCAL_TEMPLATE_PATH = path.resolve(process.cwd(), '.grm/templates/changelog.ejs');
|
|
43
|
-
// export async function resolveTemplatePath1(paramPath?: string): Promise<string> {
|
|
44
|
-
// if (paramPath) {
|
|
45
|
-
// const resolvedPath = path.resolve(paramPath);
|
|
46
|
-
// try {
|
|
47
|
-
// const isCustomTemplateExists = fs.existsSync(resolvedPath);
|
|
48
|
-
// if (isCustomTemplateExists) {
|
|
49
|
-
// return resolvedPath;
|
|
50
|
-
// }
|
|
51
|
-
// } catch (error: any) {
|
|
52
|
-
// if (error.code === 'ENOENT') {
|
|
53
|
-
// throw new Error(`Template file not found at: ${resolvedPath}`);
|
|
54
|
-
// }
|
|
55
|
-
// throw error;
|
|
56
|
-
// }
|
|
57
|
-
// }
|
|
58
|
-
// const isLocalTemplateExists = fs.existsSync(LOCAL_TEMPLATE_PATH);
|
|
59
|
-
// if (isLocalTemplateExists) {
|
|
60
|
-
// return LOCAL_TEMPLATE_PATH;
|
|
61
|
-
// } else {
|
|
62
|
-
// return DEFAULT_TEMPLATE_PATH;
|
|
63
|
-
// }
|
|
64
|
-
// }
|
|
39
|
+
const constants_1 = require("./constants");
|
|
65
40
|
async function resolveTemplatePath(paramPath, environment = null) {
|
|
66
41
|
const envSuffix = environment ? `.${environment}` : '';
|
|
67
42
|
if (paramPath) {
|
|
@@ -76,26 +51,20 @@ async function resolveTemplatePath(paramPath, environment = null) {
|
|
|
76
51
|
}
|
|
77
52
|
throw new Error(`Template file not found at: ${resolvedPath} or ${defaultParamPath}`);
|
|
78
53
|
}
|
|
79
|
-
const localTemplatePath = LOCAL_TEMPLATE_PATH.replace(/\.ejs$/, `${envSuffix}.ejs`);
|
|
54
|
+
const localTemplatePath = constants_1.LOCAL_TEMPLATE_PATH.replace(/\.ejs$/, `${envSuffix}.ejs`);
|
|
80
55
|
if (fs.existsSync(localTemplatePath)) {
|
|
81
56
|
return localTemplatePath;
|
|
82
57
|
}
|
|
83
|
-
if (fs.existsSync(LOCAL_TEMPLATE_PATH)) {
|
|
84
|
-
return LOCAL_TEMPLATE_PATH;
|
|
58
|
+
if (fs.existsSync(constants_1.LOCAL_TEMPLATE_PATH)) {
|
|
59
|
+
return constants_1.LOCAL_TEMPLATE_PATH;
|
|
85
60
|
}
|
|
86
|
-
const defaultTemplatePath = DEFAULT_TEMPLATE_PATH.replace(/\.ejs$/, `${envSuffix}.ejs`);
|
|
61
|
+
const defaultTemplatePath = constants_1.DEFAULT_TEMPLATE_PATH.replace(/\.ejs$/, `${envSuffix}.ejs`);
|
|
87
62
|
if (fs.existsSync(defaultTemplatePath)) {
|
|
88
63
|
return defaultTemplatePath;
|
|
89
64
|
}
|
|
90
|
-
if (fs.existsSync(DEFAULT_TEMPLATE_PATH)) {
|
|
91
|
-
return DEFAULT_TEMPLATE_PATH;
|
|
65
|
+
if (fs.existsSync(constants_1.DEFAULT_TEMPLATE_PATH)) {
|
|
66
|
+
return constants_1.DEFAULT_TEMPLATE_PATH;
|
|
92
67
|
}
|
|
93
68
|
throw new Error('No valid template file found');
|
|
94
69
|
}
|
|
95
|
-
|
|
96
|
-
const resolvedTemplatePath = await resolveTemplatePath(templatePath, environment);
|
|
97
|
-
const templateContent = fs.readFileSync(resolvedTemplatePath, 'utf-8');
|
|
98
|
-
const output = ejs.render(templateContent, { ...data });
|
|
99
|
-
return output;
|
|
100
|
-
}
|
|
101
|
-
//# sourceMappingURL=index.js.map
|
|
70
|
+
//# sourceMappingURL=templateResolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templateResolver.js","sourceRoot":"","sources":["../../../src/templates/templateResolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,kDAmCC;AAvCD,uCAAwB;AACxB,2CAA4B;AAC5B,2CAAwE;AAEjE,KAAK,UAAU,mBAAmB,CAAC,SAAkB,EAAE,cAA6B,IAAI;IAC3F,MAAM,SAAS,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAEtD,IAAI,SAAS,EAAE,CAAC;QACZ,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,G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