@hugojosefson/cli 0.11.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/README.md +1 -1
  2. package/esm/deno.js +16 -8
  3. package/esm/hj.js +19 -0
  4. package/esm/node_modules/@conventional-changelog/template/LICENSE.md +21 -0
  5. package/esm/node_modules/@conventional-changelog/template/README.md +66 -0
  6. package/esm/node_modules/@conventional-changelog/template/dist/elements.d.ts +78 -0
  7. package/esm/node_modules/@conventional-changelog/template/dist/elements.d.ts.map +1 -0
  8. package/esm/node_modules/@conventional-changelog/template/dist/elements.js +132 -0
  9. package/esm/node_modules/@conventional-changelog/template/dist/index.d.ts +6 -0
  10. package/esm/node_modules/@conventional-changelog/template/dist/index.d.ts.map +1 -0
  11. package/esm/node_modules/@conventional-changelog/template/dist/index.js +5 -0
  12. package/esm/node_modules/@conventional-changelog/template/dist/legacy.d.ts +20 -0
  13. package/esm/node_modules/@conventional-changelog/template/dist/legacy.d.ts.map +1 -0
  14. package/esm/node_modules/@conventional-changelog/template/dist/legacy.js +22 -0
  15. package/esm/node_modules/@conventional-changelog/template/dist/references.d.ts +43 -0
  16. package/esm/node_modules/@conventional-changelog/template/dist/references.d.ts.map +1 -0
  17. package/esm/node_modules/@conventional-changelog/template/dist/references.js +82 -0
  18. package/esm/node_modules/@conventional-changelog/template/dist/templates.d.ts +74 -0
  19. package/esm/node_modules/@conventional-changelog/template/dist/templates.d.ts.map +1 -0
  20. package/esm/node_modules/@conventional-changelog/template/dist/templates.js +125 -0
  21. package/esm/node_modules/@conventional-changelog/template/dist/types/commit.d.ts +37 -0
  22. package/esm/node_modules/@conventional-changelog/template/dist/types/commit.d.ts.map +1 -0
  23. package/esm/node_modules/@conventional-changelog/template/dist/types/commit.js +2 -0
  24. package/esm/node_modules/@conventional-changelog/template/dist/types/context.d.ts +113 -0
  25. package/esm/node_modules/@conventional-changelog/template/dist/types/context.d.ts.map +1 -0
  26. package/esm/node_modules/@conventional-changelog/template/dist/types/context.js +2 -0
  27. package/esm/node_modules/@conventional-changelog/template/dist/types/index.d.ts +4 -0
  28. package/esm/node_modules/@conventional-changelog/template/dist/types/index.d.ts.map +1 -0
  29. package/esm/node_modules/@conventional-changelog/template/dist/types/index.js +2 -0
  30. package/esm/node_modules/@conventional-changelog/template/dist/types/utils.d.ts +2 -0
  31. package/esm/node_modules/@conventional-changelog/template/dist/types/utils.d.ts.map +1 -0
  32. package/esm/node_modules/@conventional-changelog/template/dist/types/utils.js +2 -0
  33. package/esm/node_modules/@conventional-changelog/template/package.json +38 -0
  34. package/esm/node_modules/@simple-libs/stream-utils/LICENSE +21 -0
  35. package/esm/node_modules/@simple-libs/stream-utils/README.md +79 -0
  36. package/esm/node_modules/@simple-libs/stream-utils/dist/index.d.ts +51 -0
  37. package/esm/node_modules/@simple-libs/stream-utils/dist/index.d.ts.map +1 -0
  38. package/esm/node_modules/@simple-libs/stream-utils/dist/index.js +116 -0
  39. package/esm/node_modules/@simple-libs/stream-utils/package.json +38 -0
  40. package/esm/node_modules/argue-cli/LICENSE +21 -0
  41. package/esm/node_modules/argue-cli/README.md +239 -0
  42. package/esm/node_modules/argue-cli/dist/args.d.ts +30 -0
  43. package/esm/node_modules/argue-cli/dist/args.d.ts.map +1 -0
  44. package/esm/node_modules/argue-cli/dist/argv.d.ts +14 -0
  45. package/esm/node_modules/argue-cli/dist/argv.d.ts.map +1 -0
  46. package/esm/node_modules/argue-cli/dist/core.d.ts +24 -0
  47. package/esm/node_modules/argue-cli/dist/core.d.ts.map +1 -0
  48. package/esm/node_modules/argue-cli/dist/index.d.ts +6 -0
  49. package/esm/node_modules/argue-cli/dist/index.d.ts.map +1 -0
  50. package/esm/node_modules/argue-cli/dist/index.js +254 -0
  51. package/esm/node_modules/argue-cli/dist/index.js.map +1 -0
  52. package/esm/node_modules/argue-cli/dist/options.d.ts +9 -0
  53. package/esm/node_modules/argue-cli/dist/options.d.ts.map +1 -0
  54. package/esm/node_modules/argue-cli/dist/types.d.ts +16 -0
  55. package/esm/node_modules/argue-cli/dist/types.d.ts.map +1 -0
  56. package/esm/node_modules/argue-cli/dist/utils.d.ts +24 -0
  57. package/esm/node_modules/argue-cli/dist/utils.d.ts.map +1 -0
  58. package/esm/node_modules/argue-cli/package.json +34 -0
  59. package/esm/node_modules/conventional-changelog-core/node_modules/conventional-changelog-writer/LICENSE.md +21 -0
  60. package/esm/node_modules/conventional-changelog-core/node_modules/conventional-changelog-writer/README.md +369 -0
  61. package/esm/node_modules/conventional-changelog-core/node_modules/conventional-changelog-writer/package.json +53 -0
  62. package/esm/node_modules/conventional-changelog-core/node_modules/conventional-commits-filter/LICENSE +21 -0
  63. package/esm/node_modules/conventional-changelog-core/node_modules/conventional-commits-filter/README.md +184 -0
  64. package/esm/node_modules/conventional-changelog-core/node_modules/conventional-commits-filter/package.json +31 -0
  65. package/esm/node_modules/conventional-changelog-core/node_modules/conventional-commits-parser/LICENSE.md +21 -0
  66. package/esm/node_modules/conventional-changelog-core/node_modules/conventional-commits-parser/README.md +383 -0
  67. package/esm/node_modules/conventional-changelog-core/node_modules/conventional-commits-parser/package.json +47 -0
  68. package/esm/node_modules/conventional-changelog-writer/README.md +49 -342
  69. package/esm/node_modules/conventional-changelog-writer/dist/cli/index.d.ts +3 -0
  70. package/esm/node_modules/conventional-changelog-writer/dist/cli/index.d.ts.map +1 -0
  71. package/esm/node_modules/conventional-changelog-writer/dist/cli/index.js +68 -0
  72. package/esm/node_modules/conventional-changelog-writer/dist/cli/utils.d.ts +4 -0
  73. package/esm/node_modules/conventional-changelog-writer/dist/cli/utils.d.ts.map +1 -0
  74. package/esm/node_modules/conventional-changelog-writer/dist/cli/utils.js +39 -0
  75. package/esm/node_modules/conventional-changelog-writer/dist/commit.d.ts +10 -0
  76. package/esm/node_modules/conventional-changelog-writer/dist/commit.d.ts.map +1 -0
  77. package/esm/node_modules/conventional-changelog-writer/dist/commit.js +43 -0
  78. package/esm/node_modules/conventional-changelog-writer/dist/context.d.ts +27 -0
  79. package/esm/node_modules/conventional-changelog-writer/dist/context.d.ts.map +1 -0
  80. package/esm/node_modules/conventional-changelog-writer/dist/context.js +134 -0
  81. package/esm/node_modules/conventional-changelog-writer/dist/index.d.ts +7 -0
  82. package/esm/node_modules/conventional-changelog-writer/dist/index.d.ts.map +1 -0
  83. package/esm/node_modules/conventional-changelog-writer/dist/index.js +6 -0
  84. package/esm/node_modules/conventional-changelog-writer/dist/options.d.ts +25 -0
  85. package/esm/node_modules/conventional-changelog-writer/dist/options.d.ts.map +1 -0
  86. package/esm/node_modules/conventional-changelog-writer/dist/options.js +79 -0
  87. package/esm/node_modules/conventional-changelog-writer/dist/template.d.ts +10 -0
  88. package/esm/node_modules/conventional-changelog-writer/dist/template.d.ts.map +1 -0
  89. package/esm/node_modules/conventional-changelog-writer/dist/template.js +18 -0
  90. package/esm/node_modules/conventional-changelog-writer/dist/types/index.d.ts +8 -0
  91. package/esm/node_modules/conventional-changelog-writer/dist/types/index.d.ts.map +1 -0
  92. package/esm/node_modules/conventional-changelog-writer/dist/types/index.js +2 -0
  93. package/esm/node_modules/conventional-changelog-writer/dist/types/options.d.ts +122 -0
  94. package/esm/node_modules/conventional-changelog-writer/dist/types/options.d.ts.map +1 -0
  95. package/esm/node_modules/conventional-changelog-writer/dist/types/options.js +2 -0
  96. package/esm/node_modules/conventional-changelog-writer/dist/types/utils.d.ts +9 -0
  97. package/esm/node_modules/conventional-changelog-writer/dist/types/utils.d.ts.map +1 -0
  98. package/esm/node_modules/conventional-changelog-writer/dist/types/utils.js +2 -0
  99. package/esm/node_modules/conventional-changelog-writer/dist/utils.d.ts +20 -0
  100. package/esm/node_modules/conventional-changelog-writer/dist/utils.d.ts.map +1 -0
  101. package/esm/node_modules/conventional-changelog-writer/dist/utils.js +70 -0
  102. package/esm/node_modules/conventional-changelog-writer/dist/writers.d.ts +29 -0
  103. package/esm/node_modules/conventional-changelog-writer/dist/writers.d.ts.map +1 -0
  104. package/esm/node_modules/conventional-changelog-writer/dist/writers.js +94 -0
  105. package/esm/node_modules/conventional-changelog-writer/package.json +24 -26
  106. package/esm/node_modules/conventional-commits-filter/README.md +51 -170
  107. package/esm/node_modules/conventional-commits-filter/dist/RevertedCommitsFilter.d.ts +17 -0
  108. package/esm/node_modules/conventional-commits-filter/dist/RevertedCommitsFilter.d.ts.map +1 -0
  109. package/esm/node_modules/conventional-commits-filter/dist/RevertedCommitsFilter.js +46 -0
  110. package/esm/node_modules/conventional-commits-filter/dist/filters.d.ts +19 -0
  111. package/esm/node_modules/conventional-commits-filter/dist/filters.d.ts.map +1 -0
  112. package/esm/node_modules/conventional-commits-filter/dist/filters.js +34 -0
  113. package/esm/node_modules/conventional-commits-filter/dist/index.d.ts +4 -0
  114. package/esm/node_modules/conventional-commits-filter/dist/index.d.ts.map +1 -0
  115. package/esm/node_modules/conventional-commits-filter/dist/index.js +3 -0
  116. package/esm/node_modules/conventional-commits-filter/dist/types.d.ts +6 -0
  117. package/esm/node_modules/conventional-commits-filter/dist/types.d.ts.map +1 -0
  118. package/esm/node_modules/conventional-commits-filter/dist/types.js +2 -0
  119. package/esm/node_modules/conventional-commits-filter/dist/utils.d.ts +16 -0
  120. package/esm/node_modules/conventional-commits-filter/dist/utils.d.ts.map +1 -0
  121. package/esm/node_modules/conventional-commits-filter/dist/utils.js +43 -0
  122. package/esm/node_modules/conventional-commits-filter/package.json +22 -16
  123. package/esm/node_modules/conventional-commits-parser/README.md +49 -353
  124. package/esm/node_modules/conventional-commits-parser/dist/CommitParser.d.ts +40 -0
  125. package/esm/node_modules/conventional-commits-parser/dist/CommitParser.d.ts.map +1 -0
  126. package/esm/node_modules/conventional-commits-parser/dist/CommitParser.js +319 -0
  127. package/esm/node_modules/conventional-commits-parser/dist/cli/index.d.ts +3 -0
  128. package/esm/node_modules/conventional-commits-parser/dist/cli/index.d.ts.map +1 -0
  129. package/esm/node_modules/conventional-commits-parser/dist/cli/index.js +67 -0
  130. package/esm/node_modules/conventional-commits-parser/dist/cli/options.d.ts +3 -0
  131. package/esm/node_modules/conventional-commits-parser/dist/cli/options.d.ts.map +1 -0
  132. package/esm/node_modules/conventional-commits-parser/dist/cli/options.js +40 -0
  133. package/esm/node_modules/conventional-commits-parser/dist/cli/utils.d.ts +5 -0
  134. package/esm/node_modules/conventional-commits-parser/dist/cli/utils.d.ts.map +1 -0
  135. package/esm/node_modules/conventional-commits-parser/dist/cli/utils.js +49 -0
  136. package/esm/node_modules/conventional-commits-parser/dist/index.d.ts +4 -0
  137. package/esm/node_modules/conventional-commits-parser/dist/index.d.ts.map +1 -0
  138. package/esm/node_modules/conventional-commits-parser/dist/index.js +3 -0
  139. package/esm/node_modules/conventional-commits-parser/dist/options.d.ts +3 -0
  140. package/esm/node_modules/conventional-commits-parser/dist/options.d.ts.map +1 -0
  141. package/esm/node_modules/conventional-commits-parser/dist/options.js +27 -0
  142. package/esm/node_modules/conventional-commits-parser/dist/regex.d.ts +8 -0
  143. package/esm/node_modules/conventional-commits-parser/dist/regex.d.ts.map +1 -0
  144. package/esm/node_modules/conventional-commits-parser/dist/regex.js +63 -0
  145. package/esm/node_modules/conventional-commits-parser/dist/stream.d.ts +14 -0
  146. package/esm/node_modules/conventional-commits-parser/dist/stream.d.ts.map +1 -0
  147. package/esm/node_modules/conventional-commits-parser/dist/stream.js +38 -0
  148. package/esm/node_modules/conventional-commits-parser/dist/types.d.ts +100 -0
  149. package/esm/node_modules/conventional-commits-parser/dist/types.d.ts.map +1 -0
  150. package/esm/node_modules/conventional-commits-parser/dist/types.js +2 -0
  151. package/esm/node_modules/conventional-commits-parser/dist/utils.d.ts +41 -0
  152. package/esm/node_modules/conventional-commits-parser/dist/utils.d.ts.map +1 -0
  153. package/esm/node_modules/conventional-commits-parser/dist/utils.js +75 -0
  154. package/esm/node_modules/conventional-commits-parser/package.json +22 -23
  155. package/esm/src/cli/command-help.js +15 -0
  156. package/esm/src/cli/repair-configuration-description.js +98 -0
  157. package/esm/src/cli/run-changelog.js +51 -0
  158. package/esm/src/cli/run-cli.js +8 -0
  159. package/esm/src/features/built-in-feature-registry.js +2 -0
  160. package/esm/src/features/changelog-feature.js +155 -0
  161. package/esm/src/features/github-ci-artifacts.js +17 -3
  162. package/esm/src/features/github-ci-runtime-matrix.js +50 -0
  163. package/esm/src/features/github-release-publish-artifacts.js +5 -4
  164. package/esm/src/features/github-release-publish-feature.js +7 -2
  165. package/esm/src/features/github-workflow-cache.js +18 -0
  166. package/esm/src/features/npm-readme-badge.js +163 -0
  167. package/esm/src/features/readme-contribution-plans.js +18 -1
  168. package/esm/src/features/workflow-deno.js +1 -1
  169. package/esm/src/package/npm-name.js +5 -0
  170. package/esm/src/readme/contribution-blocks.js +33 -6
  171. package/esm/src/release/changelog-markdown.js +41 -0
  172. package/esm/src/release/changelog.js +155 -7
  173. package/esm/src/release/format-changelog.js +15 -0
  174. package/esm/src/release/migrate-changelog.js +92 -0
  175. package/esm/src/release/publish-github.js +7 -3
  176. package/esm/src/release/publish-npm.js +2 -2
  177. package/esm/src/release/publish-tag-prepare.js +63 -78
  178. package/esm/src/release/release-history.js +53 -0
  179. package/npm-dependencies.lock.json +115 -48
  180. package/package.json +7 -5
  181. package/esm/node_modules/conventional-commits-parser/node_modules/meow/build/dependencies.js +0 -11036
  182. package/esm/node_modules/conventional-commits-parser/node_modules/meow/build/index.d.ts +0 -1416
  183. package/esm/node_modules/conventional-commits-parser/node_modules/meow/build/index.js +0 -100
  184. package/esm/node_modules/conventional-commits-parser/node_modules/meow/build/licenses.md +0 -1767
  185. package/esm/node_modules/conventional-commits-parser/node_modules/meow/build/options.js +0 -92
  186. package/esm/node_modules/conventional-commits-parser/node_modules/meow/build/parser.js +0 -84
  187. package/esm/node_modules/conventional-commits-parser/node_modules/meow/build/utils.js +0 -7
  188. package/esm/node_modules/conventional-commits-parser/node_modules/meow/build/validate.js +0 -122
  189. package/esm/node_modules/conventional-commits-parser/node_modules/meow/license +0 -9
  190. package/esm/node_modules/conventional-commits-parser/node_modules/meow/package.json +0 -107
  191. package/esm/node_modules/conventional-commits-parser/node_modules/meow/readme.md +0 -314
  192. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core/node_modules/conventional-changelog-writer}/cli.mjs +0 -0
  193. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core/node_modules/conventional-changelog-writer}/index.js +0 -0
  194. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core/node_modules/conventional-changelog-writer}/lib/util.js +0 -0
  195. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core/node_modules/conventional-changelog-writer}/templates/commit.hbs +0 -0
  196. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core/node_modules/conventional-changelog-writer}/templates/footer.hbs +0 -0
  197. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core/node_modules/conventional-changelog-writer}/templates/header.hbs +0 -0
  198. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core/node_modules/conventional-changelog-writer}/templates/template.hbs +0 -0
  199. /package/esm/node_modules/{conventional-commits-filter → conventional-changelog-core/node_modules/conventional-commits-filter}/index.js +0 -0
  200. /package/esm/node_modules/{conventional-commits-parser → conventional-changelog-core/node_modules/conventional-commits-parser}/cli.mjs +0 -0
  201. /package/esm/node_modules/{conventional-commits-parser → conventional-changelog-core/node_modules/conventional-commits-parser}/index.js +0 -0
  202. /package/esm/node_modules/{conventional-commits-parser → conventional-changelog-core/node_modules/conventional-commits-parser}/lib/parser.js +0 -0
  203. /package/esm/node_modules/{conventional-commits-parser → conventional-changelog-core/node_modules/conventional-commits-parser}/lib/regex.js +0 -0
  204. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core}/node_modules/meow/build/dependencies.js +0 -0
  205. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core}/node_modules/meow/build/index.d.ts +0 -0
  206. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core}/node_modules/meow/build/index.js +0 -0
  207. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core}/node_modules/meow/build/licenses.md +0 -0
  208. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core}/node_modules/meow/build/options.js +0 -0
  209. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core}/node_modules/meow/build/parser.js +0 -0
  210. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core}/node_modules/meow/build/utils.js +0 -0
  211. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core}/node_modules/meow/build/validate.js +0 -0
  212. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core}/node_modules/meow/license +0 -0
  213. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core}/node_modules/meow/package.json +0 -0
  214. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core}/node_modules/meow/readme.md +0 -0
@@ -0,0 +1,369 @@
1
+ # [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage Status][coverage-image]][coverage-url]
2
+
3
+ > Write logs based on conventional commits and templates
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ $ npm install --save conventional-changelog-writer
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```js
14
+ var conventionalChangelogWriter = require('conventional-changelog-writer');
15
+
16
+ conventionalChangelogWriter(context, options);
17
+ ```
18
+
19
+ It returns a transform stream.
20
+
21
+ It expects an object mode upstream that looks something like this:
22
+
23
+ ```js
24
+ { hash: '9b1aff905b638aa274a5fc8f88662df446d374bd',
25
+ header: 'feat(scope): broadcast $destroy event on scope destruction',
26
+ type: 'feat',
27
+ scope: 'scope',
28
+ subject: 'broadcast $destroy event on scope destruction',
29
+ body: null,
30
+ footer: 'Closes #1',
31
+ notes: [],
32
+ references: [ { action: 'Closes', owner: null, repository: null, issue: '1', raw: '#1' } ] }
33
+ { hash: '13f31602f396bc269076ab4d389cfd8ca94b20ba',
34
+ header: 'feat(ng-list): Allow custom separator',
35
+ type: 'feat',
36
+ scope: 'ng-list',
37
+ subject: 'Allow custom separator',
38
+ body: 'bla bla bla',
39
+ footer: 'BREAKING CHANGE: some breaking change',
40
+ notes: [ { title: 'BREAKING CHANGE', text: 'some breaking change' } ],
41
+ references: [] }
42
+ ```
43
+
44
+ Each chunk should be a commit. Json object is also **valid**. Parts of the objects will be formatted and combined into a log based on the handlebars context, templates and options.
45
+
46
+ The downstream might look something like this:
47
+
48
+ ```js
49
+ ## 0.0.1 "this is a title" (2015-05-29)
50
+
51
+
52
+ ### Features
53
+
54
+ * **ng-list:** Allow custom separator ([13f3160](https://github.com/a/b/commits/13f3160))
55
+ * **scope:** broadcast $destroy event on scope destruction ([9b1aff9](https://github.com/a/b/commits/9b1aff9)), closes [#1](https://github.com/a/b/issues/1)
56
+
57
+
58
+ ### BREAKING CHANGES
59
+
60
+ * some breaking change
61
+ ```
62
+
63
+
64
+ ## API
65
+
66
+ ### conventionalChangelogWriter([context, [options]])
67
+
68
+ Returns a transform stream.
69
+
70
+ ### conventionalChangelogWriter.parseArray(commits, [context, [options]])
71
+
72
+ Rather than returning a transform stream for parsing commits,
73
+ parses the array of commits provided generating a CHANGELOG entry.
74
+
75
+ #### context
76
+
77
+ Variables that will be interpolated to the template. This object contains, but not limits to the following fields.
78
+
79
+ ##### version
80
+
81
+ Type: `string`
82
+
83
+ Version number of the up-coming release. If `version` is found in the last commit before generating logs, it will be overwritten.
84
+
85
+ ##### title
86
+
87
+ Type: `string`
88
+
89
+ ##### isPatch
90
+
91
+ Type: `boolean` Default: `semver.patch(context.version) !== 0`
92
+
93
+ By default, this value is true if `version`'s patch is `0`.
94
+
95
+ ##### host
96
+
97
+ Type: `string`
98
+
99
+ The hosting website. Eg: `'https://github.com'` or `'https://bitbucket.org'`
100
+
101
+ ##### owner
102
+
103
+ Type: `string`
104
+
105
+ The owner of the repository. Eg: `'stevemao'`.
106
+
107
+ ##### repository
108
+
109
+ Type: `string`
110
+
111
+ The repository name on `host`. Eg: `'conventional-changelog-writer'`.
112
+
113
+ ##### repoUrl
114
+
115
+ Type: `string`
116
+
117
+ The whole repository url. Eg: `'https://github.com/conventional-changelog/conventional-changelog-writer'`.
118
+ The should be used as a fallback when `context.repository` doesn't exist.
119
+
120
+ ##### linkReferences
121
+
122
+ Type: `boolean` Default: `true` if (`context.repository` or `context.repoUrl`), `context.commit` and `context.issue` are truthy
123
+
124
+ Should all references be linked?
125
+
126
+ ##### commit
127
+
128
+ Type: `string` Default: `'commits'`
129
+
130
+ Commit keyword in the url if `context.linkReferences === true`.
131
+
132
+ ##### issue
133
+
134
+ Type: `string` Default: `'issues'`
135
+
136
+ Issue or pull request keyword in the url if `context.linkReferences === true`.
137
+
138
+ ##### date
139
+
140
+ Type: `string` Default: formatted (`'yyyy-mm-dd'`) today's date in UTC timezone
141
+
142
+ If `version` is found in the last commit, `committerDate` will overwrite this.
143
+
144
+ #### options
145
+
146
+ Type: `object`
147
+
148
+ ##### transform
149
+
150
+ Type: `object` or `function` Default: get the first 7 digits of hash, and `committerDate` will be formatted as `'yyyy-mm-dd'`.
151
+
152
+ Replace with new values in each commit.
153
+
154
+ If this is an object, the keys are paths to a nested object property. the values can be a string (static) and a function (dynamic) with the old value and path passed as arguments. This value is merged with your own transform object.
155
+
156
+ If this is a function, the commit chunk will be passed as the argument and the returned value would be the new commit object. This is a handy function if you can't provide a transform stream as an upstream of this one. If returns a falsy value this commit is ignored.
157
+
158
+ a `raw` object that is originally poured form upstream is attached to `commit`.
159
+
160
+ ##### groupBy
161
+
162
+ Type: `string` Default: `'type'`
163
+
164
+ How to group the commits. EG: based on the same type. If this value is falsy, commits are not grouped.
165
+
166
+ ##### commitGroupsSort
167
+
168
+ Type: `function`, `string` or `array`
169
+
170
+ A compare function used to sort commit groups. If it's a string or array, it sorts on the property(ies) by `localeCompare`. Will not sort if this is a falsy value.
171
+
172
+ ##### commitsSort
173
+
174
+ Type: `function`, `string` or `array` Default: `'header'`
175
+
176
+ A compare function used to sort commits. If it's a string or array, it sorts on the property(ies) by `localeCompare`. Will not sort if this is a falsy value.
177
+
178
+ ##### noteGroupsSort
179
+
180
+ Type: `function`, `string` or `array` Default: `'title'`
181
+
182
+ A compare function used to sort note groups. If it's a string or array, it sorts on the property(ies) by `localeCompare`. Will not sort if this is a falsy value.
183
+
184
+ ##### notesSort
185
+
186
+ Type: `function`, `string` or `array` Default: `'text'`
187
+
188
+ A compare function used to sort note groups. If it's a string or array, it sorts on the property(ies) by `localeCompare`. Will not sort if this is a falsy value.
189
+
190
+ ##### generateOn
191
+
192
+ Type: `function`, `string` or `any` Default: if `commit.version` is a valid semver.
193
+
194
+ When the upstream finishes pouring the commits it will generate a block of logs if `doFlush` is `true`. However, you can generate more than one block based on this criteria (usually a version) even if there are still commits from the upstream.
195
+
196
+ ###### generateOn(commit, commits, context, options)
197
+
198
+ ####### commit
199
+
200
+ Current commit.
201
+
202
+ ####### commits
203
+
204
+ Current collected commits.
205
+
206
+ ####### context
207
+
208
+ The generated context based on original input `context` and `options`.
209
+
210
+ ####### options
211
+
212
+ Normalized options.
213
+
214
+ **NOTE**: It checks on the transformed commit chunk instead of the original one (you can check on the original by access the `raw` object on the `commit`). However, if the transformed commit is ignored it falls back to the original commit.
215
+
216
+ If this value is a `string`, it checks the existence of the field. Set to other type to disable it.
217
+
218
+ ##### finalizeContext
219
+
220
+ Type: `function` Default: pass through
221
+
222
+ Last chance to modify your context before generating a changelog.
223
+
224
+ ###### finalizeContext(context, options, commits, keyCommit)
225
+
226
+ ####### context
227
+
228
+ The generated context based on original input `context` and `options`.
229
+
230
+ ####### options
231
+
232
+ Normalized options.
233
+
234
+ ####### commits
235
+
236
+ Filtered commits from your git metadata.
237
+
238
+ ####### keyCommit
239
+
240
+ The commit that triggers to generate the log.
241
+
242
+ ##### debug
243
+
244
+ Type: `function` Default: `function() {}`
245
+
246
+ A function to get debug information.
247
+
248
+ ##### reverse
249
+
250
+ Type: `boolean` Default: `false`
251
+
252
+ The normal order means reverse chronological order. `reverse` order means chronological order. Are the commits from upstream in the reverse order? You should only worry about this when generating more than one blocks of logs based on `generateOn`. If you find the last commit is in the wrong block inverse this value.
253
+
254
+ ##### includeDetails
255
+
256
+ Type: `boolean` Default: `false`
257
+
258
+ If this value is `true`, instead of emitting strings of changelog, it emits objects containing the details the block.
259
+
260
+ *NOTE:* The downstream must be in object mode if this is `true`.
261
+ *NOTE:* This is only supported when using streaming mode.
262
+
263
+ ##### ignoreReverted
264
+
265
+ Type: `boolean` Default: `true`
266
+
267
+ If `true`, reverted commits will be ignored.
268
+
269
+ ##### doFlush
270
+
271
+ Type: `boolean` Default: `true`
272
+
273
+ If `true`, the stream will flush out the last bit of commits (could be empty) to changelog.
274
+
275
+ *NOTE:* This is only supported when using streaming mode.
276
+
277
+ ##### mainTemplate
278
+
279
+ Type: `string` Default: [template.hbs](templates/template.hbs)
280
+
281
+ The main handlebars template.
282
+
283
+ ##### headerPartial
284
+
285
+ Type: `string` Default: [header.hbs](templates/header.hbs)
286
+
287
+ ##### commitPartial
288
+
289
+ Type: `string` Default: [commit.hbs](templates/commit.hbs)
290
+
291
+ ##### footerPartial
292
+
293
+ Type: `string` Default: [footer.hbs](templates/footer.hbs)
294
+
295
+ ##### partials
296
+
297
+ Type: `object`
298
+
299
+ Partials that used in the main template, if any. The key should be the partial name and the value should be handlebars template strings. If you are using handlebars template files, read files by yourself.
300
+
301
+
302
+ ## Customization Guide
303
+
304
+ It is possible to customize this the changelog to suit your needs. Templates are written in [handlebars](http://handlebarsjs.com). You can customize all partials or the whole template. Template variables are from either `upstream` or `context`. The following are a suggested way of defining variables.
305
+
306
+ ### upstream
307
+
308
+ Variables in upstream are commit specific and should be used per commit. Eg: *commit date* and *commit username*. You can think of them as "local" or "isolate" variables. A "raw" commit message (original commit poured from upstream) is attached to `commit`. `transform` can be used to modify a commit.
309
+
310
+ ### context
311
+
312
+ context should be module specific and can be used across the whole log. Thus these variables should not be related to any single commit and should be generic information of the module or all commits. Eg: *repository url* and *author names*, etc. You can think of them as "global" or "root" variables.
313
+
314
+ Basically you can make your own templates and define all your template context. Extra context are based on commits from upstream and `options`. For more details, please checkout [handlebars](http://handlebarsjs.com) and the source code of this module. `finalizeContext` can be used at last to modify context before generating a changelog.
315
+
316
+
317
+ ## CLI
318
+
319
+ ```sh
320
+ $ npm install --global conventional-changelog-writer
321
+ $ conventional-changelog-writer --help # for more details
322
+ ```
323
+
324
+ It works with [Line Delimited JSON](http://en.wikipedia.org/wiki/Line_Delimited_JSON).
325
+
326
+ If you have commits.ldjson
327
+
328
+ ```js
329
+ {"hash":"9b1aff905b638aa274a5fc8f88662df446d374bd","header":"feat(ngMessages): provide support for dynamic message resolution","type":"feat","scope":"ngMessages","subject":"provide support for dynamic message resolution","body":"Prior to this fix it was impossible to apply a binding to a the ngMessage directive to represent the name of the error.","footer":"BREAKING CHANGE: The `ngMessagesInclude` attribute is now its own directive and that must be placed as a **child** element within the element with the ngMessages directive.\nCloses #10036\nCloses #9338","notes":[{"title":"BREAKING CHANGE","text":"The `ngMessagesInclude` attribute is now its own directive and that must be placed as a **child** element within the element with the ngMessages directive."}],"references":[{"action":"Closes","owner",null,"repository":null,"issue":"10036","raw":"#10036"},{"action":"Closes","owner":null,"repository":null,"issue":"9338","raw":"#9338"}]}
330
+ ```
331
+
332
+ And you run
333
+
334
+ ```sh
335
+ $ conventional-changelog-writer commits.ldjson -o options.js
336
+ ```
337
+
338
+ The output might look something like this
339
+
340
+ ```md
341
+ # 1.0.0 (2015-04-09)
342
+
343
+
344
+ ### Features
345
+
346
+ * **ngMessages:** provide support for dynamic message resolution 9b1aff9, closes #10036 #9338
347
+
348
+
349
+ ### BREAKING CHANGES
350
+
351
+ * The `ngMessagesInclude` attribute is now its own directive and that must be placed as a **child** element within the element with the ngMessages directive.
352
+ ```
353
+
354
+ It is printed to stdout.
355
+
356
+
357
+ ## License
358
+
359
+ MIT © [Steve Mao](https://github.com/stevemao)
360
+
361
+
362
+ [npm-image]: https://badge.fury.io/js/conventional-changelog-writer.svg
363
+ [npm-url]: https://npmjs.org/package/conventional-changelog-writer
364
+ [travis-image]: https://travis-ci.org/conventional-changelog/conventional-changelog-writer.svg?branch=master
365
+ [travis-url]: https://travis-ci.org/conventional-changelog/conventional-changelog-writer
366
+ [daviddm-image]: https://david-dm.org/conventional-changelog/conventional-changelog-writer.svg?theme=shields.io
367
+ [daviddm-url]: https://david-dm.org/conventional-changelog/conventional-changelog-writer
368
+ [coverage-image]: https://coveralls.io/repos/github/conventional-changelog/conventional-changelog/badge.svg?branch=master
369
+ [coverage-url]: https://coveralls.io/github/conventional-changelog/conventional-changelog?branch=master
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "conventional-changelog-writer",
3
+ "version": "7.0.1",
4
+ "description": "Write logs based on conventional commits and templates",
5
+ "bugs": {
6
+ "url": "https://github.com/conventional-changelog/conventional-changelog/issues"
7
+ },
8
+ "homepage": "https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-writer#readme",
9
+ "author": {
10
+ "name": "Steve Mao",
11
+ "email": "maochenyan@gmail.com",
12
+ "url": "https://github.com/stevemao"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/conventional-changelog/conventional-changelog.git"
17
+ },
18
+ "license": "MIT",
19
+ "engines": {
20
+ "node": ">=16"
21
+ },
22
+ "files": [
23
+ "index.js",
24
+ "cli.mjs",
25
+ "lib",
26
+ "templates"
27
+ ],
28
+ "keywords": [
29
+ "conventional-changelog-writer",
30
+ "changelog",
31
+ "conventional",
32
+ "commits",
33
+ "templates",
34
+ "writer",
35
+ "writing",
36
+ "logs"
37
+ ],
38
+ "dependencies": {
39
+ "handlebars": "^4.7.7",
40
+ "json-stringify-safe": "^5.0.1",
41
+ "meow": "^12.0.1",
42
+ "semver": "^7.5.2",
43
+ "split2": "^4.0.0",
44
+ "conventional-commits-filter": "^4.0.0"
45
+ },
46
+ "bin": {
47
+ "conventional-changelog-writer": "cli.mjs"
48
+ },
49
+ "devDependencies": {
50
+ "dedent": "^1.0.0",
51
+ "forceable-tty": "^0.1.0"
52
+ }
53
+ }
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Steve Mao <maochenyan@gmail.com> (https://github.com/stevemao)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,184 @@
1
+ # conventional-commits-filter [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage percentage][coverage-image]][coverage-url]
2
+ > Filter out reverted commits parsed by conventional-commits-parser
3
+
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ $ npm install --save conventional-commits-filter
9
+ ```
10
+
11
+
12
+ ## Usage
13
+
14
+ ```js
15
+ var conventionalCommitsFilter = require('conventional-commits-filter');
16
+
17
+ var commits = [{
18
+ type: 'revert',
19
+ scope: null,
20
+ subject: 'feat(): amazing new module',
21
+ header: 'revert: feat(): amazing new module\n',
22
+ body: 'This reverts commit 56185b7356766d2b30cfa2406b257080272e0b7a.\n',
23
+ footer: null,
24
+ notes: [],
25
+ references: [],
26
+ revert: {
27
+ header: 'feat(): amazing new module',
28
+ hash: '56185b7356766d2b30cfa2406b257080272e0b7a',
29
+ body: null
30
+ },
31
+ hash: '789d898b5f8422d7f65cc25135af2c1a95a125ac\n',
32
+ raw: {
33
+ type: 'revert',
34
+ scope: null,
35
+ subject: 'feat(): amazing new module',
36
+ header: 'revert: feat(): amazing new module\n',
37
+ body: 'This reverts commit 56185b7356766d2b30cfa2406b257080272e0b7a.\n',
38
+ footer: null,
39
+ notes: [],
40
+ references: [],
41
+ revert: {
42
+ header: 'feat(): amazing new module',
43
+ hash: '56185b7356766d2b30cfa2406b257080272e0b7a',
44
+ body: null
45
+ },
46
+ hash: '789d898b5f8422d7f65cc25135af2c1a95a125ac\n'
47
+ }
48
+ }, {
49
+ type: 'Features',
50
+ scope: null,
51
+ subject: 'wow',
52
+ header: 'amazing new module\n',
53
+ body: null,
54
+ footer: 'BREAKING CHANGE: Not backward compatible.\n',
55
+ notes: [],
56
+ references: [],
57
+ revert: null,
58
+ hash: '56185b',
59
+ raw: {
60
+ type: 'feat',
61
+ scope: null,
62
+ subject: 'amazing new module',
63
+ header: 'feat(): amazing new module\n',
64
+ body: null,
65
+ footer: 'BREAKING CHANGE: Not backward compatible.\n',
66
+ notes: [],
67
+ references: [],
68
+ revert: null,
69
+ hash: '56185b7356766d2b30cfa2406b257080272e0b7a\n'
70
+ }
71
+ }, {
72
+ type: 'What',
73
+ scope: null,
74
+ subject: 'new feature',
75
+ header: 'feat(): new feature\n',
76
+ body: null,
77
+ footer: null,
78
+ notes: [],
79
+ references: [],
80
+ revert: null,
81
+ hash: '815a3f0',
82
+ raw: {
83
+ type: 'feat',
84
+ scope: null,
85
+ subject: 'new feature',
86
+ header: 'feat(): new feature\n',
87
+ body: null,
88
+ footer: null,
89
+ notes: [],
90
+ references: [],
91
+ revert: null,
92
+ hash: '815a3f0717bf1dfce007bd076420c609504edcf3\n'
93
+ }
94
+ }, {
95
+ type: 'Chores',
96
+ scope: null,
97
+ subject: 'first commit',
98
+ header: 'chore: first commit\n',
99
+ body: null,
100
+ footer: null,
101
+ notes: [],
102
+ references: [],
103
+ revert: null,
104
+ hash: '74a3e4d6d25',
105
+ raw: {
106
+ type: 'chore',
107
+ scope: null,
108
+ subject: 'first commit',
109
+ header: 'chore: first commit\n',
110
+ body: null,
111
+ footer: null,
112
+ notes: [],
113
+ references: [],
114
+ revert: null,
115
+ hash: '74a3e4d6d25dee2c0d6483a0a3887417728cbe0a\n'
116
+ }
117
+ }];
118
+
119
+ commits = conventionalCommitsFilter(commits);
120
+ console.log(commits);
121
+ /*=>
122
+ [{
123
+ type: 'What',
124
+ scope: null,
125
+ subject: 'new feature',
126
+ header: 'feat(): new feature\n',
127
+ body: null,
128
+ footer: null,
129
+ notes: [],
130
+ references: [],
131
+ revert: null,
132
+ hash: '815a3f0',
133
+ raw: {
134
+ type: 'feat',
135
+ scope: null,
136
+ subject: 'new feature',
137
+ header: 'feat(): new feature\n',
138
+ body: null,
139
+ footer: null,
140
+ notes: [],
141
+ references: [],
142
+ revert: null,
143
+ hash: '815a3f0717bf1dfce007bd076420c609504edcf3\n'
144
+ }
145
+ }, {
146
+ type: 'Chores',
147
+ scope: null,
148
+ subject: 'first commit',
149
+ header: 'chore: first commit\n',
150
+ body: null,
151
+ footer: null,
152
+ notes: [],
153
+ references: [],
154
+ revert: null,
155
+ hash: '74a3e4d6d25',
156
+ raw: {
157
+ type: 'chore',
158
+ scope: null,
159
+ subject: 'first commit',
160
+ header: 'chore: first commit\n',
161
+ body: null,
162
+ footer: null,
163
+ notes: [],
164
+ references: [],
165
+ revert: null,
166
+ hash: '74a3e4d6d25dee2c0d6483a0a3887417728cbe0a\n'
167
+ }
168
+ }]
169
+ */
170
+ ```
171
+
172
+ ## License
173
+
174
+ MIT © [Steve Mao]()
175
+
176
+
177
+ [npm-image]: https://badge.fury.io/js/conventional-commits-filter.svg
178
+ [npm-url]: https://npmjs.org/package/conventional-commits-filter
179
+ [travis-image]: https://travis-ci.org/stevemao/conventional-commits-filter.svg?branch=master
180
+ [travis-url]: https://travis-ci.org/stevemao/conventional-commits-filter
181
+ [daviddm-image]: https://david-dm.org/stevemao/conventional-commits-filter.svg
182
+ [daviddm-url]: https://david-dm.org/stevemao/conventional-commits-filter
183
+ [coverage-image]: https://coveralls.io/repos/github/conventional-changelog/conventional-changelog/badge.svg?branch=master
184
+ [coverage-url]: https://coveralls.io/github/conventional-changelog/conventional-changelog?branch=master
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "conventional-commits-filter",
3
+ "version": "4.0.0",
4
+ "description": "Filter out reverted commits parsed by conventional-commits-parser",
5
+ "bugs": {
6
+ "url": "https://github.com/conventional-changelog/conventional-changelog/issues"
7
+ },
8
+ "homepage": "https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-commits-filter#readme",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/conventional-changelog/conventional-changelog.git"
12
+ },
13
+ "author": {
14
+ "name": "Steve Mao",
15
+ "email": "maochenyan@gmail.com",
16
+ "url": "https://github.com/stevemao"
17
+ },
18
+ "engines": {
19
+ "node": ">=16"
20
+ },
21
+ "files": [
22
+ "index.js"
23
+ ],
24
+ "keywords": [
25
+ "filter",
26
+ "conventional",
27
+ "changelog",
28
+ "commits"
29
+ ],
30
+ "license": "MIT"
31
+ }
@@ -0,0 +1,21 @@
1
+ ### MIT License
2
+
3
+ Copyright © [conventional-changelog team](https://github.com/conventional-changelog)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9
+ of the Software, and to permit persons to whom the Software is furnished to do
10
+ so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.