renovate 42.3.0 → 42.4.1

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 (732) hide show
  1. package/dist/config/decrypt.js +13 -14
  2. package/dist/config/decrypt.js.map +1 -1
  3. package/dist/config/massage.js +6 -7
  4. package/dist/config/massage.js.map +1 -1
  5. package/dist/config/migrate-validate.js +3 -3
  6. package/dist/config/migrate-validate.js.map +1 -1
  7. package/dist/config/migration.js +19 -20
  8. package/dist/config/migration.js.map +1 -1
  9. package/dist/config/migrations/base/abstract-migration.js +5 -6
  10. package/dist/config/migrations/base/abstract-migration.js.map +1 -1
  11. package/dist/config/migrations/custom/automerge-major-migration.js +2 -3
  12. package/dist/config/migrations/custom/automerge-major-migration.js.map +1 -1
  13. package/dist/config/migrations/custom/automerge-migration.js +4 -5
  14. package/dist/config/migrations/custom/automerge-migration.js.map +1 -1
  15. package/dist/config/migrations/custom/automerge-minor-migration.js +2 -3
  16. package/dist/config/migrations/custom/automerge-minor-migration.js.map +1 -1
  17. package/dist/config/migrations/custom/automerge-patch-migration.js +2 -3
  18. package/dist/config/migrations/custom/automerge-patch-migration.js.map +1 -1
  19. package/dist/config/migrations/custom/automerge-type-migration.js +2 -3
  20. package/dist/config/migrations/custom/automerge-type-migration.js.map +1 -1
  21. package/dist/config/migrations/custom/base-branch-migration.js +3 -4
  22. package/dist/config/migrations/custom/base-branch-migration.js.map +1 -1
  23. package/dist/config/migrations/custom/branch-name-migration.js +2 -3
  24. package/dist/config/migrations/custom/branch-name-migration.js.map +1 -1
  25. package/dist/config/migrations/custom/branch-prefix-migration.js +2 -3
  26. package/dist/config/migrations/custom/branch-prefix-migration.js.map +1 -1
  27. package/dist/config/migrations/custom/compatibility-migration.js +2 -3
  28. package/dist/config/migrations/custom/compatibility-migration.js.map +1 -1
  29. package/dist/config/migrations/custom/composer-ignore-platform-reqs-migration.js +2 -3
  30. package/dist/config/migrations/custom/composer-ignore-platform-reqs-migration.js.map +1 -1
  31. package/dist/config/migrations/custom/custom-managers-migration.js +2 -3
  32. package/dist/config/migrations/custom/custom-managers-migration.js.map +1 -1
  33. package/dist/config/migrations/custom/datasource-migration.js +2 -3
  34. package/dist/config/migrations/custom/datasource-migration.js.map +1 -1
  35. package/dist/config/migrations/custom/dep-types-migration.js +4 -5
  36. package/dist/config/migrations/custom/dep-types-migration.js.map +1 -1
  37. package/dist/config/migrations/custom/enabled-managers-migration.js +2 -3
  38. package/dist/config/migrations/custom/enabled-managers-migration.js.map +1 -1
  39. package/dist/config/migrations/custom/extends-migration.js +4 -5
  40. package/dist/config/migrations/custom/extends-migration.js.map +1 -1
  41. package/dist/config/migrations/custom/fetch-release-notes-migration.js +2 -3
  42. package/dist/config/migrations/custom/fetch-release-notes-migration.js.map +1 -1
  43. package/dist/config/migrations/custom/file-match-migration.js +3 -4
  44. package/dist/config/migrations/custom/file-match-migration.js.map +1 -1
  45. package/dist/config/migrations/custom/host-rules-migration.js +6 -7
  46. package/dist/config/migrations/custom/host-rules-migration.js.map +1 -1
  47. package/dist/config/migrations/custom/ignore-npmrc-file-migration.js +2 -3
  48. package/dist/config/migrations/custom/ignore-npmrc-file-migration.js.map +1 -1
  49. package/dist/config/migrations/custom/include-forks-migration.js +2 -3
  50. package/dist/config/migrations/custom/include-forks-migration.js.map +1 -1
  51. package/dist/config/migrations/custom/match-datasources-migration.js +2 -3
  52. package/dist/config/migrations/custom/match-datasources-migration.js.map +1 -1
  53. package/dist/config/migrations/custom/match-managers-migration.js +2 -3
  54. package/dist/config/migrations/custom/match-managers-migration.js.map +1 -1
  55. package/dist/config/migrations/custom/match-strings-migration.js +2 -3
  56. package/dist/config/migrations/custom/match-strings-migration.js.map +1 -1
  57. package/dist/config/migrations/custom/package-files-migration.js +6 -7
  58. package/dist/config/migrations/custom/package-files-migration.js.map +1 -1
  59. package/dist/config/migrations/custom/package-rules-migration.js +15 -16
  60. package/dist/config/migrations/custom/package-rules-migration.js.map +1 -1
  61. package/dist/config/migrations/custom/packages-migration.js +3 -4
  62. package/dist/config/migrations/custom/packages-migration.js.map +1 -1
  63. package/dist/config/migrations/custom/path-rules-migration.js +3 -4
  64. package/dist/config/migrations/custom/path-rules-migration.js.map +1 -1
  65. package/dist/config/migrations/custom/pin-versions-migration.js +2 -3
  66. package/dist/config/migrations/custom/pin-versions-migration.js.map +1 -1
  67. package/dist/config/migrations/custom/platform-commit-migration.js +2 -3
  68. package/dist/config/migrations/custom/platform-commit-migration.js.map +1 -1
  69. package/dist/config/migrations/custom/post-update-options-migration.js +2 -3
  70. package/dist/config/migrations/custom/post-update-options-migration.js.map +1 -1
  71. package/dist/config/migrations/custom/rebase-stale-prs-migration.js +2 -3
  72. package/dist/config/migrations/custom/rebase-stale-prs-migration.js.map +1 -1
  73. package/dist/config/migrations/custom/recreate-closed-migration.js +2 -3
  74. package/dist/config/migrations/custom/recreate-closed-migration.js.map +1 -1
  75. package/dist/config/migrations/custom/renovate-fork-migration.js +2 -3
  76. package/dist/config/migrations/custom/renovate-fork-migration.js.map +1 -1
  77. package/dist/config/migrations/custom/schedule-migration.js +4 -4
  78. package/dist/config/migrations/custom/schedule-migration.js.map +1 -1
  79. package/dist/config/migrations/custom/semantic-commits-migration.js +2 -3
  80. package/dist/config/migrations/custom/semantic-commits-migration.js.map +1 -1
  81. package/dist/config/migrations/custom/semantic-prefix-migration.js +2 -3
  82. package/dist/config/migrations/custom/semantic-prefix-migration.js.map +1 -1
  83. package/dist/config/migrations/custom/stability-days-migration.js +2 -3
  84. package/dist/config/migrations/custom/stability-days-migration.js.map +1 -1
  85. package/dist/config/migrations/custom/suppress-notifications-migration.js +2 -3
  86. package/dist/config/migrations/custom/suppress-notifications-migration.js.map +1 -1
  87. package/dist/config/migrations/custom/unpublish-safe-migration.js +2 -3
  88. package/dist/config/migrations/custom/unpublish-safe-migration.js.map +1 -1
  89. package/dist/config/migrations/migrations-service.js +2 -3
  90. package/dist/config/migrations/migrations-service.js.map +1 -1
  91. package/dist/config/presets/github/index.js +2 -3
  92. package/dist/config/presets/github/index.js.map +1 -1
  93. package/dist/config/presets/gitlab/index.js +2 -3
  94. package/dist/config/presets/gitlab/index.js.map +1 -1
  95. package/dist/config/presets/index.js +8 -8
  96. package/dist/config/presets/index.js.map +1 -1
  97. package/dist/config/presets/parse.js +2 -3
  98. package/dist/config/presets/parse.js.map +1 -1
  99. package/dist/config/secrets.js +3 -4
  100. package/dist/config/secrets.js.map +1 -1
  101. package/dist/config/validation-helpers/match-base-branches.js +2 -3
  102. package/dist/config/validation-helpers/match-base-branches.js.map +1 -1
  103. package/dist/config/validation-helpers/regex-glob-matchers.js +2 -3
  104. package/dist/config/validation-helpers/regex-glob-matchers.js.map +1 -1
  105. package/dist/config/validation-helpers/utils.js +6 -6
  106. package/dist/config/validation-helpers/utils.js.map +1 -1
  107. package/dist/config/validation.js +29 -29
  108. package/dist/config/validation.js.map +1 -1
  109. package/dist/instrumentation/reporting.js +7 -8
  110. package/dist/instrumentation/reporting.js.map +1 -1
  111. package/dist/instrumentation/utils.js +2 -3
  112. package/dist/instrumentation/utils.js.map +1 -1
  113. package/dist/logger/err-serializer.js +2 -2
  114. package/dist/logger/err-serializer.js.map +1 -1
  115. package/dist/logger/index.js +3 -3
  116. package/dist/logger/index.js.map +1 -1
  117. package/dist/logger/renovate-logger.js +4 -5
  118. package/dist/logger/renovate-logger.js.map +1 -1
  119. package/dist/logger/utils.js +19 -19
  120. package/dist/logger/utils.js.map +1 -1
  121. package/dist/modules/datasource/aws-eks-addon/index.js +2 -2
  122. package/dist/modules/datasource/aws-eks-addon/index.js.map +1 -1
  123. package/dist/modules/datasource/bazel/index.js +2 -2
  124. package/dist/modules/datasource/bazel/index.js.map +1 -1
  125. package/dist/modules/datasource/bitrise/index.js +2 -2
  126. package/dist/modules/datasource/bitrise/index.js.map +1 -1
  127. package/dist/modules/datasource/common.js +4 -4
  128. package/dist/modules/datasource/common.js.map +1 -1
  129. package/dist/modules/datasource/conan/index.js +3 -3
  130. package/dist/modules/datasource/conan/index.js.map +1 -1
  131. package/dist/modules/datasource/custom/formats/html.js +2 -5
  132. package/dist/modules/datasource/custom/formats/html.js.map +1 -1
  133. package/dist/modules/datasource/custom/index.js +2 -3
  134. package/dist/modules/datasource/custom/index.js.map +1 -1
  135. package/dist/modules/datasource/custom/utils.js +4 -4
  136. package/dist/modules/datasource/custom/utils.js.map +1 -1
  137. package/dist/modules/datasource/dart-version/index.js +2 -3
  138. package/dist/modules/datasource/dart-version/index.js.map +1 -1
  139. package/dist/modules/datasource/deno/index.js +2 -2
  140. package/dist/modules/datasource/deno/index.js.map +1 -1
  141. package/dist/modules/datasource/docker/common.js +5 -5
  142. package/dist/modules/datasource/docker/common.js.map +1 -1
  143. package/dist/modules/datasource/docker/index.js +6 -6
  144. package/dist/modules/datasource/docker/index.js.map +1 -1
  145. package/dist/modules/datasource/endoflife-date/index.js +2 -2
  146. package/dist/modules/datasource/endoflife-date/index.js.map +1 -1
  147. package/dist/modules/datasource/galaxy/index.js +2 -2
  148. package/dist/modules/datasource/galaxy/index.js.map +1 -1
  149. package/dist/modules/datasource/galaxy-collection/index.js +2 -2
  150. package/dist/modules/datasource/galaxy-collection/index.js.map +1 -1
  151. package/dist/modules/datasource/git-refs/base.js +2 -2
  152. package/dist/modules/datasource/git-refs/base.js.map +1 -1
  153. package/dist/modules/datasource/github-release-attachments/index.js +2 -2
  154. package/dist/modules/datasource/github-release-attachments/index.js.map +1 -1
  155. package/dist/modules/datasource/github-releases/index.js +2 -3
  156. package/dist/modules/datasource/github-releases/index.js.map +1 -1
  157. package/dist/modules/datasource/github-tags/index.js +2 -3
  158. package/dist/modules/datasource/github-tags/index.js.map +1 -1
  159. package/dist/modules/datasource/go/goproxy-parser.js +3 -3
  160. package/dist/modules/datasource/go/goproxy-parser.js.map +1 -1
  161. package/dist/modules/datasource/go/index.js +2 -2
  162. package/dist/modules/datasource/go/index.js.map +1 -1
  163. package/dist/modules/datasource/go/releases-goproxy.js +3 -3
  164. package/dist/modules/datasource/go/releases-goproxy.js.map +1 -1
  165. package/dist/modules/datasource/hackage/index.js +2 -2
  166. package/dist/modules/datasource/hackage/index.js.map +1 -1
  167. package/dist/modules/datasource/hex/schema.js +2 -3
  168. package/dist/modules/datasource/hex/schema.js.map +1 -1
  169. package/dist/modules/datasource/hexpm-bob/index.js +2 -2
  170. package/dist/modules/datasource/hexpm-bob/index.js.map +1 -1
  171. package/dist/modules/datasource/index.js +14 -14
  172. package/dist/modules/datasource/index.js.map +1 -1
  173. package/dist/modules/datasource/jsr/index.js +2 -2
  174. package/dist/modules/datasource/jsr/index.js.map +1 -1
  175. package/dist/modules/datasource/jsr/util.js +3 -4
  176. package/dist/modules/datasource/jsr/util.js.map +1 -1
  177. package/dist/modules/datasource/metadata.js +5 -5
  178. package/dist/modules/datasource/metadata.js.map +1 -1
  179. package/dist/modules/datasource/npm/get.js +2 -2
  180. package/dist/modules/datasource/npm/get.js.map +1 -1
  181. package/dist/modules/datasource/npm/npmrc.js +7 -7
  182. package/dist/modules/datasource/npm/npmrc.js.map +1 -1
  183. package/dist/modules/datasource/nuget/v3.js +2 -2
  184. package/dist/modules/datasource/nuget/v3.js.map +1 -1
  185. package/dist/modules/datasource/packagist/index.js +2 -2
  186. package/dist/modules/datasource/packagist/index.js.map +1 -1
  187. package/dist/modules/datasource/packagist/schema.js +3 -4
  188. package/dist/modules/datasource/packagist/schema.js.map +1 -1
  189. package/dist/modules/datasource/pypi/index.js +2 -2
  190. package/dist/modules/datasource/pypi/index.js.map +1 -1
  191. package/dist/modules/datasource/repology/index.js +3 -3
  192. package/dist/modules/datasource/repology/index.js.map +1 -1
  193. package/dist/modules/datasource/rubygems/schema.js +5 -6
  194. package/dist/modules/datasource/rubygems/schema.js.map +1 -1
  195. package/dist/modules/datasource/util.js +2 -3
  196. package/dist/modules/datasource/util.js.map +1 -1
  197. package/dist/modules/manager/argocd/extract.js +3 -4
  198. package/dist/modules/manager/argocd/extract.js.map +1 -1
  199. package/dist/modules/manager/asdf/extract.js +2 -3
  200. package/dist/modules/manager/asdf/extract.js.map +1 -1
  201. package/dist/modules/manager/bazel/artifacts.js +2 -2
  202. package/dist/modules/manager/bazel/artifacts.js.map +1 -1
  203. package/dist/modules/manager/bazel/common.js +4 -5
  204. package/dist/modules/manager/bazel/common.js.map +1 -1
  205. package/dist/modules/manager/bazel/rules/http.js +3 -4
  206. package/dist/modules/manager/bazel/rules/http.js.map +1 -1
  207. package/dist/modules/manager/bazel/rules/maven.js +2 -3
  208. package/dist/modules/manager/bazel/rules/maven.js.map +1 -1
  209. package/dist/modules/manager/bazel-module/parser/starlark.js +2 -3
  210. package/dist/modules/manager/bazel-module/parser/starlark.js.map +1 -1
  211. package/dist/modules/manager/bazel-module/rules.js +3 -3
  212. package/dist/modules/manager/bazel-module/rules.js.map +1 -1
  213. package/dist/modules/manager/bitrise/utils.js +3 -4
  214. package/dist/modules/manager/bitrise/utils.js.map +1 -1
  215. package/dist/modules/manager/buildpacks/extract.js +2 -3
  216. package/dist/modules/manager/buildpacks/extract.js.map +1 -1
  217. package/dist/modules/manager/bun/artifacts.js +2 -2
  218. package/dist/modules/manager/bun/artifacts.js.map +1 -1
  219. package/dist/modules/manager/bun/extract.js +2 -3
  220. package/dist/modules/manager/bun/extract.js.map +1 -1
  221. package/dist/modules/manager/bundler/artifacts.js +3 -3
  222. package/dist/modules/manager/bundler/artifacts.js.map +1 -1
  223. package/dist/modules/manager/bundler/extract.js +5 -6
  224. package/dist/modules/manager/bundler/extract.js.map +1 -1
  225. package/dist/modules/manager/cargo/extract.js +3 -4
  226. package/dist/modules/manager/cargo/extract.js.map +1 -1
  227. package/dist/modules/manager/composer/artifacts.js +3 -3
  228. package/dist/modules/manager/composer/artifacts.js.map +1 -1
  229. package/dist/modules/manager/composer/utils.js +3 -4
  230. package/dist/modules/manager/composer/utils.js.map +1 -1
  231. package/dist/modules/manager/conan/extract.js +2 -3
  232. package/dist/modules/manager/conan/extract.js.map +1 -1
  233. package/dist/modules/manager/copier/artifacts.js +1 -1
  234. package/dist/modules/manager/copier/artifacts.js.map +1 -1
  235. package/dist/modules/manager/copier/utils.js +3 -4
  236. package/dist/modules/manager/copier/utils.js.map +1 -1
  237. package/dist/modules/manager/crow/extract.js +2 -3
  238. package/dist/modules/manager/crow/extract.js.map +1 -1
  239. package/dist/modules/manager/custom/jsonata/index.js +2 -3
  240. package/dist/modules/manager/custom/jsonata/index.js.map +1 -1
  241. package/dist/modules/manager/custom/jsonata/utils.js +3 -3
  242. package/dist/modules/manager/custom/jsonata/utils.js.map +1 -1
  243. package/dist/modules/manager/custom/regex/index.js +2 -3
  244. package/dist/modules/manager/custom/regex/index.js.map +1 -1
  245. package/dist/modules/manager/custom/regex/strategies.js +4 -5
  246. package/dist/modules/manager/custom/regex/strategies.js.map +1 -1
  247. package/dist/modules/manager/custom/regex/utils.js +2 -2
  248. package/dist/modules/manager/custom/regex/utils.js.map +1 -1
  249. package/dist/modules/manager/custom/utils.js +6 -7
  250. package/dist/modules/manager/custom/utils.js.map +1 -1
  251. package/dist/modules/manager/deps-edn/extract.js +13 -14
  252. package/dist/modules/manager/deps-edn/extract.js.map +1 -1
  253. package/dist/modules/manager/deps-edn/parser.js +2 -2
  254. package/dist/modules/manager/deps-edn/parser.js.map +1 -1
  255. package/dist/modules/manager/devbox/artifacts.js +2 -2
  256. package/dist/modules/manager/devbox/artifacts.js.map +1 -1
  257. package/dist/modules/manager/docker-compose/extract.js +3 -4
  258. package/dist/modules/manager/docker-compose/extract.js.map +1 -1
  259. package/dist/modules/manager/docker-compose/schema.js +2 -3
  260. package/dist/modules/manager/docker-compose/schema.js.map +1 -1
  261. package/dist/modules/manager/dockerfile/extract.js +5 -5
  262. package/dist/modules/manager/dockerfile/extract.js.map +1 -1
  263. package/dist/modules/manager/fingerprint.generated.js +6 -6
  264. package/dist/modules/manager/fingerprint.generated.js.map +1 -1
  265. package/dist/modules/manager/fleet/extract.js +2 -3
  266. package/dist/modules/manager/fleet/extract.js.map +1 -1
  267. package/dist/modules/manager/flux/extract.js +2 -3
  268. package/dist/modules/manager/flux/extract.js.map +1 -1
  269. package/dist/modules/manager/glasskube/extract.js +2 -3
  270. package/dist/modules/manager/glasskube/extract.js.map +1 -1
  271. package/dist/modules/manager/gleam/artifacts.js +3 -4
  272. package/dist/modules/manager/gleam/artifacts.js.map +1 -1
  273. package/dist/modules/manager/gomod/artifacts.js +2 -2
  274. package/dist/modules/manager/gomod/artifacts.js.map +1 -1
  275. package/dist/modules/manager/gradle/artifacts.js +2 -2
  276. package/dist/modules/manager/gradle/artifacts.js.map +1 -1
  277. package/dist/modules/manager/gradle/extract/catalog.js +5 -5
  278. package/dist/modules/manager/gradle/extract/catalog.js.map +1 -1
  279. package/dist/modules/manager/gradle-wrapper/artifacts.js +2 -2
  280. package/dist/modules/manager/gradle-wrapper/artifacts.js.map +1 -1
  281. package/dist/modules/manager/helm-requirements/extract.js +2 -3
  282. package/dist/modules/manager/helm-requirements/extract.js.map +1 -1
  283. package/dist/modules/manager/helmfile/artifacts.js +2 -3
  284. package/dist/modules/manager/helmfile/artifacts.js.map +1 -1
  285. package/dist/modules/manager/helmfile/extract.js +4 -5
  286. package/dist/modules/manager/helmfile/extract.js.map +1 -1
  287. package/dist/modules/manager/helmsman/extract.js +4 -5
  288. package/dist/modules/manager/helmsman/extract.js.map +1 -1
  289. package/dist/modules/manager/helmv3/artifacts.js +4 -4
  290. package/dist/modules/manager/helmv3/artifacts.js.map +1 -1
  291. package/dist/modules/manager/helmv3/extract.js +4 -5
  292. package/dist/modules/manager/helmv3/extract.js.map +1 -1
  293. package/dist/modules/manager/helmv3/oci.js +3 -4
  294. package/dist/modules/manager/helmv3/oci.js.map +1 -1
  295. package/dist/modules/manager/homebrew/extract.js +1 -1
  296. package/dist/modules/manager/homebrew/extract.js.map +1 -1
  297. package/dist/modules/manager/jenkins/extract.js +3 -3
  298. package/dist/modules/manager/jenkins/extract.js.map +1 -1
  299. package/dist/modules/manager/kotlin-script/extract.js +3 -4
  300. package/dist/modules/manager/kotlin-script/extract.js.map +1 -1
  301. package/dist/modules/manager/kubernetes/extract.js +4 -4
  302. package/dist/modules/manager/kubernetes/extract.js.map +1 -1
  303. package/dist/modules/manager/kustomize/artifacts.js +8 -8
  304. package/dist/modules/manager/kustomize/artifacts.js.map +1 -1
  305. package/dist/modules/manager/kustomize/extract.js +8 -8
  306. package/dist/modules/manager/kustomize/extract.js.map +1 -1
  307. package/dist/modules/manager/maven/extract.js +4 -4
  308. package/dist/modules/manager/maven/extract.js.map +1 -1
  309. package/dist/modules/manager/maven/update.js +2 -2
  310. package/dist/modules/manager/maven/update.js.map +1 -1
  311. package/dist/modules/manager/maven-wrapper/artifacts.js +2 -2
  312. package/dist/modules/manager/maven-wrapper/artifacts.js.map +1 -1
  313. package/dist/modules/manager/mise/backends.js +9 -10
  314. package/dist/modules/manager/mise/backends.js.map +1 -1
  315. package/dist/modules/manager/mise/extract.js +7 -8
  316. package/dist/modules/manager/mise/extract.js.map +1 -1
  317. package/dist/modules/manager/mix/artifacts.js +3 -3
  318. package/dist/modules/manager/mix/artifacts.js.map +1 -1
  319. package/dist/modules/manager/nix/artifacts.js +2 -2
  320. package/dist/modules/manager/nix/artifacts.js.map +1 -1
  321. package/dist/modules/manager/npm/detect.js +2 -2
  322. package/dist/modules/manager/npm/detect.js.map +1 -1
  323. package/dist/modules/manager/npm/extract/common/dependency.js +2 -2
  324. package/dist/modules/manager/npm/extract/common/dependency.js.map +1 -1
  325. package/dist/modules/manager/npm/extract/common/overrides.js +3 -4
  326. package/dist/modules/manager/npm/extract/common/overrides.js.map +1 -1
  327. package/dist/modules/manager/npm/extract/common/package-file.js +8 -9
  328. package/dist/modules/manager/npm/extract/common/package-file.js.map +1 -1
  329. package/dist/modules/manager/npm/extract/index.js +10 -10
  330. package/dist/modules/manager/npm/extract/index.js.map +1 -1
  331. package/dist/modules/manager/npm/extract/pnpm.js +7 -7
  332. package/dist/modules/manager/npm/extract/pnpm.js.map +1 -1
  333. package/dist/modules/manager/npm/extract/post/locked-versions.js +3 -3
  334. package/dist/modules/manager/npm/extract/post/locked-versions.js.map +1 -1
  335. package/dist/modules/manager/npm/extract/post/monorepo.js +3 -4
  336. package/dist/modules/manager/npm/extract/post/monorepo.js.map +1 -1
  337. package/dist/modules/manager/npm/extract/yarn.js +2 -3
  338. package/dist/modules/manager/npm/extract/yarn.js.map +1 -1
  339. package/dist/modules/manager/npm/extract/yarnrc.js +2 -3
  340. package/dist/modules/manager/npm/extract/yarnrc.js.map +1 -1
  341. package/dist/modules/manager/npm/post-update/index.js +6 -6
  342. package/dist/modules/manager/npm/post-update/index.js.map +1 -1
  343. package/dist/modules/manager/npm/post-update/npm.js +4 -4
  344. package/dist/modules/manager/npm/post-update/npm.js.map +1 -1
  345. package/dist/modules/manager/npm/post-update/pnpm.js +3 -3
  346. package/dist/modules/manager/npm/post-update/pnpm.js.map +1 -1
  347. package/dist/modules/manager/npm/post-update/rules.js +2 -2
  348. package/dist/modules/manager/npm/post-update/rules.js.map +1 -1
  349. package/dist/modules/manager/npm/post-update/utils.js +2 -2
  350. package/dist/modules/manager/npm/post-update/utils.js.map +1 -1
  351. package/dist/modules/manager/npm/post-update/yarn.js +3 -3
  352. package/dist/modules/manager/npm/post-update/yarn.js.map +1 -1
  353. package/dist/modules/manager/npm/update/dependency/index.js +2 -3
  354. package/dist/modules/manager/npm/update/dependency/index.js.map +1 -1
  355. package/dist/modules/manager/npm/update/dependency/pnpm.js +2 -3
  356. package/dist/modules/manager/npm/update/dependency/pnpm.js.map +1 -1
  357. package/dist/modules/manager/npm/update/dependency/yarn.js +3 -4
  358. package/dist/modules/manager/npm/update/dependency/yarn.js.map +1 -1
  359. package/dist/modules/manager/nuget/config-formatter.js +2 -2
  360. package/dist/modules/manager/nuget/config-formatter.js.map +1 -1
  361. package/dist/modules/manager/nuget/extract.js +4 -4
  362. package/dist/modules/manager/nuget/extract.js.map +1 -1
  363. package/dist/modules/manager/nuget/package-tree.js +2 -2
  364. package/dist/modules/manager/nuget/package-tree.js.map +1 -1
  365. package/dist/modules/manager/ocb/extract.js +2 -3
  366. package/dist/modules/manager/ocb/extract.js.map +1 -1
  367. package/dist/modules/manager/osgi/extract.js +4 -4
  368. package/dist/modules/manager/osgi/extract.js.map +1 -1
  369. package/dist/modules/manager/pep621/artifacts.js +3 -4
  370. package/dist/modules/manager/pep621/artifacts.js.map +1 -1
  371. package/dist/modules/manager/pep621/processors/uv.js +2 -3
  372. package/dist/modules/manager/pep621/processors/uv.js.map +1 -1
  373. package/dist/modules/manager/pep621/schema.d.ts +1 -1
  374. package/dist/modules/manager/pep621/schema.js +1 -0
  375. package/dist/modules/manager/pep621/schema.js.map +1 -1
  376. package/dist/modules/manager/pep621/utils.js +8 -10
  377. package/dist/modules/manager/pep621/utils.js.map +1 -1
  378. package/dist/modules/manager/pep723/schema.js +2 -3
  379. package/dist/modules/manager/pep723/schema.js.map +1 -1
  380. package/dist/modules/manager/pip-compile/common.js +3 -3
  381. package/dist/modules/manager/pip-compile/common.js.map +1 -1
  382. package/dist/modules/manager/pip_requirements/artifacts.js +2 -3
  383. package/dist/modules/manager/pip_requirements/artifacts.js.map +1 -1
  384. package/dist/modules/manager/pip_requirements/extract.js +2 -3
  385. package/dist/modules/manager/pip_requirements/extract.js.map +1 -1
  386. package/dist/modules/manager/pipenv/artifacts.js +3 -4
  387. package/dist/modules/manager/pipenv/artifacts.js.map +1 -1
  388. package/dist/modules/manager/pipenv/extract.js +6 -7
  389. package/dist/modules/manager/pipenv/extract.js.map +1 -1
  390. package/dist/modules/manager/pixi/artifacts.js +2 -3
  391. package/dist/modules/manager/pixi/artifacts.js.map +1 -1
  392. package/dist/modules/manager/pixi/extract.js +2 -3
  393. package/dist/modules/manager/pixi/extract.js.map +1 -1
  394. package/dist/modules/manager/poetry/artifacts.js +4 -5
  395. package/dist/modules/manager/poetry/artifacts.js.map +1 -1
  396. package/dist/modules/manager/poetry/extract.js +2 -3
  397. package/dist/modules/manager/poetry/extract.js.map +1 -1
  398. package/dist/modules/manager/poetry/schema.d.ts +4 -0
  399. package/dist/modules/manager/poetry/schema.js +5 -1
  400. package/dist/modules/manager/poetry/schema.js.map +1 -1
  401. package/dist/modules/manager/pre-commit/extract.js +4 -5
  402. package/dist/modules/manager/pre-commit/extract.js.map +1 -1
  403. package/dist/modules/manager/pub/artifacts.js +3 -4
  404. package/dist/modules/manager/pub/artifacts.js.map +1 -1
  405. package/dist/modules/manager/pub/extract.js +8 -11
  406. package/dist/modules/manager/pub/extract.js.map +1 -1
  407. package/dist/modules/manager/renovate-config-presets/extract.js +4 -5
  408. package/dist/modules/manager/renovate-config-presets/extract.js.map +1 -1
  409. package/dist/modules/manager/tekton/extract.js +9 -10
  410. package/dist/modules/manager/tekton/extract.js.map +1 -1
  411. package/dist/modules/manager/terraform/base.js +2 -3
  412. package/dist/modules/manager/terraform/base.js.map +1 -1
  413. package/dist/modules/manager/terraform/extract.js +2 -2
  414. package/dist/modules/manager/terraform/extract.js.map +1 -1
  415. package/dist/modules/manager/terraform/extractors/others/modules.js +3 -4
  416. package/dist/modules/manager/terraform/extractors/others/modules.js.map +1 -1
  417. package/dist/modules/manager/terraform/extractors/others/providers.js +3 -4
  418. package/dist/modules/manager/terraform/extractors/others/providers.js.map +1 -1
  419. package/dist/modules/manager/terraform/extractors/resources/generic-docker-image-ref.js +7 -8
  420. package/dist/modules/manager/terraform/extractors/resources/generic-docker-image-ref.js.map +1 -1
  421. package/dist/modules/manager/terraform/extractors/resources/helm-release.js +5 -6
  422. package/dist/modules/manager/terraform/extractors/resources/helm-release.js.map +1 -1
  423. package/dist/modules/manager/terraform/extractors/resources/terraform-workspace.js +3 -4
  424. package/dist/modules/manager/terraform/extractors/resources/terraform-workspace.js.map +1 -1
  425. package/dist/modules/manager/terraform/extractors/terraform-block/required-provider.js +4 -5
  426. package/dist/modules/manager/terraform/extractors/terraform-block/required-provider.js.map +1 -1
  427. package/dist/modules/manager/terraform/extractors/terraform-block/terraform-version.js +3 -3
  428. package/dist/modules/manager/terraform/extractors/terraform-block/terraform-version.js.map +1 -1
  429. package/dist/modules/manager/terraform/lockfile/index.js +2 -2
  430. package/dist/modules/manager/terraform/lockfile/index.js.map +1 -1
  431. package/dist/modules/manager/terraform/lockfile/util.js +2 -3
  432. package/dist/modules/manager/terraform/lockfile/util.js.map +1 -1
  433. package/dist/modules/manager/terraform/util.js +2 -3
  434. package/dist/modules/manager/terraform/util.js.map +1 -1
  435. package/dist/modules/manager/tflint-plugin/plugins.js +2 -3
  436. package/dist/modules/manager/tflint-plugin/plugins.js.map +1 -1
  437. package/dist/modules/manager/travis/extract.js +5 -6
  438. package/dist/modules/manager/travis/extract.js.map +1 -1
  439. package/dist/modules/manager/woodpecker/extract.js +2 -3
  440. package/dist/modules/manager/woodpecker/extract.js.map +1 -1
  441. package/dist/modules/platform/azure/index.js +2 -2
  442. package/dist/modules/platform/azure/index.js.map +1 -1
  443. package/dist/modules/platform/bitbucket/index.js +5 -5
  444. package/dist/modules/platform/bitbucket/index.js.map +1 -1
  445. package/dist/modules/platform/bitbucket-server/pr-cache.js +3 -3
  446. package/dist/modules/platform/bitbucket-server/pr-cache.js.map +1 -1
  447. package/dist/modules/platform/bitbucket-server/utils.js +2 -2
  448. package/dist/modules/platform/bitbucket-server/utils.js.map +1 -1
  449. package/dist/modules/platform/codecommit/codecommit-client.js +2 -2
  450. package/dist/modules/platform/codecommit/codecommit-client.js.map +1 -1
  451. package/dist/modules/platform/forgejo/index.js +5 -5
  452. package/dist/modules/platform/forgejo/index.js.map +1 -1
  453. package/dist/modules/platform/forgejo/pr-cache.js +1 -1
  454. package/dist/modules/platform/forgejo/pr-cache.js.map +1 -1
  455. package/dist/modules/platform/forgejo/utils.js +2 -2
  456. package/dist/modules/platform/forgejo/utils.js.map +1 -1
  457. package/dist/modules/platform/gitea/index.js +5 -5
  458. package/dist/modules/platform/gitea/index.js.map +1 -1
  459. package/dist/modules/platform/gitea/pr-cache.js +1 -1
  460. package/dist/modules/platform/gitea/pr-cache.js.map +1 -1
  461. package/dist/modules/platform/gitea/utils.js +2 -2
  462. package/dist/modules/platform/gitea/utils.js.map +1 -1
  463. package/dist/modules/platform/github/common.js +4 -5
  464. package/dist/modules/platform/github/common.js.map +1 -1
  465. package/dist/modules/platform/github/index.js +5 -5
  466. package/dist/modules/platform/github/index.js.map +1 -1
  467. package/dist/modules/platform/github/pr.js +2 -3
  468. package/dist/modules/platform/github/pr.js.map +1 -1
  469. package/dist/modules/platform/gitlab/http.js +2 -3
  470. package/dist/modules/platform/gitlab/http.js.map +1 -1
  471. package/dist/modules/platform/gitlab/index.js +3 -3
  472. package/dist/modules/platform/gitlab/index.js.map +1 -1
  473. package/dist/modules/platform/gitlab/utils.js +3 -3
  474. package/dist/modules/platform/gitlab/utils.js.map +1 -1
  475. package/dist/modules/platform/pr-body.js +2 -3
  476. package/dist/modules/platform/pr-body.js.map +1 -1
  477. package/dist/modules/versioning/composer/index.js +2 -3
  478. package/dist/modules/versioning/composer/index.js.map +1 -1
  479. package/dist/modules/versioning/generic.js +5 -6
  480. package/dist/modules/versioning/generic.js.map +1 -1
  481. package/dist/modules/versioning/gradle/compare.js +3 -4
  482. package/dist/modules/versioning/gradle/compare.js.map +1 -1
  483. package/dist/modules/versioning/ivy/parse.js +1 -1
  484. package/dist/modules/versioning/ivy/parse.js.map +1 -1
  485. package/dist/modules/versioning/maven/index.js +1 -1
  486. package/dist/modules/versioning/maven/index.js.map +1 -1
  487. package/dist/modules/versioning/nixpkgs/index.js +6 -7
  488. package/dist/modules/versioning/nixpkgs/index.js.map +1 -1
  489. package/dist/modules/versioning/npm/range.js +2 -2
  490. package/dist/modules/versioning/npm/range.js.map +1 -1
  491. package/dist/modules/versioning/nuget/index.js +1 -1
  492. package/dist/modules/versioning/nuget/index.js.map +1 -1
  493. package/dist/modules/versioning/rpm/index.js +4 -5
  494. package/dist/modules/versioning/rpm/index.js.map +1 -1
  495. package/dist/modules/versioning/schema.js +2 -2
  496. package/dist/modules/versioning/schema.js.map +1 -1
  497. package/dist/modules/versioning/semver-coerced/index.js +3 -3
  498. package/dist/modules/versioning/semver-coerced/index.js.map +1 -1
  499. package/dist/modules/versioning/semver-partial/index.js +4 -4
  500. package/dist/modules/versioning/semver-partial/index.js.map +1 -1
  501. package/dist/proxy.js +3 -4
  502. package/dist/proxy.js.map +1 -1
  503. package/dist/util/array.js +4 -5
  504. package/dist/util/array.js.map +1 -1
  505. package/dist/util/assign-keys.js +2 -3
  506. package/dist/util/assign-keys.js.map +1 -1
  507. package/dist/util/cache/package/decorator.js +6 -6
  508. package/dist/util/cache/package/decorator.js.map +1 -1
  509. package/dist/util/cache/package/ttl.js +4 -5
  510. package/dist/util/cache/package/ttl.js.map +1 -1
  511. package/dist/util/cache/repository/impl/base.js +3 -4
  512. package/dist/util/cache/repository/impl/base.js.map +1 -1
  513. package/dist/util/cache/repository/impl/s3.js +2 -3
  514. package/dist/util/cache/repository/impl/s3.js.map +1 -1
  515. package/dist/util/exec/common.js +2 -3
  516. package/dist/util/exec/common.js.map +1 -1
  517. package/dist/util/exec/containerbase.js +2 -2
  518. package/dist/util/exec/containerbase.js.map +1 -1
  519. package/dist/util/exec/docker/index.js +5 -5
  520. package/dist/util/exec/docker/index.js.map +1 -1
  521. package/dist/util/exec/index.js +2 -2
  522. package/dist/util/exec/index.js.map +1 -1
  523. package/dist/util/exec/utils.js +3 -4
  524. package/dist/util/exec/utils.js.map +1 -1
  525. package/dist/util/filter-map.js +2 -3
  526. package/dist/util/filter-map.js.map +1 -1
  527. package/dist/util/fs/index.js +3 -3
  528. package/dist/util/fs/index.js.map +1 -1
  529. package/dist/util/git/auth.js +2 -3
  530. package/dist/util/git/auth.js.map +1 -1
  531. package/dist/util/git/behind-base-branch-cache.js +2 -1
  532. package/dist/util/git/behind-base-branch-cache.js.map +1 -1
  533. package/dist/util/git/config.js +3 -4
  534. package/dist/util/git/config.js.map +1 -1
  535. package/dist/util/git/conflicts-cache.js +2 -1
  536. package/dist/util/git/conflicts-cache.js.map +1 -1
  537. package/dist/util/git/index.js +5 -5
  538. package/dist/util/git/index.js.map +1 -1
  539. package/dist/util/git/private-key.js +2 -2
  540. package/dist/util/git/private-key.js.map +1 -1
  541. package/dist/util/github/graphql/datasource-fetcher.js +2 -1
  542. package/dist/util/github/graphql/datasource-fetcher.js.map +1 -1
  543. package/dist/util/host-rules.js +6 -6
  544. package/dist/util/host-rules.js.map +1 -1
  545. package/dist/util/http/auth.js +3 -4
  546. package/dist/util/http/auth.js.map +1 -1
  547. package/dist/util/http/bitbucket-server.js +2 -3
  548. package/dist/util/http/bitbucket-server.js.map +1 -1
  549. package/dist/util/http/bitbucket.js +3 -4
  550. package/dist/util/http/bitbucket.js.map +1 -1
  551. package/dist/util/http/cache/package-http-cache-provider.js +2 -2
  552. package/dist/util/http/cache/package-http-cache-provider.js.map +1 -1
  553. package/dist/util/http/forgejo.js +3 -4
  554. package/dist/util/http/forgejo.js.map +1 -1
  555. package/dist/util/http/gitea.js +3 -4
  556. package/dist/util/http/gitea.js.map +1 -1
  557. package/dist/util/http/github.js +10 -10
  558. package/dist/util/http/github.js.map +1 -1
  559. package/dist/util/http/gitlab.js +4 -5
  560. package/dist/util/http/gitlab.js.map +1 -1
  561. package/dist/util/http/host-rules.js +10 -10
  562. package/dist/util/http/host-rules.js.map +1 -1
  563. package/dist/util/http/http.js +5 -5
  564. package/dist/util/http/http.js.map +1 -1
  565. package/dist/util/http/rate-limits.js +3 -3
  566. package/dist/util/http/rate-limits.js.map +1 -1
  567. package/dist/util/http/retry-after.js +3 -4
  568. package/dist/util/http/retry-after.js.map +1 -1
  569. package/dist/util/interpolator.js +8 -9
  570. package/dist/util/interpolator.js.map +1 -1
  571. package/dist/util/merge-confidence/index.js +5 -5
  572. package/dist/util/merge-confidence/index.js.map +1 -1
  573. package/dist/util/number.js +2 -3
  574. package/dist/util/number.js.map +1 -1
  575. package/dist/util/package-rules/base-branches.js +3 -4
  576. package/dist/util/package-rules/base-branches.js.map +1 -1
  577. package/dist/util/package-rules/categories.js +3 -4
  578. package/dist/util/package-rules/categories.js.map +1 -1
  579. package/dist/util/package-rules/current-age.js +3 -4
  580. package/dist/util/package-rules/current-age.js.map +1 -1
  581. package/dist/util/package-rules/current-value.js +2 -3
  582. package/dist/util/package-rules/current-value.js.map +1 -1
  583. package/dist/util/package-rules/current-version.js +5 -5
  584. package/dist/util/package-rules/current-version.js.map +1 -1
  585. package/dist/util/package-rules/datasources.js +3 -4
  586. package/dist/util/package-rules/datasources.js.map +1 -1
  587. package/dist/util/package-rules/dep-names.js +3 -4
  588. package/dist/util/package-rules/dep-names.js.map +1 -1
  589. package/dist/util/package-rules/dep-types.js +2 -3
  590. package/dist/util/package-rules/dep-types.js.map +1 -1
  591. package/dist/util/package-rules/files.js +4 -5
  592. package/dist/util/package-rules/files.js.map +1 -1
  593. package/dist/util/package-rules/index.js +6 -6
  594. package/dist/util/package-rules/index.js.map +1 -1
  595. package/dist/util/package-rules/managers.js +3 -4
  596. package/dist/util/package-rules/managers.js.map +1 -1
  597. package/dist/util/package-rules/merge-confidence.js +5 -6
  598. package/dist/util/package-rules/merge-confidence.js.map +1 -1
  599. package/dist/util/package-rules/new-value.js +2 -3
  600. package/dist/util/package-rules/new-value.js.map +1 -1
  601. package/dist/util/package-rules/package-names.js +2 -3
  602. package/dist/util/package-rules/package-names.js.map +1 -1
  603. package/dist/util/package-rules/repositories.js +3 -4
  604. package/dist/util/package-rules/repositories.js.map +1 -1
  605. package/dist/util/package-rules/sourceurls.js +2 -3
  606. package/dist/util/package-rules/sourceurls.js.map +1 -1
  607. package/dist/util/package-rules/update-types.js +2 -3
  608. package/dist/util/package-rules/update-types.js.map +1 -1
  609. package/dist/util/pretty-time.js +4 -4
  610. package/dist/util/pretty-time.js.map +1 -1
  611. package/dist/util/regex.js +2 -3
  612. package/dist/util/regex.js.map +1 -1
  613. package/dist/util/s3.js +2 -3
  614. package/dist/util/s3.js.map +1 -1
  615. package/dist/util/sanitize.js +2 -3
  616. package/dist/util/sanitize.js.map +1 -1
  617. package/dist/util/string-match.js +2 -3
  618. package/dist/util/string-match.js.map +1 -1
  619. package/dist/util/template/index.js +6 -6
  620. package/dist/util/template/index.js.map +1 -1
  621. package/dist/util/url.js +5 -5
  622. package/dist/util/url.js.map +1 -1
  623. package/dist/workers/global/autodiscover.js +3 -4
  624. package/dist/workers/global/autodiscover.js.map +1 -1
  625. package/dist/workers/global/config/parse/additional-config-file.js +4 -4
  626. package/dist/workers/global/config/parse/additional-config-file.js.map +1 -1
  627. package/dist/workers/global/config/parse/coersions.js +2 -2
  628. package/dist/workers/global/config/parse/coersions.js.map +1 -1
  629. package/dist/workers/global/config/parse/env.js +2 -2
  630. package/dist/workers/global/config/parse/env.js.map +1 -1
  631. package/dist/workers/global/config/parse/file.js +5 -5
  632. package/dist/workers/global/config/parse/file.js.map +1 -1
  633. package/dist/workers/global/config/parse/index.js +6 -7
  634. package/dist/workers/global/config/parse/index.js.map +1 -1
  635. package/dist/workers/global/config/parse/util.js +2 -2
  636. package/dist/workers/global/config/parse/util.js.map +1 -1
  637. package/dist/workers/global/index.js +5 -5
  638. package/dist/workers/global/index.js.map +1 -1
  639. package/dist/workers/global/limits.js +6 -7
  640. package/dist/workers/global/limits.js.map +1 -1
  641. package/dist/workers/repository/config-migration/branch/index.js +2 -3
  642. package/dist/workers/repository/config-migration/branch/index.js.map +1 -1
  643. package/dist/workers/repository/config-migration/branch/migrated-data.js +2 -2
  644. package/dist/workers/repository/config-migration/branch/migrated-data.js.map +1 -1
  645. package/dist/workers/repository/config-migration/pr/index.js +3 -3
  646. package/dist/workers/repository/config-migration/pr/index.js.map +1 -1
  647. package/dist/workers/repository/dependency-dashboard.js +10 -10
  648. package/dist/workers/repository/dependency-dashboard.js.map +1 -1
  649. package/dist/workers/repository/extract/index.js +2 -3
  650. package/dist/workers/repository/extract/index.js.map +1 -1
  651. package/dist/workers/repository/extract/manager-files.js +2 -3
  652. package/dist/workers/repository/extract/manager-files.js.map +1 -1
  653. package/dist/workers/repository/extract/supersedes.js +4 -5
  654. package/dist/workers/repository/extract/supersedes.js.map +1 -1
  655. package/dist/workers/repository/finalize/prune.js +2 -3
  656. package/dist/workers/repository/finalize/prune.js.map +1 -1
  657. package/dist/workers/repository/init/inherited.js +5 -5
  658. package/dist/workers/repository/init/inherited.js.map +1 -1
  659. package/dist/workers/repository/init/merge.js +13 -13
  660. package/dist/workers/repository/init/merge.js.map +1 -1
  661. package/dist/workers/repository/model/commit-message.js +2 -3
  662. package/dist/workers/repository/model/commit-message.js.map +1 -1
  663. package/dist/workers/repository/onboarding/branch/check.js +2 -1
  664. package/dist/workers/repository/onboarding/branch/check.js.map +1 -1
  665. package/dist/workers/repository/onboarding/branch/index.js +3 -4
  666. package/dist/workers/repository/onboarding/branch/index.js.map +1 -1
  667. package/dist/workers/repository/onboarding/branch/onboarding-branch-cache.js +7 -8
  668. package/dist/workers/repository/onboarding/branch/onboarding-branch-cache.js.map +1 -1
  669. package/dist/workers/repository/onboarding/pr/config-description.js +2 -5
  670. package/dist/workers/repository/onboarding/pr/config-description.js.map +1 -1
  671. package/dist/workers/repository/onboarding/pr/index.js +3 -3
  672. package/dist/workers/repository/onboarding/pr/index.js.map +1 -1
  673. package/dist/workers/repository/package-files.js +8 -9
  674. package/dist/workers/repository/package-files.js.map +1 -1
  675. package/dist/workers/repository/process/extract-update.js +2 -2
  676. package/dist/workers/repository/process/extract-update.js.map +1 -1
  677. package/dist/workers/repository/process/fetch.js +3 -3
  678. package/dist/workers/repository/process/fetch.js.map +1 -1
  679. package/dist/workers/repository/process/lookup/current.js +2 -3
  680. package/dist/workers/repository/process/lookup/current.js.map +1 -1
  681. package/dist/workers/repository/process/lookup/filter-checks.js +4 -5
  682. package/dist/workers/repository/process/lookup/filter-checks.js.map +1 -1
  683. package/dist/workers/repository/process/lookup/generate.js +2 -3
  684. package/dist/workers/repository/process/lookup/generate.js.map +1 -1
  685. package/dist/workers/repository/process/lookup/index.js +15 -16
  686. package/dist/workers/repository/process/lookup/index.js.map +1 -1
  687. package/dist/workers/repository/process/lookup/utils.js +7 -7
  688. package/dist/workers/repository/process/lookup/utils.js.map +1 -1
  689. package/dist/workers/repository/process/vulnerabilities.js +11 -11
  690. package/dist/workers/repository/process/vulnerabilities.js.map +1 -1
  691. package/dist/workers/repository/process/write.js +2 -3
  692. package/dist/workers/repository/process/write.js.map +1 -1
  693. package/dist/workers/repository/reconfigure/comment.js +2 -5
  694. package/dist/workers/repository/reconfigure/comment.js.map +1 -1
  695. package/dist/workers/repository/reconfigure/utils.js +2 -3
  696. package/dist/workers/repository/reconfigure/utils.js.map +1 -1
  697. package/dist/workers/repository/reconfigure/validate.js +2 -3
  698. package/dist/workers/repository/reconfigure/validate.js.map +1 -1
  699. package/dist/workers/repository/update/branch/auto-replace.js +4 -5
  700. package/dist/workers/repository/update/branch/auto-replace.js.map +1 -1
  701. package/dist/workers/repository/update/branch/commit.js +3 -4
  702. package/dist/workers/repository/update/branch/commit.js.map +1 -1
  703. package/dist/workers/repository/update/branch/execute-post-upgrade-commands.js +12 -5
  704. package/dist/workers/repository/update/branch/execute-post-upgrade-commands.js.map +1 -1
  705. package/dist/workers/repository/update/branch/get-updated.js +8 -9
  706. package/dist/workers/repository/update/branch/get-updated.js.map +1 -1
  707. package/dist/workers/repository/update/branch/index.js +3 -3
  708. package/dist/workers/repository/update/branch/index.js.map +1 -1
  709. package/dist/workers/repository/update/branch/schedule.js +2 -2
  710. package/dist/workers/repository/update/branch/schedule.js.map +1 -1
  711. package/dist/workers/repository/update/pr/body/notes.js +2 -2
  712. package/dist/workers/repository/update/pr/body/notes.js.map +1 -1
  713. package/dist/workers/repository/update/pr/changelog/bitbucket/index.js +2 -2
  714. package/dist/workers/repository/update/pr/changelog/bitbucket/index.js.map +1 -1
  715. package/dist/workers/repository/update/pr/changelog/index.js +3 -3
  716. package/dist/workers/repository/update/pr/changelog/index.js.map +1 -1
  717. package/dist/workers/repository/update/pr/changelog/release-notes.js +4 -4
  718. package/dist/workers/repository/update/pr/changelog/release-notes.js.map +1 -1
  719. package/dist/workers/repository/update/pr/changelog/source.js +8 -8
  720. package/dist/workers/repository/update/pr/changelog/source.js.map +1 -1
  721. package/dist/workers/repository/update/pr/code-owners.js +2 -2
  722. package/dist/workers/repository/update/pr/code-owners.js.map +1 -1
  723. package/dist/workers/repository/update/pr/index.js +7 -8
  724. package/dist/workers/repository/update/pr/index.js.map +1 -1
  725. package/dist/workers/repository/update/pr/labels.js +4 -4
  726. package/dist/workers/repository/update/pr/labels.js.map +1 -1
  727. package/dist/workers/repository/update/pr/participants.js +4 -5
  728. package/dist/workers/repository/update/pr/participants.js.map +1 -1
  729. package/dist/workers/repository/updates/generate.js +4 -4
  730. package/dist/workers/repository/updates/generate.js.map +1 -1
  731. package/package.json +5 -5
  732. package/renovate-schema.json +2 -2
@@ -3,8 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getPythonConstraint = getPythonConstraint;
4
4
  exports.getPoetryRequirement = getPoetryRequirement;
5
5
  exports.updateArtifacts = updateArtifacts;
6
- const tslib_1 = require("tslib");
7
- const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
6
+ const is_1 = require("@sindresorhus/is");
8
7
  const shlex_1 = require("shlex");
9
8
  const error_messages_1 = require("../../../constants/error-messages");
10
9
  const logger_1 = require("../../../logger");
@@ -79,7 +78,7 @@ function getPoetrySources(content, fileName) {
79
78
  }
80
79
  async function getMatchingHostRule(url) {
81
80
  const scopedMatch = (0, host_rules_1.find)({ hostType: pypi_1.PypiDatasource.id, url });
82
- const hostRule = is_1.default.nonEmptyObject(scopedMatch) ? scopedMatch : (0, host_rules_1.find)({ url });
81
+ const hostRule = (0, is_1.isNonEmptyObject)(scopedMatch) ? scopedMatch : (0, host_rules_1.find)({ url });
83
82
  if (hostRule && Object.keys(hostRule).length !== 0) {
84
83
  return hostRule;
85
84
  }
@@ -119,7 +118,7 @@ async function getSourceCredentialVars(pyprojectContent, packageFileName) {
119
118
  async function updateArtifacts({ packageFileName, updatedDeps, newPackageFileContent, config, }) {
120
119
  logger_1.logger.debug(`poetry.updateArtifacts(${packageFileName})`);
121
120
  const { isLockFileMaintenance } = config;
122
- if (!is_1.default.nonEmptyArray(updatedDeps) && !isLockFileMaintenance) {
121
+ if (!(0, is_1.isNonEmptyArray)(updatedDeps) && !isLockFileMaintenance) {
123
122
  logger_1.logger.debug('No updated poetry deps - returning null');
124
123
  return null;
125
124
  }
@@ -146,7 +145,7 @@ async function updateArtifacts({ packageFileName, updatedDeps, newPackageFileCon
146
145
  else {
147
146
  cmd.push(`poetry update --lock --no-interaction ${updatedDeps
148
147
  .map((dep) => dep.depName)
149
- .filter(is_1.default.string)
148
+ .filter(is_1.isString)
150
149
  .map((dep) => (0, shlex_1.quote)(dep))
151
150
  .join(' ')}`);
152
151
  }
@@ -1 +1 @@
1
- {"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../../../lib/modules/manager/poetry/artifacts.ts"],"names":[],"mappings":";;AA0BA,kDA4BC;AAED,oDAsCC;AAyED,0CAgGC;;AAvQD,kEAAkC;AAClC,iCAA8B;AAC9B,sEAAoE;AACpE,4CAAyC;AAEzC,6CAA0C;AAE1C,yCAM0B;AAC1B,iDAAoE;AACpE,yDAAgD;AAChD,+CAA4C;AAC5C,iDAA8C;AAC9C,6CAAgF;AAChF,2CAA6C;AAC7C,gDAAuD;AACvD,gDAA8D;AAE9D,qCAAqD;AAGrD,SAAgB,mBAAmB,CACjC,gBAAwB,EACxB,uBAA+B;IAE/B,gFAAgF;IAChF,MAAM,yBAAyB,GAAG,eAAM,CAAC,KAAK,CAC5C,IAAA,cAAW,EAAC,gBAAgB,CAAC,EAC7B,wBAAe,CAAC,SAAS,CACvB,CAAC,EAAE,kBAAkB,EAAE,EAAE,EAAE,CACzB,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,KAAK,QAAQ,CAAC;QAC7D,EAAE,YAAY,CACnB,CACF,CAAC,YA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AAG,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 type { HostRule } from '../../../types';\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 { getGitEnvironmentVariables } from '../../../util/git/auth';\nimport { find } from '../../../util/host-rules';\nimport { regEx } from '../../../util/regex';\nimport { Result } from '../../../util/result';\nimport { massage as massageToml, parse as parseToml } from '../../../util/toml';\nimport { parseUrl } from '../../../util/url';\nimport { PypiDatasource } from '../../datasource/pypi';\nimport { getGoogleAuthHostRule } from '../../datasource/util';\nimport type { UpdateArtifact, UpdateArtifactsResult } from '../types';\nimport { Lockfile, PoetryPyProject } from './schema';\nimport type { PoetryFile, PoetrySource } from './types';\n\nexport function getPythonConstraint(\n pyProjectContent: string,\n existingLockFileContent: string,\n): string | null {\n // Read Python version from `pyproject.toml` first as it could have been updated\n const pyprojectPythonConstraint = Result.parse(\n massageToml(pyProjectContent),\n PoetryPyProject.transform(\n ({ packageFileContent }) =>\n packageFileContent.deps.find((dep) => dep.depName === 'python')\n ?.currentValue,\n ),\n ).unwrapOrNull();\n if (pyprojectPythonConstraint) {\n logger.debug('Using python version from pyproject.toml');\n return pyprojectPythonConstraint;\n }\n\n const lockfilePythonConstraint = Result.parse(\n existingLockFileContent,\n Lockfile.transform(({ pythonVersions }) => pythonVersions),\n ).unwrapOrNull();\n if (lockfilePythonConstraint) {\n logger.debug('Using python version from poetry.lock');\n return lockfilePythonConstraint;\n }\n\n return null;\n}\n\nexport function getPoetryRequirement(\n pyProjectContent: string,\n existingLockFileContent: string,\n): undefined | string | null {\n // Read Poetry version from first line of poetry.lock\n const firstLine = existingLockFileContent.split('\\n')[0];\n const poetryVersionMatch = regEx(/by Poetry ([\\d\\\\.]+)/).exec(firstLine);\n if (poetryVersionMatch?.[1]) {\n const poetryVersion = poetryVersionMatch[1];\n logger.debug(\n `Using poetry version ${poetryVersion} from poetry.lock header`,\n );\n return poetryVersion;\n }\n\n const { val: lockfilePoetryConstraint } = Result.parse(\n existingLockFileContent,\n Lockfile.transform(({ poetryConstraint }) => poetryConstraint),\n ).unwrap();\n if (lockfilePoetryConstraint) {\n logger.debug(\n `Using poetry version ${lockfilePoetryConstraint} from poetry.lock metadata`,\n );\n return lockfilePoetryConstraint;\n }\n\n const { val: pyprojectPoetryConstraint } = Result.parse(\n massageToml(pyProjectContent),\n PoetryPyProject.transform(({ poetryRequirement }) => poetryRequirement),\n ).unwrap();\n if (pyprojectPoetryConstraint) {\n logger.debug(\n `Using poetry version ${pyprojectPoetryConstraint} from pyproject.toml`,\n );\n return pyprojectPoetryConstraint;\n }\n\n return null;\n}\n\nfunction getPoetrySources(content: string, fileName: string): PoetrySource[] {\n let pyprojectFile: PoetryFile;\n try {\n pyprojectFile = parseToml(massageToml(content)) as PoetryFile;\n } catch (err) {\n logger.debug({ err }, 'Error parsing pyproject.toml file');\n return [];\n }\n if (!pyprojectFile.tool?.poetry) {\n logger.debug(`${fileName} contains no poetry section`);\n return [];\n }\n\n const sources = pyprojectFile.tool?.poetry?.source ?? [];\n const sourceArray: PoetrySource[] = [];\n for (const source of sources) {\n if (source.name && source.url) {\n sourceArray.push({ name: source.name, url: source.url });\n }\n }\n return sourceArray;\n}\n\nasync function getMatchingHostRule(url: string | undefined): Promise<HostRule> {\n const scopedMatch = find({ hostType: PypiDatasource.id, url });\n const hostRule = is.nonEmptyObject(scopedMatch) ? scopedMatch : find({ url });\n if (hostRule && Object.keys(hostRule).length !== 0) {\n return hostRule;\n }\n\n const parsedUrl = parseUrl(url);\n if (!parsedUrl) {\n logger.once.debug(`Failed to parse URL ${url}`);\n return {};\n }\n\n if (parsedUrl.hostname.endsWith('.pkg.dev')) {\n const hostRule = await getGoogleAuthHostRule();\n if (hostRule && Object.keys(hostRule).length !== 0) {\n return hostRule;\n }\n logger.once.debug(`Could not get Google access token (url=${url})`);\n }\n\n return {};\n}\n\nasync function getSourceCredentialVars(\n pyprojectContent: string,\n packageFileName: string,\n): Promise<NodeJS.ProcessEnv> {\n const poetrySources = getPoetrySources(pyprojectContent, packageFileName);\n const envVars: NodeJS.ProcessEnv = {};\n\n for (const source of poetrySources) {\n const matchingHostRule = await getMatchingHostRule(source.url);\n const formattedSourceName = source.name\n .replace(regEx(/(\\.|-)+/g), '_')\n .toUpperCase();\n if (matchingHostRule.username) {\n envVars[`POETRY_HTTP_BASIC_${formattedSourceName}_USERNAME`] =\n matchingHostRule.username;\n }\n if (matchingHostRule.password) {\n envVars[`POETRY_HTTP_BASIC_${formattedSourceName}_PASSWORD`] =\n matchingHostRule.password;\n }\n }\n return envVars;\n}\n\nexport async function updateArtifacts({\n packageFileName,\n updatedDeps,\n newPackageFileContent,\n config,\n}: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> {\n logger.debug(`poetry.updateArtifacts(${packageFileName})`);\n const { isLockFileMaintenance } = config;\n\n if (!is.nonEmptyArray(updatedDeps) && !isLockFileMaintenance) {\n logger.debug('No updated poetry deps - returning null');\n return null;\n }\n // Try poetry.lock first\n let lockFileName = getSiblingFileName(packageFileName, 'poetry.lock');\n let existingLockFileContent = await readLocalFile(lockFileName, 'utf8');\n if (!existingLockFileContent) {\n // Try pyproject.lock next\n lockFileName = getSiblingFileName(packageFileName, 'pyproject.lock');\n existingLockFileContent = await readLocalFile(lockFileName, 'utf8');\n if (!existingLockFileContent) {\n logger.debug(`No lock file found`);\n return null;\n }\n }\n logger.debug(`Updating ${lockFileName}`);\n try {\n await writeLocalFile(packageFileName, newPackageFileContent);\n const cmd: string[] = [];\n if (isLockFileMaintenance) {\n await deleteLocalFile(lockFileName);\n cmd.push('poetry update --lock --no-interaction');\n } else {\n cmd.push(\n `poetry update --lock --no-interaction ${updatedDeps\n .map((dep) => dep.depName)\n .filter(is.string)\n .map((dep) => quote(dep))\n .join(' ')}`,\n );\n }\n const pythonConstraint =\n config?.constraints?.python ??\n getPythonConstraint(newPackageFileContent, existingLockFileContent);\n const poetryConstraint =\n config.constraints?.poetry ??\n getPoetryRequirement(newPackageFileContent, existingLockFileContent);\n const extraEnv = {\n ...(await getSourceCredentialVars(\n newPackageFileContent,\n packageFileName,\n )),\n ...getGitEnvironmentVariables(['poetry']),\n PIP_CACHE_DIR: await ensureCacheDir('pip'),\n };\n\n const execOptions: ExecOptions = {\n cwdFile: packageFileName,\n extraEnv,\n docker: {},\n toolConstraints: [\n { toolName: 'python', constraint: pythonConstraint },\n { toolName: 'poetry', constraint: poetryConstraint },\n ],\n };\n await exec(cmd, execOptions);\n const newPoetryLockContent = await readLocalFile(lockFileName, 'utf8');\n if (existingLockFileContent === newPoetryLockContent) {\n logger.debug(`${lockFileName} is unchanged`);\n return null;\n }\n logger.debug(`Returning updated ${lockFileName}`);\n return [\n {\n file: {\n type: 'addition',\n path: lockFileName,\n contents: newPoetryLockContent,\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 ${lockFileName} file`);\n return [\n {\n artifactError: {\n lockFile: lockFileName,\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/poetry/artifacts.ts"],"names":[],"mappings":";;AA0BA,kDA4BC;AAED,oDAsCC;AAyED,0CAgGC;AAvQD,yCAA+E;AAC/E,iCAA8B;AAC9B,sEAAoE;AACpE,4CAAyC;AAEzC,6CAA0C;AAE1C,yCAM0B;AAC1B,iDAAoE;AACpE,yDAAgD;AAChD,+CAA4C;AAC5C,iDAA8C;AAC9C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,EAAE,UAAU;oBAChB,IAAI,EAAE,YAAY;oBAClB,QAAQ,EAAE,oBAAoB;iBAC/B;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,YAAY,OAAO,CAAC,CAAC;QAC/D,OAAO;YACL;gBACE,aAAa,EAAE;oBACb,QAAQ,EAAE,YAAY;oBACtB,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 { isNonEmptyArray, isNonEmptyObject, isString } from '@sindresorhus/is';\nimport { quote } from 'shlex';\nimport { TEMPORARY_ERROR } from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport type { HostRule } from '../../../types';\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 { getGitEnvironmentVariables } from '../../../util/git/auth';\nimport { find } from '../../../util/host-rules';\nimport { regEx } from '../../../util/regex';\nimport { Result } from '../../../util/result';\nimport { massage as massageToml, parse as parseToml } from '../../../util/toml';\nimport { parseUrl } from '../../../util/url';\nimport { PypiDatasource } from '../../datasource/pypi';\nimport { getGoogleAuthHostRule } from '../../datasource/util';\nimport type { UpdateArtifact, UpdateArtifactsResult } from '../types';\nimport { Lockfile, PoetryPyProject } from './schema';\nimport type { PoetryFile, PoetrySource } from './types';\n\nexport function getPythonConstraint(\n pyProjectContent: string,\n existingLockFileContent: string,\n): string | null {\n // Read Python version from `pyproject.toml` first as it could have been updated\n const pyprojectPythonConstraint = Result.parse(\n massageToml(pyProjectContent),\n PoetryPyProject.transform(\n ({ packageFileContent }) =>\n packageFileContent.deps.find((dep) => dep.depName === 'python')\n ?.currentValue,\n ),\n ).unwrapOrNull();\n if (pyprojectPythonConstraint) {\n logger.debug('Using python version from pyproject.toml');\n return pyprojectPythonConstraint;\n }\n\n const lockfilePythonConstraint = Result.parse(\n existingLockFileContent,\n Lockfile.transform(({ pythonVersions }) => pythonVersions),\n ).unwrapOrNull();\n if (lockfilePythonConstraint) {\n logger.debug('Using python version from poetry.lock');\n return lockfilePythonConstraint;\n }\n\n return null;\n}\n\nexport function getPoetryRequirement(\n pyProjectContent: string,\n existingLockFileContent: string,\n): undefined | string | null {\n // Read Poetry version from first line of poetry.lock\n const firstLine = existingLockFileContent.split('\\n')[0];\n const poetryVersionMatch = regEx(/by Poetry ([\\d\\\\.]+)/).exec(firstLine);\n if (poetryVersionMatch?.[1]) {\n const poetryVersion = poetryVersionMatch[1];\n logger.debug(\n `Using poetry version ${poetryVersion} from poetry.lock header`,\n );\n return poetryVersion;\n }\n\n const { val: lockfilePoetryConstraint } = Result.parse(\n existingLockFileContent,\n Lockfile.transform(({ poetryConstraint }) => poetryConstraint),\n ).unwrap();\n if (lockfilePoetryConstraint) {\n logger.debug(\n `Using poetry version ${lockfilePoetryConstraint} from poetry.lock metadata`,\n );\n return lockfilePoetryConstraint;\n }\n\n const { val: pyprojectPoetryConstraint } = Result.parse(\n massageToml(pyProjectContent),\n PoetryPyProject.transform(({ poetryRequirement }) => poetryRequirement),\n ).unwrap();\n if (pyprojectPoetryConstraint) {\n logger.debug(\n `Using poetry version ${pyprojectPoetryConstraint} from pyproject.toml`,\n );\n return pyprojectPoetryConstraint;\n }\n\n return null;\n}\n\nfunction getPoetrySources(content: string, fileName: string): PoetrySource[] {\n let pyprojectFile: PoetryFile;\n try {\n pyprojectFile = parseToml(massageToml(content)) as PoetryFile;\n } catch (err) {\n logger.debug({ err }, 'Error parsing pyproject.toml file');\n return [];\n }\n if (!pyprojectFile.tool?.poetry) {\n logger.debug(`${fileName} contains no poetry section`);\n return [];\n }\n\n const sources = pyprojectFile.tool?.poetry?.source ?? [];\n const sourceArray: PoetrySource[] = [];\n for (const source of sources) {\n if (source.name && source.url) {\n sourceArray.push({ name: source.name, url: source.url });\n }\n }\n return sourceArray;\n}\n\nasync function getMatchingHostRule(url: string | undefined): Promise<HostRule> {\n const scopedMatch = find({ hostType: PypiDatasource.id, url });\n const hostRule = isNonEmptyObject(scopedMatch) ? scopedMatch : find({ url });\n if (hostRule && Object.keys(hostRule).length !== 0) {\n return hostRule;\n }\n\n const parsedUrl = parseUrl(url);\n if (!parsedUrl) {\n logger.once.debug(`Failed to parse URL ${url}`);\n return {};\n }\n\n if (parsedUrl.hostname.endsWith('.pkg.dev')) {\n const hostRule = await getGoogleAuthHostRule();\n if (hostRule && Object.keys(hostRule).length !== 0) {\n return hostRule;\n }\n logger.once.debug(`Could not get Google access token (url=${url})`);\n }\n\n return {};\n}\n\nasync function getSourceCredentialVars(\n pyprojectContent: string,\n packageFileName: string,\n): Promise<NodeJS.ProcessEnv> {\n const poetrySources = getPoetrySources(pyprojectContent, packageFileName);\n const envVars: NodeJS.ProcessEnv = {};\n\n for (const source of poetrySources) {\n const matchingHostRule = await getMatchingHostRule(source.url);\n const formattedSourceName = source.name\n .replace(regEx(/(\\.|-)+/g), '_')\n .toUpperCase();\n if (matchingHostRule.username) {\n envVars[`POETRY_HTTP_BASIC_${formattedSourceName}_USERNAME`] =\n matchingHostRule.username;\n }\n if (matchingHostRule.password) {\n envVars[`POETRY_HTTP_BASIC_${formattedSourceName}_PASSWORD`] =\n matchingHostRule.password;\n }\n }\n return envVars;\n}\n\nexport async function updateArtifacts({\n packageFileName,\n updatedDeps,\n newPackageFileContent,\n config,\n}: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> {\n logger.debug(`poetry.updateArtifacts(${packageFileName})`);\n const { isLockFileMaintenance } = config;\n\n if (!isNonEmptyArray(updatedDeps) && !isLockFileMaintenance) {\n logger.debug('No updated poetry deps - returning null');\n return null;\n }\n // Try poetry.lock first\n let lockFileName = getSiblingFileName(packageFileName, 'poetry.lock');\n let existingLockFileContent = await readLocalFile(lockFileName, 'utf8');\n if (!existingLockFileContent) {\n // Try pyproject.lock next\n lockFileName = getSiblingFileName(packageFileName, 'pyproject.lock');\n existingLockFileContent = await readLocalFile(lockFileName, 'utf8');\n if (!existingLockFileContent) {\n logger.debug(`No lock file found`);\n return null;\n }\n }\n logger.debug(`Updating ${lockFileName}`);\n try {\n await writeLocalFile(packageFileName, newPackageFileContent);\n const cmd: string[] = [];\n if (isLockFileMaintenance) {\n await deleteLocalFile(lockFileName);\n cmd.push('poetry update --lock --no-interaction');\n } else {\n cmd.push(\n `poetry update --lock --no-interaction ${updatedDeps\n .map((dep) => dep.depName)\n .filter(isString)\n .map((dep) => quote(dep))\n .join(' ')}`,\n );\n }\n const pythonConstraint =\n config?.constraints?.python ??\n getPythonConstraint(newPackageFileContent, existingLockFileContent);\n const poetryConstraint =\n config.constraints?.poetry ??\n getPoetryRequirement(newPackageFileContent, existingLockFileContent);\n const extraEnv = {\n ...(await getSourceCredentialVars(\n newPackageFileContent,\n packageFileName,\n )),\n ...getGitEnvironmentVariables(['poetry']),\n PIP_CACHE_DIR: await ensureCacheDir('pip'),\n };\n\n const execOptions: ExecOptions = {\n cwdFile: packageFileName,\n extraEnv,\n docker: {},\n toolConstraints: [\n { toolName: 'python', constraint: pythonConstraint },\n { toolName: 'poetry', constraint: poetryConstraint },\n ],\n };\n await exec(cmd, execOptions);\n const newPoetryLockContent = await readLocalFile(lockFileName, 'utf8');\n if (existingLockFileContent === newPoetryLockContent) {\n logger.debug(`${lockFileName} is unchanged`);\n return null;\n }\n logger.debug(`Returning updated ${lockFileName}`);\n return [\n {\n file: {\n type: 'addition',\n path: lockFileName,\n contents: newPoetryLockContent,\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 ${lockFileName} file`);\n return [\n {\n artifactError: {\n lockFile: lockFileName,\n stderr: `${String(err.stdout)}\\n${String(err.stderr)}`,\n },\n },\n ];\n }\n}\n"]}
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.extractPackageFile = extractPackageFile;
4
- const tslib_1 = require("tslib");
5
- const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
4
+ const is_1 = require("@sindresorhus/is");
6
5
  const logger_1 = require("../../../logger");
7
6
  const filter_map_1 = require("../../../util/filter-map");
8
7
  const fs_1 = require("../../../util/fs");
@@ -46,7 +45,7 @@ async function extractPackageFile(content, packageFile) {
46
45
  return null;
47
46
  }
48
47
  const extractedConstraints = {};
49
- if (is_1.default.nonEmptyString(pythonVersion)) {
48
+ if ((0, is_1.isNonEmptyString)(pythonVersion)) {
50
49
  extractedConstraints.python = pythonVersion;
51
50
  }
52
51
  res.extractedConstraints = extractedConstraints;
@@ -1 +1 @@
1
- {"version":3,"file":"extract.js","sourceRoot":"","sources":["../../../../lib/modules/manager/poetry/extract.ts"],"names":[],"mappings":";;AAcA,gDAsEC;;AApFD,kEAAkC;AAClC,4CAAyC;AACzC,yDAAqD;AACrD,yCAI0B;AAC1B,iDAA8C;AAC9C,6CAA4D;AAC5D,sEAA4E;AAE5E,qCAAqD;AAE9C,KAAK,UAAU,kBAAkB,CACtC,OAAe,EACf,WAAmB;IAEnB,eAAM,CAAC,KAAK,CAAC,6BAA6B,WAAW,GAAG,CAAC,CAAC;IAC1D,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,eAAM,CAAC,KAAK,CACpC,IAAA,cAAW,EAAC,OAAO,CAAC,EACpB,wBAAe,CAAC,SAAS,CAAC,CAAC,EAAE,kBAAkB,EAAE,EAAE,EAAE,CAAC,kBAAkB,CAAC,CAC1E,CAAC,MAAM,EAAE,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,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,oBAAoB,GAAwB,EAAE,CAAC;IAErD,IAAI,YAAE,CAAC,cAAc,CAAC,aAAa,CAAC,EAAE,CAAC;QACrC,oBAAoB,CAAC,MAAM,GAAG,aAAa,CAAC;IAC9C,CAAC;IACD,GAAG,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;IAEhD,wBAAwB;IACxB,IAAI,QAAQ,GAAG,IAAA,uBAAkB,EAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IAC9D,uBAAuB;IACvB,IAAI,MAAM,IAAA,oBAAe,EAAC,QAAQ,CAAC,EAAE,CAAC;QACpC,GAAG,CAAC,SAAS,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC7B,CAAC;SAAM,CAAC;QACN,0BAA0B;QAC1B,QAAQ,GAAG,IAAA,uBAAkB,EAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC;QAC7D,IAAI,MAAM,IAAA,oBAAe,EAAC,QAAQ,CAAC,EAAE,CAAC;YACpC,GAAG,CAAC,SAAS,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { logger } from '../../../logger';\nimport { filterMap } from '../../../util/filter-map';\nimport {\n getSiblingFileName,\n localPathExists,\n readLocalFile,\n} from '../../../util/fs';\nimport { Result } from '../../../util/result';\nimport { massage as massageToml } from '../../../util/toml';\nimport { GithubReleasesDatasource } from '../../datasource/github-releases';\nimport type { PackageFileContent } from '../types';\nimport { Lockfile, PoetryPyProject } from './schema';\n\nexport async function extractPackageFile(\n content: string,\n packageFile: string,\n): Promise<PackageFileContent | null> {\n logger.trace(`poetry.extractPackageFile(${packageFile})`);\n const { val: res, err } = Result.parse(\n massageToml(content),\n PoetryPyProject.transform(({ packageFileContent }) => packageFileContent),\n ).unwrap();\n if (err) {\n logger.debug({ packageFile, err }, `Poetry: error parsing pyproject.toml`);\n return null;\n }\n\n const lockfileName = getSiblingFileName(packageFile, 'poetry.lock');\n const lockContents = (await readLocalFile(lockfileName, 'utf8'))!;\n const lockfileMapping = Result.parse(\n lockContents,\n Lockfile.transform(({ lock }) => lock),\n ).unwrapOr({});\n\n let pythonVersion: string | undefined;\n filterMap(res.deps, (dep) => {\n if (dep.depName === 'python') {\n if (dep.currentValue) {\n pythonVersion = dep.currentValue;\n }\n return {\n ...dep,\n // We use containerbase python as source, as there are a lot docker tags which can cause\n // issues with poetry versioning.\n packageName: 'containerbase/python-prebuild',\n datasource: GithubReleasesDatasource.id,\n commitMessageTopic: 'Python',\n registryUrls: null,\n };\n }\n\n const packageName = dep.packageName ?? dep.depName;\n if (packageName && packageName in lockfileMapping) {\n dep.lockedVersion = lockfileMapping[packageName];\n }\n\n return dep;\n });\n\n if (!res.deps.length) {\n return null;\n }\n\n const extractedConstraints: Record<string, any> = {};\n\n if (is.nonEmptyString(pythonVersion)) {\n extractedConstraints.python = pythonVersion;\n }\n res.extractedConstraints = extractedConstraints;\n\n // Try poetry.lock first\n let lockFile = getSiblingFileName(packageFile, 'poetry.lock');\n // istanbul ignore next\n if (await localPathExists(lockFile)) {\n res.lockFiles = [lockFile];\n } else {\n // Try pyproject.lock next\n lockFile = getSiblingFileName(packageFile, 'pyproject.lock');\n if (await localPathExists(lockFile)) {\n res.lockFiles = [lockFile];\n }\n }\n return res;\n}\n"]}
1
+ {"version":3,"file":"extract.js","sourceRoot":"","sources":["../../../../lib/modules/manager/poetry/extract.ts"],"names":[],"mappings":";;AAcA,gDAsEC;AApFD,yCAAoD;AACpD,4CAAyC;AACzC,yDAAqD;AACrD,yCAI0B;AAC1B,iDAA8C;AAC9C,6CAA4D;AAC5D,sEAA4E;AAE5E,qCAAqD;AAE9C,KAAK,UAAU,kBAAkB,CACtC,OAAe,EACf,WAAmB;IAEnB,eAAM,CAAC,KAAK,CAAC,6BAA6B,WA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AW,GAAG,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,OAAO,CAAC;QACnD,IAAI,WAAW,IAAI,WAAW,IAAI,eAAe,EAAE,CAAC;YAClD,GAAG,CAAC,aAAa,GAAG,eAAe,CAAC,WAAW,CAAC,CAAC;QACnD,CAAC;QAED,OAAO,GAAG,CAAC;IACb,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,oBAAoB,GAAwB,EAAE,CAAC;IAErD,IAAI,IAAA,qBAAgB,EAAC,aAAa,CAAC,EAAE,CAAC;QACpC,oBAAoB,CAAC,MAAM,GAAG,aAAa,CAAC;IAC9C,CAAC;IACD,GAAG,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;IAEhD,wBAAwB;IACxB,IAAI,QAAQ,GAAG,IAAA,uBAAkB,EAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IAC9D,uBAAuB;IACvB,IAAI,MAAM,IAAA,oBAAe,EAAC,QAAQ,CAAC,EAAE,CAAC;QACpC,GAAG,CAAC,SAAS,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC7B,CAAC;SAAM,CAAC;QACN,0BAA0B;QAC1B,QAAQ,GAAG,IAAA,uBAAkB,EAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC;QAC7D,IAAI,MAAM,IAAA,oBAAe,EAAC,QAAQ,CAAC,EAAE,CAAC;YACpC,GAAG,CAAC,SAAS,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC7B,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["import { isNonEmptyString } from '@sindresorhus/is';\nimport { logger } from '../../../logger';\nimport { filterMap } from '../../../util/filter-map';\nimport {\n getSiblingFileName,\n localPathExists,\n readLocalFile,\n} from '../../../util/fs';\nimport { Result } from '../../../util/result';\nimport { massage as massageToml } from '../../../util/toml';\nimport { GithubReleasesDatasource } from '../../datasource/github-releases';\nimport type { PackageFileContent } from '../types';\nimport { Lockfile, PoetryPyProject } from './schema';\n\nexport async function extractPackageFile(\n content: string,\n packageFile: string,\n): Promise<PackageFileContent | null> {\n logger.trace(`poetry.extractPackageFile(${packageFile})`);\n const { val: res, err } = Result.parse(\n massageToml(content),\n PoetryPyProject.transform(({ packageFileContent }) => packageFileContent),\n ).unwrap();\n if (err) {\n logger.debug({ packageFile, err }, `Poetry: error parsing pyproject.toml`);\n return null;\n }\n\n const lockfileName = getSiblingFileName(packageFile, 'poetry.lock');\n const lockContents = (await readLocalFile(lockfileName, 'utf8'))!;\n const lockfileMapping = Result.parse(\n lockContents,\n Lockfile.transform(({ lock }) => lock),\n ).unwrapOr({});\n\n let pythonVersion: string | undefined;\n filterMap(res.deps, (dep) => {\n if (dep.depName === 'python') {\n if (dep.currentValue) {\n pythonVersion = dep.currentValue;\n }\n return {\n ...dep,\n // We use containerbase python as source, as there are a lot docker tags which can cause\n // issues with poetry versioning.\n packageName: 'containerbase/python-prebuild',\n datasource: GithubReleasesDatasource.id,\n commitMessageTopic: 'Python',\n registryUrls: null,\n };\n }\n\n const packageName = dep.packageName ?? dep.depName;\n if (packageName && packageName in lockfileMapping) {\n dep.lockedVersion = lockfileMapping[packageName];\n }\n\n return dep;\n });\n\n if (!res.deps.length) {\n return null;\n }\n\n const extractedConstraints: Record<string, any> = {};\n\n if (isNonEmptyString(pythonVersion)) {\n extractedConstraints.python = pythonVersion;\n }\n res.extractedConstraints = extractedConstraints;\n\n // Try poetry.lock first\n let lockFile = getSiblingFileName(packageFile, 'poetry.lock');\n // istanbul ignore next\n if (await localPathExists(lockFile)) {\n res.lockFiles = [lockFile];\n } else {\n // Try pyproject.lock next\n lockFile = getSiblingFileName(packageFile, 'pyproject.lock');\n if (await localPathExists(lockFile)) {\n res.lockFiles = [lockFile];\n }\n }\n return res;\n}\n"]}
@@ -127,6 +127,7 @@ export declare const PoetryPyProject: z.ZodPipeline<z.ZodEffects<z.ZodString, un
127
127
  'dev-dependencies'?: Record<string, any> | undefined;
128
128
  };
129
129
  }>>>;
130
+ 'dependency-groups': z.ZodCatch<z.ZodType<PackageDependency<Record<string, any>>[], z.ZodTypeDef, PackageDependency<Record<string, any>>[]>>;
130
131
  'build-system': z.ZodCatch<z.ZodOptional<z.ZodEffects<z.ZodObject<{
131
132
  'build-backend': z.ZodEffects<z.ZodString, "poetry.masonry.api" | "poetry.core.masonry.api", string>;
132
133
  requires: z.ZodEffects<z.ZodEffects<z.ZodArray<z.ZodAny, "many">, {
@@ -144,6 +145,7 @@ export declare const PoetryPyProject: z.ZodPipeline<z.ZodEffects<z.ZodString, un
144
145
  'build-backend': string;
145
146
  }>>>;
146
147
  }, "strip", z.ZodTypeAny, {
148
+ 'dependency-groups': PackageDependency<Record<string, any>>[];
147
149
  project?: {
148
150
  dependencies: PackageDependency<Record<string, any>>[];
149
151
  'optional-dependencies': PackageDependency<Record<string, any>>[];
@@ -167,6 +169,7 @@ export declare const PoetryPyProject: z.ZodPipeline<z.ZodEffects<z.ZodString, un
167
169
  }, {
168
170
  project?: unknown;
169
171
  tool?: unknown;
172
+ 'dependency-groups'?: unknown;
170
173
  'build-system'?: unknown;
171
174
  }>, {
172
175
  packageFileContent: PackageFileContent<Record<string, any>>;
@@ -174,6 +177,7 @@ export declare const PoetryPyProject: z.ZodPipeline<z.ZodEffects<z.ZodString, un
174
177
  }, {
175
178
  project?: unknown;
176
179
  tool?: unknown;
180
+ 'dependency-groups'?: unknown;
177
181
  'build-system'?: unknown;
178
182
  }>>;
179
183
  export type PoetryPyProject = z.infer<typeof PoetryPyProject>;
@@ -19,6 +19,7 @@ const gitVersioning = tslib_1.__importStar(require("../../versioning/git"));
19
19
  const pep440Versioning = tslib_1.__importStar(require("../../versioning/pep440"));
20
20
  const poetryVersioning = tslib_1.__importStar(require("../../versioning/poetry"));
21
21
  const schema_1 = require("../pep621/schema");
22
+ const utils_1 = require("../pep621/utils");
22
23
  const extract_1 = require("../pip_requirements/extract");
23
24
  const PoetryOptionalDependencyMixin = zod_1.z
24
25
  .object({
@@ -251,6 +252,7 @@ exports.PoetryPyProject = schema_utils_1.Toml.pipe(zod_1.z
251
252
  .object({
252
253
  project: schema_1.ProjectSection.optional().catch(undefined),
253
254
  tool: zod_1.z.object({ poetry: exports.PoetrySection }).optional().catch(undefined),
255
+ 'dependency-groups': (0, schema_1.DependencyGroup)(utils_1.depTypes.dependencyGroups).catch([]),
254
256
  'build-system': zod_1.z
255
257
  .object({
256
258
  'build-backend': zod_1.z.string().refine(
@@ -266,7 +268,8 @@ exports.PoetryPyProject = schema_utils_1.Toml.pipe(zod_1.z
266
268
  .optional()
267
269
  .catch(undefined),
268
270
  })
269
- .transform(({ project, tool, 'build-system': poetryRequirement }) => {
271
+ .transform((pyproject) => {
272
+ const { project, tool, 'build-system': poetryRequirement, 'dependency-groups': dependencyGroups, } = pyproject;
270
273
  const deps = [];
271
274
  const projectDependencies = project?.dependencies;
272
275
  if (projectDependencies) {
@@ -276,6 +279,7 @@ exports.PoetryPyProject = schema_utils_1.Toml.pipe(zod_1.z
276
279
  if (projectOptionalDependencies) {
277
280
  deps.push(...projectOptionalDependencies);
278
281
  }
282
+ deps.push(...dependencyGroups);
279
283
  const poetryDependencies = tool?.poetry?.dependencies;
280
284
  if (poetryDependencies) {
281
285
  deps.push(...poetryDependencies);
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../lib/modules/manager/poetry/schema.ts"],"names":[],"mappings":";;;;AAAA,6BAAwB;AACxB,4CAAyC;AACzC,2CAA2C;AAC3C,+CAAoD;AACpD,+CAA4C;AAC5C,6DAKoC;AACpC,6CAA0C;AAC1C,wDAA8D;AAC9D,wDAA8D;AAC9D,8DAAoE;AACpE,8DAAoE;AACpE,gDAAuD;AACvD,yDAAsE;AACtE,4EAAsD;AACtD,kFAA4D;AAC5D,kFAA4D;AAC5D,6CAAkD;AAClD,yDAAgE;AAGhE,MAAM,6BA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;QACN,cAAc,EAAE,OAAC;aACd,MAAM,EAAE;aACR,SAAS,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;aACzD,QAAQ,EAAE;aACV,KAAK,CAAC,SAAS,CAAC;QACnB,iBAAiB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC;KAC1D,CAAC;SACD,SAAS,CACR,CAAC,EACC,cAAc,EAAE,gBAAgB,EAChC,iBAAiB,EAAE,cAAc,GAClC,EAAE,EAAE,CAAC,CAAC;QACL,gBAAgB;QAChB,cAAc;KACf,CAAC,CACH;SACA,KAAK,CAAC;QACL,gBAAgB,EAAE,SAAS;QAC3B,cAAc,EAAE,SAAS;KAC1B,CAAC;CACL,CAAC,CACH,CAAC,SAAS,CACT,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,gBAAgB,EAAE,cAAc,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IACtE,IAAI;IACJ,gBAAgB;IAChB,cAAc;CACf,CAAC,CACH,CAAC","sourcesContent":["import { z } from 'zod';\nimport { logger } from '../../../logger';\nimport { getEnv } from '../../../util/env';\nimport { parseGitUrl } from '../../../util/git/url';\nimport { regEx } from '../../../util/regex';\nimport {\n LooseArray,\n LooseRecord,\n Toml,\n withDepType,\n} from '../../../util/schema-utils';\nimport { uniq } from '../../../util/uniq';\nimport { GitRefsDatasource } from '../../datasource/git-refs';\nimport { GitTagsDatasource } from '../../datasource/git-tags';\nimport { GithubTagsDatasource } from '../../datasource/github-tags';\nimport { GitlabTagsDatasource } from '../../datasource/gitlab-tags';\nimport { PypiDatasource } from '../../datasource/pypi';\nimport { normalizePythonDepName } from '../../datasource/pypi/common';\nimport * as gitVersioning from '../../versioning/git';\nimport * as pep440Versioning from '../../versioning/pep440';\nimport * as poetryVersioning from '../../versioning/poetry';\nimport { ProjectSection } from '../pep621/schema';\nimport { dependencyPattern } from '../pip_requirements/extract';\nimport type { PackageDependency, PackageFileContent } from '../types';\n\nconst PoetryOptionalDependencyMixin = z\n .object({\n optional: z.boolean().optional().catch(false),\n })\n .transform(\n ({ optional }): PackageDependency =>\n optional ? { depType: 'extras' } : {},\n );\n\nconst PoetryPathDependency = z\n .object({\n path: z.string(),\n version: z.string().optional().catch(undefined),\n })\n .transform(({ version }): PackageDependency => {\n const dep: PackageDependency = {\n datasource: PypiDatasource.id,\n skipReason: 'path-dependency',\n };\n\n if (version) {\n dep.currentValue = version;\n }\n\n return dep;\n })\n .and(PoetryOptionalDependencyMixin);\n\nconst PoetryGitDependency = z\n .object({\n git: z.string(),\n tag: z.string().optional().catch(undefined),\n version: z.string().optional().catch(undefined),\n branch: z.string().optional().catch(undefined),\n rev: z.string().optional().catch(undefined),\n })\n .transform(({ git, tag, version, branch, rev }): PackageDependency => {\n if (tag) {\n const { source, owner, name } = parseGitUrl(git);\n const repo = `${owner}/${name}`;\n if (source === 'github.com') {\n return {\n datasource: GithubTagsDatasource.id,\n currentValue: tag,\n packageName: repo,\n };\n } else if (source === 'gitlab.com') {\n return {\n datasource: GitlabTagsDatasource.id,\n currentValue: tag,\n packageName: repo,\n };\n } else {\n return {\n datasource: GitTagsDatasource.id,\n currentValue: tag,\n packageName: git,\n };\n }\n }\n\n if (rev) {\n return {\n datasource: GitRefsDatasource.id,\n currentValue: branch,\n currentDigest: rev,\n replaceString: rev,\n packageName: git,\n };\n }\n\n return {\n datasource: GitRefsDatasource.id,\n currentValue: version,\n packageName: git,\n skipReason: 'git-dependency',\n };\n })\n .and(PoetryOptionalDependencyMixin);\n\nconst PoetryPypiDependency = z.union([\n z\n .object({ version: z.string().optional(), source: z.string().optional() })\n .transform(({ version: currentValue, source }): PackageDependency => {\n if (!currentValue) {\n return { datasource: PypiDatasource.id };\n }\n\n return {\n datasource: PypiDatasource.id,\n managerData: {\n nestedVersion: true,\n ...(source ? { sourceName: source.toLowerCase() } : {}),\n },\n currentValue,\n };\n })\n .and(PoetryOptionalDependencyMixin),\n z.string().transform(\n (version): PackageDependency => ({\n datasource: PypiDatasource.id,\n currentValue: version,\n managerData: { nestedVersion: false },\n }),\n ),\n]);\n\nconst PoetryArrayDependency = z.array(z.unknown()).transform(\n (): PackageDependency => ({\n datasource: PypiDatasource.id,\n skipReason: 'multiple-constraint-dep',\n }),\n);\n\nconst PoetryDependency = z.union([\n PoetryPathDependency,\n PoetryGitDependency,\n PoetryPypiDependency,\n PoetryArrayDependency,\n]);\n\nexport const PoetryDependencies = LooseRecord(\n z.string(),\n PoetryDependency.transform((dep) => {\n if (dep.skipReason) {\n return dep;\n }\n\n if (dep.datasource === GitRefsDatasource.id && dep.currentDigest) {\n dep.versioning = gitVersioning.id;\n return dep;\n }\n\n // istanbul ignore if: normaly should not happen\n if (!dep.currentValue) {\n dep.skipReason = 'unspecified-version';\n return dep;\n }\n\n if (pep440Versioning.isValid(dep.currentValue)) {\n dep.versioning = pep440Versioning.id;\n return dep;\n }\n\n if (poetryVersioning.isValid(dep.currentValue)) {\n dep.versioning = poetryVersioning.id;\n return dep;\n }\n\n dep.skipReason = 'invalid-version';\n return dep;\n }),\n).transform((record) => {\n const deps: PackageDependency[] = [];\n for (const [depName, dep] of Object.entries(record)) {\n dep.depName = depName;\n if (!dep.packageName) {\n const packageName = normalizePythonDepName(depName);\n if (depName !== packageName) {\n dep.packageName = packageName;\n }\n }\n deps.push(dep);\n }\n return deps;\n});\n\nexport const PoetryGroupDependencies = LooseRecord(\n z.string(),\n z\n .object({ dependencies: PoetryDependencies })\n .transform(({ dependencies }) => dependencies),\n).transform((record) => {\n const deps: PackageDependency[] = [];\n for (const [name, val] of Object.entries(record)) {\n for (const dep of Object.values(val)) {\n dep.depType = name;\n deps.push(dep);\n }\n }\n return deps;\n});\n\nconst PoetrySourceOrder = [\n 'default',\n 'primary',\n 'secondary',\n 'supplemental',\n 'explicit',\n] as const;\n\nexport const PoetrySource = z.object({\n name: z.string().toLowerCase(),\n url: z.string().optional(),\n priority: z.enum(PoetrySourceOrder).default('primary'),\n});\nexport type PoetrySource = z.infer<typeof PoetrySource>;\n\nexport const PoetrySources = LooseArray(PoetrySource, {\n onError: ({ error: err }) => {\n logger.debug({ err }, 'Poetry: error parsing sources array');\n },\n})\n .transform((sources) => {\n const pypiUrl = getEnv().PIP_INDEX_URL ?? 'https://pypi.org/pypi/';\n const result: PoetrySource[] = [];\n\n let overridesPyPi = false;\n let hasDefaultSource = false;\n let hasPrimarySource = false;\n for (const source of sources) {\n if (source.name === 'pypi') {\n source.url = pypiUrl;\n overridesPyPi = true;\n }\n\n if (!source.url) {\n continue;\n }\n\n if (source.priority === 'default') {\n hasDefaultSource = true;\n } else if (source.priority === 'primary') {\n hasPrimarySource = true;\n }\n\n result.push(source);\n }\n\n if (sources.length && !hasDefaultSource && !overridesPyPi) {\n result.push({\n name: 'pypi',\n priority: hasPrimarySource ? 'secondary' : 'default',\n url: pypiUrl,\n });\n }\n\n result.sort(\n (a, b) =>\n PoetrySourceOrder.indexOf(a.priority) -\n PoetrySourceOrder.indexOf(b.priority),\n );\n\n return result;\n })\n .catch([]);\n\nexport const PoetrySection = z.object({\n version: z.string().optional().catch(undefined),\n dependencies: withDepType(\n PoetryDependencies,\n 'dependencies',\n false,\n ).optional(),\n 'dev-dependencies': withDepType(\n PoetryDependencies,\n 'dev-dependencies',\n ).optional(),\n group: PoetryGroupDependencies.optional(),\n source: PoetrySources,\n});\n\nexport type PoetrySection = z.infer<typeof PoetrySection>;\n\nconst BuildSystemRequireVal = z\n .string()\n .nonempty()\n .transform((val) => regEx(`^${dependencyPattern}$`).exec(val))\n .transform((match, ctx) => {\n if (!match) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: 'invalid requirement',\n });\n return z.NEVER;\n }\n\n const [, depName, , poetryRequirement] = match;\n return { depName, poetryRequirement };\n });\n\nexport const PoetryPyProject = Toml.pipe(\n z\n .object({\n project: ProjectSection.optional().catch(undefined),\n tool: z.object({ poetry: PoetrySection }).optional().catch(undefined),\n 'build-system': z\n .object({\n 'build-backend': z.string().refine(\n // https://python-poetry.org/docs/pyproject/#poetry-and-pep-517\n (buildBackend) =>\n buildBackend === 'poetry.masonry.api' ||\n buildBackend === 'poetry.core.masonry.api',\n ),\n requires: LooseArray(BuildSystemRequireVal).transform((vals) => {\n const req = vals.find(\n ({ depName }) =>\n depName === 'poetry' || depName === 'poetry_core',\n );\n return req?.poetryRequirement;\n }),\n })\n .transform(({ requires: poetryRequirement }) => poetryRequirement)\n .optional()\n .catch(undefined),\n })\n .transform(({ project, tool, 'build-system': poetryRequirement }) => {\n const deps: PackageDependency[] = [];\n\n const projectDependencies = project?.dependencies;\n if (projectDependencies) {\n deps.push(...projectDependencies);\n }\n\n const projectOptionalDependencies = project?.['optional-dependencies'];\n if (projectOptionalDependencies) {\n deps.push(...projectOptionalDependencies);\n }\n\n const poetryDependencies = tool?.poetry?.dependencies;\n if (poetryDependencies) {\n deps.push(...poetryDependencies);\n }\n\n const poetryDevDependencies = tool?.poetry?.['dev-dependencies'];\n if (poetryDevDependencies) {\n deps.push(...poetryDevDependencies);\n }\n\n const poetryGroupDependencies = tool?.poetry?.group;\n if (poetryGroupDependencies) {\n deps.push(...poetryGroupDependencies);\n }\n\n const packageFileVersion = tool?.poetry?.version;\n const packageFileContent: PackageFileContent = {\n deps,\n packageFileVersion,\n };\n\n const sourceUrls = tool?.poetry?.source;\n if (sourceUrls) {\n for (const dep of deps) {\n if (dep.managerData?.sourceName) {\n const sourceUrl = sourceUrls.find(\n ({ name }) => name === dep.managerData?.sourceName,\n );\n if (sourceUrl?.url) {\n dep.registryUrls = [sourceUrl.url];\n }\n }\n }\n\n const sourceUrlsFiltered = sourceUrls.filter(\n ({ priority }) => priority !== 'explicit',\n );\n if (sourceUrlsFiltered.length) {\n packageFileContent.registryUrls = uniq(\n sourceUrlsFiltered.map(({ url }) => url!),\n );\n }\n }\n\n return { packageFileContent, poetryRequirement };\n }),\n);\n\nexport type PoetryPyProject = z.infer<typeof PoetryPyProject>;\n\nconst poetryConstraint: Record<string, string> = {\n '1.0': '<1.1.0',\n '1.1': '<1.3.0',\n '2.0': '>=1.3.0 <1.4.0', // 1.4.0 introduced embedding of the poetry version in lock file header\n};\n\nexport const Lockfile = Toml.pipe(\n z.object({\n package: LooseArray(\n z\n .object({\n name: z.string(),\n version: z.string(),\n })\n .transform(({ name, version }): [string, string] => [name, version]),\n )\n .transform((entries) => Object.fromEntries(entries))\n .catch({}),\n metadata: z\n .object({\n 'lock-version': z\n .string()\n .transform((lockVersion) => poetryConstraint[lockVersion])\n .optional()\n .catch(undefined),\n 'python-versions': z.string().optional().catch(undefined),\n })\n .transform(\n ({\n 'lock-version': poetryConstraint,\n 'python-versions': pythonVersions,\n }) => ({\n poetryConstraint,\n pythonVersions,\n }),\n )\n .catch({\n poetryConstraint: undefined,\n pythonVersions: undefined,\n }),\n }),\n).transform(\n ({ package: lock, metadata: { poetryConstraint, pythonVersions } }) => ({\n lock,\n poetryConstraint,\n pythonVersions,\n }),\n);\n"]}
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../lib/modules/manager/poetry/schema.ts"],"names":[],"mappings":";;;;AAAA,6BAAwB;AACxB,4CAAyC;AACzC,2CAA2C;AAC3C,+CAAoD;AACpD,+CAA4C;AAC5C,6DAKoC;AACpC,6CAA0C;AAC1C,wDAA8D;AAC9D,wDAA8D;AAC9D,8DAAoE;AACpE,8DAAoE;AACpE,gDAAuD;AACvD,yDAAsE;AACtE,4EAAsD;AACtD,kFAA4D;AAC5D,kFAA4D;AAC5D,6CAAmE;AACnE,2CAA2C;AAC3C,yDAAgE;AAGhE,MAAM,6BAA6B,GAAG,OAAC;KACpC,MAAM,CAAC;IACN,QAAQ,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC;CAC9C,CAAC;KACD,SAAS,CACR,CAAC,EAAE,QAAQ,EAAE,EAAqB,EAAE,CACl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,OAAC;SACR,MAAM,CAAC;QACN,cAAc,EAAE,OAAC;aACd,MAAM,EAAE;aACR,SAAS,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;aACzD,QAAQ,EAAE;aACV,KAAK,CAAC,SAAS,CAAC;QACnB,iBAAiB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC;KAC1D,CAAC;SACD,SAAS,CACR,CAAC,EACC,cAAc,EAAE,gBAAgB,EAChC,iBAAiB,EAAE,cAAc,GAClC,EAAE,EAAE,CAAC,CAAC;QACL,gBAAgB;QAChB,cAAc;KACf,CAAC,CACH;SACA,KAAK,CAAC;QACL,gBAAgB,EAAE,SAAS;QAC3B,cAAc,EAAE,SAAS;KAC1B,CAAC;CACL,CAAC,CACH,CAAC,SAAS,CACT,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,gBAAgB,EAAE,cAAc,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IACtE,IAAI;IACJ,gBAAgB;IAChB,cAAc;CACf,CAAC,CACH,CAAC","sourcesContent":["import { z } from 'zod';\nimport { logger } from '../../../logger';\nimport { getEnv } from '../../../util/env';\nimport { parseGitUrl } from '../../../util/git/url';\nimport { regEx } from '../../../util/regex';\nimport {\n LooseArray,\n LooseRecord,\n Toml,\n withDepType,\n} from '../../../util/schema-utils';\nimport { uniq } from '../../../util/uniq';\nimport { GitRefsDatasource } from '../../datasource/git-refs';\nimport { GitTagsDatasource } from '../../datasource/git-tags';\nimport { GithubTagsDatasource } from '../../datasource/github-tags';\nimport { GitlabTagsDatasource } from '../../datasource/gitlab-tags';\nimport { PypiDatasource } from '../../datasource/pypi';\nimport { normalizePythonDepName } from '../../datasource/pypi/common';\nimport * as gitVersioning from '../../versioning/git';\nimport * as pep440Versioning from '../../versioning/pep440';\nimport * as poetryVersioning from '../../versioning/poetry';\nimport { DependencyGroup, ProjectSection } from '../pep621/schema';\nimport { depTypes } from '../pep621/utils';\nimport { dependencyPattern } from '../pip_requirements/extract';\nimport type { PackageDependency, PackageFileContent } from '../types';\n\nconst PoetryOptionalDependencyMixin = z\n .object({\n optional: z.boolean().optional().catch(false),\n })\n .transform(\n ({ optional }): PackageDependency =>\n optional ? { depType: 'extras' } : {},\n );\n\nconst PoetryPathDependency = z\n .object({\n path: z.string(),\n version: z.string().optional().catch(undefined),\n })\n .transform(({ version }): PackageDependency => {\n const dep: PackageDependency = {\n datasource: PypiDatasource.id,\n skipReason: 'path-dependency',\n };\n\n if (version) {\n dep.currentValue = version;\n }\n\n return dep;\n })\n .and(PoetryOptionalDependencyMixin);\n\nconst PoetryGitDependency = z\n .object({\n git: z.string(),\n tag: z.string().optional().catch(undefined),\n version: z.string().optional().catch(undefined),\n branch: z.string().optional().catch(undefined),\n rev: z.string().optional().catch(undefined),\n })\n .transform(({ git, tag, version, branch, rev }): PackageDependency => {\n if (tag) {\n const { source, owner, name } = parseGitUrl(git);\n const repo = `${owner}/${name}`;\n if (source === 'github.com') {\n return {\n datasource: GithubTagsDatasource.id,\n currentValue: tag,\n packageName: repo,\n };\n } else if (source === 'gitlab.com') {\n return {\n datasource: GitlabTagsDatasource.id,\n currentValue: tag,\n packageName: repo,\n };\n } else {\n return {\n datasource: GitTagsDatasource.id,\n currentValue: tag,\n packageName: git,\n };\n }\n }\n\n if (rev) {\n return {\n datasource: GitRefsDatasource.id,\n currentValue: branch,\n currentDigest: rev,\n replaceString: rev,\n packageName: git,\n };\n }\n\n return {\n datasource: GitRefsDatasource.id,\n currentValue: version,\n packageName: git,\n skipReason: 'git-dependency',\n };\n })\n .and(PoetryOptionalDependencyMixin);\n\nconst PoetryPypiDependency = z.union([\n z\n .object({ version: z.string().optional(), source: z.string().optional() })\n .transform(({ version: currentValue, source }): PackageDependency => {\n if (!currentValue) {\n return { datasource: PypiDatasource.id };\n }\n\n return {\n datasource: PypiDatasource.id,\n managerData: {\n nestedVersion: true,\n ...(source ? { sourceName: source.toLowerCase() } : {}),\n },\n currentValue,\n };\n })\n .and(PoetryOptionalDependencyMixin),\n z.string().transform(\n (version): PackageDependency => ({\n datasource: PypiDatasource.id,\n currentValue: version,\n managerData: { nestedVersion: false },\n }),\n ),\n]);\n\nconst PoetryArrayDependency = z.array(z.unknown()).transform(\n (): PackageDependency => ({\n datasource: PypiDatasource.id,\n skipReason: 'multiple-constraint-dep',\n }),\n);\n\nconst PoetryDependency = z.union([\n PoetryPathDependency,\n PoetryGitDependency,\n PoetryPypiDependency,\n PoetryArrayDependency,\n]);\n\nexport const PoetryDependencies = LooseRecord(\n z.string(),\n PoetryDependency.transform((dep) => {\n if (dep.skipReason) {\n return dep;\n }\n\n if (dep.datasource === GitRefsDatasource.id && dep.currentDigest) {\n dep.versioning = gitVersioning.id;\n return dep;\n }\n\n // istanbul ignore if: normaly should not happen\n if (!dep.currentValue) {\n dep.skipReason = 'unspecified-version';\n return dep;\n }\n\n if (pep440Versioning.isValid(dep.currentValue)) {\n dep.versioning = pep440Versioning.id;\n return dep;\n }\n\n if (poetryVersioning.isValid(dep.currentValue)) {\n dep.versioning = poetryVersioning.id;\n return dep;\n }\n\n dep.skipReason = 'invalid-version';\n return dep;\n }),\n).transform((record) => {\n const deps: PackageDependency[] = [];\n for (const [depName, dep] of Object.entries(record)) {\n dep.depName = depName;\n if (!dep.packageName) {\n const packageName = normalizePythonDepName(depName);\n if (depName !== packageName) {\n dep.packageName = packageName;\n }\n }\n deps.push(dep);\n }\n return deps;\n});\n\nexport const PoetryGroupDependencies = LooseRecord(\n z.string(),\n z\n .object({ dependencies: PoetryDependencies })\n .transform(({ dependencies }) => dependencies),\n).transform((record) => {\n const deps: PackageDependency[] = [];\n for (const [name, val] of Object.entries(record)) {\n for (const dep of Object.values(val)) {\n dep.depType = name;\n deps.push(dep);\n }\n }\n return deps;\n});\n\nconst PoetrySourceOrder = [\n 'default',\n 'primary',\n 'secondary',\n 'supplemental',\n 'explicit',\n] as const;\n\nexport const PoetrySource = z.object({\n name: z.string().toLowerCase(),\n url: z.string().optional(),\n priority: z.enum(PoetrySourceOrder).default('primary'),\n});\nexport type PoetrySource = z.infer<typeof PoetrySource>;\n\nexport const PoetrySources = LooseArray(PoetrySource, {\n onError: ({ error: err }) => {\n logger.debug({ err }, 'Poetry: error parsing sources array');\n },\n})\n .transform((sources) => {\n const pypiUrl = getEnv().PIP_INDEX_URL ?? 'https://pypi.org/pypi/';\n const result: PoetrySource[] = [];\n\n let overridesPyPi = false;\n let hasDefaultSource = false;\n let hasPrimarySource = false;\n for (const source of sources) {\n if (source.name === 'pypi') {\n source.url = pypiUrl;\n overridesPyPi = true;\n }\n\n if (!source.url) {\n continue;\n }\n\n if (source.priority === 'default') {\n hasDefaultSource = true;\n } else if (source.priority === 'primary') {\n hasPrimarySource = true;\n }\n\n result.push(source);\n }\n\n if (sources.length && !hasDefaultSource && !overridesPyPi) {\n result.push({\n name: 'pypi',\n priority: hasPrimarySource ? 'secondary' : 'default',\n url: pypiUrl,\n });\n }\n\n result.sort(\n (a, b) =>\n PoetrySourceOrder.indexOf(a.priority) -\n PoetrySourceOrder.indexOf(b.priority),\n );\n\n return result;\n })\n .catch([]);\n\nexport const PoetrySection = z.object({\n version: z.string().optional().catch(undefined),\n dependencies: withDepType(\n PoetryDependencies,\n 'dependencies',\n false,\n ).optional(),\n 'dev-dependencies': withDepType(\n PoetryDependencies,\n 'dev-dependencies',\n ).optional(),\n group: PoetryGroupDependencies.optional(),\n source: PoetrySources,\n});\n\nexport type PoetrySection = z.infer<typeof PoetrySection>;\n\nconst BuildSystemRequireVal = z\n .string()\n .nonempty()\n .transform((val) => regEx(`^${dependencyPattern}$`).exec(val))\n .transform((match, ctx) => {\n if (!match) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: 'invalid requirement',\n });\n return z.NEVER;\n }\n\n const [, depName, , poetryRequirement] = match;\n return { depName, poetryRequirement };\n });\n\nexport const PoetryPyProject = Toml.pipe(\n z\n .object({\n project: ProjectSection.optional().catch(undefined),\n tool: z.object({ poetry: PoetrySection }).optional().catch(undefined),\n 'dependency-groups': DependencyGroup(depTypes.dependencyGroups).catch([]),\n 'build-system': z\n .object({\n 'build-backend': z.string().refine(\n // https://python-poetry.org/docs/pyproject/#poetry-and-pep-517\n (buildBackend) =>\n buildBackend === 'poetry.masonry.api' ||\n buildBackend === 'poetry.core.masonry.api',\n ),\n requires: LooseArray(BuildSystemRequireVal).transform((vals) => {\n const req = vals.find(\n ({ depName }) =>\n depName === 'poetry' || depName === 'poetry_core',\n );\n return req?.poetryRequirement;\n }),\n })\n .transform(({ requires: poetryRequirement }) => poetryRequirement)\n .optional()\n .catch(undefined),\n })\n .transform((pyproject) => {\n const {\n project,\n tool,\n 'build-system': poetryRequirement,\n 'dependency-groups': dependencyGroups,\n } = pyproject;\n\n const deps: PackageDependency[] = [];\n\n const projectDependencies = project?.dependencies;\n if (projectDependencies) {\n deps.push(...projectDependencies);\n }\n\n const projectOptionalDependencies = project?.['optional-dependencies'];\n if (projectOptionalDependencies) {\n deps.push(...projectOptionalDependencies);\n }\n\n deps.push(...dependencyGroups);\n\n const poetryDependencies = tool?.poetry?.dependencies;\n if (poetryDependencies) {\n deps.push(...poetryDependencies);\n }\n\n const poetryDevDependencies = tool?.poetry?.['dev-dependencies'];\n if (poetryDevDependencies) {\n deps.push(...poetryDevDependencies);\n }\n\n const poetryGroupDependencies = tool?.poetry?.group;\n if (poetryGroupDependencies) {\n deps.push(...poetryGroupDependencies);\n }\n\n const packageFileVersion = tool?.poetry?.version;\n const packageFileContent: PackageFileContent = {\n deps,\n packageFileVersion,\n };\n\n const sourceUrls = tool?.poetry?.source;\n if (sourceUrls) {\n for (const dep of deps) {\n if (dep.managerData?.sourceName) {\n const sourceUrl = sourceUrls.find(\n ({ name }) => name === dep.managerData?.sourceName,\n );\n if (sourceUrl?.url) {\n dep.registryUrls = [sourceUrl.url];\n }\n }\n }\n\n const sourceUrlsFiltered = sourceUrls.filter(\n ({ priority }) => priority !== 'explicit',\n );\n if (sourceUrlsFiltered.length) {\n packageFileContent.registryUrls = uniq(\n sourceUrlsFiltered.map(({ url }) => url!),\n );\n }\n }\n\n return { packageFileContent, poetryRequirement };\n }),\n);\n\nexport type PoetryPyProject = z.infer<typeof PoetryPyProject>;\n\nconst poetryConstraint: Record<string, string> = {\n '1.0': '<1.1.0',\n '1.1': '<1.3.0',\n '2.0': '>=1.3.0 <1.4.0', // 1.4.0 introduced embedding of the poetry version in lock file header\n};\n\nexport const Lockfile = Toml.pipe(\n z.object({\n package: LooseArray(\n z\n .object({\n name: z.string(),\n version: z.string(),\n })\n .transform(({ name, version }): [string, string] => [name, version]),\n )\n .transform((entries) => Object.fromEntries(entries))\n .catch({}),\n metadata: z\n .object({\n 'lock-version': z\n .string()\n .transform((lockVersion) => poetryConstraint[lockVersion])\n .optional()\n .catch(undefined),\n 'python-versions': z.string().optional().catch(undefined),\n })\n .transform(\n ({\n 'lock-version': poetryConstraint,\n 'python-versions': pythonVersions,\n }) => ({\n poetryConstraint,\n pythonVersions,\n }),\n )\n .catch({\n poetryConstraint: undefined,\n pythonVersions: undefined,\n }),\n }),\n).transform(\n ({ package: lock, metadata: { poetryConstraint, pythonVersions } }) => ({\n lock,\n poetryConstraint,\n pythonVersions,\n }),\n);\n"]}
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.extractPackageFile = extractPackageFile;
4
- const tslib_1 = require("tslib");
5
- const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
4
+ const is_1 = require("@sindresorhus/is");
6
5
  const logger_1 = require("../../../logger");
7
6
  const common_1 = require("../../../util/common");
8
7
  const host_rules_1 = require("../../../util/host-rules");
@@ -41,7 +40,7 @@ function determineDatasource(repository, hostname) {
41
40
  }
42
41
  const hostUrl = 'https://' + hostname;
43
42
  const res = (0, host_rules_1.find)({ url: hostUrl });
44
- if (is_1.default.emptyObject(res)) {
43
+ if ((0, is_1.isEmptyObject)(res)) {
45
44
  // 1 check, to possibly prevent 3 failures in combined query of hostType & url.
46
45
  logger_1.logger.debug({ repository, hostUrl }, 'Provided hostname does not match any hostRules. Ignoring');
47
46
  return { skipReason: 'unknown-registry', registryUrls: [hostname] };
@@ -50,7 +49,7 @@ function determineDatasource(repository, hostname) {
50
49
  ['github', github_tags_1.GithubTagsDatasource.id],
51
50
  ['gitlab', gitlab_tags_1.GitlabTagsDatasource.id],
52
51
  ]) {
53
- if (is_1.default.nonEmptyObject((0, host_rules_1.find)({ hostType, url: hostUrl }))) {
52
+ if ((0, is_1.isNonEmptyObject)((0, host_rules_1.find)({ hostType, url: hostUrl }))) {
54
53
  logger_1.logger.debug({ repository, hostUrl, hostType }, `Provided hostname matches a ${hostType} hostrule.`);
55
54
  return { datasource: sourceId, registryUrls: [hostname] };
56
55
  }
@@ -163,7 +162,7 @@ function extractPackageFile(content, packageFile) {
163
162
  logger_1.logger.debug({ filename: packageFile, err }, 'Failed to parse pre-commit config YAML');
164
163
  return null;
165
164
  }
166
- if (!is_1.default.plainObject(parsedContent)) {
165
+ if (!(0, is_1.isPlainObject)(parsedContent)) {
167
166
  logger_1.logger.debug({ packageFile }, `Parsing of pre-commit config YAML returned invalid result`);
168
167
  return null;
169
168
  }
@@ -1 +1 @@
1
- {"version":3,"file":"extract.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pre-commit/extract.ts"],"names":[],"mappings":";;AAoMA,gDA2CC;;AA/OD,kEAAkC;AAClC,4CAAyC;AAEzC,iDAAsD;AACtD,yDAAgD;AAChD,+CAA4C;AAC5C,6CAAqD;AACrD,8DAAoE;AACpE,8DAAoE;AACpE,iEAA6F;AAC7F,2CAA4D;AAE5D,uCAGmB;AAGnB;;;;;;;;;GASG;AACH,SAAS,mBAAmB,CAC1B,UAAkB,EAClB,QAAgB;IAEhB,IAAI,QAAQ,KAAK,YAAY,IAAI,IAAA,uBAAc,EAAC,UAAU,CAAC,KAAK,QAA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["import is from '@sindresorhus/is';\nimport { logger } from '../../../logger';\nimport type { SkipReason } from '../../../types';\nimport { detectPlatform } from '../../../util/common';\nimport { find } from '../../../util/host-rules';\nimport { regEx } from '../../../util/regex';\nimport { parseSingleYaml } from '../../../util/yaml';\nimport { GithubTagsDatasource } from '../../datasource/github-tags';\nimport { GitlabTagsDatasource } from '../../datasource/gitlab-tags';\nimport { extractDependency as npmExtractDependency } from '../npm/extract/common/dependency';\nimport { pep508ToPackageDependency } from '../pep621/utils';\nimport type { PackageDependency, PackageFileContent } from '../types';\nimport {\n matchesPrecommitConfigHeuristic,\n matchesPrecommitDependencyHeuristic,\n} from './parsing';\nimport type { PreCommitConfig } from './types';\n\n/**\n * Determines the datasource(id) to be used for this dependency\n * @param repository the full git url, ie git@github.com/user/project.\n * Used in debug statements to clearly indicate the related dependency.\n * @param hostname the hostname (ie github.com)\n * Used to determine which renovate datasource should be used.\n * Is matched literally against `github.com` and `gitlab.com`.\n * If that doesn't match, `hostRules.find()` is used to find related sources.\n * In that case, the hostname is passed on as registryUrl to the corresponding datasource.\n */\nfunction determineDatasource(\n repository: string,\n hostname: string,\n): { datasource?: string; registryUrls?: string[]; skipReason?: SkipReason } {\n if (hostname === 'github.com' || detectPlatform(repository) === 'github') {\n logger.debug({ repository, hostname }, 'Found github dependency');\n return { datasource: GithubTagsDatasource.id };\n }\n if (hostname === 'gitlab.com') {\n logger.debug({ repository, hostname }, 'Found gitlab dependency');\n return { datasource: GitlabTagsDatasource.id };\n }\n if (detectPlatform(repository) === 'gitlab') {\n logger.debug(\n { repository, hostname },\n 'Found gitlab dependency with custom registryUrl',\n );\n return {\n datasource: GitlabTagsDatasource.id,\n registryUrls: ['https://' + hostname],\n };\n }\n const hostUrl = 'https://' + hostname;\n const res = find({ url: hostUrl });\n if (is.emptyObject(res)) {\n // 1 check, to possibly prevent 3 failures in combined query of hostType & url.\n logger.debug(\n { repository, hostUrl },\n 'Provided hostname does not match any hostRules. Ignoring',\n );\n return { skipReason: 'unknown-registry', registryUrls: [hostname] };\n }\n for (const [hostType, sourceId] of [\n ['github', GithubTagsDatasource.id],\n ['gitlab', GitlabTagsDatasource.id],\n ]) {\n if (is.nonEmptyObject(find({ hostType, url: hostUrl }))) {\n logger.debug(\n { repository, hostUrl, hostType },\n `Provided hostname matches a ${hostType} hostrule.`,\n );\n return { datasource: sourceId, registryUrls: [hostname] };\n }\n }\n logger.debug(\n { repository, registry: hostUrl },\n 'Provided hostname did not match any of the hostRules of hostType github nor gitlab',\n );\n return { skipReason: 'unknown-registry', registryUrls: [hostname] };\n}\n\nconst gitUrlRegex = regEx(/\\.git$/i);\n\nfunction extractDependency(\n tag: string,\n repository: string,\n): {\n depName?: string;\n depType?: string;\n datasource?: string;\n packageName?: string;\n skipReason?: SkipReason;\n currentValue?: string;\n} {\n logger.debug(`Found version ${tag}`);\n\n const urlMatchers = [\n // This splits \"http://my.github.com/user/repo\" -> \"my.github.com\" \"user/repo\n regEx('^https?://(?<hostname>[^/]+)/(?<depName>\\\\S*)'),\n // This splits \"git@private.registry.com:user/repo\" -> \"private.registry.com\" \"user/repo\n regEx('^git@(?<hostname>[^:]+):(?<depName>\\\\S*)'),\n // This split \"git://github.com/pre-commit/pre-commit-hooks\" -> \"github.com\" \"pre-commit/pre-commit-hooks\"\n regEx(/^git:\\/\\/(?<hostname>[^/]+)\\/(?<depName>\\S*)/),\n // This splits \"ssh://git@github.com/pre-commit/pre-commit-hooks\" -> \"github.com\" \"pre-commit/pre-commit-hooks\"\n regEx(/^ssh:\\/\\/git@(?<hostname>[^/]+)\\/(?<depName>\\S*)/),\n ];\n for (const urlMatcher of urlMatchers) {\n const match = urlMatcher.exec(repository);\n if (match?.groups) {\n const hostname = match.groups.hostname;\n const depName = match.groups.depName.replace(gitUrlRegex, '');\n const sourceDef = determineDatasource(repository, hostname);\n return {\n ...sourceDef,\n depName,\n depType: 'repository',\n packageName: depName,\n currentValue: tag,\n };\n }\n }\n logger.info(\n { repository },\n 'Could not separate hostname from full dependency url.',\n );\n return {\n depName: undefined,\n depType: 'repository',\n datasource: undefined,\n packageName: undefined,\n skipReason: 'invalid-url',\n currentValue: tag,\n };\n}\n\n/**\n * Find all supported dependencies in the pre-commit yaml object.\n *\n * @param precommitFile the parsed yaml config file\n */\nfunction findDependencies(precommitFile: PreCommitConfig): PackageDependency[] {\n if (!precommitFile.repos) {\n logger.debug(`No repos section found, skipping file`);\n return [];\n }\n const packageDependencies: PackageDependency[] = [];\n precommitFile.repos.forEach((item) => {\n // meta hooks is defined from pre-commit and doesn't support `additional_dependencies`\n if (item.repo !== 'meta') {\n item.hooks?.forEach((hook) => {\n // normally language are not defined in yaml\n // only support it when it's explicitly defined.\n // this avoid to parse hooks from pre-commit-hooks.yaml from git repo\n if (hook.language === 'node') {\n hook.additional_dependencies?.map((req) => {\n const match = regEx('^(?<name>.+)@(?<range>.+)$').exec(req);\n if (!match?.groups) {\n return;\n }\n\n const depType = 'pre-commit-node';\n const dep = npmExtractDependency(\n depType,\n match.groups.name,\n match.groups.range,\n );\n packageDependencies.push({\n depType,\n depName: match.groups.name,\n packageName: match.groups.name,\n ...dep,\n });\n });\n } else if (hook.language === 'python') {\n hook.additional_dependencies?.map((req) => {\n const dep = pep508ToPackageDependency('pre-commit-python', req);\n if (dep) {\n packageDependencies.push(dep);\n }\n });\n }\n });\n }\n\n if (matchesPrecommitDependencyHeuristic(item)) {\n logger.trace(item, 'Matched pre-commit dependency spec');\n const repository = String(item.repo);\n const tag = String(item.rev);\n const dep = extractDependency(tag, repository);\n\n packageDependencies.push(dep);\n } else {\n logger.trace(item, 'Did not find pre-commit repo spec');\n }\n });\n return packageDependencies;\n}\n\nexport function extractPackageFile(\n content: string,\n packageFile: string,\n): PackageFileContent | null {\n type ParsedContent = Record<string, unknown> | PreCommitConfig;\n let parsedContent: ParsedContent;\n try {\n // TODO: use schema (#9610)\n parsedContent = parseSingleYaml(content);\n } catch (err) {\n logger.debug(\n { filename: packageFile, err },\n 'Failed to parse pre-commit config YAML',\n );\n return null;\n }\n if (!is.plainObject<Record<string, unknown>>(parsedContent)) {\n logger.debug(\n { packageFile },\n `Parsing of pre-commit config YAML returned invalid result`,\n );\n return null;\n }\n if (!matchesPrecommitConfigHeuristic(parsedContent)) {\n logger.debug(\n { packageFile },\n `File does not look like a pre-commit config file`,\n );\n return null;\n }\n try {\n const deps = findDependencies(parsedContent);\n if (deps.length) {\n logger.trace({ deps }, 'Found dependencies in pre-commit config');\n return { deps };\n }\n } catch (err) /* istanbul ignore next */ {\n logger.debug(\n { packageFile, err },\n 'Error scanning parsed pre-commit config',\n );\n }\n return null;\n}\n"]}
1
+ {"version":3,"file":"extract.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pre-commit/extract.ts"],"names":[],"mappings":";;AAwMA,gDA2CC;AAnPD,yCAI0B;AAC1B,4CAAyC;AAEzC,iDAAsD;AACtD,yDAAgD;AAChD,+CAA4C;AAC5C,6CAAqD;AACrD,8DAAoE;AACpE,8DAAoE;AACpE,iEAA6F;AAC7F,2CAA4D;AAE5D,uCAGmB;AAGnB;;;;;;;;;GASG;AACH,SAAS,mBAAmB,CAC1B,UAAkB,EAClB,QAAgB;IAEhB,IAAI,QAAQ,KAAK,YAAY,IAAI,IAAA,uBAAc,EAAC,UAAU,CAAC,KAAK,QAAQ,EAAE,CAAC;QACzE,eAAM,CAAC,KAAK,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,yBAAyB,CAAC,CAAC;QAClE,OAAO,EAAE,UAAU,EAAE,kCAAoB,CAAC,EAAE,EAAE,CAAC;IACjD,CAAC;IACD,IAAI,QAAQ,KAAK,YAAY,EAAE,CAAC;QAC9B,eAAM,CAAC,KAAK,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,yBAAyB,CAAC,CAAC;QAClE,OAAO,EAAE,UAAU,EAAE,kCAAoB,CAAC,EAAE,EAAE,CAAC;IACjD,CAAC;IACD,IAAI,IAAA,uBAAc,EAAC,UAAU,CAAC,KAAK,QAA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;IACd,CAAC;IACD,IAAI,CAAC,IAAA,kBAAa,EAA0B,aAAa,CAAC,EAAE,CAAC;QAC3D,eAAM,CAAC,KAAK,CACV,EAAE,WAAW,EAAE,EACf,2DAA2D,CAC5D,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,CAAC,IAAA,yCAA+B,EAAC,aAAa,CAAC,EAAE,CAAC;QACpD,eAAM,CAAC,KAAK,CACV,EAAE,WAAW,EAAE,EACf,kDAAkD,CACnD,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,gBAAgB,CAAC,aAAa,CAAC,CAAC;QAC7C,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,eAAM,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,EAAE,yCAAyC,CAAC,CAAC;YAClE,OAAO,EAAE,IAAI,EAAE,CAAC;QAClB,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,0BAA0B,CAAC,CAAC;QACxC,eAAM,CAAC,KAAK,CACV,EAAE,WAAW,EAAE,GAAG,EAAE,EACpB,yCAAyC,CAC1C,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import {\n isEmptyObject,\n isNonEmptyObject,\n isPlainObject,\n} from '@sindresorhus/is';\nimport { logger } from '../../../logger';\nimport type { SkipReason } from '../../../types';\nimport { detectPlatform } from '../../../util/common';\nimport { find } from '../../../util/host-rules';\nimport { regEx } from '../../../util/regex';\nimport { parseSingleYaml } from '../../../util/yaml';\nimport { GithubTagsDatasource } from '../../datasource/github-tags';\nimport { GitlabTagsDatasource } from '../../datasource/gitlab-tags';\nimport { extractDependency as npmExtractDependency } from '../npm/extract/common/dependency';\nimport { pep508ToPackageDependency } from '../pep621/utils';\nimport type { PackageDependency, PackageFileContent } from '../types';\nimport {\n matchesPrecommitConfigHeuristic,\n matchesPrecommitDependencyHeuristic,\n} from './parsing';\nimport type { PreCommitConfig } from './types';\n\n/**\n * Determines the datasource(id) to be used for this dependency\n * @param repository the full git url, ie git@github.com/user/project.\n * Used in debug statements to clearly indicate the related dependency.\n * @param hostname the hostname (ie github.com)\n * Used to determine which renovate datasource should be used.\n * Is matched literally against `github.com` and `gitlab.com`.\n * If that doesn't match, `hostRules.find()` is used to find related sources.\n * In that case, the hostname is passed on as registryUrl to the corresponding datasource.\n */\nfunction determineDatasource(\n repository: string,\n hostname: string,\n): { datasource?: string; registryUrls?: string[]; skipReason?: SkipReason } {\n if (hostname === 'github.com' || detectPlatform(repository) === 'github') {\n logger.debug({ repository, hostname }, 'Found github dependency');\n return { datasource: GithubTagsDatasource.id };\n }\n if (hostname === 'gitlab.com') {\n logger.debug({ repository, hostname }, 'Found gitlab dependency');\n return { datasource: GitlabTagsDatasource.id };\n }\n if (detectPlatform(repository) === 'gitlab') {\n logger.debug(\n { repository, hostname },\n 'Found gitlab dependency with custom registryUrl',\n );\n return {\n datasource: GitlabTagsDatasource.id,\n registryUrls: ['https://' + hostname],\n };\n }\n const hostUrl = 'https://' + hostname;\n const res = find({ url: hostUrl });\n if (isEmptyObject(res)) {\n // 1 check, to possibly prevent 3 failures in combined query of hostType & url.\n logger.debug(\n { repository, hostUrl },\n 'Provided hostname does not match any hostRules. Ignoring',\n );\n return { skipReason: 'unknown-registry', registryUrls: [hostname] };\n }\n for (const [hostType, sourceId] of [\n ['github', GithubTagsDatasource.id],\n ['gitlab', GitlabTagsDatasource.id],\n ]) {\n if (isNonEmptyObject(find({ hostType, url: hostUrl }))) {\n logger.debug(\n { repository, hostUrl, hostType },\n `Provided hostname matches a ${hostType} hostrule.`,\n );\n return { datasource: sourceId, registryUrls: [hostname] };\n }\n }\n logger.debug(\n { repository, registry: hostUrl },\n 'Provided hostname did not match any of the hostRules of hostType github nor gitlab',\n );\n return { skipReason: 'unknown-registry', registryUrls: [hostname] };\n}\n\nconst gitUrlRegex = regEx(/\\.git$/i);\n\nfunction extractDependency(\n tag: string,\n repository: string,\n): {\n depName?: string;\n depType?: string;\n datasource?: string;\n packageName?: string;\n skipReason?: SkipReason;\n currentValue?: string;\n} {\n logger.debug(`Found version ${tag}`);\n\n const urlMatchers = [\n // This splits \"http://my.github.com/user/repo\" -> \"my.github.com\" \"user/repo\n regEx('^https?://(?<hostname>[^/]+)/(?<depName>\\\\S*)'),\n // This splits \"git@private.registry.com:user/repo\" -> \"private.registry.com\" \"user/repo\n regEx('^git@(?<hostname>[^:]+):(?<depName>\\\\S*)'),\n // This split \"git://github.com/pre-commit/pre-commit-hooks\" -> \"github.com\" \"pre-commit/pre-commit-hooks\"\n regEx(/^git:\\/\\/(?<hostname>[^/]+)\\/(?<depName>\\S*)/),\n // This splits \"ssh://git@github.com/pre-commit/pre-commit-hooks\" -> \"github.com\" \"pre-commit/pre-commit-hooks\"\n regEx(/^ssh:\\/\\/git@(?<hostname>[^/]+)\\/(?<depName>\\S*)/),\n ];\n for (const urlMatcher of urlMatchers) {\n const match = urlMatcher.exec(repository);\n if (match?.groups) {\n const hostname = match.groups.hostname;\n const depName = match.groups.depName.replace(gitUrlRegex, '');\n const sourceDef = determineDatasource(repository, hostname);\n return {\n ...sourceDef,\n depName,\n depType: 'repository',\n packageName: depName,\n currentValue: tag,\n };\n }\n }\n logger.info(\n { repository },\n 'Could not separate hostname from full dependency url.',\n );\n return {\n depName: undefined,\n depType: 'repository',\n datasource: undefined,\n packageName: undefined,\n skipReason: 'invalid-url',\n currentValue: tag,\n };\n}\n\n/**\n * Find all supported dependencies in the pre-commit yaml object.\n *\n * @param precommitFile the parsed yaml config file\n */\nfunction findDependencies(precommitFile: PreCommitConfig): PackageDependency[] {\n if (!precommitFile.repos) {\n logger.debug(`No repos section found, skipping file`);\n return [];\n }\n const packageDependencies: PackageDependency[] = [];\n precommitFile.repos.forEach((item) => {\n // meta hooks is defined from pre-commit and doesn't support `additional_dependencies`\n if (item.repo !== 'meta') {\n item.hooks?.forEach((hook) => {\n // normally language are not defined in yaml\n // only support it when it's explicitly defined.\n // this avoid to parse hooks from pre-commit-hooks.yaml from git repo\n if (hook.language === 'node') {\n hook.additional_dependencies?.map((req) => {\n const match = regEx('^(?<name>.+)@(?<range>.+)$').exec(req);\n if (!match?.groups) {\n return;\n }\n\n const depType = 'pre-commit-node';\n const dep = npmExtractDependency(\n depType,\n match.groups.name,\n match.groups.range,\n );\n packageDependencies.push({\n depType,\n depName: match.groups.name,\n packageName: match.groups.name,\n ...dep,\n });\n });\n } else if (hook.language === 'python') {\n hook.additional_dependencies?.map((req) => {\n const dep = pep508ToPackageDependency('pre-commit-python', req);\n if (dep) {\n packageDependencies.push(dep);\n }\n });\n }\n });\n }\n\n if (matchesPrecommitDependencyHeuristic(item)) {\n logger.trace(item, 'Matched pre-commit dependency spec');\n const repository = String(item.repo);\n const tag = String(item.rev);\n const dep = extractDependency(tag, repository);\n\n packageDependencies.push(dep);\n } else {\n logger.trace(item, 'Did not find pre-commit repo spec');\n }\n });\n return packageDependencies;\n}\n\nexport function extractPackageFile(\n content: string,\n packageFile: string,\n): PackageFileContent | null {\n type ParsedContent = Record<string, unknown> | PreCommitConfig;\n let parsedContent: ParsedContent;\n try {\n // TODO: use schema (#9610)\n parsedContent = parseSingleYaml(content);\n } catch (err) {\n logger.debug(\n { filename: packageFile, err },\n 'Failed to parse pre-commit config YAML',\n );\n return null;\n }\n if (!isPlainObject<Record<string, unknown>>(parsedContent)) {\n logger.debug(\n { packageFile },\n `Parsing of pre-commit config YAML returned invalid result`,\n );\n return null;\n }\n if (!matchesPrecommitConfigHeuristic(parsedContent)) {\n logger.debug(\n { packageFile },\n `File does not look like a pre-commit config file`,\n );\n return null;\n }\n try {\n const deps = findDependencies(parsedContent);\n if (deps.length) {\n logger.trace({ deps }, 'Found dependencies in pre-commit config');\n return { deps };\n }\n } catch (err) /* istanbul ignore next */ {\n logger.debug(\n { packageFile, err },\n 'Error scanning parsed pre-commit config',\n );\n }\n return null;\n}\n"]}
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.updateArtifacts = updateArtifacts;
4
- const tslib_1 = require("tslib");
5
- const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
4
+ const is_1 = require("@sindresorhus/is");
6
5
  const shlex_1 = require("shlex");
7
6
  const error_messages_1 = require("../../../constants/error-messages");
8
7
  const logger_1 = require("../../../logger");
@@ -14,7 +13,7 @@ const PUB_GET_COMMAND = 'pub get --no-precompile';
14
13
  async function updateArtifacts({ packageFileName, updatedDeps, newPackageFileContent, config, }) {
15
14
  logger_1.logger.debug(`pub.updateArtifacts(${packageFileName})`);
16
15
  const { isLockFileMaintenance } = config;
17
- if (is_1.default.emptyArray(updatedDeps) && !isLockFileMaintenance) {
16
+ if ((0, is_1.isEmptyArray)(updatedDeps) && !isLockFileMaintenance) {
18
17
  logger_1.logger.debug('No updated pub deps - returning null');
19
18
  return null;
20
19
  }
@@ -85,7 +84,7 @@ function getExecCommand(toolName, updatedDeps, isLockFileMaintenance) {
85
84
  return `${toolName} pub upgrade`;
86
85
  }
87
86
  else {
88
- const depNames = updatedDeps.map((dep) => dep.depName).filter(is_1.default.string);
87
+ const depNames = updatedDeps.map((dep) => dep.depName).filter(is_1.isString);
89
88
  if (depNames.length === 1 && SDK_NAMES.includes(depNames[0])) {
90
89
  return `${toolName} ${PUB_GET_COMMAND}`;
91
90
  }
@@ -1 +1 @@
1
- {"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pub/artifacts.ts"],"names":[],"mappings":";;AAiBA,0CAgFC;;AAjGD,kEAAkC;AAClC,iCAA8B;AAC9B,sEAAoE;AACpE,4CAAyC;AACzC,6CAA0C;AAE1C,yCAI0B;AAE1B,mCAAyD;AAEzD,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AACtC,MAAM,eAAe,GAAG,yBAAyB,CAAC;AAE3C,KAAK,UAAU,eAAe,CAAC,EACpC,eAAe,EACf,W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,CAAC;IACnC,CAAC;SAAM,CAAC;QACN,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,YAAE,CAAC,MAAM,CAAC,CAAC;QACzE,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC7D,OAAO,GAAG,QAAQ,IAAI,eAAe,EAAE,CAAC;QAC1C,CAAC;QACD,6FAA6F;QAC7F,wEAAwE;aACnE,IACH,QAAQ,CAAC,MAAM,KAAK,CAAC;YACrB,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,EACtE,CAAC;YACD,OAAO,WAAW,eAAe,EAAE,CAAC;QACtC,CAAC;aAAM,CAAC;YACN,MAAM,WAAW,GAAG,QAAQ;iBACzB,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;iBACjD,GAAG,CAAC,aAAK,CAAC;iBACV,IAAI,CAAC,GAAG,CAAC,CAAC;YACb,OAAO,GAAG,QAAQ,gBAAgB,WAAW,EAAE,CAAC;QAClD,CAAC;IACH,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 {\n getSiblingFileName,\n readLocalFile,\n writeLocalFile,\n} from '../../../util/fs';\nimport type { UpdateArtifact, UpdateArtifactsResult, Upgrade } from '../types';\nimport { parsePubspec, parsePubspecLock } from './utils';\n\nconst SDK_NAMES = ['dart', 'flutter'];\nconst PUB_GET_COMMAND = 'pub get --no-precompile';\n\nexport async function updateArtifacts({\n packageFileName,\n updatedDeps,\n newPackageFileContent,\n config,\n}: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> {\n logger.debug(`pub.updateArtifacts(${packageFileName})`);\n const { isLockFileMaintenance } = config;\n\n if (is.emptyArray(updatedDeps) && !isLockFileMaintenance) {\n logger.debug('No updated pub deps - returning null');\n return null;\n }\n\n const lockFileName = getSiblingFileName(packageFileName, 'pubspec.lock');\n const oldLockFileContent = await readLocalFile(lockFileName, 'utf8');\n if (!oldLockFileContent) {\n logger.debug('No pubspec.lock found');\n return null;\n }\n\n try {\n await writeLocalFile(packageFileName, newPackageFileContent);\n\n const isFlutter = newPackageFileContent.includes('sdk: flutter');\n const toolName = isFlutter ? 'flutter' : 'dart';\n const cmd = getExecCommand(toolName, updatedDeps, isLockFileMaintenance);\n\n let constraint = config.constraints?.[toolName];\n if (!constraint) {\n const pubspec = parsePubspec(packageFileName, newPackageFileContent);\n const pubspecToolName = isFlutter ? 'flutter' : 'sdk';\n constraint = pubspec?.environment[pubspecToolName];\n\n if (!constraint) {\n const pubspecLock = parsePubspecLock(lockFileName, oldLockFileContent);\n constraint = pubspecLock?.sdks[toolName];\n }\n }\n\n const execOptions: ExecOptions = {\n cwdFile: packageFileName,\n docker: {},\n toolConstraints: [\n {\n toolName,\n constraint,\n },\n ],\n };\n\n await exec(cmd, execOptions);\n const newLockFileContent = await readLocalFile(lockFileName, 'utf8');\n if (oldLockFileContent === newLockFileContent) {\n return null;\n }\n return [\n {\n file: {\n type: 'addition',\n path: lockFileName,\n contents: newLockFileContent,\n },\n },\n ];\n } catch (err) {\n // istanbul ignore if\n if (err.message === TEMPORARY_ERROR) {\n throw err;\n }\n logger.warn({ lockfile: lockFileName, err }, `Failed to update lock file`);\n return [\n {\n artifactError: {\n lockFile: lockFileName,\n stderr: err.message,\n },\n },\n ];\n }\n}\n\nfunction getExecCommand(\n toolName: string,\n updatedDeps: Upgrade<Record<string, unknown>>[],\n isLockFileMaintenance: boolean | undefined,\n): string {\n if (isLockFileMaintenance) {\n return `${toolName} pub upgrade`;\n } else {\n const depNames = updatedDeps.map((dep) => dep.depName).filter(is.string);\n if (depNames.length === 1 && SDK_NAMES.includes(depNames[0])) {\n return `${toolName} ${PUB_GET_COMMAND}`;\n }\n // If there are two updated dependencies and both of them are SDK updates (Dart and Flutter),\n // we use Flutter over Dart to run `pub get` as it is a Flutter project.\n else if (\n depNames.length === 2 &&\n depNames.filter((depName) => SDK_NAMES.includes(depName)).length === 2\n ) {\n return `flutter ${PUB_GET_COMMAND}`;\n } else {\n const depNamesCmd = depNames\n .filter((depName) => !SDK_NAMES.includes(depName))\n .map(quote)\n .join(' ');\n return `${toolName} pub upgrade ${depNamesCmd}`;\n }\n }\n}\n"]}
1
+ {"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pub/artifacts.ts"],"names":[],"mappings":";;AAiBA,0CAgFC;AAjGD,yCAA0D;AAC1D,iCAA8B;AAC9B,sEAAoE;AACpE,4CAAyC;AACzC,6CAA0C;AAE1C,yCAI0B;AAE1B,mCAAyD;AAEzD,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AACtC,MAAM,eAAe,GAAG,yBAAyB,CAAC;AAE3C,KAAK,UAAU,eAAe,CAAC,EACpC,eAAe,EACf,WAAW,EACX,qBAAqB,EACrB,MAAM,GACS;IACf,eAAM,CAAC,KAAK,CAAC,uBAAuB,eAAe,GAAG,CAAC,CAAC;IACxD,MAAM,EAAE,qBAAqB,EAAE,GAAG,MAAM,CAAC;IAEzC,IAAI,IAAA,iBAAY,EAAC,WAAW,CAAC,IAAI,CAAC,qBAAqB,EAAE,CAAC;QACxD,eAAM,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;QACrD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,YAAY,GAAG,IAAA,uBAAkB,EAAC,eAAe,EAAE,cA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,wEAAwE;aACnE,IACH,QAAQ,CAAC,MAAM,KAAK,CAAC;YACrB,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,EACtE,CAAC;YACD,OAAO,WAAW,eAAe,EAAE,CAAC;QACtC,CAAC;aAAM,CAAC;YACN,MAAM,WAAW,GAAG,QAAQ;iBACzB,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;iBACjD,GAAG,CAAC,aAAK,CAAC;iBACV,IAAI,CAAC,GAAG,CAAC,CAAC;YACb,OAAO,GAAG,QAAQ,gBAAgB,WAAW,EAAE,CAAC;QAClD,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import { isEmptyArray, isString } 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 {\n getSiblingFileName,\n readLocalFile,\n writeLocalFile,\n} from '../../../util/fs';\nimport type { UpdateArtifact, UpdateArtifactsResult, Upgrade } from '../types';\nimport { parsePubspec, parsePubspecLock } from './utils';\n\nconst SDK_NAMES = ['dart', 'flutter'];\nconst PUB_GET_COMMAND = 'pub get --no-precompile';\n\nexport async function updateArtifacts({\n packageFileName,\n updatedDeps,\n newPackageFileContent,\n config,\n}: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> {\n logger.debug(`pub.updateArtifacts(${packageFileName})`);\n const { isLockFileMaintenance } = config;\n\n if (isEmptyArray(updatedDeps) && !isLockFileMaintenance) {\n logger.debug('No updated pub deps - returning null');\n return null;\n }\n\n const lockFileName = getSiblingFileName(packageFileName, 'pubspec.lock');\n const oldLockFileContent = await readLocalFile(lockFileName, 'utf8');\n if (!oldLockFileContent) {\n logger.debug('No pubspec.lock found');\n return null;\n }\n\n try {\n await writeLocalFile(packageFileName, newPackageFileContent);\n\n const isFlutter = newPackageFileContent.includes('sdk: flutter');\n const toolName = isFlutter ? 'flutter' : 'dart';\n const cmd = getExecCommand(toolName, updatedDeps, isLockFileMaintenance);\n\n let constraint = config.constraints?.[toolName];\n if (!constraint) {\n const pubspec = parsePubspec(packageFileName, newPackageFileContent);\n const pubspecToolName = isFlutter ? 'flutter' : 'sdk';\n constraint = pubspec?.environment[pubspecToolName];\n\n if (!constraint) {\n const pubspecLock = parsePubspecLock(lockFileName, oldLockFileContent);\n constraint = pubspecLock?.sdks[toolName];\n }\n }\n\n const execOptions: ExecOptions = {\n cwdFile: packageFileName,\n docker: {},\n toolConstraints: [\n {\n toolName,\n constraint,\n },\n ],\n };\n\n await exec(cmd, execOptions);\n const newLockFileContent = await readLocalFile(lockFileName, 'utf8');\n if (oldLockFileContent === newLockFileContent) {\n return null;\n }\n return [\n {\n file: {\n type: 'addition',\n path: lockFileName,\n contents: newLockFileContent,\n },\n },\n ];\n } catch (err) {\n // istanbul ignore if\n if (err.message === TEMPORARY_ERROR) {\n throw err;\n }\n logger.warn({ lockfile: lockFileName, err }, `Failed to update lock file`);\n return [\n {\n artifactError: {\n lockFile: lockFileName,\n stderr: err.message,\n },\n },\n ];\n }\n}\n\nfunction getExecCommand(\n toolName: string,\n updatedDeps: Upgrade<Record<string, unknown>>[],\n isLockFileMaintenance: boolean | undefined,\n): string {\n if (isLockFileMaintenance) {\n return `${toolName} pub upgrade`;\n } else {\n const depNames = updatedDeps.map((dep) => dep.depName).filter(isString);\n if (depNames.length === 1 && SDK_NAMES.includes(depNames[0])) {\n return `${toolName} ${PUB_GET_COMMAND}`;\n }\n // If there are two updated dependencies and both of them are SDK updates (Dart and Flutter),\n // we use Flutter over Dart to run `pub get` as it is a Flutter project.\n else if (\n depNames.length === 2 &&\n depNames.filter((depName) => SDK_NAMES.includes(depName)).length === 2\n ) {\n return `flutter ${PUB_GET_COMMAND}`;\n } else {\n const depNamesCmd = depNames\n .filter((depName) => !SDK_NAMES.includes(depName))\n .map(quote)\n .join(' ');\n return `${toolName} pub upgrade ${depNamesCmd}`;\n }\n }\n}\n"]}
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.extractPackageFile = extractPackageFile;
4
- const tslib_1 = require("tslib");
5
- const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
4
+ const is_1 = require("@sindresorhus/is");
6
5
  const dart_1 = require("../../datasource/dart");
7
6
  const dart_version_1 = require("../../datasource/dart-version");
8
7
  const flutter_version_1 = require("../../datasource/flutter-version");
@@ -29,21 +28,21 @@ function extractFromSection(pubspec, sectionKey) {
29
28
  let skipReason;
30
29
  let registryUrls;
31
30
  let gitUrl;
32
- if (!is_1.default.string(currentValue)) {
31
+ if (!(0, is_1.isString)(currentValue)) {
33
32
  const version = currentValue.version;
34
33
  const path = currentValue.path;
35
34
  const hosted = currentValue.hosted;
36
35
  const git = currentValue.git;
37
- if (is_1.default.string(hosted)) {
36
+ if ((0, is_1.isString)(hosted)) {
38
37
  registryUrls = [hosted];
39
38
  }
40
- else if (is_1.default.string(hosted?.url)) {
39
+ else if ((0, is_1.isString)(hosted?.url)) {
41
40
  registryUrls = [hosted.url];
42
41
  }
43
- if (is_1.default.object(git)) {
42
+ if ((0, is_1.isObject)(git)) {
44
43
  gitUrl = git?.url;
45
44
  }
46
- else if (is_1.default.string(git)) {
45
+ else if ((0, is_1.isString)(git)) {
47
46
  gitUrl = git;
48
47
  }
49
48
  if (version) {
@@ -53,12 +52,10 @@ function extractFromSection(pubspec, sectionKey) {
53
52
  currentValue = '';
54
53
  skipReason = 'path-dependency';
55
54
  }
56
- else if (is_1.default.object(git) && is_1.default.string(git?.ref)) {
55
+ else if ((0, is_1.isObject)(git) && (0, is_1.isString)(git?.ref)) {
57
56
  currentValue = git.ref;
58
57
  }
59
- else if (is_1.default.object(git) &&
60
- !is_1.default.string(git?.ref) &&
61
- !is_1.default.string(version)) {
58
+ else if ((0, is_1.isObject)(git) && !(0, is_1.isString)(git?.ref) && !(0, is_1.isString)(version)) {
62
59
  currentValue = '';
63
60
  skipReason = 'unspecified-version';
64
61
  }