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
package/dist/src/utils/cmd.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.runCommand = runCommand;
|
|
7
|
+
exports.execWithErrorHandling = execWithErrorHandling;
|
|
4
8
|
const child_process_1 = require("child_process");
|
|
9
|
+
const util_1 = __importDefault(require("util"));
|
|
10
|
+
const execPromise = util_1.default.promisify(child_process_1.exec);
|
|
5
11
|
function runCommand(cmd, onError) {
|
|
6
12
|
var _a;
|
|
7
13
|
try {
|
|
@@ -24,34 +30,13 @@ function runCommand(cmd, onError) {
|
|
|
24
30
|
return null;
|
|
25
31
|
}
|
|
26
32
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
// process.stderr?.on('data', (data: Buffer) => {
|
|
37
|
-
// stderr += data.toString();
|
|
38
|
-
// });
|
|
39
|
-
// process.on('close', (status: number | null) => {
|
|
40
|
-
// if (status === 0) {
|
|
41
|
-
// resolve(stdout.trim());
|
|
42
|
-
// } else {
|
|
43
|
-
// if (onError && typeof onError === 'function') {
|
|
44
|
-
// onError(cmd, stderr.trim(), status);
|
|
45
|
-
// }
|
|
46
|
-
// resolve(null);
|
|
47
|
-
// }
|
|
48
|
-
// });
|
|
49
|
-
// process.on('error', (error: Error) => {
|
|
50
|
-
// if (onError && typeof onError === 'function') {
|
|
51
|
-
// onError(cmd, error.message, null);
|
|
52
|
-
// }
|
|
53
|
-
// resolve(null);
|
|
54
|
-
// });
|
|
55
|
-
// });
|
|
56
|
-
// }
|
|
33
|
+
async function execWithErrorHandling(command) {
|
|
34
|
+
try {
|
|
35
|
+
return await execPromise(command);
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
console.error(`Error executing "${command}":`, error);
|
|
39
|
+
return { stdout: '' };
|
|
40
|
+
}
|
|
41
|
+
}
|
|
57
42
|
//# sourceMappingURL=cmd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmd.js","sourceRoot":"","sources":["../../../src/utils/cmd.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cmd.js","sourceRoot":"","sources":["../../../src/utils/cmd.ts"],"names":[],"mappings":";;;;;AAMA,gCAmBC;AAID,sDAOC;AApCD,iDAA+C;AAC/C,gDAAuB;AACvB,MAAM,WAAW,GAAG,cAAI,CAAC,SAAS,CAAC,oBAAI,CAAC,CAAA;AAIxC,SAAgB,UAAU,CAAC,GAAW,EAAE,OAAuB;;IAC3D,IAAI,CAAC;QACD,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QACzC,MAAM,MAAM,GAAG,IAAA,yBAAS,EAAC,OAAO,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAA;QAE7D,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtB,OAAO,CAAA,MAAA,MAAM,CAAC,MAAM,0CAAE,IAAI,EAAE,KAAI,EAAE,CAAA;QACtC,CAAC;aAAM,CAAC;YACJ,IAAI,OAAO,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE,CAAC;gBAC3C,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,CAAA;YACrD,CAAC;YACD,OAAO,IAAI,CAAA;QACf,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,IAAI,OAAO,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE,CAAC;YAC3C,OAAO,CAAC,GAAG,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CAAA;QAC9E,CAAC;QACD,OAAO,IAAI,CAAA;IACf,CAAC;AACL,CAAC;AAIM,KAAK,UAAU,qBAAqB,CAAC,OAAe;IACvD,IAAI,CAAC;QACD,OAAO,MAAM,WAAW,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,oBAAoB,OAAO,IAAI,EAAE,KAAK,CAAC,CAAC;QACtD,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;IAC1B,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatISO8601 = formatISO8601;
|
|
4
|
+
exports.formatDateForGit = formatDateForGit;
|
|
5
|
+
/**
|
|
6
|
+
* Converts a date string from the format 'YYYY-MM-DD HH:mm:ss ±HHMM' to ISO 8601 format.
|
|
7
|
+
*
|
|
8
|
+
* @param dateStr - The date string to be converted, e.g., '2025-01-07 16:57:38 +0300'.
|
|
9
|
+
* @returns The date string in ISO 8601 format, e.g., '2025-01-07T16:57:38+03:00'.
|
|
10
|
+
*/
|
|
11
|
+
function formatISO8601(dateStr) {
|
|
12
|
+
const [datePart, timePart, offset] = dateStr.split(' ');
|
|
13
|
+
const parsedDate = new Date(`${datePart}T${timePart}${offset}`);
|
|
14
|
+
return parsedDate.toISOString();
|
|
15
|
+
}
|
|
16
|
+
function formatDateForGit(dateStr) {
|
|
17
|
+
const date = new Date(dateStr);
|
|
18
|
+
return date.toISOString();
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=date.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date.js","sourceRoot":"","sources":["../../../src/utils/date.ts"],"names":[],"mappings":";;AAMA,sCAKC;AAED,4CAGC;AAhBD;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,OAAe;IACzC,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACvD,MAAM,UAAU,GAAG,IAAI,IAAI,CAAC,GAAG,QAAQ,IAAI,QAAQ,GAAG,MAAM,EAAE,CAAC,CAAA;IAE/D,OAAO,UAAU,CAAC,WAAW,EAAE,CAAA;AACnC,CAAC;AAED,SAAgB,gBAAgB,CAAC,OAAe;IAC5C,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,CAAA;IAC9B,OAAO,IAAI,CAAC,WAAW,EAAE,CAAA;AAC7B,CAAC"}
|
|
@@ -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"}
|
|
@@ -0,0 +1,111 @@
|
|
|
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
|
+
<% } %>
|
|
@@ -0,0 +1,68 @@
|
|
|
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
|
+
<% } %>
|
|
@@ -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"}
|
|
@@ -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
|
|
@@ -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,GAAG,SAAS,MAAM,CAAC,CAAC,CAAA;QAClF,IAAI,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;YAC9B,OAAO,YAAY,CAAA;QACvB,CAAC;QACD,6EAA6E;QAC7E,MAAM,gBAAgB,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;QAChD,IAAI,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,CAAC;YAClC,OAAO,gBAAgB,CAAA;QAC3B,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,+BAA+B,YAAY,OAAO,gBAAgB,EAAE,CAAC,CAAA;IACzF,CAAC;IAED,MAAM,iBAAiB,GAAG,+BAAmB,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,SAAS,MAAM,CAAC,CAAA;IACnF,IAAI,EAAE,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,CAAC;QACnC,OAAO,iBAAiB,CAAA;IAC5B,CAAC;IAED,IAAI,EAAE,CAAC,UAAU,CAAC,+BAAmB,CAAC,EAAE,CAAC;QACrC,OAAO,+BAAmB,CAAA;IAC9B,CAAC;IAED,MAAM,mBAAmB,GAAG,iCAAqB,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,SAAS,MAAM,CAAC,CAAA;IACvF,IAAI,EAAE,CAAC,UAAU,CAAC,mBAAmB,CAAC,EAAE,CAAC;QACrC,OAAO,mBAAmB,CAAA;IAC9B,CAAC;IAED,IAAI,EAAE,CAAC,UAAU,CAAC,iCAAqB,CAAC,EAAE,CAAC;QACvC,OAAO,iCAAqB,CAAA;IAChC,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAA;AACnD,CAAC"}
|
|
@@ -35,60 +35,60 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
const globals_1 = require("@jest/globals");
|
|
37
37
|
const fs = __importStar(require("fs"));
|
|
38
|
-
const
|
|
39
|
-
globals_1.jest.mock(
|
|
38
|
+
const configLoader_1 = require("../../../src/config/configLoader");
|
|
39
|
+
globals_1.jest.mock('fs', () => ({
|
|
40
40
|
promises: {
|
|
41
41
|
readFile: globals_1.jest.fn(),
|
|
42
42
|
},
|
|
43
43
|
}));
|
|
44
|
-
describe(
|
|
45
|
-
const mockPath =
|
|
44
|
+
describe('loadConfigFile', () => {
|
|
45
|
+
const mockPath = '/mock/path/config.json';
|
|
46
46
|
beforeEach(() => {
|
|
47
47
|
globals_1.jest.clearAllMocks();
|
|
48
48
|
});
|
|
49
|
-
it(
|
|
49
|
+
it('should load and parse config file successfully', async () => {
|
|
50
50
|
var _a;
|
|
51
51
|
const mockConfig = {
|
|
52
|
-
appName:
|
|
52
|
+
appName: 'sample-app',
|
|
53
53
|
helpers: {
|
|
54
|
-
formatCommit:
|
|
54
|
+
formatCommit: 'function(commit) { return commit.toUpperCase(); }',
|
|
55
55
|
},
|
|
56
56
|
};
|
|
57
57
|
const readFileMock = fs.promises.readFile;
|
|
58
58
|
readFileMock.mockResolvedValue(JSON.stringify(mockConfig));
|
|
59
|
-
const result = await (0,
|
|
59
|
+
const result = await (0, configLoader_1.loadConfigFile)(mockPath);
|
|
60
60
|
// Use mockResult where needed in your test setup
|
|
61
|
-
expect(fs.promises.readFile).toHaveBeenCalledWith(mockPath,
|
|
62
|
-
expect(result).toHaveProperty(
|
|
63
|
-
expect(typeof ((_a = result.helpers) === null || _a === void 0 ? void 0 : _a.formatCommit)).toBe(
|
|
61
|
+
expect(fs.promises.readFile).toHaveBeenCalledWith(mockPath, 'utf-8');
|
|
62
|
+
expect(result).toHaveProperty('helpers');
|
|
63
|
+
expect(typeof ((_a = result.helpers) === null || _a === void 0 ? void 0 : _a.formatCommit)).toBe('function');
|
|
64
64
|
});
|
|
65
|
-
it(
|
|
66
|
-
const error = new Error(
|
|
67
|
-
error.code =
|
|
65
|
+
it('should return empty object when file does not exist', async () => {
|
|
66
|
+
const error = new Error('File not found');
|
|
67
|
+
error.code = 'ENOENT';
|
|
68
68
|
const readFileMock = fs.promises.readFile;
|
|
69
69
|
readFileMock.mockRejectedValue(error);
|
|
70
|
-
const result = await (0,
|
|
70
|
+
const result = await (0, configLoader_1.loadConfigFile)(mockPath);
|
|
71
71
|
expect(result).toEqual({});
|
|
72
72
|
});
|
|
73
|
-
it(
|
|
74
|
-
const error = new Error(
|
|
73
|
+
it('should throw error for other file system errors', async () => {
|
|
74
|
+
const error = new Error('Permission denied');
|
|
75
75
|
const readFileMock = fs.promises.readFile;
|
|
76
76
|
readFileMock.mockRejectedValue(error);
|
|
77
|
-
await expect((0,
|
|
77
|
+
await expect((0, configLoader_1.loadConfigFile)(mockPath)).rejects.toThrow('Permission denied');
|
|
78
78
|
});
|
|
79
|
-
it(
|
|
79
|
+
it('should handle config without helpers', async () => {
|
|
80
80
|
const mockConfig = {
|
|
81
|
-
someOtherProperty:
|
|
81
|
+
someOtherProperty: 'value',
|
|
82
82
|
};
|
|
83
83
|
const readFileMock = fs.promises.readFile;
|
|
84
84
|
readFileMock.mockResolvedValue(JSON.stringify(mockConfig));
|
|
85
|
-
const result = await (0,
|
|
85
|
+
const result = await (0, configLoader_1.loadConfigFile)(mockPath);
|
|
86
86
|
expect(result).toEqual(mockConfig);
|
|
87
87
|
});
|
|
88
|
-
it(
|
|
88
|
+
it('should handle invalid JSON', async () => {
|
|
89
89
|
const readFileMock = fs.promises.readFile;
|
|
90
|
-
readFileMock.mockResolvedValue(
|
|
91
|
-
await expect((0,
|
|
90
|
+
readFileMock.mockResolvedValue('invalid json');
|
|
91
|
+
await expect((0, configLoader_1.loadConfigFile)(mockPath)).rejects.toThrow(SyntaxError);
|
|
92
92
|
});
|
|
93
93
|
});
|
|
94
94
|
//# sourceMappingURL=loadConfigFile.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadConfigFile.test.js","sourceRoot":"","sources":["../../../../test/config/configLoader/loadConfigFile.test.ts"],"names":[],"mappings":"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"}
|
|
@@ -36,88 +36,87 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
const globals_1 = require("@jest/globals");
|
|
37
37
|
const fs = __importStar(require("fs"));
|
|
38
38
|
const path = __importStar(require("path"));
|
|
39
|
-
const
|
|
40
|
-
globals_1.jest.mock(
|
|
39
|
+
const configManager_1 = require("../../../src/config/configManager");
|
|
40
|
+
globals_1.jest.mock('fs', () => ({
|
|
41
41
|
existsSync: globals_1.jest.fn(),
|
|
42
42
|
promises: {
|
|
43
43
|
readFile: globals_1.jest.fn(),
|
|
44
44
|
},
|
|
45
45
|
}));
|
|
46
|
-
globals_1.jest.mock(
|
|
47
|
-
resolve: globals_1.jest.fn(
|
|
46
|
+
globals_1.jest.mock('path', () => ({
|
|
47
|
+
resolve: globals_1.jest.fn(path => path),
|
|
48
48
|
}));
|
|
49
49
|
function isPathLike(param) {
|
|
50
|
-
return typeof param ===
|
|
50
|
+
return typeof param === 'string' || param instanceof Buffer;
|
|
51
51
|
}
|
|
52
|
-
describe(
|
|
52
|
+
describe('readConfig', () => {
|
|
53
53
|
beforeEach(() => {
|
|
54
54
|
globals_1.jest.clearAllMocks();
|
|
55
55
|
fs.existsSync.mockReturnValue(true);
|
|
56
56
|
});
|
|
57
|
-
it(
|
|
58
|
-
const mockDefaultConfig = { prop1:
|
|
59
|
-
const mockLocalConfig = { prop1:
|
|
60
|
-
const mockCustomConfig = { prop1:
|
|
61
|
-
const customConfigPath =
|
|
57
|
+
it('should merge configs with correct priority', async () => {
|
|
58
|
+
const mockDefaultConfig = { prop1: 'default', prop2: 'default' };
|
|
59
|
+
const mockLocalConfig = { prop1: 'local' };
|
|
60
|
+
const mockCustomConfig = { prop1: 'custom' };
|
|
61
|
+
const customConfigPath = '/custom/path/config.json';
|
|
62
62
|
const readFileMock = fs.promises.readFile;
|
|
63
63
|
readFileMock
|
|
64
64
|
.mockResolvedValueOnce(JSON.stringify(mockDefaultConfig)) // Default config
|
|
65
65
|
.mockResolvedValueOnce(JSON.stringify(mockLocalConfig)) // Local config
|
|
66
66
|
.mockResolvedValueOnce(JSON.stringify(mockCustomConfig)); // Custom config
|
|
67
|
-
const result = await (0,
|
|
68
|
-
expect(fs.promises.readFile).toHaveBeenCalledWith(customConfigPath,
|
|
67
|
+
const result = await (0, configManager_1.readConfig)(customConfigPath);
|
|
68
|
+
expect(fs.promises.readFile).toHaveBeenCalledWith(customConfigPath, 'utf-8');
|
|
69
69
|
expect(result).toEqual({
|
|
70
|
-
prop1:
|
|
71
|
-
prop2:
|
|
70
|
+
prop1: 'default', //! validate custom config, not correct in test case? should validate "custom" for prop1
|
|
71
|
+
prop2: 'default',
|
|
72
72
|
});
|
|
73
73
|
});
|
|
74
|
-
it(
|
|
75
|
-
const mockDefaultConfig = { prop:
|
|
76
|
-
const mockEnvConfig = { prop:
|
|
74
|
+
it('should handle environment-specific configs', async () => {
|
|
75
|
+
const mockDefaultConfig = { prop: 'default' };
|
|
76
|
+
const mockEnvConfig = { prop: 'production' };
|
|
77
77
|
const existsSyncMock = fs.existsSync;
|
|
78
78
|
// Apply the mock implementation
|
|
79
|
-
existsSyncMock.mockImplementation((path) => path.toString().includes(
|
|
79
|
+
existsSyncMock.mockImplementation((path) => path.toString().includes('.production.json'));
|
|
80
80
|
const readFileMock = fs.promises.readFile;
|
|
81
|
-
readFileMock
|
|
82
|
-
|
|
83
|
-
const result = await (0, config_1.readConfig)(null, "production");
|
|
81
|
+
readFileMock.mockResolvedValueOnce(JSON.stringify(mockEnvConfig));
|
|
82
|
+
const result = await (0, configManager_1.readConfig)(null, 'production');
|
|
84
83
|
expect(result).toEqual({
|
|
85
|
-
prop:
|
|
84
|
+
prop: 'production',
|
|
86
85
|
});
|
|
87
86
|
});
|
|
88
|
-
it(
|
|
89
|
-
const mockDefaultConfig = { prop:
|
|
87
|
+
it('should fall back to default config when env config does not exist', async () => {
|
|
88
|
+
const mockDefaultConfig = { prop: 'default' };
|
|
90
89
|
fs.existsSync.mockReturnValue(false);
|
|
91
90
|
const readFileMock = fs.promises.readFile;
|
|
92
91
|
readFileMock.mockResolvedValue(JSON.stringify(mockDefaultConfig));
|
|
93
|
-
const result = await (0,
|
|
92
|
+
const result = await (0, configManager_1.readConfig)(null, 'nonexistent');
|
|
94
93
|
expect(result).toEqual({
|
|
95
|
-
prop:
|
|
94
|
+
prop: 'default',
|
|
96
95
|
});
|
|
97
96
|
});
|
|
98
|
-
it(
|
|
99
|
-
const mockDefaultConfig = { prop:
|
|
97
|
+
it('should handle missing custom config path', async () => {
|
|
98
|
+
const mockDefaultConfig = { prop: 'default' };
|
|
100
99
|
fs.existsSync.mockReturnValue(false);
|
|
101
100
|
const readFileMock = fs.promises.readFile;
|
|
102
101
|
readFileMock.mockResolvedValue(JSON.stringify(mockDefaultConfig));
|
|
103
|
-
const result = await (0,
|
|
102
|
+
const result = await (0, configManager_1.readConfig)();
|
|
104
103
|
expect(result).toEqual(mockDefaultConfig);
|
|
105
104
|
});
|
|
106
|
-
it(
|
|
107
|
-
const error = new Error(
|
|
108
|
-
error.code =
|
|
105
|
+
it('should handle file read errors', async () => {
|
|
106
|
+
const error = new Error('File not found');
|
|
107
|
+
error.code = 'ENOENT';
|
|
109
108
|
const readFileMock = fs.promises.readFile;
|
|
110
109
|
readFileMock.mockRejectedValue(error);
|
|
111
|
-
const result = await (0,
|
|
110
|
+
const result = await (0, configManager_1.readConfig)();
|
|
112
111
|
expect(result).toEqual({});
|
|
113
112
|
});
|
|
114
|
-
it(
|
|
115
|
-
const mockCustomConfig = { prop:
|
|
116
|
-
const customPath =
|
|
113
|
+
it('should handle custom config with environment', async () => {
|
|
114
|
+
const mockCustomConfig = { prop: 'custom-prod' };
|
|
115
|
+
const customPath = '/custom/path/config.production.json';
|
|
117
116
|
fs.existsSync.mockReturnValue(true);
|
|
118
117
|
const readFileMock = fs.promises.readFile;
|
|
119
118
|
readFileMock.mockResolvedValue(JSON.stringify(mockCustomConfig));
|
|
120
|
-
const result = await (0,
|
|
119
|
+
const result = await (0, configManager_1.readConfig)('/custom/path/config.json', 'production');
|
|
121
120
|
expect(path.resolve).toHaveBeenCalledWith(customPath);
|
|
122
121
|
expect(result).toEqual(mockCustomConfig);
|
|
123
122
|
});
|