@hyperfrontend/versioning 0.1.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 (353) hide show
  1. package/ARCHITECTURE.md +593 -0
  2. package/CHANGELOG.md +35 -0
  3. package/FUNDING.md +141 -0
  4. package/LICENSE.md +21 -0
  5. package/README.md +195 -0
  6. package/SECURITY.md +82 -0
  7. package/changelog/compare/diff.d.ts +128 -0
  8. package/changelog/compare/diff.d.ts.map +1 -0
  9. package/changelog/compare/index.cjs.js +628 -0
  10. package/changelog/compare/index.cjs.js.map +1 -0
  11. package/changelog/compare/index.d.ts +4 -0
  12. package/changelog/compare/index.d.ts.map +1 -0
  13. package/changelog/compare/index.esm.js +612 -0
  14. package/changelog/compare/index.esm.js.map +1 -0
  15. package/changelog/compare/is-equal.d.ts +114 -0
  16. package/changelog/compare/is-equal.d.ts.map +1 -0
  17. package/changelog/index.cjs.js +6448 -0
  18. package/changelog/index.cjs.js.map +1 -0
  19. package/changelog/index.d.ts +6 -0
  20. package/changelog/index.d.ts.map +1 -0
  21. package/changelog/index.esm.js +6358 -0
  22. package/changelog/index.esm.js.map +1 -0
  23. package/changelog/models/changelog.d.ts +86 -0
  24. package/changelog/models/changelog.d.ts.map +1 -0
  25. package/changelog/models/commit-ref.d.ts +51 -0
  26. package/changelog/models/commit-ref.d.ts.map +1 -0
  27. package/changelog/models/entry.d.ts +84 -0
  28. package/changelog/models/entry.d.ts.map +1 -0
  29. package/changelog/models/index.cjs.js +2043 -0
  30. package/changelog/models/index.cjs.js.map +1 -0
  31. package/changelog/models/index.d.ts +11 -0
  32. package/changelog/models/index.d.ts.map +1 -0
  33. package/changelog/models/index.esm.js +2026 -0
  34. package/changelog/models/index.esm.js.map +1 -0
  35. package/changelog/models/schema.d.ts +68 -0
  36. package/changelog/models/schema.d.ts.map +1 -0
  37. package/changelog/models/section.d.ts +25 -0
  38. package/changelog/models/section.d.ts.map +1 -0
  39. package/changelog/operations/add-entry.d.ts +56 -0
  40. package/changelog/operations/add-entry.d.ts.map +1 -0
  41. package/changelog/operations/add-item.d.ts +18 -0
  42. package/changelog/operations/add-item.d.ts.map +1 -0
  43. package/changelog/operations/filter-by-predicate.d.ts +81 -0
  44. package/changelog/operations/filter-by-predicate.d.ts.map +1 -0
  45. package/changelog/operations/filter-by-range.d.ts +63 -0
  46. package/changelog/operations/filter-by-range.d.ts.map +1 -0
  47. package/changelog/operations/filter-entries.d.ts +9 -0
  48. package/changelog/operations/filter-entries.d.ts.map +1 -0
  49. package/changelog/operations/index.cjs.js +2455 -0
  50. package/changelog/operations/index.cjs.js.map +1 -0
  51. package/changelog/operations/index.d.ts +15 -0
  52. package/changelog/operations/index.d.ts.map +1 -0
  53. package/changelog/operations/index.esm.js +2411 -0
  54. package/changelog/operations/index.esm.js.map +1 -0
  55. package/changelog/operations/merge.d.ts +88 -0
  56. package/changelog/operations/merge.d.ts.map +1 -0
  57. package/changelog/operations/remove-entry.d.ts +45 -0
  58. package/changelog/operations/remove-entry.d.ts.map +1 -0
  59. package/changelog/operations/remove-section.d.ts +50 -0
  60. package/changelog/operations/remove-section.d.ts.map +1 -0
  61. package/changelog/operations/transform.d.ts +143 -0
  62. package/changelog/operations/transform.d.ts.map +1 -0
  63. package/changelog/parse/index.cjs.js +1282 -0
  64. package/changelog/parse/index.cjs.js.map +1 -0
  65. package/changelog/parse/index.d.ts +5 -0
  66. package/changelog/parse/index.d.ts.map +1 -0
  67. package/changelog/parse/index.esm.js +1275 -0
  68. package/changelog/parse/index.esm.js.map +1 -0
  69. package/changelog/parse/line.d.ts +48 -0
  70. package/changelog/parse/line.d.ts.map +1 -0
  71. package/changelog/parse/parser.d.ts +16 -0
  72. package/changelog/parse/parser.d.ts.map +1 -0
  73. package/changelog/parse/tokenizer.d.ts +49 -0
  74. package/changelog/parse/tokenizer.d.ts.map +1 -0
  75. package/changelog/serialize/index.cjs.js +574 -0
  76. package/changelog/serialize/index.cjs.js.map +1 -0
  77. package/changelog/serialize/index.d.ts +6 -0
  78. package/changelog/serialize/index.d.ts.map +1 -0
  79. package/changelog/serialize/index.esm.js +564 -0
  80. package/changelog/serialize/index.esm.js.map +1 -0
  81. package/changelog/serialize/templates.d.ts +81 -0
  82. package/changelog/serialize/templates.d.ts.map +1 -0
  83. package/changelog/serialize/to-json.d.ts +57 -0
  84. package/changelog/serialize/to-json.d.ts.map +1 -0
  85. package/changelog/serialize/to-string.d.ts +30 -0
  86. package/changelog/serialize/to-string.d.ts.map +1 -0
  87. package/commits/index.cjs.js +648 -0
  88. package/commits/index.cjs.js.map +1 -0
  89. package/commits/index.d.ts +3 -0
  90. package/commits/index.d.ts.map +1 -0
  91. package/commits/index.esm.js +629 -0
  92. package/commits/index.esm.js.map +1 -0
  93. package/commits/models/breaking.d.ts +39 -0
  94. package/commits/models/breaking.d.ts.map +1 -0
  95. package/commits/models/commit-type.d.ts +32 -0
  96. package/commits/models/commit-type.d.ts.map +1 -0
  97. package/commits/models/conventional.d.ts +49 -0
  98. package/commits/models/conventional.d.ts.map +1 -0
  99. package/commits/models/index.cjs.js +207 -0
  100. package/commits/models/index.cjs.js.map +1 -0
  101. package/commits/models/index.d.ts +7 -0
  102. package/commits/models/index.d.ts.map +1 -0
  103. package/commits/models/index.esm.js +193 -0
  104. package/commits/models/index.esm.js.map +1 -0
  105. package/commits/parse/body.d.ts +18 -0
  106. package/commits/parse/body.d.ts.map +1 -0
  107. package/commits/parse/footer.d.ts +16 -0
  108. package/commits/parse/footer.d.ts.map +1 -0
  109. package/commits/parse/header.d.ts +15 -0
  110. package/commits/parse/header.d.ts.map +1 -0
  111. package/commits/parse/index.cjs.js +505 -0
  112. package/commits/parse/index.cjs.js.map +1 -0
  113. package/commits/parse/index.d.ts +5 -0
  114. package/commits/parse/index.d.ts.map +1 -0
  115. package/commits/parse/index.esm.js +499 -0
  116. package/commits/parse/index.esm.js.map +1 -0
  117. package/commits/parse/message.d.ts +17 -0
  118. package/commits/parse/message.d.ts.map +1 -0
  119. package/commits/utils/replace-char.d.ts +19 -0
  120. package/commits/utils/replace-char.d.ts.map +1 -0
  121. package/flow/executor/execute.d.ts +72 -0
  122. package/flow/executor/execute.d.ts.map +1 -0
  123. package/flow/executor/index.cjs.js +4402 -0
  124. package/flow/executor/index.cjs.js.map +1 -0
  125. package/flow/executor/index.d.ts +3 -0
  126. package/flow/executor/index.d.ts.map +1 -0
  127. package/flow/executor/index.esm.js +4398 -0
  128. package/flow/executor/index.esm.js.map +1 -0
  129. package/flow/factory.d.ts +58 -0
  130. package/flow/factory.d.ts.map +1 -0
  131. package/flow/index.cjs.js +8506 -0
  132. package/flow/index.cjs.js.map +1 -0
  133. package/flow/index.d.ts +7 -0
  134. package/flow/index.d.ts.map +1 -0
  135. package/flow/index.esm.js +8451 -0
  136. package/flow/index.esm.js.map +1 -0
  137. package/flow/models/flow.d.ts +130 -0
  138. package/flow/models/flow.d.ts.map +1 -0
  139. package/flow/models/index.cjs.js +285 -0
  140. package/flow/models/index.cjs.js.map +1 -0
  141. package/flow/models/index.d.ts +7 -0
  142. package/flow/models/index.d.ts.map +1 -0
  143. package/flow/models/index.esm.js +268 -0
  144. package/flow/models/index.esm.js.map +1 -0
  145. package/flow/models/step.d.ts +108 -0
  146. package/flow/models/step.d.ts.map +1 -0
  147. package/flow/models/types.d.ts +150 -0
  148. package/flow/models/types.d.ts.map +1 -0
  149. package/flow/presets/conventional.d.ts +59 -0
  150. package/flow/presets/conventional.d.ts.map +1 -0
  151. package/flow/presets/independent.d.ts +61 -0
  152. package/flow/presets/independent.d.ts.map +1 -0
  153. package/flow/presets/index.cjs.js +3903 -0
  154. package/flow/presets/index.cjs.js.map +1 -0
  155. package/flow/presets/index.d.ts +4 -0
  156. package/flow/presets/index.d.ts.map +1 -0
  157. package/flow/presets/index.esm.js +3889 -0
  158. package/flow/presets/index.esm.js.map +1 -0
  159. package/flow/presets/synced.d.ts +65 -0
  160. package/flow/presets/synced.d.ts.map +1 -0
  161. package/flow/steps/analyze-commits.d.ts +19 -0
  162. package/flow/steps/analyze-commits.d.ts.map +1 -0
  163. package/flow/steps/calculate-bump.d.ts +27 -0
  164. package/flow/steps/calculate-bump.d.ts.map +1 -0
  165. package/flow/steps/create-commit.d.ts +16 -0
  166. package/flow/steps/create-commit.d.ts.map +1 -0
  167. package/flow/steps/create-tag.d.ts +22 -0
  168. package/flow/steps/create-tag.d.ts.map +1 -0
  169. package/flow/steps/fetch-registry.d.ts +19 -0
  170. package/flow/steps/fetch-registry.d.ts.map +1 -0
  171. package/flow/steps/generate-changelog.d.ts +25 -0
  172. package/flow/steps/generate-changelog.d.ts.map +1 -0
  173. package/flow/steps/index.cjs.js +3523 -0
  174. package/flow/steps/index.cjs.js.map +1 -0
  175. package/flow/steps/index.d.ts +8 -0
  176. package/flow/steps/index.d.ts.map +1 -0
  177. package/flow/steps/index.esm.js +3504 -0
  178. package/flow/steps/index.esm.js.map +1 -0
  179. package/flow/steps/update-packages.d.ts +25 -0
  180. package/flow/steps/update-packages.d.ts.map +1 -0
  181. package/flow/utils/interpolate.d.ts +11 -0
  182. package/flow/utils/interpolate.d.ts.map +1 -0
  183. package/git/factory.d.ts +233 -0
  184. package/git/factory.d.ts.map +1 -0
  185. package/git/index.cjs.js +2863 -0
  186. package/git/index.cjs.js.map +1 -0
  187. package/git/index.d.ts +5 -0
  188. package/git/index.d.ts.map +1 -0
  189. package/git/index.esm.js +2785 -0
  190. package/git/index.esm.js.map +1 -0
  191. package/git/models/commit.d.ts +129 -0
  192. package/git/models/commit.d.ts.map +1 -0
  193. package/git/models/index.cjs.js +755 -0
  194. package/git/models/index.cjs.js.map +1 -0
  195. package/git/models/index.d.ts +7 -0
  196. package/git/models/index.d.ts.map +1 -0
  197. package/git/models/index.esm.js +729 -0
  198. package/git/models/index.esm.js.map +1 -0
  199. package/git/models/ref.d.ts +120 -0
  200. package/git/models/ref.d.ts.map +1 -0
  201. package/git/models/tag.d.ts +141 -0
  202. package/git/models/tag.d.ts.map +1 -0
  203. package/git/operations/commit.d.ts +97 -0
  204. package/git/operations/commit.d.ts.map +1 -0
  205. package/git/operations/head-info.d.ts +29 -0
  206. package/git/operations/head-info.d.ts.map +1 -0
  207. package/git/operations/index.cjs.js +1954 -0
  208. package/git/operations/index.cjs.js.map +1 -0
  209. package/git/operations/index.d.ts +14 -0
  210. package/git/operations/index.d.ts.map +1 -0
  211. package/git/operations/index.esm.js +1903 -0
  212. package/git/operations/index.esm.js.map +1 -0
  213. package/git/operations/log.d.ts +104 -0
  214. package/git/operations/log.d.ts.map +1 -0
  215. package/git/operations/manage-tags.d.ts +60 -0
  216. package/git/operations/manage-tags.d.ts.map +1 -0
  217. package/git/operations/query-tags.d.ts +88 -0
  218. package/git/operations/query-tags.d.ts.map +1 -0
  219. package/git/operations/stage.d.ts +66 -0
  220. package/git/operations/stage.d.ts.map +1 -0
  221. package/git/operations/status.d.ts +173 -0
  222. package/git/operations/status.d.ts.map +1 -0
  223. package/index.cjs.js +16761 -0
  224. package/index.cjs.js.map +1 -0
  225. package/index.d.ts +102 -0
  226. package/index.d.ts.map +1 -0
  227. package/index.esm.js +16427 -0
  228. package/index.esm.js.map +1 -0
  229. package/package.json +200 -0
  230. package/registry/factory.d.ts +18 -0
  231. package/registry/factory.d.ts.map +1 -0
  232. package/registry/index.cjs.js +543 -0
  233. package/registry/index.cjs.js.map +1 -0
  234. package/registry/index.d.ts +5 -0
  235. package/registry/index.d.ts.map +1 -0
  236. package/registry/index.esm.js +535 -0
  237. package/registry/index.esm.js.map +1 -0
  238. package/registry/models/index.cjs.js +69 -0
  239. package/registry/models/index.cjs.js.map +1 -0
  240. package/registry/models/index.d.ts +6 -0
  241. package/registry/models/index.d.ts.map +1 -0
  242. package/registry/models/index.esm.js +66 -0
  243. package/registry/models/index.esm.js.map +1 -0
  244. package/registry/models/package-info.d.ts +55 -0
  245. package/registry/models/package-info.d.ts.map +1 -0
  246. package/registry/models/registry.d.ts +62 -0
  247. package/registry/models/registry.d.ts.map +1 -0
  248. package/registry/models/version-info.d.ts +67 -0
  249. package/registry/models/version-info.d.ts.map +1 -0
  250. package/registry/npm/cache.d.ts +50 -0
  251. package/registry/npm/cache.d.ts.map +1 -0
  252. package/registry/npm/client.d.ts +30 -0
  253. package/registry/npm/client.d.ts.map +1 -0
  254. package/registry/npm/index.cjs.js +456 -0
  255. package/registry/npm/index.cjs.js.map +1 -0
  256. package/registry/npm/index.d.ts +4 -0
  257. package/registry/npm/index.d.ts.map +1 -0
  258. package/registry/npm/index.esm.js +451 -0
  259. package/registry/npm/index.esm.js.map +1 -0
  260. package/semver/compare/compare.d.ts +100 -0
  261. package/semver/compare/compare.d.ts.map +1 -0
  262. package/semver/compare/index.cjs.js +386 -0
  263. package/semver/compare/index.cjs.js.map +1 -0
  264. package/semver/compare/index.d.ts +3 -0
  265. package/semver/compare/index.d.ts.map +1 -0
  266. package/semver/compare/index.esm.js +370 -0
  267. package/semver/compare/index.esm.js.map +1 -0
  268. package/semver/compare/sort.d.ts +36 -0
  269. package/semver/compare/sort.d.ts.map +1 -0
  270. package/semver/format/index.cjs.js +58 -0
  271. package/semver/format/index.cjs.js.map +1 -0
  272. package/semver/format/index.d.ts +2 -0
  273. package/semver/format/index.d.ts.map +1 -0
  274. package/semver/format/index.esm.js +53 -0
  275. package/semver/format/index.esm.js.map +1 -0
  276. package/semver/format/to-string.d.ts +31 -0
  277. package/semver/format/to-string.d.ts.map +1 -0
  278. package/semver/increment/bump.d.ts +37 -0
  279. package/semver/increment/bump.d.ts.map +1 -0
  280. package/semver/increment/index.cjs.js +223 -0
  281. package/semver/increment/index.cjs.js.map +1 -0
  282. package/semver/increment/index.d.ts +2 -0
  283. package/semver/increment/index.d.ts.map +1 -0
  284. package/semver/increment/index.esm.js +219 -0
  285. package/semver/increment/index.esm.js.map +1 -0
  286. package/semver/index.cjs.js +1499 -0
  287. package/semver/index.cjs.js.map +1 -0
  288. package/semver/index.d.ts +6 -0
  289. package/semver/index.d.ts.map +1 -0
  290. package/semver/index.esm.js +1458 -0
  291. package/semver/index.esm.js.map +1 -0
  292. package/semver/models/index.cjs.js +153 -0
  293. package/semver/models/index.cjs.js.map +1 -0
  294. package/semver/models/index.d.ts +5 -0
  295. package/semver/models/index.d.ts.map +1 -0
  296. package/semver/models/index.esm.js +139 -0
  297. package/semver/models/index.esm.js.map +1 -0
  298. package/semver/models/range.d.ts +83 -0
  299. package/semver/models/range.d.ts.map +1 -0
  300. package/semver/models/version.d.ts +78 -0
  301. package/semver/models/version.d.ts.map +1 -0
  302. package/semver/parse/index.cjs.js +799 -0
  303. package/semver/parse/index.cjs.js.map +1 -0
  304. package/semver/parse/index.d.ts +5 -0
  305. package/semver/parse/index.d.ts.map +1 -0
  306. package/semver/parse/index.esm.js +793 -0
  307. package/semver/parse/index.esm.js.map +1 -0
  308. package/semver/parse/range.d.ts +38 -0
  309. package/semver/parse/range.d.ts.map +1 -0
  310. package/semver/parse/version.d.ts +49 -0
  311. package/semver/parse/version.d.ts.map +1 -0
  312. package/workspace/discovery/changelog-path.d.ts +21 -0
  313. package/workspace/discovery/changelog-path.d.ts.map +1 -0
  314. package/workspace/discovery/dependencies.d.ts +145 -0
  315. package/workspace/discovery/dependencies.d.ts.map +1 -0
  316. package/workspace/discovery/discover-changelogs.d.ts +76 -0
  317. package/workspace/discovery/discover-changelogs.d.ts.map +1 -0
  318. package/workspace/discovery/index.cjs.js +2300 -0
  319. package/workspace/discovery/index.cjs.js.map +1 -0
  320. package/workspace/discovery/index.d.ts +13 -0
  321. package/workspace/discovery/index.d.ts.map +1 -0
  322. package/workspace/discovery/index.esm.js +2283 -0
  323. package/workspace/discovery/index.esm.js.map +1 -0
  324. package/workspace/discovery/packages.d.ts +83 -0
  325. package/workspace/discovery/packages.d.ts.map +1 -0
  326. package/workspace/index.cjs.js +4445 -0
  327. package/workspace/index.cjs.js.map +1 -0
  328. package/workspace/index.d.ts +52 -0
  329. package/workspace/index.d.ts.map +1 -0
  330. package/workspace/index.esm.js +4394 -0
  331. package/workspace/index.esm.js.map +1 -0
  332. package/workspace/models/index.cjs.js +284 -0
  333. package/workspace/models/index.cjs.js.map +1 -0
  334. package/workspace/models/index.d.ts +10 -0
  335. package/workspace/models/index.d.ts.map +1 -0
  336. package/workspace/models/index.esm.js +261 -0
  337. package/workspace/models/index.esm.js.map +1 -0
  338. package/workspace/models/project.d.ts +118 -0
  339. package/workspace/models/project.d.ts.map +1 -0
  340. package/workspace/models/workspace.d.ts +139 -0
  341. package/workspace/models/workspace.d.ts.map +1 -0
  342. package/workspace/operations/batch-update.d.ts +99 -0
  343. package/workspace/operations/batch-update.d.ts.map +1 -0
  344. package/workspace/operations/cascade-bump.d.ts +125 -0
  345. package/workspace/operations/cascade-bump.d.ts.map +1 -0
  346. package/workspace/operations/index.cjs.js +2675 -0
  347. package/workspace/operations/index.cjs.js.map +1 -0
  348. package/workspace/operations/index.d.ts +12 -0
  349. package/workspace/operations/index.d.ts.map +1 -0
  350. package/workspace/operations/index.esm.js +2663 -0
  351. package/workspace/operations/index.esm.js.map +1 -0
  352. package/workspace/operations/validate.d.ts +85 -0
  353. package/workspace/operations/validate.d.ts.map +1 -0
@@ -0,0 +1,593 @@
1
+ # Architecture
2
+
3
+ This document describes the internal architecture of `@hyperfrontend/versioning`. For usage examples and quick start guides, see the main [README.md](./README.md).
4
+
5
+ ## Table of Contents
6
+
7
+ - [Design Principles](#design-principles)
8
+ - [Module Composition](#module-composition)
9
+ - [Data Flow](#data-flow)
10
+ - [Core Types](#core-types)
11
+ - [Security Architecture](#security-architecture)
12
+ - [Module Details](#module-details)
13
+
14
+ ---
15
+
16
+ ## Design Principles
17
+
18
+ ### 1. Purely Functional Architecture
19
+
20
+ All operations are implemented as pure functions. State is never mutated—instead, new objects are returned from each operation.
21
+
22
+ ```typescript
23
+ // ✅ Pure function - returns new object
24
+ function incrementVersion(version: ParsedVersion, type: ReleaseType): ParsedVersion
25
+
26
+ // ❌ Never mutate - this pattern does not exist in this library
27
+ function updateVersion(version: ParsedVersion, type: ReleaseType): void
28
+ ```
29
+
30
+ ### 2. Factory Functions Over Classes
31
+
32
+ All complex objects are created via factory functions rather than class constructors. This simplifies testing, enables tree-shaking, and avoids `this` binding issues.
33
+
34
+ ```typescript
35
+ // Factory function pattern used throughout
36
+ const context = createFlowContext({ workspaceRoot, projectName })
37
+ const client = createGitClient({ tree, workspaceRoot })
38
+ ```
39
+
40
+ ### 3. State Machine Parsing
41
+
42
+ All parsing uses character-by-character state machines with O(n) complexity, ensuring predictable performance regardless of input patterns.
43
+
44
+ ```mermaid
45
+ flowchart LR
46
+ Input[Raw Input] --> Tokenizer[State Machine Tokenizer]
47
+ Tokenizer --> Tokens[Token Stream]
48
+ Tokens --> Parser[Token Parser]
49
+ Parser --> AST[Structured Data]
50
+ ```
51
+
52
+ ### 4. Explicit Error Handling
53
+
54
+ Functions return discriminated unions or throw typed errors. No silent failures.
55
+
56
+ ```typescript
57
+ type ParseResult<T> = { success: true; value: T } | { success: false; error: ParseError }
58
+ ```
59
+
60
+ ### 5. Composition Over Configuration
61
+
62
+ Complex operations are built by composing simple functions rather than through configuration objects with many options.
63
+
64
+ ---
65
+
66
+ ## Module Composition
67
+
68
+ The library is organized into seven focused modules that compose together:
69
+
70
+ ```mermaid
71
+ graph TB
72
+ subgraph "Orchestration Layer"
73
+ flow[flow/]
74
+ end
75
+
76
+ subgraph "Domain Modules"
77
+ changelog[changelog/]
78
+ commits[commits/]
79
+ semver[semver/]
80
+ registry[registry/]
81
+ end
82
+
83
+ subgraph "Infrastructure Modules"
84
+ git[git/]
85
+ workspace[workspace/]
86
+ end
87
+
88
+ flow --> changelog
89
+ flow --> commits
90
+ flow --> semver
91
+ flow --> registry
92
+ flow --> git
93
+ flow --> workspace
94
+
95
+ changelog --> semver
96
+ commits --> changelog
97
+ registry --> semver
98
+ git --> workspace
99
+
100
+ style flow fill:#e1f5fe
101
+ style changelog fill:#fff3e0
102
+ style commits fill:#fff3e0
103
+ style semver fill:#fff3e0
104
+ style registry fill:#fff3e0
105
+ style git fill:#f3e5f5
106
+ style workspace fill:#f3e5f5
107
+ ```
108
+
109
+ ### Module Hierarchy
110
+
111
+ | Layer | Modules | Responsibility |
112
+ | -------------- | ------------------------------------------------ | ---------------------------------- |
113
+ | Orchestration | `flow/` | Version release workflow execution |
114
+ | Domain | `changelog/`, `commits/`, `semver/`, `registry/` | Core versioning logic |
115
+ | Infrastructure | `git/`, `workspace/` | File system and git operations |
116
+
117
+ ---
118
+
119
+ ## Data Flow
120
+
121
+ ### Version Release Flow
122
+
123
+ The primary use case—releasing a new version—flows through multiple modules:
124
+
125
+ ```mermaid
126
+ sequenceDiagram
127
+ participant User
128
+ participant Flow as flow/
129
+ participant Git as git/
130
+ participant Commits as commits/
131
+ participant Semver as semver/
132
+ participant Changelog as changelog/
133
+ participant Registry as registry/
134
+ participant Workspace as workspace/
135
+
136
+ User->>Flow: executeVersionFlow(context)
137
+ Flow->>Workspace: discoverProjects()
138
+ Workspace-->>Flow: projects[]
139
+
140
+ Flow->>Git: getCommitsSince(lastTag)
141
+ Git-->>Flow: commits[]
142
+
143
+ Flow->>Commits: parseConventionalCommits(commits)
144
+ Commits-->>Flow: parsedCommits[]
145
+
146
+ Flow->>Semver: determineVersionBump(parsedCommits)
147
+ Semver-->>Flow: ReleaseType
148
+
149
+ Flow->>Semver: incrementVersion(current, releaseType)
150
+ Semver-->>Flow: newVersion
151
+
152
+ Flow->>Registry: checkVersionAvailable(newVersion)
153
+ Registry-->>Flow: boolean
154
+
155
+ Flow->>Changelog: generateEntry(parsedCommits, newVersion)
156
+ Changelog-->>Flow: ChangelogEntry
157
+
158
+ Flow->>Workspace: updatePackageJson(newVersion)
159
+ Flow->>Workspace: updateChangelog(entry)
160
+
161
+ Flow->>Git: commitAndTag(newVersion)
162
+
163
+ Flow-->>User: FlowResult
164
+ ```
165
+
166
+ ### Changelog Parsing Pipeline
167
+
168
+ ```mermaid
169
+ flowchart LR
170
+ MD["CHANGELOG.md"] --> tokenize["tokenize()"]
171
+ tokenize --> tokens["Token[ ]"]
172
+ tokens --> parseTokens["parseTokens()"]
173
+ parseTokens --> ast["Changelog AST"]
174
+ ast --> buildChangelog["buildChangelog()"]
175
+ buildChangelog --> format["Format Detection"]
176
+ format --> changelog["Changelog Object"]
177
+ ```
178
+
179
+ ### Conventional Commit Parsing
180
+
181
+ ```mermaid
182
+ flowchart TD
183
+ input["feat(scope)!: description\n\nBody text\n\nBREAKING CHANGE: details"]
184
+
185
+ subgraph "Header Parsing"
186
+ type[Type: feat]
187
+ scope[Scope: scope]
188
+ breaking1[Breaking: !]
189
+ subject[Subject: description]
190
+ end
191
+
192
+ subgraph "Body Parsing"
193
+ body[Body: Body text]
194
+ end
195
+
196
+ subgraph "Footer Parsing"
197
+ footer[Footer: BREAKING CHANGE]
198
+ breaking2[Breaking Details: details]
199
+ end
200
+
201
+ input --> type
202
+ input --> scope
203
+ input --> breaking1
204
+ input --> subject
205
+ input --> body
206
+ input --> footer
207
+ footer --> breaking2
208
+
209
+ type --> result[ConventionalCommit]
210
+ scope --> result
211
+ breaking1 --> result
212
+ subject --> result
213
+ body --> result
214
+ breaking2 --> result
215
+ ```
216
+
217
+ ---
218
+
219
+ ## Core Types
220
+
221
+ ### Central Type Relationships
222
+
223
+ ```mermaid
224
+ classDiagram
225
+ class Changelog {
226
+ +title: string
227
+ +description: string
228
+ +entries: ChangelogEntry[]
229
+ +metadata: ChangelogMetadata
230
+ }
231
+
232
+ class ChangelogEntry {
233
+ +version: string
234
+ +date: string
235
+ +sections: ChangelogSection[]
236
+ +yanked: boolean
237
+ }
238
+
239
+ class ChangelogSection {
240
+ +heading: SectionHeading
241
+ +items: ChangelogItem[]
242
+ }
243
+
244
+ class ChangelogItem {
245
+ +content: string
246
+ +scope: string
247
+ +references: Reference[]
248
+ }
249
+
250
+ class ConventionalCommit {
251
+ +type: CommitType
252
+ +scope: string
253
+ +subject: string
254
+ +body: string
255
+ +breaking: boolean
256
+ +footers: CommitFooter[]
257
+ }
258
+
259
+ class ParsedVersion {
260
+ +major: number
261
+ +minor: number
262
+ +patch: number
263
+ +prerelease: string[]
264
+ +build: string[]
265
+ }
266
+
267
+ class FlowContext {
268
+ +workspaceRoot: string
269
+ +projectName: string
270
+ +tree: Tree
271
+ +logger: Logger
272
+ +gitClient: GitClient
273
+ }
274
+
275
+ Changelog "1" *-- "*" ChangelogEntry
276
+ ChangelogEntry "1" *-- "*" ChangelogSection
277
+ ChangelogSection "1" *-- "*" ChangelogItem
278
+ ConventionalCommit ..> ChangelogItem : generates
279
+ ParsedVersion ..> ChangelogEntry : version field
280
+ FlowContext ..> Changelog : orchestrates
281
+ ```
282
+
283
+ ### Type Categories
284
+
285
+ | Category | Types | Location |
286
+ | --------- | ------------------------------------------------------------------ | ------------ |
287
+ | Changelog | `Changelog`, `ChangelogEntry`, `ChangelogSection`, `ChangelogItem` | `changelog/` |
288
+ | Commits | `ConventionalCommit`, `CommitType`, `CommitFooter` | `commits/` |
289
+ | Semver | `ParsedVersion`, `ReleaseType`, `PreReleaseType` | `semver/` |
290
+ | Git | `GitClient`, `GitCommit`, `GitTag`, `GitLogEntry` | `git/` |
291
+ | Registry | `RegistryClient`, `PackageInfo`, `VersionInfo` | `registry/` |
292
+ | Workspace | `Project`, `Workspace`, `PackageJson` | `workspace/` |
293
+ | Flow | `FlowContext`, `FlowStep`, `FlowResult`, `FlowError` | `flow/` |
294
+
295
+ ---
296
+
297
+ ## Security Architecture
298
+
299
+ ### Input Validation
300
+
301
+ All entry points validate input before processing:
302
+
303
+ ```mermaid
304
+ flowchart LR
305
+ input[User Input] --> length{Length Check}
306
+ length -->|>limit| reject[Reject]
307
+ length -->|≤limit| encoding{Encoding Check}
308
+ encoding -->|invalid| reject
309
+ encoding -->|valid| process[Process]
310
+ ```
311
+
312
+ ### Input Limits
313
+
314
+ | Input Type | Maximum Length | Rationale |
315
+ | -------------- | -------------- | --------------------------------- |
316
+ | Commit message | 10,000 chars | No legitimate commit exceeds this |
317
+ | Changelog file | 1 MB | Prevents memory exhaustion |
318
+ | Version string | 256 chars | Per semver spec limits |
319
+ | Package name | 214 chars | Per npm spec |
320
+
321
+ State-machine parsing ensures O(n) complexity for all inputs, providing predictable performance regardless of content patterns.
322
+
323
+ ---
324
+
325
+ ## Module Details
326
+
327
+ ### changelog/
328
+
329
+ **Purpose:** Parse, manipulate, and serialize CHANGELOG.md files.
330
+
331
+ **Key Components:**
332
+
333
+ - `tokenize/` - Character-by-character markdown tokenizer
334
+ - `parse/` - Token-to-AST parser
335
+ - `format/` - Format detection (Keep a Changelog, Conventional, etc.)
336
+ - `render/` - AST-to-markdown serializer
337
+
338
+ **Architecture:**
339
+
340
+ ```mermaid
341
+ flowchart TB
342
+ subgraph Public API
343
+ parseChangelog
344
+ renderChangelog
345
+ createChangelog
346
+ end
347
+
348
+ subgraph Internal
349
+ tokenize
350
+ parseTokens
351
+ detectFormat
352
+ buildAST
353
+ end
354
+
355
+ parseChangelog --> tokenize
356
+ tokenize --> parseTokens
357
+ parseTokens --> detectFormat
358
+ detectFormat --> buildAST
359
+ renderChangelog --> serialize
360
+ ```
361
+
362
+ 📖 [Full changelog/ documentation](./src/changelog/README.md)
363
+
364
+ ---
365
+
366
+ ### commits/
367
+
368
+ **Purpose:** Parse conventional commit messages into structured data.
369
+
370
+ **Key Components:**
371
+
372
+ - `parse/` - Commit message parser
373
+ - `types/` - Type definitions and constants
374
+ - `validate/` - Commit validation utilities
375
+
376
+ **Architecture:**
377
+
378
+ ```mermaid
379
+ flowchart LR
380
+ message[Commit Message] --> header[Parse Header]
381
+ header --> type[Extract Type]
382
+ header --> scope[Extract Scope]
383
+ header --> subject[Extract Subject]
384
+ message --> body[Parse Body]
385
+ message --> footer[Parse Footers]
386
+ footer --> breaking[Detect Breaking Changes]
387
+
388
+ type --> commit[ConventionalCommit]
389
+ scope --> commit
390
+ subject --> commit
391
+ body --> commit
392
+ breaking --> commit
393
+ ```
394
+
395
+ 📖 [Full commits/ documentation](./src/commits/README.md)
396
+
397
+ ---
398
+
399
+ ### semver/
400
+
401
+ **Purpose:** Parse, compare, and manipulate semantic versions.
402
+
403
+ **Key Components:**
404
+
405
+ - `parse/` - Version string parser
406
+ - `compare/` - Version comparison functions
407
+ - `increment/` - Version bumping logic
408
+ - `range/` - Version range utilities
409
+
410
+ **Architecture:**
411
+
412
+ ```mermaid
413
+ flowchart TB
414
+ subgraph "Parse"
415
+ parseVersion[parseVersion]
416
+ parseRange[parseRange]
417
+ end
418
+
419
+ subgraph "Compare"
420
+ compareVersions[compareVersions]
421
+ satisfiesRange[satisfiesRange]
422
+ end
423
+
424
+ subgraph "Transform"
425
+ incrementVersion[incrementVersion]
426
+ formatVersion[formatVersion]
427
+ end
428
+
429
+ parseVersion --> compareVersions
430
+ parseRange --> satisfiesRange
431
+ parseVersion --> incrementVersion
432
+ incrementVersion --> formatVersion
433
+ ```
434
+
435
+ 📖 [Full semver/ documentation](./src/semver/README.md)
436
+
437
+ ---
438
+
439
+ ### registry/
440
+
441
+ **Purpose:** Query npm registry for package and version information.
442
+
443
+ **Key Components:**
444
+
445
+ - `client/` - Registry client factory
446
+ - `fetch/` - HTTP fetch utilities
447
+ - `parse/` - Registry response parsers
448
+
449
+ **Architecture:**
450
+
451
+ ```mermaid
452
+ flowchart LR
453
+ createRegistryClient --> client[RegistryClient]
454
+ client --> getPackageInfo
455
+ client --> getVersionInfo
456
+ client --> checkVersionExists
457
+
458
+ getPackageInfo --> fetch[HTTP Fetch]
459
+ fetch --> parse[Parse Response]
460
+ parse --> result[PackageInfo]
461
+ ```
462
+
463
+ 📖 [Full registry/ documentation](./src/registry/README.md)
464
+
465
+ ---
466
+
467
+ ### git/
468
+
469
+ **Purpose:** Git operations abstraction layer.
470
+
471
+ **Key Components:**
472
+
473
+ - `client/` - Git client factory
474
+ - `log/` - Commit history parsing
475
+ - `tag/` - Tag operations
476
+ - `branch/` - Branch operations
477
+ - `diff/` - Diff parsing
478
+
479
+ **Architecture:**
480
+
481
+ ```mermaid
482
+ flowchart TB
483
+ createGitClient --> client[GitClient]
484
+
485
+ subgraph "Read Operations"
486
+ client --> getLog
487
+ client --> getTags
488
+ client --> getBranches
489
+ client --> getDiff
490
+ end
491
+
492
+ subgraph "Write Operations"
493
+ client --> commit
494
+ client --> tag
495
+ client --> push
496
+ end
497
+
498
+ subgraph "Query Operations"
499
+ client --> getCommitsSince
500
+ client --> getLatestTag
501
+ client --> isClean
502
+ end
503
+ ```
504
+
505
+ 📖 [Full git/ documentation](./src/git/README.md)
506
+
507
+ ---
508
+
509
+ ### workspace/
510
+
511
+ **Purpose:** Workspace and project discovery, package.json manipulation.
512
+
513
+ **Key Components:**
514
+
515
+ - `discover/` - Project discovery
516
+ - `package-json/` - Package.json read/write
517
+ - `project/` - Project configuration
518
+ - `nx/` - Nx workspace integration
519
+
520
+ **Architecture:**
521
+
522
+ ```mermaid
523
+ flowchart TB
524
+ subgraph "Discovery"
525
+ discoverProjects
526
+ findPackageJson
527
+ detectWorkspaceRoot
528
+ end
529
+
530
+ subgraph "Package Operations"
531
+ readPackageJson
532
+ writePackageJson
533
+ updateVersion
534
+ end
535
+
536
+ subgraph "Project Operations"
537
+ getProjectConfig
538
+ getProjectDependencies
539
+ end
540
+
541
+ discoverProjects --> readPackageJson
542
+ readPackageJson --> getProjectConfig
543
+ ```
544
+
545
+ 📖 [Full workspace/ documentation](./src/workspace/README.md)
546
+
547
+ ---
548
+
549
+ ### flow/
550
+
551
+ **Purpose:** Orchestrate version release workflows.
552
+
553
+ **Key Components:**
554
+
555
+ - `context/` - Flow context factory
556
+ - `steps/` - Individual flow steps
557
+ - `execute/` - Flow execution engine
558
+ - `validate/` - Pre-flight validation
559
+
560
+ **Architecture:**
561
+
562
+ ```mermaid
563
+ flowchart TB
564
+ subgraph "Setup"
565
+ createFlowContext --> context[FlowContext]
566
+ validateContext --> validation[Validation Result]
567
+ end
568
+
569
+ subgraph "Execution"
570
+ executeVersionFlow --> step1[Analyze Commits]
571
+ step1 --> step2[Determine Version]
572
+ step2 --> step3[Validate Registry]
573
+ step3 --> step4[Update Files]
574
+ step4 --> step5[Git Operations]
575
+ end
576
+
577
+ subgraph "Result"
578
+ step5 --> result[FlowResult]
579
+ end
580
+
581
+ context --> executeVersionFlow
582
+ ```
583
+
584
+ 📖 [Full flow/ documentation](./src/flow/README.md)
585
+
586
+ ---
587
+
588
+ ## Further Reading
589
+
590
+ - [Main README](./README.md) - Installation and quick start
591
+ - [Module Documentation](./src/) - Per-module README files
592
+ - [Contributing Guide](../../CONTRIBUTING.md) - Development setup
593
+ - [Security Policy](../../SECURITY.md) - Vulnerability reporting
package/CHANGELOG.md ADDED
@@ -0,0 +1,35 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## 0.1.0 - 2026-03-16
6
+
7
+ ### Features
8
+
9
+ - **lib-versioning:** support commit amend no edit
10
+ - **lib-versioning:** support force bump with release as config
11
+ - **tool-package:** improve memory management and visibility on builder executor
12
+ - **eslint-rules:** lib-ts-config-paths
13
+ - **e2e-lib-versioning:** test cjs and esm builds
14
+ - **eslint-rules:** lib-e2e-project-required
15
+ - **lib-versioning:** implement project versioning
16
+ - **eslint-rules:** ensure publishable libraries accounted for in docs
17
+ - **eslint-rules:** add rule to ensure pipeline is ready for publishable libraries
18
+ - **eslint-rules:** root readme.md rule to ensure packages are listed
19
+ - **eslint-rules:** rules to align readme.md content format
20
+ - **docs-site:** add project-scope
21
+ - **tool-package:** build executor now takes unpkg and jsdelivr configuration
22
+ - **lib-json-utils:** regex pattern safety
23
+ - **eslint-rules:** no-unsafe-regex
24
+ - **eslint-rules:** no-deprecated-tag
25
+ - **lib-project-scope:** complete implementation
26
+
27
+ ### Bug Fixes
28
+
29
+ - **lib-versioning:** remove unused %h format causing git log field misalignment
30
+ - **lib-immutable-api-utils:** rename safe object to prevent variable shadowing on cjs module init
31
+ - **@hyperfrontend/workspace:** prevent changelog corruption in pr ci
32
+
33
+ ### Other
34
+
35
+ - **eslint-rules:** disable angle bracket typecasting on eslint-rules project