@hugojosefson/cli 0.11.0 → 0.12.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 (207) hide show
  1. package/esm/deno.js +16 -8
  2. package/esm/node_modules/@conventional-changelog/template/LICENSE.md +21 -0
  3. package/esm/node_modules/@conventional-changelog/template/README.md +66 -0
  4. package/esm/node_modules/@conventional-changelog/template/dist/elements.d.ts +78 -0
  5. package/esm/node_modules/@conventional-changelog/template/dist/elements.d.ts.map +1 -0
  6. package/esm/node_modules/@conventional-changelog/template/dist/elements.js +132 -0
  7. package/esm/node_modules/@conventional-changelog/template/dist/index.d.ts +6 -0
  8. package/esm/node_modules/@conventional-changelog/template/dist/index.d.ts.map +1 -0
  9. package/esm/node_modules/@conventional-changelog/template/dist/index.js +5 -0
  10. package/esm/node_modules/@conventional-changelog/template/dist/legacy.d.ts +20 -0
  11. package/esm/node_modules/@conventional-changelog/template/dist/legacy.d.ts.map +1 -0
  12. package/esm/node_modules/@conventional-changelog/template/dist/legacy.js +22 -0
  13. package/esm/node_modules/@conventional-changelog/template/dist/references.d.ts +43 -0
  14. package/esm/node_modules/@conventional-changelog/template/dist/references.d.ts.map +1 -0
  15. package/esm/node_modules/@conventional-changelog/template/dist/references.js +82 -0
  16. package/esm/node_modules/@conventional-changelog/template/dist/templates.d.ts +74 -0
  17. package/esm/node_modules/@conventional-changelog/template/dist/templates.d.ts.map +1 -0
  18. package/esm/node_modules/@conventional-changelog/template/dist/templates.js +125 -0
  19. package/esm/node_modules/@conventional-changelog/template/dist/types/commit.d.ts +37 -0
  20. package/esm/node_modules/@conventional-changelog/template/dist/types/commit.d.ts.map +1 -0
  21. package/esm/node_modules/@conventional-changelog/template/dist/types/commit.js +2 -0
  22. package/esm/node_modules/@conventional-changelog/template/dist/types/context.d.ts +113 -0
  23. package/esm/node_modules/@conventional-changelog/template/dist/types/context.d.ts.map +1 -0
  24. package/esm/node_modules/@conventional-changelog/template/dist/types/context.js +2 -0
  25. package/esm/node_modules/@conventional-changelog/template/dist/types/index.d.ts +4 -0
  26. package/esm/node_modules/@conventional-changelog/template/dist/types/index.d.ts.map +1 -0
  27. package/esm/node_modules/@conventional-changelog/template/dist/types/index.js +2 -0
  28. package/esm/node_modules/@conventional-changelog/template/dist/types/utils.d.ts +2 -0
  29. package/esm/node_modules/@conventional-changelog/template/dist/types/utils.d.ts.map +1 -0
  30. package/esm/node_modules/@conventional-changelog/template/dist/types/utils.js +2 -0
  31. package/esm/node_modules/@conventional-changelog/template/package.json +38 -0
  32. package/esm/node_modules/@simple-libs/stream-utils/LICENSE +21 -0
  33. package/esm/node_modules/@simple-libs/stream-utils/README.md +79 -0
  34. package/esm/node_modules/@simple-libs/stream-utils/dist/index.d.ts +51 -0
  35. package/esm/node_modules/@simple-libs/stream-utils/dist/index.d.ts.map +1 -0
  36. package/esm/node_modules/@simple-libs/stream-utils/dist/index.js +116 -0
  37. package/esm/node_modules/@simple-libs/stream-utils/package.json +38 -0
  38. package/esm/node_modules/argue-cli/LICENSE +21 -0
  39. package/esm/node_modules/argue-cli/README.md +239 -0
  40. package/esm/node_modules/argue-cli/dist/args.d.ts +30 -0
  41. package/esm/node_modules/argue-cli/dist/args.d.ts.map +1 -0
  42. package/esm/node_modules/argue-cli/dist/argv.d.ts +14 -0
  43. package/esm/node_modules/argue-cli/dist/argv.d.ts.map +1 -0
  44. package/esm/node_modules/argue-cli/dist/core.d.ts +24 -0
  45. package/esm/node_modules/argue-cli/dist/core.d.ts.map +1 -0
  46. package/esm/node_modules/argue-cli/dist/index.d.ts +6 -0
  47. package/esm/node_modules/argue-cli/dist/index.d.ts.map +1 -0
  48. package/esm/node_modules/argue-cli/dist/index.js +254 -0
  49. package/esm/node_modules/argue-cli/dist/index.js.map +1 -0
  50. package/esm/node_modules/argue-cli/dist/options.d.ts +9 -0
  51. package/esm/node_modules/argue-cli/dist/options.d.ts.map +1 -0
  52. package/esm/node_modules/argue-cli/dist/types.d.ts +16 -0
  53. package/esm/node_modules/argue-cli/dist/types.d.ts.map +1 -0
  54. package/esm/node_modules/argue-cli/dist/utils.d.ts +24 -0
  55. package/esm/node_modules/argue-cli/dist/utils.d.ts.map +1 -0
  56. package/esm/node_modules/argue-cli/package.json +34 -0
  57. package/esm/node_modules/conventional-changelog-core/node_modules/conventional-changelog-writer/LICENSE.md +21 -0
  58. package/esm/node_modules/conventional-changelog-core/node_modules/conventional-changelog-writer/README.md +369 -0
  59. package/esm/node_modules/conventional-changelog-core/node_modules/conventional-changelog-writer/package.json +53 -0
  60. package/esm/node_modules/conventional-changelog-core/node_modules/conventional-commits-filter/LICENSE +21 -0
  61. package/esm/node_modules/conventional-changelog-core/node_modules/conventional-commits-filter/README.md +184 -0
  62. package/esm/node_modules/conventional-changelog-core/node_modules/conventional-commits-filter/package.json +31 -0
  63. package/esm/node_modules/conventional-changelog-core/node_modules/conventional-commits-parser/LICENSE.md +21 -0
  64. package/esm/node_modules/conventional-changelog-core/node_modules/conventional-commits-parser/README.md +383 -0
  65. package/esm/node_modules/conventional-changelog-core/node_modules/conventional-commits-parser/package.json +47 -0
  66. package/esm/node_modules/conventional-changelog-writer/README.md +49 -342
  67. package/esm/node_modules/conventional-changelog-writer/dist/cli/index.d.ts +3 -0
  68. package/esm/node_modules/conventional-changelog-writer/dist/cli/index.d.ts.map +1 -0
  69. package/esm/node_modules/conventional-changelog-writer/dist/cli/index.js +68 -0
  70. package/esm/node_modules/conventional-changelog-writer/dist/cli/utils.d.ts +4 -0
  71. package/esm/node_modules/conventional-changelog-writer/dist/cli/utils.d.ts.map +1 -0
  72. package/esm/node_modules/conventional-changelog-writer/dist/cli/utils.js +39 -0
  73. package/esm/node_modules/conventional-changelog-writer/dist/commit.d.ts +10 -0
  74. package/esm/node_modules/conventional-changelog-writer/dist/commit.d.ts.map +1 -0
  75. package/esm/node_modules/conventional-changelog-writer/dist/commit.js +43 -0
  76. package/esm/node_modules/conventional-changelog-writer/dist/context.d.ts +27 -0
  77. package/esm/node_modules/conventional-changelog-writer/dist/context.d.ts.map +1 -0
  78. package/esm/node_modules/conventional-changelog-writer/dist/context.js +134 -0
  79. package/esm/node_modules/conventional-changelog-writer/dist/index.d.ts +7 -0
  80. package/esm/node_modules/conventional-changelog-writer/dist/index.d.ts.map +1 -0
  81. package/esm/node_modules/conventional-changelog-writer/dist/index.js +6 -0
  82. package/esm/node_modules/conventional-changelog-writer/dist/options.d.ts +25 -0
  83. package/esm/node_modules/conventional-changelog-writer/dist/options.d.ts.map +1 -0
  84. package/esm/node_modules/conventional-changelog-writer/dist/options.js +79 -0
  85. package/esm/node_modules/conventional-changelog-writer/dist/template.d.ts +10 -0
  86. package/esm/node_modules/conventional-changelog-writer/dist/template.d.ts.map +1 -0
  87. package/esm/node_modules/conventional-changelog-writer/dist/template.js +18 -0
  88. package/esm/node_modules/conventional-changelog-writer/dist/types/index.d.ts +8 -0
  89. package/esm/node_modules/conventional-changelog-writer/dist/types/index.d.ts.map +1 -0
  90. package/esm/node_modules/conventional-changelog-writer/dist/types/index.js +2 -0
  91. package/esm/node_modules/conventional-changelog-writer/dist/types/options.d.ts +122 -0
  92. package/esm/node_modules/conventional-changelog-writer/dist/types/options.d.ts.map +1 -0
  93. package/esm/node_modules/conventional-changelog-writer/dist/types/options.js +2 -0
  94. package/esm/node_modules/conventional-changelog-writer/dist/types/utils.d.ts +9 -0
  95. package/esm/node_modules/conventional-changelog-writer/dist/types/utils.d.ts.map +1 -0
  96. package/esm/node_modules/conventional-changelog-writer/dist/types/utils.js +2 -0
  97. package/esm/node_modules/conventional-changelog-writer/dist/utils.d.ts +20 -0
  98. package/esm/node_modules/conventional-changelog-writer/dist/utils.d.ts.map +1 -0
  99. package/esm/node_modules/conventional-changelog-writer/dist/utils.js +70 -0
  100. package/esm/node_modules/conventional-changelog-writer/dist/writers.d.ts +29 -0
  101. package/esm/node_modules/conventional-changelog-writer/dist/writers.d.ts.map +1 -0
  102. package/esm/node_modules/conventional-changelog-writer/dist/writers.js +94 -0
  103. package/esm/node_modules/conventional-changelog-writer/package.json +24 -26
  104. package/esm/node_modules/conventional-commits-filter/README.md +51 -170
  105. package/esm/node_modules/conventional-commits-filter/dist/RevertedCommitsFilter.d.ts +17 -0
  106. package/esm/node_modules/conventional-commits-filter/dist/RevertedCommitsFilter.d.ts.map +1 -0
  107. package/esm/node_modules/conventional-commits-filter/dist/RevertedCommitsFilter.js +46 -0
  108. package/esm/node_modules/conventional-commits-filter/dist/filters.d.ts +19 -0
  109. package/esm/node_modules/conventional-commits-filter/dist/filters.d.ts.map +1 -0
  110. package/esm/node_modules/conventional-commits-filter/dist/filters.js +34 -0
  111. package/esm/node_modules/conventional-commits-filter/dist/index.d.ts +4 -0
  112. package/esm/node_modules/conventional-commits-filter/dist/index.d.ts.map +1 -0
  113. package/esm/node_modules/conventional-commits-filter/dist/index.js +3 -0
  114. package/esm/node_modules/conventional-commits-filter/dist/types.d.ts +6 -0
  115. package/esm/node_modules/conventional-commits-filter/dist/types.d.ts.map +1 -0
  116. package/esm/node_modules/conventional-commits-filter/dist/types.js +2 -0
  117. package/esm/node_modules/conventional-commits-filter/dist/utils.d.ts +16 -0
  118. package/esm/node_modules/conventional-commits-filter/dist/utils.d.ts.map +1 -0
  119. package/esm/node_modules/conventional-commits-filter/dist/utils.js +43 -0
  120. package/esm/node_modules/conventional-commits-filter/package.json +22 -16
  121. package/esm/node_modules/conventional-commits-parser/README.md +49 -353
  122. package/esm/node_modules/conventional-commits-parser/dist/CommitParser.d.ts +40 -0
  123. package/esm/node_modules/conventional-commits-parser/dist/CommitParser.d.ts.map +1 -0
  124. package/esm/node_modules/conventional-commits-parser/dist/CommitParser.js +319 -0
  125. package/esm/node_modules/conventional-commits-parser/dist/cli/index.d.ts +3 -0
  126. package/esm/node_modules/conventional-commits-parser/dist/cli/index.d.ts.map +1 -0
  127. package/esm/node_modules/conventional-commits-parser/dist/cli/index.js +67 -0
  128. package/esm/node_modules/conventional-commits-parser/dist/cli/options.d.ts +3 -0
  129. package/esm/node_modules/conventional-commits-parser/dist/cli/options.d.ts.map +1 -0
  130. package/esm/node_modules/conventional-commits-parser/dist/cli/options.js +40 -0
  131. package/esm/node_modules/conventional-commits-parser/dist/cli/utils.d.ts +5 -0
  132. package/esm/node_modules/conventional-commits-parser/dist/cli/utils.d.ts.map +1 -0
  133. package/esm/node_modules/conventional-commits-parser/dist/cli/utils.js +49 -0
  134. package/esm/node_modules/conventional-commits-parser/dist/index.d.ts +4 -0
  135. package/esm/node_modules/conventional-commits-parser/dist/index.d.ts.map +1 -0
  136. package/esm/node_modules/conventional-commits-parser/dist/index.js +3 -0
  137. package/esm/node_modules/conventional-commits-parser/dist/options.d.ts +3 -0
  138. package/esm/node_modules/conventional-commits-parser/dist/options.d.ts.map +1 -0
  139. package/esm/node_modules/conventional-commits-parser/dist/options.js +27 -0
  140. package/esm/node_modules/conventional-commits-parser/dist/regex.d.ts +8 -0
  141. package/esm/node_modules/conventional-commits-parser/dist/regex.d.ts.map +1 -0
  142. package/esm/node_modules/conventional-commits-parser/dist/regex.js +63 -0
  143. package/esm/node_modules/conventional-commits-parser/dist/stream.d.ts +14 -0
  144. package/esm/node_modules/conventional-commits-parser/dist/stream.d.ts.map +1 -0
  145. package/esm/node_modules/conventional-commits-parser/dist/stream.js +38 -0
  146. package/esm/node_modules/conventional-commits-parser/dist/types.d.ts +100 -0
  147. package/esm/node_modules/conventional-commits-parser/dist/types.d.ts.map +1 -0
  148. package/esm/node_modules/conventional-commits-parser/dist/types.js +2 -0
  149. package/esm/node_modules/conventional-commits-parser/dist/utils.d.ts +41 -0
  150. package/esm/node_modules/conventional-commits-parser/dist/utils.d.ts.map +1 -0
  151. package/esm/node_modules/conventional-commits-parser/dist/utils.js +75 -0
  152. package/esm/node_modules/conventional-commits-parser/package.json +22 -23
  153. package/esm/src/cli/command-help.js +15 -0
  154. package/esm/src/cli/repair-configuration-description.js +98 -0
  155. package/esm/src/cli/run-changelog.js +51 -0
  156. package/esm/src/cli/run-cli.js +8 -0
  157. package/esm/src/features/built-in-feature-registry.js +2 -0
  158. package/esm/src/features/changelog-feature.js +155 -0
  159. package/esm/src/features/github-ci-artifacts.js +17 -3
  160. package/esm/src/features/github-ci-runtime-matrix.js +50 -0
  161. package/esm/src/features/github-release-publish-artifacts.js +5 -4
  162. package/esm/src/features/github-release-publish-feature.js +4 -0
  163. package/esm/src/features/github-workflow-cache.js +18 -0
  164. package/esm/src/features/workflow-deno.js +1 -1
  165. package/esm/src/release/changelog-markdown.js +41 -0
  166. package/esm/src/release/changelog.js +155 -7
  167. package/esm/src/release/format-changelog.js +15 -0
  168. package/esm/src/release/migrate-changelog.js +92 -0
  169. package/esm/src/release/publish-github.js +7 -3
  170. package/esm/src/release/publish-tag-prepare.js +63 -78
  171. package/esm/src/release/release-history.js +53 -0
  172. package/npm-dependencies.lock.json +115 -48
  173. package/package.json +5 -3
  174. package/esm/node_modules/conventional-commits-parser/node_modules/meow/build/dependencies.js +0 -11036
  175. package/esm/node_modules/conventional-commits-parser/node_modules/meow/build/index.d.ts +0 -1416
  176. package/esm/node_modules/conventional-commits-parser/node_modules/meow/build/index.js +0 -100
  177. package/esm/node_modules/conventional-commits-parser/node_modules/meow/build/licenses.md +0 -1767
  178. package/esm/node_modules/conventional-commits-parser/node_modules/meow/build/options.js +0 -92
  179. package/esm/node_modules/conventional-commits-parser/node_modules/meow/build/parser.js +0 -84
  180. package/esm/node_modules/conventional-commits-parser/node_modules/meow/build/utils.js +0 -7
  181. package/esm/node_modules/conventional-commits-parser/node_modules/meow/build/validate.js +0 -122
  182. package/esm/node_modules/conventional-commits-parser/node_modules/meow/license +0 -9
  183. package/esm/node_modules/conventional-commits-parser/node_modules/meow/package.json +0 -107
  184. package/esm/node_modules/conventional-commits-parser/node_modules/meow/readme.md +0 -314
  185. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core/node_modules/conventional-changelog-writer}/cli.mjs +0 -0
  186. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core/node_modules/conventional-changelog-writer}/index.js +0 -0
  187. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core/node_modules/conventional-changelog-writer}/lib/util.js +0 -0
  188. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core/node_modules/conventional-changelog-writer}/templates/commit.hbs +0 -0
  189. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core/node_modules/conventional-changelog-writer}/templates/footer.hbs +0 -0
  190. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core/node_modules/conventional-changelog-writer}/templates/header.hbs +0 -0
  191. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core/node_modules/conventional-changelog-writer}/templates/template.hbs +0 -0
  192. /package/esm/node_modules/{conventional-commits-filter → conventional-changelog-core/node_modules/conventional-commits-filter}/index.js +0 -0
  193. /package/esm/node_modules/{conventional-commits-parser → conventional-changelog-core/node_modules/conventional-commits-parser}/cli.mjs +0 -0
  194. /package/esm/node_modules/{conventional-commits-parser → conventional-changelog-core/node_modules/conventional-commits-parser}/index.js +0 -0
  195. /package/esm/node_modules/{conventional-commits-parser → conventional-changelog-core/node_modules/conventional-commits-parser}/lib/parser.js +0 -0
  196. /package/esm/node_modules/{conventional-commits-parser → conventional-changelog-core/node_modules/conventional-commits-parser}/lib/regex.js +0 -0
  197. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core}/node_modules/meow/build/dependencies.js +0 -0
  198. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core}/node_modules/meow/build/index.d.ts +0 -0
  199. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core}/node_modules/meow/build/index.js +0 -0
  200. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core}/node_modules/meow/build/licenses.md +0 -0
  201. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core}/node_modules/meow/build/options.js +0 -0
  202. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core}/node_modules/meow/build/parser.js +0 -0
  203. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core}/node_modules/meow/build/utils.js +0 -0
  204. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core}/node_modules/meow/build/validate.js +0 -0
  205. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core}/node_modules/meow/license +0 -0
  206. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core}/node_modules/meow/package.json +0 -0
  207. /package/esm/node_modules/{conventional-changelog-writer → conventional-changelog-core}/node_modules/meow/readme.md +0 -0
@@ -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.
@@ -0,0 +1,383 @@
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
+ > Parse raw conventional commits
4
+
5
+
6
+ ## Conventional Commit Message Format
7
+
8
+ A minimum input should contain a raw message.
9
+
10
+ Each commit message consists of a **merge header**, a **header** (mandatory), a **body** and a **footer**. **Mention** (optional) someone using the `@` notation.
11
+
12
+ ```
13
+ <merge>
14
+ <header>
15
+ <body>
16
+ <footer>
17
+ ```
18
+
19
+ ### merge
20
+
21
+ The merge header may optionally have a special format that includes other parts, such as **branch**, **issueId** or **source**.
22
+
23
+ ```
24
+ Merge branch <branch>
25
+ Merge pull request <issue-id> from <source>
26
+ ```
27
+
28
+ ### header
29
+
30
+ The header may optionally have a special format that includes other parts, such as **type**, **scope** and **subject**. You could **reference** (optional) issues here.
31
+
32
+ ```
33
+ <type>(<scope>): <subject>
34
+ ```
35
+
36
+ ### footer
37
+
38
+ The footer should contain any information about **Important Notes** (optional) and is also the place to **reference** (optional) issues.
39
+
40
+ ```
41
+ <important note>
42
+ <references>
43
+ ```
44
+
45
+ ### other parts
46
+
47
+ This module will only parse the message body. However, it is possible to include other fields such as hash, committer or date.
48
+
49
+ ```
50
+ My commit message
51
+ -sideNotes-
52
+ It should warn the correct unfound file names.
53
+ Also it should continue if one file cannot be found.
54
+ Tests are added for these
55
+ ```
56
+
57
+ Then `sideNotes` will be `It should warn the correct unfound file names.\nAlso it should continue if one file cannot be found.\nTests are added for these`. You can customize the `fieldPattern`.
58
+
59
+
60
+ ## Install
61
+
62
+ ```sh
63
+ $ npm install --save conventional-commits-parser
64
+ ```
65
+
66
+
67
+ ## Usage
68
+
69
+ ```js
70
+ var conventionalCommitsParser = require('conventional-commits-parser');
71
+
72
+ conventionalCommitsParser(options);
73
+ ```
74
+
75
+ It returns a transform stream and expects an upstream that looks something like this:
76
+
77
+ ```
78
+ 'feat(scope): broadcast $destroy event on scope destruction\nCloses #1'
79
+ 'feat(ng-list): Allow custom separator\nbla bla bla\n\nBREAKING CHANGE: some breaking change.\nThanks @stevemao\n'
80
+ ```
81
+
82
+ Each chunk should be a commit. The downstream will look something like this:
83
+
84
+ ```js
85
+ { type: 'feat',
86
+ scope: 'scope',
87
+ subject: 'broadcast $destroy event on scope destruction',
88
+ merge: null,
89
+ header: 'feat(scope): broadcast $destroy event on scope destruction',
90
+ body: null,
91
+ footer: 'Closes #1',
92
+ notes: [],
93
+ references:
94
+ [ { action: 'Closes',
95
+ owner: null,
96
+ repository: null,
97
+ issue: '1',
98
+ raw: '#1',
99
+ prefix: '#' } ],
100
+ mentions: [],
101
+ revert: null }
102
+ { type: 'feat',
103
+ scope: 'ng-list',
104
+ subject: 'Allow custom separator',
105
+ merge: null,
106
+ header: 'feat(ng-list): Allow custom separator',
107
+ body: 'bla bla bla',
108
+ footer: 'BREAKING CHANGE: some breaking change.\nThanks @stevemao',
109
+ notes:
110
+ [ { title: 'BREAKING CHANGE',
111
+ text: 'some breaking change.\nThanks @stevemao' } ],
112
+ references: [],
113
+ mentions: [ 'stevemao' ],
114
+ revert: null }
115
+ ```
116
+
117
+
118
+ ## API
119
+
120
+ ### conventionalCommitsParser([options])
121
+
122
+ Returns an transform stream. If there is any malformed commits it will be gracefully ignored (an empty data will be emitted so down stream can notice).
123
+
124
+ #### options
125
+
126
+ Type: `object`
127
+
128
+ ##### mergePattern
129
+
130
+ Type: `regex` or `string` Default: null
131
+
132
+ Pattern to match merge headers. EG: branch merge, GitHub or GitLab like pull requests headers. When a merge header is parsed, the next line is used for conventional header parsing.
133
+
134
+ For example, if we have a commit
135
+
136
+ ```
137
+ Merge pull request #1 from user/feature/feature-name
138
+
139
+ feat(scope): broadcast $destroy event on scope destruction
140
+ ```
141
+
142
+ We can parse it with these options and the default headerPattern:
143
+
144
+ ```js
145
+ {
146
+ mergePattern: /^Merge pull request #(\d+) from (.*)$/,
147
+ mergeCorrespondence: ['id', 'source']
148
+ }
149
+ ```
150
+
151
+ ##### mergeCorrespondence
152
+
153
+ Type: `array` of `string` or `string` Default: null
154
+
155
+ Used to define what capturing group of `mergePattern`.
156
+
157
+ If it's a `string` it will be converted to an `array` separated by a comma.
158
+
159
+ ##### headerPattern
160
+
161
+ Type: `regex` or `string` Default: `/^(\w*)(?:\(([\w\$\.\-\* ]*)\))?\: (.*)$/`
162
+
163
+ Used to match header pattern.
164
+
165
+ ##### headerCorrespondence
166
+
167
+ Type: `array` of `string` or `string` Default `['type', 'scope', 'subject']`
168
+
169
+ Used to define what capturing group of `headerPattern` captures what header part. The order of the array should correspond to the order of `headerPattern`'s capturing group. If the part is not captured it is `null`. If it's a `string` it will be converted to an `array` separated by a comma.
170
+
171
+ ##### referenceActions
172
+
173
+ Type: `array` of `string` or `string` Default:
174
+ `[
175
+ 'close',
176
+ 'closes',
177
+ 'closed',
178
+ 'fix',
179
+ 'fixes',
180
+ 'fixed',
181
+ 'resolve',
182
+ 'resolves',
183
+ 'resolved'
184
+ ]`
185
+
186
+ Keywords to reference an issue. This value is case **insensitive**. If it's a `string` it will be converted to an `array` separated by a comma.
187
+
188
+ Set it to `null` to reference an issue without any action.
189
+
190
+ ##### issuePrefixes
191
+
192
+ Type: `array` of `string` or `string` Default: `['#']`
193
+
194
+ The prefixes of an issue. EG: In `gh-123` `gh-` is the prefix.
195
+
196
+ ##### issuePrefixesCaseSensitive
197
+
198
+ Type: `boolean` Default: false
199
+
200
+ Used to define if `issuePrefixes` should be considered case sensitive.
201
+
202
+ ##### noteKeywords
203
+
204
+ Type: `array` of `string` or `string` Default: `['BREAKING CHANGE',
205
+ 'BREAKING-CHANGE']`
206
+
207
+ Keywords for important notes. This value is case **insensitive**. If it's a `string` it will be converted to an `array` separated by a comma.
208
+
209
+ ##### notesPattern
210
+
211
+ Type: `function` Default: `noteKeywordsSelection => ^[\\s|*]*(' + noteKeywordsSelection + ')[:\\s]+(.*)` where `noteKeywordsSelection` is `join(noteKeywords, '|')`
212
+
213
+ A function that takes `noteKeywordsSelection` and returns a `RegExp` to be matched against the notes.
214
+
215
+ ##### fieldPattern
216
+
217
+ Type: `regex` or `string` Default: `/^-(.*?)-$/`
218
+
219
+ Pattern to match other fields.
220
+
221
+ ##### revertPattern
222
+
223
+ Type: `regex` or `string` Default: `/^Revert\s"([\s\S]*)"\s*This reverts commit (\w*)\./`
224
+
225
+ Pattern to match what this commit reverts.
226
+
227
+ ##### revertCorrespondence
228
+
229
+ Type: `array` of `string` or `string` Default: `['header', 'hash']`
230
+
231
+ Used to define what capturing group of `revertPattern` captures what reverted commit fields. The order of the array should correspond to the order of `revertPattern`'s capturing group.
232
+
233
+ For example, if we had commit
234
+
235
+ ```
236
+ Revert "throw an error if a callback is passed"
237
+
238
+ This reverts commit 9bb4d6c.
239
+ ```
240
+
241
+ If configured correctly, the parsed result would be
242
+
243
+ ```js
244
+ {
245
+ revert: {
246
+ header: 'throw an error if a callback is passed',
247
+ hash: '9bb4d6c'
248
+ }
249
+ }
250
+ ```
251
+
252
+ It implies that this commit reverts a commit with header `'throw an error if a callback is passed'` and hash `'9bb4d6c'`.
253
+
254
+ If it's a `string` it will be converted to an `array` separated by a comma.
255
+
256
+ ##### commentChar
257
+
258
+ Type: `string` or `null` Default: null
259
+
260
+ What commentChar to use. By default it is `null`, so no comments are stripped.
261
+ Set to `#` if you pass the contents of `.git/COMMIT_EDITMSG` directly.
262
+
263
+ If you have configured the git commentchar via `git config core.commentchar` you'll want to pass what you have set there.
264
+
265
+ ##### warn
266
+
267
+ Type: `function` or `boolean` Default: `function() {}`
268
+
269
+ What warn function to use. For example, `console.warn.bind(console)` or `grunt.log.writeln`. By default, it's a noop. If it is `true`, it will error if commit cannot be parsed (strict).
270
+
271
+ ### conventionalCommitsParser.sync(commit, [options])
272
+
273
+ The sync version. Useful when parsing a single commit. Returns the result.
274
+
275
+ #### commit
276
+
277
+ A single commit to be parsed.
278
+
279
+ #### options
280
+
281
+ Same as the `options` of `conventionalCommitsParser`.
282
+
283
+
284
+ ## CLI
285
+
286
+ You can use cli to practice writing commit messages or parse messages from files. Note: the sample output might be different. It's just for demonstration purposes.
287
+
288
+ ```sh
289
+ $ npm install --global conventional-commits-parser
290
+ ```
291
+
292
+ If you run `conventional-commits-parser` without any arguments
293
+
294
+ ```sh
295
+ $ conventional-commits-parser
296
+ ```
297
+
298
+ You will enter an interactive shell. To show your parsed output enter "return" three times (or enter your specified separator).
299
+
300
+ ```sh
301
+ > fix(title): a title is fixed
302
+
303
+
304
+ {"type":"fix","scope":"title","subject":"a title is fixed","header":"fix(title): a title is fixed","body":null,"footer":null,"notes":[],"references":[],"revert":null}
305
+ ```
306
+
307
+ You can also use cli to parse messages from files.
308
+
309
+ If you have log.txt
310
+
311
+ ```text
312
+ feat(ngMessages): provide support for dynamic message resolution
313
+
314
+ Prior to this fix it was impossible to apply a binding to a the ngMessage directive to represent the name of the error.
315
+
316
+ 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.
317
+
318
+ Closes #10036
319
+ Closes #9338
320
+ ```
321
+
322
+ And you run
323
+
324
+ ```sh
325
+ $ conventional-commits-parser log.txt
326
+ # or
327
+ $ cat log.txt | conventional-commits-parser
328
+ ```
329
+
330
+ An array of json will be printed to stdout.
331
+
332
+ ```sh
333
+ [
334
+ {"type":"feat","scope":"ngMessages","subject":"provide support for dynamic message resolution","header":"feat(ngMessages): 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"}],"revert":null}
335
+ ]
336
+ ```
337
+
338
+ Commits should be split by at least three newlines (`\n\n\n`) or you can specify a separator as the second argument.
339
+
340
+ Eg: in log2.txt
341
+
342
+ ```text
343
+
344
+ docs(ngMessageExp): split ngMessage docs up to show its alias more clearly
345
+ ===
346
+
347
+ fix($animate): applyStyles from options on leave
348
+
349
+ Closes #10068
350
+ ```
351
+
352
+ And you run
353
+
354
+ ```sh
355
+ $ conventional-commits-parser log2.txt '==='
356
+ ```
357
+
358
+ ```sh
359
+ [
360
+ {"type":"docs","scope":"ngMessageExp","subject":"split ngMessage docs up to show its alias more clearly","header":"docs(ngMessageExp): split ngMessage docs up to show its alias more clearly","body":null,"footer":null,"notes":[],"references":[],"revert":null}
361
+ ,
362
+ {"type":"fix","scope":"$animate","subject":"applyStyles from options on leave","header":"fix($animate): applyStyles from options on leave","body":null,"footer":"Closes #10068","notes":[],"references":[{"action":"Closes","owner":null,"repository":null,"issue":"10068","raw":"#10068"}],"revert":null}
363
+ ]
364
+ ```
365
+
366
+ Will be printed out.
367
+
368
+ You can specify one or more files. The output array will be in order of the input file paths. If you specify more than one separator, the last one will be used.
369
+
370
+
371
+ ## License
372
+
373
+ MIT © [Steve Mao](https://github.com/stevemao)
374
+
375
+
376
+ [npm-image]: https://badge.fury.io/js/conventional-commits-parser.svg
377
+ [npm-url]: https://npmjs.org/package/conventional-commits-parser
378
+ [travis-image]: https://travis-ci.org/conventional-changelog/conventional-commits-parser.svg?branch=master
379
+ [travis-url]: https://travis-ci.org/conventional-changelog/conventional-commits-parser
380
+ [daviddm-image]: https://david-dm.org/conventional-changelog/conventional-commits-parser.svg?theme=shields.io
381
+ [daviddm-url]: https://david-dm.org/conventional-changelog/conventional-commits-parser
382
+ [coverage-image]: https://coveralls.io/repos/github/conventional-changelog/conventional-changelog/badge.svg?branch=master
383
+ [coverage-url]: https://coveralls.io/github/conventional-changelog/conventional-changelog?branch=master
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "conventional-commits-parser",
3
+ "version": "5.0.0",
4
+ "description": "Parse raw conventional commits",
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-parser#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
+ ],
27
+ "keywords": [
28
+ "conventional-commits-parser",
29
+ "changelog",
30
+ "conventional",
31
+ "parser",
32
+ "parsing",
33
+ "logs"
34
+ ],
35
+ "dependencies": {
36
+ "JSONStream": "^1.3.5",
37
+ "is-text-path": "^2.0.0",
38
+ "meow": "^12.0.1",
39
+ "split2": "^4.0.0"
40
+ },
41
+ "bin": {
42
+ "conventional-commits-parser": "cli.mjs"
43
+ },
44
+ "devDependencies": {
45
+ "forceable-tty": "^0.1.0"
46
+ }
47
+ }