@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,74 @@
1
+ import type { FinalTemplateContext, CommitKnownProps, CommitNote, CommitReference, TransformedCommit } from './types/index.js';
2
+ /**
3
+ * Builds a repository URL from template context fields.
4
+ * @param context - Template context.
5
+ * @returns Repository URL.
6
+ */
7
+ export declare function repositoryUrl<Commit extends CommitKnownProps = CommitKnownProps>(context: FinalTemplateContext<Commit>): string;
8
+ /**
9
+ * Builds a repository URL for a commit reference.
10
+ * @param context - Template context.
11
+ * @param reference - Commit reference.
12
+ * @returns Reference repository URL.
13
+ */
14
+ export declare function referenceRepositoryUrl<Commit extends CommitKnownProps = CommitKnownProps>(context: FinalTemplateContext<Commit>, reference: CommitReference): string;
15
+ /**
16
+ * Builds a release comparison URL and encodes tag names as URL path segments.
17
+ * @param context - Template context.
18
+ * @returns Release comparison URL.
19
+ */
20
+ export declare function compareUrl<Commit extends CommitKnownProps = CommitKnownProps>(context: FinalTemplateContext<Commit>): string;
21
+ export declare const BREAKING_CHANGE_KEYWORDS: string[];
22
+ export declare const BREAKING_CHANGES_TITLE = "BREAKING CHANGES";
23
+ /**
24
+ * Renders a note group title.
25
+ * Breaking change keywords are merged into a single title,
26
+ * every other keyword is uppercased to group its spellings together.
27
+ * @param title - Note title as it was written in a commit.
28
+ * @returns Note group title.
29
+ */
30
+ export declare function noteTitle(title: string): string;
31
+ /**
32
+ * Checks if a note is a breaking change note.
33
+ * @param note - Commit note.
34
+ * @returns Is it a breaking change note.
35
+ */
36
+ export declare function isBreakingNote(note: CommitNote): boolean;
37
+ /**
38
+ * Renders a commit reference label.
39
+ * @param reference - Commit reference.
40
+ * @returns Commit reference label.
41
+ */
42
+ export declare function reference(reference: CommitReference): string;
43
+ /**
44
+ * Renders the default changelog header.
45
+ * @param context - Template context.
46
+ * @returns Changelog header.
47
+ */
48
+ export declare function headerPartial<Commit extends CommitKnownProps = CommitKnownProps>({ isPatch, title, version, date }: FinalTemplateContext<Commit>): string;
49
+ /**
50
+ * Renders the default changelog preamble.
51
+ * @param context - Template context.
52
+ * @returns Changelog preamble.
53
+ */
54
+ export declare function preamblePartial<Commit extends CommitKnownProps = CommitKnownProps>({ preamble }: FinalTemplateContext<Commit>): string;
55
+ /**
56
+ * Renders the default changelog footer.
57
+ * @param context - Template context.
58
+ * @returns Changelog footer.
59
+ */
60
+ export declare function footerPartial<Commit extends CommitKnownProps = CommitKnownProps>({ noteGroups }: FinalTemplateContext<Commit>): string;
61
+ /**
62
+ * Renders the default changelog commit line.
63
+ * @param context - Template context.
64
+ * @param commit - Transformed commit.
65
+ * @returns Changelog commit line.
66
+ */
67
+ export declare function commitPartial<Commit extends CommitKnownProps = CommitKnownProps>(context: FinalTemplateContext<Commit>, commit: TransformedCommit<Commit>): string;
68
+ /**
69
+ * Renders the default changelog template.
70
+ * @param context - Template context.
71
+ * @returns Changelog text.
72
+ */
73
+ export declare function template<Commit extends CommitKnownProps = CommitKnownProps>(context: FinalTemplateContext<Commit>): string;
74
+ //# sourceMappingURL=templates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../src/templates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB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;AACH,wBAAgB,aAAa,CAAC,MAAM,SAAS,gBAAgB,GAAG,gBAAgB,EAC9E,OAAO,EAAE,oBAAoB,CAAC,MAAM,CAAC,EACrC,MAAM,EAAE,iBAAiB,CAAC,MAAM,CAAC,UAuClC;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,MAAM,SAAS,gBAAgB,GAAG,gBAAgB,EACzE,OAAO,EAAE,oBAAoB,CAAC,MAAM,CAAC,UAsBtC"}
@@ -0,0 +1,125 @@
1
+ import { each, link, list, small, heading, segments, strings, words, newline, url } from './elements.js';
2
+ /**
3
+ * Builds a repository URL from template context fields.
4
+ * @param context - Template context.
5
+ * @returns Repository URL.
6
+ */
7
+ export function repositoryUrl(context) {
8
+ if (context.repository) {
9
+ return url(context.host, context.owner, context.repository);
10
+ }
11
+ return context.repoUrl || '';
12
+ }
13
+ /**
14
+ * Builds a repository URL for a commit reference.
15
+ * @param context - Template context.
16
+ * @param reference - Commit reference.
17
+ * @returns Reference repository URL.
18
+ */
19
+ export function referenceRepositoryUrl(context, reference) {
20
+ if (!context.repository) {
21
+ return context.repoUrl || '';
22
+ }
23
+ if (reference.repository) {
24
+ return url(context.host, reference.owner, reference.repository);
25
+ }
26
+ return url(context.host, context.owner, context.repository);
27
+ }
28
+ /**
29
+ * Builds a release comparison URL and encodes tag names as URL path segments.
30
+ * @param context - Template context.
31
+ * @returns Release comparison URL.
32
+ */
33
+ export function compareUrl(context) {
34
+ const previousTag = encodeURIComponent(context.previousTag || '');
35
+ const currentTag = encodeURIComponent(context.currentTag || '');
36
+ return url(repositoryUrl(context), context.compare || 'compare', `${previousTag}...${currentTag}`);
37
+ }
38
+ export const BREAKING_CHANGE_KEYWORDS = ['BREAKING CHANGE', 'BREAKING-CHANGE'];
39
+ export const BREAKING_CHANGES_TITLE = 'BREAKING CHANGES';
40
+ /**
41
+ * Renders a note group title.
42
+ * Breaking change keywords are merged into a single title,
43
+ * every other keyword is uppercased to group its spellings together.
44
+ * @param title - Note title as it was written in a commit.
45
+ * @returns Note group title.
46
+ */
47
+ export function noteTitle(title) {
48
+ const upperCaseTitle = title.toUpperCase();
49
+ return BREAKING_CHANGE_KEYWORDS.includes(upperCaseTitle)
50
+ ? BREAKING_CHANGES_TITLE
51
+ : upperCaseTitle;
52
+ }
53
+ /**
54
+ * Checks if a note is a breaking change note.
55
+ * @param note - Commit note.
56
+ * @returns Is it a breaking change note.
57
+ */
58
+ export function isBreakingNote(note) {
59
+ return noteTitle(note.title) === BREAKING_CHANGES_TITLE;
60
+ }
61
+ /**
62
+ * Renders a commit reference label.
63
+ * @param reference - Commit reference.
64
+ * @returns Commit reference label.
65
+ */
66
+ export function reference(reference) {
67
+ return strings(reference.owner && `${reference.owner}/`, reference.repository, reference.issue && `${reference.prefix || '#'}${reference.issue}`);
68
+ }
69
+ /**
70
+ * Renders the default changelog header.
71
+ * @param context - Template context.
72
+ * @returns Changelog header.
73
+ */
74
+ export function headerPartial({ isPatch, title, version, date }) {
75
+ const versionText = words(version, title && `"${title}"`, date && `(${date})`);
76
+ return heading(2, isPatch ? small(versionText) : versionText);
77
+ }
78
+ /**
79
+ * Renders the default changelog preamble.
80
+ * @param context - Template context.
81
+ * @returns Changelog preamble.
82
+ */
83
+ export function preamblePartial({ preamble }) {
84
+ return strings(preamble);
85
+ }
86
+ /**
87
+ * Renders the default changelog footer.
88
+ * @param context - Template context.
89
+ * @returns Changelog footer.
90
+ */
91
+ export function footerPartial({ noteGroups }) {
92
+ return each(noteGroups, group => segments(heading(3, group.title), list(group.notes, note => note.text)), newline(2));
93
+ }
94
+ /**
95
+ * Renders the default changelog commit line.
96
+ * @param context - Template context.
97
+ * @param commit - Transformed commit.
98
+ * @returns Changelog commit line.
99
+ */
100
+ export function commitPartial(context, commit) {
101
+ const { linkReferences, issue, commit: commitUrlPath } = context;
102
+ const { hash, references, header } = commit;
103
+ const commitLink = hash
104
+ ? linkReferences
105
+ ? `(${link(hash, url(repositoryUrl(context), commitUrlPath, hash))})`
106
+ : hash
107
+ : '';
108
+ const renderedReferences = each(references, (linkReference) => {
109
+ if (linkReferences) {
110
+ return link(reference(linkReference), url(referenceRepositoryUrl(context, linkReference), issue, linkReference.issue));
111
+ }
112
+ return reference(linkReference);
113
+ }, ' ');
114
+ return strings(words(header, commitLink), renderedReferences && `, closes ${renderedReferences}`);
115
+ }
116
+ /**
117
+ * Renders the default changelog template.
118
+ * @param context - Template context.
119
+ * @returns Changelog text.
120
+ */
121
+ export function template(context) {
122
+ const { headerPartial, preamblePartial, commitPartial, footerPartial, commitGroups } = context;
123
+ return segments(headerPartial(context), preamblePartial(context), each(commitGroups, group => list(group.commits, commit => commitPartial(context, commit))), footerPartial(context));
124
+ }
125
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVtcGxhdGVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL3RlbXBsYXRlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFPQSxPQUFPLEVBQ0wsSUFBSSxFQUNKLElBQUksRUFDSixJQUFJLEVBQ0osS0FBSyxFQUNMLE9BQU8sRUFDUCxRQUFRLEVBQ1IsT0FBTyxFQUNQLEtBQUssRUFDTCxPQUFPLEVBQ1AsR0FBRyxFQUNKLE1BQU0sZUFBZSxDQUFBO0FBRXRCOzs7O0dBSUc7QUFDSCxNQUFNLFVBQVUsYUFBYSxDQUMzQixPQUFxQztJQUVyQyxJQUFJLE9BQU8sQ0FBQyxVQUFVLEVBQUUsQ0FBQztRQUN2QixPQUFPLEdBQUcsQ0FBQyxPQUFPLENBQUMsSUFBSSxFQUFFLE9BQU8sQ0FBQyxLQUFLLEVBQUUsT0FBTyxDQUFDLFVBQVUsQ0FBQyxDQUFBO0lBQzdELENBQUM7SUFFRCxPQUFPLE9BQU8sQ0FBQyxPQUFPLElBQUksRUFBRSxDQUFBO0FBQzlCLENBQUM7QUFFRDs7Ozs7R0FLRztBQUNILE1BQU0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QUUsTUFBTSxDQUFDLENBQ3pDLENBQ0YsRUFDRCxhQUFhLENBQUMsT0FBTyxDQUFDLENBQ3ZCLENBQUE7QUFDSCxDQUFDIn0=
@@ -0,0 +1,37 @@
1
+ import type { AnyObject } from './utils.js';
2
+ export interface CommitReference {
3
+ raw: string;
4
+ action: string | null;
5
+ owner: string | null;
6
+ repository: string | null;
7
+ issue: string;
8
+ prefix: string;
9
+ }
10
+ export interface CommitNote {
11
+ title: string;
12
+ text: string;
13
+ }
14
+ export interface CommitKnownProps {
15
+ type?: string | null;
16
+ header?: string | null;
17
+ version?: string | null;
18
+ hash?: string | null;
19
+ committerDate?: string | null;
20
+ references?: CommitReference[] | null;
21
+ notes: CommitNote[];
22
+ revert?: AnyObject | null;
23
+ body?: string | null;
24
+ footer?: string | null;
25
+ }
26
+ export type TransformedCommit<Commit> = Commit & {
27
+ raw?: Commit;
28
+ };
29
+ export interface CommitGroup<Commit extends CommitKnownProps = CommitKnownProps> {
30
+ title: string;
31
+ commits: Commit[];
32
+ }
33
+ export interface NoteGroup {
34
+ title: string;
35
+ notes: CommitNote[];
36
+ }
37
+ //# sourceMappingURL=commit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commit.d.ts","sourceRoot":"","sources":["../../src/types/commit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE3C,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,UAAU,CAAC,EAAE,eAAe,EAAE,GAAG,IAAI,CAAA;IACrC,KAAK,EAAE,UAAU,EAAE,CAAA;IACnB,MAAM,CAAC,EAAE,SAAS,GAAG,IAAI,CAAA;IACzB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACvB;AAED,MAAM,MAAM,iBAAiB,CAAC,MAAM,IAAI,MAAM,GAAG;IAC/C,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,WAAW,WAAW,CAAC,MAAM,SAAS,gBAAgB,GAAG,gBAAgB;IAC7E,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB;AAED,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,UAAU,EAAE,CAAA;CACpB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbWl0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3R5cGVzL2NvbW1pdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIn0=
@@ -0,0 +1,113 @@
1
+ import type { CommitKnownProps, CommitGroup, NoteGroup, TransformedCommit } from './commit.js';
2
+ export type HeaderPartialFunction<Commit extends CommitKnownProps = CommitKnownProps> = (context: FinalTemplateContext<Commit>) => string;
3
+ export type PreamblePartialFunction<Commit extends CommitKnownProps = CommitKnownProps> = (context: FinalTemplateContext<Commit>) => string;
4
+ export type CommitPartialFunction<Commit extends CommitKnownProps = CommitKnownProps> = (context: FinalTemplateContext<Commit>, commit: TransformedCommit<Commit>) => string;
5
+ export type FooterPartialFunction<Commit extends CommitKnownProps = CommitKnownProps> = (context: FinalTemplateContext<Commit>) => string;
6
+ export interface TemplateContext<Commit extends CommitKnownProps = CommitKnownProps> {
7
+ /**
8
+ * Version number of the upcoming release.
9
+ * If `version` is found in the last commit before generating logs, it will be overwritten.
10
+ */
11
+ version?: string;
12
+ /**
13
+ * Is this a patch release?
14
+ */
15
+ isPatch?: boolean;
16
+ /**
17
+ * The title of the release.
18
+ */
19
+ title?: string;
20
+ /**
21
+ * The release date.
22
+ */
23
+ date?: string;
24
+ /**
25
+ * Introductory text rendered after the release header.
26
+ */
27
+ preamble?: string;
28
+ /**
29
+ * Should all references be linked?
30
+ */
31
+ linkReferences?: boolean;
32
+ /**
33
+ * Commit base url path.
34
+ */
35
+ commit?: string;
36
+ /**
37
+ * Issue base url.
38
+ */
39
+ issue?: string;
40
+ /**
41
+ * Release comparison base url path.
42
+ */
43
+ compare?: string;
44
+ /**
45
+ * Repository name.
46
+ * Eg: `'conventional-changelog-writer'`
47
+ */
48
+ repository?: string;
49
+ /**
50
+ * Repository host.
51
+ * Eg: `'https://github.com'` or `'https://bitbucket.org'`
52
+ */
53
+ host?: string;
54
+ /**
55
+ * Repository owner.
56
+ * Eg: `'conventional-changelog'`
57
+ */
58
+ owner?: string;
59
+ /**
60
+ * Full repository url.
61
+ * Eg: `'https://github.com/conventional-changelog/conventional-changelog-writer'`.
62
+ * Should be used as a fallback when `context.repository` doesn't exist.
63
+ */
64
+ repoUrl?: string;
65
+ /**
66
+ * Commit groups.
67
+ */
68
+ commitGroups?: CommitGroup<Commit>[];
69
+ /**
70
+ * Note groups.
71
+ */
72
+ noteGroups?: NoteGroup[];
73
+ /**
74
+ * Previous release tag.
75
+ */
76
+ previousTag?: string | null;
77
+ /**
78
+ * Current release tag.
79
+ */
80
+ currentTag?: string | null;
81
+ /**
82
+ * Add a link to compare changes.
83
+ */
84
+ linkCompare?: boolean;
85
+ /**
86
+ * Function that renders the release header.
87
+ */
88
+ headerPartial?: HeaderPartialFunction<Commit>;
89
+ /**
90
+ * Function that renders introductory text after the release header.
91
+ */
92
+ preamblePartial?: PreamblePartialFunction<Commit>;
93
+ /**
94
+ * Function that renders a single commit entry.
95
+ */
96
+ commitPartial?: CommitPartialFunction<Commit>;
97
+ /**
98
+ * Function that renders release footer notes.
99
+ */
100
+ footerPartial?: FooterPartialFunction<Commit>;
101
+ }
102
+ type RequiredTemplateContext<Commit extends CommitKnownProps = CommitKnownProps> = Required<TemplateContext<Commit>>;
103
+ export interface FinalTemplateContext<Commit extends CommitKnownProps = CommitKnownProps> extends TemplateContext<Commit> {
104
+ commit: RequiredTemplateContext<Commit>['commit'];
105
+ issue: RequiredTemplateContext<Commit>['issue'];
106
+ date: RequiredTemplateContext<Commit>['date'];
107
+ headerPartial: RequiredTemplateContext<Commit>['headerPartial'];
108
+ preamblePartial: RequiredTemplateContext<Commit>['preamblePartial'];
109
+ commitPartial: RequiredTemplateContext<Commit>['commitPartial'];
110
+ footerPartial: RequiredTemplateContext<Commit>['footerPartial'];
111
+ }
112
+ export {};
113
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/types/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,iBAAiB,EAClB,MAAM,aAAa,CAAA;AAEpB,MAAM,MAAM,qBAAqB,CAAC,MAAM,SAAS,gBAAgB,GAAG,gBAAgB,IAClF,CAAC,OAAO,EAAE,oBAAoB,CAAC,MAAM,CAAC,KAAK,MAAM,CAAA;AAEnD,MAAM,MAAM,uBAAuB,CAAC,MAAM,SAAS,gBAAgB,GAAG,gBAAgB,IACpF,CAAC,OAAO,EAAE,o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InNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90eXBlcy9jb250ZXh0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIifQ==
@@ -0,0 +1,4 @@
1
+ export type * from './commit.js';
2
+ export type * from './context.js';
3
+ export type * from './utils.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,aAAa,CAAA;AAChC,mBAAmB,cAAc,CAAA;AACjC,mBAAmB,YAAY,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdHlwZXMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
@@ -0,0 +1,2 @@
1
+ export type AnyObject = Record<string, any>;
2
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/types/utils.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdHlwZXMvdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@conventional-changelog/template",
3
+ "type": "module",
4
+ "version": "1.4.0",
5
+ "description": "Template utilities for conventional changelog generation.",
6
+ "author": {
7
+ "name": "Dan Onoshko",
8
+ "email": "danon0404@gmail.com",
9
+ "url": "https://github.com/dangreen"
10
+ },
11
+ "license": "MIT",
12
+ "homepage": "https://conventional-changelog.js.org/template/",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "https://github.com/conventional-changelog/conventional-changelog.git",
16
+ "directory": "packages/template"
17
+ },
18
+ "bugs": {
19
+ "url": "https://github.com/conventional-changelog/conventional-changelog/issues"
20
+ },
21
+ "keywords": [
22
+ "conventional-changelog",
23
+ "changelog",
24
+ "template",
25
+ "render",
26
+ "helpers"
27
+ ],
28
+ "engines": {
29
+ "node": ">=22"
30
+ },
31
+ "exports": {
32
+ "types": "./dist/index.d.ts",
33
+ "import": "./dist/index.js"
34
+ },
35
+ "files": [
36
+ "dist"
37
+ ]
38
+ }
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 - present, TrigenSoftware
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 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,79 @@
1
+ # @simple-libs/stream-utils
2
+
3
+ [![ESM-only package][package]][package-url]
4
+ [![NPM version][npm]][npm-url]
5
+ [![Node version][node]][node-url]
6
+ [![Dependencies status][deps]][deps-url]
7
+ [![Install size][size]][size-url]
8
+ [![Build status][build]][build-url]
9
+ [![Coverage status][coverage]][coverage-url]
10
+
11
+ [package]: https://img.shields.io/badge/package-ESM--only-ffe536.svg
12
+ [package-url]: https://nodejs.org/api/esm.html
13
+
14
+ [npm]: https://img.shields.io/npm/v/@simple-libs/stream-utils.svg
15
+ [npm-url]: https://www.npmjs.com/package/@simple-libs/stream-utils
16
+
17
+ [node]: https://img.shields.io/node/v/@simple-libs/stream-utils.svg
18
+ [node-url]: https://nodejs.org
19
+
20
+ [deps]: https://img.shields.io/librariesio/release/npm/@simple-libs/stream-utils
21
+ [deps-url]: https://libraries.io/npm/@simple-libs%2Fstream-utils
22
+
23
+ [size]: https://packagephobia.com/badge?p=@simple-libs/stream-utils
24
+ [size-url]: https://packagephobia.com/result?p=@simple-libs/stream-utils
25
+
26
+ [build]: https://img.shields.io/github/actions/workflow/status/TrigenSoftware/simple-libs/tests.yml?branch=main
27
+ [build-url]: https://github.com/TrigenSoftware/simple-libs/actions
28
+
29
+ [coverage]: https://coveralls.io/repos/github/TrigenSoftware/simple-libs/badge.svg?branch=main
30
+ [coverage-url]: https://coveralls.io/github/TrigenSoftware/simple-libs?branch=main
31
+
32
+ A small set of utilities for streams.
33
+
34
+ ## Install
35
+
36
+ ```bash
37
+ # pnpm
38
+ pnpm add @simple-libs/stream-utils
39
+ # yarn
40
+ yarn add @simple-libs/stream-utils
41
+ # npm
42
+ npm i @simple-libs/stream-utils
43
+ ```
44
+
45
+ ## Usage
46
+
47
+ ```ts
48
+ import {
49
+ toArray,
50
+ concatBufferStream,
51
+ concatStringStream,
52
+ firstFromStream,
53
+ mergeReadables
54
+ } from '@simple-libs/stream-utils'
55
+
56
+ // Convert a readable stream to an array
57
+ await toArray(Readable.from(['foo', 'bar', 'baz']))
58
+ // Returns ['foo', 'bar', 'baz']
59
+
60
+ // Concatenate a stream of buffers into a single buffer
61
+ await concatBufferStream(Readable.from([Buffer.from('foo'), Buffer.from('bar')]))
62
+ // Returns <Buffer 66 6f 6f 62 61 72>
63
+
64
+ // Concatenate a stream of strings into a single string
65
+ await concatStringStream(Readable.from(['foo', 'bar']))
66
+ // Returns 'foobar'
67
+
68
+ // Get the first value from a stream
69
+ await firstFromStream(Readable.from(['foo', 'bar']))
70
+ // Returns 'foo'
71
+
72
+ // Merges multiple Readable streams into a single Readable stream.
73
+ // Each chunk will be an object containing the source stream name and the chunk data.
74
+ await mergeReadables({
75
+ foo: Readable.from(['foo1', 'foo2']),
76
+ bar: Readable.from(['bar1', 'bar2'])
77
+ })
78
+ // Returns [{ source: 'foo', chunk: 'foo1' }, { source: 'foo', chunk: 'foo2' }, { source: 'bar', chunk: 'bar1' }, { source: 'bar', chunk: 'bar2' }]
79
+ ```
@@ -0,0 +1,51 @@
1
+ import { Readable } from 'stream';
2
+ /**
3
+ * Get all items from an async iterable and return them as an array.
4
+ * @param iterable
5
+ * @returns A promise that resolves to an array of items.
6
+ */
7
+ export declare function toArray<T>(iterable: AsyncIterable<T>): Promise<T[]>;
8
+ /**
9
+ * Concatenate all buffers from an async iterable into a single Buffer.
10
+ * @param iterable
11
+ * @returns A promise that resolves to a single Buffer containing all concatenated buffers.
12
+ */
13
+ export declare function concatBufferStream(iterable: AsyncIterable<Buffer>): Promise<Buffer<ArrayBuffer>>;
14
+ /**
15
+ * Concatenate all strings from an async iterable into a single string.
16
+ * @param iterable
17
+ * @returns A promise that resolves to a single string containing all concatenated strings.
18
+ */
19
+ export declare function concatStringStream(iterable: AsyncIterable<string>): Promise<string>;
20
+ /**
21
+ * Get the first item from an async iterable.
22
+ * @param stream
23
+ * @returns A promise that resolves to the first item, or null if the iterable is empty.
24
+ */
25
+ export declare function firstFromStream<T>(stream: AsyncIterable<T>): Promise<T | null>;
26
+ export interface MergedReadableChunk<K extends string, T = Buffer> {
27
+ source: K;
28
+ chunk: T;
29
+ }
30
+ /**
31
+ * Merges multiple Readable streams into a single Readable stream.
32
+ * Each chunk will be an object containing the source stream name and the chunk data.
33
+ * @param streams - An object where keys are stream names and values are Readable streams.
34
+ * @returns A merged Readable stream.
35
+ */
36
+ export declare function mergeReadables<K extends string, T = Buffer>(streams: Record<K, Readable>): Readable & AsyncIterable<MergedReadableChunk<K, T>>;
37
+ /**
38
+ * Split stream by separator.
39
+ * @param stream
40
+ * @param separator
41
+ * @yields String chunks.
42
+ */
43
+ export declare function splitStream(stream: AsyncIterable<string | Buffer>, separator: string): AsyncGenerator<string, void, unknown>;
44
+ /**
45
+ * Parse JSON objects from a stream, separated by a delimiter (default is newline).
46
+ * @param stream
47
+ * @param delimiter
48
+ * @yields Parsed JSON objects of type T.
49
+ */
50
+ export declare function parseJsonStream<T>(stream: AsyncIterable<string | Buffer>, delimiter?: RegExp): AsyncGenerator<Awaited<T>, void, unknown>;
51
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAEjC;;;;GAIG;AACH,wBAAsB,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CAQzE;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,gCAEvE;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,mBAEvE;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,qBAMhE;AAED,MAAM,WAAW,mBAAmB,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,GAAG,MAAM;IAC/D,MAAM,EAAE,CAAC,CAAA;IACT,KAAK,EAAE,CAAC,CAAA;CACT;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,CAAC,SAAS,MAAM,EAChB,CAAC,GAAG,MAAM,EAEV,OAAO,EAAE,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,GAC3B,QAAQ,GAAG,aAAa,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAwBrD;AAED;;;;;GAKG;AACH,wBAAuB,WAAW,CAChC,MAAM,EAAE,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC,EACtC,SAAS,EAAE,MAAM,yCAoBlB;AAED;;;;;GAKG;AACH,wBAAuB,eAAe,CAAC,CAAC,EACtC,MAAM,EAAE,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC,EACtC,SAAS,SAAU,6CAuBpB"}