renovate 40.0.0-next.9 → 40.0.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 (816) hide show
  1. package/dist/config/decrypt/legacy.js +0 -1
  2. package/dist/config/decrypt/legacy.js.map +1 -1
  3. package/dist/config/decrypt.d.ts +3 -1
  4. package/dist/config/decrypt.js +56 -13
  5. package/dist/config/decrypt.js.map +1 -1
  6. package/dist/config/global.js +0 -1
  7. package/dist/config/global.js.map +1 -1
  8. package/dist/config/migrate-validate.js +3 -2
  9. package/dist/config/migrate-validate.js.map +1 -1
  10. package/dist/config/migration.js +2 -1
  11. package/dist/config/migration.js.map +1 -1
  12. package/dist/config/migrations/custom/rebase-stale-prs-migration.js +1 -1
  13. package/dist/config/migrations/custom/rebase-stale-prs-migration.js.map +1 -1
  14. package/dist/config/migrations/migrations-service.js +3 -2
  15. package/dist/config/migrations/migrations-service.js.map +1 -1
  16. package/dist/config/options/index.js +18 -11
  17. package/dist/config/options/index.js.map +1 -1
  18. package/dist/config/parse.js +2 -2
  19. package/dist/config/parse.js.map +1 -1
  20. package/dist/config/presets/common.js +1 -0
  21. package/dist/config/presets/common.js.map +1 -1
  22. package/dist/config/presets/gitea/index.js +0 -1
  23. package/dist/config/presets/gitea/index.js.map +1 -1
  24. package/dist/config/presets/github/index.js +4 -2
  25. package/dist/config/presets/github/index.js.map +1 -1
  26. package/dist/config/presets/gitlab/index.js +1 -1
  27. package/dist/config/presets/gitlab/index.js.map +1 -1
  28. package/dist/config/presets/http/index.js +2 -2
  29. package/dist/config/presets/http/index.js.map +1 -1
  30. package/dist/config/presets/index.js +0 -7
  31. package/dist/config/presets/index.js.map +1 -1
  32. package/dist/config/presets/internal/custom-managers.js +18 -4
  33. package/dist/config/presets/internal/custom-managers.js.map +1 -1
  34. package/dist/config/presets/internal/group.js +30 -1
  35. package/dist/config/presets/internal/group.js.map +1 -1
  36. package/dist/config/presets/internal/index.js +1 -3
  37. package/dist/config/presets/internal/index.js.map +1 -1
  38. package/dist/config/presets/internal/workarounds.js +1 -0
  39. package/dist/config/presets/internal/workarounds.js.map +1 -1
  40. package/dist/config/presets/npm/index.js +4 -1
  41. package/dist/config/presets/npm/index.js.map +1 -1
  42. package/dist/config/presets/parse.js +2 -1
  43. package/dist/config/presets/parse.js.map +1 -1
  44. package/dist/config/schema.d.ts +2 -2
  45. package/dist/config/types.d.ts +4 -2
  46. package/dist/config/types.js.map +1 -1
  47. package/dist/config/validation.js +3 -5
  48. package/dist/config/validation.js.map +1 -1
  49. package/dist/config-validator.js +0 -1
  50. package/dist/config-validator.js.map +1 -1
  51. package/dist/constants/category.js +0 -1
  52. package/dist/constants/category.js.map +1 -1
  53. package/dist/constants/platforms.js +5 -1
  54. package/dist/constants/platforms.js.map +1 -1
  55. package/dist/data/monorepo.json +9 -2
  56. package/dist/data/replacements.json +13 -0
  57. package/dist/data/source-urls.json +1 -0
  58. package/dist/data-files.generated.js +2 -2
  59. package/dist/data-files.generated.js.map +1 -1
  60. package/dist/instrumentation/index.js +39 -15
  61. package/dist/instrumentation/index.js.map +1 -1
  62. package/dist/instrumentation/utils.js +1 -1
  63. package/dist/instrumentation/utils.js.map +1 -1
  64. package/dist/logger/cmd-serializer.js +0 -1
  65. package/dist/logger/cmd-serializer.js.map +1 -1
  66. package/dist/logger/config-serializer.js +0 -1
  67. package/dist/logger/config-serializer.js.map +1 -1
  68. package/dist/logger/index.js +1 -4
  69. package/dist/logger/index.js.map +1 -1
  70. package/dist/logger/once.js +4 -2
  71. package/dist/logger/once.js.map +1 -1
  72. package/dist/logger/pretty-stdout.js +0 -1
  73. package/dist/logger/pretty-stdout.js.map +1 -1
  74. package/dist/logger/renovate-logger.js +1 -1
  75. package/dist/logger/renovate-logger.js.map +1 -1
  76. package/dist/logger/utils.js +5 -10
  77. package/dist/logger/utils.js.map +1 -1
  78. package/dist/modules/datasource/api.js +4 -0
  79. package/dist/modules/datasource/api.js.map +1 -1
  80. package/dist/modules/datasource/artifactory/index.js +1 -2
  81. package/dist/modules/datasource/artifactory/index.js.map +1 -1
  82. package/dist/modules/datasource/aws-eks-addon/index.d.ts +11 -0
  83. package/dist/modules/datasource/aws-eks-addon/index.js +75 -0
  84. package/dist/modules/datasource/aws-eks-addon/index.js.map +1 -0
  85. package/dist/modules/datasource/aws-eks-addon/schema.d.ts +40 -0
  86. package/dist/modules/datasource/aws-eks-addon/schema.js +31 -0
  87. package/dist/modules/datasource/aws-eks-addon/schema.js.map +1 -0
  88. package/dist/modules/datasource/aws-machine-image/index.js +6 -5
  89. package/dist/modules/datasource/aws-machine-image/index.js.map +1 -1
  90. package/dist/modules/datasource/azure-pipelines-tasks/index.js +15 -1
  91. package/dist/modules/datasource/azure-pipelines-tasks/index.js.map +1 -1
  92. package/dist/modules/datasource/azure-pipelines-tasks/schema.d.ts +24 -0
  93. package/dist/modules/datasource/azure-pipelines-tasks/schema.js +3 -0
  94. package/dist/modules/datasource/azure-pipelines-tasks/schema.js.map +1 -1
  95. package/dist/modules/datasource/bazel/index.js +18 -2
  96. package/dist/modules/datasource/bazel/index.js.map +1 -1
  97. package/dist/modules/datasource/bazel/schema.d.ts +1 -0
  98. package/dist/modules/datasource/bazel/schema.js.map +1 -1
  99. package/dist/modules/datasource/bitbucket-server-tags/index.d.ts +19 -0
  100. package/dist/modules/datasource/bitbucket-server-tags/index.js +133 -0
  101. package/dist/modules/datasource/bitbucket-server-tags/index.js.map +1 -0
  102. package/dist/modules/datasource/bitbucket-server-tags/schema.d.ts +28 -0
  103. package/dist/modules/datasource/bitbucket-server-tags/schema.js +13 -0
  104. package/dist/modules/datasource/bitbucket-server-tags/schema.js.map +1 -0
  105. package/dist/modules/datasource/bitrise/index.js +1 -1
  106. package/dist/modules/datasource/bitrise/index.js.map +1 -1
  107. package/dist/modules/datasource/cdnjs/schema.d.ts +2 -2
  108. package/dist/modules/datasource/conda/index.js +18 -1
  109. package/dist/modules/datasource/conda/index.js.map +1 -1
  110. package/dist/modules/datasource/conda/prefix-dev.d.ts +3 -0
  111. package/dist/modules/datasource/conda/prefix-dev.js +81 -0
  112. package/dist/modules/datasource/conda/prefix-dev.js.map +1 -0
  113. package/dist/modules/datasource/conda/schema/prefix-dev.d.ts +189 -0
  114. package/dist/modules/datasource/conda/schema/prefix-dev.js +31 -0
  115. package/dist/modules/datasource/conda/schema/prefix-dev.js.map +1 -0
  116. package/dist/modules/datasource/conda/types.d.ts +1 -20
  117. package/dist/modules/datasource/conda/types.js.map +1 -1
  118. package/dist/modules/datasource/cpan/index.js +2 -4
  119. package/dist/modules/datasource/cpan/index.js.map +1 -1
  120. package/dist/modules/datasource/crate/index.js +3 -3
  121. package/dist/modules/datasource/crate/index.js.map +1 -1
  122. package/dist/modules/datasource/custom/formats/html.js +1 -1
  123. package/dist/modules/datasource/custom/formats/html.js.map +1 -1
  124. package/dist/modules/datasource/custom/formats/yaml.js +1 -1
  125. package/dist/modules/datasource/custom/formats/yaml.js.map +1 -1
  126. package/dist/modules/datasource/custom/index.js +4 -2
  127. package/dist/modules/datasource/custom/index.js.map +1 -1
  128. package/dist/modules/datasource/custom/schema.d.ts +22 -22
  129. package/dist/modules/datasource/custom/utils.js +1 -0
  130. package/dist/modules/datasource/custom/utils.js.map +1 -1
  131. package/dist/modules/datasource/dart/index.js +1 -1
  132. package/dist/modules/datasource/dart/index.js.map +1 -1
  133. package/dist/modules/datasource/dart-version/index.js +1 -1
  134. package/dist/modules/datasource/dart-version/index.js.map +1 -1
  135. package/dist/modules/datasource/datasource.js +0 -1
  136. package/dist/modules/datasource/datasource.js.map +1 -1
  137. package/dist/modules/datasource/deb/index.d.ts +4 -5
  138. package/dist/modules/datasource/deb/index.js +10 -11
  139. package/dist/modules/datasource/deb/index.js.map +1 -1
  140. package/dist/modules/datasource/deb/url.d.ts +3 -3
  141. package/dist/modules/datasource/deb/url.js +17 -13
  142. package/dist/modules/datasource/deb/url.js.map +1 -1
  143. package/dist/modules/datasource/deno/index.js +1 -1
  144. package/dist/modules/datasource/deno/index.js.map +1 -1
  145. package/dist/modules/datasource/deno/schema.d.ts +1 -1
  146. package/dist/modules/datasource/devbox/index.js +0 -1
  147. package/dist/modules/datasource/devbox/index.js.map +1 -1
  148. package/dist/modules/datasource/docker/common.js +5 -2
  149. package/dist/modules/datasource/docker/common.js.map +1 -1
  150. package/dist/modules/datasource/docker/index.js +8 -6
  151. package/dist/modules/datasource/docker/index.js.map +1 -1
  152. package/dist/modules/datasource/docker/schema.d.ts +77 -101
  153. package/dist/modules/datasource/docker/schema.js +2 -1
  154. package/dist/modules/datasource/docker/schema.js.map +1 -1
  155. package/dist/modules/datasource/flutter-version/index.js +1 -1
  156. package/dist/modules/datasource/flutter-version/index.js.map +1 -1
  157. package/dist/modules/datasource/galaxy/schema.d.ts +1 -1
  158. package/dist/modules/datasource/galaxy-collection/schema.d.ts +8 -8
  159. package/dist/modules/datasource/git-refs/index.js +1 -1
  160. package/dist/modules/datasource/git-refs/index.js.map +1 -1
  161. package/dist/modules/datasource/gitea-releases/schema.d.ts +6 -6
  162. package/dist/modules/datasource/gitea-tags/schema.d.ts +4 -4
  163. package/dist/modules/datasource/github-release-attachments/index.js +2 -2
  164. package/dist/modules/datasource/github-release-attachments/index.js.map +1 -1
  165. package/dist/modules/datasource/github-runners/index.js +2 -2
  166. package/dist/modules/datasource/github-runners/index.js.map +1 -1
  167. package/dist/modules/datasource/github-tags/index.js +4 -1
  168. package/dist/modules/datasource/github-tags/index.js.map +1 -1
  169. package/dist/modules/datasource/gitlab-packages/index.js +1 -1
  170. package/dist/modules/datasource/gitlab-packages/index.js.map +1 -1
  171. package/dist/modules/datasource/gitlab-releases/index.js +1 -3
  172. package/dist/modules/datasource/gitlab-releases/index.js.map +1 -1
  173. package/dist/modules/datasource/go/base.js +1 -1
  174. package/dist/modules/datasource/go/base.js.map +1 -1
  175. package/dist/modules/datasource/go/index.js +1 -1
  176. package/dist/modules/datasource/go/index.js.map +1 -1
  177. package/dist/modules/datasource/go/releases-direct.js +7 -4
  178. package/dist/modules/datasource/go/releases-direct.js.map +1 -1
  179. package/dist/modules/datasource/go/releases-goproxy.js +1 -1
  180. package/dist/modules/datasource/go/releases-goproxy.js.map +1 -1
  181. package/dist/modules/datasource/golang-version/index.js +2 -2
  182. package/dist/modules/datasource/golang-version/index.js.map +1 -1
  183. package/dist/modules/datasource/gradle-version/index.js +1 -1
  184. package/dist/modules/datasource/gradle-version/index.js.map +1 -1
  185. package/dist/modules/datasource/helm/index.js +1 -1
  186. package/dist/modules/datasource/helm/index.js.map +1 -1
  187. package/dist/modules/datasource/hex/index.js +1 -1
  188. package/dist/modules/datasource/hex/index.js.map +1 -1
  189. package/dist/modules/datasource/hex/schema.d.ts +11 -11
  190. package/dist/modules/datasource/hexpm-bob/index.js +1 -1
  191. package/dist/modules/datasource/hexpm-bob/index.js.map +1 -1
  192. package/dist/modules/datasource/index.js +46 -5
  193. package/dist/modules/datasource/index.js.map +1 -1
  194. package/dist/modules/datasource/java-version/index.js +0 -1
  195. package/dist/modules/datasource/java-version/index.js.map +1 -1
  196. package/dist/modules/datasource/jenkins-plugins/index.js +1 -1
  197. package/dist/modules/datasource/jenkins-plugins/index.js.map +1 -1
  198. package/dist/modules/datasource/maven/index.d.ts +2 -2
  199. package/dist/modules/datasource/maven/index.js +56 -33
  200. package/dist/modules/datasource/maven/index.js.map +1 -1
  201. package/dist/modules/datasource/maven/types.d.ts +7 -6
  202. package/dist/modules/datasource/maven/types.js.map +1 -1
  203. package/dist/modules/datasource/maven/util.d.ts +4 -5
  204. package/dist/modules/datasource/maven/util.js +94 -157
  205. package/dist/modules/datasource/maven/util.js.map +1 -1
  206. package/dist/modules/datasource/metadata.js +9 -1
  207. package/dist/modules/datasource/metadata.js.map +1 -1
  208. package/dist/modules/datasource/node-version/index.js +1 -1
  209. package/dist/modules/datasource/node-version/index.js.map +1 -1
  210. package/dist/modules/datasource/npm/get.d.ts +0 -1
  211. package/dist/modules/datasource/npm/get.js +14 -68
  212. package/dist/modules/datasource/npm/get.js.map +1 -1
  213. package/dist/modules/datasource/npm/index.js +1 -1
  214. package/dist/modules/datasource/npm/index.js.map +1 -1
  215. package/dist/modules/datasource/npm/npmrc.js +1 -1
  216. package/dist/modules/datasource/npm/npmrc.js.map +1 -1
  217. package/dist/modules/datasource/npm/types.d.ts +0 -8
  218. package/dist/modules/datasource/npm/types.js.map +1 -1
  219. package/dist/modules/datasource/nuget/index.js +1 -1
  220. package/dist/modules/datasource/nuget/index.js.map +1 -1
  221. package/dist/modules/datasource/nuget/v2.js +1 -1
  222. package/dist/modules/datasource/nuget/v2.js.map +1 -1
  223. package/dist/modules/datasource/nuget/v3.js +8 -6
  224. package/dist/modules/datasource/nuget/v3.js.map +1 -1
  225. package/dist/modules/datasource/orb/index.js +1 -1
  226. package/dist/modules/datasource/orb/index.js.map +1 -1
  227. package/dist/modules/datasource/packagist/index.js +2 -2
  228. package/dist/modules/datasource/packagist/index.js.map +1 -1
  229. package/dist/modules/datasource/packagist/schema.d.ts +32 -32
  230. package/dist/modules/datasource/pod/index.js +2 -2
  231. package/dist/modules/datasource/pod/index.js.map +1 -1
  232. package/dist/modules/datasource/postprocess-release.js +1 -1
  233. package/dist/modules/datasource/postprocess-release.js.map +1 -1
  234. package/dist/modules/datasource/pypi/index.js +1 -1
  235. package/dist/modules/datasource/pypi/index.js.map +1 -1
  236. package/dist/modules/datasource/python-version/index.js +1 -1
  237. package/dist/modules/datasource/python-version/index.js.map +1 -1
  238. package/dist/modules/datasource/repology/index.js +1 -1
  239. package/dist/modules/datasource/repology/index.js.map +1 -1
  240. package/dist/modules/datasource/ruby-version/index.js +1 -1
  241. package/dist/modules/datasource/ruby-version/index.js.map +1 -1
  242. package/dist/modules/datasource/rubygems/index.js +2 -2
  243. package/dist/modules/datasource/rubygems/index.js.map +1 -1
  244. package/dist/modules/datasource/rubygems/versions-endpoint-cache.js +2 -2
  245. package/dist/modules/datasource/rubygems/versions-endpoint-cache.js.map +1 -1
  246. package/dist/modules/datasource/sbt-package/index.js +1 -1
  247. package/dist/modules/datasource/sbt-package/index.js.map +1 -1
  248. package/dist/modules/datasource/sbt-plugin/index.js +1 -1
  249. package/dist/modules/datasource/sbt-plugin/index.js.map +1 -1
  250. package/dist/modules/datasource/schema.d.ts +4 -4
  251. package/dist/modules/datasource/terraform-module/index.js +1 -1
  252. package/dist/modules/datasource/terraform-module/index.js.map +1 -1
  253. package/dist/modules/datasource/terraform-provider/index.js +2 -3
  254. package/dist/modules/datasource/terraform-provider/index.js.map +1 -1
  255. package/dist/modules/datasource/types.d.ts +2 -0
  256. package/dist/modules/datasource/types.js.map +1 -1
  257. package/dist/modules/manager/api.js +2 -0
  258. package/dist/modules/manager/api.js.map +1 -1
  259. package/dist/modules/manager/argocd/extract.js +1 -1
  260. package/dist/modules/manager/argocd/extract.js.map +1 -1
  261. package/dist/modules/manager/argocd/schema.d.ts +22 -22
  262. package/dist/modules/manager/asdf/upgradeable-tooling.js +94 -0
  263. package/dist/modules/manager/asdf/upgradeable-tooling.js.map +1 -1
  264. package/dist/modules/manager/azure-pipelines/schema.d.ts +32 -32
  265. package/dist/modules/manager/batect/schema.d.ts +4 -4
  266. package/dist/modules/manager/batect-wrapper/artifacts.js +1 -1
  267. package/dist/modules/manager/batect-wrapper/artifacts.js.map +1 -1
  268. package/dist/modules/manager/bazel/rules/docker.d.ts +6 -6
  269. package/dist/modules/manager/bazel/rules/git.d.ts +10 -10
  270. package/dist/modules/manager/bazel/rules/git.js +9 -2
  271. package/dist/modules/manager/bazel/rules/git.js.map +1 -1
  272. package/dist/modules/manager/bazel/rules/go.d.ts +5 -5
  273. package/dist/modules/manager/bazel/rules/maven.d.ts +7 -7
  274. package/dist/modules/manager/bazel/rules/oci.d.ts +6 -6
  275. package/dist/modules/manager/bazel-module/parser/fragments.d.ts +40 -40
  276. package/dist/modules/manager/bazel-module/parser/maven.d.ts +44 -90
  277. package/dist/modules/manager/bazel-module/parser/oci.d.ts +19 -42
  278. package/dist/modules/manager/bazel-module/rules.d.ts +50 -160
  279. package/dist/modules/manager/buildpacks/extract.d.ts +6 -1
  280. package/dist/modules/manager/buildpacks/extract.js +24 -14
  281. package/dist/modules/manager/buildpacks/extract.js.map +1 -1
  282. package/dist/modules/manager/bun/artifacts.js +0 -1
  283. package/dist/modules/manager/bun/artifacts.js.map +1 -1
  284. package/dist/modules/manager/bun/extract.d.ts +1 -0
  285. package/dist/modules/manager/bun/extract.js +53 -27
  286. package/dist/modules/manager/bun/extract.js.map +1 -1
  287. package/dist/modules/manager/bun/index.js +1 -1
  288. package/dist/modules/manager/bun/index.js.map +1 -1
  289. package/dist/modules/manager/bun/utils.d.ts +2 -0
  290. package/dist/modules/manager/bun/utils.js +22 -0
  291. package/dist/modules/manager/bun/utils.js.map +1 -0
  292. package/dist/modules/manager/bundler/artifacts.js +0 -1
  293. package/dist/modules/manager/bundler/artifacts.js.map +1 -1
  294. package/dist/modules/manager/bundler/extract.js +2 -1
  295. package/dist/modules/manager/bundler/extract.js.map +1 -1
  296. package/dist/modules/manager/cake/index.js +4 -2
  297. package/dist/modules/manager/cake/index.js.map +1 -1
  298. package/dist/modules/manager/cargo/artifacts.js +5 -7
  299. package/dist/modules/manager/cargo/artifacts.js.map +1 -1
  300. package/dist/modules/manager/cargo/schema.d.ts +166 -166
  301. package/dist/modules/manager/circleci/extract.js +21 -30
  302. package/dist/modules/manager/circleci/extract.js.map +1 -1
  303. package/dist/modules/manager/circleci/schema.d.ts +33 -144
  304. package/dist/modules/manager/circleci/schema.js +21 -17
  305. package/dist/modules/manager/circleci/schema.js.map +1 -1
  306. package/dist/modules/manager/cocoapods/artifacts.js +1 -2
  307. package/dist/modules/manager/cocoapods/artifacts.js.map +1 -1
  308. package/dist/modules/manager/composer/artifacts.js +1 -2
  309. package/dist/modules/manager/composer/artifacts.js.map +1 -1
  310. package/dist/modules/manager/composer/schema.d.ts +32 -34
  311. package/dist/modules/manager/composer/schema.js +1 -1
  312. package/dist/modules/manager/composer/schema.js.map +1 -1
  313. package/dist/modules/manager/composer/utils.d.ts +1 -0
  314. package/dist/modules/manager/composer/utils.js +18 -6
  315. package/dist/modules/manager/composer/utils.js.map +1 -1
  316. package/dist/modules/manager/conan/artifacts.d.ts +2 -0
  317. package/dist/modules/manager/conan/artifacts.js +76 -0
  318. package/dist/modules/manager/conan/artifacts.js.map +1 -0
  319. package/dist/modules/manager/conan/index.d.ts +2 -0
  320. package/dist/modules/manager/conan/index.js +4 -1
  321. package/dist/modules/manager/conan/index.js.map +1 -1
  322. package/dist/modules/manager/copier/artifacts.js +0 -1
  323. package/dist/modules/manager/copier/artifacts.js.map +1 -1
  324. package/dist/modules/manager/crossplane/schema.d.ts +2 -2
  325. package/dist/modules/manager/custom/jsonata/schema.d.ts +21 -21
  326. package/dist/modules/manager/custom/regex/index.js +2 -0
  327. package/dist/modules/manager/custom/regex/index.js.map +1 -1
  328. package/dist/modules/manager/deps-edn/extract.js +2 -1
  329. package/dist/modules/manager/deps-edn/extract.js.map +1 -1
  330. package/dist/modules/manager/devbox/artifacts.d.ts +1 -1
  331. package/dist/modules/manager/devbox/artifacts.js +35 -11
  332. package/dist/modules/manager/devbox/artifacts.js.map +1 -1
  333. package/dist/modules/manager/devbox/schema.js +1 -1
  334. package/dist/modules/manager/devbox/schema.js.map +1 -1
  335. package/dist/modules/manager/devcontainer/extract.js +43 -1
  336. package/dist/modules/manager/devcontainer/extract.js.map +1 -1
  337. package/dist/modules/manager/devcontainer/index.js +11 -1
  338. package/dist/modules/manager/devcontainer/index.js.map +1 -1
  339. package/dist/modules/manager/devcontainer/schema.d.ts +7 -3
  340. package/dist/modules/manager/devcontainer/schema.js +3 -1
  341. package/dist/modules/manager/devcontainer/schema.js.map +1 -1
  342. package/dist/modules/manager/docker-compose/schema.d.ts +6 -6
  343. package/dist/modules/manager/dockerfile/extract.js +2 -6
  344. package/dist/modules/manager/dockerfile/extract.js.map +1 -1
  345. package/dist/modules/manager/fingerprint.generated.js +86 -85
  346. package/dist/modules/manager/fingerprint.generated.js.map +1 -1
  347. package/dist/modules/manager/fleet/schema.d.ts +4 -4
  348. package/dist/modules/manager/flux/artifacts.js +0 -1
  349. package/dist/modules/manager/flux/artifacts.js.map +1 -1
  350. package/dist/modules/manager/flux/extract.js +27 -24
  351. package/dist/modules/manager/flux/extract.js.map +1 -1
  352. package/dist/modules/manager/flux/schema.d.ts +130 -154
  353. package/dist/modules/manager/github-actions/extract.js +60 -39
  354. package/dist/modules/manager/github-actions/extract.js.map +1 -1
  355. package/dist/modules/manager/github-actions/schema.d.ts +66 -0
  356. package/dist/modules/manager/github-actions/schema.js +38 -0
  357. package/dist/modules/manager/github-actions/schema.js.map +1 -0
  358. package/dist/modules/manager/gitlabci/extract.d.ts +1 -5
  359. package/dist/modules/manager/gitlabci/extract.js +27 -126
  360. package/dist/modules/manager/gitlabci/extract.js.map +1 -1
  361. package/dist/modules/manager/gitlabci/schema.d.ts +55 -0
  362. package/dist/modules/manager/gitlabci/schema.js +63 -0
  363. package/dist/modules/manager/gitlabci/schema.js.map +1 -0
  364. package/dist/modules/manager/gitlabci-include/extract.js +6 -54
  365. package/dist/modules/manager/gitlabci-include/extract.js.map +1 -1
  366. package/dist/modules/manager/gitlabci-include/schema.d.ts +13 -0
  367. package/dist/modules/manager/gitlabci-include/schema.js +46 -0
  368. package/dist/modules/manager/gitlabci-include/schema.js.map +1 -0
  369. package/dist/modules/manager/glasskube/schema.d.ts +8 -8
  370. package/dist/modules/manager/gomod/artifacts-extra.js +12 -4
  371. package/dist/modules/manager/gomod/artifacts-extra.js.map +1 -1
  372. package/dist/modules/manager/gomod/artifacts.js +24 -10
  373. package/dist/modules/manager/gomod/artifacts.js.map +1 -1
  374. package/dist/modules/manager/gomod/extract.js +23 -0
  375. package/dist/modules/manager/gomod/extract.js.map +1 -1
  376. package/dist/modules/manager/gomod/line-parser.js +16 -0
  377. package/dist/modules/manager/gomod/line-parser.js.map +1 -1
  378. package/dist/modules/manager/gomod/update.js +5 -3
  379. package/dist/modules/manager/gomod/update.js.map +1 -1
  380. package/dist/modules/manager/gradle/artifacts.js +0 -1
  381. package/dist/modules/manager/gradle/artifacts.js.map +1 -1
  382. package/dist/modules/manager/gradle/extract/catalog.js +1 -1
  383. package/dist/modules/manager/gradle/extract/catalog.js.map +1 -1
  384. package/dist/modules/manager/gradle/extract.js +8 -13
  385. package/dist/modules/manager/gradle/extract.js.map +1 -1
  386. package/dist/modules/manager/gradle/parser/assignments.js +2 -2
  387. package/dist/modules/manager/gradle/parser/assignments.js.map +1 -1
  388. package/dist/modules/manager/gradle/parser/handlers.d.ts +1 -2
  389. package/dist/modules/manager/gradle/parser/handlers.js +17 -24
  390. package/dist/modules/manager/gradle/parser/handlers.js.map +1 -1
  391. package/dist/modules/manager/gradle/parser/registry-urls.js +46 -12
  392. package/dist/modules/manager/gradle/parser/registry-urls.js.map +1 -1
  393. package/dist/modules/manager/gradle/types.d.ts +1 -0
  394. package/dist/modules/manager/gradle/types.js.map +1 -1
  395. package/dist/modules/manager/gradle-wrapper/artifacts.js +1 -2
  396. package/dist/modules/manager/gradle-wrapper/artifacts.js.map +1 -1
  397. package/dist/modules/manager/helmfile/artifacts.js +0 -1
  398. package/dist/modules/manager/helmfile/artifacts.js.map +1 -1
  399. package/dist/modules/manager/helmfile/extract.js +4 -0
  400. package/dist/modules/manager/helmfile/extract.js.map +1 -1
  401. package/dist/modules/manager/helmfile/schema.d.ts +9 -9
  402. package/dist/modules/manager/helmv3/artifacts.js +0 -1
  403. package/dist/modules/manager/helmv3/artifacts.js.map +1 -1
  404. package/dist/modules/manager/helmv3/utils.js +3 -1
  405. package/dist/modules/manager/helmv3/utils.js.map +1 -1
  406. package/dist/modules/manager/hermit/artifacts.js +0 -1
  407. package/dist/modules/manager/hermit/artifacts.js.map +1 -1
  408. package/dist/modules/manager/homebrew/extract.js +0 -1
  409. package/dist/modules/manager/homebrew/extract.js.map +1 -1
  410. package/dist/modules/manager/jsonnet-bundler/artifacts.js +0 -1
  411. package/dist/modules/manager/jsonnet-bundler/artifacts.js.map +1 -1
  412. package/dist/modules/manager/kustomize/artifacts.d.ts +2 -0
  413. package/dist/modules/manager/kustomize/artifacts.js +154 -0
  414. package/dist/modules/manager/kustomize/artifacts.js.map +1 -0
  415. package/dist/modules/manager/kustomize/common.d.ts +3 -0
  416. package/dist/modules/manager/kustomize/common.js +22 -0
  417. package/dist/modules/manager/kustomize/common.js.map +1 -0
  418. package/dist/modules/manager/kustomize/index.d.ts +1 -0
  419. package/dist/modules/manager/kustomize/index.js +3 -1
  420. package/dist/modules/manager/kustomize/index.js.map +1 -1
  421. package/dist/modules/manager/kustomize/types.d.ts +4 -0
  422. package/dist/modules/manager/kustomize/types.js.map +1 -1
  423. package/dist/modules/manager/maven/extract.d.ts +2 -2
  424. package/dist/modules/manager/maven/extract.js +14 -9
  425. package/dist/modules/manager/maven/extract.js.map +1 -1
  426. package/dist/modules/manager/maven-wrapper/artifacts.js +0 -1
  427. package/dist/modules/manager/maven-wrapper/artifacts.js.map +1 -1
  428. package/dist/modules/manager/mise/extract.js +1 -1
  429. package/dist/modules/manager/mise/extract.js.map +1 -1
  430. package/dist/modules/manager/mix/artifacts.js +64 -14
  431. package/dist/modules/manager/mix/artifacts.js.map +1 -1
  432. package/dist/modules/manager/mix/index.d.ts +1 -0
  433. package/dist/modules/manager/mix/index.js +2 -1
  434. package/dist/modules/manager/mix/index.js.map +1 -1
  435. package/dist/modules/manager/nix/artifacts.js +0 -1
  436. package/dist/modules/manager/nix/artifacts.js.map +1 -1
  437. package/dist/modules/manager/nix/extract.js +1 -1
  438. package/dist/modules/manager/nix/extract.js.map +1 -1
  439. package/dist/modules/manager/nix/schema.d.ts +20 -20
  440. package/dist/modules/manager/nix/schema.js +1 -0
  441. package/dist/modules/manager/nix/schema.js.map +1 -1
  442. package/dist/modules/manager/npm/artifacts.js +0 -1
  443. package/dist/modules/manager/npm/artifacts.js.map +1 -1
  444. package/dist/modules/manager/npm/extract/common/package-file.js +1 -0
  445. package/dist/modules/manager/npm/extract/common/package-file.js.map +1 -1
  446. package/dist/modules/manager/npm/extract/yarn.js +2 -2
  447. package/dist/modules/manager/npm/extract/yarn.js.map +1 -1
  448. package/dist/modules/manager/npm/post-update/npm.js +0 -1
  449. package/dist/modules/manager/npm/post-update/npm.js.map +1 -1
  450. package/dist/modules/manager/npm/post-update/pnpm.js +13 -2
  451. package/dist/modules/manager/npm/post-update/pnpm.js.map +1 -1
  452. package/dist/modules/manager/npm/post-update/rules.js +11 -1
  453. package/dist/modules/manager/npm/post-update/rules.js.map +1 -1
  454. package/dist/modules/manager/npm/post-update/yarn.js +0 -1
  455. package/dist/modules/manager/npm/post-update/yarn.js.map +1 -1
  456. package/dist/modules/manager/npm/schema.d.ts +13 -13
  457. package/dist/modules/manager/npm/update/dependency/index.js +1 -1
  458. package/dist/modules/manager/npm/update/dependency/index.js.map +1 -1
  459. package/dist/modules/manager/nuget/artifacts.js +1 -2
  460. package/dist/modules/manager/nuget/artifacts.js.map +1 -1
  461. package/dist/modules/manager/nuget/extract.js +21 -18
  462. package/dist/modules/manager/nuget/extract.js.map +1 -1
  463. package/dist/modules/manager/nuget/package-tree.js +4 -0
  464. package/dist/modules/manager/nuget/package-tree.js.map +1 -1
  465. package/dist/modules/manager/nuget/schema.d.ts +8 -8
  466. package/dist/modules/manager/nuget/util.js +4 -1
  467. package/dist/modules/manager/nuget/util.js.map +1 -1
  468. package/dist/modules/manager/ocb/schema.d.ts +6 -6
  469. package/dist/modules/manager/pep621/extract.js +19 -3
  470. package/dist/modules/manager/pep621/extract.js.map +1 -1
  471. package/dist/modules/manager/pep621/processors/pdm.js +3 -2
  472. package/dist/modules/manager/pep621/processors/pdm.js.map +1 -1
  473. package/dist/modules/manager/pep621/processors/uv.js +4 -1
  474. package/dist/modules/manager/pep621/processors/uv.js.map +1 -1
  475. package/dist/modules/manager/pep621/schema.d.ts +341 -49
  476. package/dist/modules/manager/pep621/schema.js +3 -1
  477. package/dist/modules/manager/pep621/schema.js.map +1 -1
  478. package/dist/modules/manager/pep621/utils.js +1 -1
  479. package/dist/modules/manager/pep621/utils.js.map +1 -1
  480. package/dist/modules/manager/pip-compile/common.js +0 -1
  481. package/dist/modules/manager/pip-compile/common.js.map +1 -1
  482. package/dist/modules/manager/pip_requirements/artifacts.js +0 -1
  483. package/dist/modules/manager/pip_requirements/artifacts.js.map +1 -1
  484. package/dist/modules/manager/pip_requirements/common.js +2 -6
  485. package/dist/modules/manager/pip_requirements/common.js.map +1 -1
  486. package/dist/modules/manager/pipenv/artifacts.js +0 -1
  487. package/dist/modules/manager/pipenv/artifacts.js.map +1 -1
  488. package/dist/modules/manager/pixi/artifacts.d.ts +3 -0
  489. package/dist/modules/manager/pixi/artifacts.js +78 -0
  490. package/dist/modules/manager/pixi/artifacts.js.map +1 -0
  491. package/dist/modules/manager/pixi/extract.d.ts +4 -0
  492. package/dist/modules/manager/pixi/extract.js +131 -0
  493. package/dist/modules/manager/pixi/extract.js.map +1 -0
  494. package/dist/modules/manager/pixi/index.d.ts +10 -0
  495. package/dist/modules/manager/pixi/index.js +20 -0
  496. package/dist/modules/manager/pixi/index.js.map +1 -0
  497. package/dist/modules/manager/pixi/schema.d.ts +405 -0
  498. package/dist/modules/manager/pixi/schema.js +147 -0
  499. package/dist/modules/manager/pixi/schema.js.map +1 -0
  500. package/dist/modules/manager/poetry/artifacts.js +3 -4
  501. package/dist/modules/manager/poetry/artifacts.js.map +1 -1
  502. package/dist/modules/manager/poetry/extract.js +2 -1
  503. package/dist/modules/manager/poetry/extract.js.map +1 -1
  504. package/dist/modules/manager/poetry/schema.d.ts +44 -44
  505. package/dist/modules/manager/pub/artifacts.js +0 -1
  506. package/dist/modules/manager/pub/artifacts.js.map +1 -1
  507. package/dist/modules/manager/pub/schema.d.ts +8 -8
  508. package/dist/modules/manager/scalafmt/extract.js +1 -1
  509. package/dist/modules/manager/scalafmt/extract.js.map +1 -1
  510. package/dist/modules/manager/sveltos/schema.d.ts +30 -42
  511. package/dist/modules/manager/terraform/lockfile/hash.d.ts +1 -1
  512. package/dist/modules/manager/terraform/util.js +1 -3
  513. package/dist/modules/manager/terraform/util.js.map +1 -1
  514. package/dist/modules/manager/types.d.ts +6 -2
  515. package/dist/modules/manager/types.js.map +1 -1
  516. package/dist/modules/manager/vendir/schema.d.ts +7 -7
  517. package/dist/modules/platform/api.d.ts +1 -1
  518. package/dist/modules/platform/azure/azure-helper.js +2 -2
  519. package/dist/modules/platform/azure/azure-helper.js.map +1 -1
  520. package/dist/modules/platform/azure/index.js +14 -14
  521. package/dist/modules/platform/azure/index.js.map +1 -1
  522. package/dist/modules/platform/bitbucket/comments.js +4 -4
  523. package/dist/modules/platform/bitbucket/comments.js.map +1 -1
  524. package/dist/modules/platform/bitbucket/index.js +49 -44
  525. package/dist/modules/platform/bitbucket/index.js.map +1 -1
  526. package/dist/modules/platform/bitbucket/schema.d.ts +14 -14
  527. package/dist/modules/platform/bitbucket/utils.js +3 -3
  528. package/dist/modules/platform/bitbucket/utils.js.map +1 -1
  529. package/dist/modules/platform/bitbucket-server/index.d.ts +2 -2
  530. package/dist/modules/platform/bitbucket-server/index.js +81 -81
  531. package/dist/modules/platform/bitbucket-server/index.js.map +1 -1
  532. package/dist/modules/platform/bitbucket-server/pr-cache.d.ts +23 -0
  533. package/dist/modules/platform/bitbucket-server/pr-cache.js +125 -0
  534. package/dist/modules/platform/bitbucket-server/pr-cache.js.map +1 -0
  535. package/dist/modules/platform/bitbucket-server/schema.d.ts +76 -0
  536. package/dist/modules/platform/bitbucket-server/schema.js +15 -1
  537. package/dist/modules/platform/bitbucket-server/schema.js.map +1 -1
  538. package/dist/modules/platform/bitbucket-server/types.d.ts +8 -2
  539. package/dist/modules/platform/bitbucket-server/types.js.map +1 -1
  540. package/dist/modules/platform/bitbucket-server/utils.d.ts +0 -2
  541. package/dist/modules/platform/bitbucket-server/utils.js +6 -52
  542. package/dist/modules/platform/bitbucket-server/utils.js.map +1 -1
  543. package/dist/modules/platform/codecommit/codecommit-client.js +6 -6
  544. package/dist/modules/platform/codecommit/codecommit-client.js.map +1 -1
  545. package/dist/modules/platform/codecommit/index.js +24 -24
  546. package/dist/modules/platform/codecommit/index.js.map +1 -1
  547. package/dist/modules/platform/gerrit/client.d.ts +0 -3
  548. package/dist/modules/platform/gerrit/client.js +20 -29
  549. package/dist/modules/platform/gerrit/client.js.map +1 -1
  550. package/dist/modules/platform/gerrit/index.js +0 -6
  551. package/dist/modules/platform/gerrit/index.js.map +1 -1
  552. package/dist/modules/platform/gerrit/scm.js +5 -6
  553. package/dist/modules/platform/gerrit/scm.js.map +1 -1
  554. package/dist/modules/platform/gerrit/types.d.ts +1 -4
  555. package/dist/modules/platform/gerrit/types.js.map +1 -1
  556. package/dist/modules/platform/gerrit/utils.d.ts +3 -2
  557. package/dist/modules/platform/gerrit/utils.js +4 -8
  558. package/dist/modules/platform/gerrit/utils.js.map +1 -1
  559. package/dist/modules/platform/gitea/gitea-helper.d.ts +1 -0
  560. package/dist/modules/platform/gitea/gitea-helper.js +16 -0
  561. package/dist/modules/platform/gitea/gitea-helper.js.map +1 -1
  562. package/dist/modules/platform/gitea/index.js +22 -16
  563. package/dist/modules/platform/gitea/index.js.map +1 -1
  564. package/dist/modules/platform/gitea/schema.d.ts +8 -8
  565. package/dist/modules/platform/gitea/types.d.ts +1 -1
  566. package/dist/modules/platform/gitea/types.js.map +1 -1
  567. package/dist/modules/platform/github/common.d.ts +2 -0
  568. package/dist/modules/platform/github/common.js +16 -0
  569. package/dist/modules/platform/github/common.js.map +1 -1
  570. package/dist/modules/platform/github/index.d.ts +1 -1
  571. package/dist/modules/platform/github/index.js +87 -82
  572. package/dist/modules/platform/github/index.js.map +1 -1
  573. package/dist/modules/platform/github/issue.d.ts +18 -18
  574. package/dist/modules/platform/github/massage-markdown-links.js +2 -2
  575. package/dist/modules/platform/github/massage-markdown-links.js.map +1 -1
  576. package/dist/modules/platform/github/pr.js +3 -3
  577. package/dist/modules/platform/github/pr.js.map +1 -1
  578. package/dist/modules/platform/github/schema.d.ts +128 -128
  579. package/dist/modules/platform/github/schema.js +3 -1
  580. package/dist/modules/platform/github/schema.js.map +1 -1
  581. package/dist/modules/platform/gitlab/index.js +63 -49
  582. package/dist/modules/platform/gitlab/index.js.map +1 -1
  583. package/dist/modules/platform/index.js +0 -1
  584. package/dist/modules/platform/index.js.map +1 -1
  585. package/dist/modules/platform/scm.d.ts +1 -1
  586. package/dist/modules/versioning/api.js +2 -0
  587. package/dist/modules/versioning/api.js.map +1 -1
  588. package/dist/modules/versioning/composer/index.js +10 -0
  589. package/dist/modules/versioning/composer/index.js.map +1 -1
  590. package/dist/modules/versioning/conda/index.d.ts +41 -0
  591. package/dist/modules/versioning/conda/index.js +178 -0
  592. package/dist/modules/versioning/conda/index.js.map +1 -0
  593. package/dist/modules/versioning/distro.js +1 -3
  594. package/dist/modules/versioning/distro.js.map +1 -1
  595. package/dist/modules/versioning/hashicorp/convertor.d.ts +2 -1
  596. package/dist/modules/versioning/hashicorp/convertor.js +13 -8
  597. package/dist/modules/versioning/hashicorp/convertor.js.map +1 -1
  598. package/dist/modules/versioning/hex/index.js +3 -3
  599. package/dist/modules/versioning/hex/index.js.map +1 -1
  600. package/dist/modules/versioning/npm/index.js +2 -1
  601. package/dist/modules/versioning/npm/index.js.map +1 -1
  602. package/dist/modules/versioning/types.d.ts +4 -0
  603. package/dist/modules/versioning/types.js.map +1 -1
  604. package/dist/proxy.js +2 -1
  605. package/dist/proxy.js.map +1 -1
  606. package/dist/renovate.js +2 -2
  607. package/dist/renovate.js.map +1 -1
  608. package/dist/util/cache/package/redis.js +0 -1
  609. package/dist/util/cache/package/redis.js.map +1 -1
  610. package/dist/util/cache/package/types.d.ts +1 -1
  611. package/dist/util/cache/package/types.js.map +1 -1
  612. package/dist/util/cache/repository/impl/base.d.ts +1 -1
  613. package/dist/util/cache/repository/impl/base.js +4 -0
  614. package/dist/util/cache/repository/impl/base.js.map +1 -1
  615. package/dist/util/cache/repository/schema.d.ts +4 -4
  616. package/dist/util/cache/repository/types.d.ts +3 -0
  617. package/dist/util/cache/repository/types.js.map +1 -1
  618. package/dist/util/common.d.ts +4 -2
  619. package/dist/util/common.js +17 -3
  620. package/dist/util/common.js.map +1 -1
  621. package/dist/util/env.d.ts +4 -0
  622. package/dist/util/env.js +22 -0
  623. package/dist/util/env.js.map +1 -0
  624. package/dist/util/exec/containerbase.js +19 -14
  625. package/dist/util/exec/containerbase.js.map +1 -1
  626. package/dist/util/exec/index.js +5 -2
  627. package/dist/util/exec/index.js.map +1 -1
  628. package/dist/util/exec/types.d.ts +0 -2
  629. package/dist/util/exec/types.js.map +1 -1
  630. package/dist/util/exec/utils.d.ts +1 -1
  631. package/dist/util/exec/utils.js +6 -5
  632. package/dist/util/exec/utils.js.map +1 -1
  633. package/dist/util/git/auth.js +8 -5
  634. package/dist/util/git/auth.js.map +1 -1
  635. package/dist/util/git/author.js +1 -1
  636. package/dist/util/git/author.js.map +1 -1
  637. package/dist/util/git/config.js +0 -1
  638. package/dist/util/git/config.js.map +1 -1
  639. package/dist/util/git/error.js +4 -2
  640. package/dist/util/git/error.js.map +1 -1
  641. package/dist/util/git/index.js +75 -52
  642. package/dist/util/git/index.js.map +1 -1
  643. package/dist/util/git/private-key.js +2 -4
  644. package/dist/util/git/private-key.js.map +1 -1
  645. package/dist/util/git/types.d.ts +2 -0
  646. package/dist/util/git/types.js.map +1 -1
  647. package/dist/util/git/url.js +1 -1
  648. package/dist/util/git/url.js.map +1 -1
  649. package/dist/util/github/graphql/datasource-fetcher.js +3 -5
  650. package/dist/util/github/graphql/datasource-fetcher.js.map +1 -1
  651. package/dist/util/github/graphql/query-adapters/releases-query-adapter.d.ts +2 -2
  652. package/dist/util/github/graphql/query-adapters/tags-query-adapter.d.ts +2 -2
  653. package/dist/util/http/auth.js +0 -1
  654. package/dist/util/http/auth.js.map +1 -1
  655. package/dist/util/http/bitbucket-server.d.ts +7 -5
  656. package/dist/util/http/bitbucket-server.js +26 -23
  657. package/dist/util/http/bitbucket-server.js.map +1 -1
  658. package/dist/util/http/bitbucket.d.ts +6 -5
  659. package/dist/util/http/bitbucket.js +34 -31
  660. package/dist/util/http/bitbucket.js.map +1 -1
  661. package/dist/util/http/cache/abstract-http-cache-provider.js +2 -2
  662. package/dist/util/http/cache/abstract-http-cache-provider.js.map +1 -1
  663. package/dist/util/http/cache/memory-http-cache-provider.d.ts +10 -0
  664. package/dist/util/http/cache/memory-http-cache-provider.js +29 -0
  665. package/dist/util/http/cache/memory-http-cache-provider.js.map +1 -0
  666. package/dist/util/http/cache/package-http-cache-provider.d.ts +23 -0
  667. package/dist/util/http/cache/package-http-cache-provider.js +80 -0
  668. package/dist/util/http/cache/package-http-cache-provider.js.map +1 -0
  669. package/dist/util/http/cache/schema.d.ts +2 -2
  670. package/dist/util/http/errors.d.ts +2 -0
  671. package/dist/util/http/errors.js +8 -0
  672. package/dist/util/http/errors.js.map +1 -0
  673. package/dist/util/http/gerrit.d.ts +6 -4
  674. package/dist/util/http/gerrit.js +11 -12
  675. package/dist/util/http/gerrit.js.map +1 -1
  676. package/dist/util/http/gitea.d.ts +5 -4
  677. package/dist/util/http/gitea.js +14 -13
  678. package/dist/util/http/gitea.js.map +1 -1
  679. package/dist/util/http/github.d.ts +14 -8
  680. package/dist/util/http/github.js +65 -60
  681. package/dist/util/http/github.js.map +1 -1
  682. package/dist/util/http/gitlab.d.ts +7 -5
  683. package/dist/util/http/gitlab.js +58 -46
  684. package/dist/util/http/gitlab.js.map +1 -1
  685. package/dist/util/http/got.d.ts +9 -0
  686. package/dist/util/http/got.js +54 -0
  687. package/dist/util/http/got.js.map +1 -0
  688. package/dist/util/http/host-rules.d.ts +2 -1
  689. package/dist/util/http/host-rules.js +17 -4
  690. package/dist/util/http/host-rules.js.map +1 -1
  691. package/dist/util/http/http.d.ts +93 -0
  692. package/dist/util/http/http.js +346 -0
  693. package/dist/util/http/http.js.map +1 -0
  694. package/dist/util/http/index.d.ts +6 -74
  695. package/dist/util/http/index.js +5 -359
  696. package/dist/util/http/index.js.map +1 -1
  697. package/dist/util/http/legacy.js +4 -1
  698. package/dist/util/http/legacy.js.map +1 -1
  699. package/dist/util/http/types.d.ts +9 -16
  700. package/dist/util/http/types.js.map +1 -1
  701. package/dist/util/schema-utils.d.ts +1 -0
  702. package/dist/util/schema-utils.js +43 -8
  703. package/dist/util/schema-utils.js.map +1 -1
  704. package/dist/util/stats.d.ts +10 -0
  705. package/dist/util/stats.js +45 -1
  706. package/dist/util/stats.js.map +1 -1
  707. package/dist/util/string.d.ts +16 -0
  708. package/dist/util/string.js +79 -0
  709. package/dist/util/string.js.map +1 -1
  710. package/dist/util/toml.d.ts +1 -0
  711. package/dist/util/toml.js +6 -0
  712. package/dist/util/toml.js.map +1 -1
  713. package/dist/util/url.js +3 -8
  714. package/dist/util/url.js.map +1 -1
  715. package/dist/util/yaml.js +3 -8
  716. package/dist/util/yaml.js.map +1 -1
  717. package/dist/workers/global/autodiscover.js +1 -19
  718. package/dist/workers/global/autodiscover.js.map +1 -1
  719. package/dist/workers/global/config/parse/env.js +3 -3
  720. package/dist/workers/global/config/parse/env.js.map +1 -1
  721. package/dist/workers/global/config/parse/file.js +18 -8
  722. package/dist/workers/global/config/parse/file.js.map +1 -1
  723. package/dist/workers/global/config/parse/host-rules-from-env.js +6 -2
  724. package/dist/workers/global/config/parse/host-rules-from-env.js.map +1 -1
  725. package/dist/workers/global/config/parse/index.js +15 -0
  726. package/dist/workers/global/config/parse/index.js.map +1 -1
  727. package/dist/workers/global/index.js +4 -2
  728. package/dist/workers/global/index.js.map +1 -1
  729. package/dist/workers/repository/cache.js +1 -2
  730. package/dist/workers/repository/cache.js.map +1 -1
  731. package/dist/workers/repository/config-migration/branch/migrated-data.js +2 -0
  732. package/dist/workers/repository/config-migration/branch/migrated-data.js.map +1 -1
  733. package/dist/workers/repository/index.js +1 -0
  734. package/dist/workers/repository/index.js.map +1 -1
  735. package/dist/workers/repository/init/merge.js +6 -3
  736. package/dist/workers/repository/init/merge.js.map +1 -1
  737. package/dist/workers/repository/onboarding/pr/config-description.js +3 -1
  738. package/dist/workers/repository/onboarding/pr/config-description.js.map +1 -1
  739. package/dist/workers/repository/onboarding/pr/index.js +4 -0
  740. package/dist/workers/repository/onboarding/pr/index.js.map +1 -1
  741. package/dist/workers/repository/process/extract-update.js +0 -1
  742. package/dist/workers/repository/process/extract-update.js.map +1 -1
  743. package/dist/workers/repository/process/fingerprint-fields.js +0 -1
  744. package/dist/workers/repository/process/fingerprint-fields.js.map +1 -1
  745. package/dist/workers/repository/process/libyear.js +2 -2
  746. package/dist/workers/repository/process/libyear.js.map +1 -1
  747. package/dist/workers/repository/process/lookup/index.js +15 -4
  748. package/dist/workers/repository/process/lookup/index.js.map +1 -1
  749. package/dist/workers/repository/process/lookup/timestamps.d.ts +18 -0
  750. package/dist/workers/repository/process/lookup/timestamps.js +69 -0
  751. package/dist/workers/repository/process/lookup/timestamps.js.map +1 -0
  752. package/dist/workers/repository/process/lookup/types.d.ts +1 -0
  753. package/dist/workers/repository/process/lookup/types.js.map +1 -1
  754. package/dist/workers/repository/process/lookup/utils.js +20 -9
  755. package/dist/workers/repository/process/lookup/utils.js.map +1 -1
  756. package/dist/workers/repository/process/sort.js +1 -1
  757. package/dist/workers/repository/process/sort.js.map +1 -1
  758. package/dist/workers/repository/process/vulnerabilities.js +1 -1
  759. package/dist/workers/repository/process/vulnerabilities.js.map +1 -1
  760. package/dist/workers/repository/process/write.js +1 -8
  761. package/dist/workers/repository/process/write.js.map +1 -1
  762. package/dist/workers/repository/reconfigure/utils.d.ts +2 -0
  763. package/dist/workers/repository/reconfigure/utils.js +16 -0
  764. package/dist/workers/repository/reconfigure/utils.js.map +1 -1
  765. package/dist/workers/repository/reconfigure/validate.js +6 -17
  766. package/dist/workers/repository/reconfigure/validate.js.map +1 -1
  767. package/dist/workers/repository/update/branch/auto-replace.js +25 -5
  768. package/dist/workers/repository/update/branch/auto-replace.js.map +1 -1
  769. package/dist/workers/repository/update/branch/commit.js +2 -0
  770. package/dist/workers/repository/update/branch/commit.js.map +1 -1
  771. package/dist/workers/repository/update/branch/execute-post-upgrade-commands.js +17 -8
  772. package/dist/workers/repository/update/branch/execute-post-upgrade-commands.js.map +1 -1
  773. package/dist/workers/repository/update/pr/body/config-description.js +26 -1
  774. package/dist/workers/repository/update/pr/body/config-description.js.map +1 -1
  775. package/dist/workers/repository/update/pr/body/index.js +21 -14
  776. package/dist/workers/repository/update/pr/body/index.js.map +1 -1
  777. package/dist/workers/repository/update/pr/changelog/api.js +8 -6
  778. package/dist/workers/repository/update/pr/changelog/api.js.map +1 -1
  779. package/dist/workers/repository/update/pr/changelog/bitbucket/index.js +1 -1
  780. package/dist/workers/repository/update/pr/changelog/bitbucket/index.js.map +1 -1
  781. package/dist/workers/repository/update/pr/changelog/bitbucket-server/index.d.ts +3 -0
  782. package/dist/workers/repository/update/pr/changelog/bitbucket-server/index.js +39 -0
  783. package/dist/workers/repository/update/pr/changelog/bitbucket-server/index.js.map +1 -0
  784. package/dist/workers/repository/update/pr/changelog/bitbucket-server/source.d.ts +8 -0
  785. package/dist/workers/repository/update/pr/changelog/bitbucket-server/source.js +31 -0
  786. package/dist/workers/repository/update/pr/changelog/bitbucket-server/source.js.map +1 -0
  787. package/dist/workers/repository/update/pr/changelog/github/index.js +6 -3
  788. package/dist/workers/repository/update/pr/changelog/github/index.js.map +1 -1
  789. package/dist/workers/repository/update/pr/changelog/gitlab/index.js +1 -1
  790. package/dist/workers/repository/update/pr/changelog/gitlab/index.js.map +1 -1
  791. package/dist/workers/repository/update/pr/changelog/release-notes.js +12 -8
  792. package/dist/workers/repository/update/pr/changelog/release-notes.js.map +1 -1
  793. package/dist/workers/repository/update/pr/changelog/source.d.ts +1 -1
  794. package/dist/workers/repository/update/pr/changelog/source.js +1 -0
  795. package/dist/workers/repository/update/pr/changelog/source.js.map +1 -1
  796. package/dist/workers/repository/update/pr/changelog/types.d.ts +1 -1
  797. package/dist/workers/repository/update/pr/changelog/types.js.map +1 -1
  798. package/dist/workers/repository/update/pr/index.js +2 -4
  799. package/dist/workers/repository/update/pr/index.js.map +1 -1
  800. package/dist/workers/repository/updates/flatten.js +8 -4
  801. package/dist/workers/repository/updates/flatten.js.map +1 -1
  802. package/dist/workers/repository/updates/generate.js +3 -2
  803. package/dist/workers/repository/updates/generate.js.map +1 -1
  804. package/dist/workers/types.d.ts +1 -4
  805. package/dist/workers/types.js.map +1 -1
  806. package/package.json +86 -83
  807. package/renovate-schema.json +25 -10
  808. package/dist/modules/manager/github-actions/types.d.ts +0 -30
  809. package/dist/modules/manager/github-actions/types.js +0 -3
  810. package/dist/modules/manager/github-actions/types.js.map +0 -1
  811. package/dist/modules/manager/gitlabci/common.d.ts +0 -6
  812. package/dist/modules/manager/gitlabci/common.js +0 -30
  813. package/dist/modules/manager/gitlabci/common.js.map +0 -1
  814. package/dist/modules/manager/gitlabci/types.d.ts +0 -35
  815. package/dist/modules/manager/gitlabci/types.js +0 -3
  816. package/dist/modules/manager/gitlabci/types.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/modules/versioning/composer/index.ts"],"names":[],"mappings":";;;AAyMA,0BAEC;AAED,8BAEC;;AA/MD,kEAAkC;AAClC,4DAA4B;AAC5B,+CAA0C;AAC1C,4CAAyC;AAEzC,+CAA4C;AAC5C,gCAAoC;AAGvB,QAAA,EAAE,GAAG,UAAU,CAAC;AAChB,QAAA,WAAW,GAAG,UAAU,CAAC;AACzB,QAAA,IAAI,GAAG;IAClB,kDAAkD;IAClD,gDAAgD;IAChD,sDAAsD;IACtD,uBAAuB;CACxB,CAAC;AACW,QAAA,cAAc,GAAG,IAAI,CAAC;AACtB,QAAA,wBAAwB,GAAoB;IACvD,MAAM;IACN,OAAO;IACP,KAAK;IACL,SAAS;IACT,iBAAiB;CAClB,CAAC;AAEF,SAAS,eAAe,CAAC,KAAa;IACpC,MAAM,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACtC,IAAI,YAAY,CAAC,MAAM,KA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BAA+B,CAAC,CAAC,CAAC,CAAC;IAE3E,IAAI,cAAc,KAAK,cAAc,EAAE,CAAC;QACtC,wIAAwI;QACxI,OAAO,SAAG,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5D,CAAC;SAAM,IACL,SAAG,CAAC,MAAM,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,YAAY,CAAC,aAAa,CAAC,CAAC,EACpE,CAAC;QACD,mLAAmL;QACnL,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACjC,CAAC;SAAM,CAAC;QACN,mDAAmD;QACnD,OAAO,SAAG,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC;AAED,SAAS,YAAY,CAAC,OAAe;IACnC,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC;AAC5B,CAAC;AAEY,QAAA,GAAG,GAAkB;IAChC,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,YAAY;IACZ,aAAa;IACb,eAAe;IACf,eAAe;IACf,QAAQ;IACR,OAAO;IACP,SAAS;IACT,OAAO;IACP,oBAAoB;IACpB,oBAAoB;IACpB,WAAW;IACX,YAAY;IACZ,MAAM;CACP,CAAC;AACF,kBAAe,WAAG,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport semver from 'semver';\nimport { parseRange } from 'semver-utils';\nimport { logger } from '../../../logger';\nimport type { RangeStrategy } from '../../../types/versioning';\nimport { regEx } from '../../../util/regex';\nimport { api as npm } from '../npm';\nimport type { NewValueConfig, VersioningApi } from '../types';\n\nexport const id = 'composer';\nexport const displayName = 'Composer';\nexport const urls = [\n 'https://getcomposer.org/doc/articles/versions.md',\n 'https://packagist.org/packages/composer/semver',\n 'https://madewithlove.be/tilde-and-caret-constraints/',\n 'https://semver.mwl.be',\n];\nexport const supportsRanges = true;\nexport const supportedRangeStrategies: RangeStrategy[] = [\n 'bump',\n 'widen',\n 'pin',\n 'replace',\n 'update-lockfile',\n];\n\nfunction getVersionParts(input: string): [string, string] {\n const versionParts = input.split('-');\n if (versionParts.length === 1) {\n return [input, ''];\n }\n\n return [versionParts[0], '-' + versionParts[1]];\n}\n\nfunction padZeroes(input: string): string {\n const [output, stability] = getVersionParts(input);\n\n const sections = output.split('.');\n while (sections.length < 3) {\n sections.push('0');\n }\n return sections.join('.') + stability;\n}\n\nfunction convertStabilityModifier(input: string): string {\n // Handle stability modifiers.\n const versionParts = input.split('@');\n if (versionParts.length === 1) {\n return input;\n }\n\n // 1.0@beta2 to 1.0-beta.2\n const stability = versionParts[1].replace(\n regEx(/(?:^|\\s)(beta|alpha|rc)([1-9][0-9]*)(?: |$)/gi),\n '$1.$2',\n );\n\n // If there is a stability part, npm semver expects the version\n // to be full\n return padZeroes(versionParts[0]) + '-' + stability;\n}\n\nfunction normalizeVersion(input: string): string {\n let output = input;\n output = output.replace(regEx(/(^|>|>=|\\^|~)v/i), '$1');\n return convertStabilityModifier(output);\n}\n\n/**\n * @param versions Version list in any format, it recognizes the specific patch format x.x.x-pXX\n * @param range Range in composer format\n * @param minMode If true, it will calculate minSatisfyingVersion, if false, it calculates the maxSatisfyingVersion\n * @returns min or max satisfyingVersion from the input\n */\nfunction calculateSatisfyingVersionIntenal(\n versions: string[],\n range: string,\n minMode: boolean,\n): string | null {\n // Because composer -p versions are considered stable, we have to remove the suffix for the npm.XXX functions.\n const versionsMapped = versions.map((x) => {\n return {\n origianl: x,\n cleaned: removeComposerSpecificPatchPart(x),\n npmVariant: composer2npm(removeComposerSpecificPatchPart(x)[0]),\n };\n });\n\n const npmVersions = versionsMapped.map((x) => x.npmVariant);\n const npmVersion = minMode\n ? npm.minSatisfyingVersion(npmVersions, composer2npm(range))\n : npm.getSatisfyingVersion(npmVersions, composer2npm(range));\n\n if (!npmVersion) {\n return null;\n }\n\n // After we find the npm versions, we select from them back in the mapping the possible patches.\n const candidates = versionsMapped\n .filter((x) => x.npmVariant === npmVersion)\n .sort((a, b) => (minMode ? 1 : -1) * sortVersions(a.origianl, b.origianl));\n\n return candidates[0].origianl;\n}\n\n/**\n * @param intput Version in any format, it recognizes the specific patch format x.x.x-pXX\n * @returns If input contains the specific patch, it returns the input with removed the patch and true, otherwise it retunrs the same string and false.\n */\nfunction removeComposerSpecificPatchPart(input: string): [string, boolean] {\n // the regex is based on the original from composer implementation https://github.com/composer/semver/blob/fa1ec24f0ab1efe642671ec15c51a3ab879f59bf/src/VersionParser.php#L137\n const pattern = /^v?\\d+(\\.\\d+(\\.\\d+(\\.\\d+)?)?)?(?<suffix>-p[1-9]\\d*)$/gi;\n const match = pattern.exec(input);\n\n return match\n ? [input.replace(match.groups!.suffix, ''), true]\n : [input, false];\n}\n\nfunction composer2npm(input: string): string {\n return input\n .split(regEx(/\\s*\\|\\|?\\s*/g))\n .map((part): string => {\n const cleanInput = normalizeVersion(part);\n if (npm.isVersion(cleanInput)) {\n return cleanInput;\n }\n if (npm.isVersion(padZeroes(cleanInput))) {\n return padZeroes(cleanInput);\n }\n const [versionId, stability] = getVersionParts(cleanInput);\n let output = versionId;\n\n // ~4 to ^4 and ~4.1 to ^4.1\n output = output.replace(\n regEx(/(?:^|\\s)~([1-9][0-9]*(?:\\.[0-9]*)?)(?: |$)/g),\n '^$1',\n );\n // ~0.4 to >=0.4 <1\n output = output.replace(\n regEx(/(?:^|\\s)~(0\\.[1-9][0-9]*)(?: |$)/g),\n '>=$1 <1',\n );\n\n // add extra digits to <8-DEV and <8.0-DEV\n output = output\n .replace(regEx(/^(<\\d+(\\.\\d+)?)$/g), '$1.0')\n .replace(regEx(/^(<\\d+(\\.\\d+)?)$/g), '$1.0');\n\n return output + stability;\n })\n .map((part) => part.replace(/([a-z])([0-9])/gi, '$1.$2'))\n .join(' || ');\n}\n\nfunction equals(a: string, b: string): boolean {\n return npm.equals(composer2npm(a), composer2npm(b));\n}\n\nfunction getMajor(version: string): number | null {\n const semverVersion = semver.coerce(composer2npm(version));\n return semverVersion ? npm.getMajor(semverVersion) : null;\n}\n\nfunction getMinor(version: string): number | null {\n const semverVersion = semver.coerce(composer2npm(version));\n return semverVersion ? npm.getMinor(semverVersion) : null;\n}\n\nfunction getPatch(version: string): number | null {\n const semverVersion = semver.coerce(composer2npm(version));\n\n // This returns only the numbers without the optional `-pXX` patch version supported by composer. Fixing that would require a bigger\n // refactoring, because the API supports only numbers.\n return semverVersion ? npm.getPatch(semverVersion) : null;\n}\n\nfunction isGreaterThan(a: string, b: string): boolean {\n return sortVersions(a, b) === 1;\n}\n\nfunction isLessThanRange(version: string, range: string): boolean {\n return !!npm.isLessThanRange?.(composer2npm(version), composer2npm(range));\n}\n\nfunction isSingleVersion(input: string): boolean {\n return !!input && npm.isSingleVersion(composer2npm(input));\n}\n\nfunction isStable(version: string): boolean {\n if (version) {\n // Composer considers patches `-pXX` as stable: https://github.com/composer/semver/blob/fa1ec24f0ab1efe642671ec15c51a3ab879f59bf/src/VersionParser.php#L568 but npm not.\n // In order to be able to use the standard npm.isStable function, we remove the potential patch version for the check.\n const [withoutPatch] = removeComposerSpecificPatchPart(version);\n return npm.isStable(composer2npm(withoutPatch));\n }\n\n return false;\n}\n\nexport function isValid(input: string): boolean {\n return !!input && npm.isValid(composer2npm(input));\n}\n\nexport function isVersion(input: string): boolean {\n return !!input && npm.isVersion(composer2npm(input));\n}\n\nfunction matches(version: string, range: string): boolean {\n return npm.matches(composer2npm(version), composer2npm(range));\n}\n\nfunction getSatisfyingVersion(\n versions: string[],\n range: string,\n): string | null {\n return calculateSatisfyingVersionIntenal(versions, range, false);\n}\n\nfunction minSatisfyingVersion(\n versions: string[],\n range: string,\n): string | null {\n return calculateSatisfyingVersionIntenal(versions, range, true);\n}\n\nfunction subset(subRange: string, superRange: string): boolean | undefined {\n try {\n return npm.subset!(composer2npm(subRange), composer2npm(superRange));\n } catch (err) {\n logger.trace({ err }, 'composer.subset error');\n return false;\n }\n}\n\nfunction getNewValue({\n currentValue,\n rangeStrategy,\n currentVersion,\n newVersion,\n}: NewValueConfig): string | null {\n if (rangeStrategy === 'pin') {\n return newVersion;\n }\n if (rangeStrategy === 'update-lockfile') {\n if (matches(newVersion, currentValue)) {\n return currentValue;\n }\n return getNewValue({\n currentValue,\n rangeStrategy: 'replace',\n currentVersion,\n newVersion,\n });\n }\n const currentMajor = currentVersion ? getMajor(currentVersion) : null;\n const toMajor = getMajor(newVersion);\n const toMinor = getMinor(newVersion);\n let newValue: string | null = null;\n if (isVersion(currentValue)) {\n newValue = newVersion;\n } else if (regEx(/^[~^](0\\.[1-9][0-9]*)$/).test(currentValue)) {\n const operator = currentValue.substring(0, 1);\n // handle ~0.4 case first\n if (toMajor === 0) {\n // TODO: types (#22198)\n newValue = `${operator}0.${toMinor!}`;\n } else {\n // TODO: types (#22198)\n newValue = `${operator}${toMajor!}.0`;\n }\n } else if (regEx(/^[~^]([0-9]*)$/).test(currentValue)) {\n // handle ~4 case\n const operator = currentValue.substring(0, 1);\n // TODO: types (#22198)\n newValue = `${operator}${toMajor!}`;\n } else if (\n toMajor &&\n regEx(/^[~^]([0-9]*(?:\\.[0-9]*)?)$/).test(currentValue)\n ) {\n const operator = currentValue.substring(0, 1);\n if (rangeStrategy === 'bump') {\n newValue = `${operator}${newVersion}`;\n } else if (\n (is.number(currentMajor) && toMajor > currentMajor) ||\n !toMinor\n ) {\n // handle ~4.1 case\n newValue = `${operator}${toMajor}.0`;\n } else {\n newValue = `${operator}${toMajor}.${toMinor}`;\n }\n } else if (\n currentVersion &&\n npm.isVersion(padZeroes(normalizeVersion(newVersion))) &&\n npm.isValid(normalizeVersion(currentValue)) &&\n composer2npm(currentValue) === normalizeVersion(currentValue)\n ) {\n newValue = npm.getNewValue({\n currentValue: normalizeVersion(currentValue),\n rangeStrategy,\n currentVersion: padZeroes(normalizeVersion(currentVersion)),\n newVersion: padZeroes(normalizeVersion(newVersion)),\n });\n }\n\n if (rangeStrategy === 'widen' && matches(newVersion, currentValue)) {\n newValue = currentValue;\n } else {\n const hasOr = currentValue.includes(' || ');\n if (hasOr || rangeStrategy === 'widen') {\n const splitValues = currentValue.split('||');\n const lastValue = splitValues[splitValues.length - 1];\n const replacementValue = getNewValue({\n currentValue: lastValue.trim(),\n rangeStrategy: 'replace',\n currentVersion,\n newVersion,\n });\n if (rangeStrategy === 'replace') {\n newValue = replacementValue;\n } else if (replacementValue) {\n const parsedRange = parseRange(replacementValue);\n const element = parsedRange[parsedRange.length - 1];\n if (element.operator?.startsWith('<')) {\n const splitCurrent = currentValue.split(element.operator);\n splitCurrent.pop();\n newValue = splitCurrent.join(element.operator) + replacementValue;\n } else {\n newValue = currentValue + ' || ' + replacementValue;\n }\n }\n }\n }\n\n if (!newValue) {\n logger.warn(\n { currentValue, rangeStrategy, currentVersion, newVersion },\n 'Unsupported composer value',\n );\n newValue = newVersion;\n }\n if (currentValue.split('.')[0].includes('v')) {\n newValue = newValue.replace(regEx(/([0-9])/), 'v$1');\n }\n\n // Preserve original min-stability specifier\n if (currentValue.includes('@')) {\n newValue += '@' + currentValue.split('@')[1];\n }\n\n return newValue;\n}\n\nfunction sortVersions(a: string, b: string): number {\n const [aWithoutPatch, aContainsPatch] = removeComposerSpecificPatchPart(a);\n const [bWithoutPatch, bContainsPatch] = removeComposerSpecificPatchPart(b);\n\n if (aContainsPatch === bContainsPatch) {\n // If both [a and b] contain patch version or both [a and b] do not contain patch version, then npm comparison deliveres correct results\n return npm.sortVersions(composer2npm(a), composer2npm(b));\n } else if (\n npm.equals(composer2npm(aWithoutPatch), composer2npm(bWithoutPatch))\n ) {\n // If only one [a or b] contains patch version and the parts without patch versions are equal, then the version with patch is greater (this is the case where npm comparison fails)\n return aContainsPatch ? 1 : -1;\n } else {\n // All other cases can be compared correctly by npm\n return npm.sortVersions(composer2npm(a), composer2npm(b));\n }\n}\n\nfunction isCompatible(version: string): boolean {\n return isVersion(version);\n}\n\nexport const api: VersioningApi = {\n equals,\n getMajor,\n getMinor,\n getPatch,\n isCompatible,\n isGreaterThan,\n isLessThanRange,\n isSingleVersion,\n isStable,\n isValid,\n isVersion,\n matches,\n getSatisfyingVersion,\n minSatisfyingVersion,\n getNewValue,\n sortVersions,\n subset,\n};\nexport default api;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/modules/versioning/composer/index.ts"],"names":[],"mappings":";;;AAyMA,0BAEC;AAED,8BAEC;;AA/MD,kEAAkC;AAClC,4DAA4B;AAC5B,+CAA0C;AAC1C,4CAAyC;AAEzC,+CAA4C;AAC5C,gCAAoC;AAGvB,QAAA,EAAE,GAAG,UAAU,CAAC;AAChB,QAAA,WAAW,GAAG,UAAU,CAAC;AACzB,QAAA,IAAI,GAAG;IAClB,kDAAkD;IAClD,gDAAgD;IAChD,sDAAsD;IACtD,uBAAuB;CACxB,CAAC;AACW,QAAA,cAAc,GAAG,IAAI,CAAC;AACtB,QAAA,wBAAwB,GAAoB;IACvD,MAAM;IACN,OAAO;IACP,KAAK;IACL,SAAS;IACT,iBAAiB;CAClB,CAAC;AAEF,SAAS,eAAe,CAAC,KAAa;IACpC,MAAM,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACtC,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9B,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACrB,CAAC;IAED,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;AAClD,CAAC;AAED,SAAS,SAAS,CAAC,KAAa;IAC9B,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;IAEnD,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACnC,OAAO,QAAQ,CAAC,MAAM,G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;QACtC,wIAAwI;QACxI,OAAO,SAAG,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5D,CAAC;SAAM,IACL,SAAG,CAAC,MAAM,CAAC,YAAY,CAAC,aAAa,CAAC,EAAE,YAAY,CAAC,aAAa,CAAC,CAAC,EACpE,CAAC;QACD,mLAAmL;QACnL,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACjC,CAAC;SAAM,CAAC;QACN,mDAAmD;QACnD,OAAO,SAAG,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC;AAED,SAAS,YAAY,CAAC,OAAe;IACnC,OAAO,SAAS,CAAC,OAAO,CAAC,CAAC;AAC5B,CAAC;AAEY,QAAA,GAAG,GAAkB;IAChC,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,YAAY;IACZ,aAAa;IACb,eAAe;IACf,eAAe;IACf,QAAQ;IACR,OAAO;IACP,SAAS;IACT,OAAO;IACP,oBAAoB;IACpB,oBAAoB;IACpB,WAAW;IACX,YAAY;IACZ,MAAM;IACN,UAAU;CACX,CAAC;AACF,kBAAe,WAAG,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport semver from 'semver';\nimport { parseRange } from 'semver-utils';\nimport { logger } from '../../../logger';\nimport type { RangeStrategy } from '../../../types/versioning';\nimport { regEx } from '../../../util/regex';\nimport { api as npm } from '../npm';\nimport type { NewValueConfig, VersioningApi } from '../types';\n\nexport const id = 'composer';\nexport const displayName = 'Composer';\nexport const urls = [\n 'https://getcomposer.org/doc/articles/versions.md',\n 'https://packagist.org/packages/composer/semver',\n 'https://madewithlove.be/tilde-and-caret-constraints/',\n 'https://semver.mwl.be',\n];\nexport const supportsRanges = true;\nexport const supportedRangeStrategies: RangeStrategy[] = [\n 'bump',\n 'widen',\n 'pin',\n 'replace',\n 'update-lockfile',\n];\n\nfunction getVersionParts(input: string): [string, string] {\n const versionParts = input.split('-');\n if (versionParts.length === 1) {\n return [input, ''];\n }\n\n return [versionParts[0], '-' + versionParts[1]];\n}\n\nfunction padZeroes(input: string): string {\n const [output, stability] = getVersionParts(input);\n\n const sections = output.split('.');\n while (sections.length < 3) {\n sections.push('0');\n }\n return sections.join('.') + stability;\n}\n\nfunction convertStabilityModifier(input: string): string {\n // Handle stability modifiers.\n const versionParts = input.split('@');\n if (versionParts.length === 1) {\n return input;\n }\n\n // 1.0@beta2 to 1.0-beta.2\n const stability = versionParts[1].replace(\n regEx(/(?:^|\\s)(beta|alpha|rc)([1-9][0-9]*)(?: |$)/gi),\n '$1.$2',\n );\n\n // If there is a stability part, npm semver expects the version\n // to be full\n return padZeroes(versionParts[0]) + '-' + stability;\n}\n\nfunction normalizeVersion(input: string): string {\n let output = input;\n output = output.replace(regEx(/(^|>|>=|\\^|~)v/i), '$1');\n return convertStabilityModifier(output);\n}\n\n/**\n * @param versions Version list in any format, it recognizes the specific patch format x.x.x-pXX\n * @param range Range in composer format\n * @param minMode If true, it will calculate minSatisfyingVersion, if false, it calculates the maxSatisfyingVersion\n * @returns min or max satisfyingVersion from the input\n */\nfunction calculateSatisfyingVersionIntenal(\n versions: string[],\n range: string,\n minMode: boolean,\n): string | null {\n // Because composer -p versions are considered stable, we have to remove the suffix for the npm.XXX functions.\n const versionsMapped = versions.map((x) => {\n return {\n origianl: x,\n cleaned: removeComposerSpecificPatchPart(x),\n npmVariant: composer2npm(removeComposerSpecificPatchPart(x)[0]),\n };\n });\n\n const npmVersions = versionsMapped.map((x) => x.npmVariant);\n const npmVersion = minMode\n ? npm.minSatisfyingVersion(npmVersions, composer2npm(range))\n : npm.getSatisfyingVersion(npmVersions, composer2npm(range));\n\n if (!npmVersion) {\n return null;\n }\n\n // After we find the npm versions, we select from them back in the mapping the possible patches.\n const candidates = versionsMapped\n .filter((x) => x.npmVariant === npmVersion)\n .sort((a, b) => (minMode ? 1 : -1) * sortVersions(a.origianl, b.origianl));\n\n return candidates[0].origianl;\n}\n\n/**\n * @param intput Version in any format, it recognizes the specific patch format x.x.x-pXX\n * @returns If input contains the specific patch, it returns the input with removed the patch and true, otherwise it retunrs the same string and false.\n */\nfunction removeComposerSpecificPatchPart(input: string): [string, boolean] {\n // the regex is based on the original from composer implementation https://github.com/composer/semver/blob/fa1ec24f0ab1efe642671ec15c51a3ab879f59bf/src/VersionParser.php#L137\n const pattern = /^v?\\d+(\\.\\d+(\\.\\d+(\\.\\d+)?)?)?(?<suffix>-p[1-9]\\d*)$/gi;\n const match = pattern.exec(input);\n\n return match\n ? [input.replace(match.groups!.suffix, ''), true]\n : [input, false];\n}\n\nfunction composer2npm(input: string): string {\n return input\n .split(regEx(/\\s*\\|\\|?\\s*/g))\n .map((part): string => {\n const cleanInput = normalizeVersion(part);\n if (npm.isVersion(cleanInput)) {\n return cleanInput;\n }\n if (npm.isVersion(padZeroes(cleanInput))) {\n return padZeroes(cleanInput);\n }\n const [versionId, stability] = getVersionParts(cleanInput);\n let output = versionId;\n\n // ~4 to ^4 and ~4.1 to ^4.1\n output = output.replace(\n regEx(/(?:^|\\s)~([1-9][0-9]*(?:\\.[0-9]*)?)(?: |$)/g),\n '^$1',\n );\n // ~0.4 to >=0.4 <1\n output = output.replace(\n regEx(/(?:^|\\s)~(0\\.[1-9][0-9]*)(?: |$)/g),\n '>=$1 <1',\n );\n\n // add extra digits to <8-DEV and <8.0-DEV\n output = output\n .replace(regEx(/^(<\\d+(\\.\\d+)?)$/g), '$1.0')\n .replace(regEx(/^(<\\d+(\\.\\d+)?)$/g), '$1.0');\n\n return output + stability;\n })\n .map((part) => part.replace(/([a-z])([0-9])/gi, '$1.$2'))\n .join(' || ');\n}\n\nfunction equals(a: string, b: string): boolean {\n return npm.equals(composer2npm(a), composer2npm(b));\n}\n\nfunction getMajor(version: string): number | null {\n const semverVersion = semver.coerce(composer2npm(version));\n return semverVersion ? npm.getMajor(semverVersion) : null;\n}\n\nfunction getMinor(version: string): number | null {\n const semverVersion = semver.coerce(composer2npm(version));\n return semverVersion ? npm.getMinor(semverVersion) : null;\n}\n\nfunction getPatch(version: string): number | null {\n const semverVersion = semver.coerce(composer2npm(version));\n\n // This returns only the numbers without the optional `-pXX` patch version supported by composer. Fixing that would require a bigger\n // refactoring, because the API supports only numbers.\n return semverVersion ? npm.getPatch(semverVersion) : null;\n}\n\nfunction isGreaterThan(a: string, b: string): boolean {\n return sortVersions(a, b) === 1;\n}\n\nfunction isLessThanRange(version: string, range: string): boolean {\n return !!npm.isLessThanRange?.(composer2npm(version), composer2npm(range));\n}\n\nfunction isSingleVersion(input: string): boolean {\n return !!input && npm.isSingleVersion(composer2npm(input));\n}\n\nfunction isStable(version: string): boolean {\n if (version) {\n // Composer considers patches `-pXX` as stable: https://github.com/composer/semver/blob/fa1ec24f0ab1efe642671ec15c51a3ab879f59bf/src/VersionParser.php#L568 but npm not.\n // In order to be able to use the standard npm.isStable function, we remove the potential patch version for the check.\n const [withoutPatch] = removeComposerSpecificPatchPart(version);\n return npm.isStable(composer2npm(withoutPatch));\n }\n\n return false;\n}\n\nexport function isValid(input: string): boolean {\n return !!input && npm.isValid(composer2npm(input));\n}\n\nexport function isVersion(input: string): boolean {\n return !!input && npm.isVersion(composer2npm(input));\n}\n\nfunction matches(version: string, range: string): boolean {\n return npm.matches(composer2npm(version), composer2npm(range));\n}\n\nfunction getSatisfyingVersion(\n versions: string[],\n range: string,\n): string | null {\n return calculateSatisfyingVersionIntenal(versions, range, false);\n}\n\nfunction minSatisfyingVersion(\n versions: string[],\n range: string,\n): string | null {\n return calculateSatisfyingVersionIntenal(versions, range, true);\n}\n\nfunction subset(subRange: string, superRange: string): boolean | undefined {\n try {\n return npm.subset!(composer2npm(subRange), composer2npm(superRange));\n } catch (err) {\n logger.trace({ err }, 'composer.subset error');\n return false;\n }\n}\n\nfunction intersects(subRange: string, superRange: string): boolean {\n try {\n return npm.intersects!(composer2npm(subRange), composer2npm(superRange));\n } catch (err) {\n logger.trace({ err }, 'composer.intersects error');\n return false;\n }\n}\n\nfunction getNewValue({\n currentValue,\n rangeStrategy,\n currentVersion,\n newVersion,\n}: NewValueConfig): string | null {\n if (rangeStrategy === 'pin') {\n return newVersion;\n }\n if (rangeStrategy === 'update-lockfile') {\n if (matches(newVersion, currentValue)) {\n return currentValue;\n }\n return getNewValue({\n currentValue,\n rangeStrategy: 'replace',\n currentVersion,\n newVersion,\n });\n }\n const currentMajor = currentVersion ? getMajor(currentVersion) : null;\n const toMajor = getMajor(newVersion);\n const toMinor = getMinor(newVersion);\n let newValue: string | null = null;\n if (isVersion(currentValue)) {\n newValue = newVersion;\n } else if (regEx(/^[~^](0\\.[1-9][0-9]*)$/).test(currentValue)) {\n const operator = currentValue.substring(0, 1);\n // handle ~0.4 case first\n if (toMajor === 0) {\n // TODO: types (#22198)\n newValue = `${operator}0.${toMinor!}`;\n } else {\n // TODO: types (#22198)\n newValue = `${operator}${toMajor!}.0`;\n }\n } else if (regEx(/^[~^]([0-9]*)$/).test(currentValue)) {\n // handle ~4 case\n const operator = currentValue.substring(0, 1);\n // TODO: types (#22198)\n newValue = `${operator}${toMajor!}`;\n } else if (\n toMajor &&\n regEx(/^[~^]([0-9]*(?:\\.[0-9]*)?)$/).test(currentValue)\n ) {\n const operator = currentValue.substring(0, 1);\n if (rangeStrategy === 'bump') {\n newValue = `${operator}${newVersion}`;\n } else if (\n (is.number(currentMajor) && toMajor > currentMajor) ||\n !toMinor\n ) {\n // handle ~4.1 case\n newValue = `${operator}${toMajor}.0`;\n } else {\n newValue = `${operator}${toMajor}.${toMinor}`;\n }\n } else if (\n currentVersion &&\n npm.isVersion(padZeroes(normalizeVersion(newVersion))) &&\n npm.isValid(normalizeVersion(currentValue)) &&\n composer2npm(currentValue) === normalizeVersion(currentValue)\n ) {\n newValue = npm.getNewValue({\n currentValue: normalizeVersion(currentValue),\n rangeStrategy,\n currentVersion: padZeroes(normalizeVersion(currentVersion)),\n newVersion: padZeroes(normalizeVersion(newVersion)),\n });\n }\n\n if (rangeStrategy === 'widen' && matches(newVersion, currentValue)) {\n newValue = currentValue;\n } else {\n const hasOr = currentValue.includes(' || ');\n if (hasOr || rangeStrategy === 'widen') {\n const splitValues = currentValue.split('||');\n const lastValue = splitValues[splitValues.length - 1];\n const replacementValue = getNewValue({\n currentValue: lastValue.trim(),\n rangeStrategy: 'replace',\n currentVersion,\n newVersion,\n });\n if (rangeStrategy === 'replace') {\n newValue = replacementValue;\n } else if (replacementValue) {\n const parsedRange = parseRange(replacementValue);\n const element = parsedRange[parsedRange.length - 1];\n if (element.operator?.startsWith('<')) {\n const splitCurrent = currentValue.split(element.operator);\n splitCurrent.pop();\n newValue = splitCurrent.join(element.operator) + replacementValue;\n } else {\n newValue = currentValue + ' || ' + replacementValue;\n }\n }\n }\n }\n\n if (!newValue) {\n logger.warn(\n { currentValue, rangeStrategy, currentVersion, newVersion },\n 'Unsupported composer value',\n );\n newValue = newVersion;\n }\n if (currentValue.split('.')[0].includes('v')) {\n newValue = newValue.replace(regEx(/([0-9])/), 'v$1');\n }\n\n // Preserve original min-stability specifier\n if (currentValue.includes('@')) {\n newValue += '@' + currentValue.split('@')[1];\n }\n\n return newValue;\n}\n\nfunction sortVersions(a: string, b: string): number {\n const [aWithoutPatch, aContainsPatch] = removeComposerSpecificPatchPart(a);\n const [bWithoutPatch, bContainsPatch] = removeComposerSpecificPatchPart(b);\n\n if (aContainsPatch === bContainsPatch) {\n // If both [a and b] contain patch version or both [a and b] do not contain patch version, then npm comparison deliveres correct results\n return npm.sortVersions(composer2npm(a), composer2npm(b));\n } else if (\n npm.equals(composer2npm(aWithoutPatch), composer2npm(bWithoutPatch))\n ) {\n // If only one [a or b] contains patch version and the parts without patch versions are equal, then the version with patch is greater (this is the case where npm comparison fails)\n return aContainsPatch ? 1 : -1;\n } else {\n // All other cases can be compared correctly by npm\n return npm.sortVersions(composer2npm(a), composer2npm(b));\n }\n}\n\nfunction isCompatible(version: string): boolean {\n return isVersion(version);\n}\n\nexport const api: VersioningApi = {\n equals,\n getMajor,\n getMinor,\n getPatch,\n isCompatible,\n isGreaterThan,\n isLessThanRange,\n isSingleVersion,\n isStable,\n isValid,\n isVersion,\n matches,\n getSatisfyingVersion,\n minSatisfyingVersion,\n getNewValue,\n sortVersions,\n subset,\n intersects,\n};\nexport default api;\n"]}
@@ -0,0 +1,41 @@
1
+ import type { SemVer } from 'semver';
2
+ import type { RangeStrategy } from '../../../types/versioning';
3
+ import type { NewValueConfig } from '../types';
4
+ export declare const id = "conda";
5
+ export declare const displayName = "conda";
6
+ export declare const urls: string[];
7
+ export declare const supportsRanges = true;
8
+ export declare const supportedRangeStrategies: RangeStrategy[];
9
+ declare function isValidVersion(s: string): boolean;
10
+ declare function isValid(input: string): boolean;
11
+ declare function matches(version: string, range: string): boolean;
12
+ declare function isSingleVersion(input: string): boolean;
13
+ declare function getNewValue({ currentValue, rangeStrategy, currentVersion, newVersion, isReplacement, }: NewValueConfig): string | null;
14
+ declare function sortVersions(version: string, other: string): number;
15
+ declare function equals(version: string, other: string): boolean;
16
+ declare function isStable(version: string): boolean;
17
+ declare function isCompatible(version: string, current?: string): boolean;
18
+ declare function getMajor(version: string | SemVer): null | number;
19
+ declare function getMinor(version: string | SemVer): null | number;
20
+ declare function getPatch(version: string | SemVer): null | number;
21
+ declare function isGreaterThan(version: string, other: string): boolean;
22
+ declare function getSatisfyingVersion(versions: string[], range: string): string | null;
23
+ declare function minSatisfyingVersion(versions: string[], range: string): string | null;
24
+ export declare const api: {
25
+ equals: typeof equals;
26
+ isValid: typeof isValid;
27
+ isVersion: typeof isValidVersion;
28
+ isSingleVersion: typeof isSingleVersion;
29
+ isStable: typeof isStable;
30
+ isCompatible: typeof isCompatible;
31
+ getMajor: typeof getMajor;
32
+ getMinor: typeof getMinor;
33
+ getPatch: typeof getPatch;
34
+ isGreaterThan: typeof isGreaterThan;
35
+ getSatisfyingVersion: typeof getSatisfyingVersion;
36
+ minSatisfyingVersion: typeof minSatisfyingVersion;
37
+ getNewValue: typeof getNewValue;
38
+ matches: typeof matches;
39
+ sortVersions: typeof sortVersions;
40
+ };
41
+ export {};
@@ -0,0 +1,178 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.api = exports.supportedRangeStrategies = exports.supportsRanges = exports.urls = exports.displayName = exports.id = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const rattler_1 = require("@baszalmstra/rattler");
6
+ const pep440 = tslib_1.__importStar(require("../pep440"));
7
+ function parse(v) {
8
+ try {
9
+ return new rattler_1.Version(v);
10
+ }
11
+ catch {
12
+ return null;
13
+ }
14
+ }
15
+ exports.id = 'conda';
16
+ exports.displayName = 'conda';
17
+ exports.urls = [
18
+ 'https://docs.conda.io/projects/conda-build/en/stable/resources/package-spec.html#package-match-specifications',
19
+ ];
20
+ exports.supportsRanges = true;
21
+ exports.supportedRangeStrategies = [
22
+ 'bump',
23
+ 'widen',
24
+ 'pin',
25
+ 'replace',
26
+ ];
27
+ function isValidVersion(s) {
28
+ try {
29
+ new rattler_1.Version(s);
30
+ return true;
31
+ }
32
+ catch {
33
+ return false;
34
+ }
35
+ }
36
+ function isValidVersionSpec(s) {
37
+ try {
38
+ new rattler_1.VersionSpec(s);
39
+ return true;
40
+ }
41
+ catch {
42
+ return false;
43
+ }
44
+ }
45
+ function isValid(input) {
46
+ return isValidVersion(input) || isValidVersionSpec(input);
47
+ }
48
+ function matches(version, range) {
49
+ try {
50
+ return new rattler_1.VersionSpec(range).matches(new rattler_1.Version(version));
51
+ }
52
+ catch {
53
+ return false;
54
+ }
55
+ }
56
+ function isSingleVersion(input) {
57
+ if (!input.startsWith('=')) {
58
+ return false;
59
+ }
60
+ return isValidVersion(input.replace(/^==/, '').trimStart());
61
+ }
62
+ function getNewValue({ currentValue, rangeStrategy, currentVersion, newVersion, isReplacement, }) {
63
+ if (rangeStrategy === 'pin') {
64
+ return '==' + newVersion;
65
+ }
66
+ if (currentValue === '*') {
67
+ if (rangeStrategy === 'bump') {
68
+ return '>=' + newVersion;
69
+ }
70
+ // don't think you can widen or replace `*`
71
+ return null;
72
+ }
73
+ const normalizedCurrentValue = new rattler_1.VersionSpec(currentValue).toString();
74
+ // it's valid range spec in conda to write `3.12.*`, translate to pep440 `==3.12.*`
75
+ if (/^(\d+\.)+\*$/.test(normalizedCurrentValue)) {
76
+ const newValue = pep440.api.getNewValue({
77
+ currentValue: '==' + normalizedCurrentValue,
78
+ rangeStrategy,
79
+ currentVersion,
80
+ newVersion,
81
+ isReplacement,
82
+ });
83
+ return newValue?.replace(/^==/, '') ?? null;
84
+ }
85
+ return pep440.api.getNewValue({
86
+ currentValue: normalizedCurrentValue,
87
+ rangeStrategy,
88
+ currentVersion,
89
+ newVersion,
90
+ isReplacement,
91
+ });
92
+ }
93
+ function sortVersions(version, other) {
94
+ return new rattler_1.Version(version).compare(new rattler_1.Version(other));
95
+ }
96
+ function equals(version, other) {
97
+ const v2 = parse(other);
98
+ if (!v2) {
99
+ return false;
100
+ }
101
+ return parse(version)?.equals(v2) ?? false;
102
+ }
103
+ function isStable(version) {
104
+ return !(parse(version)?.isDev ?? true);
105
+ }
106
+ function isCompatible(version, current) {
107
+ return true;
108
+ }
109
+ function getMajor(version) {
110
+ return parse(version)?.asMajorMinor?.()?.[0] ?? null;
111
+ }
112
+ function getMinor(version) {
113
+ return parse(version)?.asMajorMinor?.()?.[1] ?? null;
114
+ }
115
+ function getPatch(version) {
116
+ try {
117
+ return pep440.api.getPatch(version);
118
+ }
119
+ catch {
120
+ return null;
121
+ }
122
+ }
123
+ function isGreaterThan(version, other) {
124
+ return sortVersions(version, other) > 0;
125
+ }
126
+ function getSatisfyingVersion(versions, range) {
127
+ const spec = new rattler_1.VersionSpec(range);
128
+ const satisfiedVersions = versions
129
+ .map((v) => {
130
+ return [new rattler_1.Version(v), v];
131
+ })
132
+ .filter(([v, raw]) => spec.matches(v))
133
+ .sort((a, b) => {
134
+ return a[0].compare(b[0]);
135
+ });
136
+ if (satisfiedVersions.length === 0) {
137
+ return null;
138
+ }
139
+ return satisfiedVersions[satisfiedVersions.length - 1][1];
140
+ }
141
+ function minSatisfyingVersion(versions, range) {
142
+ const spec = new rattler_1.VersionSpec(range);
143
+ const satisfiedVersions = versions
144
+ .map((v) => {
145
+ return [new rattler_1.Version(v), v];
146
+ })
147
+ .filter(([v, raw]) => spec.matches(v))
148
+ .sort((a, b) => {
149
+ return a[0].compare(b[0]);
150
+ });
151
+ if (satisfiedVersions.length === 0) {
152
+ return null;
153
+ }
154
+ return satisfiedVersions[0][1];
155
+ }
156
+ exports.api = {
157
+ equals,
158
+ isValid,
159
+ isVersion: isValidVersion,
160
+ isSingleVersion,
161
+ // conda doesn't have stable version and non-stable version
162
+ // for example, tzdata has version 2024a but it's stable
163
+ isStable,
164
+ // conda use version are always compatible with each other.
165
+ isCompatible,
166
+ getMajor,
167
+ getMinor,
168
+ // sadly conda version doesn't have a concept of patch version
169
+ // so we try to use pep440 get a patch version.
170
+ getPatch,
171
+ isGreaterThan,
172
+ getSatisfyingVersion,
173
+ minSatisfyingVersion,
174
+ getNewValue,
175
+ matches,
176
+ sortVersions,
177
+ };
178
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/modules/versioning/conda/index.ts"],"names":[],"mappings":";;;;AAAA,kDAA4D;AAI5D,0DAAoC;AAGpC,SAAS,KAAK,CAAC,CAAS;IACtB,IAAI,CAAC;QACH,OAAO,IAAI,iBAAO,CAAC,CAAC,CAAC,CAAC;IACxB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAEY,QAAA,EAAE,GAAG,OAAO,CAAC;AACb,QAAA,WAAW,GAAG,OAAO,CAAC;AACtB,QAAA,IAAI,GAAG;IAClB,+GAA+G;CAChH,CAAC;AACW,QAAA,c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IAER,aAAa;IACb,oBAAoB;IAEpB,oBAAoB;IACpB,WAAW;IAEX,OAAO;IACP,YAAY;CACW,CAAC","sourcesContent":["import { Version, VersionSpec } from '@baszalmstra/rattler';\nimport type { SemVer } from 'semver';\n\nimport type { RangeStrategy } from '../../../types/versioning';\nimport * as pep440 from '../pep440';\nimport type { NewValueConfig, VersioningApi } from '../types';\n\nfunction parse(v: string): Version | null {\n try {\n return new Version(v);\n } catch {\n return null;\n }\n}\n\nexport const id = 'conda';\nexport const displayName = 'conda';\nexport const urls = [\n 'https://docs.conda.io/projects/conda-build/en/stable/resources/package-spec.html#package-match-specifications',\n];\nexport const supportsRanges = true;\nexport const supportedRangeStrategies: RangeStrategy[] = [\n 'bump',\n 'widen',\n 'pin',\n 'replace',\n];\n\nfunction isValidVersion(s: string): boolean {\n try {\n new Version(s);\n return true;\n } catch {\n return false;\n }\n}\n\nfunction isValidVersionSpec(s: string): boolean {\n try {\n new VersionSpec(s);\n return true;\n } catch {\n return false;\n }\n}\n\nfunction isValid(input: string): boolean {\n return isValidVersion(input) || isValidVersionSpec(input);\n}\n\nfunction matches(version: string, range: string): boolean {\n try {\n return new VersionSpec(range).matches(new Version(version));\n } catch {\n return false;\n }\n}\n\nfunction isSingleVersion(input: string): boolean {\n if (!input.startsWith('=')) {\n return false;\n }\n\n return isValidVersion(input.replace(/^==/, '').trimStart());\n}\n\nfunction getNewValue({\n currentValue,\n rangeStrategy,\n currentVersion,\n newVersion,\n isReplacement,\n}: NewValueConfig): string | null {\n if (rangeStrategy === 'pin') {\n return '==' + newVersion;\n }\n\n if (currentValue === '*') {\n if (rangeStrategy === 'bump') {\n return '>=' + newVersion;\n }\n\n // don't think you can widen or replace `*`\n return null;\n }\n\n const normalizedCurrentValue = new VersionSpec(currentValue).toString();\n\n // it's valid range spec in conda to write `3.12.*`, translate to pep440 `==3.12.*`\n if (/^(\\d+\\.)+\\*$/.test(normalizedCurrentValue)) {\n const newValue = pep440.api.getNewValue({\n currentValue: '==' + normalizedCurrentValue,\n rangeStrategy,\n currentVersion,\n newVersion,\n isReplacement,\n });\n\n return newValue?.replace(/^==/, '') ?? null;\n }\n\n return pep440.api.getNewValue({\n currentValue: normalizedCurrentValue,\n rangeStrategy,\n currentVersion,\n newVersion,\n isReplacement,\n });\n}\n\nfunction sortVersions(version: string, other: string): number {\n return new Version(version).compare(new Version(other));\n}\n\nfunction equals(version: string, other: string): boolean {\n const v2 = parse(other);\n if (!v2) {\n return false;\n }\n\n return parse(version)?.equals(v2) ?? false;\n}\n\nfunction isStable(version: string): boolean {\n return !(parse(version)?.isDev ?? true);\n}\n\nfunction isCompatible(version: string, current?: string): boolean {\n return true;\n}\n\nfunction getMajor(version: string | SemVer): null | number {\n return parse(version as string)?.asMajorMinor?.()?.[0] ?? null;\n}\nfunction getMinor(version: string | SemVer): null | number {\n return parse(version as string)?.asMajorMinor?.()?.[1] ?? null;\n}\n\nfunction getPatch(version: string | SemVer): null | number {\n try {\n return pep440.api.getPatch(version);\n } catch {\n return null;\n }\n}\n\nfunction isGreaterThan(version: string, other: string): boolean {\n return sortVersions(version, other) > 0;\n}\nfunction getSatisfyingVersion(\n versions: string[],\n range: string,\n): string | null {\n const spec = new VersionSpec(range);\n\n const satisfiedVersions = versions\n .map((v) => {\n return [new Version(v), v] as const;\n })\n .filter(([v, raw]) => spec.matches(v))\n .sort((a, b) => {\n return a[0].compare(b[0]);\n });\n\n if (satisfiedVersions.length === 0) {\n return null;\n }\n\n return satisfiedVersions[satisfiedVersions.length - 1][1];\n}\n\nfunction minSatisfyingVersion(\n versions: string[],\n range: string,\n): string | null {\n const spec = new VersionSpec(range);\n\n const satisfiedVersions = versions\n .map((v) => {\n return [new Version(v), v] as const;\n })\n .filter(([v, raw]) => spec.matches(v))\n .sort((a, b) => {\n return a[0].compare(b[0]);\n });\n\n if (satisfiedVersions.length === 0) {\n return null;\n }\n\n return satisfiedVersions[0][1];\n}\n\nexport const api = {\n equals,\n isValid,\n isVersion: isValidVersion,\n isSingleVersion,\n\n // conda doesn't have stable version and non-stable version\n // for example, tzdata has version 2024a but it's stable\n isStable,\n\n // conda use version are always compatible with each other.\n isCompatible,\n\n getMajor,\n getMinor,\n // sadly conda version doesn't have a concept of patch version\n // so we try to use pep440 get a patch version.\n getPatch,\n\n isGreaterThan,\n getSatisfyingVersion,\n\n minSatisfyingVersion,\n getNewValue,\n\n matches,\n sortVersions,\n} satisfies VersioningApi;\n"]}
@@ -89,9 +89,7 @@ class DistroInfo {
89
89
  let end = schedule?.eol_lts ?? null;
90
90
  // ubuntu: does not have eol_lts
91
91
  // debian: only "Stable" has no eol_lts, old and oldold has both
92
- if (!end) {
93
- end = endLts;
94
- }
92
+ end ??= endLts;
95
93
  if (end) {
96
94
  const now = luxon_1.DateTime.now().toUTC();
97
95
  const eol = luxon_1.DateTime.fromISO(end, { zone: 'utc' });
@@ -1 +1 @@
1
- {"version":3,"file":"distro.js","sourceRoot":"","sources":["../../../lib/modules/versioning/distro.ts"],"names":[],"mappings":";;;;AAAA,iCAAiC;AAEjC,8FAAmD;AAsBnD,6BAA6B;AAC7B,MAAM,KAAK,GAAG,CAAC,CAAC;AAEhB,MAAa,UAAU;IACJ,kBAAkB,GAAG,IAAI,GAAG,EAG1C,CAAC;IAEa,WAAW,GAAkC,EAAE,CAAC;IAEhD,WAAW,CAAmB;IAE/C,YAAY,aAA6B;QACvC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,KAAK,CAC3B,8BAAS,CAAC,GAAG,CAAC,aAAyB,CAAE,CAAC,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC,CACzE,CAAC;QAEF,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;YACpD,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;YAC3C,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,OAAO,EA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AAE,CAAC;YACd,OAAO,KAAK,CAAC;QACf,CAAC;QAED,MAAM,GAAG,GAAG,gBAAQ,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;QACzD,MAAM,OAAO,GAAG,gBAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QAEpE,OAAO,OAAO,GAAG,GAAG,CAAC;IACvB,CAAC;IAED;;;;;;OAMG;IACI,UAAU,CAAC,CAAS;QACzB,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC;QACxC,IAAI,GAAG,GAAG,CAAC,CAAC,CAAC;QAEb,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YACV,OAAO,IAAI,CAAC;QACd,CAAC;QAED,KAAK,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAC9B,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;gBACjD,8CAA8C;gBAC9C,mCAAmC;gBACnC,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBACxB,MAAM;YACR,CAAC;QACH,CAAC;QAED,IAAI,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,CAAC,EAAE,CAAC;YACzB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAC/B,CAAC;CACF;AAtKD,gCAsKC","sourcesContent":["import { DateTime } from 'luxon';\nimport type { DataFile } from '../../data-files.generated';\nimport dataFiles from '../../data-files.generated';\n\nexport interface DistroSchedule {\n codename: string;\n series: string;\n created: string;\n release: string;\n eol: string;\n eol_server?: string;\n eol_esm?: string;\n eol_lts?: string;\n eol_elts?: string;\n}\n\nexport type DistroDataFile =\n | 'data/ubuntu-distro-info.json'\n | 'data/debian-distro-info.json';\n\nexport type DistroInfoRecord = Record<string, DistroSchedule>;\n\nexport type DistroInfoRecordWithVersion = { version: string } & DistroSchedule;\n\n// Days to delay new releases\nconst delay = 1;\n\nexport class DistroInfo {\n private readonly _codenameToVersion = new Map<\n string,\n DistroInfoRecordWithVersion\n >();\n\n private readonly _sortedInfo: DistroInfoRecordWithVersion[] = [];\n\n private readonly _distroInfo: DistroInfoRecord;\n\n constructor(distroJsonKey: DistroDataFile) {\n this._distroInfo = JSON.parse(\n dataFiles.get(distroJsonKey as DataFile)!.replace(/v([\\d.]+)\\b/gm, '$1'),\n );\n\n for (const version of Object.keys(this._distroInfo)) {\n const schedule = this._distroInfo[version];\n this._codenameToVersion.set(schedule.series, { version, ...schedule });\n }\n\n const arr = Object.keys(this._distroInfo).sort(\n (a, b) => parseFloat(a) - parseFloat(b),\n );\n\n for (const v of arr) {\n const obj = { version: v, ...this._distroInfo[v.toString()] };\n if (!obj.release) {\n // istanbul ignore next\n continue;\n }\n this._sortedInfo.push(obj);\n }\n }\n\n /**\n * Check if input is a valid release codename\n * @param input A codename\n * @returns true if input is a codename, false otherwise\n */\n public isCodename(input: string): boolean {\n return this._codenameToVersion.has(input);\n }\n\n /**\n * Checks if given input string is a valid release version\n * @param input A codename/semVer\n * @returns true if release exists, false otherwise\n */\n public exists(input: string): boolean {\n const ver = this.getVersionByCodename(input);\n return !!this._distroInfo[ver];\n }\n\n /**\n * Get semVer representation of a given codename\n * @param input A codename\n * @returns A semVer if exists, otherwise input string is returned\n */\n public getVersionByCodename(input: string): string {\n const schedule = this._codenameToVersion.get(input);\n if (schedule) {\n return schedule.version;\n }\n return input;\n }\n\n /**\n * Get codename representation of a given semVer\n * @param input A semVer\n * @returns A codename if exists, otherwise input string is returned\n */\n public getCodenameByVersion(input: string): string {\n const di = this._distroInfo[input];\n if (di) {\n return di.series;\n }\n // istanbul ignore next\n return input;\n }\n\n /**\n * Get schedule of a given release\n * @param input A codename/semVer\n * @returns A schedule if available, otherwise undefined\n */\n public getSchedule(input: string): DistroSchedule | null {\n const ver = this.getVersionByCodename(input);\n return this._distroInfo[ver] ?? null;\n }\n\n /**\n * Check if a given release has passed its EOL\n * @param input A codename/semVer\n * @returns false if still supported, true otherwise\n */\n public isEolLts(input: string): boolean {\n const ver = this.getVersionByCodename(input);\n const schedule = this.getSchedule(ver);\n const endLts = schedule?.eol ?? null;\n let end = schedule?.eol_lts ?? null;\n\n // ubuntu: does not have eol_lts\n // debian: only \"Stable\" has no eol_lts, old and oldold has both\n if (!end) {\n end = endLts;\n }\n\n if (end) {\n const now = DateTime.now().toUTC();\n const eol = DateTime.fromISO(end, { zone: 'utc' });\n return eol < now;\n }\n\n // istanbul ignore next\n return true;\n }\n\n /**\n * Check if a given version has been released\n * @param input A codename/semVer\n * @returns false if unreleased or has no schedule, true otherwise\n */\n public isReleased(input: string): boolean {\n const ver = this.getVersionByCodename(input);\n const schedule = this.getSchedule(ver);\n\n if (!schedule) {\n return false;\n }\n\n const now = DateTime.now().minus({ day: delay }).toUTC();\n const release = DateTime.fromISO(schedule.release, { zone: 'utc' });\n\n return release < now;\n }\n\n /**\n * Get distro info for the release that has N other newer releases.\n * Example: n=0 corresponds to the latest available release, n=1 the release before, etc.\n * In Debian terms: N = 0 -> stable, N = 1 -> oldstable, N = 2 -> oldoldstalbe\n * @param n\n * @returns Distro info of the Nth latest release\n */\n public getNLatest(n: number): DistroInfoRecordWithVersion | null {\n const len = this._sortedInfo.length - 1;\n let idx = -1;\n\n if (n < 0) {\n return null;\n }\n\n for (let i = len; i >= 0; i--) {\n if (this.isReleased(this._sortedInfo[i].version)) {\n // 'i' holds the latest released version index\n // compensate for the requested 'n'\n idx = i - Math.floor(n);\n break;\n }\n }\n\n if (idx > len || idx < 0) {\n return null;\n }\n\n return this._sortedInfo[idx];\n }\n}\n"]}
1
+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AC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAC9B,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;gBACjD,8CAA8C;gBAC9C,mCAAmC;gBACnC,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBACxB,MAAM;YACR,CAAC;QACH,CAAC;QAED,IAAI,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,CAAC,EAAE,CAAC;YACzB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAC/B,CAAC;CACF;AApKD,gCAoKC","sourcesContent":["import { DateTime } from 'luxon';\nimport type { DataFile } from '../../data-files.generated';\nimport dataFiles from '../../data-files.generated';\n\nexport interface DistroSchedule {\n codename: string;\n series: string;\n created: string;\n release: string;\n eol: string;\n eol_server?: string;\n eol_esm?: string;\n eol_lts?: string;\n eol_elts?: string;\n}\n\nexport type DistroDataFile =\n | 'data/ubuntu-distro-info.json'\n | 'data/debian-distro-info.json';\n\nexport type DistroInfoRecord = Record<string, DistroSchedule>;\n\nexport type DistroInfoRecordWithVersion = { version: string } & DistroSchedule;\n\n// Days to delay new releases\nconst delay = 1;\n\nexport class DistroInfo {\n private readonly _codenameToVersion = new Map<\n string,\n DistroInfoRecordWithVersion\n >();\n\n private readonly _sortedInfo: DistroInfoRecordWithVersion[] = [];\n\n private readonly _distroInfo: DistroInfoRecord;\n\n constructor(distroJsonKey: DistroDataFile) {\n this._distroInfo = JSON.parse(\n dataFiles.get(distroJsonKey as DataFile)!.replace(/v([\\d.]+)\\b/gm, '$1'),\n );\n\n for (const version of Object.keys(this._distroInfo)) {\n const schedule = this._distroInfo[version];\n this._codenameToVersion.set(schedule.series, { version, ...schedule });\n }\n\n const arr = Object.keys(this._distroInfo).sort(\n (a, b) => parseFloat(a) - parseFloat(b),\n );\n\n for (const v of arr) {\n const obj = { version: v, ...this._distroInfo[v.toString()] };\n if (!obj.release) {\n // istanbul ignore next\n continue;\n }\n this._sortedInfo.push(obj);\n }\n }\n\n /**\n * Check if input is a valid release codename\n * @param input A codename\n * @returns true if input is a codename, false otherwise\n */\n public isCodename(input: string): boolean {\n return this._codenameToVersion.has(input);\n }\n\n /**\n * Checks if given input string is a valid release version\n * @param input A codename/semVer\n * @returns true if release exists, false otherwise\n */\n public exists(input: string): boolean {\n const ver = this.getVersionByCodename(input);\n return !!this._distroInfo[ver];\n }\n\n /**\n * Get semVer representation of a given codename\n * @param input A codename\n * @returns A semVer if exists, otherwise input string is returned\n */\n public getVersionByCodename(input: string): string {\n const schedule = this._codenameToVersion.get(input);\n if (schedule) {\n return schedule.version;\n }\n return input;\n }\n\n /**\n * Get codename representation of a given semVer\n * @param input A semVer\n * @returns A codename if exists, otherwise input string is returned\n */\n public getCodenameByVersion(input: string): string {\n const di = this._distroInfo[input];\n if (di) {\n return di.series;\n }\n // istanbul ignore next\n return input;\n }\n\n /**\n * Get schedule of a given release\n * @param input A codename/semVer\n * @returns A schedule if available, otherwise undefined\n */\n public getSchedule(input: string): DistroSchedule | null {\n const ver = this.getVersionByCodename(input);\n return this._distroInfo[ver] ?? null;\n }\n\n /**\n * Check if a given release has passed its EOL\n * @param input A codename/semVer\n * @returns false if still supported, true otherwise\n */\n public isEolLts(input: string): boolean {\n const ver = this.getVersionByCodename(input);\n const schedule = this.getSchedule(ver);\n const endLts = schedule?.eol ?? null;\n let end = schedule?.eol_lts ?? null;\n\n // ubuntu: does not have eol_lts\n // debian: only \"Stable\" has no eol_lts, old and oldold has both\n end ??= endLts;\n\n if (end) {\n const now = DateTime.now().toUTC();\n const eol = DateTime.fromISO(end, { zone: 'utc' });\n return eol < now;\n }\n\n // istanbul ignore next\n return true;\n }\n\n /**\n * Check if a given version has been released\n * @param input A codename/semVer\n * @returns false if unreleased or has no schedule, true otherwise\n */\n public isReleased(input: string): boolean {\n const ver = this.getVersionByCodename(input);\n const schedule = this.getSchedule(ver);\n\n if (!schedule) {\n return false;\n }\n\n const now = DateTime.now().minus({ day: delay }).toUTC();\n const release = DateTime.fromISO(schedule.release, { zone: 'utc' });\n\n return release < now;\n }\n\n /**\n * Get distro info for the release that has N other newer releases.\n * Example: n=0 corresponds to the latest available release, n=1 the release before, etc.\n * In Debian terms: N = 0 -> stable, N = 1 -> oldstable, N = 2 -> oldoldstalbe\n * @param n\n * @returns Distro info of the Nth latest release\n */\n public getNLatest(n: number): DistroInfoRecordWithVersion | null {\n const len = this._sortedInfo.length - 1;\n let idx = -1;\n\n if (n < 0) {\n return null;\n }\n\n for (let i = len; i >= 0; i--) {\n if (this.isReleased(this._sortedInfo[i].version)) {\n // 'i' holds the latest released version index\n // compensate for the requested 'n'\n idx = i - Math.floor(n);\n break;\n }\n }\n\n if (idx > len || idx < 0) {\n return null;\n }\n\n return this._sortedInfo[idx];\n }\n}\n"]}
@@ -2,7 +2,8 @@
2
2
  * This can convert most hashicorp ranges to valid npm syntax
3
3
  * The `!=` syntax is currently unsupported as there is no direct
4
4
  * equivalent in npm and isn't widely used
5
- * Also prerelease syntax is less well-defined for hashicorp and will
5
+ * The version part of the constraint is parsed as a semver but with the minor and patch versions being optional.
6
+ * The prerelease syntax is less well-defined for hashicorp and will
6
7
  * cause issues if it is not semvar compatible as no attempts to convert it
7
8
  * are made
8
9
  */
@@ -4,11 +4,16 @@ exports.hashicorp2npm = hashicorp2npm;
4
4
  exports.npm2hashicorp = npm2hashicorp;
5
5
  const logger_1 = require("../../../logger");
6
6
  const regex_1 = require("../../../util/regex");
7
+ // Taken from https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string. Licensed under CC BY 3.0
8
+ // Removed the ^ and $.
9
+ // Made minor and patch versions optional by surrounding them in parentheses followed by a question mark.
10
+ const semverRegex = /(0|[1-9]\d*)(\.(0|[1-9]\d*))?(\.(0|[1-9]\d*))?(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?/;
7
11
  /**
8
12
  * This can convert most hashicorp ranges to valid npm syntax
9
13
  * The `!=` syntax is currently unsupported as there is no direct
10
14
  * equivalent in npm and isn't widely used
11
- * Also prerelease syntax is less well-defined for hashicorp and will
15
+ * The version part of the constraint is parsed as a semver but with the minor and patch versions being optional.
16
+ * The prerelease syntax is less well-defined for hashicorp and will
12
17
  * cause issues if it is not semvar compatible as no attempts to convert it
13
18
  * are made
14
19
  */
@@ -19,18 +24,18 @@ function hashicorp2npm(input) {
19
24
  return input
20
25
  .split(',')
21
26
  .map((single) => {
22
- const r = single.match((0, regex_1.regEx)(/^\s*(|=|!=|>|<|>=|<=|~>)\s*v?((\d+)(\.\d+){0,2}[\w-+]*(\.\d+)*)\s*$/));
27
+ const r = single.match((0, regex_1.regEx)(`^\\s*(?<operator>(|=|!=|>|<|>=|<=|~>))\\s*v?(?<version>${semverRegex.source})\\s*$`));
23
28
  if (!r) {
24
29
  logger_1.logger.warn({ constraint: input, element: single }, 'Invalid hashicorp constraint');
25
30
  throw new Error('Invalid hashicorp constraint');
26
31
  }
27
- if (r[1] === '!=') {
32
+ if (r.groups.operator === '!=') {
28
33
  logger_1.logger.warn({ constraint: input, element: single }, 'Unsupported hashicorp constraint');
29
34
  throw new Error('Unsupported hashicorp constraint');
30
35
  }
31
36
  return {
32
- operator: r[1],
33
- version: r[2],
37
+ operator: r.groups.operator,
38
+ version: r.groups.version,
34
39
  };
35
40
  })
36
41
  .map(({ operator, version }) => {
@@ -63,13 +68,13 @@ function npm2hashicorp(input) {
63
68
  return input
64
69
  .split(' ')
65
70
  .map((single) => {
66
- const r = single.match((0, regex_1.regEx)(/^(|>|<|>=|<=|~|\^)v?((\d+)(\.\d+){0,2}[\w-]*(\.\d+)*)$/));
71
+ const r = single.match((0, regex_1.regEx)(`^(?<operator>(|>|<|>=|<=|~|\\^))v?(?<version>${semverRegex.source})$`));
67
72
  if (!r) {
68
73
  throw new Error('invalid npm constraint');
69
74
  }
70
75
  return {
71
- operator: r[1],
72
- version: r[2],
76
+ operator: r.groups.operator,
77
+ version: r.groups.version,
73
78
  };
74
79
  })
75
80
  .map(({ operator, version }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"convertor.js","sourceRoot":"","sources":["../../../../lib/modules/versioning/hashicorp/convertor.ts"],"names":[],"mappings":";;AAWA,sCAgDC;AAOD,sCAmDC;AArHD,4CAAyC;AACzC,+CAA4C;AAE5C;;;;;;;GAOG;AACH,SAAgB,aAAa,CAAC,KAAa;IACzC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,KAAK;SACT,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QACd,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CACpB,IAAA,aAAK,EACH,qEAAqE,CACtE,CACF,CAAC;QACF,IAAI,CAAC,CAAC,EAAE,CAAC;YACP,eAAM,CAAC,IAAI,CACT,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EACtC,8BAA8B,CAC/B,CAAC;YACF,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;QAClD,CAAC;QACD,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;YAClB,eAAM,CAAC,IAAI,CACT,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EACtC,kCAAkC,CACnC,CAAC;YACF,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;QACtD,CAAC;QACD,OAAO;YACL,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC;YACd,OAAO,EAAE,CAAC,CAAC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can convert most hashicorp ranges to valid npm syntax\n * The `!=` syntax is currently unsupported as there is no direct\n * equivalent in npm and isn't widely used\n * Also prerelease syntax is less well-defined for hashicorp and will\n * cause issues if it is not semvar compatible as no attempts to convert it\n * are made\n */\nexport function hashicorp2npm(input: string): string {\n if (!input) {\n return input;\n }\n return input\n .split(',')\n .map((single) => {\n const r = single.match(\n regEx(\n /^\\s*(|=|!=|>|<|>=|<=|~>)\\s*v?((\\d+)(\\.\\d+){0,2}[\\w-+]*(\\.\\d+)*)\\s*$/,\n ),\n );\n if (!r) {\n logger.warn(\n { constraint: input, element: single },\n 'Invalid hashicorp constraint',\n );\n throw new Error('Invalid hashicorp constraint');\n }\n if (r[1] === '!=') {\n logger.warn(\n { constraint: input, element: single },\n 'Unsupported hashicorp constraint',\n );\n throw new Error('Unsupported hashicorp constraint');\n }\n return {\n operator: r[1],\n version: r[2],\n };\n })\n .map(({ operator, version }) => {\n switch (operator) {\n case '=':\n return version;\n case '~>':\n if (version.match(regEx(/^\\d+$/))) {\n return `>=${version}`;\n }\n if (version.match(regEx(/^\\d+\\.\\d+$/))) {\n return `^${version}`;\n }\n return `~${version}`;\n default:\n return `${operator}${version}`;\n }\n })\n .join(' ');\n}\n\n/**\n * This can convert a limited set of npm range syntax to hashicorp,\n * it supports all the syntax that hashicorp2npm can output\n * It cannot handle `*`, `1.x.x`, range with `-`, `||`\n */\nexport function npm2hashicorp(input: string): string {\n if (!input) {\n return input;\n }\n return input\n .split(' ')\n .map((single) => {\n const r = single.match(\n regEx(/^(|>|<|>=|<=|~|\\^)v?((\\d+)(\\.\\d+){0,2}[\\w-]*(\\.\\d+)*)$/),\n );\n if (!r) {\n throw new Error('invalid npm constraint');\n }\n return {\n operator: r[1],\n version: r[2],\n };\n })\n .map(({ operator, version }) => {\n switch (operator) {\n case '^': {\n if (version.match(regEx(/^\\d+$/))) {\n return `~> ${version}.0`;\n }\n const withZero = version.match(regEx(/^(\\d+\\.\\d+)\\.0$/));\n if (withZero) {\n return `~> ${withZero[1]}`;\n }\n const nonZero = version.match(regEx(/^(\\d+\\.\\d+)\\.\\d+$/));\n if (nonZero) {\n // not including`>= ${version}`, which makes this less accurate\n // but makes the results cleaner\n return `~> ${nonZero[1]}`;\n }\n return `~> ${version}`;\n }\n case '~':\n if (version.match(regEx(/^\\d+$/))) {\n return `~> ${version}.0`;\n }\n if (version.match(regEx(/^\\d+\\.\\d+$/))) {\n return `~> ${version}.0`;\n }\n return `~> ${version}`;\n case '':\n return `${version}`;\n default:\n return `${operator} ${version}`;\n }\n })\n .join(', ');\n}\n"]}
1
+ {"version":3,"file":"convertor.js","sourceRoot":"","sources":["../../../../lib/modules/versioning/hashicorp/convertor.ts"],"names":[],"mappings":";;AAkBA,sCAgDC;AAOD,sCAqDC;AA9HD,4CAAyC;AACzC,+CAA4C;AAE5C,kIAAkI;AAClI,uBAAuB;AACvB,yGAAyG;AACzG,MAAM,WAAW,GACf,yLAAyL,CAAC;AAE5L;;;;;;;;GAQG;AACH,SAAgB,aAAa,CAAC,KAAa;IACzC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,KAAK;SACT,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QACd,MAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CACpB,IAAA,aAAK,EACH,0DAA0D,WAAW,CAAC,MAAM,QAAQ,CACrF,CACF,CAAC;QACF,IAAI,CAAC,CAAC,EAAE,CAAC;YACP,eAAM,CAAC,IAAI,CACT,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,EACtC,8BAA8B,CAC/B,CAAC;YACF,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;QAClD,CAAC;QACD,IAAI,CAAC,CAAC,MAAO,CAAC,QAAQ,KAAK,IAAI,EAAE,CAAC;YAChC,eAAM,CAAC,IAAI,CACT,EAAE,UAAU,EAAE,KAA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,EAAE,CAAC;YACzB,KAAK,EAAE;gBACL,OAAO,GAAG,OAAO,EAAE,CAAC;YACtB;gBACE,OAAO,GAAG,QAAQ,IAAI,OAAO,EAAE,CAAC;QACpC,CAAC;IACH,CAAC,CAAC;SACD,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC","sourcesContent":["import { logger } from '../../../logger';\nimport { regEx } from '../../../util/regex';\n\n// Taken from https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string. Licensed under CC BY 3.0\n// Removed the ^ and $.\n// Made minor and patch versions optional by surrounding them in parentheses followed by a question mark.\nconst semverRegex =\n /(0|[1-9]\\d*)(\\.(0|[1-9]\\d*))?(\\.(0|[1-9]\\d*))?(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?/;\n\n/**\n * This can convert most hashicorp ranges to valid npm syntax\n * The `!=` syntax is currently unsupported as there is no direct\n * equivalent in npm and isn't widely used\n * The version part of the constraint is parsed as a semver but with the minor and patch versions being optional.\n * The prerelease syntax is less well-defined for hashicorp and will\n * cause issues if it is not semvar compatible as no attempts to convert it\n * are made\n */\nexport function hashicorp2npm(input: string): string {\n if (!input) {\n return input;\n }\n return input\n .split(',')\n .map((single) => {\n const r = single.match(\n regEx(\n `^\\\\s*(?<operator>(|=|!=|>|<|>=|<=|~>))\\\\s*v?(?<version>${semverRegex.source})\\\\s*$`,\n ),\n );\n if (!r) {\n logger.warn(\n { constraint: input, element: single },\n 'Invalid hashicorp constraint',\n );\n throw new Error('Invalid hashicorp constraint');\n }\n if (r.groups!.operator === '!=') {\n logger.warn(\n { constraint: input, element: single },\n 'Unsupported hashicorp constraint',\n );\n throw new Error('Unsupported hashicorp constraint');\n }\n return {\n operator: r.groups!.operator,\n version: r.groups!.version,\n };\n })\n .map(({ operator, version }) => {\n switch (operator) {\n case '=':\n return version;\n case '~>':\n if (version.match(regEx(/^\\d+$/))) {\n return `>=${version}`;\n }\n if (version.match(regEx(/^\\d+\\.\\d+$/))) {\n return `^${version}`;\n }\n return `~${version}`;\n default:\n return `${operator}${version}`;\n }\n })\n .join(' ');\n}\n\n/**\n * This can convert a limited set of npm range syntax to hashicorp,\n * it supports all the syntax that hashicorp2npm can output\n * It cannot handle `*`, `1.x.x`, range with `-`, `||`\n */\nexport function npm2hashicorp(input: string): string {\n if (!input) {\n return input;\n }\n return input\n .split(' ')\n .map((single) => {\n const r = single.match(\n regEx(\n `^(?<operator>(|>|<|>=|<=|~|\\\\^))v?(?<version>${semverRegex.source})$`,\n ),\n );\n if (!r) {\n throw new Error('invalid npm constraint');\n }\n return {\n operator: r.groups!.operator,\n version: r.groups!.version,\n };\n })\n .map(({ operator, version }) => {\n switch (operator) {\n case '^': {\n if (version.match(regEx(/^\\d+$/))) {\n return `~> ${version}.0`;\n }\n const withZero = version.match(regEx(/^(\\d+\\.\\d+)\\.0$/));\n if (withZero) {\n return `~> ${withZero[1]}`;\n }\n const nonZero = version.match(regEx(/^(\\d+\\.\\d+)\\.\\d+$/));\n if (nonZero) {\n // not including`>= ${version}`, which makes this less accurate\n // but makes the results cleaner\n return `~> ${nonZero[1]}`;\n }\n return `~> ${version}`;\n }\n case '~':\n if (version.match(regEx(/^\\d+$/))) {\n return `~> ${version}.0`;\n }\n if (version.match(regEx(/^\\d+\\.\\d+$/))) {\n return `~> ${version}.0`;\n }\n return `~> ${version}`;\n case '':\n return `${version}`;\n default:\n return `${operator} ${version}`;\n }\n })\n .join(', ');\n}\n"]}
@@ -70,13 +70,13 @@ function getNewValue({ currentValue, rangeStrategy, currentVersion, newVersion,
70
70
  if (newSemver) {
71
71
  newSemver = npm2hex(newSemver);
72
72
  if ((0, regex_1.regEx)(/~>\s*(\d+\.\d+\.\d+)$/).test(currentValue)) {
73
- newSemver = newSemver.replace((0, regex_1.regEx)(/[\^~]\s*(\d+\.\d+\.\d+)/), (_str, p1) => `~> ${p1}`);
73
+ newSemver = newSemver.replace((0, regex_1.regEx)(/[\^~]\s*(\d+\.\d+\.\d+)/g), (_str, p1) => `~> ${p1}`);
74
74
  }
75
75
  else if ((0, regex_1.regEx)(/~>\s*(\d+\.\d+)$/).test(currentValue)) {
76
- newSemver = newSemver.replace((0, regex_1.regEx)(/\^\s*(\d+\.\d+)(\.\d+)?/), (_str, p1) => `~> ${p1}`);
76
+ newSemver = newSemver.replace((0, regex_1.regEx)(/\^\s*(\d+\.\d+)(\.\d+)?/g), (_str, p1) => `~> ${p1}`);
77
77
  }
78
78
  else {
79
- newSemver = newSemver.replace((0, regex_1.regEx)(/~\s*(\d+\.\d+\.\d)/), '~> $1');
79
+ newSemver = newSemver.replace((0, regex_1.regEx)(/~\s*(\d+\.\d+\.\d)/g), '~> $1');
80
80
  }
81
81
  if (npm_1.api.isVersion(newSemver)) {
82
82
  newSemver = `== ${newSemver}`;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/modules/versioning/hex/index.ts"],"names":[],"mappings":";;;AACA,+CAA4C;AAC5C,gCAAoC;AAGvB,QAAA,EAAE,GAAG,KAAK,CAAC;AACX,QAAA,WAAW,GAAG,KAAK,CAAC;AACpB,QAAA,IAAI,GAAG,CAAC,wCAAwC,CAAC,CAAC;AAClD,QAAA,cAAc,GAAG,IAAI,CAAC;AACtB,QAAA,wBAAwB,GAAoB;IACvD,MAAM;IACN,OAAO;IACP,KAAK;IACL,SAAS;IACT,iBAAiB;CAClB,CAAC;AAEF,SAAS,OAAO,CAAC,KAAa;IAC5B,OAAO,KAAK;SACT,OAAO,CAAC,IAAA,aAAK,EAAC,kBAAkB,CAAC,EAAE,KAAK,CAAC;SACzC,OAAO,CAAC,IAAA,aAAK,EAAC,sBAAsB,CAAC,EAAE,KAAK,CAAC;SAC7C,OAAO,CAAC,IAAA,aAAK,EAAC,QAAQ,CAAC,EA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AAA,aAAK,EAAC,uBAAuB,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;YACtD,SAAS,GAAG,SAAS,CAAC,OAAO,CAC3B,IAAA,aAAK,EAAC,yBAAyB,CAAC,EAChC,CAAC,IAAI,EAAE,EAAU,EAAE,EAAE,CAAC,MAAM,EAAE,EAAE,CACjC,CAAC;QACJ,CAAC;aAAM,IAAI,IAAA,aAAK,EAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;YACxD,SAAS,GAAG,SAAS,CAAC,OAAO,CAC3B,IAAA,aAAK,EAAC,yBAAyB,CAAC,EAChC,CAAC,IAAI,EAAE,EAAU,EAAE,EAAE,CAAC,MAAM,EAAE,EAAE,CACjC,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,IAAA,aAAK,EAAC,oBAAoB,CAAC,EAAE,OAAO,CAAC,CAAC;QACtE,CAAC;QACD,IAAI,SAAG,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC;YAC7B,SAAS,GAAG,MAAM,SAAS,EAAE,CAAC;QAChC,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAIY,QAAA,GAAG,GAAkB;IAChC,GAAG,SAAG;IACN,eAAe;IACf,OAAO;IACP,OAAO;IACP,oBAAoB;IACpB,oBAAoB;IACpB,WAAW;CACZ,CAAC;AAEF,kBAAe,WAAG,CAAC","sourcesContent":["import type { RangeStrategy } from '../../../types/versioning';\nimport { regEx } from '../../../util/regex';\nimport { api as npm } from '../npm';\nimport type { NewValueConfig, VersioningApi } from '../types';\n\nexport const id = 'hex';\nexport const displayName = 'Hex';\nexport const urls = ['https://hexdocs.pm/elixir/Version.html'];\nexport const supportsRanges = true;\nexport const supportedRangeStrategies: RangeStrategy[] = [\n 'bump',\n 'widen',\n 'pin',\n 'replace',\n 'update-lockfile',\n];\n\nfunction hex2npm(input: string): string {\n return input\n .replace(regEx(/~>\\s*(\\d+\\.\\d+)$/), '^$1')\n .replace(regEx(/~>\\s*(\\d+\\.\\d+\\.\\d+)/), '~$1')\n .replace(regEx(/==|and/), '')\n .replace('or', '||')\n .replace(regEx(/!=\\s*(\\d+\\.\\d+(\\.\\d+.*)?)/), '>$1 <$1')\n .trim();\n}\n\nfunction npm2hex(input: string): string {\n const res = input\n .split(' ')\n .map((str) => str.trim())\n .filter((str) => str !== '');\n let output = '';\n const operators = ['^', '=', '>', '<', '<=', '>=', '~>'];\n for (let i = 0; i < res.length; i += 1) {\n if (i === res.length - 1) {\n output += res[i];\n break;\n }\n if (i < res.length - 1 && res[i + 1].includes('||')) {\n output += res[i] + ' or ';\n i += 1;\n } else if (operators.includes(res[i])) {\n output += res[i] + ' ';\n } else {\n output += res[i] + ' and ';\n }\n }\n return output;\n}\n\nfunction isLessThanRange(version: string, range: string): boolean {\n return !!npm.isLessThanRange?.(hex2npm(version), hex2npm(range));\n}\n\nconst isValid = (input: string): boolean => !!npm.isValid(hex2npm(input));\n\nconst matches = (version: string, range: string): boolean =>\n npm.matches(hex2npm(version), hex2npm(range));\n\nfunction getSatisfyingVersion(\n versions: string[],\n range: string,\n): string | null {\n return npm.getSatisfyingVersion(versions.map(hex2npm), hex2npm(range));\n}\n\nfunction minSatisfyingVersion(\n versions: string[],\n range: string,\n): string | null {\n return npm.minSatisfyingVersion(versions.map(hex2npm), hex2npm(range));\n}\n\nfunction getNewValue({\n currentValue,\n rangeStrategy,\n currentVersion,\n newVersion,\n}: NewValueConfig): string | null {\n let newSemver = npm.getNewValue({\n currentValue: hex2npm(currentValue),\n rangeStrategy,\n currentVersion,\n newVersion,\n });\n if (newSemver) {\n newSemver = npm2hex(newSemver);\n\n if (regEx(/~>\\s*(\\d+\\.\\d+\\.\\d+)$/).test(currentValue)) {\n newSemver = newSemver.replace(\n regEx(/[\\^~]\\s*(\\d+\\.\\d+\\.\\d+)/),\n (_str, p1: string) => `~> ${p1}`,\n );\n } else if (regEx(/~>\\s*(\\d+\\.\\d+)$/).test(currentValue)) {\n newSemver = newSemver.replace(\n regEx(/\\^\\s*(\\d+\\.\\d+)(\\.\\d+)?/),\n (_str, p1: string) => `~> ${p1}`,\n );\n } else {\n newSemver = newSemver.replace(regEx(/~\\s*(\\d+\\.\\d+\\.\\d)/), '~> $1');\n }\n if (npm.isVersion(newSemver)) {\n newSemver = `== ${newSemver}`;\n }\n }\n return newSemver;\n}\n\nexport { isValid };\n\nexport const api: VersioningApi = {\n ...npm,\n isLessThanRange,\n isValid,\n matches,\n getSatisfyingVersion,\n minSatisfyingVersion,\n getNewValue,\n};\n\nexport default api;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/modules/versioning/hex/index.ts"],"names":[],"mappings":";;;AACA,+CAA4C;AAC5C,gCAAoC;AAGvB,QAAA,EAAE,GAAG,KAAK,CAAC;AACX,QAAA,WAAW,GAAG,KAAK,CAAC;AACpB,QAAA,IAAI,GAAG,CAAC,wCAAwC,CAAC,CAAC;AAClD,QAAA,cAAc,GAAG,IAAI,CAAC;AACtB,QAAA,wBAAwB,GAAoB;IACvD,MAAM;IACN,OAAO;IACP,KAAK;IACL,SAAS;IACT,iBAAiB;CAClB,CAAC;AAEF,SAAS,OAAO,CAAC,KAAa;IAC5B,OAAO,KAAK;SACT,OAAO,CAAC,IAAA,aAAK,EAAC,kBAAkB,CAAC,EAAE,KAAK,CAAC;SACzC,OAAO,CAAC,IAAA,aAAK,EAAC,sBAAsB,CAAC,EAAE,KAAK,CAAC;SAC7C,OAAO,CAAC,IAAA,aAAK,EAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;SAC5B,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC;SACnB,OAAO,CAAC,IAAA,aAAK,EAAC,2BAA2B,CAAC,EAAE,SAAS,CAAC;SACtD,IAAI,EAAE,CAAC;AACZ,CAAC;AAED,SAAS,OAAO,CAAC,KAAa;IAC5B,MAAM,GAAG,GAAG,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jC,CAAC;QACJ,CAAC;aAAM,IAAI,IAAA,aAAK,EAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;YACxD,SAAS,GAAG,SAAS,CAAC,OAAO,CAC3B,IAAA,aAAK,EAAC,0BAA0B,CAAC,EACjC,CAAC,IAAI,EAAE,EAAU,EAAE,EAAE,CAAC,MAAM,EAAE,EAAE,CACjC,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,SAAS,GAAG,SAAS,CAAC,OAAO,CAAC,IAAA,aAAK,EAAC,qBAAqB,CAAC,EAAE,OAAO,CAAC,CAAC;QACvE,CAAC;QACD,IAAI,SAAG,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC;YAC7B,SAAS,GAAG,MAAM,SAAS,EAAE,CAAC;QAChC,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAIY,QAAA,GAAG,GAAkB;IAChC,GAAG,SAAG;IACN,eAAe;IACf,OAAO;IACP,OAAO;IACP,oBAAoB;IACpB,oBAAoB;IACpB,WAAW;CACZ,CAAC;AAEF,kBAAe,WAAG,CAAC","sourcesContent":["import type { RangeStrategy } from '../../../types/versioning';\nimport { regEx } from '../../../util/regex';\nimport { api as npm } from '../npm';\nimport type { NewValueConfig, VersioningApi } from '../types';\n\nexport const id = 'hex';\nexport const displayName = 'Hex';\nexport const urls = ['https://hexdocs.pm/elixir/Version.html'];\nexport const supportsRanges = true;\nexport const supportedRangeStrategies: RangeStrategy[] = [\n 'bump',\n 'widen',\n 'pin',\n 'replace',\n 'update-lockfile',\n];\n\nfunction hex2npm(input: string): string {\n return input\n .replace(regEx(/~>\\s*(\\d+\\.\\d+)$/), '^$1')\n .replace(regEx(/~>\\s*(\\d+\\.\\d+\\.\\d+)/), '~$1')\n .replace(regEx(/==|and/), '')\n .replace('or', '||')\n .replace(regEx(/!=\\s*(\\d+\\.\\d+(\\.\\d+.*)?)/), '>$1 <$1')\n .trim();\n}\n\nfunction npm2hex(input: string): string {\n const res = input\n .split(' ')\n .map((str) => str.trim())\n .filter((str) => str !== '');\n let output = '';\n const operators = ['^', '=', '>', '<', '<=', '>=', '~>'];\n for (let i = 0; i < res.length; i += 1) {\n if (i === res.length - 1) {\n output += res[i];\n break;\n }\n if (i < res.length - 1 && res[i + 1].includes('||')) {\n output += res[i] + ' or ';\n i += 1;\n } else if (operators.includes(res[i])) {\n output += res[i] + ' ';\n } else {\n output += res[i] + ' and ';\n }\n }\n return output;\n}\n\nfunction isLessThanRange(version: string, range: string): boolean {\n return !!npm.isLessThanRange?.(hex2npm(version), hex2npm(range));\n}\n\nconst isValid = (input: string): boolean => !!npm.isValid(hex2npm(input));\n\nconst matches = (version: string, range: string): boolean =>\n npm.matches(hex2npm(version), hex2npm(range));\n\nfunction getSatisfyingVersion(\n versions: string[],\n range: string,\n): string | null {\n return npm.getSatisfyingVersion(versions.map(hex2npm), hex2npm(range));\n}\n\nfunction minSatisfyingVersion(\n versions: string[],\n range: string,\n): string | null {\n return npm.minSatisfyingVersion(versions.map(hex2npm), hex2npm(range));\n}\n\nfunction getNewValue({\n currentValue,\n rangeStrategy,\n currentVersion,\n newVersion,\n}: NewValueConfig): string | null {\n let newSemver = npm.getNewValue({\n currentValue: hex2npm(currentValue),\n rangeStrategy,\n currentVersion,\n newVersion,\n });\n if (newSemver) {\n newSemver = npm2hex(newSemver);\n\n if (regEx(/~>\\s*(\\d+\\.\\d+\\.\\d+)$/).test(currentValue)) {\n newSemver = newSemver.replace(\n regEx(/[\\^~]\\s*(\\d+\\.\\d+\\.\\d+)/g),\n (_str, p1: string) => `~> ${p1}`,\n );\n } else if (regEx(/~>\\s*(\\d+\\.\\d+)$/).test(currentValue)) {\n newSemver = newSemver.replace(\n regEx(/\\^\\s*(\\d+\\.\\d+)(\\.\\d+)?/g),\n (_str, p1: string) => `~> ${p1}`,\n );\n } else {\n newSemver = newSemver.replace(regEx(/~\\s*(\\d+\\.\\d+\\.\\d)/g), '~> $1');\n }\n if (npm.isVersion(newSemver)) {\n newSemver = `== ${newSemver}`;\n }\n }\n return newSemver;\n}\n\nexport { isValid };\n\nexport const api: VersioningApi = {\n ...npm,\n isLessThanRange,\n isValid,\n matches,\n getSatisfyingVersion,\n minSatisfyingVersion,\n getNewValue,\n};\n\nexport default api;\n"]}
@@ -20,7 +20,7 @@ exports.supportedRangeStrategies = [
20
20
  'pin',
21
21
  'replace',
22
22
  ];
23
- const { compare: sortVersions, maxSatisfying: getSatisfyingVersion, minSatisfying: minSatisfyingVersion, major: getMajor, minor: getMinor, patch: getPatch, satisfies: matches, valid, validRange, ltr: isLessThanRange, gt: isGreaterThan, eq: equals, subset, } = semver_1.default;
23
+ const { compare: sortVersions, maxSatisfying: getSatisfyingVersion, minSatisfying: minSatisfyingVersion, major: getMajor, minor: getMinor, patch: getPatch, satisfies: matches, valid, validRange, ltr: isLessThanRange, gt: isGreaterThan, eq: equals, subset, intersects, } = semver_1.default;
24
24
  // If this is left as an alias, inputs like "17.04.0" throw errors
25
25
  const isValid = (input) => !!validRange(input);
26
26
  exports.isValid = isValid;
@@ -48,6 +48,7 @@ exports.api = {
48
48
  minSatisfyingVersion,
49
49
  sortVersions,
50
50
  subset,
51
+ intersects,
51
52
  };
52
53
  exports.default = exports.api;
53
54
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/modules/versioning/npm/index.ts"],"names":[],"mappings":";;;;AAAA,4DAA4B;AAC5B,0EAAmC;AAGnC,mCAAsC;AAEzB,QAAA,EAAE,GAAG,KAAK,CAAC;AACX,QAAA,WAAW,GAAG,KAAK,CAAC;AACpB,QAAA,IAAI,GAAG;IAClB,qBAAqB;IACrB,sCAAsC;IACtC,kDAAkD;IAClD,2BAA2B;CAC5B,CAAC;AACW,QAAA,cAAc,GAAG,IAAI,CAAC;AACtB,QAAA,wBAAwB,GAAoB;IACvD,MAAM;IACN,OAAO;IACP,KAAK;IACL,SAAS;CACV,CAAC;AAEF,MAAM,EACJ,OAAO,EAAE,YAAY,EACrB,aAAa,EAAE,oBAAoB,EACnC,aAAa,EAAE,oBAAoB,EACnC,KAAK,EAAE,QAAQ,EACf,KAAK,EAAE,QAAQ,EACf,KAAK,EAAE,QAAQ,EACf,SAAS,EAAE,OAAO,EAClB,KAAK,EACL,UAAU,EACV,GAAG,EAAE,eAAe,EACpB,EAAE,EAAE,aAAa,EACjB,EAAE,EAAE,MAAM,EACV,MAAM,GACP,GAAG,gBAAM,CAAC;AAEX,kEAAkE;AAC3D,MAAM,OAAO,GAAG,CAAC,KAAa,EAAW,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;AAA1D,QAAA,OAAO,WAAmD;AAChE,MAAM,SAAS,GAAG,CAAC,KAAa,EAAW,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAAvD,QAAA,SAAS,aAA8C;AAEpE,SAAS,eAAe,CAAC,UAAkB;IACzC,OAAO,CACL,IAAA,iBAAS,EAAC,UAAU,CAAC;QACrB,CAAC,UAAU,EAAE,UAAU,CAAC,GAAG,CAAC,IAAI,IAAA,iBAAS,EAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAC3E,CAAC;AACJ,CAAC;AAEY,QAAA,GAAG,GAAkB;IAChC,MAAM;IACN,QAAQ;IACR,QAAQ;IACR,WAAW,EAAX,mBAAW;IACX,QAAQ;IACR,YAAY,EAAE,iBAAS;IACvB,aAAa;IACb,eAAe;IACf,eAAe;IACf,QAAQ,EAAE,uBAAM,CAAC,EAAE;IACnB,OAAO,EAAP,eAAO;IACP,SAAS,EAAT,iBAAS;IACT,OAAO;IACP,oBAAoB;IACpB,oBAAoB;IACpB,YAAY;IACZ,MAAM;CACP,CAAC;AAEF,kBAAe,WAAG,CAAC","sourcesContent":["import semver from 'semver';\nimport stable from 'semver-stable';\nimport type { RangeStrategy } from '../../../types/versioning';\nimport type { VersioningApi } from '../types';\nimport { getNewValue } from './range';\n\nexport const id = 'npm';\nexport const displayName = 'npm';\nexport const urls = [\n 'https://semver.org/',\n 'https://www.npmjs.com/package/semver',\n 'https://docs.npmjs.com/about-semantic-versioning',\n 'https://semver.npmjs.com/',\n];\nexport const supportsRanges = true;\nexport const supportedRangeStrategies: RangeStrategy[] = [\n 'bump',\n 'widen',\n 'pin',\n 'replace',\n];\n\nconst {\n compare: sortVersions,\n maxSatisfying: getSatisfyingVersion,\n minSatisfying: minSatisfyingVersion,\n major: getMajor,\n minor: getMinor,\n patch: getPatch,\n satisfies: matches,\n valid,\n validRange,\n ltr: isLessThanRange,\n gt: isGreaterThan,\n eq: equals,\n subset,\n} = semver;\n\n// If this is left as an alias, inputs like \"17.04.0\" throw errors\nexport const isValid = (input: string): boolean => !!validRange(input);\nexport const isVersion = (input: string): boolean => !!valid(input);\n\nfunction isSingleVersion(constraint: string): boolean {\n return (\n isVersion(constraint) ||\n (constraint?.startsWith('=') && isVersion(constraint.substring(1).trim()))\n );\n}\n\nexport const api: VersioningApi = {\n equals,\n getMajor,\n getMinor,\n getNewValue,\n getPatch,\n isCompatible: isVersion,\n isGreaterThan,\n isLessThanRange,\n isSingleVersion,\n isStable: stable.is,\n isValid,\n isVersion,\n matches,\n getSatisfyingVersion,\n minSatisfyingVersion,\n sortVersions,\n subset,\n};\n\nexport default api;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/modules/versioning/npm/index.ts"],"names":[],"mappings":";;;;AAAA,4DAA4B;AAC5B,0EAAmC;AAGnC,mCAAsC;AAEzB,QAAA,EAAE,GAAG,KAAK,CAAC;AACX,QAAA,WAAW,GAAG,KAAK,CAAC;AACpB,QAAA,IAAI,GAAG;IAClB,qBAAqB;IACrB,sCAAsC;IACtC,kDAAkD;IAClD,2BAA2B;CAC5B,CAAC;AACW,QAAA,cAAc,GAAG,IAAI,CAAC;AACtB,QAAA,wBAAwB,GAAoB;IACv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","sourcesContent":["import semver from 'semver';\nimport stable from 'semver-stable';\nimport type { RangeStrategy } from '../../../types/versioning';\nimport type { VersioningApi } from '../types';\nimport { getNewValue } from './range';\n\nexport const id = 'npm';\nexport const displayName = 'npm';\nexport const urls = [\n 'https://semver.org/',\n 'https://www.npmjs.com/package/semver',\n 'https://docs.npmjs.com/about-semantic-versioning',\n 'https://semver.npmjs.com/',\n];\nexport const supportsRanges = true;\nexport const supportedRangeStrategies: RangeStrategy[] = [\n 'bump',\n 'widen',\n 'pin',\n 'replace',\n];\n\nconst {\n compare: sortVersions,\n maxSatisfying: getSatisfyingVersion,\n minSatisfying: minSatisfyingVersion,\n major: getMajor,\n minor: getMinor,\n patch: getPatch,\n satisfies: matches,\n valid,\n validRange,\n ltr: isLessThanRange,\n gt: isGreaterThan,\n eq: equals,\n subset,\n intersects,\n} = semver;\n\n// If this is left as an alias, inputs like \"17.04.0\" throw errors\nexport const isValid = (input: string): boolean => !!validRange(input);\nexport const isVersion = (input: string): boolean => !!valid(input);\n\nfunction isSingleVersion(constraint: string): boolean {\n return (\n isVersion(constraint) ||\n (constraint?.startsWith('=') && isVersion(constraint.substring(1).trim()))\n );\n}\n\nexport const api: VersioningApi = {\n equals,\n getMajor,\n getMinor,\n getNewValue,\n getPatch,\n isCompatible: isVersion,\n isGreaterThan,\n isLessThanRange,\n isSingleVersion,\n isStable: stable.is,\n isValid,\n isVersion,\n matches,\n getSatisfyingVersion,\n minSatisfyingVersion,\n sortVersions,\n subset,\n intersects,\n};\n\nexport default api;\n"]}