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.
Files changed (345) hide show
  1. package/dist/cli/types/BranchCliArgs.js +3 -0
  2. package/dist/cli/types/BranchCliArgs.js.map +1 -0
  3. package/dist/cli/types/ChangelogCliArgs.js +3 -0
  4. package/dist/cli/types/ChangelogCliArgs.js.map +1 -0
  5. package/dist/cli/types/CliArgs.js +3 -0
  6. package/dist/cli/types/CliArgs.js.map +1 -0
  7. package/dist/cli/types/VersionCliArgs.js +3 -0
  8. package/dist/cli/types/VersionCliArgs.js.map +1 -0
  9. package/dist/config/configLoader.js +61 -0
  10. package/dist/config/configLoader.js.map +1 -0
  11. package/dist/{src/config/index.js → config/configManager.js} +13 -33
  12. package/dist/config/configManager.js.map +1 -0
  13. package/dist/config/constants.js +10 -0
  14. package/dist/config/constants.js.map +1 -0
  15. package/dist/{src/config/defaultConfig.json → config/defaults/config.json} +231 -231
  16. package/dist/config/types/ChannelType.js +3 -0
  17. package/dist/config/types/ChannelType.js.map +1 -0
  18. package/dist/config/types/CommitType.js +3 -0
  19. package/dist/config/types/CommitType.js.map +1 -0
  20. package/dist/config/types/Config.js +3 -0
  21. package/dist/config/types/Config.js.map +1 -0
  22. package/dist/config/types/FileGroups.js +3 -0
  23. package/dist/config/types/FileGroups.js.map +1 -0
  24. package/dist/config/types/LinkType.js +3 -0
  25. package/dist/config/types/LinkType.js.map +1 -0
  26. package/dist/config/types/MentionType.js +3 -0
  27. package/dist/config/types/MentionType.js.map +1 -0
  28. package/dist/config/types/NoteType.js +3 -0
  29. package/dist/config/types/NoteType.js.map +1 -0
  30. package/dist/config/types/Options.js +3 -0
  31. package/dist/config/types/Options.js.map +1 -0
  32. package/dist/core/changelog/app.js +40 -0
  33. package/dist/core/changelog/app.js.map +1 -0
  34. package/dist/index.js +89 -0
  35. package/dist/index.js.map +1 -0
  36. package/dist/modules/branch/BranchController.js +62 -0
  37. package/dist/modules/branch/BranchController.js.map +1 -0
  38. package/dist/modules/branch/BranchManager.js +194 -0
  39. package/dist/modules/branch/BranchManager.js.map +1 -0
  40. package/dist/modules/changelog/ChangelogValidator.js +19 -0
  41. package/dist/modules/changelog/ChangelogValidator.js.map +1 -0
  42. package/dist/modules/changelog/templateOperations.js +144 -0
  43. package/dist/modules/changelog/templateOperations.js.map +1 -0
  44. package/dist/modules/changes/types/ChangeInformation.js +3 -0
  45. package/dist/modules/changes/types/ChangeInformation.js.map +1 -0
  46. package/dist/modules/changes/types/Context.js +3 -0
  47. package/dist/modules/changes/types/Context.js.map +1 -0
  48. package/dist/modules/changes/types/RangeInfo.js +8 -0
  49. package/dist/modules/changes/types/RangeInfo.js.map +1 -0
  50. package/dist/modules/changes/types/RangeSummary.js +3 -0
  51. package/dist/modules/changes/types/RangeSummary.js.map +1 -0
  52. package/dist/modules/changes/types/ReferenceTypesEnum.js +12 -0
  53. package/dist/modules/changes/types/ReferenceTypesEnum.js.map +1 -0
  54. package/dist/modules/git/commits/commitProcessor.js +50 -0
  55. package/dist/modules/git/commits/commitProcessor.js.map +1 -0
  56. package/dist/modules/git/commits/gitLogFetcher.js +27 -0
  57. package/dist/modules/git/commits/gitLogFetcher.js.map +1 -0
  58. package/dist/modules/git/commits/index.js +136 -0
  59. package/dist/modules/git/commits/index.js.map +1 -0
  60. package/dist/modules/git/commits/profileHandler.js +48 -0
  61. package/dist/modules/git/commits/profileHandler.js.map +1 -0
  62. package/dist/modules/git/commits/regexHandlers.js +27 -0
  63. package/dist/modules/git/commits/regexHandlers.js.map +1 -0
  64. package/dist/modules/git/context/branchHandler.js +18 -0
  65. package/dist/modules/git/context/branchHandler.js.map +1 -0
  66. package/dist/modules/git/context/commitHandler.js +29 -0
  67. package/dist/modules/git/context/commitHandler.js.map +1 -0
  68. package/dist/modules/git/context/index.js +26 -0
  69. package/dist/modules/git/context/index.js.map +1 -0
  70. package/dist/modules/git/context/remoteHandler.js +20 -0
  71. package/dist/modules/git/context/remoteHandler.js.map +1 -0
  72. package/dist/modules/git/context/statusHandler.js +16 -0
  73. package/dist/modules/git/context/statusHandler.js.map +1 -0
  74. package/dist/modules/git/context/tagHandler.js +28 -0
  75. package/dist/modules/git/context/tagHandler.js.map +1 -0
  76. package/dist/modules/git/gitOperations.js +56 -0
  77. package/dist/modules/git/gitOperations.js.map +1 -0
  78. package/dist/modules/git/types/Author.js +3 -0
  79. package/dist/modules/git/types/Author.js.map +1 -0
  80. package/dist/modules/git/types/Branch.js +3 -0
  81. package/dist/modules/git/types/Branch.js.map +1 -0
  82. package/dist/modules/git/types/BranchInfo.js +3 -0
  83. package/dist/modules/git/types/BranchInfo.js.map +1 -0
  84. package/dist/modules/git/types/CommitContent.js +3 -0
  85. package/dist/modules/git/types/CommitContent.js.map +1 -0
  86. package/dist/modules/git/types/CommitInfo.js +3 -0
  87. package/dist/modules/git/types/CommitInfo.js.map +1 -0
  88. package/dist/modules/git/types/CommitType.js +3 -0
  89. package/dist/modules/git/types/CommitType.js.map +1 -0
  90. package/dist/modules/git/types/GitCommit.js +3 -0
  91. package/dist/modules/git/types/GitCommit.js.map +1 -0
  92. package/dist/modules/git/types/GitReference.js +3 -0
  93. package/dist/modules/git/types/GitReference.js.map +1 -0
  94. package/dist/{src/core/types.js → modules/git/types/Link.js} +1 -1
  95. package/dist/modules/git/types/Link.js.map +1 -0
  96. package/dist/modules/git/types/Mention.js +3 -0
  97. package/dist/modules/git/types/Mention.js.map +1 -0
  98. package/dist/{src/config/types.js → modules/git/types/Note.js} +1 -1
  99. package/dist/modules/git/types/Note.js.map +1 -0
  100. package/dist/modules/git/types/RemoteInfo.js +3 -0
  101. package/dist/modules/git/types/RemoteInfo.js.map +1 -0
  102. package/dist/modules/git/types/Repository.js +3 -0
  103. package/dist/modules/git/types/Repository.js.map +1 -0
  104. package/dist/modules/git/types/StatusInfo.js +3 -0
  105. package/dist/modules/git/types/StatusInfo.js.map +1 -0
  106. package/dist/{src/utils/cli.js → modules/git/types/Tag.js} +1 -1
  107. package/dist/modules/git/types/Tag.js.map +1 -0
  108. package/dist/modules/git/types/TagInfo.js +3 -0
  109. package/dist/modules/git/types/TagInfo.js.map +1 -0
  110. package/dist/modules/git/utils/branchUtils.js +54 -0
  111. package/dist/modules/git/utils/branchUtils.js.map +1 -0
  112. package/dist/modules/git/utils/commitUtils.js +48 -0
  113. package/dist/modules/git/utils/commitUtils.js.map +1 -0
  114. package/dist/modules/git/utils/logUtils.js +18 -0
  115. package/dist/modules/git/utils/logUtils.js.map +1 -0
  116. package/dist/modules/git/utils/rangeOperations.js +14 -0
  117. package/dist/modules/git/utils/rangeOperations.js.map +1 -0
  118. package/dist/modules/git/utils/refUtils.js +41 -0
  119. package/dist/modules/git/utils/refUtils.js.map +1 -0
  120. package/dist/modules/git/utils/referenceUtils.js +135 -0
  121. package/dist/modules/git/utils/referenceUtils.js.map +1 -0
  122. package/dist/modules/git/utils/tagUtils.js +55 -0
  123. package/dist/modules/git/utils/tagUtils.js.map +1 -0
  124. package/dist/{src → modules}/output/writer.js +2 -2
  125. package/dist/modules/output/writer.js.map +1 -0
  126. package/dist/modules/sections/contributors.js +50 -0
  127. package/dist/modules/sections/contributors.js.map +1 -0
  128. package/dist/modules/sections/grouping.js +64 -0
  129. package/dist/modules/sections/grouping.js.map +1 -0
  130. package/dist/modules/sections/index.js +19 -0
  131. package/dist/modules/sections/index.js.map +1 -0
  132. package/dist/modules/sections/summarizing.js +75 -0
  133. package/dist/modules/sections/summarizing.js.map +1 -0
  134. package/dist/modules/sections/types/Contributor.js +3 -0
  135. package/dist/modules/sections/types/Contributor.js.map +1 -0
  136. package/dist/modules/sections/types/Group.js +3 -0
  137. package/dist/modules/sections/types/Group.js.map +1 -0
  138. package/dist/modules/sections/types/SectionSummary.js +3 -0
  139. package/dist/modules/sections/types/SectionSummary.js.map +1 -0
  140. package/dist/modules/sections/types/Sections.js +3 -0
  141. package/dist/modules/sections/types/Sections.js.map +1 -0
  142. package/dist/modules/version/GitVersionManager.js +153 -0
  143. package/dist/modules/version/GitVersionManager.js.map +1 -0
  144. package/dist/modules/version/ReleaseManager.js +69 -0
  145. package/dist/modules/version/ReleaseManager.js.map +1 -0
  146. package/dist/modules/version/VersionManager.js +77 -0
  147. package/dist/modules/version/VersionManager.js.map +1 -0
  148. package/dist/modules/version/VersionValidator.js +31 -0
  149. package/dist/modules/version/VersionValidator.js.map +1 -0
  150. package/dist/modules/version/types/const.js +3 -0
  151. package/dist/modules/version/types/const.js.map +1 -0
  152. package/dist/modules/version/versionFormatter.js +104 -0
  153. package/dist/modules/version/versionFormatter.js.map +1 -0
  154. package/dist/modules/version/versionHelper.js +9 -0
  155. package/dist/modules/version/versionHelper.js.map +1 -0
  156. package/dist/src/cli/types/BranchCliArgs.js +3 -0
  157. package/dist/src/cli/types/BranchCliArgs.js.map +1 -0
  158. package/dist/src/cli/types/ChangelogCliArgs.js +3 -0
  159. package/dist/src/cli/types/ChangelogCliArgs.js.map +1 -0
  160. package/dist/src/cli/types/CliArgs.js +3 -0
  161. package/dist/src/cli/types/CliArgs.js.map +1 -0
  162. package/dist/src/cli/types/VersionCliArgs.js +3 -0
  163. package/dist/src/cli/types/VersionCliArgs.js.map +1 -0
  164. package/dist/src/config/configLoader.js +61 -0
  165. package/dist/src/config/configLoader.js.map +1 -0
  166. package/dist/src/config/configManager.js +66 -0
  167. package/dist/src/config/configManager.js.map +1 -0
  168. package/dist/src/config/constants.js +10 -0
  169. package/dist/src/config/constants.js.map +1 -0
  170. package/dist/src/config/defaults/config.json +232 -0
  171. package/dist/src/config/types/ChannelType.js +3 -0
  172. package/dist/src/config/types/ChannelType.js.map +1 -0
  173. package/dist/src/config/types/CommitType.js +3 -0
  174. package/dist/src/config/types/CommitType.js.map +1 -0
  175. package/dist/src/config/types/Config.js +3 -0
  176. package/dist/src/config/types/Config.js.map +1 -0
  177. package/dist/src/config/types/FileGroups.js +3 -0
  178. package/dist/src/config/types/FileGroups.js.map +1 -0
  179. package/dist/src/config/types/LinkType.js +3 -0
  180. package/dist/src/config/types/LinkType.js.map +1 -0
  181. package/dist/src/config/types/MentionType.js +3 -0
  182. package/dist/src/config/types/MentionType.js.map +1 -0
  183. package/dist/src/config/types/NoteType.js +3 -0
  184. package/dist/src/config/types/NoteType.js.map +1 -0
  185. package/dist/src/config/types/Options.js +3 -0
  186. package/dist/src/config/types/Options.js.map +1 -0
  187. package/dist/src/core/changelog/app.js +20 -0
  188. package/dist/src/core/changelog/app.js.map +1 -0
  189. package/dist/src/index.js +139 -20
  190. package/dist/src/index.js.map +1 -1
  191. package/dist/src/modules/changelog/templateOperations.js +142 -0
  192. package/dist/src/modules/changelog/templateOperations.js.map +1 -0
  193. package/dist/src/modules/changes/types/ChangeInformation.js +3 -0
  194. package/dist/src/modules/changes/types/ChangeInformation.js.map +1 -0
  195. package/dist/src/modules/changes/types/Context.js +3 -0
  196. package/dist/src/modules/changes/types/Context.js.map +1 -0
  197. package/dist/src/modules/changes/types/RangeInfo.js +8 -0
  198. package/dist/src/modules/changes/types/RangeInfo.js.map +1 -0
  199. package/dist/src/modules/changes/types/RangeSummary.js +3 -0
  200. package/dist/src/modules/changes/types/RangeSummary.js.map +1 -0
  201. package/dist/src/modules/changes/types/ReferenceTypesEnum.js +12 -0
  202. package/dist/src/modules/changes/types/ReferenceTypesEnum.js.map +1 -0
  203. package/dist/src/modules/git/commits/commitProcessor.js +50 -0
  204. package/dist/src/modules/git/commits/commitProcessor.js.map +1 -0
  205. package/dist/src/modules/git/commits/gitLogFetcher.js +27 -0
  206. package/dist/src/modules/git/commits/gitLogFetcher.js.map +1 -0
  207. package/dist/src/modules/git/commits/index.js +136 -0
  208. package/dist/src/modules/git/commits/index.js.map +1 -0
  209. package/dist/src/modules/git/commits/profileHandler.js +48 -0
  210. package/dist/src/modules/git/commits/profileHandler.js.map +1 -0
  211. package/dist/src/modules/git/commits/regexHandlers.js +27 -0
  212. package/dist/src/modules/git/commits/regexHandlers.js.map +1 -0
  213. package/dist/src/modules/git/context/branchHandler.js +18 -0
  214. package/dist/src/modules/git/context/branchHandler.js.map +1 -0
  215. package/dist/src/modules/git/context/commitHandler.js +29 -0
  216. package/dist/src/modules/git/context/commitHandler.js.map +1 -0
  217. package/dist/src/modules/git/context/index.js +26 -0
  218. package/dist/src/modules/git/context/index.js.map +1 -0
  219. package/dist/src/modules/git/context/remoteHandler.js +20 -0
  220. package/dist/src/modules/git/context/remoteHandler.js.map +1 -0
  221. package/dist/src/modules/git/context/statusHandler.js +16 -0
  222. package/dist/src/modules/git/context/statusHandler.js.map +1 -0
  223. package/dist/src/modules/git/context/tagHandler.js +28 -0
  224. package/dist/src/modules/git/context/tagHandler.js.map +1 -0
  225. package/dist/src/modules/git/gitOperations.js +56 -0
  226. package/dist/src/modules/git/gitOperations.js.map +1 -0
  227. package/dist/src/modules/git/types/Author.js +3 -0
  228. package/dist/src/modules/git/types/Author.js.map +1 -0
  229. package/dist/src/modules/git/types/Branch.js +3 -0
  230. package/dist/src/modules/git/types/Branch.js.map +1 -0
  231. package/dist/src/modules/git/types/BranchInfo.js +3 -0
  232. package/dist/src/modules/git/types/BranchInfo.js.map +1 -0
  233. package/dist/src/modules/git/types/CommitContent.js +3 -0
  234. package/dist/src/modules/git/types/CommitContent.js.map +1 -0
  235. package/dist/src/modules/git/types/CommitInfo.js +3 -0
  236. package/dist/src/modules/git/types/CommitInfo.js.map +1 -0
  237. package/dist/src/modules/git/types/CommitType.js +3 -0
  238. package/dist/src/modules/git/types/CommitType.js.map +1 -0
  239. package/dist/src/modules/git/types/GitCommit.js +3 -0
  240. package/dist/src/modules/git/types/GitCommit.js.map +1 -0
  241. package/dist/src/modules/git/types/GitReference.js +3 -0
  242. package/dist/src/modules/git/types/GitReference.js.map +1 -0
  243. package/dist/src/modules/git/types/Link.js +3 -0
  244. package/dist/src/modules/git/types/Link.js.map +1 -0
  245. package/dist/src/modules/git/types/Mention.js +3 -0
  246. package/dist/src/modules/git/types/Mention.js.map +1 -0
  247. package/dist/src/modules/git/types/Note.js +3 -0
  248. package/dist/src/modules/git/types/Note.js.map +1 -0
  249. package/dist/src/modules/git/types/RemoteInfo.js +3 -0
  250. package/dist/src/modules/git/types/RemoteInfo.js.map +1 -0
  251. package/dist/src/modules/git/types/Repository.js +3 -0
  252. package/dist/src/modules/git/types/Repository.js.map +1 -0
  253. package/dist/src/modules/git/types/StatusInfo.js +3 -0
  254. package/dist/src/modules/git/types/StatusInfo.js.map +1 -0
  255. package/dist/src/modules/git/types/Tag.js +3 -0
  256. package/dist/src/modules/git/types/Tag.js.map +1 -0
  257. package/dist/src/modules/git/types/TagInfo.js +3 -0
  258. package/dist/src/modules/git/types/TagInfo.js.map +1 -0
  259. package/dist/src/modules/git/utils/branchUtils.js +54 -0
  260. package/dist/src/modules/git/utils/branchUtils.js.map +1 -0
  261. package/dist/src/modules/git/utils/commitUtils.js +48 -0
  262. package/dist/src/modules/git/utils/commitUtils.js.map +1 -0
  263. package/dist/src/modules/git/utils/logUtils.js +18 -0
  264. package/dist/src/modules/git/utils/logUtils.js.map +1 -0
  265. package/dist/src/modules/git/utils/rangeOperations.js +14 -0
  266. package/dist/src/modules/git/utils/rangeOperations.js.map +1 -0
  267. package/dist/src/modules/git/utils/refUtils.js +41 -0
  268. package/dist/src/modules/git/utils/refUtils.js.map +1 -0
  269. package/dist/src/modules/git/utils/referenceUtils.js +135 -0
  270. package/dist/src/modules/git/utils/referenceUtils.js.map +1 -0
  271. package/dist/src/modules/git/utils/tagUtils.js +55 -0
  272. package/dist/src/modules/git/utils/tagUtils.js.map +1 -0
  273. package/dist/src/modules/output/writer.js +46 -0
  274. package/dist/src/modules/output/writer.js.map +1 -0
  275. package/dist/src/modules/sections/contributors.js +50 -0
  276. package/dist/src/modules/sections/contributors.js.map +1 -0
  277. package/dist/src/modules/sections/grouping.js +64 -0
  278. package/dist/src/modules/sections/grouping.js.map +1 -0
  279. package/dist/src/modules/sections/index.js +19 -0
  280. package/dist/src/modules/sections/index.js.map +1 -0
  281. package/dist/src/modules/sections/summarizing.js +75 -0
  282. package/dist/src/modules/sections/summarizing.js.map +1 -0
  283. package/dist/src/modules/sections/types/Contributor.js +3 -0
  284. package/dist/src/modules/sections/types/Contributor.js.map +1 -0
  285. package/dist/src/modules/sections/types/Group.js +3 -0
  286. package/dist/src/modules/sections/types/Group.js.map +1 -0
  287. package/dist/src/modules/sections/types/SectionSummary.js +3 -0
  288. package/dist/src/modules/sections/types/SectionSummary.js.map +1 -0
  289. package/dist/src/modules/sections/types/Sections.js +3 -0
  290. package/dist/src/modules/sections/types/Sections.js.map +1 -0
  291. package/dist/src/templates/constants.js +10 -0
  292. package/dist/src/templates/constants.js.map +1 -0
  293. package/dist/src/templates/{changelog.detailed.ejs → defaults/changelog.detailed.ejs} +110 -110
  294. package/dist/src/templates/{changelog.ejs → defaults/changelog.ejs} +67 -67
  295. package/dist/src/templates/templateRenderer.js +46 -0
  296. package/dist/src/templates/templateRenderer.js.map +1 -0
  297. package/dist/src/templates/{index.js → templateResolver.js} +8 -39
  298. package/dist/src/templates/templateResolver.js.map +1 -0
  299. package/dist/src/types/PackageJson.js +3 -0
  300. package/dist/src/types/PackageJson.js.map +1 -0
  301. package/dist/src/utils/cmd.js +15 -30
  302. package/dist/src/utils/cmd.js.map +1 -1
  303. package/dist/src/utils/date.js +20 -0
  304. package/dist/src/utils/date.js.map +1 -0
  305. package/dist/templates/constants.js +10 -0
  306. package/dist/templates/constants.js.map +1 -0
  307. package/dist/templates/defaults/changelog.detailed.ejs +111 -0
  308. package/dist/templates/defaults/changelog.ejs +68 -0
  309. package/dist/templates/templateRenderer.js +46 -0
  310. package/dist/templates/templateRenderer.js.map +1 -0
  311. package/dist/templates/templateResolver.js +70 -0
  312. package/dist/templates/templateResolver.js.map +1 -0
  313. package/dist/test/config/{loadConfigFile.test.js → configLoader/loadConfigFile.test.js} +24 -24
  314. package/dist/test/config/configLoader/loadConfigFile.test.js.map +1 -0
  315. package/dist/test/config/{readConfig.test.js → configManager/readConfig.test.js} +37 -38
  316. package/dist/test/config/configManager/readConfig.test.js.map +1 -0
  317. package/dist/types/PackageJson.js +3 -0
  318. package/dist/types/PackageJson.js.map +1 -0
  319. package/dist/utils/cmd.js +42 -0
  320. package/dist/utils/cmd.js.map +1 -0
  321. package/dist/utils/date.js +20 -0
  322. package/dist/utils/date.js.map +1 -0
  323. package/package.json +64 -61
  324. package/dist/src/config/index.js.map +0 -1
  325. package/dist/src/config/types.js.map +0 -1
  326. package/dist/src/core/app.js +0 -218
  327. package/dist/src/core/app.js.map +0 -1
  328. package/dist/src/core/types.js.map +0 -1
  329. package/dist/src/git/commits.js +0 -237
  330. package/dist/src/git/commits.js.map +0 -1
  331. package/dist/src/git/context.js +0 -95
  332. package/dist/src/git/context.js.map +0 -1
  333. package/dist/src/main.js +0 -22
  334. package/dist/src/main.js.map +0 -1
  335. package/dist/src/output/writer.js.map +0 -1
  336. package/dist/src/sections/index.js +0 -207
  337. package/dist/src/sections/index.js.map +0 -1
  338. package/dist/src/templates/index.js.map +0 -1
  339. package/dist/src/utils/cli.js.map +0 -1
  340. package/dist/src/utils/git-utils.js +0 -278
  341. package/dist/src/utils/git-utils.js.map +0 -1
  342. package/dist/src/utils/helpers.js +0 -50
  343. package/dist/src/utils/helpers.js.map +0 -1
  344. package/dist/test/config/loadConfigFile.test.js.map +0 -1
  345. 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":"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"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Contributor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Contributor.js","sourceRoot":"","sources":["../../../../../src/modules/sections/types/Contributor.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Group.js","sourceRoot":"","sources":["../../../../../src/modules/sections/types/Group.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=SectionSummary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SectionSummary.js","sourceRoot":"","sources":["../../../../../src/modules/sections/types/SectionSummary.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=Sections.js.map
@@ -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 - <%= latestTag?.date?.split("T")[0] %>
2
-
3
- ## Summary:
4
- <% sections.summary.commits.forEach(function(commit) { %>
5
- - <%= commit.title %>: <%= commit.count %> <%= commit.count === 1 ? 'commit' : 'commits' %>
6
- <% }) %>
7
- <% sections.summary.notes.forEach(function(note) { %>
8
- - <%= note.title %>: <%= note.count %> <%= note.count === 1 ? 'note' : 'notes' %>
9
- <% }) %>
10
- and <%= sections.summary.contributors.length %> <%= sections.summary.contributors.length === 1 ? '❤️ contributor' : '❤️ contributors' %>
11
-
12
-
13
- <% if (sections.notes.length > 0) { %>
14
- ## Notes
15
- <% sections.notes.forEach((note) => { %>
16
- ### <%= note.title %>
17
- <% note.items.forEach(item => { %>
18
- <%
19
- const commitLinks = `[#${item.commit.raw.shortHash}](#commit-${item.commit.raw.shortHash})`;
20
- %>
21
- - <%= item.note.content %> (<%= commitLinks %>)
22
- <% }) %>
23
- <% }) %>
24
- <% } %>
25
-
26
-
27
- <% if (sections.commits.length > 0) { %>
28
- ## Changes
29
- <% sections.commits.forEach((section) => { %>
30
- ### <%= section.title %>:
31
- <%
32
- // Scope'a göre commit'leri gruplama
33
- const scopedCommits = {};
34
- const unscopedCommits = [];
35
-
36
- section.items.forEach(commit => {
37
- if (commit.scope) {
38
- if (!scopedCommits[commit.scope]) {
39
- scopedCommits[commit.scope] = [];
40
- }
41
- scopedCommits[commit.scope].push(commit);
42
- } else {
43
- unscopedCommits.push(commit);
44
- }
45
- });
46
- %>
47
-
48
- <% // Scope'lu commit'leri gösterme
49
- Object.keys(scopedCommits).sort().forEach(scope => { %>
50
- #### <%= scope %>
51
- <% scopedCommits[scope].forEach(commit => {
52
- const author = `[@${commit.author.name}](${commit.author.profileUrl})`;
53
- const mentions = commit.mentions
54
- ? commit.mentions
55
- .filter(mention => ['co-authored-by', 'helped-by'].includes(mention.type))
56
- .map(mention => `[@${mention.name}](${mention.profileUrl})`)
57
- .join(', ')
58
- : '';
59
- const authorText = mentions ? `${author} with ${mentions}` : author;
60
-
61
- const commitLink = `[#${commit.raw.shortHash}](${repository.remote.repoUrl}/commit/${commit.raw.hash})`;
62
-
63
- const issueLinks = commit.links && commit.links.length > 0
64
- ? ` (${commit.links.length === 1 ? 'Issue' : 'Issues'}: ${commit.links.map(link => `[#${link.id}](${repository.remote.repoUrl}/issues/${link.id})`).join(', ')})`
65
- : '';
66
- %>
67
- - <a id="commit-<%= commit.raw.shortHash %>"></a><%= commitLink %>: <%= commit.summary %> (by <%= authorText %>) <%= issueLinks %>
68
- <% if (commit.description) { %>
69
-
70
- <%= commit.description?.split('\n').map(line => `\t${line.trim()}`).join('\n') %>
71
- <% } %>
72
- <% }); %>
73
- <% }); %>
74
-
75
- <% // Scope'suz commit'leri gösterme
76
- unscopedCommits.forEach(commit => {
77
- const author = `[@${commit.author.name}](${commit.author.profileUrl})`;
78
- const mentions = commit.mentions
79
- ? commit.mentions
80
- .filter(mention => ['co-authored-by', 'helped-by'].includes(mention.type))
81
- .map(mention => `[@${mention.name}](${mention.profileUrl})`)
82
- .join(', ')
83
- : '';
84
- const authorText = mentions ? `${author} with ${mentions}` : author;
85
-
86
- const commitLink = `[#${commit.raw.shortHash}](${repository.remote.repoUrl}/commit/${commit.raw.hash})`;
87
-
88
- const issueLinks = commit.links && commit.links.length > 0
89
- ? ` (${commit.links.length === 1 ? 'Issue' : 'Issues'}: ${commit.links.map(link => `[#${link.id}](${repository.remote.repoUrl}/issues/${link.id})`).join(', ')})`
90
- : '';
91
- %>
92
- - <a id="commit-<%= commit.raw.shortHash %>"></a><%= commitLink %>: <%= commit.summary %> (by <%= authorText %>) <%= issueLinks %>
93
- <% if (commit.description) { %>
94
-
95
- <%= commit.description %>
96
- <% } %>
97
- <% }); %>
98
- <% }) %>
99
- <% } %>
100
-
101
- ## Useful Links
102
- - 📜 [Full Changelog](<%= repository.remote.repoUrl %>/blob/main/CHANGELOG.md)
103
-
104
-
105
-
106
- <% if (sections.contributors.length > 0) { %>
107
- ## Contributors:
108
- <% sections.contributors.forEach((contributor) => { %>
109
- - [<%= contributor.name %>](<%= contributor.profileUrl %>) <% if (contributor.groups.length > 0) { %>(<%= contributor.groups.map(group => group.title).join(', ') %>)<% } %>
110
- <% }) %>
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 - <%= latestTag?.date?.split("T")[0] %>
2
-
3
- ## Summary:
4
- <% sections.summary.commits.forEach(function(commit) { %>
5
- - <%= commit.title %>: <%= commit.count %> <%= commit.count === 1 ? 'commit' : 'commits' %>
6
- <% }) %>
7
- <% sections.summary.notes.forEach(function(note) { %>
8
- - <%= note.title %>: <%= note.count %> <%= note.count === 1 ? 'note' : 'notes' %>
9
- <% }) %>
10
- and <%= sections.summary.contributors.length %> <%= sections.summary.contributors.length === 1 ? '❤️ contributor' : '❤️ contributors' %>
11
-
12
-
13
- <% if (sections.notes.length > 0) { %>
14
- ## Notes
15
- <% sections.notes.forEach((note) => { %>
16
- ### <%= note.title %>
17
- <% note.items.forEach(item => { %>
18
- <%
19
- const commitLinks = `[#${item.commit.raw.shortHash}](#commit-${item.commit.raw.shortHash})`;
20
- %>
21
- - <%= item.note.content %> (<%= commitLinks %>)
22
- <% }) %>
23
- <% }) %>
24
- <% } %>
25
-
26
-
27
- <% if (sections.commits.length > 0) { %>
28
- ## Changes
29
- <% sections.commits.forEach((section) => { %>
30
- ### <%= section.title %>:
31
- <%
32
- section.items.forEach(commit => {
33
- const author = `[@${commit.author.name}](${commit.author.profileUrl})`;
34
- const mentions = commit.mentions
35
- ? commit.mentions
36
- .filter(mention => ['co-authored-by', 'helped-by'].includes(mention.type))
37
- .map(mention => `[@${mention.name}](${mention.profileUrl})`)
38
- .join(', ')
39
- : '';
40
- const authorText = mentions ? `${author} with ${mentions}` : author;
41
-
42
- const commitLink = `[#${commit.raw.shortHash}](${repository.remote.repoUrl}/commit/${commit.raw.hash})`;
43
-
44
- const issueLinks = commit.links && commit.links.length > 0
45
- ? ` (${commit.links.length === 1 ? 'Issue' : 'Issues'}: ${commit.links.map(link => `[#${link.id}](${repository.remote.repoUrl}/issues/${link.id})`).join(', ')})`
46
- : '';
47
-
48
- const scopeText = commit.scope ? `**${commit.scope}** ` : '';
49
- %>
50
- - <a id="commit-<%= commit.raw.shortHash %>"></a><%= scopeText %><%= commitLink %>: <%= commit.summary %> (by <%= authorText %>) <%= issueLinks %>
51
- <% if (commit.description) { %>
52
-
53
- <%= commit.description?.split('\n').map(line => `\t${line.trim()}`).join('\n') %>
54
- <% } %>
55
- <% }); %>
56
- <% }) %>
57
- <% } %>
58
-
59
- ## Useful Links
60
- - 📜 [Full Changelog](<%= repository.remote.repoUrl %>/blob/main/CHANGELOG.md)
61
-
62
-
63
- <% if (sections.contributors.length > 0) { %>
64
- ## Contributors:
65
- <% sections.contributors.forEach((contributor) => { %>
66
- - [<%= contributor.name %>](<%= contributor.profileUrl %>) <% if (contributor.groups.length > 0) { %>(<%= contributor.groups.map(group => group.title).join(', ') %>)<% } %>
67
- <% }) %>
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 DEFAULT_TEMPLATE_PATH = path.resolve(__dirname, 'changelog.ejs');
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
- async function renderTemplate(templatePath, environment = null, data) {
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,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"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=PackageJson.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PackageJson.js","sourceRoot":"","sources":["../../../src/types/PackageJson.ts"],"names":[],"mappings":""}