@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,451 @@
1
+ import { execSync } from 'node:child_process';
2
+
3
+ /**
4
+ * Safe copies of Array built-in static methods.
5
+ *
6
+ * These references are captured at module initialization time to protect against
7
+ * prototype pollution attacks. Import only what you need for tree-shaking.
8
+ *
9
+ * @module @hyperfrontend/immutable-api-utils/built-in-copy/array
10
+ */
11
+ // Capture references at module initialization time
12
+ const _Array = globalThis.Array;
13
+ /**
14
+ * (Safe copy) Determines whether the passed value is an Array.
15
+ */
16
+ const isArray = _Array.isArray;
17
+
18
+ /**
19
+ * Safe copies of Date built-in via factory function and static methods.
20
+ *
21
+ * Since constructors cannot be safely captured via Object.assign, this module
22
+ * provides a factory function that uses Reflect.construct internally.
23
+ *
24
+ * These references are captured at module initialization time to protect against
25
+ * prototype pollution attacks. Import only what you need for tree-shaking.
26
+ *
27
+ * @module @hyperfrontend/immutable-api-utils/built-in-copy/date
28
+ */
29
+ // Capture references at module initialization time
30
+ const _Date = globalThis.Date;
31
+ const _Reflect$2 = globalThis.Reflect;
32
+ function createDate(...args) {
33
+ return _Reflect$2.construct(_Date, args);
34
+ }
35
+ /**
36
+ * (Safe copy) Returns the number of milliseconds elapsed since January 1, 1970 00:00:00 UTC.
37
+ */
38
+ const dateNow = _Date.now;
39
+
40
+ /**
41
+ * Safe copies of Error built-ins via factory functions.
42
+ *
43
+ * Since constructors cannot be safely captured via Object.assign, this module
44
+ * provides factory functions that use Reflect.construct internally.
45
+ *
46
+ * These references are captured at module initialization time to protect against
47
+ * prototype pollution attacks. Import only what you need for tree-shaking.
48
+ *
49
+ * @module @hyperfrontend/immutable-api-utils/built-in-copy/error
50
+ */
51
+ // Capture references at module initialization time
52
+ const _Error = globalThis.Error;
53
+ const _Reflect$1 = globalThis.Reflect;
54
+ /**
55
+ * (Safe copy) Creates a new Error using the captured Error constructor.
56
+ * Use this instead of `new Error()`.
57
+ *
58
+ * @param message - Optional error message.
59
+ * @param options - Optional error options.
60
+ * @returns A new Error instance.
61
+ */
62
+ const createError = (message, options) => _Reflect$1.construct(_Error, [message, options]);
63
+
64
+ /**
65
+ * Safe copies of JSON built-in methods.
66
+ *
67
+ * These references are captured at module initialization time to protect against
68
+ * prototype pollution attacks. Import only what you need for tree-shaking.
69
+ *
70
+ * @module @hyperfrontend/immutable-api-utils/built-in-copy/json
71
+ */
72
+ // Capture references at module initialization time
73
+ const _JSON = globalThis.JSON;
74
+ /**
75
+ * (Safe copy) Converts a JavaScript Object Notation (JSON) string into an object.
76
+ */
77
+ const parse = _JSON.parse;
78
+
79
+ /**
80
+ * Safe copies of Map built-in via factory function.
81
+ *
82
+ * Since constructors cannot be safely captured via Object.assign, this module
83
+ * provides a factory function that uses Reflect.construct internally.
84
+ *
85
+ * These references are captured at module initialization time to protect against
86
+ * prototype pollution attacks. Import only what you need for tree-shaking.
87
+ *
88
+ * @module @hyperfrontend/immutable-api-utils/built-in-copy/map
89
+ */
90
+ // Capture references at module initialization time
91
+ const _Map = globalThis.Map;
92
+ const _Reflect = globalThis.Reflect;
93
+ /**
94
+ * (Safe copy) Creates a new Map using the captured Map constructor.
95
+ * Use this instead of `new Map()`.
96
+ *
97
+ * @param iterable - Optional iterable of key-value pairs.
98
+ * @returns A new Map instance.
99
+ */
100
+ const createMap = (iterable) => _Reflect.construct(_Map, iterable ? [iterable] : []);
101
+
102
+ /**
103
+ * Creates a new cache instance.
104
+ *
105
+ * @param ttl - Time-to-live in milliseconds (default: 60000 = 1 minute)
106
+ * @returns A new Cache instance
107
+ */
108
+ function createCache(ttl = 60000) {
109
+ const entries = createMap();
110
+ return {
111
+ get(key) {
112
+ const entry = entries.get(key);
113
+ if (!entry)
114
+ return undefined;
115
+ const now = dateNow();
116
+ if (now - entry.timestamp > ttl) {
117
+ entries.delete(key);
118
+ return undefined;
119
+ }
120
+ return entry.data;
121
+ },
122
+ set(key, value) {
123
+ entries.set(key, { data: value, timestamp: dateNow() });
124
+ },
125
+ delete(key) {
126
+ entries.delete(key);
127
+ },
128
+ clear() {
129
+ entries.clear();
130
+ },
131
+ size() {
132
+ return entries.size;
133
+ },
134
+ };
135
+ }
136
+
137
+ /**
138
+ * Creates an npm registry client.
139
+ *
140
+ * @param config - Registry configuration
141
+ * @returns A Registry implementation for npm
142
+ *
143
+ * @example
144
+ * const registry = createNpmRegistry()
145
+ * const version = await registry.getLatestVersion('@hyperfrontend/utils')
146
+ */
147
+ function createNpmRegistry(config = {}) {
148
+ const state = {
149
+ config: {
150
+ url: config.url ?? 'https://registry.npmjs.org',
151
+ timeout: config.timeout ?? 10000,
152
+ cacheTtl: config.cacheTtl ?? 60000,
153
+ authToken: config.authToken,
154
+ },
155
+ cache: createCache(config.cacheTtl ?? 60000),
156
+ };
157
+ return {
158
+ name: 'npm',
159
+ url: state.config.url,
160
+ getLatestVersion: (packageName) => getLatestVersion(state, packageName),
161
+ isVersionPublished: (packageName, version) => isVersionPublished(state, packageName, version),
162
+ getPackageInfo: (packageName) => getPackageInfo(state, packageName),
163
+ getVersionInfo: (packageName, version) => getVersionInfo(state, packageName, version),
164
+ listVersions: (packageName) => listVersions(state, packageName),
165
+ };
166
+ }
167
+ /**
168
+ * Gets the latest published version of a package.
169
+ *
170
+ * @param state - Internal registry client state
171
+ * @param packageName - Name of the package to query
172
+ * @returns The latest version string, or null if not found
173
+ */
174
+ async function getLatestVersion(state, packageName) {
175
+ const cacheKey = `latest:${packageName}`;
176
+ const cached = state.cache.get(cacheKey);
177
+ if (cached !== undefined)
178
+ return cached;
179
+ try {
180
+ const safeName = escapePackageName(packageName);
181
+ const result = execSync(`npm view ${safeName} version`, {
182
+ encoding: 'utf-8',
183
+ timeout: state.config.timeout,
184
+ stdio: ['pipe', 'pipe', 'pipe'],
185
+ }).trim();
186
+ const version = result || null;
187
+ state.cache.set(cacheKey, version);
188
+ return version;
189
+ }
190
+ catch {
191
+ state.cache.set(cacheKey, null);
192
+ return null;
193
+ }
194
+ }
195
+ /**
196
+ * Checks if a specific version is published.
197
+ *
198
+ * @param state - Internal registry client state
199
+ * @param packageName - Name of the package to check
200
+ * @param version - Semver version string to verify
201
+ * @returns True if the version is published
202
+ */
203
+ async function isVersionPublished(state, packageName, version) {
204
+ const cacheKey = `published:${packageName}@${version}`;
205
+ const cached = state.cache.get(cacheKey);
206
+ if (cached !== undefined)
207
+ return cached;
208
+ try {
209
+ const safeName = escapePackageName(packageName);
210
+ const safeVersion = escapeVersion(version);
211
+ const result = execSync(`npm view ${safeName}@${safeVersion} version`, {
212
+ encoding: 'utf-8',
213
+ timeout: state.config.timeout,
214
+ stdio: ['pipe', 'pipe', 'pipe'],
215
+ }).trim();
216
+ const published = result === version;
217
+ state.cache.set(cacheKey, published);
218
+ return published;
219
+ }
220
+ catch {
221
+ state.cache.set(cacheKey, false);
222
+ return false;
223
+ }
224
+ }
225
+ /**
226
+ * Gets full package information.
227
+ *
228
+ * @param state - Internal registry client state
229
+ * @param packageName - Name of the package to query
230
+ * @returns Package info, or null if not found
231
+ */
232
+ async function getPackageInfo(state, packageName) {
233
+ const cacheKey = `info:${packageName}`;
234
+ const cached = state.cache.get(cacheKey);
235
+ if (cached !== undefined)
236
+ return cached;
237
+ try {
238
+ const safeName = escapePackageName(packageName);
239
+ const result = execSync(`npm view ${safeName} --json`, {
240
+ encoding: 'utf-8',
241
+ timeout: state.config.timeout,
242
+ stdio: ['pipe', 'pipe', 'pipe'],
243
+ maxBuffer: 10 * 1024 * 1024, // 10MB
244
+ });
245
+ const data = parse(result);
246
+ const info = {
247
+ name: data.name,
248
+ description: data.description,
249
+ latestVersion: data.version,
250
+ versions: isArray(data.versions) ? data.versions : [data.version],
251
+ license: data.license,
252
+ repository: extractRepoUrl(data.repository),
253
+ homepage: data.homepage,
254
+ maintainers: (data.maintainers ?? []).map((m) => {
255
+ if (typeof m === 'string') {
256
+ return { name: m };
257
+ }
258
+ return { name: m.name ?? '', email: m.email };
259
+ }),
260
+ keywords: data.keywords,
261
+ lastModified: data.time?.modified,
262
+ };
263
+ state.cache.set(cacheKey, info);
264
+ return info;
265
+ }
266
+ catch {
267
+ state.cache.set(cacheKey, null);
268
+ return null;
269
+ }
270
+ }
271
+ /**
272
+ * Gets version-specific information.
273
+ *
274
+ * @param state - Internal registry client state
275
+ * @param packageName - Name of the package to query
276
+ * @param version - Semver version string to look up
277
+ * @returns Version info, or null if not found
278
+ */
279
+ async function getVersionInfo(state, packageName, version) {
280
+ const cacheKey = `versionInfo:${packageName}@${version}`;
281
+ const cached = state.cache.get(cacheKey);
282
+ if (cached !== undefined)
283
+ return cached;
284
+ try {
285
+ const safeName = escapePackageName(packageName);
286
+ const safeVersion = escapeVersion(version);
287
+ const result = execSync(`npm view ${safeName}@${safeVersion} --json`, {
288
+ encoding: 'utf-8',
289
+ timeout: state.config.timeout,
290
+ stdio: ['pipe', 'pipe', 'pipe'],
291
+ maxBuffer: 5 * 1024 * 1024, // 5MB
292
+ });
293
+ const data = parse(result);
294
+ const info = {
295
+ version: data.version,
296
+ publishedAt: data.time ?? createDate().toISOString(),
297
+ tarball: data.dist?.tarball ?? '',
298
+ integrity: data.dist?.integrity,
299
+ dependencies: data.dependencies,
300
+ devDependencies: data.devDependencies,
301
+ peerDependencies: data.peerDependencies,
302
+ optionalDependencies: data.optionalDependencies,
303
+ engines: data.engines,
304
+ nodeVersion: data._nodeVersion,
305
+ npmVersion: data._npmVersion,
306
+ };
307
+ state.cache.set(cacheKey, info);
308
+ return info;
309
+ }
310
+ catch {
311
+ state.cache.set(cacheKey, null);
312
+ return null;
313
+ }
314
+ }
315
+ /**
316
+ * Lists all published versions.
317
+ *
318
+ * @param state - Internal registry client state
319
+ * @param packageName - Name of the package to query
320
+ * @returns Array of version strings
321
+ */
322
+ async function listVersions(state, packageName) {
323
+ const cacheKey = `versions:${packageName}`;
324
+ const cached = state.cache.get(cacheKey);
325
+ if (cached !== undefined)
326
+ return cached;
327
+ try {
328
+ const safeName = escapePackageName(packageName);
329
+ const result = execSync(`npm view ${safeName} versions --json`, {
330
+ encoding: 'utf-8',
331
+ timeout: state.config.timeout,
332
+ stdio: ['pipe', 'pipe', 'pipe'],
333
+ });
334
+ const versions = parse(result);
335
+ const versionList = isArray(versions) ? versions : [versions];
336
+ state.cache.set(cacheKey, versionList);
337
+ return versionList;
338
+ }
339
+ catch {
340
+ state.cache.set(cacheKey, []);
341
+ return [];
342
+ }
343
+ }
344
+ // ============================================================================
345
+ // Security helpers - character-by-character validation (no regex)
346
+ // ============================================================================
347
+ /**
348
+ * Maximum allowed package name length (npm limit).
349
+ */
350
+ const MAX_PACKAGE_NAME_LENGTH = 214;
351
+ /**
352
+ * Escapes a package name for safe use in shell commands.
353
+ * Uses character-by-character validation to prevent injection.
354
+ *
355
+ * @param name - Package name to escape
356
+ * @returns Safe package name
357
+ * @throws {Error} If package name contains invalid characters
358
+ */
359
+ function escapePackageName(name) {
360
+ if (!name || typeof name !== 'string') {
361
+ throw createError('Package name is required');
362
+ }
363
+ if (name.length > MAX_PACKAGE_NAME_LENGTH) {
364
+ throw createError(`Package name exceeds maximum length of ${MAX_PACKAGE_NAME_LENGTH}`);
365
+ }
366
+ const safe = [];
367
+ for (let i = 0; i < name.length; i++) {
368
+ const code = name.charCodeAt(i);
369
+ // Allow: a-z, A-Z, 0-9, @, /, -, _, .
370
+ if ((code >= 97 && code <= 122) || // a-z
371
+ (code >= 65 && code <= 90) || // A-Z
372
+ (code >= 48 && code <= 57) || // 0-9
373
+ code === 64 || // @
374
+ code === 47 || // /
375
+ code === 45 || // -
376
+ code === 95 || // _
377
+ code === 46 // .
378
+ ) {
379
+ safe.push(name[i]);
380
+ }
381
+ else {
382
+ throw createError(`Invalid character in package name at position ${i}: "${name[i]}"`);
383
+ }
384
+ }
385
+ return safe.join('');
386
+ }
387
+ /**
388
+ * Maximum allowed version string length.
389
+ */
390
+ const MAX_VERSION_LENGTH = 256;
391
+ /**
392
+ * Escapes a version string for safe use in shell commands.
393
+ *
394
+ * @param version - Version string to escape
395
+ * @returns Safe version string
396
+ * @throws {Error} If version contains invalid characters
397
+ */
398
+ function escapeVersion(version) {
399
+ if (!version || typeof version !== 'string') {
400
+ throw createError('Version is required');
401
+ }
402
+ if (version.length > MAX_VERSION_LENGTH) {
403
+ throw createError(`Version exceeds maximum length of ${MAX_VERSION_LENGTH}`);
404
+ }
405
+ const safe = [];
406
+ for (let i = 0; i < version.length; i++) {
407
+ const code = version.charCodeAt(i);
408
+ // Allow: 0-9, ., -, +, a-z, A-Z
409
+ if ((code >= 48 && code <= 57) || // 0-9
410
+ (code >= 97 && code <= 122) || // a-z
411
+ (code >= 65 && code <= 90) || // A-Z
412
+ code === 46 || // .
413
+ code === 45 || // -
414
+ code === 43 // +
415
+ ) {
416
+ safe.push(version[i]);
417
+ }
418
+ else {
419
+ throw createError(`Invalid character in version at position ${i}: "${version[i]}"`);
420
+ }
421
+ }
422
+ return safe.join('');
423
+ }
424
+ /**
425
+ * Extracts repository URL from npm package repository field.
426
+ *
427
+ * @param repository - Repository field from package.json (string or object)
428
+ * @returns Repository URL, or undefined if not found
429
+ */
430
+ function extractRepoUrl(repository) {
431
+ if (typeof repository === 'string')
432
+ return repository;
433
+ if (repository && typeof repository === 'object') {
434
+ const repo = repository;
435
+ if (repo.url) {
436
+ // Clean up git+ prefix and .git suffix
437
+ let url = repo.url;
438
+ if (url.startsWith('git+')) {
439
+ url = url.slice(4);
440
+ }
441
+ if (url.endsWith('.git')) {
442
+ url = url.slice(0, -4);
443
+ }
444
+ return url;
445
+ }
446
+ }
447
+ return undefined;
448
+ }
449
+
450
+ export { createCache, createNpmRegistry, escapePackageName, escapeVersion };
451
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":["../../../../../../../../../../libs/utils/immutable-api/src/built-in-copy/array/index.ts","../../../../../../../../../../libs/utils/immutable-api/src/built-in-copy/date/index.ts","../../../../../../../../../../libs/utils/immutable-api/src/built-in-copy/error/index.ts","../../../../../../../../../../libs/utils/immutable-api/src/built-in-copy/json/index.ts","../../../../../../../../../../libs/utils/immutable-api/src/built-in-copy/map/index.ts","../../../../../../../../../../libs/versioning/src/registry/npm/cache.ts","../../../../../../../../../../libs/versioning/src/registry/npm/client.ts"],"sourcesContent":[null,null,null,null,null,null,null],"names":["_Reflect"],"mappings":";;AAAA;;;;;;;AAOG;AAEH;AACA,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK;AAG/B;;AAEG;AACI,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO;;AChBrC;;;;;;;;;;AAUG;AAEH;AACA,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI;AAC7B,MAAMA,UAAQ,GAAG,UAAU,CAAC,OAAO;AAoB7B,SAAU,UAAU,CAAC,GAAG,IAAe,EAAA;IAC3C,OAAaA,UAAQ,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,CAAC;AAC9C;AAEA;;AAEG;AACI,MAAM,OAAO,GAAG,KAAK,CAAC,GAAG;;ACzChC;;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,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;AAC1B,gBAAA,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;YACpB;AACA,YAAA,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;gBACxB,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;YACxB;AACA,YAAA,OAAO,GAAG;QACZ;IACF;AAEA,IAAA,OAAO,SAAS;AAClB;;;;"}
@@ -0,0 +1,100 @@
1
+ import type { Comparator, Range } from '../models/range';
2
+ import type { SemVer } from '../models/version';
3
+ /**
4
+ * Compares two semantic versions.
5
+ *
6
+ * @param a - First version
7
+ * @param b - Second version
8
+ * @returns -1 if a < b, 0 if a == b, 1 if a > b
9
+ *
10
+ * @example
11
+ * compare(parseVersion('1.0.0'), parseVersion('2.0.0')) // -1
12
+ * compare(parseVersion('1.0.0'), parseVersion('1.0.0')) // 0
13
+ * compare(parseVersion('2.0.0'), parseVersion('1.0.0')) // 1
14
+ */
15
+ export declare function compare(a: SemVer, b: SemVer): -1 | 0 | 1;
16
+ /**
17
+ * Checks if two versions are equal (ignoring build metadata).
18
+ *
19
+ * @param a - First version
20
+ * @param b - Second version
21
+ * @returns True if versions are equal
22
+ */
23
+ export declare function eq(a: SemVer, b: SemVer): boolean;
24
+ /**
25
+ * Checks if a < b.
26
+ *
27
+ * @param a - First version to compare
28
+ * @param b - Second version to compare
29
+ * @returns True if a is less than b
30
+ */
31
+ export declare function lt(a: SemVer, b: SemVer): boolean;
32
+ /**
33
+ * Checks if a <= b.
34
+ *
35
+ * @param a - First version to compare
36
+ * @param b - Second version to compare
37
+ * @returns True if a is less than or equal to b
38
+ */
39
+ export declare function lte(a: SemVer, b: SemVer): boolean;
40
+ /**
41
+ * Checks if a > b.
42
+ *
43
+ * @param a - First version to compare
44
+ * @param b - Second version to compare
45
+ * @returns True if a is greater than b
46
+ */
47
+ export declare function gt(a: SemVer, b: SemVer): boolean;
48
+ /**
49
+ * Checks if a >= b.
50
+ *
51
+ * @param a - First version to compare
52
+ * @param b - Second version to compare
53
+ * @returns True if a is greater than or equal to b
54
+ */
55
+ export declare function gte(a: SemVer, b: SemVer): boolean;
56
+ /**
57
+ * Checks if a != b.
58
+ *
59
+ * @param a - First version to compare
60
+ * @param b - Second version to compare
61
+ * @returns True if versions are not equal
62
+ */
63
+ export declare function neq(a: SemVer, b: SemVer): boolean;
64
+ /**
65
+ * Checks if a version satisfies a comparator.
66
+ *
67
+ * @param version - Version to check
68
+ * @param comparator - Comparator to test against
69
+ * @returns True if version satisfies the comparator
70
+ */
71
+ export declare function satisfiesComparator(version: SemVer, comparator: Comparator): boolean;
72
+ /**
73
+ * Checks if a version satisfies a range.
74
+ *
75
+ * @param version - Version to check
76
+ * @param range - Range to test against
77
+ * @returns True if version satisfies the range
78
+ *
79
+ * @example
80
+ * satisfies(parseVersion('1.2.3'), parseRange('^1.0.0')) // true
81
+ * satisfies(parseVersion('2.0.0'), parseRange('^1.0.0')) // false
82
+ */
83
+ export declare function satisfies(version: SemVer, range: Range): boolean;
84
+ /**
85
+ * Finds the maximum version that satisfies a range.
86
+ *
87
+ * @param versions - Array of versions to check
88
+ * @param range - Range to test against
89
+ * @returns The maximum satisfying version, or null if none satisfy
90
+ */
91
+ export declare function maxSatisfying(versions: readonly SemVer[], range: Range): SemVer | null;
92
+ /**
93
+ * Finds the minimum version that satisfies a range.
94
+ *
95
+ * @param versions - Array of versions to check
96
+ * @param range - Range to test against
97
+ * @returns The minimum satisfying version, or null if none satisfy
98
+ */
99
+ export declare function minSatisfying(versions: readonly SemVer[], range: Range): SemVer | null;
100
+ //# sourceMappingURL=compare.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compare.d.ts","sourceRoot":"","sources":["../../../../../../../../libs/versioning/src/semver/compare/compare.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CA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