renovate 40.0.0-next.4 → 40.0.0-next.41

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 (810) 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/migrate-validate.js +3 -2
  7. package/dist/config/migrate-validate.js.map +1 -1
  8. package/dist/config/migration.js +2 -1
  9. package/dist/config/migration.js.map +1 -1
  10. package/dist/config/migrations/custom/rebase-stale-prs-migration.js +1 -1
  11. package/dist/config/migrations/custom/rebase-stale-prs-migration.js.map +1 -1
  12. package/dist/config/options/index.js +17 -3
  13. package/dist/config/options/index.js.map +1 -1
  14. package/dist/config/parse.js +2 -2
  15. package/dist/config/parse.js.map +1 -1
  16. package/dist/config/presets/common.js +1 -0
  17. package/dist/config/presets/common.js.map +1 -1
  18. package/dist/config/presets/gitea/index.js +0 -1
  19. package/dist/config/presets/gitea/index.js.map +1 -1
  20. package/dist/config/presets/github/index.js +0 -1
  21. package/dist/config/presets/github/index.js.map +1 -1
  22. package/dist/config/presets/gitlab/index.js +1 -1
  23. package/dist/config/presets/gitlab/index.js.map +1 -1
  24. package/dist/config/presets/http/index.js +1 -2
  25. package/dist/config/presets/http/index.js.map +1 -1
  26. package/dist/config/presets/index.js +0 -7
  27. package/dist/config/presets/index.js.map +1 -1
  28. package/dist/config/presets/internal/custom-managers.js +18 -4
  29. package/dist/config/presets/internal/custom-managers.js.map +1 -1
  30. package/dist/config/presets/internal/group.js +30 -1
  31. package/dist/config/presets/internal/group.js.map +1 -1
  32. package/dist/config/presets/internal/index.js +1 -3
  33. package/dist/config/presets/internal/index.js.map +1 -1
  34. package/dist/config/presets/internal/workarounds.js +1 -0
  35. package/dist/config/presets/internal/workarounds.js.map +1 -1
  36. package/dist/config/presets/parse.js +2 -1
  37. package/dist/config/presets/parse.js.map +1 -1
  38. package/dist/config/schema.d.ts +2 -2
  39. package/dist/config/types.d.ts +4 -1
  40. package/dist/config/types.js.map +1 -1
  41. package/dist/config/validation.js +3 -5
  42. package/dist/config/validation.js.map +1 -1
  43. package/dist/config-validator.js +0 -1
  44. package/dist/config-validator.js.map +1 -1
  45. package/dist/constants/category.js +0 -1
  46. package/dist/constants/category.js.map +1 -1
  47. package/dist/constants/platforms.js +5 -1
  48. package/dist/constants/platforms.js.map +1 -1
  49. package/dist/data/monorepo.json +8 -2
  50. package/dist/data/source-urls.json +1 -0
  51. package/dist/data-files.generated.js +2 -2
  52. package/dist/data-files.generated.js.map +1 -1
  53. package/dist/instrumentation/index.js +39 -15
  54. package/dist/instrumentation/index.js.map +1 -1
  55. package/dist/instrumentation/utils.js +1 -1
  56. package/dist/instrumentation/utils.js.map +1 -1
  57. package/dist/logger/cmd-serializer.js +0 -1
  58. package/dist/logger/cmd-serializer.js.map +1 -1
  59. package/dist/logger/config-serializer.js +0 -1
  60. package/dist/logger/config-serializer.js.map +1 -1
  61. package/dist/logger/index.js +1 -4
  62. package/dist/logger/index.js.map +1 -1
  63. package/dist/logger/once.js +4 -2
  64. package/dist/logger/once.js.map +1 -1
  65. package/dist/logger/pretty-stdout.js +0 -1
  66. package/dist/logger/pretty-stdout.js.map +1 -1
  67. package/dist/logger/renovate-logger.js +1 -1
  68. package/dist/logger/renovate-logger.js.map +1 -1
  69. package/dist/logger/utils.js +6 -11
  70. package/dist/logger/utils.js.map +1 -1
  71. package/dist/modules/datasource/api.js +4 -0
  72. package/dist/modules/datasource/api.js.map +1 -1
  73. package/dist/modules/datasource/artifactory/index.js +1 -2
  74. package/dist/modules/datasource/artifactory/index.js.map +1 -1
  75. package/dist/modules/datasource/aws-eks-addon/index.d.ts +11 -0
  76. package/dist/modules/datasource/aws-eks-addon/index.js +75 -0
  77. package/dist/modules/datasource/aws-eks-addon/index.js.map +1 -0
  78. package/dist/modules/datasource/aws-eks-addon/schema.d.ts +40 -0
  79. package/dist/modules/datasource/aws-eks-addon/schema.js +31 -0
  80. package/dist/modules/datasource/aws-eks-addon/schema.js.map +1 -0
  81. package/dist/modules/datasource/aws-machine-image/index.js +6 -5
  82. package/dist/modules/datasource/aws-machine-image/index.js.map +1 -1
  83. package/dist/modules/datasource/azure-pipelines-tasks/index.js +15 -1
  84. package/dist/modules/datasource/azure-pipelines-tasks/index.js.map +1 -1
  85. package/dist/modules/datasource/azure-pipelines-tasks/schema.d.ts +24 -0
  86. package/dist/modules/datasource/azure-pipelines-tasks/schema.js +3 -0
  87. package/dist/modules/datasource/azure-pipelines-tasks/schema.js.map +1 -1
  88. package/dist/modules/datasource/bazel/index.js +18 -2
  89. package/dist/modules/datasource/bazel/index.js.map +1 -1
  90. package/dist/modules/datasource/bazel/schema.d.ts +1 -0
  91. package/dist/modules/datasource/bazel/schema.js.map +1 -1
  92. package/dist/modules/datasource/bitbucket-server-tags/index.d.ts +19 -0
  93. package/dist/modules/datasource/bitbucket-server-tags/index.js +133 -0
  94. package/dist/modules/datasource/bitbucket-server-tags/index.js.map +1 -0
  95. package/dist/modules/datasource/bitbucket-server-tags/schema.d.ts +28 -0
  96. package/dist/modules/datasource/bitbucket-server-tags/schema.js +13 -0
  97. package/dist/modules/datasource/bitbucket-server-tags/schema.js.map +1 -0
  98. package/dist/modules/datasource/bitrise/index.js +1 -1
  99. package/dist/modules/datasource/bitrise/index.js.map +1 -1
  100. package/dist/modules/datasource/cdnjs/schema.d.ts +2 -2
  101. package/dist/modules/datasource/conda/index.js +18 -1
  102. package/dist/modules/datasource/conda/index.js.map +1 -1
  103. package/dist/modules/datasource/conda/prefix-dev.d.ts +3 -0
  104. package/dist/modules/datasource/conda/prefix-dev.js +81 -0
  105. package/dist/modules/datasource/conda/prefix-dev.js.map +1 -0
  106. package/dist/modules/datasource/conda/schema/prefix-dev.d.ts +189 -0
  107. package/dist/modules/datasource/conda/schema/prefix-dev.js +31 -0
  108. package/dist/modules/datasource/conda/schema/prefix-dev.js.map +1 -0
  109. package/dist/modules/datasource/conda/types.d.ts +1 -20
  110. package/dist/modules/datasource/conda/types.js.map +1 -1
  111. package/dist/modules/datasource/cpan/index.js +2 -4
  112. package/dist/modules/datasource/cpan/index.js.map +1 -1
  113. package/dist/modules/datasource/crate/index.js +3 -3
  114. package/dist/modules/datasource/crate/index.js.map +1 -1
  115. package/dist/modules/datasource/custom/formats/html.js +1 -1
  116. package/dist/modules/datasource/custom/formats/html.js.map +1 -1
  117. package/dist/modules/datasource/custom/formats/yaml.js +1 -1
  118. package/dist/modules/datasource/custom/formats/yaml.js.map +1 -1
  119. package/dist/modules/datasource/custom/index.js +4 -2
  120. package/dist/modules/datasource/custom/index.js.map +1 -1
  121. package/dist/modules/datasource/custom/schema.d.ts +22 -22
  122. package/dist/modules/datasource/custom/utils.js +1 -0
  123. package/dist/modules/datasource/custom/utils.js.map +1 -1
  124. package/dist/modules/datasource/dart/index.js +1 -1
  125. package/dist/modules/datasource/dart/index.js.map +1 -1
  126. package/dist/modules/datasource/dart-version/index.js +1 -1
  127. package/dist/modules/datasource/dart-version/index.js.map +1 -1
  128. package/dist/modules/datasource/datasource.js +0 -1
  129. package/dist/modules/datasource/datasource.js.map +1 -1
  130. package/dist/modules/datasource/deb/index.d.ts +4 -5
  131. package/dist/modules/datasource/deb/index.js +10 -11
  132. package/dist/modules/datasource/deb/index.js.map +1 -1
  133. package/dist/modules/datasource/deb/url.d.ts +3 -3
  134. package/dist/modules/datasource/deb/url.js +17 -13
  135. package/dist/modules/datasource/deb/url.js.map +1 -1
  136. package/dist/modules/datasource/deno/index.js +1 -1
  137. package/dist/modules/datasource/deno/index.js.map +1 -1
  138. package/dist/modules/datasource/deno/schema.d.ts +1 -1
  139. package/dist/modules/datasource/devbox/index.js +0 -1
  140. package/dist/modules/datasource/devbox/index.js.map +1 -1
  141. package/dist/modules/datasource/docker/common.js +5 -2
  142. package/dist/modules/datasource/docker/common.js.map +1 -1
  143. package/dist/modules/datasource/docker/index.js +10 -8
  144. package/dist/modules/datasource/docker/index.js.map +1 -1
  145. package/dist/modules/datasource/docker/schema.d.ts +77 -101
  146. package/dist/modules/datasource/docker/schema.js +2 -1
  147. package/dist/modules/datasource/docker/schema.js.map +1 -1
  148. package/dist/modules/datasource/flutter-version/index.js +1 -1
  149. package/dist/modules/datasource/flutter-version/index.js.map +1 -1
  150. package/dist/modules/datasource/galaxy/schema.d.ts +1 -1
  151. package/dist/modules/datasource/galaxy-collection/schema.d.ts +8 -8
  152. package/dist/modules/datasource/git-refs/index.js +1 -1
  153. package/dist/modules/datasource/git-refs/index.js.map +1 -1
  154. package/dist/modules/datasource/gitea-releases/schema.d.ts +2 -2
  155. package/dist/modules/datasource/gitea-tags/schema.d.ts +4 -4
  156. package/dist/modules/datasource/github-release-attachments/index.js +2 -2
  157. package/dist/modules/datasource/github-release-attachments/index.js.map +1 -1
  158. package/dist/modules/datasource/github-runners/index.js +2 -2
  159. package/dist/modules/datasource/github-runners/index.js.map +1 -1
  160. package/dist/modules/datasource/gitlab-packages/index.js +1 -1
  161. package/dist/modules/datasource/gitlab-packages/index.js.map +1 -1
  162. package/dist/modules/datasource/gitlab-releases/index.js +1 -3
  163. package/dist/modules/datasource/gitlab-releases/index.js.map +1 -1
  164. package/dist/modules/datasource/go/base.js +1 -1
  165. package/dist/modules/datasource/go/base.js.map +1 -1
  166. package/dist/modules/datasource/go/index.js +1 -1
  167. package/dist/modules/datasource/go/index.js.map +1 -1
  168. package/dist/modules/datasource/go/releases-direct.js +7 -4
  169. package/dist/modules/datasource/go/releases-direct.js.map +1 -1
  170. package/dist/modules/datasource/go/releases-goproxy.js +1 -1
  171. package/dist/modules/datasource/go/releases-goproxy.js.map +1 -1
  172. package/dist/modules/datasource/golang-version/index.js +2 -2
  173. package/dist/modules/datasource/golang-version/index.js.map +1 -1
  174. package/dist/modules/datasource/gradle-version/index.js +1 -1
  175. package/dist/modules/datasource/gradle-version/index.js.map +1 -1
  176. package/dist/modules/datasource/helm/index.js +1 -1
  177. package/dist/modules/datasource/helm/index.js.map +1 -1
  178. package/dist/modules/datasource/hex/index.js +1 -1
  179. package/dist/modules/datasource/hex/index.js.map +1 -1
  180. package/dist/modules/datasource/hex/schema.d.ts +11 -11
  181. package/dist/modules/datasource/hexpm-bob/index.js +1 -1
  182. package/dist/modules/datasource/hexpm-bob/index.js.map +1 -1
  183. package/dist/modules/datasource/index.js +4 -4
  184. package/dist/modules/datasource/index.js.map +1 -1
  185. package/dist/modules/datasource/java-version/index.js +0 -1
  186. package/dist/modules/datasource/java-version/index.js.map +1 -1
  187. package/dist/modules/datasource/jenkins-plugins/index.js +1 -1
  188. package/dist/modules/datasource/jenkins-plugins/index.js.map +1 -1
  189. package/dist/modules/datasource/maven/index.js +35 -27
  190. package/dist/modules/datasource/maven/index.js.map +1 -1
  191. package/dist/modules/datasource/maven/types.d.ts +3 -6
  192. package/dist/modules/datasource/maven/types.js.map +1 -1
  193. package/dist/modules/datasource/maven/util.d.ts +4 -5
  194. package/dist/modules/datasource/maven/util.js +94 -157
  195. package/dist/modules/datasource/maven/util.js.map +1 -1
  196. package/dist/modules/datasource/metadata.js +9 -1
  197. package/dist/modules/datasource/metadata.js.map +1 -1
  198. package/dist/modules/datasource/node-version/index.js +1 -1
  199. package/dist/modules/datasource/node-version/index.js.map +1 -1
  200. package/dist/modules/datasource/npm/get.d.ts +0 -1
  201. package/dist/modules/datasource/npm/get.js +14 -68
  202. package/dist/modules/datasource/npm/get.js.map +1 -1
  203. package/dist/modules/datasource/npm/index.js +1 -1
  204. package/dist/modules/datasource/npm/index.js.map +1 -1
  205. package/dist/modules/datasource/npm/npmrc.js +1 -1
  206. package/dist/modules/datasource/npm/npmrc.js.map +1 -1
  207. package/dist/modules/datasource/npm/types.d.ts +0 -8
  208. package/dist/modules/datasource/npm/types.js.map +1 -1
  209. package/dist/modules/datasource/nuget/index.js +1 -1
  210. package/dist/modules/datasource/nuget/index.js.map +1 -1
  211. package/dist/modules/datasource/nuget/v2.js +1 -1
  212. package/dist/modules/datasource/nuget/v2.js.map +1 -1
  213. package/dist/modules/datasource/nuget/v3.js +6 -6
  214. package/dist/modules/datasource/nuget/v3.js.map +1 -1
  215. package/dist/modules/datasource/orb/index.js +1 -1
  216. package/dist/modules/datasource/orb/index.js.map +1 -1
  217. package/dist/modules/datasource/packagist/index.js +2 -2
  218. package/dist/modules/datasource/packagist/index.js.map +1 -1
  219. package/dist/modules/datasource/packagist/schema.d.ts +32 -32
  220. package/dist/modules/datasource/pod/index.js +2 -2
  221. package/dist/modules/datasource/pod/index.js.map +1 -1
  222. package/dist/modules/datasource/postprocess-release.js +1 -1
  223. package/dist/modules/datasource/postprocess-release.js.map +1 -1
  224. package/dist/modules/datasource/pypi/index.js +1 -1
  225. package/dist/modules/datasource/pypi/index.js.map +1 -1
  226. package/dist/modules/datasource/python-version/index.js +1 -1
  227. package/dist/modules/datasource/python-version/index.js.map +1 -1
  228. package/dist/modules/datasource/repology/index.js +1 -1
  229. package/dist/modules/datasource/repology/index.js.map +1 -1
  230. package/dist/modules/datasource/ruby-version/index.js +1 -1
  231. package/dist/modules/datasource/ruby-version/index.js.map +1 -1
  232. package/dist/modules/datasource/rubygems/index.js +2 -2
  233. package/dist/modules/datasource/rubygems/index.js.map +1 -1
  234. package/dist/modules/datasource/rubygems/versions-endpoint-cache.js +2 -2
  235. package/dist/modules/datasource/rubygems/versions-endpoint-cache.js.map +1 -1
  236. package/dist/modules/datasource/sbt-package/index.js +1 -1
  237. package/dist/modules/datasource/sbt-package/index.js.map +1 -1
  238. package/dist/modules/datasource/sbt-plugin/index.js +1 -1
  239. package/dist/modules/datasource/sbt-plugin/index.js.map +1 -1
  240. package/dist/modules/datasource/schema.d.ts +4 -4
  241. package/dist/modules/datasource/terraform-module/index.js +1 -1
  242. package/dist/modules/datasource/terraform-module/index.js.map +1 -1
  243. package/dist/modules/datasource/terraform-provider/index.js +2 -3
  244. package/dist/modules/datasource/terraform-provider/index.js.map +1 -1
  245. package/dist/modules/datasource/types.d.ts +2 -0
  246. package/dist/modules/datasource/types.js.map +1 -1
  247. package/dist/modules/datasource/unity3d/index.d.ts +4 -1
  248. package/dist/modules/datasource/unity3d/index.js +36 -42
  249. package/dist/modules/datasource/unity3d/index.js.map +1 -1
  250. package/dist/modules/datasource/unity3d/schema.d.ts +47 -0
  251. package/dist/modules/datasource/unity3d/schema.js +17 -0
  252. package/dist/modules/datasource/unity3d/schema.js.map +1 -0
  253. package/dist/modules/manager/api.js +2 -0
  254. package/dist/modules/manager/api.js.map +1 -1
  255. package/dist/modules/manager/argocd/extract.js +1 -1
  256. package/dist/modules/manager/argocd/extract.js.map +1 -1
  257. package/dist/modules/manager/argocd/schema.d.ts +22 -22
  258. package/dist/modules/manager/asdf/upgradeable-tooling.js +94 -0
  259. package/dist/modules/manager/asdf/upgradeable-tooling.js.map +1 -1
  260. package/dist/modules/manager/azure-pipelines/schema.d.ts +32 -32
  261. package/dist/modules/manager/batect/schema.d.ts +4 -4
  262. package/dist/modules/manager/batect-wrapper/artifacts.js +1 -1
  263. package/dist/modules/manager/batect-wrapper/artifacts.js.map +1 -1
  264. package/dist/modules/manager/bazel/rules/docker.d.ts +6 -6
  265. package/dist/modules/manager/bazel/rules/git.d.ts +10 -10
  266. package/dist/modules/manager/bazel/rules/git.js +9 -2
  267. package/dist/modules/manager/bazel/rules/git.js.map +1 -1
  268. package/dist/modules/manager/bazel/rules/go.d.ts +5 -5
  269. package/dist/modules/manager/bazel/rules/maven.d.ts +7 -7
  270. package/dist/modules/manager/bazel/rules/oci.d.ts +6 -6
  271. package/dist/modules/manager/bazel-module/parser/fragments.d.ts +40 -40
  272. package/dist/modules/manager/bazel-module/parser/maven.d.ts +44 -90
  273. package/dist/modules/manager/bazel-module/parser/oci.d.ts +19 -42
  274. package/dist/modules/manager/bazel-module/rules.d.ts +50 -160
  275. package/dist/modules/manager/bun/artifacts.js +0 -1
  276. package/dist/modules/manager/bun/artifacts.js.map +1 -1
  277. package/dist/modules/manager/bun/extract.d.ts +1 -0
  278. package/dist/modules/manager/bun/extract.js +53 -27
  279. package/dist/modules/manager/bun/extract.js.map +1 -1
  280. package/dist/modules/manager/bun/index.js +1 -1
  281. package/dist/modules/manager/bun/index.js.map +1 -1
  282. package/dist/modules/manager/bun/utils.d.ts +2 -0
  283. package/dist/modules/manager/bun/utils.js +22 -0
  284. package/dist/modules/manager/bun/utils.js.map +1 -0
  285. package/dist/modules/manager/bundler/artifacts.js +0 -1
  286. package/dist/modules/manager/bundler/artifacts.js.map +1 -1
  287. package/dist/modules/manager/bundler/extract.js +2 -1
  288. package/dist/modules/manager/bundler/extract.js.map +1 -1
  289. package/dist/modules/manager/cake/index.js +4 -2
  290. package/dist/modules/manager/cake/index.js.map +1 -1
  291. package/dist/modules/manager/cargo/artifacts.js +5 -7
  292. package/dist/modules/manager/cargo/artifacts.js.map +1 -1
  293. package/dist/modules/manager/cargo/schema.d.ts +117 -117
  294. package/dist/modules/manager/circleci/extract.js +21 -30
  295. package/dist/modules/manager/circleci/extract.js.map +1 -1
  296. package/dist/modules/manager/circleci/schema.d.ts +33 -144
  297. package/dist/modules/manager/circleci/schema.js +21 -17
  298. package/dist/modules/manager/circleci/schema.js.map +1 -1
  299. package/dist/modules/manager/cocoapods/artifacts.js +1 -2
  300. package/dist/modules/manager/cocoapods/artifacts.js.map +1 -1
  301. package/dist/modules/manager/composer/artifacts.js +1 -2
  302. package/dist/modules/manager/composer/artifacts.js.map +1 -1
  303. package/dist/modules/manager/composer/schema.d.ts +32 -34
  304. package/dist/modules/manager/composer/schema.js +1 -1
  305. package/dist/modules/manager/composer/schema.js.map +1 -1
  306. package/dist/modules/manager/composer/utils.d.ts +1 -0
  307. package/dist/modules/manager/composer/utils.js +18 -6
  308. package/dist/modules/manager/composer/utils.js.map +1 -1
  309. package/dist/modules/manager/conan/artifacts.d.ts +2 -0
  310. package/dist/modules/manager/conan/artifacts.js +76 -0
  311. package/dist/modules/manager/conan/artifacts.js.map +1 -0
  312. package/dist/modules/manager/conan/index.d.ts +2 -0
  313. package/dist/modules/manager/conan/index.js +4 -1
  314. package/dist/modules/manager/conan/index.js.map +1 -1
  315. package/dist/modules/manager/copier/artifacts.js +0 -1
  316. package/dist/modules/manager/copier/artifacts.js.map +1 -1
  317. package/dist/modules/manager/crossplane/schema.d.ts +2 -2
  318. package/dist/modules/manager/custom/jsonata/index.js +4 -0
  319. package/dist/modules/manager/custom/jsonata/index.js.map +1 -1
  320. package/dist/modules/manager/custom/jsonata/schema.d.ts +21 -21
  321. package/dist/modules/manager/custom/regex/index.js +2 -0
  322. package/dist/modules/manager/custom/regex/index.js.map +1 -1
  323. package/dist/modules/manager/deps-edn/extract.js +2 -1
  324. package/dist/modules/manager/deps-edn/extract.js.map +1 -1
  325. package/dist/modules/manager/devbox/artifacts.d.ts +1 -1
  326. package/dist/modules/manager/devbox/artifacts.js +35 -11
  327. package/dist/modules/manager/devbox/artifacts.js.map +1 -1
  328. package/dist/modules/manager/devbox/schema.js +1 -1
  329. package/dist/modules/manager/devbox/schema.js.map +1 -1
  330. package/dist/modules/manager/devcontainer/extract.js +43 -1
  331. package/dist/modules/manager/devcontainer/extract.js.map +1 -1
  332. package/dist/modules/manager/devcontainer/index.js +11 -1
  333. package/dist/modules/manager/devcontainer/index.js.map +1 -1
  334. package/dist/modules/manager/devcontainer/schema.d.ts +7 -3
  335. package/dist/modules/manager/devcontainer/schema.js +3 -1
  336. package/dist/modules/manager/devcontainer/schema.js.map +1 -1
  337. package/dist/modules/manager/docker-compose/schema.d.ts +6 -6
  338. package/dist/modules/manager/dockerfile/extract.js +2 -6
  339. package/dist/modules/manager/dockerfile/extract.js.map +1 -1
  340. package/dist/modules/manager/fingerprint.generated.js +86 -85
  341. package/dist/modules/manager/fingerprint.generated.js.map +1 -1
  342. package/dist/modules/manager/flux/artifacts.js +0 -1
  343. package/dist/modules/manager/flux/artifacts.js.map +1 -1
  344. package/dist/modules/manager/flux/extract.js +27 -24
  345. package/dist/modules/manager/flux/extract.js.map +1 -1
  346. package/dist/modules/manager/flux/schema.d.ts +130 -154
  347. package/dist/modules/manager/github-actions/extract.js +60 -39
  348. package/dist/modules/manager/github-actions/extract.js.map +1 -1
  349. package/dist/modules/manager/github-actions/schema.d.ts +66 -0
  350. package/dist/modules/manager/github-actions/schema.js +38 -0
  351. package/dist/modules/manager/github-actions/schema.js.map +1 -0
  352. package/dist/modules/manager/gitlabci/extract.d.ts +1 -5
  353. package/dist/modules/manager/gitlabci/extract.js +27 -126
  354. package/dist/modules/manager/gitlabci/extract.js.map +1 -1
  355. package/dist/modules/manager/gitlabci/schema.d.ts +55 -0
  356. package/dist/modules/manager/gitlabci/schema.js +63 -0
  357. package/dist/modules/manager/gitlabci/schema.js.map +1 -0
  358. package/dist/modules/manager/gitlabci-include/extract.js +6 -54
  359. package/dist/modules/manager/gitlabci-include/extract.js.map +1 -1
  360. package/dist/modules/manager/gitlabci-include/schema.d.ts +13 -0
  361. package/dist/modules/manager/gitlabci-include/schema.js +46 -0
  362. package/dist/modules/manager/gitlabci-include/schema.js.map +1 -0
  363. package/dist/modules/manager/glasskube/schema.d.ts +8 -8
  364. package/dist/modules/manager/gomod/artifacts-extra.js +12 -4
  365. package/dist/modules/manager/gomod/artifacts-extra.js.map +1 -1
  366. package/dist/modules/manager/gomod/artifacts.js +24 -10
  367. package/dist/modules/manager/gomod/artifacts.js.map +1 -1
  368. package/dist/modules/manager/gomod/extract.js +23 -0
  369. package/dist/modules/manager/gomod/extract.js.map +1 -1
  370. package/dist/modules/manager/gomod/line-parser.js +16 -0
  371. package/dist/modules/manager/gomod/line-parser.js.map +1 -1
  372. package/dist/modules/manager/gomod/update.js +5 -3
  373. package/dist/modules/manager/gomod/update.js.map +1 -1
  374. package/dist/modules/manager/gradle/artifacts.js +0 -1
  375. package/dist/modules/manager/gradle/artifacts.js.map +1 -1
  376. package/dist/modules/manager/gradle/extract/catalog.js +1 -1
  377. package/dist/modules/manager/gradle/extract/catalog.js.map +1 -1
  378. package/dist/modules/manager/gradle/extract.js +8 -13
  379. package/dist/modules/manager/gradle/extract.js.map +1 -1
  380. package/dist/modules/manager/gradle/parser/assignments.js +2 -2
  381. package/dist/modules/manager/gradle/parser/assignments.js.map +1 -1
  382. package/dist/modules/manager/gradle/parser/handlers.d.ts +1 -2
  383. package/dist/modules/manager/gradle/parser/handlers.js +17 -24
  384. package/dist/modules/manager/gradle/parser/handlers.js.map +1 -1
  385. package/dist/modules/manager/gradle/parser/registry-urls.js +46 -12
  386. package/dist/modules/manager/gradle/parser/registry-urls.js.map +1 -1
  387. package/dist/modules/manager/gradle/types.d.ts +1 -0
  388. package/dist/modules/manager/gradle/types.js.map +1 -1
  389. package/dist/modules/manager/gradle-wrapper/artifacts.js +1 -2
  390. package/dist/modules/manager/gradle-wrapper/artifacts.js.map +1 -1
  391. package/dist/modules/manager/helmfile/artifacts.js +0 -1
  392. package/dist/modules/manager/helmfile/artifacts.js.map +1 -1
  393. package/dist/modules/manager/helmfile/extract.js +4 -0
  394. package/dist/modules/manager/helmfile/extract.js.map +1 -1
  395. package/dist/modules/manager/helmfile/schema.d.ts +9 -9
  396. package/dist/modules/manager/helmv3/artifacts.js +0 -1
  397. package/dist/modules/manager/helmv3/artifacts.js.map +1 -1
  398. package/dist/modules/manager/helmv3/utils.js +3 -1
  399. package/dist/modules/manager/helmv3/utils.js.map +1 -1
  400. package/dist/modules/manager/hermit/artifacts.js +0 -1
  401. package/dist/modules/manager/hermit/artifacts.js.map +1 -1
  402. package/dist/modules/manager/homebrew/extract.js +0 -1
  403. package/dist/modules/manager/homebrew/extract.js.map +1 -1
  404. package/dist/modules/manager/jsonnet-bundler/artifacts.js +0 -1
  405. package/dist/modules/manager/jsonnet-bundler/artifacts.js.map +1 -1
  406. package/dist/modules/manager/kustomize/artifacts.d.ts +2 -0
  407. package/dist/modules/manager/kustomize/artifacts.js +154 -0
  408. package/dist/modules/manager/kustomize/artifacts.js.map +1 -0
  409. package/dist/modules/manager/kustomize/common.d.ts +3 -0
  410. package/dist/modules/manager/kustomize/common.js +22 -0
  411. package/dist/modules/manager/kustomize/common.js.map +1 -0
  412. package/dist/modules/manager/kustomize/index.d.ts +1 -0
  413. package/dist/modules/manager/kustomize/index.js +3 -1
  414. package/dist/modules/manager/kustomize/index.js.map +1 -1
  415. package/dist/modules/manager/kustomize/types.d.ts +4 -0
  416. package/dist/modules/manager/kustomize/types.js.map +1 -1
  417. package/dist/modules/manager/maven/extract.js +4 -4
  418. package/dist/modules/manager/maven/extract.js.map +1 -1
  419. package/dist/modules/manager/maven-wrapper/artifacts.js +0 -1
  420. package/dist/modules/manager/maven-wrapper/artifacts.js.map +1 -1
  421. package/dist/modules/manager/mise/extract.js +1 -1
  422. package/dist/modules/manager/mise/extract.js.map +1 -1
  423. package/dist/modules/manager/mix/artifacts.js +64 -14
  424. package/dist/modules/manager/mix/artifacts.js.map +1 -1
  425. package/dist/modules/manager/mix/index.d.ts +1 -0
  426. package/dist/modules/manager/mix/index.js +2 -1
  427. package/dist/modules/manager/mix/index.js.map +1 -1
  428. package/dist/modules/manager/nix/artifacts.js +0 -1
  429. package/dist/modules/manager/nix/artifacts.js.map +1 -1
  430. package/dist/modules/manager/nix/extract.js +1 -1
  431. package/dist/modules/manager/nix/extract.js.map +1 -1
  432. package/dist/modules/manager/nix/schema.d.ts +20 -20
  433. package/dist/modules/manager/nix/schema.js +1 -0
  434. package/dist/modules/manager/nix/schema.js.map +1 -1
  435. package/dist/modules/manager/npm/artifacts.js +0 -1
  436. package/dist/modules/manager/npm/artifacts.js.map +1 -1
  437. package/dist/modules/manager/npm/extract/common/package-file.js +1 -0
  438. package/dist/modules/manager/npm/extract/common/package-file.js.map +1 -1
  439. package/dist/modules/manager/npm/extract/yarn.js +2 -2
  440. package/dist/modules/manager/npm/extract/yarn.js.map +1 -1
  441. package/dist/modules/manager/npm/post-update/npm.js +0 -1
  442. package/dist/modules/manager/npm/post-update/npm.js.map +1 -1
  443. package/dist/modules/manager/npm/post-update/pnpm.js +13 -2
  444. package/dist/modules/manager/npm/post-update/pnpm.js.map +1 -1
  445. package/dist/modules/manager/npm/post-update/rules.js +11 -1
  446. package/dist/modules/manager/npm/post-update/rules.js.map +1 -1
  447. package/dist/modules/manager/npm/post-update/yarn.js +0 -1
  448. package/dist/modules/manager/npm/post-update/yarn.js.map +1 -1
  449. package/dist/modules/manager/npm/schema.d.ts +13 -13
  450. package/dist/modules/manager/npm/update/dependency/index.js +1 -1
  451. package/dist/modules/manager/npm/update/dependency/index.js.map +1 -1
  452. package/dist/modules/manager/nuget/artifacts.js +1 -2
  453. package/dist/modules/manager/nuget/artifacts.js.map +1 -1
  454. package/dist/modules/manager/nuget/extract.js +21 -18
  455. package/dist/modules/manager/nuget/extract.js.map +1 -1
  456. package/dist/modules/manager/nuget/package-tree.js +4 -0
  457. package/dist/modules/manager/nuget/package-tree.js.map +1 -1
  458. package/dist/modules/manager/nuget/schema.d.ts +8 -8
  459. package/dist/modules/manager/nuget/util.js +4 -1
  460. package/dist/modules/manager/nuget/util.js.map +1 -1
  461. package/dist/modules/manager/ocb/schema.d.ts +6 -6
  462. package/dist/modules/manager/pep621/processors/pdm.js +0 -1
  463. package/dist/modules/manager/pep621/processors/pdm.js.map +1 -1
  464. package/dist/modules/manager/pep621/processors/uv.js +0 -1
  465. package/dist/modules/manager/pep621/processors/uv.js.map +1 -1
  466. package/dist/modules/manager/pep621/schema.d.ts +346 -54
  467. package/dist/modules/manager/pep621/schema.js +2 -0
  468. package/dist/modules/manager/pep621/schema.js.map +1 -1
  469. package/dist/modules/manager/pep621/utils.js +1 -1
  470. package/dist/modules/manager/pep621/utils.js.map +1 -1
  471. package/dist/modules/manager/pip-compile/common.js +0 -1
  472. package/dist/modules/manager/pip-compile/common.js.map +1 -1
  473. package/dist/modules/manager/pip_requirements/artifacts.js +0 -1
  474. package/dist/modules/manager/pip_requirements/artifacts.js.map +1 -1
  475. package/dist/modules/manager/pip_requirements/common.js +2 -6
  476. package/dist/modules/manager/pip_requirements/common.js.map +1 -1
  477. package/dist/modules/manager/pipenv/artifacts.js +0 -1
  478. package/dist/modules/manager/pipenv/artifacts.js.map +1 -1
  479. package/dist/modules/manager/pixi/artifacts.d.ts +3 -0
  480. package/dist/modules/manager/pixi/artifacts.js +78 -0
  481. package/dist/modules/manager/pixi/artifacts.js.map +1 -0
  482. package/dist/modules/manager/pixi/extract.d.ts +4 -0
  483. package/dist/modules/manager/pixi/extract.js +131 -0
  484. package/dist/modules/manager/pixi/extract.js.map +1 -0
  485. package/dist/modules/manager/pixi/index.d.ts +10 -0
  486. package/dist/modules/manager/pixi/index.js +20 -0
  487. package/dist/modules/manager/pixi/index.js.map +1 -0
  488. package/dist/modules/manager/pixi/schema.d.ts +405 -0
  489. package/dist/modules/manager/pixi/schema.js +147 -0
  490. package/dist/modules/manager/pixi/schema.js.map +1 -0
  491. package/dist/modules/manager/poetry/artifacts.js +3 -4
  492. package/dist/modules/manager/poetry/artifacts.js.map +1 -1
  493. package/dist/modules/manager/poetry/extract.js +2 -1
  494. package/dist/modules/manager/poetry/extract.js.map +1 -1
  495. package/dist/modules/manager/poetry/schema.d.ts +48 -48
  496. package/dist/modules/manager/pub/artifacts.js +0 -1
  497. package/dist/modules/manager/pub/artifacts.js.map +1 -1
  498. package/dist/modules/manager/pub/schema.d.ts +8 -8
  499. package/dist/modules/manager/scalafmt/extract.js +1 -1
  500. package/dist/modules/manager/scalafmt/extract.js.map +1 -1
  501. package/dist/modules/manager/sveltos/schema.d.ts +30 -42
  502. package/dist/modules/manager/terraform/lockfile/hash.d.ts +1 -1
  503. package/dist/modules/manager/terraform/util.js +1 -3
  504. package/dist/modules/manager/terraform/util.js.map +1 -1
  505. package/dist/modules/manager/types.d.ts +6 -2
  506. package/dist/modules/manager/types.js.map +1 -1
  507. package/dist/modules/manager/vendir/schema.d.ts +7 -7
  508. package/dist/modules/platform/api.d.ts +1 -1
  509. package/dist/modules/platform/azure/azure-helper.js +2 -2
  510. package/dist/modules/platform/azure/azure-helper.js.map +1 -1
  511. package/dist/modules/platform/azure/index.js +14 -14
  512. package/dist/modules/platform/azure/index.js.map +1 -1
  513. package/dist/modules/platform/bitbucket/comments.js +4 -4
  514. package/dist/modules/platform/bitbucket/comments.js.map +1 -1
  515. package/dist/modules/platform/bitbucket/index.d.ts +1 -0
  516. package/dist/modules/platform/bitbucket/index.js +54 -44
  517. package/dist/modules/platform/bitbucket/index.js.map +1 -1
  518. package/dist/modules/platform/bitbucket/schema.d.ts +14 -14
  519. package/dist/modules/platform/bitbucket/utils.js +3 -3
  520. package/dist/modules/platform/bitbucket/utils.js.map +1 -1
  521. package/dist/modules/platform/bitbucket-server/index.d.ts +3 -3
  522. package/dist/modules/platform/bitbucket-server/index.js +81 -81
  523. package/dist/modules/platform/bitbucket-server/index.js.map +1 -1
  524. package/dist/modules/platform/bitbucket-server/pr-cache.d.ts +23 -0
  525. package/dist/modules/platform/bitbucket-server/pr-cache.js +125 -0
  526. package/dist/modules/platform/bitbucket-server/pr-cache.js.map +1 -0
  527. package/dist/modules/platform/bitbucket-server/schema.d.ts +76 -0
  528. package/dist/modules/platform/bitbucket-server/schema.js +15 -1
  529. package/dist/modules/platform/bitbucket-server/schema.js.map +1 -1
  530. package/dist/modules/platform/bitbucket-server/types.d.ts +8 -2
  531. package/dist/modules/platform/bitbucket-server/types.js.map +1 -1
  532. package/dist/modules/platform/bitbucket-server/utils.d.ts +0 -2
  533. package/dist/modules/platform/bitbucket-server/utils.js +6 -52
  534. package/dist/modules/platform/bitbucket-server/utils.js.map +1 -1
  535. package/dist/modules/platform/codecommit/codecommit-client.js +6 -6
  536. package/dist/modules/platform/codecommit/codecommit-client.js.map +1 -1
  537. package/dist/modules/platform/codecommit/index.js +24 -24
  538. package/dist/modules/platform/codecommit/index.js.map +1 -1
  539. package/dist/modules/platform/gerrit/client.d.ts +0 -3
  540. package/dist/modules/platform/gerrit/client.js +20 -29
  541. package/dist/modules/platform/gerrit/client.js.map +1 -1
  542. package/dist/modules/platform/gerrit/index.js +0 -6
  543. package/dist/modules/platform/gerrit/index.js.map +1 -1
  544. package/dist/modules/platform/gerrit/scm.js +5 -6
  545. package/dist/modules/platform/gerrit/scm.js.map +1 -1
  546. package/dist/modules/platform/gerrit/types.d.ts +1 -4
  547. package/dist/modules/platform/gerrit/types.js.map +1 -1
  548. package/dist/modules/platform/gerrit/utils.d.ts +3 -2
  549. package/dist/modules/platform/gerrit/utils.js +4 -8
  550. package/dist/modules/platform/gerrit/utils.js.map +1 -1
  551. package/dist/modules/platform/gitea/gitea-helper.d.ts +1 -0
  552. package/dist/modules/platform/gitea/gitea-helper.js +16 -0
  553. package/dist/modules/platform/gitea/gitea-helper.js.map +1 -1
  554. package/dist/modules/platform/gitea/index.d.ts +1 -0
  555. package/dist/modules/platform/gitea/index.js +33 -16
  556. package/dist/modules/platform/gitea/index.js.map +1 -1
  557. package/dist/modules/platform/gitea/schema.d.ts +8 -8
  558. package/dist/modules/platform/gitea/types.d.ts +1 -1
  559. package/dist/modules/platform/gitea/types.js.map +1 -1
  560. package/dist/modules/platform/github/common.d.ts +2 -0
  561. package/dist/modules/platform/github/common.js +16 -0
  562. package/dist/modules/platform/github/common.js.map +1 -1
  563. package/dist/modules/platform/github/index.d.ts +1 -1
  564. package/dist/modules/platform/github/index.js +87 -82
  565. package/dist/modules/platform/github/index.js.map +1 -1
  566. package/dist/modules/platform/github/issue.d.ts +18 -18
  567. package/dist/modules/platform/github/massage-markdown-links.js +2 -2
  568. package/dist/modules/platform/github/massage-markdown-links.js.map +1 -1
  569. package/dist/modules/platform/github/pr.js +3 -3
  570. package/dist/modules/platform/github/pr.js.map +1 -1
  571. package/dist/modules/platform/github/schema.d.ts +128 -128
  572. package/dist/modules/platform/github/schema.js +3 -1
  573. package/dist/modules/platform/github/schema.js.map +1 -1
  574. package/dist/modules/platform/gitlab/index.d.ts +1 -0
  575. package/dist/modules/platform/gitlab/index.js +72 -49
  576. package/dist/modules/platform/gitlab/index.js.map +1 -1
  577. package/dist/modules/platform/index.js +0 -1
  578. package/dist/modules/platform/index.js.map +1 -1
  579. package/dist/modules/platform/scm.d.ts +1 -1
  580. package/dist/modules/versioning/api.js +2 -0
  581. package/dist/modules/versioning/api.js.map +1 -1
  582. package/dist/modules/versioning/composer/index.js +10 -0
  583. package/dist/modules/versioning/composer/index.js.map +1 -1
  584. package/dist/modules/versioning/conda/index.d.ts +41 -0
  585. package/dist/modules/versioning/conda/index.js +178 -0
  586. package/dist/modules/versioning/conda/index.js.map +1 -0
  587. package/dist/modules/versioning/distro.js +1 -3
  588. package/dist/modules/versioning/distro.js.map +1 -1
  589. package/dist/modules/versioning/hashicorp/convertor.d.ts +2 -1
  590. package/dist/modules/versioning/hashicorp/convertor.js +13 -8
  591. package/dist/modules/versioning/hashicorp/convertor.js.map +1 -1
  592. package/dist/modules/versioning/hex/index.js +3 -3
  593. package/dist/modules/versioning/hex/index.js.map +1 -1
  594. package/dist/modules/versioning/npm/index.js +2 -1
  595. package/dist/modules/versioning/npm/index.js.map +1 -1
  596. package/dist/modules/versioning/schema.js +1 -1
  597. package/dist/modules/versioning/schema.js.map +1 -1
  598. package/dist/modules/versioning/types.d.ts +4 -0
  599. package/dist/modules/versioning/types.js.map +1 -1
  600. package/dist/proxy.js +2 -1
  601. package/dist/proxy.js.map +1 -1
  602. package/dist/renovate.js +2 -2
  603. package/dist/renovate.js.map +1 -1
  604. package/dist/util/cache/package/decorator.js +2 -2
  605. package/dist/util/cache/package/decorator.js.map +1 -1
  606. package/dist/util/cache/package/redis.js +0 -1
  607. package/dist/util/cache/package/redis.js.map +1 -1
  608. package/dist/util/cache/package/types.d.ts +1 -1
  609. package/dist/util/cache/package/types.js.map +1 -1
  610. package/dist/util/cache/repository/impl/base.d.ts +1 -1
  611. package/dist/util/cache/repository/impl/base.js +4 -0
  612. package/dist/util/cache/repository/impl/base.js.map +1 -1
  613. package/dist/util/cache/repository/schema.d.ts +4 -4
  614. package/dist/util/cache/repository/types.d.ts +3 -0
  615. package/dist/util/cache/repository/types.js.map +1 -1
  616. package/dist/util/common.d.ts +4 -2
  617. package/dist/util/common.js +17 -3
  618. package/dist/util/common.js.map +1 -1
  619. package/dist/util/env.d.ts +4 -0
  620. package/dist/util/env.js +22 -0
  621. package/dist/util/env.js.map +1 -0
  622. package/dist/util/exec/containerbase.js +19 -14
  623. package/dist/util/exec/containerbase.js.map +1 -1
  624. package/dist/util/exec/index.js +5 -2
  625. package/dist/util/exec/index.js.map +1 -1
  626. package/dist/util/exec/types.d.ts +0 -2
  627. package/dist/util/exec/types.js.map +1 -1
  628. package/dist/util/exec/utils.d.ts +1 -1
  629. package/dist/util/exec/utils.js +6 -5
  630. package/dist/util/exec/utils.js.map +1 -1
  631. package/dist/util/git/auth.js +8 -5
  632. package/dist/util/git/auth.js.map +1 -1
  633. package/dist/util/git/author.js +1 -1
  634. package/dist/util/git/author.js.map +1 -1
  635. package/dist/util/git/config.js +0 -1
  636. package/dist/util/git/config.js.map +1 -1
  637. package/dist/util/git/error.js +4 -2
  638. package/dist/util/git/error.js.map +1 -1
  639. package/dist/util/git/index.js +75 -52
  640. package/dist/util/git/index.js.map +1 -1
  641. package/dist/util/git/private-key.js +2 -4
  642. package/dist/util/git/private-key.js.map +1 -1
  643. package/dist/util/git/types.d.ts +2 -0
  644. package/dist/util/git/types.js.map +1 -1
  645. package/dist/util/git/url.js +1 -1
  646. package/dist/util/git/url.js.map +1 -1
  647. package/dist/util/github/graphql/datasource-fetcher.js +3 -5
  648. package/dist/util/github/graphql/datasource-fetcher.js.map +1 -1
  649. package/dist/util/github/graphql/query-adapters/releases-query-adapter.d.ts +2 -2
  650. package/dist/util/github/graphql/query-adapters/tags-query-adapter.d.ts +2 -2
  651. package/dist/util/http/auth.js +0 -1
  652. package/dist/util/http/auth.js.map +1 -1
  653. package/dist/util/http/bitbucket-server.d.ts +7 -5
  654. package/dist/util/http/bitbucket-server.js +26 -23
  655. package/dist/util/http/bitbucket-server.js.map +1 -1
  656. package/dist/util/http/bitbucket.d.ts +6 -5
  657. package/dist/util/http/bitbucket.js +34 -31
  658. package/dist/util/http/bitbucket.js.map +1 -1
  659. package/dist/util/http/cache/abstract-http-cache-provider.js +2 -2
  660. package/dist/util/http/cache/abstract-http-cache-provider.js.map +1 -1
  661. package/dist/util/http/cache/memory-http-cache-provider.d.ts +10 -0
  662. package/dist/util/http/cache/memory-http-cache-provider.js +29 -0
  663. package/dist/util/http/cache/memory-http-cache-provider.js.map +1 -0
  664. package/dist/util/http/cache/package-http-cache-provider.d.ts +23 -0
  665. package/dist/util/http/cache/package-http-cache-provider.js +80 -0
  666. package/dist/util/http/cache/package-http-cache-provider.js.map +1 -0
  667. package/dist/util/http/cache/schema.d.ts +2 -2
  668. package/dist/util/http/errors.d.ts +2 -0
  669. package/dist/util/http/errors.js +8 -0
  670. package/dist/util/http/errors.js.map +1 -0
  671. package/dist/util/http/gerrit.d.ts +6 -4
  672. package/dist/util/http/gerrit.js +11 -12
  673. package/dist/util/http/gerrit.js.map +1 -1
  674. package/dist/util/http/gitea.d.ts +5 -4
  675. package/dist/util/http/gitea.js +14 -13
  676. package/dist/util/http/gitea.js.map +1 -1
  677. package/dist/util/http/github.d.ts +14 -8
  678. package/dist/util/http/github.js +65 -60
  679. package/dist/util/http/github.js.map +1 -1
  680. package/dist/util/http/gitlab.d.ts +7 -5
  681. package/dist/util/http/gitlab.js +58 -46
  682. package/dist/util/http/gitlab.js.map +1 -1
  683. package/dist/util/http/got.d.ts +9 -0
  684. package/dist/util/http/got.js +54 -0
  685. package/dist/util/http/got.js.map +1 -0
  686. package/dist/util/http/host-rules.d.ts +2 -1
  687. package/dist/util/http/host-rules.js +17 -4
  688. package/dist/util/http/host-rules.js.map +1 -1
  689. package/dist/util/http/http.d.ts +93 -0
  690. package/dist/util/http/http.js +346 -0
  691. package/dist/util/http/http.js.map +1 -0
  692. package/dist/util/http/index.d.ts +6 -74
  693. package/dist/util/http/index.js +5 -359
  694. package/dist/util/http/index.js.map +1 -1
  695. package/dist/util/http/legacy.js +4 -1
  696. package/dist/util/http/legacy.js.map +1 -1
  697. package/dist/util/http/types.d.ts +9 -16
  698. package/dist/util/http/types.js.map +1 -1
  699. package/dist/util/schema-utils.d.ts +1 -0
  700. package/dist/util/schema-utils.js +43 -8
  701. package/dist/util/schema-utils.js.map +1 -1
  702. package/dist/util/stats.d.ts +10 -0
  703. package/dist/util/stats.js +45 -1
  704. package/dist/util/stats.js.map +1 -1
  705. package/dist/util/string.d.ts +16 -0
  706. package/dist/util/string.js +79 -0
  707. package/dist/util/string.js.map +1 -1
  708. package/dist/util/toml.d.ts +1 -0
  709. package/dist/util/toml.js +6 -0
  710. package/dist/util/toml.js.map +1 -1
  711. package/dist/util/url.js +3 -8
  712. package/dist/util/url.js.map +1 -1
  713. package/dist/util/yaml.js +3 -8
  714. package/dist/util/yaml.js.map +1 -1
  715. package/dist/workers/global/config/parse/env.js +3 -2
  716. package/dist/workers/global/config/parse/env.js.map +1 -1
  717. package/dist/workers/global/config/parse/file.js +19 -9
  718. package/dist/workers/global/config/parse/file.js.map +1 -1
  719. package/dist/workers/global/config/parse/host-rules-from-env.js +6 -2
  720. package/dist/workers/global/config/parse/host-rules-from-env.js.map +1 -1
  721. package/dist/workers/global/config/parse/index.js +15 -0
  722. package/dist/workers/global/config/parse/index.js.map +1 -1
  723. package/dist/workers/global/index.js +4 -2
  724. package/dist/workers/global/index.js.map +1 -1
  725. package/dist/workers/repository/cache.js +1 -2
  726. package/dist/workers/repository/cache.js.map +1 -1
  727. package/dist/workers/repository/config-migration/branch/migrated-data.js +2 -0
  728. package/dist/workers/repository/config-migration/branch/migrated-data.js.map +1 -1
  729. package/dist/workers/repository/index.js +1 -0
  730. package/dist/workers/repository/index.js.map +1 -1
  731. package/dist/workers/repository/init/merge.js +6 -3
  732. package/dist/workers/repository/init/merge.js.map +1 -1
  733. package/dist/workers/repository/onboarding/pr/config-description.js +3 -1
  734. package/dist/workers/repository/onboarding/pr/config-description.js.map +1 -1
  735. package/dist/workers/repository/process/extract-update.js +0 -1
  736. package/dist/workers/repository/process/extract-update.js.map +1 -1
  737. package/dist/workers/repository/process/fingerprint-fields.js +0 -1
  738. package/dist/workers/repository/process/fingerprint-fields.js.map +1 -1
  739. package/dist/workers/repository/process/libyear.js +2 -2
  740. package/dist/workers/repository/process/libyear.js.map +1 -1
  741. package/dist/workers/repository/process/lookup/index.js +15 -4
  742. package/dist/workers/repository/process/lookup/index.js.map +1 -1
  743. package/dist/workers/repository/process/lookup/timestamps.d.ts +18 -0
  744. package/dist/workers/repository/process/lookup/timestamps.js +69 -0
  745. package/dist/workers/repository/process/lookup/timestamps.js.map +1 -0
  746. package/dist/workers/repository/process/lookup/types.d.ts +1 -0
  747. package/dist/workers/repository/process/lookup/types.js.map +1 -1
  748. package/dist/workers/repository/process/lookup/utils.js +20 -9
  749. package/dist/workers/repository/process/lookup/utils.js.map +1 -1
  750. package/dist/workers/repository/process/sort.js +1 -1
  751. package/dist/workers/repository/process/sort.js.map +1 -1
  752. package/dist/workers/repository/process/vulnerabilities.js +1 -1
  753. package/dist/workers/repository/process/vulnerabilities.js.map +1 -1
  754. package/dist/workers/repository/process/write.js +1 -8
  755. package/dist/workers/repository/process/write.js.map +1 -1
  756. package/dist/workers/repository/reconfigure/utils.d.ts +2 -0
  757. package/dist/workers/repository/reconfigure/utils.js +16 -0
  758. package/dist/workers/repository/reconfigure/utils.js.map +1 -1
  759. package/dist/workers/repository/reconfigure/validate.js +6 -17
  760. package/dist/workers/repository/reconfigure/validate.js.map +1 -1
  761. package/dist/workers/repository/update/branch/auto-replace.js +25 -5
  762. package/dist/workers/repository/update/branch/auto-replace.js.map +1 -1
  763. package/dist/workers/repository/update/branch/commit.js +2 -0
  764. package/dist/workers/repository/update/branch/commit.js.map +1 -1
  765. package/dist/workers/repository/update/branch/execute-post-upgrade-commands.js +10 -1
  766. package/dist/workers/repository/update/branch/execute-post-upgrade-commands.js.map +1 -1
  767. package/dist/workers/repository/update/pr/body/config-description.js +26 -1
  768. package/dist/workers/repository/update/pr/body/config-description.js.map +1 -1
  769. package/dist/workers/repository/update/pr/body/index.js +21 -14
  770. package/dist/workers/repository/update/pr/body/index.js.map +1 -1
  771. package/dist/workers/repository/update/pr/changelog/api.js +8 -6
  772. package/dist/workers/repository/update/pr/changelog/api.js.map +1 -1
  773. package/dist/workers/repository/update/pr/changelog/bitbucket/index.js +1 -1
  774. package/dist/workers/repository/update/pr/changelog/bitbucket/index.js.map +1 -1
  775. package/dist/workers/repository/update/pr/changelog/bitbucket-server/index.d.ts +3 -0
  776. package/dist/workers/repository/update/pr/changelog/bitbucket-server/index.js +39 -0
  777. package/dist/workers/repository/update/pr/changelog/bitbucket-server/index.js.map +1 -0
  778. package/dist/workers/repository/update/pr/changelog/bitbucket-server/source.d.ts +8 -0
  779. package/dist/workers/repository/update/pr/changelog/bitbucket-server/source.js +31 -0
  780. package/dist/workers/repository/update/pr/changelog/bitbucket-server/source.js.map +1 -0
  781. package/dist/workers/repository/update/pr/changelog/github/index.js +6 -3
  782. package/dist/workers/repository/update/pr/changelog/github/index.js.map +1 -1
  783. package/dist/workers/repository/update/pr/changelog/gitlab/index.js +1 -1
  784. package/dist/workers/repository/update/pr/changelog/gitlab/index.js.map +1 -1
  785. package/dist/workers/repository/update/pr/changelog/release-notes.js +12 -8
  786. package/dist/workers/repository/update/pr/changelog/release-notes.js.map +1 -1
  787. package/dist/workers/repository/update/pr/changelog/source.d.ts +1 -1
  788. package/dist/workers/repository/update/pr/changelog/source.js +1 -0
  789. package/dist/workers/repository/update/pr/changelog/source.js.map +1 -1
  790. package/dist/workers/repository/update/pr/changelog/types.d.ts +1 -1
  791. package/dist/workers/repository/update/pr/changelog/types.js.map +1 -1
  792. package/dist/workers/repository/update/pr/index.js +2 -4
  793. package/dist/workers/repository/update/pr/index.js.map +1 -1
  794. package/dist/workers/repository/updates/flatten.js +8 -4
  795. package/dist/workers/repository/updates/flatten.js.map +1 -1
  796. package/dist/workers/repository/updates/generate.js +3 -2
  797. package/dist/workers/repository/updates/generate.js.map +1 -1
  798. package/dist/workers/types.d.ts +1 -4
  799. package/dist/workers/types.js.map +1 -1
  800. package/package.json +85 -85
  801. package/renovate-schema.json +24 -3
  802. package/dist/modules/manager/github-actions/types.d.ts +0 -30
  803. package/dist/modules/manager/github-actions/types.js +0 -3
  804. package/dist/modules/manager/github-actions/types.js.map +0 -1
  805. package/dist/modules/manager/gitlabci/common.d.ts +0 -6
  806. package/dist/modules/manager/gitlabci/common.js +0 -30
  807. package/dist/modules/manager/gitlabci/common.js.map +0 -1
  808. package/dist/modules/manager/gitlabci/types.d.ts +0 -35
  809. package/dist/modules/manager/gitlabci/types.js +0 -3
  810. package/dist/modules/manager/gitlabci/types.js.map +0 -1
@@ -4,6 +4,7 @@ exports.UvLockfileSchema = exports.PdmLockfileSchema = exports.PyProjectSchema =
4
4
  const zod_1 = require("zod");
5
5
  const schema_utils_1 = require("../../../util/schema-utils");
6
6
  const common_1 = require("../../datasource/pypi/common");
7
+ const schema_1 = require("../pixi/schema");
7
8
  const DependencyListSchema = zod_1.z.array(zod_1.z.string()).optional();
8
9
  const DependencyRecordSchema = zod_1.z
9
10
  .record(zod_1.z.string(), zod_1.z.array(zod_1.z.string()))
@@ -90,6 +91,7 @@ exports.PyProjectSchema = zod_1.z.object({
90
91
  .optional(),
91
92
  tool: zod_1.z
92
93
  .object({
94
+ pixi: schema_1.PixiConfigSchema.optional(),
93
95
  pdm: PdmSchema.optional(),
94
96
  hatch: HatchSchema.optional(),
95
97
  uv: UvSchema.optional(),
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pep621/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,6DAA2E;AAC3E,yDAAsE;AAItE,MAAM,oBAAoB,GAAG,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;AAC5D,MAAM,sBAAsB,GAAG,OAAC;KAC7B,MAAM,CAAC,OAAC,CAAC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AI,CACvC,OAAC,CAAC,MAAM,CAAC;IACP,OAAO,EAAE,IAAA,yBAAU,EACjB,OAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;QAChB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;KACpB,CAAC,CACH;CACF,CAAC,CACH,CAAC,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,CAC/B,MAAM,CAAC,WAAW,CAChB,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAoB,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAClE,CACF,CAAC","sourcesContent":["import { z } from 'zod';\nimport { LooseArray, LooseRecord, Toml } from '../../../util/schema-utils';\nimport { normalizePythonDepName } from '../../datasource/pypi/common';\n\nexport type PyProject = z.infer<typeof PyProjectSchema>;\n\nconst DependencyListSchema = z.array(z.string()).optional();\nconst DependencyRecordSchema = z\n .record(z.string(), z.array(z.string()))\n .optional();\n\nconst PdmSchema = z.object({\n 'dev-dependencies': DependencyRecordSchema,\n source: z\n .array(\n z.object({\n url: z.string(),\n name: z.string(),\n verify_ssl: z.boolean().optional(),\n }),\n )\n .optional(),\n});\n\nconst HatchSchema = z.object({\n envs: z\n .record(\n z.string(),\n z\n .object({\n dependencies: DependencyListSchema,\n 'extra-dependencies': DependencyListSchema,\n })\n .optional(),\n )\n .optional(),\n});\n\nconst UvIndexSource = z.object({\n index: z.string(),\n});\n\nconst UvGitSource = z.object({\n git: z.string(),\n rev: z.string().optional(),\n tag: z.string().optional(),\n branch: z.string().optional(),\n});\nexport type UvGitSource = z.infer<typeof UvGitSource>;\n\nconst UvUrlSource = z.object({\n url: z.string(),\n});\n\nconst UvPathSource = z.object({\n path: z.string(),\n});\n\nconst UvWorkspaceSource = z.object({\n workspace: z.literal(true),\n});\n\n// https://docs.astral.sh/uv/concepts/dependencies/#dependency-sources\nconst UvSource = z.union([\n UvIndexSource,\n UvGitSource,\n UvUrlSource,\n UvPathSource,\n UvWorkspaceSource,\n]);\n\nconst UvSchema = z.object({\n 'dev-dependencies': DependencyListSchema,\n sources: LooseRecord(\n // uv applies the same normalization as for Python dependencies on sources\n z.string().transform((source) => normalizePythonDepName(source)),\n UvSource,\n ).optional(),\n index: z\n .array(\n z.object({\n name: z.string(),\n url: z.string(),\n default: z.boolean().default(false),\n explicit: z.boolean().default(false),\n }),\n )\n .optional(),\n});\n\nexport const PyProjectSchema = z.object({\n project: z\n .object({\n version: z.string().optional().catch(undefined),\n 'requires-python': z.string().optional(),\n dependencies: DependencyListSchema,\n 'optional-dependencies': DependencyRecordSchema,\n })\n .optional(),\n 'build-system': z\n .object({\n requires: DependencyListSchema,\n 'build-backend': z.string().optional(),\n })\n .optional(),\n 'dependency-groups': z\n .record(\n z.string(),\n // Skip non-string entries, like `{include-group = \"typing\"}`, as they are not dependencies.\n LooseArray(z.string()),\n )\n .optional(),\n tool: z\n .object({\n pdm: PdmSchema.optional(),\n hatch: HatchSchema.optional(),\n uv: UvSchema.optional(),\n })\n .optional(),\n});\n\nexport const PdmLockfileSchema = Toml.pipe(\n z.object({\n package: LooseArray(\n z.object({\n name: z.string(),\n version: z.string(),\n }),\n ),\n }),\n)\n .transform(({ package: pkg }) =>\n Object.fromEntries(\n pkg.map(({ name, version }): [string, string] => [name, version]),\n ),\n )\n .transform((lock) => ({ lock }));\n\nexport const UvLockfileSchema = Toml.pipe(\n z.object({\n package: LooseArray(\n z.object({\n name: z.string(),\n version: z.string(),\n }),\n ),\n }),\n).transform(({ package: pkg }) =>\n Object.fromEntries(\n pkg.map(({ name, version }): [string, string] => [name, version]),\n ),\n);\n"]}
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pep621/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,6DAA2E;AAC3E,yDAAsE;AACtE,2CAAkD;AAIlD,MAAM,oBAAoB,GAAG,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AE,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAClE,CACF;KACA,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAEtB,QAAA,gBAAgB,GAAG,mBAAI,CAAC,IAAI,CACvC,OAAC,CAAC,MAAM,CAAC;IACP,OAAO,EAAE,IAAA,yBAAU,EACjB,OAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;QAChB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;KACpB,CAAC,CACH;CACF,CAAC,CACH,CAAC,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,CAC/B,MAAM,CAAC,WAAW,CAChB,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAoB,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAClE,CACF,CAAC","sourcesContent":["import { z } from 'zod';\nimport { LooseArray, LooseRecord, Toml } from '../../../util/schema-utils';\nimport { normalizePythonDepName } from '../../datasource/pypi/common';\nimport { PixiConfigSchema } from '../pixi/schema';\n\nexport type PyProject = z.infer<typeof PyProjectSchema>;\n\nconst DependencyListSchema = z.array(z.string()).optional();\nconst DependencyRecordSchema = z\n .record(z.string(), z.array(z.string()))\n .optional();\n\nconst PdmSchema = z.object({\n 'dev-dependencies': DependencyRecordSchema,\n source: z\n .array(\n z.object({\n url: z.string(),\n name: z.string(),\n verify_ssl: z.boolean().optional(),\n }),\n )\n .optional(),\n});\n\nconst HatchSchema = z.object({\n envs: z\n .record(\n z.string(),\n z\n .object({\n dependencies: DependencyListSchema,\n 'extra-dependencies': DependencyListSchema,\n })\n .optional(),\n )\n .optional(),\n});\n\nconst UvIndexSource = z.object({\n index: z.string(),\n});\n\nconst UvGitSource = z.object({\n git: z.string(),\n rev: z.string().optional(),\n tag: z.string().optional(),\n branch: z.string().optional(),\n});\nexport type UvGitSource = z.infer<typeof UvGitSource>;\n\nconst UvUrlSource = z.object({\n url: z.string(),\n});\n\nconst UvPathSource = z.object({\n path: z.string(),\n});\n\nconst UvWorkspaceSource = z.object({\n workspace: z.literal(true),\n});\n\n// https://docs.astral.sh/uv/concepts/dependencies/#dependency-sources\nconst UvSource = z.union([\n UvIndexSource,\n UvGitSource,\n UvUrlSource,\n UvPathSource,\n UvWorkspaceSource,\n]);\n\nconst UvSchema = z.object({\n 'dev-dependencies': DependencyListSchema,\n sources: LooseRecord(\n // uv applies the same normalization as for Python dependencies on sources\n z.string().transform((source) => normalizePythonDepName(source)),\n UvSource,\n ).optional(),\n index: z\n .array(\n z.object({\n name: z.string(),\n url: z.string(),\n default: z.boolean().default(false),\n explicit: z.boolean().default(false),\n }),\n )\n .optional(),\n});\n\nexport const PyProjectSchema = z.object({\n project: z\n .object({\n version: z.string().optional().catch(undefined),\n 'requires-python': z.string().optional(),\n dependencies: DependencyListSchema,\n 'optional-dependencies': DependencyRecordSchema,\n })\n .optional(),\n 'build-system': z\n .object({\n requires: DependencyListSchema,\n 'build-backend': z.string().optional(),\n })\n .optional(),\n 'dependency-groups': z\n .record(\n z.string(),\n // Skip non-string entries, like `{include-group = \"typing\"}`, as they are not dependencies.\n LooseArray(z.string()),\n )\n .optional(),\n tool: z\n .object({\n pixi: PixiConfigSchema.optional(),\n pdm: PdmSchema.optional(),\n hatch: HatchSchema.optional(),\n uv: UvSchema.optional(),\n })\n .optional(),\n});\n\nexport const PdmLockfileSchema = Toml.pipe(\n z.object({\n package: LooseArray(\n z.object({\n name: z.string(),\n version: z.string(),\n }),\n ),\n }),\n)\n .transform(({ package: pkg }) =>\n Object.fromEntries(\n pkg.map(({ name, version }): [string, string] => [name, version]),\n ),\n )\n .transform((lock) => ({ lock }));\n\nexport const UvLockfileSchema = Toml.pipe(\n z.object({\n package: LooseArray(\n z.object({\n name: z.string(),\n version: z.string(),\n }),\n ),\n }),\n).transform(({ package: pkg }) =>\n Object.fromEntries(\n pkg.map(({ name, version }): [string, string] => [name, version]),\n ),\n);\n"]}
@@ -108,7 +108,7 @@ function parseDependencyList(depType, list) {
108
108
  }
109
109
  function parsePyProject(packageFile, content) {
110
110
  try {
111
- const jsonMap = (0, toml_1.parse)(content);
111
+ const jsonMap = (0, toml_1.parse)((0, toml_1.massage)(content));
112
112
  return schema_1.PyProjectSchema.parse(jsonMap);
113
113
  }
114
114
  catch (err) {
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pep621/utils.ts"],"names":[],"mappings":";;;AAyBA,kCAuCC;AAED,8DA0BC;AAED,gEAmBC;AAED,kDAgBC;AAED,wCAcC;;AAnJD,kEAAkC;AAClC,4CAAyC;AACzC,+CAA4C;AAC5C,6CAAwD;AACxD,gDAAuD;AACvD,yDAAsE;AAGtE,qCAA2C;AAG3C,MAAM,WAAW,GAAG,IAAA,aAAK,EACvB,kHAAkH,CACnH,CAAC;AAEW,QAAA,QAAQ,GAAG;IACtB,YAAY,EAAE,sBAAsB;IACpC,oBAAoB,EAAE,+BAA+B;IACrD,gBAAgB,EAAE,mBAAmB;IACrC,kBAAkB,EAAE,2BAA2B;IAC/C,iBAAiB,EAAE,0BAA0B;IAC7C,SAAS,EAAE,iBAAiB;IAC5B,mBAAmB,EAAE,uBAAuB;CAC7C,CAAC;AAEF,SAAgB,WAAW,CACzB,KAAgC;IAEhC,IAAI,YAAE,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3C,IACE,YAAE,CAAC,eAAe,CAAC,UAAU,CAAC;QAC9B,YAAE,CAAC,eAAe,CAAC,UAAU,EAAE,MAAM,CAAC,EACtC,CAAC;QACD,eAAM,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;QAC9C,OA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ED,SAAgB,mBAAmB,CACjC,OAAe,EACf,IAAiC;IAEjC,IAAI,YAAE,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,IAAI,GAAwB,EAAE,CAAC;IACrC,KAAK,MAAM,OAAO,IAAI,IAAI,EAAE,CAAC;QAC3B,MAAM,GAAG,GAAG,yBAAyB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxD,IAAI,YAAE,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;YACnB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACjB,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAgB,cAAc,CAC5B,WAAmB,EACnB,OAAe;IAEf,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAA,YAAS,EAAC,OAAO,CAAC,CAAC;QACnC,OAAO,wBAAe,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,eAAM,CAAC,KAAK,CACV,EAAE,WAAW,EAAE,GAAG,EAAE,EACpB,6CAA6C,CAC9C,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { logger } from '../../../logger';\nimport { regEx } from '../../../util/regex';\nimport { parse as parseToml } from '../../../util/toml';\nimport { PypiDatasource } from '../../datasource/pypi';\nimport { normalizePythonDepName } from '../../datasource/pypi/common';\nimport type { PackageDependency } from '../types';\nimport type { PyProject } from './schema';\nimport { PyProjectSchema } from './schema';\nimport type { Pep508ParseResult, Pep621ManagerData } from './types';\n\nconst pep508Regex = regEx(\n /^(?<packageName>[A-Z0-9._-]+)\\s*(\\[(?<extras>[A-Z0-9\\s,._-]+)\\])?\\s*(?<currentValue>[^;]+)?(;\\s*(?<marker>.*))?/i,\n);\n\nexport const depTypes = {\n dependencies: 'project.dependencies',\n optionalDependencies: 'project.optional-dependencies',\n dependencyGroups: 'dependency-groups',\n pdmDevDependencies: 'tool.pdm.dev-dependencies',\n uvDevDependencies: 'tool.uv.dev-dependencies',\n uvSources: 'tool.uv.sources',\n buildSystemRequires: 'build-system.requires',\n};\n\nexport function parsePEP508(\n value: string | null | undefined,\n): Pep508ParseResult | null {\n if (is.nullOrUndefined(value)) {\n return null;\n }\n\n const regExpExec = pep508Regex.exec(value);\n if (\n is.nullOrUndefined(regExpExec) ||\n is.nullOrUndefined(regExpExec?.groups)\n ) {\n logger.trace(`Pep508 could not be extracted`);\n return null;\n }\n\n const result: Pep508ParseResult = {\n packageName: regExpExec.groups.packageName,\n };\n if (is.nonEmptyString(regExpExec.groups.currentValue)) {\n if (\n regExpExec.groups.currentValue.startsWith('(') &&\n regExpExec.groups.currentValue.endsWith(')')\n ) {\n result.currentValue = regExpExec.groups.currentValue.slice(1, -1).trim();\n } else {\n result.currentValue = regExpExec.groups.currentValue;\n }\n }\n\n if (is.nonEmptyString(regExpExec.groups.marker)) {\n result.marker = regExpExec.groups.marker;\n }\n if (is.nonEmptyString(regExpExec.groups.extras)) {\n // trim to remove allowed whitespace between brackets\n result.extras = regExpExec.groups.extras.split(',').map((e) => e.trim());\n }\n\n return result;\n}\n\nexport function pep508ToPackageDependency(\n depType: string,\n value: string,\n): PackageDependency | null {\n const parsed = parsePEP508(value);\n if (is.nullOrUndefined(parsed)) {\n return null;\n }\n\n const dep: PackageDependency = {\n packageName: normalizePythonDepName(parsed.packageName),\n depName: parsed.packageName,\n datasource: PypiDatasource.id,\n depType,\n };\n\n if (is.nullOrUndefined(parsed.currentValue)) {\n dep.skipReason = 'unspecified-version';\n } else {\n dep.currentValue = parsed.currentValue;\n\n if (parsed.currentValue.startsWith('==')) {\n dep.currentVersion = parsed.currentValue.replace(regEx(/^==\\s*/), '');\n }\n }\n return dep;\n}\n\nexport function parseDependencyGroupRecord(\n depType: string,\n records: Record<string, string[]> | null | undefined,\n): PackageDependency[] {\n if (is.nullOrUndefined(records)) {\n return [];\n }\n\n const deps: PackageDependency<Pep621ManagerData>[] = [];\n for (const [depGroup, pep508Strings] of Object.entries(records)) {\n for (const dep of parseDependencyList(depType, pep508Strings)) {\n deps.push({\n ...dep,\n depName: dep.packageName!,\n managerData: { depGroup },\n });\n }\n }\n return deps;\n}\n\nexport function parseDependencyList(\n depType: string,\n list: string[] | null | undefined,\n): PackageDependency[] {\n if (is.nullOrUndefined(list)) {\n return [];\n }\n\n const deps: PackageDependency[] = [];\n for (const element of list) {\n const dep = pep508ToPackageDependency(depType, element);\n if (is.truthy(dep)) {\n deps.push(dep);\n }\n }\n return deps;\n}\n\nexport function parsePyProject(\n packageFile: string,\n content: string,\n): PyProject | null {\n try {\n const jsonMap = parseToml(content);\n return PyProjectSchema.parse(jsonMap);\n } catch (err) {\n logger.debug(\n { packageFile, err },\n `Failed to parse and validate pyproject file`,\n );\n return null;\n }\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pep621/utils.ts"],"names":[],"mappings":";;;AAyBA,kCAuCC;AAED,8DA0BC;AAED,gEAmBC;AAED,kDAgBC;AAED,wCAcC;;AAnJD,kEAAkC;AAClC,4CAAyC;AACzC,+CAA4C;AAC5C,6CAAgF;AAChF,gDAAuD;AACvD,yDAAsE;AAGtE,qCAA2C;AAG3C,MAAM,WAAW,GAAG,IAAA,aAAK,EACvB,kHAAkH,CACnH,CAAC;AAEW,QAAA,QAAQ,GAAG;IACtB,YAAY,EAAE,sBAAsB;IACpC,oBAAoB,EAAE,+BAA+B;IACrD,gBAAgB,EAAE,mBAAmB;IACrC,kBAAkB,EAAE,2BAA2B;IAC/C,iBAAiB,EAAE,0BAA0B;IAC7C,SAAS,EAAE,iBAAiB;IAC5B,mBAAmB,EAAE,uBAAuB;CAC7C,CAAC;AAEF,SAAgB,WAAW,CACzB,KAAgC;IAEhC,IAAI,YAAE,CAAC,eAAe,CAAC,KAAK,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EAAE,CAAC;QAChE,KAAK,MAAM,GAAG,IAAI,mBAAmB,CAAC,OAAO,EAAE,aAAa,CAAC,EAAE,CAAC;YAC9D,IAAI,CAAC,IAAI,CAAC;gBACR,GAAG,GAAG;gBACN,OAAO,EAAE,GAAG,CAAC,WAAY;gBACzB,WAAW,EAAE,EAAE,QAAQ,EAAE;aAC1B,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAgB,mBAAmB,CACjC,OAAe,EACf,IAAiC;IAEjC,IAAI,YAAE,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,IAAI,GAAwB,EAAE,CAAC;IACrC,KAAK,MAAM,OAAO,IAAI,IAAI,EAAE,CAAC;QAC3B,MAAM,GAAG,GAAG,yBAAyB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxD,IAAI,YAAE,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;YACnB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACjB,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAgB,cAAc,CAC5B,WAAmB,EACnB,OAAe;IAEf,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAA,YAAS,EAAC,IAAA,cAAW,EAAC,OAAO,CAAC,CAAC,CAAC;QAChD,OAAO,wBAAe,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,eAAM,CAAC,KAAK,CACV,EAAE,WAAW,EAAE,GAAG,EAAE,EACpB,6CAA6C,CAC9C,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { logger } from '../../../logger';\nimport { regEx } from '../../../util/regex';\nimport { massage as massageToml, parse as parseToml } from '../../../util/toml';\nimport { PypiDatasource } from '../../datasource/pypi';\nimport { normalizePythonDepName } from '../../datasource/pypi/common';\nimport type { PackageDependency } from '../types';\nimport type { PyProject } from './schema';\nimport { PyProjectSchema } from './schema';\nimport type { Pep508ParseResult, Pep621ManagerData } from './types';\n\nconst pep508Regex = regEx(\n /^(?<packageName>[A-Z0-9._-]+)\\s*(\\[(?<extras>[A-Z0-9\\s,._-]+)\\])?\\s*(?<currentValue>[^;]+)?(;\\s*(?<marker>.*))?/i,\n);\n\nexport const depTypes = {\n dependencies: 'project.dependencies',\n optionalDependencies: 'project.optional-dependencies',\n dependencyGroups: 'dependency-groups',\n pdmDevDependencies: 'tool.pdm.dev-dependencies',\n uvDevDependencies: 'tool.uv.dev-dependencies',\n uvSources: 'tool.uv.sources',\n buildSystemRequires: 'build-system.requires',\n};\n\nexport function parsePEP508(\n value: string | null | undefined,\n): Pep508ParseResult | null {\n if (is.nullOrUndefined(value)) {\n return null;\n }\n\n const regExpExec = pep508Regex.exec(value);\n if (\n is.nullOrUndefined(regExpExec) ||\n is.nullOrUndefined(regExpExec?.groups)\n ) {\n logger.trace(`Pep508 could not be extracted`);\n return null;\n }\n\n const result: Pep508ParseResult = {\n packageName: regExpExec.groups.packageName,\n };\n if (is.nonEmptyString(regExpExec.groups.currentValue)) {\n if (\n regExpExec.groups.currentValue.startsWith('(') &&\n regExpExec.groups.currentValue.endsWith(')')\n ) {\n result.currentValue = regExpExec.groups.currentValue.slice(1, -1).trim();\n } else {\n result.currentValue = regExpExec.groups.currentValue;\n }\n }\n\n if (is.nonEmptyString(regExpExec.groups.marker)) {\n result.marker = regExpExec.groups.marker;\n }\n if (is.nonEmptyString(regExpExec.groups.extras)) {\n // trim to remove allowed whitespace between brackets\n result.extras = regExpExec.groups.extras.split(',').map((e) => e.trim());\n }\n\n return result;\n}\n\nexport function pep508ToPackageDependency(\n depType: string,\n value: string,\n): PackageDependency | null {\n const parsed = parsePEP508(value);\n if (is.nullOrUndefined(parsed)) {\n return null;\n }\n\n const dep: PackageDependency = {\n packageName: normalizePythonDepName(parsed.packageName),\n depName: parsed.packageName,\n datasource: PypiDatasource.id,\n depType,\n };\n\n if (is.nullOrUndefined(parsed.currentValue)) {\n dep.skipReason = 'unspecified-version';\n } else {\n dep.currentValue = parsed.currentValue;\n\n if (parsed.currentValue.startsWith('==')) {\n dep.currentVersion = parsed.currentValue.replace(regEx(/^==\\s*/), '');\n }\n }\n return dep;\n}\n\nexport function parseDependencyGroupRecord(\n depType: string,\n records: Record<string, string[]> | null | undefined,\n): PackageDependency[] {\n if (is.nullOrUndefined(records)) {\n return [];\n }\n\n const deps: PackageDependency<Pep621ManagerData>[] = [];\n for (const [depGroup, pep508Strings] of Object.entries(records)) {\n for (const dep of parseDependencyList(depType, pep508Strings)) {\n deps.push({\n ...dep,\n depName: dep.packageName!,\n managerData: { depGroup },\n });\n }\n }\n return deps;\n}\n\nexport function parseDependencyList(\n depType: string,\n list: string[] | null | undefined,\n): PackageDependency[] {\n if (is.nullOrUndefined(list)) {\n return [];\n }\n\n const deps: PackageDependency[] = [];\n for (const element of list) {\n const dep = pep508ToPackageDependency(depType, element);\n if (is.truthy(dep)) {\n deps.push(dep);\n }\n }\n return deps;\n}\n\nexport function parsePyProject(\n packageFile: string,\n content: string,\n): PyProject | null {\n try {\n const jsonMap = parseToml(massageToml(content));\n return PyProjectSchema.parse(jsonMap);\n } catch (err) {\n logger.debug(\n { packageFile, err },\n `Failed to parse and validate pyproject file`,\n );\n return null;\n }\n}\n"]}
@@ -68,7 +68,6 @@ async function getExecOptions(config, commandType, cwd, extraEnv, extractedPytho
68
68
  const execOptions = {
69
69
  cwd: (0, util_1.ensureLocalPath)(cwd),
70
70
  docker: {},
71
- userConfiguredEnv: config.env,
72
71
  toolConstraints: [
73
72
  {
74
73
  toolName: 'python',
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pip-compile/common.ts"],"names":[],"mappings":";;;AAiBA,gEAkBC;AA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CAChD,CAAC;IAEF,IAAI,QAAQ,GAAqB,EAAE,CAAC;IACpC,KAAK,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;QACvD,MAAM,SAAS,GAAG,sBAAsB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACtD,QAAQ,GAAG;YACT,GAAG,QAAQ;YACX,GAAG,SAAS;SACb,CAAC;IACJ,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAgB,YAAY,CAAC,QAAgB;IAC3C,IAAI,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QAClC,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,IAAI,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;QACnC,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,IAAI,QAAQ,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACxC,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,iEAAiE;IACjE,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1D,OAAO,kBAAkB,CAAC;IAC5B,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { split } from 'shlex';\nimport upath from 'upath';\nimport { logger } from '../../../logger';\nimport { isNotNullOrUndefined } from '../../../util/array';\nimport type {\n ExecOptions,\n ExtraEnv,\n ToolConstraint,\n} from '../../../util/exec/types';\nimport { ensureCacheDir } from '../../../util/fs';\nimport { ensureLocalPath } from '../../../util/fs/util';\nimport * as hostRules from '../../../util/host-rules';\nimport { regEx } from '../../../util/regex';\nimport type { PackageFileContent, UpdateArtifactsConfig } from '../types';\nimport type { CommandType, PipCompileArgs, SupportedManagers } from './types';\n\nexport function getPythonVersionConstraint(\n config: UpdateArtifactsConfig,\n extractedPythonVersion: string | undefined,\n): string | undefined | null {\n const { constraints = {} } = config;\n const { python } = constraints;\n\n if (python) {\n logger.debug('Using python constraint from config');\n return python;\n }\n\n if (extractedPythonVersion) {\n logger.debug('Using python constraint extracted from the lock file');\n return `==${extractedPythonVersion}`;\n }\n\n return undefined;\n}\n\nexport function getPipToolsVersionConstraint(\n config: UpdateArtifactsConfig,\n): string {\n const { constraints = {} } = config;\n const { pipTools } = constraints;\n\n if (is.string(pipTools)) {\n logger.debug('Using pipTools constraint from config');\n return pipTools;\n }\n\n return '';\n}\n\nexport function getUvVersionConstraint(config: UpdateArtifactsConfig): string {\n const { constraints = {} } = config;\n const { uv } = constraints;\n\n if (is.string(uv)) {\n logger.debug('Using uv constraint from config');\n return uv;\n }\n\n return '';\n}\n\nexport function getToolVersionConstraint(\n config: UpdateArtifactsConfig,\n commandType: CommandType,\n): ToolConstraint {\n if (commandType === 'uv') {\n return {\n toolName: 'uv',\n constraint: getUvVersionConstraint(config),\n };\n }\n\n return {\n toolName: 'pip-tools',\n constraint: getPipToolsVersionConstraint(config),\n };\n}\n\nexport async function getExecOptions(\n config: UpdateArtifactsConfig,\n commandType: CommandType,\n cwd: string,\n extraEnv: ExtraEnv<string>,\n extractedPythonVersion: string | undefined,\n): Promise<ExecOptions> {\n const constraint = getPythonVersionConstraint(config, extractedPythonVersion);\n const execOptions: ExecOptions = {\n cwd: ensureLocalPath(cwd),\n docker: {},\n userConfiguredEnv: config.env,\n toolConstraints: [\n {\n toolName: 'python',\n constraint,\n },\n getToolVersionConstraint(config, commandType),\n ],\n extraEnv: {\n PIP_CACHE_DIR: await ensureCacheDir('pip'),\n PIP_NO_INPUT: 'true', // ensure pip doesn't block forever waiting for credentials on stdin\n PIP_KEYRING_PROVIDER: 'import',\n PYTHON_KEYRING_BACKEND: 'keyrings.envvars.keyring.EnvvarsKeyring',\n ...extraEnv,\n },\n };\n return execOptions;\n}\n\nexport const constraintLineRegex = regEx(\n /^(#.*?\\r?\\n)+# {4}(?<command>\\S*)(?<arguments> .*?)?\\r?\\n/,\n);\n\nexport const disallowedPipOptions = [\n '--no-header', // header is required by this manager\n];\nconst commonOptionsWithArguments = [\n '--output-file',\n '--extra',\n '--extra-index-url',\n];\nconst pipOptionsWithArguments = [\n '--resolver',\n '--constraint',\n ...commonOptionsWithArguments,\n];\nconst uvOptionsWithArguments = [\n '--constraints',\n '--python-version',\n ...commonOptionsWithArguments,\n];\nexport const optionsWithArguments = [\n ...pipOptionsWithArguments,\n ...uvOptionsWithArguments,\n];\nconst allowedCommonOptions = [\n '-v',\n '--generate-hashes',\n '--emit-index-url',\n '--index-url',\n];\nexport const allowedOptions: Record<CommandType, string[]> = {\n 'pip-compile': [\n '--all-extras',\n '--allow-unsafe',\n '--generate-hashes',\n '--no-emit-index-url',\n '--strip-extras',\n ...allowedCommonOptions,\n ...pipOptionsWithArguments,\n ],\n uv: [\n '--no-strip-extras',\n '--universal',\n ...allowedCommonOptions,\n ...uvOptionsWithArguments,\n ],\n custom: [],\n};\n\n// TODO(not7cd): test on all correct headers, even with CUSTOM_COMPILE_COMMAND\nexport function extractHeaderCommand(\n content: string,\n fileName: string,\n): PipCompileArgs {\n const compileCommand = constraintLineRegex.exec(content);\n if (compileCommand?.groups === undefined) {\n throw new Error(\n `Failed to extract command from header in ${fileName} ${content}`,\n );\n }\n logger.trace(\n `pip-compile: found header in ${fileName}: \\n${compileCommand[0]}`,\n );\n const command = compileCommand.groups.command;\n const argv = [command];\n let commandType: CommandType;\n if (command === 'pip-compile') {\n commandType = 'pip-compile';\n } else if (command === 'uv') {\n commandType = 'uv';\n } else {\n commandType = 'custom';\n }\n if (compileCommand.groups.arguments) {\n argv.push(...split(compileCommand.groups.arguments));\n }\n logger.debug(\n { fileName, argv, commandType },\n `pip-compile: extracted command from header`,\n );\n\n const result: PipCompileArgs = {\n argv,\n command,\n commandType,\n outputFile: '',\n sourceFiles: [],\n };\n for (const arg of argv.slice(1)) {\n if (commandType === 'uv' && ['pip', 'compile'].includes(arg)) {\n continue;\n }\n // TODO(not7cd): check for \"--option -- argument\" case\n if (!arg.startsWith('-')) {\n result.sourceFiles.push(arg);\n continue;\n }\n throwForDisallowedOption(arg);\n throwForNoEqualSignInOptionWithArgument(arg);\n throwForUnknownOption(commandType, arg);\n\n if (arg.includes('=')) {\n const [option, value] = arg.split('=');\n if (option === '--extra') {\n result.extra = result.extra ?? [];\n result.extra.push(value);\n } else if (option === '--extra-index-url') {\n result.extraIndexUrl = result.extraIndexUrl ?? [];\n result.extraIndexUrl.push(value);\n // TODO: add to secrets? next PR\n } else if (['--constraint', '--constraints'].includes(option)) {\n result.constraintsFiles = result.constraintsFiles ?? [];\n result.constraintsFiles.push(value);\n } else if (option === '--output-file') {\n if (result.outputFile) {\n throw new Error('Cannot use multiple --output-file options');\n }\n result.outputFile = upath.normalize(value);\n } else if (option === '--python-version') {\n result.pythonVersion = value;\n } else if (option === '--index-url') {\n if (result.indexUrl) {\n throw new Error('Cannot use multiple --index-url options');\n }\n result.indexUrl = value;\n // TODO: add to secrets? next PR\n } else {\n logger.debug({ option }, `pip-compile: option not handled`);\n }\n continue;\n }\n if (arg === '--no-emit-index-url') {\n result.noEmitIndexUrl = true;\n continue;\n }\n if (arg === '--emit-index-url') {\n result.emitIndexUrl = true;\n continue;\n }\n if (arg === '--all-extras') {\n result.allExtras = true;\n continue;\n }\n\n logger.debug({ option: arg }, `pip-compile: option not handled`);\n }\n logger.trace(\n {\n ...result,\n },\n 'Parsed pip-compile command from header',\n );\n if (result.noEmitIndexUrl && result.emitIndexUrl) {\n throw new Error('Cannot use both --no-emit-index-url and --emit-index-url');\n }\n if (result.sourceFiles.length === 0) {\n throw new Error(\n 'No source files detected in command, pass at least one package file explicitly',\n );\n }\n return result;\n}\n\nconst pythonVersionRegex = regEx(\n /^(#.*?\\r?\\n)*# This file is autogenerated by pip-compile with Python (?<pythonVersion>\\d+(\\.\\d+)*)\\s/,\n 'i',\n);\n\nexport function extractPythonVersion(\n content: string,\n fileName: string,\n): string | undefined {\n const match = pythonVersionRegex.exec(content);\n if (match?.groups === undefined) {\n logger.warn(\n { fileName, content },\n 'pip-compile: failed to extract Python version from header in file',\n );\n return undefined;\n }\n logger.trace(\n `pip-compile: found Python version header in ${fileName}: \\n${match[0]}`,\n );\n const { pythonVersion } = match.groups;\n logger.debug(\n { fileName, pythonVersion },\n `pip-compile: extracted Python version from header`,\n );\n return pythonVersion;\n}\n\nfunction throwForDisallowedOption(arg: string): void {\n if (disallowedPipOptions.includes(arg)) {\n throw new Error(`Option ${arg} not allowed for this manager`);\n }\n}\nfunction throwForNoEqualSignInOptionWithArgument(arg: string): void {\n if (optionsWithArguments.includes(arg)) {\n throw new Error(\n `Option ${arg} must have equal sign '=' separating it's argument`,\n );\n }\n}\nfunction throwForUnknownOption(commandType: CommandType, arg: string): void {\n if (arg.includes('=')) {\n const [option] = arg.split('=');\n if (allowedOptions[commandType].includes(option)) {\n return;\n }\n }\n if (allowedOptions[commandType].includes(arg)) {\n return;\n }\n throw new Error(`Option ${arg} not supported (yet)`);\n}\n\nfunction getRegistryCredEnvVars(\n url: URL,\n index: number,\n): Record<string, string> {\n const hostRule = hostRules.find({ url: url.href });\n logger.debug(hostRule, `Found host rule for url ${url.href}`);\n const ret: Record<string, string> = {};\n if (!!hostRule.username || !!hostRule.password) {\n ret[`KEYRING_SERVICE_NAME_${index}`] = url.hostname;\n ret[`KEYRING_SERVICE_USERNAME_${index}`] = hostRule.username ?? '';\n ret[`KEYRING_SERVICE_PASSWORD_${index}`] = hostRule.password ?? '';\n }\n return ret;\n}\n\nfunction cleanUrl(url: string): URL | null {\n try {\n // Strip everything but protocol, host, and port\n const urlObj = new URL(url);\n return new URL(urlObj.origin);\n } catch {\n return null;\n }\n}\n\nexport function getRegistryCredVarsFromPackageFiles(\n packageFiles: PackageFileContent[],\n): ExtraEnv<string> {\n const urls: string[] = [];\n for (const packageFile of packageFiles) {\n urls.push(\n ...(packageFile.registryUrls ?? []),\n ...(packageFile.additionalRegistryUrls ?? []),\n );\n }\n logger.debug(urls, 'Extracted registry URLs from package files');\n\n const uniqueHosts = new Set<URL>(\n urls.map(cleanUrl).filter(isNotNullOrUndefined),\n );\n\n let allCreds: ExtraEnv<string> = {};\n for (const [index, host] of [...uniqueHosts].entries()) {\n const hostCreds = getRegistryCredEnvVars(host, index);\n allCreds = {\n ...allCreds,\n ...hostCreds,\n };\n }\n\n return allCreds;\n}\n\nexport function matchManager(filename: string): SupportedManagers | 'unknown' {\n if (filename.endsWith('setup.py')) {\n return 'pip_setup';\n }\n if (filename.endsWith('setup.cfg')) {\n return 'setup-cfg';\n }\n if (filename.endsWith('pyproject.toml')) {\n return 'pep621';\n }\n // naive, could be improved, maybe use pip_requirements.fileMatch\n if (filename.endsWith('.in') || filename.endsWith('.txt')) {\n return 'pip_requirements';\n }\n return 'unknown';\n}\n"]}
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pip-compile/common.ts"],"names":[],"mappings":";;;AAiBA,gEAkBC;AAED,oEAYC;AAED,wDAUC;AAED,4DAeC;AAED,wCA2BC;AAsDD,oDA+GC;AAOD,oDAqBC;AAoDD,kFA0BC;AAED,oCAeC;;AA3YD,kEAAkC;AAClC,iCAA8B;AAC9B,0DAA0B;AAC1B,4CAAyC;AACzC,+CAA2D;AAM3D,yCAAkD;AAClD,gDAAwD;AACxD,4EAAsD;AACtD,+CAA4C;AAI5C,SAAgB,0BAA0B,CACxC,MAA6B,EAC7B,sBAA0C;IAE1C,MAAM,EAAE,WAAW,GAAG,EAAE,EAAE,GAAG,MAAM,CAAC;IACpC,MAAM,EAAE,MAAM,EAAE,GAAG,WAAW,CAAC;IAE/B,IAAI,MAAM,EAAE,CAAC;QACX,eAAM,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;QACpD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,IAAI,sBAAsB,EAAE,CAAC;QAC3B,eAAM,CAAC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BAAgB,CAAC,EAAE,CAAC;QACxC,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,iEAAiE;IACjE,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1D,OAAO,kBAAkB,CAAC;IAC5B,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { split } from 'shlex';\nimport upath from 'upath';\nimport { logger } from '../../../logger';\nimport { isNotNullOrUndefined } from '../../../util/array';\nimport type {\n ExecOptions,\n ExtraEnv,\n ToolConstraint,\n} from '../../../util/exec/types';\nimport { ensureCacheDir } from '../../../util/fs';\nimport { ensureLocalPath } from '../../../util/fs/util';\nimport * as hostRules from '../../../util/host-rules';\nimport { regEx } from '../../../util/regex';\nimport type { PackageFileContent, UpdateArtifactsConfig } from '../types';\nimport type { CommandType, PipCompileArgs, SupportedManagers } from './types';\n\nexport function getPythonVersionConstraint(\n config: UpdateArtifactsConfig,\n extractedPythonVersion: string | undefined,\n): string | undefined | null {\n const { constraints = {} } = config;\n const { python } = constraints;\n\n if (python) {\n logger.debug('Using python constraint from config');\n return python;\n }\n\n if (extractedPythonVersion) {\n logger.debug('Using python constraint extracted from the lock file');\n return `==${extractedPythonVersion}`;\n }\n\n return undefined;\n}\n\nexport function getPipToolsVersionConstraint(\n config: UpdateArtifactsConfig,\n): string {\n const { constraints = {} } = config;\n const { pipTools } = constraints;\n\n if (is.string(pipTools)) {\n logger.debug('Using pipTools constraint from config');\n return pipTools;\n }\n\n return '';\n}\n\nexport function getUvVersionConstraint(config: UpdateArtifactsConfig): string {\n const { constraints = {} } = config;\n const { uv } = constraints;\n\n if (is.string(uv)) {\n logger.debug('Using uv constraint from config');\n return uv;\n }\n\n return '';\n}\n\nexport function getToolVersionConstraint(\n config: UpdateArtifactsConfig,\n commandType: CommandType,\n): ToolConstraint {\n if (commandType === 'uv') {\n return {\n toolName: 'uv',\n constraint: getUvVersionConstraint(config),\n };\n }\n\n return {\n toolName: 'pip-tools',\n constraint: getPipToolsVersionConstraint(config),\n };\n}\n\nexport async function getExecOptions(\n config: UpdateArtifactsConfig,\n commandType: CommandType,\n cwd: string,\n extraEnv: ExtraEnv<string>,\n extractedPythonVersion: string | undefined,\n): Promise<ExecOptions> {\n const constraint = getPythonVersionConstraint(config, extractedPythonVersion);\n const execOptions: ExecOptions = {\n cwd: ensureLocalPath(cwd),\n docker: {},\n toolConstraints: [\n {\n toolName: 'python',\n constraint,\n },\n getToolVersionConstraint(config, commandType),\n ],\n extraEnv: {\n PIP_CACHE_DIR: await ensureCacheDir('pip'),\n PIP_NO_INPUT: 'true', // ensure pip doesn't block forever waiting for credentials on stdin\n PIP_KEYRING_PROVIDER: 'import',\n PYTHON_KEYRING_BACKEND: 'keyrings.envvars.keyring.EnvvarsKeyring',\n ...extraEnv,\n },\n };\n return execOptions;\n}\n\nexport const constraintLineRegex = regEx(\n /^(#.*?\\r?\\n)+# {4}(?<command>\\S*)(?<arguments> .*?)?\\r?\\n/,\n);\n\nexport const disallowedPipOptions = [\n '--no-header', // header is required by this manager\n];\nconst commonOptionsWithArguments = [\n '--output-file',\n '--extra',\n '--extra-index-url',\n];\nconst pipOptionsWithArguments = [\n '--resolver',\n '--constraint',\n ...commonOptionsWithArguments,\n];\nconst uvOptionsWithArguments = [\n '--constraints',\n '--python-version',\n ...commonOptionsWithArguments,\n];\nexport const optionsWithArguments = [\n ...pipOptionsWithArguments,\n ...uvOptionsWithArguments,\n];\nconst allowedCommonOptions = [\n '-v',\n '--generate-hashes',\n '--emit-index-url',\n '--index-url',\n];\nexport const allowedOptions: Record<CommandType, string[]> = {\n 'pip-compile': [\n '--all-extras',\n '--allow-unsafe',\n '--generate-hashes',\n '--no-emit-index-url',\n '--strip-extras',\n ...allowedCommonOptions,\n ...pipOptionsWithArguments,\n ],\n uv: [\n '--no-strip-extras',\n '--universal',\n ...allowedCommonOptions,\n ...uvOptionsWithArguments,\n ],\n custom: [],\n};\n\n// TODO(not7cd): test on all correct headers, even with CUSTOM_COMPILE_COMMAND\nexport function extractHeaderCommand(\n content: string,\n fileName: string,\n): PipCompileArgs {\n const compileCommand = constraintLineRegex.exec(content);\n if (compileCommand?.groups === undefined) {\n throw new Error(\n `Failed to extract command from header in ${fileName} ${content}`,\n );\n }\n logger.trace(\n `pip-compile: found header in ${fileName}: \\n${compileCommand[0]}`,\n );\n const command = compileCommand.groups.command;\n const argv = [command];\n let commandType: CommandType;\n if (command === 'pip-compile') {\n commandType = 'pip-compile';\n } else if (command === 'uv') {\n commandType = 'uv';\n } else {\n commandType = 'custom';\n }\n if (compileCommand.groups.arguments) {\n argv.push(...split(compileCommand.groups.arguments));\n }\n logger.debug(\n { fileName, argv, commandType },\n `pip-compile: extracted command from header`,\n );\n\n const result: PipCompileArgs = {\n argv,\n command,\n commandType,\n outputFile: '',\n sourceFiles: [],\n };\n for (const arg of argv.slice(1)) {\n if (commandType === 'uv' && ['pip', 'compile'].includes(arg)) {\n continue;\n }\n // TODO(not7cd): check for \"--option -- argument\" case\n if (!arg.startsWith('-')) {\n result.sourceFiles.push(arg);\n continue;\n }\n throwForDisallowedOption(arg);\n throwForNoEqualSignInOptionWithArgument(arg);\n throwForUnknownOption(commandType, arg);\n\n if (arg.includes('=')) {\n const [option, value] = arg.split('=');\n if (option === '--extra') {\n result.extra = result.extra ?? [];\n result.extra.push(value);\n } else if (option === '--extra-index-url') {\n result.extraIndexUrl = result.extraIndexUrl ?? [];\n result.extraIndexUrl.push(value);\n // TODO: add to secrets? next PR\n } else if (['--constraint', '--constraints'].includes(option)) {\n result.constraintsFiles = result.constraintsFiles ?? [];\n result.constraintsFiles.push(value);\n } else if (option === '--output-file') {\n if (result.outputFile) {\n throw new Error('Cannot use multiple --output-file options');\n }\n result.outputFile = upath.normalize(value);\n } else if (option === '--python-version') {\n result.pythonVersion = value;\n } else if (option === '--index-url') {\n if (result.indexUrl) {\n throw new Error('Cannot use multiple --index-url options');\n }\n result.indexUrl = value;\n // TODO: add to secrets? next PR\n } else {\n logger.debug({ option }, `pip-compile: option not handled`);\n }\n continue;\n }\n if (arg === '--no-emit-index-url') {\n result.noEmitIndexUrl = true;\n continue;\n }\n if (arg === '--emit-index-url') {\n result.emitIndexUrl = true;\n continue;\n }\n if (arg === '--all-extras') {\n result.allExtras = true;\n continue;\n }\n\n logger.debug({ option: arg }, `pip-compile: option not handled`);\n }\n logger.trace(\n {\n ...result,\n },\n 'Parsed pip-compile command from header',\n );\n if (result.noEmitIndexUrl && result.emitIndexUrl) {\n throw new Error('Cannot use both --no-emit-index-url and --emit-index-url');\n }\n if (result.sourceFiles.length === 0) {\n throw new Error(\n 'No source files detected in command, pass at least one package file explicitly',\n );\n }\n return result;\n}\n\nconst pythonVersionRegex = regEx(\n /^(#.*?\\r?\\n)*# This file is autogenerated by pip-compile with Python (?<pythonVersion>\\d+(\\.\\d+)*)\\s/,\n 'i',\n);\n\nexport function extractPythonVersion(\n content: string,\n fileName: string,\n): string | undefined {\n const match = pythonVersionRegex.exec(content);\n if (match?.groups === undefined) {\n logger.warn(\n { fileName, content },\n 'pip-compile: failed to extract Python version from header in file',\n );\n return undefined;\n }\n logger.trace(\n `pip-compile: found Python version header in ${fileName}: \\n${match[0]}`,\n );\n const { pythonVersion } = match.groups;\n logger.debug(\n { fileName, pythonVersion },\n `pip-compile: extracted Python version from header`,\n );\n return pythonVersion;\n}\n\nfunction throwForDisallowedOption(arg: string): void {\n if (disallowedPipOptions.includes(arg)) {\n throw new Error(`Option ${arg} not allowed for this manager`);\n }\n}\nfunction throwForNoEqualSignInOptionWithArgument(arg: string): void {\n if (optionsWithArguments.includes(arg)) {\n throw new Error(\n `Option ${arg} must have equal sign '=' separating it's argument`,\n );\n }\n}\nfunction throwForUnknownOption(commandType: CommandType, arg: string): void {\n if (arg.includes('=')) {\n const [option] = arg.split('=');\n if (allowedOptions[commandType].includes(option)) {\n return;\n }\n }\n if (allowedOptions[commandType].includes(arg)) {\n return;\n }\n throw new Error(`Option ${arg} not supported (yet)`);\n}\n\nfunction getRegistryCredEnvVars(\n url: URL,\n index: number,\n): Record<string, string> {\n const hostRule = hostRules.find({ url: url.href });\n logger.debug(hostRule, `Found host rule for url ${url.href}`);\n const ret: Record<string, string> = {};\n if (!!hostRule.username || !!hostRule.password) {\n ret[`KEYRING_SERVICE_NAME_${index}`] = url.hostname;\n ret[`KEYRING_SERVICE_USERNAME_${index}`] = hostRule.username ?? '';\n ret[`KEYRING_SERVICE_PASSWORD_${index}`] = hostRule.password ?? '';\n }\n return ret;\n}\n\nfunction cleanUrl(url: string): URL | null {\n try {\n // Strip everything but protocol, host, and port\n const urlObj = new URL(url);\n return new URL(urlObj.origin);\n } catch {\n return null;\n }\n}\n\nexport function getRegistryCredVarsFromPackageFiles(\n packageFiles: PackageFileContent[],\n): ExtraEnv<string> {\n const urls: string[] = [];\n for (const packageFile of packageFiles) {\n urls.push(\n ...(packageFile.registryUrls ?? []),\n ...(packageFile.additionalRegistryUrls ?? []),\n );\n }\n logger.debug(urls, 'Extracted registry URLs from package files');\n\n const uniqueHosts = new Set<URL>(\n urls.map(cleanUrl).filter(isNotNullOrUndefined),\n );\n\n let allCreds: ExtraEnv<string> = {};\n for (const [index, host] of [...uniqueHosts].entries()) {\n const hostCreds = getRegistryCredEnvVars(host, index);\n allCreds = {\n ...allCreds,\n ...hostCreds,\n };\n }\n\n return allCreds;\n}\n\nexport function matchManager(filename: string): SupportedManagers | 'unknown' {\n if (filename.endsWith('setup.py')) {\n return 'pip_setup';\n }\n if (filename.endsWith('setup.cfg')) {\n return 'setup-cfg';\n }\n if (filename.endsWith('pyproject.toml')) {\n return 'pep621';\n }\n // naive, could be improved, maybe use pip_requirements.fileMatch\n if (filename.endsWith('.in') || filename.endsWith('.txt')) {\n return 'pip_requirements';\n }\n return 'unknown';\n}\n"]}
@@ -58,7 +58,6 @@ async function updateArtifacts({ packageFileName, updatedDeps, newPackageFileCon
58
58
  const execOptions = {
59
59
  cwdFile: '.',
60
60
  docker: {},
61
- userConfiguredEnv: config.env,
62
61
  toolConstraints: [
63
62
  { toolName: 'python', constraint: config.constraints?.python },
64
63
  { toolName: 'hashin', constraint: config.constraints?.hashin },
@@ -1 +1 @@
1
- {"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pip_requirements/artifacts.ts"],"names":[],"mappings":";;AAoCA,0CA2EC;;AA/GD,kEAAkC;AAClC,iCAA8B;AAC9B,sEAAoE;AACpE,4CAAyC;AACzC,6CAA0C;AAE1C,yCAAiE;AACjE,+CAA0D;AAE1D,uCAA0C;AAE1C;;;;;;;;;;GAUG;AACH,SAAS,wBAAwB,CAAC,OAAe;IAC/C,MAAM,cAAc,GAAG,IAAA,oBAAY,EAAC,OAAO,CAAC,CAAC;IAE7C,8FAA8F;IAC9F,oEAAoE;IACpE,EAAE;IACF,uEAAuE;IACvE,8DAA8D;IAC9D,OAAO,IAAA,aAAK,EACV,yBAAyB,cAAc,GAAG,uBAAa,0BAA0B,EACjF,GAAG,CACJ,CAAC;AACJ,CAAC;AAEM,KAAK,UAAU,eAAe,CAAC,EACpC,eAAe,EACf,WAAW,EACX,qBAAqB,EACrB,MAAM,GACS;IACf,eAAM,CAAC,KAAK,CAAC,oCAAoC,eAAe,GAAG,CAAC,CAAC;IACrE,IAAI,CAAC,YAAE,CAAC,aAAa,CAAC,WAAW,CAAC,EAAE,CAAC;QACnC,eAAM,CAAC,KAAK,CAAC,mDAAmD,CAAC,CAAC;QAClE,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,CAAC;QACH,MAAM,GAAG,GAAa,EAAE,CAAC;QACzB,MAAM,gBAAgB,GAAG,qBAAqB,CAAC,OAAO,CAAC,IAAA,aAAK,EAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;QAC3E,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;YAC9B,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,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,KAAK,CAAC,qBAAqB,eAAe,EAAE,CAAC,CAAC;QACrD,OAAO;YACL;gBACE,IAAI,EAAE;oBACJ,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,eAAe;oBACrB,QAAQ,EAAE,UAAU;iBACrB;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,qBAAqB;QACrB,IAAI,GAAG,CAAC,OAAO,KAAK,gCAAe,EAAE,CAAC;YACpC,MAAM,GAAG,CAAC;QACZ,CAAC;QACD,eAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,oBAAoB,eAAe,OAAO,CAAC,CAAC;QAClE,OAAO;YACL;gBACE,aAAa,EAAE;oBACb,QAAQ,EAAE,eAAe;oBACzB,MAAM,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;iBACvD;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { quote } from 'shlex';\nimport { TEMPORARY_ERROR } from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport { exec } from '../../../util/exec';\nimport type { ExecOptions } from '../../../util/exec/types';\nimport { ensureCacheDir, readLocalFile } from '../../../util/fs';\nimport { escapeRegExp, regEx } from '../../../util/regex';\nimport type { UpdateArtifact, UpdateArtifactsResult } from '../types';\nimport { extrasPattern } from './extract';\n\n/**\n * Create a RegExp that matches the first dependency pattern for\n * the named dependency that is followed by package hashes.\n *\n * The regular expression defines a single named group `depConstraint`\n * that holds the dependency constraint without the hash specifiers.\n * The substring matched by this named group will start with the dependency\n * name and end with a non-whitespace character.\n *\n * @param depName the name of the dependency\n */\nfunction dependencyAndHashPattern(depName: string): RegExp {\n const escapedDepName = escapeRegExp(depName);\n\n // extrasPattern covers any whitespace between the dep name and the optional extras specifier,\n // but it does not cover any whitespace in front of the equal signs.\n //\n // Use a non-greedy wildcard for the range pattern; otherwise, we would\n // include all but the last hash specifier into depConstraint.\n return regEx(\n `^\\\\s*(?<depConstraint>${escapedDepName}${extrasPattern}\\\\s*==.*?\\\\S)\\\\s+--hash=`,\n 'm',\n );\n}\n\nexport async function updateArtifacts({\n packageFileName,\n updatedDeps,\n newPackageFileContent,\n config,\n}: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> {\n logger.debug(`pip_requirements.updateArtifacts(${packageFileName})`);\n if (!is.nonEmptyArray(updatedDeps)) {\n logger.debug('No updated pip_requirements deps - returning null');\n return null;\n }\n try {\n const cmd: string[] = [];\n const rewrittenContent = newPackageFileContent.replace(regEx(/\\\\\\n/g), '');\n for (const dep of updatedDeps) {\n if (!dep.depName) {\n continue;\n }\n const depAndHashMatch = dependencyAndHashPattern(dep.depName).exec(\n rewrittenContent,\n );\n if (depAndHashMatch) {\n // If there's a match, then the regular expression guarantees\n // that the named subgroup deepConstraint did match as well.\n const depConstraint = depAndHashMatch.groups!.depConstraint;\n cmd.push(`hashin ${quote(depConstraint)} -r ${quote(packageFileName)}`);\n }\n }\n if (!cmd.length) {\n logger.debug('No hashin commands to run - returning');\n return null;\n }\n const execOptions: ExecOptions = {\n cwdFile: '.',\n docker: {},\n userConfiguredEnv: config.env,\n toolConstraints: [\n { toolName: 'python', constraint: config.constraints?.python },\n { toolName: 'hashin', constraint: config.constraints?.hashin },\n ],\n extraEnv: {\n PIP_CACHE_DIR: await ensureCacheDir('pip'),\n },\n };\n await exec(cmd, execOptions);\n const newContent = await readLocalFile(packageFileName, 'utf8');\n if (newContent === newPackageFileContent) {\n logger.debug(`${packageFileName} is unchanged`);\n return null;\n }\n logger.debug(`Returning updated ${packageFileName}`);\n return [\n {\n file: {\n type: 'addition',\n path: packageFileName,\n contents: newContent,\n },\n },\n ];\n } catch (err) {\n // istanbul ignore if\n if (err.message === TEMPORARY_ERROR) {\n throw err;\n }\n logger.debug({ err }, `Failed to update ${packageFileName} file`);\n return [\n {\n artifactError: {\n lockFile: packageFileName,\n stderr: `${String(err.stdout)}\\n${String(err.stderr)}`,\n },\n },\n ];\n }\n}\n"]}
1
+ {"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pip_requirements/artifacts.ts"],"names":[],"mappings":";;AAoCA,0CA0EC;;AA9GD,kEAAkC;AAClC,iCAA8B;AAC9B,sEAAoE;AACpE,4CAAyC;AACzC,6CAA0C;AAE1C,yCAAiE;AACjE,+CAA0D;AAE1D,uCAA0C;AAE1C;;;;;;;;;;GAUG;AACH,SAAS,wBAAwB,CAAC,OAAe;IAC/C,MAAM,cAAc,GAAG,IAAA,oBAAY,EAAC,OAAO,CAAC,CAAC;IAE7C,8FAA8F;IAC9F,oEAAoE;IACpE,EAAE;IACF,uEAAuE;IACvE,8DAA8D;IAC9D,OAAO,IAAA,aAAK,EACV,yBAAyB,cAAc,GAAG,uBAAa,0BAA0B,EACjF,GAAG,CACJ,CAAC;AACJ,CAAC;AAEM,KAAK,UAAU,eAAe,CAAC,EACpC,eAAe,EACf,WAAW,EACX,qBAAqB,EACrB,MAAM,GACS;IACf,eAAM,CAAC,KAAK,CAAC,oCAAoC,eAAe,GAAG,CAAC,CAAC;IACrE,IAAI,CAAC,YAAE,CAAC,aAAa,CAAC,WAAW,CAAC,EAAE,CAAC;QACnC,eAAM,CAAC,KAAK,CAAC,mDAAmD,CAAC,CAAC;QAClE,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,CAAC;QACH,MAAM,GAAG,GAAa,EAAE,CAAC;QACzB,MAAM,gBAAgB,GAAG,qBAAqB,CAAC,OAAO,CAAC,IAAA,aAAK,EAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;QAC3E,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;YAC9B,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;gBACjB,SAAS;YACX,CAAC;YACD,MAAM,eAAe,GAAG,wBAAwB,CAAC,GAAG,CAAC,OAAO,CAAC,CAA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rB,QAAQ,EAAE,UAAU;iBACrB;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,qBAAqB;QACrB,IAAI,GAAG,CAAC,OAAO,KAAK,gCAAe,EAAE,CAAC;YACpC,MAAM,GAAG,CAAC;QACZ,CAAC;QACD,eAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,oBAAoB,eAAe,OAAO,CAAC,CAAC;QAClE,OAAO;YACL;gBACE,aAAa,EAAE;oBACb,QAAQ,EAAE,eAAe;oBACzB,MAAM,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;iBACvD;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { quote } from 'shlex';\nimport { TEMPORARY_ERROR } from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport { exec } from '../../../util/exec';\nimport type { ExecOptions } from '../../../util/exec/types';\nimport { ensureCacheDir, readLocalFile } from '../../../util/fs';\nimport { escapeRegExp, regEx } from '../../../util/regex';\nimport type { UpdateArtifact, UpdateArtifactsResult } from '../types';\nimport { extrasPattern } from './extract';\n\n/**\n * Create a RegExp that matches the first dependency pattern for\n * the named dependency that is followed by package hashes.\n *\n * The regular expression defines a single named group `depConstraint`\n * that holds the dependency constraint without the hash specifiers.\n * The substring matched by this named group will start with the dependency\n * name and end with a non-whitespace character.\n *\n * @param depName the name of the dependency\n */\nfunction dependencyAndHashPattern(depName: string): RegExp {\n const escapedDepName = escapeRegExp(depName);\n\n // extrasPattern covers any whitespace between the dep name and the optional extras specifier,\n // but it does not cover any whitespace in front of the equal signs.\n //\n // Use a non-greedy wildcard for the range pattern; otherwise, we would\n // include all but the last hash specifier into depConstraint.\n return regEx(\n `^\\\\s*(?<depConstraint>${escapedDepName}${extrasPattern}\\\\s*==.*?\\\\S)\\\\s+--hash=`,\n 'm',\n );\n}\n\nexport async function updateArtifacts({\n packageFileName,\n updatedDeps,\n newPackageFileContent,\n config,\n}: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> {\n logger.debug(`pip_requirements.updateArtifacts(${packageFileName})`);\n if (!is.nonEmptyArray(updatedDeps)) {\n logger.debug('No updated pip_requirements deps - returning null');\n return null;\n }\n try {\n const cmd: string[] = [];\n const rewrittenContent = newPackageFileContent.replace(regEx(/\\\\\\n/g), '');\n for (const dep of updatedDeps) {\n if (!dep.depName) {\n continue;\n }\n const depAndHashMatch = dependencyAndHashPattern(dep.depName).exec(\n rewrittenContent,\n );\n if (depAndHashMatch) {\n // If there's a match, then the regular expression guarantees\n // that the named subgroup deepConstraint did match as well.\n const depConstraint = depAndHashMatch.groups!.depConstraint;\n cmd.push(`hashin ${quote(depConstraint)} -r ${quote(packageFileName)}`);\n }\n }\n if (!cmd.length) {\n logger.debug('No hashin commands to run - returning');\n return null;\n }\n const execOptions: ExecOptions = {\n cwdFile: '.',\n docker: {},\n toolConstraints: [\n { toolName: 'python', constraint: config.constraints?.python },\n { toolName: 'hashin', constraint: config.constraints?.hashin },\n ],\n extraEnv: {\n PIP_CACHE_DIR: await ensureCacheDir('pip'),\n },\n };\n await exec(cmd, execOptions);\n const newContent = await readLocalFile(packageFileName, 'utf8');\n if (newContent === newPackageFileContent) {\n logger.debug(`${packageFileName} is unchanged`);\n return null;\n }\n logger.debug(`Returning updated ${packageFileName}`);\n return [\n {\n file: {\n type: 'addition',\n path: packageFileName,\n contents: newContent,\n },\n },\n ];\n } catch (err) {\n // istanbul ignore if\n if (err.message === TEMPORARY_ERROR) {\n throw err;\n }\n logger.debug({ err }, `Failed to update ${packageFileName} file`);\n return [\n {\n artifactError: {\n lockFile: packageFileName,\n stderr: `${String(err.stdout)}\\n${String(err.stderr)}`,\n },\n },\n ];\n }\n}\n"]}
@@ -51,15 +51,11 @@ function extractPackageFileFlags(content) {
51
51
  res.additionalRegistryUrls = cleanRegistryUrls(additionalRegistryUrls);
52
52
  }
53
53
  if (additionalRequirementsFiles.length) {
54
- if (!res.managerData) {
55
- res.managerData = {};
56
- }
54
+ res.managerData ??= {};
57
55
  res.managerData.requirementsFiles = additionalRequirementsFiles;
58
56
  }
59
57
  if (additionalConstraintsFiles.length) {
60
- if (!res.managerData) {
61
- res.managerData = {};
62
- }
58
+ res.managerData ??= {};
63
59
  res.managerData.constraintsFiles = additionalConstraintsFiles;
64
60
  }
65
61
  return res;
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pip_requirements/common.ts"],"names":[],"mappings":";;AA2BA,0DA0CC;AArED,mDAAsD;AACtD,+CAA0D;AAI1D,SAAS,iBAAiB,CAAC,YAAsB;IAC/C,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QAC9B,0EAA0E;QAC1E,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,IAAA,aAAK,EAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAA,aAAK,EAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QACtE,IAAI,CAAC,qBAAY,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,CAAC;YACtC,OAAO,OAAO,CAAC;QACjB,CAAC;QACD,wCAAwC;QACxC,OAAO,OAAO,CAAC,OAAO,CACpB,IAAA,aAAK,EAAC,sCAAsC,CAAC,EAC7C,CAAC,KAAK,EAAE,EAAE;YACR,MAAM,MAAM,GAAG,KAAK;iBACjB,SAAS,CAAC,CAAC,CAAC;iBACZ,OAAO,CAAC,IAAA,aAAK,EAAC,IAAI,CAAC,EAAE,EAAE,CAAC;iBACxB,OAAO,CAAC,IAAA,aAAK,EAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;YAC5B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YAChC,OAAO,GAAG,IAAI,KAAK,CAAC;QACtB,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CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5B,GAAG,CAAC,YAAY,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAC;IACrD,CAAC;IACD,IAAI,sBAAsB,CAAC,MAAM,EAAE,CAAC;QAClC,GAAG,CAAC,sBAAsB,GAAG,iBAAiB,CAAC,sBAAsB,CAAC,CAAC;IACzE,CAAC;IACD,IAAI,2BAA2B,CAAC,MAAM,EAAE,CAAC;QACvC,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;YACrB,GAAG,CAAC,WAAW,GAAG,EAAE,CAAC;QACvB,CAAC;QACD,GAAG,CAAC,WAAW,CAAC,iBAAiB,GAAG,2BAA2B,CAAC;IAClE,CAAC;IACD,IAAI,0BAA0B,CAAC,MAAM,EAAE,CAAC;QACtC,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;YACrB,GAAG,CAAC,WAAW,GAAG,EAAE,CAAC;QACvB,CAAC;QACD,GAAG,CAAC,WAAW,CAAC,gBAAgB,GAAG,0BAA0B,CAAC;IAChE,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import { GlobalConfig } from '../../../config/global';\nimport { newlineRegex, regEx } from '../../../util/regex';\nimport type { PackageFileContent } from '../types';\nimport type { PipRequirementsManagerData } from './types';\n\nfunction cleanRegistryUrls(registryUrls: string[]): string[] {\n return registryUrls.map((url) => {\n // handle the optional quotes in eg. `--extra-index-url \"https://foo.bar\"`\n const cleaned = url.replace(regEx(/^\"/), '').replace(regEx(/\"$/), '');\n if (!GlobalConfig.get('exposeAllEnv')) {\n return cleaned;\n }\n // interpolate any environment variables\n return cleaned.replace(\n regEx(/(\\$[A-Za-z\\d_]+)|(\\${[A-Za-z\\d_]+})/g),\n (match) => {\n const envvar = match\n .substring(1)\n .replace(regEx(/^{/), '')\n .replace(regEx(/}$/), '');\n const sub = process.env[envvar];\n return sub ?? match;\n },\n );\n });\n}\n\nexport function extractPackageFileFlags(\n content: string,\n): PackageFileContent<PipRequirementsManagerData> {\n let registryUrls: string[] = [];\n const additionalRegistryUrls: string[] = [];\n const additionalRequirementsFiles: string[] = [];\n const additionalConstraintsFiles: string[] = [];\n content.split(newlineRegex).forEach((line) => {\n if (line.startsWith('-i ') || line.startsWith('--index-url ')) {\n registryUrls = [line.split(' ')[1]];\n } else if (line.startsWith('--extra-index-url ')) {\n const extraUrl = line\n .substring('--extra-index-url '.length)\n .split(' ')[0];\n additionalRegistryUrls.push(extraUrl);\n } else if (line.startsWith('-r ')) {\n additionalRequirementsFiles.push(line.split(' ')[1]);\n } else if (line.startsWith('-c ')) {\n additionalConstraintsFiles.push(line.split(' ')[1]);\n }\n });\n\n const res: PackageFileContent<PipRequirementsManagerData> = { deps: [] };\n if (registryUrls.length > 0) {\n res.registryUrls = cleanRegistryUrls(registryUrls);\n }\n if (additionalRegistryUrls.length) {\n res.additionalRegistryUrls = cleanRegistryUrls(additionalRegistryUrls);\n }\n if (additionalRequirementsFiles.length) {\n if (!res.managerData) {\n res.managerData = {};\n }\n res.managerData.requirementsFiles = additionalRequirementsFiles;\n }\n if (additionalConstraintsFiles.length) {\n if (!res.managerData) {\n res.managerData = {};\n }\n res.managerData.constraintsFiles = additionalConstraintsFiles;\n }\n return res;\n}\n"]}
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pip_requirements/common.ts"],"names":[],"mappings":";;AA2BA,0DAsCC;AAjED,mDAAsD;AACtD,+CAA0D;AAI1D,SAAS,iBAAiB,CAAC,YAAsB;IAC/C,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QAC9B,0EAA0E;QAC1E,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,IAAA,aAAK,EAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAA,aAAK,EAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QACtE,IAAI,CAAC,qBAAY,CAAC,GAAG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AC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACxC,CAAC;aAAM,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;YAClC,2BAA2B,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACvD,CAAC;aAAM,IAAI,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;YAClC,0BAA0B,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACtD,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,MAAM,GAAG,GAAmD,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;IACzE,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5B,GAAG,CAAC,YAAY,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAC;IACrD,CAAC;IACD,IAAI,sBAAsB,CAAC,MAAM,EAAE,CAAC;QAClC,GAAG,CAAC,sBAAsB,GAAG,iBAAiB,CAAC,sBAAsB,CAAC,CAAC;IACzE,CAAC;IACD,IAAI,2BAA2B,CAAC,MAAM,EAAE,CAAC;QACvC,GAAG,CAAC,WAAW,KAAK,EAAE,CAAC;QACvB,GAAG,CAAC,WAAW,CAAC,iBAAiB,GAAG,2BAA2B,CAAC;IAClE,CAAC;IACD,IAAI,0BAA0B,CAAC,MAAM,EAAE,CAAC;QACtC,GAAG,CAAC,WAAW,KAAK,EAAE,CAAC;QACvB,GAAG,CAAC,WAAW,CAAC,gBAAgB,GAAG,0BAA0B,CAAC;IAChE,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import { GlobalConfig } from '../../../config/global';\nimport { newlineRegex, regEx } from '../../../util/regex';\nimport type { PackageFileContent } from '../types';\nimport type { PipRequirementsManagerData } from './types';\n\nfunction cleanRegistryUrls(registryUrls: string[]): string[] {\n return registryUrls.map((url) => {\n // handle the optional quotes in eg. `--extra-index-url \"https://foo.bar\"`\n const cleaned = url.replace(regEx(/^\"/), '').replace(regEx(/\"$/), '');\n if (!GlobalConfig.get('exposeAllEnv')) {\n return cleaned;\n }\n // interpolate any environment variables\n return cleaned.replace(\n regEx(/(\\$[A-Za-z\\d_]+)|(\\${[A-Za-z\\d_]+})/g),\n (match) => {\n const envvar = match\n .substring(1)\n .replace(regEx(/^{/), '')\n .replace(regEx(/}$/), '');\n const sub = process.env[envvar];\n return sub ?? match;\n },\n );\n });\n}\n\nexport function extractPackageFileFlags(\n content: string,\n): PackageFileContent<PipRequirementsManagerData> {\n let registryUrls: string[] = [];\n const additionalRegistryUrls: string[] = [];\n const additionalRequirementsFiles: string[] = [];\n const additionalConstraintsFiles: string[] = [];\n content.split(newlineRegex).forEach((line) => {\n if (line.startsWith('-i ') || line.startsWith('--index-url ')) {\n registryUrls = [line.split(' ')[1]];\n } else if (line.startsWith('--extra-index-url ')) {\n const extraUrl = line\n .substring('--extra-index-url '.length)\n .split(' ')[0];\n additionalRegistryUrls.push(extraUrl);\n } else if (line.startsWith('-r ')) {\n additionalRequirementsFiles.push(line.split(' ')[1]);\n } else if (line.startsWith('-c ')) {\n additionalConstraintsFiles.push(line.split(' ')[1]);\n }\n });\n\n const res: PackageFileContent<PipRequirementsManagerData> = { deps: [] };\n if (registryUrls.length > 0) {\n res.registryUrls = cleanRegistryUrls(registryUrls);\n }\n if (additionalRegistryUrls.length) {\n res.additionalRegistryUrls = cleanRegistryUrls(additionalRegistryUrls);\n }\n if (additionalRequirementsFiles.length) {\n res.managerData ??= {};\n res.managerData.requirementsFiles = additionalRequirementsFiles;\n }\n if (additionalConstraintsFiles.length) {\n res.managerData ??= {};\n res.managerData.constraintsFiles = additionalConstraintsFiles;\n }\n return res;\n}\n"]}
@@ -100,7 +100,6 @@ async function updateArtifacts({ packageFileName: pipfileName, newPackageFileCon
100
100
  const execOptions = {
101
101
  cwdFile: pipfileName,
102
102
  docker: {},
103
- userConfiguredEnv: config.env,
104
103
  toolConstraints: [
105
104
  {
106
105
  toolName: 'python',
@@ -1 +1 @@
1
- {"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pipenv/artifacts.ts"],"names":[],"mappings":";;AAwBA,kDAUC;AAoBD,wEAKC;AAED,kDAkBC;AA6CD,0CA+EC;;AA3MD,4DAAmE;AACnE,kEAAkC;AAClC,sEAAoE;AACpE,4CAAyC;AAEzC,6CAA0C;AAE1C,yCAO0B;AAC1B,gDAAwD;AACxD,2CAAkD;AAClD,yDAAgD;AAChD,+CAA4C;AAC5C,2CAA6C;AAC7C,gDAAuD;AAEvD,uCAA+C;AAE/C,SAAgB,mBAAmB,CAAC,GAAW;IAC7C,MAAM,SAAS,GAAG,IAAA,cAAQ,EAAC,GAAG,CAAC,CAAC;IAChC,IAAI,SAAS,EAAE,CAAC;QACd,SAAS,CAAC,QAAQ,GAAG,EAAE,CAAC;QACxB,SAAS,CAAC,QAAQ,GAAG,EAAE,CAAC;QACxB,MAAM,qBAAqB,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC;QAEnD,OAAO,IAAA,iBAAI,EAAC,EAAE,QAAQ,EAAE,qBAAc,CAAC,EAAE,EAAE,GAAG,EAAE,qBAAqB,EAAE,CAAC,CAAC;IAC3E,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,KAAK,UAAU,oCAAoC,CACjD,cAAsB,EACtB,WAAmB;IAEnB,MAAM,OAAO,GAAG,MAAM,IAAA,4BAAkB,EAAC,cAAc,EAAE,WAAW,CAAC,CAAC;IAEtE,OAAO,CACL,OAAO,EAAE,YAAY;QACnB,EAAE,GAAG,CAAC,cAAQ,CAAC;SACd,MAAM,CAAC,YAAE,CAAC,WAAW,CAAC;SACtB,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,YAAE,CAAC,8BAA8B,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAC1E,C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E,CAAC;QACb,qBAAqB;QACrB,IAAI,GAAG,CAAC,OAAO,KAAK,gCAAe,EAAE,CAAC;YACpC,MAAM,GAAG,CAAC;QACZ,CAAC;QACD,eAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,+BAA+B,CAAC,CAAC;QACvD,OAAO;YACL;gBACE,aAAa,EAAE;oBACb,QAAQ,EAAE,YAAY;oBACtB,MAAM,EAAE,GAAG,CAAC,OAAO;iBACpB;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import { pipenv as pipenvDetect } from '@renovatebot/detect-tools';\nimport is from '@sindresorhus/is';\nimport { TEMPORARY_ERROR } from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport type { HostRule } from '../../../types';\nimport { exec } from '../../../util/exec';\nimport type { ExecOptions, ExtraEnv, Opt } from '../../../util/exec/types';\nimport {\n deleteLocalFile,\n ensureCacheDir,\n getParentDir,\n localPathExists,\n readLocalFile,\n writeLocalFile,\n} from '../../../util/fs';\nimport { ensureLocalPath } from '../../../util/fs/util';\nimport { getRepoStatus } from '../../../util/git';\nimport { find } from '../../../util/host-rules';\nimport { regEx } from '../../../util/regex';\nimport { parseUrl } from '../../../util/url';\nimport { PypiDatasource } from '../../datasource/pypi';\nimport type { UpdateArtifact, UpdateArtifactsResult } from '../types';\nimport { extractPackageFile } from './extract';\n\nexport function getMatchingHostRule(url: string): HostRule | null {\n const parsedUrl = parseUrl(url);\n if (parsedUrl) {\n parsedUrl.username = '';\n parsedUrl.password = '';\n const urlWithoutCredentials = parsedUrl.toString();\n\n return find({ hostType: PypiDatasource.id, url: urlWithoutCredentials });\n }\n return null;\n}\n\nasync function findPipfileSourceUrlsWithCredentials(\n pipfileContent: string,\n pipfileName: string,\n): Promise<URL[]> {\n const pipfile = await extractPackageFile(pipfileContent, pipfileName);\n\n return (\n pipfile?.registryUrls\n ?.map(parseUrl)\n .filter(is.urlInstance)\n .filter((url) => is.nonEmptyStringAndNotWhitespace(url.username)) ?? []\n );\n}\n\n/**\n * This will extract the actual variable name from an environment-placeholder:\n * ${USERNAME:-defaultvalue} will yield 'USERNAME'\n */\nexport function extractEnvironmentVariableName(\n credential: string,\n): string | null {\n const match = regEx('([a-z0-9_]+)', 'i').exec(decodeURI(credential));\n return match?.length ? match[0] : null;\n}\n\nexport function addExtraEnvVariable(\n extraEnv: ExtraEnv<unknown>,\n environmentVariableName: string,\n environmentValue: string,\n): void {\n logger.trace(\n `Adding ${environmentVariableName} environment variable for pipenv`,\n );\n if (\n extraEnv[environmentVariableName] &&\n extraEnv[environmentVariableName] !== environmentValue\n ) {\n logger.warn(\n { envVar: environmentVariableName },\n 'Possible misconfiguration, environment variable already set to a different value',\n );\n }\n extraEnv[environmentVariableName] = environmentValue;\n}\n\n/**\n * Pipenv allows configuring source-urls for remote repositories with placeholders for credentials, i.e. http://$USER:$PASS@myprivate.repo\n * if a matching host rule exists for that repository, we need to set the corresponding variables.\n * Simply substituting them in the URL is not an option as it would impact the hash for the resulting Pipfile.lock\n *\n */\nasync function addCredentialsForSourceUrls(\n newPipfileContent: string,\n pipfileName: string,\n extraEnv: ExtraEnv<unknown>,\n): Promise<void> {\n const sourceUrls = await findPipfileSourceUrlsWithCredentials(\n newPipfileContent,\n pipfileName,\n );\n for (const parsedSourceUrl of sourceUrls) {\n logger.trace(`Trying to add credentials for ${parsedSourceUrl.toString()}`);\n const matchingHostRule = getMatchingHostRule(parsedSourceUrl.toString());\n if (matchingHostRule) {\n const usernameVariableName = extractEnvironmentVariableName(\n parsedSourceUrl.username,\n );\n if (matchingHostRule.username && usernameVariableName) {\n addExtraEnvVariable(\n extraEnv,\n usernameVariableName,\n matchingHostRule.username,\n );\n }\n const passwordVariableName = extractEnvironmentVariableName(\n parsedSourceUrl.password,\n );\n if (matchingHostRule.password && passwordVariableName) {\n addExtraEnvVariable(\n extraEnv,\n passwordVariableName,\n matchingHostRule.password,\n );\n }\n }\n }\n}\n\nexport async function updateArtifacts({\n packageFileName: pipfileName,\n newPackageFileContent: newPipfileContent,\n config,\n}: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> {\n logger.debug(`pipenv.updateArtifacts(${pipfileName})`);\n\n const lockFileName = pipfileName + '.lock';\n if (!(await localPathExists(lockFileName))) {\n logger.debug('No Pipfile.lock found');\n return null;\n }\n try {\n await writeLocalFile(pipfileName, newPipfileContent);\n if (config.isLockFileMaintenance) {\n await deleteLocalFile(lockFileName);\n }\n const cmd = 'pipenv lock';\n const pipfileDir = getParentDir(ensureLocalPath(pipfileName));\n const tagConstraint =\n config.constraints?.python ??\n (await pipenvDetect.getPythonConstraint(pipfileDir));\n const pipenvConstraint =\n config.constraints?.pipenv ??\n (await pipenvDetect.getPipenvConstraint(pipfileDir));\n const extraEnv: Opt<ExtraEnv> = {\n PIPENV_CACHE_DIR: await ensureCacheDir('pipenv'),\n PIP_CACHE_DIR: await ensureCacheDir('pip'),\n WORKON_HOME: await ensureCacheDir('virtualenvs'),\n };\n const execOptions: ExecOptions = {\n cwdFile: pipfileName,\n docker: {},\n userConfiguredEnv: config.env,\n toolConstraints: [\n {\n toolName: 'python',\n constraint: tagConstraint,\n },\n {\n toolName: 'pipenv',\n constraint: pipenvConstraint,\n },\n ],\n };\n await addCredentialsForSourceUrls(newPipfileContent, pipfileName, extraEnv);\n execOptions.extraEnv = extraEnv;\n\n logger.trace({ cmd }, 'pipenv lock command');\n await exec(cmd, execOptions);\n const status = await getRepoStatus();\n if (!status?.modified.includes(lockFileName)) {\n return null;\n }\n logger.debug('Returning updated Pipfile.lock');\n return [\n {\n file: {\n type: 'addition',\n path: lockFileName,\n contents: await readLocalFile(lockFileName, 'utf8'),\n },\n },\n ];\n } catch (err) {\n // istanbul ignore if\n if (err.message === TEMPORARY_ERROR) {\n throw err;\n }\n logger.debug({ err }, 'Failed to update Pipfile.lock');\n return [\n {\n artifactError: {\n lockFile: lockFileName,\n stderr: err.message,\n },\n },\n ];\n }\n}\n"]}
1
+ {"version":3,"file":"artifacts.js","s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GAAG,EAAE,EAAE,+BAA+B,CAAC,CAAC;QACvD,OAAO;YACL;gBACE,aAAa,EAAE;oBACb,QAAQ,EAAE,YAAY;oBACtB,MAAM,EAAE,GAAG,CAAC,OAAO;iBACpB;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import { pipenv as pipenvDetect } from '@renovatebot/detect-tools';\nimport is from '@sindresorhus/is';\nimport { TEMPORARY_ERROR } from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport type { HostRule } from '../../../types';\nimport { exec } from '../../../util/exec';\nimport type { ExecOptions, ExtraEnv, Opt } from '../../../util/exec/types';\nimport {\n deleteLocalFile,\n ensureCacheDir,\n getParentDir,\n localPathExists,\n readLocalFile,\n writeLocalFile,\n} from '../../../util/fs';\nimport { ensureLocalPath } from '../../../util/fs/util';\nimport { getRepoStatus } from '../../../util/git';\nimport { find } from '../../../util/host-rules';\nimport { regEx } from '../../../util/regex';\nimport { parseUrl } from '../../../util/url';\nimport { PypiDatasource } from '../../datasource/pypi';\nimport type { UpdateArtifact, UpdateArtifactsResult } from '../types';\nimport { extractPackageFile } from './extract';\n\nexport function getMatchingHostRule(url: string): HostRule | null {\n const parsedUrl = parseUrl(url);\n if (parsedUrl) {\n parsedUrl.username = '';\n parsedUrl.password = '';\n const urlWithoutCredentials = parsedUrl.toString();\n\n return find({ hostType: PypiDatasource.id, url: urlWithoutCredentials });\n }\n return null;\n}\n\nasync function findPipfileSourceUrlsWithCredentials(\n pipfileContent: string,\n pipfileName: string,\n): Promise<URL[]> {\n const pipfile = await extractPackageFile(pipfileContent, pipfileName);\n\n return (\n pipfile?.registryUrls\n ?.map(parseUrl)\n .filter(is.urlInstance)\n .filter((url) => is.nonEmptyStringAndNotWhitespace(url.username)) ?? []\n );\n}\n\n/**\n * This will extract the actual variable name from an environment-placeholder:\n * ${USERNAME:-defaultvalue} will yield 'USERNAME'\n */\nexport function extractEnvironmentVariableName(\n credential: string,\n): string | null {\n const match = regEx('([a-z0-9_]+)', 'i').exec(decodeURI(credential));\n return match?.length ? match[0] : null;\n}\n\nexport function addExtraEnvVariable(\n extraEnv: ExtraEnv<unknown>,\n environmentVariableName: string,\n environmentValue: string,\n): void {\n logger.trace(\n `Adding ${environmentVariableName} environment variable for pipenv`,\n );\n if (\n extraEnv[environmentVariableName] &&\n extraEnv[environmentVariableName] !== environmentValue\n ) {\n logger.warn(\n { envVar: environmentVariableName },\n 'Possible misconfiguration, environment variable already set to a different value',\n );\n }\n extraEnv[environmentVariableName] = environmentValue;\n}\n\n/**\n * Pipenv allows configuring source-urls for remote repositories with placeholders for credentials, i.e. http://$USER:$PASS@myprivate.repo\n * if a matching host rule exists for that repository, we need to set the corresponding variables.\n * Simply substituting them in the URL is not an option as it would impact the hash for the resulting Pipfile.lock\n *\n */\nasync function addCredentialsForSourceUrls(\n newPipfileContent: string,\n pipfileName: string,\n extraEnv: ExtraEnv<unknown>,\n): Promise<void> {\n const sourceUrls = await findPipfileSourceUrlsWithCredentials(\n newPipfileContent,\n pipfileName,\n );\n for (const parsedSourceUrl of sourceUrls) {\n logger.trace(`Trying to add credentials for ${parsedSourceUrl.toString()}`);\n const matchingHostRule = getMatchingHostRule(parsedSourceUrl.toString());\n if (matchingHostRule) {\n const usernameVariableName = extractEnvironmentVariableName(\n parsedSourceUrl.username,\n );\n if (matchingHostRule.username && usernameVariableName) {\n addExtraEnvVariable(\n extraEnv,\n usernameVariableName,\n matchingHostRule.username,\n );\n }\n const passwordVariableName = extractEnvironmentVariableName(\n parsedSourceUrl.password,\n );\n if (matchingHostRule.password && passwordVariableName) {\n addExtraEnvVariable(\n extraEnv,\n passwordVariableName,\n matchingHostRule.password,\n );\n }\n }\n }\n}\n\nexport async function updateArtifacts({\n packageFileName: pipfileName,\n newPackageFileContent: newPipfileContent,\n config,\n}: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> {\n logger.debug(`pipenv.updateArtifacts(${pipfileName})`);\n\n const lockFileName = pipfileName + '.lock';\n if (!(await localPathExists(lockFileName))) {\n logger.debug('No Pipfile.lock found');\n return null;\n }\n try {\n await writeLocalFile(pipfileName, newPipfileContent);\n if (config.isLockFileMaintenance) {\n await deleteLocalFile(lockFileName);\n }\n const cmd = 'pipenv lock';\n const pipfileDir = getParentDir(ensureLocalPath(pipfileName));\n const tagConstraint =\n config.constraints?.python ??\n (await pipenvDetect.getPythonConstraint(pipfileDir));\n const pipenvConstraint =\n config.constraints?.pipenv ??\n (await pipenvDetect.getPipenvConstraint(pipfileDir));\n const extraEnv: Opt<ExtraEnv> = {\n PIPENV_CACHE_DIR: await ensureCacheDir('pipenv'),\n PIP_CACHE_DIR: await ensureCacheDir('pip'),\n WORKON_HOME: await ensureCacheDir('virtualenvs'),\n };\n const execOptions: ExecOptions = {\n cwdFile: pipfileName,\n docker: {},\n toolConstraints: [\n {\n toolName: 'python',\n constraint: tagConstraint,\n },\n {\n toolName: 'pipenv',\n constraint: pipenvConstraint,\n },\n ],\n };\n await addCredentialsForSourceUrls(newPipfileContent, pipfileName, extraEnv);\n execOptions.extraEnv = extraEnv;\n\n logger.trace({ cmd }, 'pipenv lock command');\n await exec(cmd, execOptions);\n const status = await getRepoStatus();\n if (!status?.modified.includes(lockFileName)) {\n return null;\n }\n logger.debug('Returning updated Pipfile.lock');\n return [\n {\n file: {\n type: 'addition',\n path: lockFileName,\n contents: await readLocalFile(lockFileName, 'utf8'),\n },\n },\n ];\n } catch (err) {\n // istanbul ignore if\n if (err.message === TEMPORARY_ERROR) {\n throw err;\n }\n logger.debug({ err }, 'Failed to update Pipfile.lock');\n return [\n {\n artifactError: {\n lockFile: lockFileName,\n stderr: err.message,\n },\n },\n ];\n }\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import type { UpdateArtifact, UpdateArtifactsResult } from '../types';
2
+ export declare const commandLock = "pixi lock --no-progress --color=never --quiet";
3
+ export declare function updateArtifacts({ packageFileName, updatedDeps, newPackageFileContent, config, }: UpdateArtifact): Promise<UpdateArtifactsResult[] | null>;
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.commandLock = void 0;
4
+ exports.updateArtifacts = updateArtifacts;
5
+ const tslib_1 = require("tslib");
6
+ const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
7
+ const error_messages_1 = require("../../../constants/error-messages");
8
+ const logger_1 = require("../../../logger");
9
+ const exec_1 = require("../../../util/exec");
10
+ const fs_1 = require("../../../util/fs");
11
+ const extract_1 = require("./extract");
12
+ exports.commandLock = 'pixi lock --no-progress --color=never --quiet';
13
+ async function updateArtifacts({ packageFileName, updatedDeps, newPackageFileContent, config, }) {
14
+ logger_1.logger.debug(`pixi.updateArtifacts(${packageFileName})`);
15
+ const { isLockFileMaintenance } = config;
16
+ if (!is_1.default.nonEmptyArray(updatedDeps) && !isLockFileMaintenance) {
17
+ logger_1.logger.debug('No updated pixi deps - returning null');
18
+ return null;
19
+ }
20
+ const lockFileName = (0, fs_1.getSiblingFileName)(packageFileName, 'pixi.lock');
21
+ const existingLockFileContent = await (0, fs_1.readLocalFile)(lockFileName, 'utf8');
22
+ if (!existingLockFileContent) {
23
+ logger_1.logger.debug(`No lock file found`);
24
+ return null;
25
+ }
26
+ logger_1.logger.trace(`Updating ${lockFileName}`);
27
+ const cmd = [exports.commandLock];
28
+ const pixiConfig = (0, extract_1.getUserPixiConfig)(newPackageFileContent, packageFileName);
29
+ const constraint = config.constraints?.pixi ?? pixiConfig?.project['requires-pixi'];
30
+ try {
31
+ await (0, fs_1.writeLocalFile)(packageFileName, newPackageFileContent);
32
+ if (isLockFileMaintenance) {
33
+ await (0, fs_1.deleteLocalFile)(lockFileName);
34
+ }
35
+ // https://pixi.sh/latest/features/environment/#caching-packages
36
+ const PIXI_CACHE_DIR = await (0, fs_1.ensureCacheDir)('pixi');
37
+ const extraEnv = {
38
+ PIXI_CACHE_DIR,
39
+ RATTLER_CACHE_DIR: PIXI_CACHE_DIR,
40
+ };
41
+ const execOptions = {
42
+ cwdFile: packageFileName,
43
+ extraEnv,
44
+ docker: {},
45
+ toolConstraints: [{ toolName: 'pixi', constraint }],
46
+ };
47
+ await (0, exec_1.exec)(cmd, execOptions);
48
+ const newPixiLockContent = await (0, fs_1.readLocalFile)(lockFileName, 'utf8');
49
+ if (existingLockFileContent === newPixiLockContent) {
50
+ logger_1.logger.debug(`${lockFileName} is unchanged`);
51
+ return null;
52
+ }
53
+ return [
54
+ {
55
+ file: {
56
+ type: 'addition',
57
+ path: lockFileName,
58
+ contents: newPixiLockContent,
59
+ },
60
+ },
61
+ ];
62
+ }
63
+ catch (err) {
64
+ if (err.message === error_messages_1.TEMPORARY_ERROR) {
65
+ throw err;
66
+ }
67
+ logger_1.logger.debug({ err }, `Failed to update ${lockFileName} file`);
68
+ return [
69
+ {
70
+ artifactError: {
71
+ lockFile: lockFileName,
72
+ stderr: `${err}`,
73
+ },
74
+ },
75
+ ];
76
+ }
77
+ }
78
+ //# sourceMappingURL=artifacts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pixi/artifacts.ts"],"names":[],"mappings":";;;AAiBA,0CA8EC;;AA/FD,kEAAkC;AAClC,sEAAoE;AACpE,4CAAyC;AACzC,6CAA0C;AAE1C,yCAM0B;AAE1B,uCAA8C;AAEjC,QAAA,WAAW,GAAG,+CAA+C,CAAC;AAEpE,KAAK,UAAU,eAAe,CAAC,EACpC,eAAe,EACf,WAAW,EACX,qBAAqB,EACrB,MAAM,GACS;IACf,eAAM,CAAC,KAAK,CAAC,wBAAwB,eAAe,GAAG,CAAC,CAAC;IACzD,MAAM,EAAE,qBAAqB,EAAE,GAAG,MAAM,CAAC;IAEzC,IAAI,CAAC,YAAE,CAAC,aAAa,CAAC,WAAW,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC7D,eAAM,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;QACtD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,M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AAK,kBAAkB,EAAE,CAAC;YACnD,eAAM,CAAC,KAAK,CAAC,GAAG,YAAY,eAAe,CAAC,CAAC;YAC7C,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO;YACL;gBACE,IAAI,EAAE;oBACJ,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,YAAY;oBAClB,QAAQ,EAAE,kBAAkB;iBAC7B;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,GAAG,CAAC,OAAO,KAAK,gCAAe,EAAE,CAAC;YACpC,MAAM,GAAG,CAAC;QACZ,CAAC;QAED,eAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,oBAAoB,YAAY,OAAO,CAAC,CAAC;QAC/D,OAAO;YACL;gBACE,aAAa,EAAE;oBACb,QAAQ,EAAE,YAAY;oBACtB,MAAM,EAAE,GAAG,GAAG,EAAE;iBACjB;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { TEMPORARY_ERROR } from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport { exec } from '../../../util/exec';\nimport type { ExecOptions } from '../../../util/exec/types';\nimport {\n deleteLocalFile,\n ensureCacheDir,\n getSiblingFileName,\n readLocalFile,\n writeLocalFile,\n} from '../../../util/fs';\nimport type { UpdateArtifact, UpdateArtifactsResult } from '../types';\nimport { getUserPixiConfig } from './extract';\n\nexport const commandLock = 'pixi lock --no-progress --color=never --quiet';\n\nexport async function updateArtifacts({\n packageFileName,\n updatedDeps,\n newPackageFileContent,\n config,\n}: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> {\n logger.debug(`pixi.updateArtifacts(${packageFileName})`);\n const { isLockFileMaintenance } = config;\n\n if (!is.nonEmptyArray(updatedDeps) && !isLockFileMaintenance) {\n logger.debug('No updated pixi deps - returning null');\n return null;\n }\n\n const lockFileName = getSiblingFileName(packageFileName, 'pixi.lock');\n const existingLockFileContent = await readLocalFile(lockFileName, 'utf8');\n if (!existingLockFileContent) {\n logger.debug(`No lock file found`);\n return null;\n }\n logger.trace(`Updating ${lockFileName}`);\n\n const cmd = [commandLock];\n\n const pixiConfig = getUserPixiConfig(newPackageFileContent, packageFileName);\n\n const constraint =\n config.constraints?.pixi ?? pixiConfig?.project['requires-pixi'];\n\n try {\n await writeLocalFile(packageFileName, newPackageFileContent);\n if (isLockFileMaintenance) {\n await deleteLocalFile(lockFileName);\n }\n\n // https://pixi.sh/latest/features/environment/#caching-packages\n const PIXI_CACHE_DIR = await ensureCacheDir('pixi');\n const extraEnv = {\n PIXI_CACHE_DIR,\n RATTLER_CACHE_DIR: PIXI_CACHE_DIR,\n };\n\n const execOptions: ExecOptions = {\n cwdFile: packageFileName,\n extraEnv,\n docker: {},\n toolConstraints: [{ toolName: 'pixi', constraint }],\n };\n await exec(cmd, execOptions);\n const newPixiLockContent = await readLocalFile(lockFileName, 'utf8');\n if (existingLockFileContent === newPixiLockContent) {\n logger.debug(`${lockFileName} is unchanged`);\n return null;\n }\n return [\n {\n file: {\n type: 'addition',\n path: lockFileName,\n contents: newPixiLockContent,\n },\n },\n ];\n } catch (err) {\n if (err.message === TEMPORARY_ERROR) {\n throw err;\n }\n\n logger.debug({ err }, `Failed to update ${lockFileName} file`);\n return [\n {\n artifactError: {\n lockFile: lockFileName,\n stderr: `${err}`,\n },\n },\n ];\n }\n}\n"]}
@@ -0,0 +1,4 @@
1
+ import type { PackageFileContent } from '../types';
2
+ import { type PixiConfig } from './schema';
3
+ export declare function getUserPixiConfig(content: string, packageFile: string): null | PixiConfig;
4
+ export declare function extractPackageFile(content: string, packageFile: string): Promise<PackageFileContent | null>;
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getUserPixiConfig = getUserPixiConfig;
4
+ exports.extractPackageFile = extractPackageFile;
5
+ const tslib_1 = require("tslib");
6
+ const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
7
+ const zod_1 = require("zod");
8
+ const logger_1 = require("../../../logger");
9
+ const array_1 = require("../../../util/array");
10
+ const fs_1 = require("../../../util/fs");
11
+ const result_1 = require("../../../util/result");
12
+ const schema_utils_1 = require("../../../util/schema-utils");
13
+ const url_1 = require("../../../util/url");
14
+ const common_1 = require("../../datasource/conda/common");
15
+ const schema_1 = require("../pep621/schema");
16
+ const schema_2 = require("./schema");
17
+ const PyProjectToml = schema_utils_1.Toml.pipe(schema_1.PyProjectSchema);
18
+ function getUserPixiConfig(content, packageFile) {
19
+ if (packageFile === 'pyproject.toml' ||
20
+ packageFile.endsWith('/pyproject.toml')) {
21
+ const { val, err } = result_1.Result.parse(content, PyProjectToml).unwrap();
22
+ if (err) {
23
+ logger_1.logger.debug({ packageFile, err }, `error parsing ${packageFile}`);
24
+ return null;
25
+ }
26
+ return val.tool?.pixi ?? null;
27
+ }
28
+ if (packageFile === 'pixi.toml' || packageFile.endsWith('/pixi.toml')) {
29
+ const { val, err } = result_1.Result.parse(content, schema_2.PixiToml).unwrap();
30
+ if (err) {
31
+ logger_1.logger.debug({ packageFile, err }, `error parsing ${packageFile}`);
32
+ return null;
33
+ }
34
+ return val;
35
+ }
36
+ const { val, err } = result_1.Result.parse(content, zod_1.z.union([schema_2.PixiToml, PyProjectToml.transform((p) => p.tool?.pixi)])).unwrap();
37
+ if (err) {
38
+ logger_1.logger.debug({ packageFile, err }, `error parsing ${packageFile}`);
39
+ return null;
40
+ }
41
+ return val ?? null;
42
+ }
43
+ async function extractPackageFile(content, packageFile) {
44
+ logger_1.logger.trace(`pixi.extractPackageFile(${packageFile})`);
45
+ const val = getUserPixiConfig(content, packageFile);
46
+ if (!val) {
47
+ return null;
48
+ }
49
+ const lockfileName = (0, fs_1.getSiblingFileName)(packageFile, 'pixi.lock');
50
+ const lockFiles = [];
51
+ if (await (0, fs_1.localPathExists)(lockfileName)) {
52
+ lockFiles.push(lockfileName);
53
+ }
54
+ const project = val.project;
55
+ const channelPriority = project['channel-priority'];
56
+ let registryStrategy;
57
+ if (channelPriority === 'disabled') {
58
+ registryStrategy = 'merge';
59
+ }
60
+ // resolve channels and build registry urls for each channel with order
61
+ const conda = [];
62
+ for (const item of val.conda) {
63
+ conda.push(addRegistryUrls({
64
+ ...item,
65
+ channels: project.channels,
66
+ registryStrategy,
67
+ }));
68
+ }
69
+ for (const item of val.feature.conda) {
70
+ conda.push(addRegistryUrls({
71
+ ...item,
72
+ registryStrategy,
73
+ channels: [...(0, array_1.coerceArray)(item.channels), ...project.channels],
74
+ }));
75
+ }
76
+ return {
77
+ lockFiles,
78
+ deps: [conda, val.pypi, val.feature.pypi].flat(),
79
+ };
80
+ }
81
+ function addRegistryUrls(item) {
82
+ const channels = orderChannels(item.channels);
83
+ if (item.channel) {
84
+ return {
85
+ ...item,
86
+ channels,
87
+ registryUrls: [channelToRegistryUrl(item.channel)],
88
+ };
89
+ }
90
+ if (channels.length === 0) {
91
+ return {
92
+ ...item,
93
+ channels,
94
+ skipStage: 'extract',
95
+ skipReason: 'unknown-registry',
96
+ };
97
+ }
98
+ const registryUrls = [];
99
+ for (const channel of channels) {
100
+ registryUrls.push(channelToRegistryUrl(channel));
101
+ }
102
+ return {
103
+ ...item,
104
+ channels,
105
+ registryUrls,
106
+ };
107
+ }
108
+ function channelToRegistryUrl(channel) {
109
+ if ((0, url_1.isHttpUrl)(channel)) {
110
+ return (0, url_1.ensureTrailingSlash)(channel);
111
+ }
112
+ return (0, url_1.ensureTrailingSlash)((0, url_1.joinUrlParts)(common_1.defaultRegistryUrl, channel));
113
+ }
114
+ function orderChannels(channels = []) {
115
+ return channels
116
+ .map((channel, index) => {
117
+ if (is_1.default.string(channel)) {
118
+ return { channel, priority: 0, index };
119
+ }
120
+ return { ...channel, index: 0 };
121
+ })
122
+ .toSorted((a, b) => {
123
+ // first based on priority then based on index
124
+ if (a.priority !== b.priority) {
125
+ return b.priority - a.priority;
126
+ }
127
+ return a.index - b.index;
128
+ })
129
+ .map((c) => c.channel);
130
+ }
131
+ //# sourceMappingURL=extract.js.map