renovate 42.4.0 → 42.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (708) 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/options/index.js +7 -0
  92. package/dist/config/options/index.js.map +1 -1
  93. package/dist/config/presets/github/index.js +2 -3
  94. package/dist/config/presets/github/index.js.map +1 -1
  95. package/dist/config/presets/gitlab/index.js +2 -3
  96. package/dist/config/presets/gitlab/index.js.map +1 -1
  97. package/dist/config/presets/index.js +8 -8
  98. package/dist/config/presets/index.js.map +1 -1
  99. package/dist/config/presets/parse.js +2 -3
  100. package/dist/config/presets/parse.js.map +1 -1
  101. package/dist/config/secrets.js +3 -4
  102. package/dist/config/secrets.js.map +1 -1
  103. package/dist/config/types.d.ts +1 -0
  104. package/dist/config/types.js.map +1 -1
  105. package/dist/config/validation-helpers/match-base-branches.js +2 -3
  106. package/dist/config/validation-helpers/match-base-branches.js.map +1 -1
  107. package/dist/config/validation-helpers/regex-glob-matchers.js +2 -3
  108. package/dist/config/validation-helpers/regex-glob-matchers.js.map +1 -1
  109. package/dist/config/validation-helpers/utils.js +6 -6
  110. package/dist/config/validation-helpers/utils.js.map +1 -1
  111. package/dist/config/validation.js +29 -29
  112. package/dist/config/validation.js.map +1 -1
  113. package/dist/instrumentation/reporting.js +7 -8
  114. package/dist/instrumentation/reporting.js.map +1 -1
  115. package/dist/instrumentation/utils.js +2 -3
  116. package/dist/instrumentation/utils.js.map +1 -1
  117. package/dist/logger/err-serializer.js +2 -2
  118. package/dist/logger/err-serializer.js.map +1 -1
  119. package/dist/logger/index.js +3 -3
  120. package/dist/logger/index.js.map +1 -1
  121. package/dist/logger/renovate-logger.js +4 -5
  122. package/dist/logger/renovate-logger.js.map +1 -1
  123. package/dist/logger/utils.js +19 -19
  124. package/dist/logger/utils.js.map +1 -1
  125. package/dist/modules/datasource/aws-eks-addon/index.js +2 -2
  126. package/dist/modules/datasource/aws-eks-addon/index.js.map +1 -1
  127. package/dist/modules/datasource/bazel/index.js +2 -2
  128. package/dist/modules/datasource/bazel/index.js.map +1 -1
  129. package/dist/modules/datasource/bitrise/index.js +2 -2
  130. package/dist/modules/datasource/bitrise/index.js.map +1 -1
  131. package/dist/modules/datasource/common.js +4 -4
  132. package/dist/modules/datasource/common.js.map +1 -1
  133. package/dist/modules/datasource/conan/index.js +3 -3
  134. package/dist/modules/datasource/conan/index.js.map +1 -1
  135. package/dist/modules/datasource/custom/formats/html.js +2 -5
  136. package/dist/modules/datasource/custom/formats/html.js.map +1 -1
  137. package/dist/modules/datasource/custom/index.js +2 -3
  138. package/dist/modules/datasource/custom/index.js.map +1 -1
  139. package/dist/modules/datasource/custom/utils.js +4 -4
  140. package/dist/modules/datasource/custom/utils.js.map +1 -1
  141. package/dist/modules/datasource/dart-version/index.js +2 -3
  142. package/dist/modules/datasource/dart-version/index.js.map +1 -1
  143. package/dist/modules/datasource/deno/index.js +2 -2
  144. package/dist/modules/datasource/deno/index.js.map +1 -1
  145. package/dist/modules/datasource/docker/common.js +5 -5
  146. package/dist/modules/datasource/docker/common.js.map +1 -1
  147. package/dist/modules/datasource/docker/index.js +6 -6
  148. package/dist/modules/datasource/docker/index.js.map +1 -1
  149. package/dist/modules/datasource/endoflife-date/index.js +2 -2
  150. package/dist/modules/datasource/endoflife-date/index.js.map +1 -1
  151. package/dist/modules/datasource/galaxy/index.js +2 -2
  152. package/dist/modules/datasource/galaxy/index.js.map +1 -1
  153. package/dist/modules/datasource/galaxy-collection/index.js +2 -2
  154. package/dist/modules/datasource/galaxy-collection/index.js.map +1 -1
  155. package/dist/modules/datasource/git-refs/base.js +2 -2
  156. package/dist/modules/datasource/git-refs/base.js.map +1 -1
  157. package/dist/modules/datasource/github-release-attachments/index.js +2 -2
  158. package/dist/modules/datasource/github-release-attachments/index.js.map +1 -1
  159. package/dist/modules/datasource/github-releases/index.js +2 -3
  160. package/dist/modules/datasource/github-releases/index.js.map +1 -1
  161. package/dist/modules/datasource/github-tags/index.js +2 -3
  162. package/dist/modules/datasource/github-tags/index.js.map +1 -1
  163. package/dist/modules/datasource/go/goproxy-parser.js +3 -3
  164. package/dist/modules/datasource/go/goproxy-parser.js.map +1 -1
  165. package/dist/modules/datasource/go/index.js +2 -2
  166. package/dist/modules/datasource/go/index.js.map +1 -1
  167. package/dist/modules/datasource/go/releases-goproxy.js +3 -3
  168. package/dist/modules/datasource/go/releases-goproxy.js.map +1 -1
  169. package/dist/modules/datasource/hackage/index.js +2 -2
  170. package/dist/modules/datasource/hackage/index.js.map +1 -1
  171. package/dist/modules/datasource/hex/schema.js +2 -3
  172. package/dist/modules/datasource/hex/schema.js.map +1 -1
  173. package/dist/modules/datasource/hexpm-bob/index.js +2 -2
  174. package/dist/modules/datasource/hexpm-bob/index.js.map +1 -1
  175. package/dist/modules/datasource/index.js +14 -14
  176. package/dist/modules/datasource/index.js.map +1 -1
  177. package/dist/modules/datasource/jsr/index.js +2 -2
  178. package/dist/modules/datasource/jsr/index.js.map +1 -1
  179. package/dist/modules/datasource/jsr/util.js +3 -4
  180. package/dist/modules/datasource/jsr/util.js.map +1 -1
  181. package/dist/modules/datasource/metadata.js +5 -5
  182. package/dist/modules/datasource/metadata.js.map +1 -1
  183. package/dist/modules/datasource/npm/get.js +2 -2
  184. package/dist/modules/datasource/npm/get.js.map +1 -1
  185. package/dist/modules/datasource/npm/npmrc.js +7 -7
  186. package/dist/modules/datasource/npm/npmrc.js.map +1 -1
  187. package/dist/modules/datasource/nuget/v3.js +2 -2
  188. package/dist/modules/datasource/nuget/v3.js.map +1 -1
  189. package/dist/modules/datasource/packagist/index.js +2 -2
  190. package/dist/modules/datasource/packagist/index.js.map +1 -1
  191. package/dist/modules/datasource/packagist/schema.js +3 -4
  192. package/dist/modules/datasource/packagist/schema.js.map +1 -1
  193. package/dist/modules/datasource/pypi/index.js +2 -2
  194. package/dist/modules/datasource/pypi/index.js.map +1 -1
  195. package/dist/modules/datasource/repology/index.js +3 -3
  196. package/dist/modules/datasource/repology/index.js.map +1 -1
  197. package/dist/modules/datasource/rubygems/schema.js +5 -6
  198. package/dist/modules/datasource/rubygems/schema.js.map +1 -1
  199. package/dist/modules/datasource/util.js +2 -3
  200. package/dist/modules/datasource/util.js.map +1 -1
  201. package/dist/modules/manager/argocd/extract.js +3 -4
  202. package/dist/modules/manager/argocd/extract.js.map +1 -1
  203. package/dist/modules/manager/asdf/extract.js +2 -3
  204. package/dist/modules/manager/asdf/extract.js.map +1 -1
  205. package/dist/modules/manager/bazel/artifacts.js +2 -2
  206. package/dist/modules/manager/bazel/artifacts.js.map +1 -1
  207. package/dist/modules/manager/bazel/common.js +4 -5
  208. package/dist/modules/manager/bazel/common.js.map +1 -1
  209. package/dist/modules/manager/bazel/rules/http.js +3 -4
  210. package/dist/modules/manager/bazel/rules/http.js.map +1 -1
  211. package/dist/modules/manager/bazel/rules/maven.js +2 -3
  212. package/dist/modules/manager/bazel/rules/maven.js.map +1 -1
  213. package/dist/modules/manager/bazel-module/parser/starlark.js +2 -3
  214. package/dist/modules/manager/bazel-module/parser/starlark.js.map +1 -1
  215. package/dist/modules/manager/bazel-module/rules.js +3 -3
  216. package/dist/modules/manager/bazel-module/rules.js.map +1 -1
  217. package/dist/modules/manager/bitrise/utils.js +3 -4
  218. package/dist/modules/manager/bitrise/utils.js.map +1 -1
  219. package/dist/modules/manager/buildpacks/extract.js +2 -3
  220. package/dist/modules/manager/buildpacks/extract.js.map +1 -1
  221. package/dist/modules/manager/bun/artifacts.js +2 -2
  222. package/dist/modules/manager/bun/artifacts.js.map +1 -1
  223. package/dist/modules/manager/bun/extract.js +2 -3
  224. package/dist/modules/manager/bun/extract.js.map +1 -1
  225. package/dist/modules/manager/bundler/artifacts.js +3 -3
  226. package/dist/modules/manager/bundler/artifacts.js.map +1 -1
  227. package/dist/modules/manager/bundler/extract.js +5 -6
  228. package/dist/modules/manager/bundler/extract.js.map +1 -1
  229. package/dist/modules/manager/cargo/extract.js +3 -4
  230. package/dist/modules/manager/cargo/extract.js.map +1 -1
  231. package/dist/modules/manager/composer/artifacts.js +3 -3
  232. package/dist/modules/manager/composer/artifacts.js.map +1 -1
  233. package/dist/modules/manager/composer/utils.js +3 -4
  234. package/dist/modules/manager/composer/utils.js.map +1 -1
  235. package/dist/modules/manager/conan/extract.js +2 -3
  236. package/dist/modules/manager/conan/extract.js.map +1 -1
  237. package/dist/modules/manager/copier/utils.js +3 -4
  238. package/dist/modules/manager/copier/utils.js.map +1 -1
  239. package/dist/modules/manager/crow/extract.js +2 -3
  240. package/dist/modules/manager/crow/extract.js.map +1 -1
  241. package/dist/modules/manager/custom/jsonata/index.js +2 -3
  242. package/dist/modules/manager/custom/jsonata/index.js.map +1 -1
  243. package/dist/modules/manager/custom/jsonata/utils.js +3 -3
  244. package/dist/modules/manager/custom/jsonata/utils.js.map +1 -1
  245. package/dist/modules/manager/custom/regex/index.js +2 -3
  246. package/dist/modules/manager/custom/regex/index.js.map +1 -1
  247. package/dist/modules/manager/custom/regex/strategies.js +4 -5
  248. package/dist/modules/manager/custom/regex/strategies.js.map +1 -1
  249. package/dist/modules/manager/custom/regex/utils.js +2 -2
  250. package/dist/modules/manager/custom/regex/utils.js.map +1 -1
  251. package/dist/modules/manager/custom/utils.js +6 -7
  252. package/dist/modules/manager/custom/utils.js.map +1 -1
  253. package/dist/modules/manager/deps-edn/extract.js +13 -14
  254. package/dist/modules/manager/deps-edn/extract.js.map +1 -1
  255. package/dist/modules/manager/deps-edn/parser.js +2 -2
  256. package/dist/modules/manager/deps-edn/parser.js.map +1 -1
  257. package/dist/modules/manager/devbox/artifacts.js +2 -2
  258. package/dist/modules/manager/devbox/artifacts.js.map +1 -1
  259. package/dist/modules/manager/docker-compose/extract.js +3 -4
  260. package/dist/modules/manager/docker-compose/extract.js.map +1 -1
  261. package/dist/modules/manager/docker-compose/schema.js +2 -3
  262. package/dist/modules/manager/docker-compose/schema.js.map +1 -1
  263. package/dist/modules/manager/dockerfile/extract.js +5 -5
  264. package/dist/modules/manager/dockerfile/extract.js.map +1 -1
  265. package/dist/modules/manager/fingerprint.generated.js +5 -5
  266. package/dist/modules/manager/fingerprint.generated.js.map +1 -1
  267. package/dist/modules/manager/fleet/extract.js +2 -3
  268. package/dist/modules/manager/fleet/extract.js.map +1 -1
  269. package/dist/modules/manager/flux/extract.js +2 -3
  270. package/dist/modules/manager/flux/extract.js.map +1 -1
  271. package/dist/modules/manager/glasskube/extract.js +2 -3
  272. package/dist/modules/manager/glasskube/extract.js.map +1 -1
  273. package/dist/modules/manager/gleam/artifacts.js +3 -4
  274. package/dist/modules/manager/gleam/artifacts.js.map +1 -1
  275. package/dist/modules/manager/gomod/artifacts.js +2 -2
  276. package/dist/modules/manager/gomod/artifacts.js.map +1 -1
  277. package/dist/modules/manager/gradle/artifacts.js +2 -2
  278. package/dist/modules/manager/gradle/artifacts.js.map +1 -1
  279. package/dist/modules/manager/gradle/extract/catalog.js +5 -5
  280. package/dist/modules/manager/gradle/extract/catalog.js.map +1 -1
  281. package/dist/modules/manager/gradle-wrapper/artifacts.js +2 -2
  282. package/dist/modules/manager/gradle-wrapper/artifacts.js.map +1 -1
  283. package/dist/modules/manager/helm-requirements/extract.js +2 -3
  284. package/dist/modules/manager/helm-requirements/extract.js.map +1 -1
  285. package/dist/modules/manager/helmfile/artifacts.js +2 -3
  286. package/dist/modules/manager/helmfile/artifacts.js.map +1 -1
  287. package/dist/modules/manager/helmfile/extract.js +4 -5
  288. package/dist/modules/manager/helmfile/extract.js.map +1 -1
  289. package/dist/modules/manager/helmsman/extract.js +4 -5
  290. package/dist/modules/manager/helmsman/extract.js.map +1 -1
  291. package/dist/modules/manager/helmv3/artifacts.js +4 -4
  292. package/dist/modules/manager/helmv3/artifacts.js.map +1 -1
  293. package/dist/modules/manager/helmv3/extract.js +4 -5
  294. package/dist/modules/manager/helmv3/extract.js.map +1 -1
  295. package/dist/modules/manager/helmv3/oci.js +3 -4
  296. package/dist/modules/manager/helmv3/oci.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/utils.js +8 -10
  374. package/dist/modules/manager/pep621/utils.js.map +1 -1
  375. package/dist/modules/manager/pep723/schema.js +2 -3
  376. package/dist/modules/manager/pep723/schema.js.map +1 -1
  377. package/dist/modules/manager/pip-compile/common.js +3 -3
  378. package/dist/modules/manager/pip-compile/common.js.map +1 -1
  379. package/dist/modules/manager/pip_requirements/artifacts.js +2 -3
  380. package/dist/modules/manager/pip_requirements/artifacts.js.map +1 -1
  381. package/dist/modules/manager/pip_requirements/extract.js +2 -3
  382. package/dist/modules/manager/pip_requirements/extract.js.map +1 -1
  383. package/dist/modules/manager/pipenv/artifacts.js +3 -4
  384. package/dist/modules/manager/pipenv/artifacts.js.map +1 -1
  385. package/dist/modules/manager/pipenv/extract.js +6 -7
  386. package/dist/modules/manager/pipenv/extract.js.map +1 -1
  387. package/dist/modules/manager/pixi/artifacts.js +2 -3
  388. package/dist/modules/manager/pixi/artifacts.js.map +1 -1
  389. package/dist/modules/manager/pixi/extract.js +2 -3
  390. package/dist/modules/manager/pixi/extract.js.map +1 -1
  391. package/dist/modules/manager/poetry/artifacts.js +4 -5
  392. package/dist/modules/manager/poetry/artifacts.js.map +1 -1
  393. package/dist/modules/manager/poetry/extract.js +2 -3
  394. package/dist/modules/manager/poetry/extract.js.map +1 -1
  395. package/dist/modules/manager/pre-commit/extract.js +4 -5
  396. package/dist/modules/manager/pre-commit/extract.js.map +1 -1
  397. package/dist/modules/manager/pub/artifacts.js +3 -4
  398. package/dist/modules/manager/pub/artifacts.js.map +1 -1
  399. package/dist/modules/manager/pub/extract.js +8 -11
  400. package/dist/modules/manager/pub/extract.js.map +1 -1
  401. package/dist/modules/manager/renovate-config-presets/extract.js +4 -5
  402. package/dist/modules/manager/renovate-config-presets/extract.js.map +1 -1
  403. package/dist/modules/manager/tekton/extract.js +9 -10
  404. package/dist/modules/manager/tekton/extract.js.map +1 -1
  405. package/dist/modules/manager/terraform/base.js +2 -3
  406. package/dist/modules/manager/terraform/base.js.map +1 -1
  407. package/dist/modules/manager/terraform/extract.js +2 -2
  408. package/dist/modules/manager/terraform/extract.js.map +1 -1
  409. package/dist/modules/manager/terraform/extractors/others/modules.js +3 -4
  410. package/dist/modules/manager/terraform/extractors/others/modules.js.map +1 -1
  411. package/dist/modules/manager/terraform/extractors/others/providers.js +3 -4
  412. package/dist/modules/manager/terraform/extractors/others/providers.js.map +1 -1
  413. package/dist/modules/manager/terraform/extractors/resources/generic-docker-image-ref.js +7 -8
  414. package/dist/modules/manager/terraform/extractors/resources/generic-docker-image-ref.js.map +1 -1
  415. package/dist/modules/manager/terraform/extractors/resources/helm-release.js +5 -6
  416. package/dist/modules/manager/terraform/extractors/resources/helm-release.js.map +1 -1
  417. package/dist/modules/manager/terraform/extractors/resources/terraform-workspace.js +3 -4
  418. package/dist/modules/manager/terraform/extractors/resources/terraform-workspace.js.map +1 -1
  419. package/dist/modules/manager/terraform/extractors/terraform-block/required-provider.js +4 -5
  420. package/dist/modules/manager/terraform/extractors/terraform-block/required-provider.js.map +1 -1
  421. package/dist/modules/manager/terraform/extractors/terraform-block/terraform-version.js +3 -3
  422. package/dist/modules/manager/terraform/extractors/terraform-block/terraform-version.js.map +1 -1
  423. package/dist/modules/manager/terraform/lockfile/index.js +2 -2
  424. package/dist/modules/manager/terraform/lockfile/index.js.map +1 -1
  425. package/dist/modules/manager/terraform/lockfile/util.js +2 -3
  426. package/dist/modules/manager/terraform/lockfile/util.js.map +1 -1
  427. package/dist/modules/manager/terraform/util.js +2 -3
  428. package/dist/modules/manager/terraform/util.js.map +1 -1
  429. package/dist/modules/manager/tflint-plugin/plugins.js +2 -3
  430. package/dist/modules/manager/tflint-plugin/plugins.js.map +1 -1
  431. package/dist/modules/manager/travis/extract.js +5 -6
  432. package/dist/modules/manager/travis/extract.js.map +1 -1
  433. package/dist/modules/manager/woodpecker/extract.js +2 -3
  434. package/dist/modules/manager/woodpecker/extract.js.map +1 -1
  435. package/dist/modules/platform/azure/index.js +2 -2
  436. package/dist/modules/platform/azure/index.js.map +1 -1
  437. package/dist/modules/platform/bitbucket/index.js +5 -5
  438. package/dist/modules/platform/bitbucket/index.js.map +1 -1
  439. package/dist/modules/platform/bitbucket-server/pr-cache.js +2 -2
  440. package/dist/modules/platform/bitbucket-server/pr-cache.js.map +1 -1
  441. package/dist/modules/platform/bitbucket-server/utils.js +2 -2
  442. package/dist/modules/platform/bitbucket-server/utils.js.map +1 -1
  443. package/dist/modules/platform/codecommit/codecommit-client.js +2 -2
  444. package/dist/modules/platform/codecommit/codecommit-client.js.map +1 -1
  445. package/dist/modules/platform/forgejo/index.js +5 -5
  446. package/dist/modules/platform/forgejo/index.js.map +1 -1
  447. package/dist/modules/platform/forgejo/utils.js +2 -2
  448. package/dist/modules/platform/forgejo/utils.js.map +1 -1
  449. package/dist/modules/platform/gitea/index.js +5 -5
  450. package/dist/modules/platform/gitea/index.js.map +1 -1
  451. package/dist/modules/platform/gitea/utils.js +2 -2
  452. package/dist/modules/platform/gitea/utils.js.map +1 -1
  453. package/dist/modules/platform/github/common.js +4 -5
  454. package/dist/modules/platform/github/common.js.map +1 -1
  455. package/dist/modules/platform/github/index.js +5 -5
  456. package/dist/modules/platform/github/index.js.map +1 -1
  457. package/dist/modules/platform/github/pr.js +2 -3
  458. package/dist/modules/platform/github/pr.js.map +1 -1
  459. package/dist/modules/platform/gitlab/http.js +2 -3
  460. package/dist/modules/platform/gitlab/http.js.map +1 -1
  461. package/dist/modules/platform/gitlab/index.js +3 -3
  462. package/dist/modules/platform/gitlab/index.js.map +1 -1
  463. package/dist/modules/platform/gitlab/utils.js +3 -3
  464. package/dist/modules/platform/gitlab/utils.js.map +1 -1
  465. package/dist/modules/platform/pr-body.js +2 -3
  466. package/dist/modules/platform/pr-body.js.map +1 -1
  467. package/dist/modules/versioning/composer/index.js +2 -3
  468. package/dist/modules/versioning/composer/index.js.map +1 -1
  469. package/dist/modules/versioning/generic.js +5 -6
  470. package/dist/modules/versioning/generic.js.map +1 -1
  471. package/dist/modules/versioning/gradle/compare.js +3 -4
  472. package/dist/modules/versioning/gradle/compare.js.map +1 -1
  473. package/dist/modules/versioning/nixpkgs/index.js +6 -7
  474. package/dist/modules/versioning/nixpkgs/index.js.map +1 -1
  475. package/dist/modules/versioning/npm/range.js +2 -2
  476. package/dist/modules/versioning/npm/range.js.map +1 -1
  477. package/dist/modules/versioning/rpm/index.js +4 -5
  478. package/dist/modules/versioning/rpm/index.js.map +1 -1
  479. package/dist/modules/versioning/schema.js +2 -2
  480. package/dist/modules/versioning/schema.js.map +1 -1
  481. package/dist/modules/versioning/semver-coerced/index.js +3 -3
  482. package/dist/modules/versioning/semver-coerced/index.js.map +1 -1
  483. package/dist/modules/versioning/semver-partial/index.js +4 -4
  484. package/dist/modules/versioning/semver-partial/index.js.map +1 -1
  485. package/dist/proxy.js +3 -4
  486. package/dist/proxy.js.map +1 -1
  487. package/dist/util/array.js +4 -5
  488. package/dist/util/array.js.map +1 -1
  489. package/dist/util/assign-keys.js +2 -3
  490. package/dist/util/assign-keys.js.map +1 -1
  491. package/dist/util/cache/package/decorator.js +6 -6
  492. package/dist/util/cache/package/decorator.js.map +1 -1
  493. package/dist/util/cache/package/ttl.js +4 -5
  494. package/dist/util/cache/package/ttl.js.map +1 -1
  495. package/dist/util/cache/repository/impl/base.js +3 -4
  496. package/dist/util/cache/repository/impl/base.js.map +1 -1
  497. package/dist/util/cache/repository/impl/s3.js +2 -3
  498. package/dist/util/cache/repository/impl/s3.js.map +1 -1
  499. package/dist/util/exec/common.js +2 -3
  500. package/dist/util/exec/common.js.map +1 -1
  501. package/dist/util/exec/containerbase.js +2 -2
  502. package/dist/util/exec/containerbase.js.map +1 -1
  503. package/dist/util/exec/docker/index.js +5 -5
  504. package/dist/util/exec/docker/index.js.map +1 -1
  505. package/dist/util/exec/index.js +2 -2
  506. package/dist/util/exec/index.js.map +1 -1
  507. package/dist/util/exec/utils.js +3 -4
  508. package/dist/util/exec/utils.js.map +1 -1
  509. package/dist/util/filter-map.js +2 -3
  510. package/dist/util/filter-map.js.map +1 -1
  511. package/dist/util/fs/index.js +3 -3
  512. package/dist/util/fs/index.js.map +1 -1
  513. package/dist/util/git/auth.js +2 -3
  514. package/dist/util/git/auth.js.map +1 -1
  515. package/dist/util/git/config.js +3 -4
  516. package/dist/util/git/config.js.map +1 -1
  517. package/dist/util/git/index.js +4 -4
  518. package/dist/util/git/index.js.map +1 -1
  519. package/dist/util/git/private-key.js +2 -2
  520. package/dist/util/git/private-key.js.map +1 -1
  521. package/dist/util/host-rules.js +6 -6
  522. package/dist/util/host-rules.js.map +1 -1
  523. package/dist/util/http/auth.js +3 -4
  524. package/dist/util/http/auth.js.map +1 -1
  525. package/dist/util/http/bitbucket-server.js +2 -3
  526. package/dist/util/http/bitbucket-server.js.map +1 -1
  527. package/dist/util/http/bitbucket.js +3 -4
  528. package/dist/util/http/bitbucket.js.map +1 -1
  529. package/dist/util/http/cache/package-http-cache-provider.js +2 -2
  530. package/dist/util/http/cache/package-http-cache-provider.js.map +1 -1
  531. package/dist/util/http/forgejo.js +3 -4
  532. package/dist/util/http/forgejo.js.map +1 -1
  533. package/dist/util/http/gitea.js +3 -4
  534. package/dist/util/http/gitea.js.map +1 -1
  535. package/dist/util/http/github.js +10 -10
  536. package/dist/util/http/github.js.map +1 -1
  537. package/dist/util/http/gitlab.js +4 -5
  538. package/dist/util/http/gitlab.js.map +1 -1
  539. package/dist/util/http/host-rules.js +10 -10
  540. package/dist/util/http/host-rules.js.map +1 -1
  541. package/dist/util/http/http.js +5 -5
  542. package/dist/util/http/http.js.map +1 -1
  543. package/dist/util/http/rate-limits.js +3 -3
  544. package/dist/util/http/rate-limits.js.map +1 -1
  545. package/dist/util/interpolator.js +8 -9
  546. package/dist/util/interpolator.js.map +1 -1
  547. package/dist/util/merge-confidence/index.js +5 -5
  548. package/dist/util/merge-confidence/index.js.map +1 -1
  549. package/dist/util/number.js +2 -3
  550. package/dist/util/number.js.map +1 -1
  551. package/dist/util/package-rules/base-branches.js +3 -4
  552. package/dist/util/package-rules/base-branches.js.map +1 -1
  553. package/dist/util/package-rules/categories.js +3 -4
  554. package/dist/util/package-rules/categories.js.map +1 -1
  555. package/dist/util/package-rules/current-age.js +3 -4
  556. package/dist/util/package-rules/current-age.js.map +1 -1
  557. package/dist/util/package-rules/current-value.js +2 -3
  558. package/dist/util/package-rules/current-value.js.map +1 -1
  559. package/dist/util/package-rules/current-version.js +5 -5
  560. package/dist/util/package-rules/current-version.js.map +1 -1
  561. package/dist/util/package-rules/datasources.js +3 -4
  562. package/dist/util/package-rules/datasources.js.map +1 -1
  563. package/dist/util/package-rules/dep-names.js +3 -4
  564. package/dist/util/package-rules/dep-names.js.map +1 -1
  565. package/dist/util/package-rules/dep-types.js +2 -3
  566. package/dist/util/package-rules/dep-types.js.map +1 -1
  567. package/dist/util/package-rules/files.js +4 -5
  568. package/dist/util/package-rules/files.js.map +1 -1
  569. package/dist/util/package-rules/index.js +6 -6
  570. package/dist/util/package-rules/index.js.map +1 -1
  571. package/dist/util/package-rules/managers.js +3 -4
  572. package/dist/util/package-rules/managers.js.map +1 -1
  573. package/dist/util/package-rules/merge-confidence.js +5 -6
  574. package/dist/util/package-rules/merge-confidence.js.map +1 -1
  575. package/dist/util/package-rules/new-value.js +2 -3
  576. package/dist/util/package-rules/new-value.js.map +1 -1
  577. package/dist/util/package-rules/package-names.js +2 -3
  578. package/dist/util/package-rules/package-names.js.map +1 -1
  579. package/dist/util/package-rules/repositories.js +3 -4
  580. package/dist/util/package-rules/repositories.js.map +1 -1
  581. package/dist/util/package-rules/sourceurls.js +2 -3
  582. package/dist/util/package-rules/sourceurls.js.map +1 -1
  583. package/dist/util/package-rules/update-types.js +2 -3
  584. package/dist/util/package-rules/update-types.js.map +1 -1
  585. package/dist/util/pretty-time.js +4 -4
  586. package/dist/util/pretty-time.js.map +1 -1
  587. package/dist/util/regex.js +2 -3
  588. package/dist/util/regex.js.map +1 -1
  589. package/dist/util/s3.js +2 -3
  590. package/dist/util/s3.js.map +1 -1
  591. package/dist/util/sanitize.js +2 -3
  592. package/dist/util/sanitize.js.map +1 -1
  593. package/dist/util/string-match.js +2 -3
  594. package/dist/util/string-match.js.map +1 -1
  595. package/dist/util/template/index.js +6 -6
  596. package/dist/util/template/index.js.map +1 -1
  597. package/dist/util/url.js +5 -5
  598. package/dist/util/url.js.map +1 -1
  599. package/dist/workers/global/autodiscover.js +3 -4
  600. package/dist/workers/global/autodiscover.js.map +1 -1
  601. package/dist/workers/global/config/parse/additional-config-file.js +4 -4
  602. package/dist/workers/global/config/parse/additional-config-file.js.map +1 -1
  603. package/dist/workers/global/config/parse/coersions.js +2 -2
  604. package/dist/workers/global/config/parse/coersions.js.map +1 -1
  605. package/dist/workers/global/config/parse/env.js +2 -2
  606. package/dist/workers/global/config/parse/env.js.map +1 -1
  607. package/dist/workers/global/config/parse/file.js +5 -5
  608. package/dist/workers/global/config/parse/file.js.map +1 -1
  609. package/dist/workers/global/config/parse/index.js +6 -7
  610. package/dist/workers/global/config/parse/index.js.map +1 -1
  611. package/dist/workers/global/config/parse/util.js +2 -2
  612. package/dist/workers/global/config/parse/util.js.map +1 -1
  613. package/dist/workers/global/index.js +5 -5
  614. package/dist/workers/global/index.js.map +1 -1
  615. package/dist/workers/global/limits.js +6 -7
  616. package/dist/workers/global/limits.js.map +1 -1
  617. package/dist/workers/repository/config-migration/branch/index.js +2 -3
  618. package/dist/workers/repository/config-migration/branch/index.js.map +1 -1
  619. package/dist/workers/repository/config-migration/branch/migrated-data.js +2 -2
  620. package/dist/workers/repository/config-migration/branch/migrated-data.js.map +1 -1
  621. package/dist/workers/repository/config-migration/pr/index.js +3 -3
  622. package/dist/workers/repository/config-migration/pr/index.js.map +1 -1
  623. package/dist/workers/repository/dependency-dashboard.js +10 -10
  624. package/dist/workers/repository/dependency-dashboard.js.map +1 -1
  625. package/dist/workers/repository/error.js +6 -1
  626. package/dist/workers/repository/error.js.map +1 -1
  627. package/dist/workers/repository/extract/index.js +2 -3
  628. package/dist/workers/repository/extract/index.js.map +1 -1
  629. package/dist/workers/repository/extract/manager-files.js +2 -3
  630. package/dist/workers/repository/extract/manager-files.js.map +1 -1
  631. package/dist/workers/repository/extract/supersedes.js +4 -5
  632. package/dist/workers/repository/extract/supersedes.js.map +1 -1
  633. package/dist/workers/repository/finalize/prune.js +2 -3
  634. package/dist/workers/repository/finalize/prune.js.map +1 -1
  635. package/dist/workers/repository/init/inherited.js +5 -5
  636. package/dist/workers/repository/init/inherited.js.map +1 -1
  637. package/dist/workers/repository/init/merge.js +13 -13
  638. package/dist/workers/repository/init/merge.js.map +1 -1
  639. package/dist/workers/repository/model/commit-message.js +2 -3
  640. package/dist/workers/repository/model/commit-message.js.map +1 -1
  641. package/dist/workers/repository/onboarding/branch/index.js +2 -3
  642. package/dist/workers/repository/onboarding/branch/index.js.map +1 -1
  643. package/dist/workers/repository/onboarding/branch/onboarding-branch-cache.js +5 -6
  644. package/dist/workers/repository/onboarding/branch/onboarding-branch-cache.js.map +1 -1
  645. package/dist/workers/repository/onboarding/pr/config-description.js +2 -5
  646. package/dist/workers/repository/onboarding/pr/config-description.js.map +1 -1
  647. package/dist/workers/repository/onboarding/pr/index.js +3 -3
  648. package/dist/workers/repository/onboarding/pr/index.js.map +1 -1
  649. package/dist/workers/repository/package-files.js +8 -9
  650. package/dist/workers/repository/package-files.js.map +1 -1
  651. package/dist/workers/repository/process/extract-update.js +2 -2
  652. package/dist/workers/repository/process/extract-update.js.map +1 -1
  653. package/dist/workers/repository/process/fetch.js +3 -3
  654. package/dist/workers/repository/process/fetch.js.map +1 -1
  655. package/dist/workers/repository/process/lookup/current.js +2 -3
  656. package/dist/workers/repository/process/lookup/current.js.map +1 -1
  657. package/dist/workers/repository/process/lookup/filter-checks.js +4 -5
  658. package/dist/workers/repository/process/lookup/filter-checks.js.map +1 -1
  659. package/dist/workers/repository/process/lookup/generate.js +2 -3
  660. package/dist/workers/repository/process/lookup/generate.js.map +1 -1
  661. package/dist/workers/repository/process/lookup/index.js +15 -16
  662. package/dist/workers/repository/process/lookup/index.js.map +1 -1
  663. package/dist/workers/repository/process/lookup/utils.js +7 -7
  664. package/dist/workers/repository/process/lookup/utils.js.map +1 -1
  665. package/dist/workers/repository/process/vulnerabilities.js +11 -11
  666. package/dist/workers/repository/process/vulnerabilities.js.map +1 -1
  667. package/dist/workers/repository/process/write.js +2 -3
  668. package/dist/workers/repository/process/write.js.map +1 -1
  669. package/dist/workers/repository/reconfigure/comment.js +2 -5
  670. package/dist/workers/repository/reconfigure/comment.js.map +1 -1
  671. package/dist/workers/repository/reconfigure/utils.js +2 -3
  672. package/dist/workers/repository/reconfigure/utils.js.map +1 -1
  673. package/dist/workers/repository/reconfigure/validate.js +2 -3
  674. package/dist/workers/repository/reconfigure/validate.js.map +1 -1
  675. package/dist/workers/repository/update/branch/auto-replace.js +4 -5
  676. package/dist/workers/repository/update/branch/auto-replace.js.map +1 -1
  677. package/dist/workers/repository/update/branch/commit.js +3 -4
  678. package/dist/workers/repository/update/branch/commit.js.map +1 -1
  679. package/dist/workers/repository/update/branch/execute-post-upgrade-commands.js +12 -5
  680. package/dist/workers/repository/update/branch/execute-post-upgrade-commands.js.map +1 -1
  681. package/dist/workers/repository/update/branch/get-updated.js +8 -9
  682. package/dist/workers/repository/update/branch/get-updated.js.map +1 -1
  683. package/dist/workers/repository/update/branch/index.js +3 -3
  684. package/dist/workers/repository/update/branch/index.js.map +1 -1
  685. package/dist/workers/repository/update/branch/schedule.js +2 -2
  686. package/dist/workers/repository/update/branch/schedule.js.map +1 -1
  687. package/dist/workers/repository/update/pr/body/notes.js +2 -2
  688. package/dist/workers/repository/update/pr/body/notes.js.map +1 -1
  689. package/dist/workers/repository/update/pr/changelog/bitbucket/index.js +2 -2
  690. package/dist/workers/repository/update/pr/changelog/bitbucket/index.js.map +1 -1
  691. package/dist/workers/repository/update/pr/changelog/index.js +3 -3
  692. package/dist/workers/repository/update/pr/changelog/index.js.map +1 -1
  693. package/dist/workers/repository/update/pr/changelog/release-notes.js +4 -4
  694. package/dist/workers/repository/update/pr/changelog/release-notes.js.map +1 -1
  695. package/dist/workers/repository/update/pr/changelog/source.js +8 -8
  696. package/dist/workers/repository/update/pr/changelog/source.js.map +1 -1
  697. package/dist/workers/repository/update/pr/code-owners.js +2 -2
  698. package/dist/workers/repository/update/pr/code-owners.js.map +1 -1
  699. package/dist/workers/repository/update/pr/index.js +7 -8
  700. package/dist/workers/repository/update/pr/index.js.map +1 -1
  701. package/dist/workers/repository/update/pr/labels.js +4 -4
  702. package/dist/workers/repository/update/pr/labels.js.map +1 -1
  703. package/dist/workers/repository/update/pr/participants.js +4 -5
  704. package/dist/workers/repository/update/pr/participants.js.map +1 -1
  705. package/dist/workers/repository/updates/generate.js +4 -4
  706. package/dist/workers/repository/updates/generate.js.map +1 -1
  707. package/package.json +3 -3
  708. package/renovate-schema.json +7 -2
@@ -10,8 +10,7 @@ exports.incCountValue = incCountValue;
10
10
  exports.calcLimit = calcLimit;
11
11
  exports.hasMultipleLimits = hasMultipleLimits;
12
12
  exports.isLimitReached = isLimitReached;
13
- const tslib_1 = require("tslib");
14
- const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
13
+ const is_1 = require("@sindresorhus/is");
15
14
  const logger_1 = require("../../logger");
16
15
  const limits = new Map();
17
16
  function resetAllLimits() {
@@ -43,7 +42,7 @@ exports.counts = new Map();
43
42
  function getCount(key) {
44
43
  const count = exports.counts.get(key);
45
44
  // istanbul ignore if: should not happen
46
- if (!is_1.default.integer(count)) {
45
+ if (!(0, is_1.isInteger)(count)) {
47
46
  logger_1.logger.debug(`Could not compute the count of ${key}, returning zero.`);
48
47
  return 0;
49
48
  }
@@ -86,11 +85,11 @@ function calcLimit(upgrades, limitName) {
86
85
  for (const upgrade of upgrades) {
87
86
  let limit = upgrade[limitName];
88
87
  // inherit prConcurrentLimit value incase branchConcurrentLimit is null
89
- if (!is_1.default.number(limit) && limitName === 'branchConcurrentLimit') {
88
+ if (!(0, is_1.isNumber)(limit) && limitName === 'branchConcurrentLimit') {
90
89
  limit = upgrade.prConcurrentLimit;
91
90
  }
92
91
  // istanbul ignore if: should never happen as all limits get a default value
93
- if (is_1.default.undefined(limit)) {
92
+ if ((0, is_1.isUndefined)(limit)) {
94
93
  limit = Number.MAX_SAFE_INTEGER;
95
94
  }
96
95
  // no limit
@@ -112,14 +111,14 @@ function hasMultipleLimits(upgrades, limitName) {
112
111
  for (const upgrade of upgrades) {
113
112
  let limitValue = upgrade[limitName];
114
113
  // inherit prConcurrentLimit value incase branchConcurrentLimit is null
115
- if (limitName === 'branchConcurrentLimit' && !is_1.default.number(limitValue)) {
114
+ if (limitName === 'branchConcurrentLimit' && !(0, is_1.isNumber)(limitValue)) {
116
115
  limitValue = upgrade.prConcurrentLimit;
117
116
  }
118
117
  // istanbul ignore if: should not happen as the limits are of type number
119
118
  if (limitValue === null) {
120
119
  limitValue = 0;
121
120
  }
122
- if (!is_1.default.undefined(limitValue) && !distinctLimits.has(limitValue)) {
121
+ if (!(0, is_1.isUndefined)(limitValue) && !distinctLimits.has(limitValue)) {
123
122
  distinctLimits.add(limitValue);
124
123
  }
125
124
  }
@@ -1 +1 @@
1
- {"version":3,"file":"limits.js","sourceRoot":"","sources":["../../../lib/workers/global/limits.ts"],"names":[],"mappings":";;;AAYA,wCAEC;AAED,kCAIC;AAED,0CAMC;AAsBD,4BAQC;AAED,4BAGC;AAED,sCAGC;AA4BD,8BAiDC;AAED,8CA4BC;AAOD,wCAgBC;;AAtMD,kEAAkC;AAClC,yCAAsC;AAStC,MAAM,MAAM,GAAG,I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AI,KAAK,CACb,uEAAuE,CACxE,CAAC;AACJ,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { logger } from '../../logger';\nimport type { BranchConfig, BranchUpgradeConfig } from '../types';\n\nexport type Limit = 'Commits';\ninterface LimitValue {\n max: number | null;\n current: number;\n}\n\nconst limits = new Map<Limit, LimitValue>();\n\nexport function resetAllLimits(): void {\n limits.clear();\n}\n\nexport function setMaxLimit(key: Limit, val: unknown): void {\n const max = typeof val === 'number' ? Math.max(0, val) : null;\n limits.set(key, { current: 0, max });\n logger.debug(`${key} limit = ${max!}`);\n}\n\nexport function incLimitedValue(key: Limit, incBy = 1): void {\n const limit = limits.get(key) ?? { max: null, current: 0 };\n limits.set(key, {\n ...limit,\n current: limit.current + incBy,\n });\n}\n\nfunction handleCommitsLimit(): boolean {\n const limit = limits.get('Commits');\n // TODO: fix me?\n // eslint-disable-next-line @typescript-eslint/prefer-optional-chain\n if (!limit || limit.max === null) {\n return false;\n }\n const { max, current } = limit;\n return max - current <= 0;\n}\n\nexport type CountName = 'ConcurrentPRs' | 'HourlyPRs' | 'Branches';\n\ntype BranchLimitName =\n | 'branchConcurrentLimit'\n | 'prConcurrentLimit'\n | 'prHourlyLimit';\n\nexport const counts = new Map<CountName, number>();\n\nexport function getCount(key: CountName): number {\n const count = counts.get(key);\n // istanbul ignore if: should not happen\n if (!is.integer(count)) {\n logger.debug(`Could not compute the count of ${key}, returning zero.`);\n return 0;\n }\n return count;\n}\n\nexport function setCount(key: CountName, val: number): void {\n counts.set(key, val);\n logger.debug(`${key} count = ${val}`);\n}\n\nexport function incCountValue(key: CountName, incBy = 1): void {\n const count = getCount(key);\n counts.set(key, count + incBy);\n}\n\nfunction handleConcurrentLimits(\n key: Exclude<CountName, 'HourlyPRs'>,\n config: BranchConfig,\n): boolean {\n const limitKey =\n key === 'Branches' ? 'branchConcurrentLimit' : 'prConcurrentLimit';\n\n // calculate the limits for this branch\n const hourlyLimit = calcLimit(config.upgrades, 'prHourlyLimit');\n const hourlyPrCount = getCount('HourlyPRs');\n\n // if a limit is defined ( >0 ) and limit reached return true ie. limit has been reached\n if (hourlyLimit && hourlyPrCount >= hourlyLimit) {\n return true;\n }\n\n const limitValue = calcLimit(config.upgrades, limitKey);\n const currentCount = getCount(key);\n\n if (limitValue && currentCount >= limitValue) {\n return true;\n }\n\n return false;\n}\n\nexport function calcLimit(\n upgrades: BranchUpgradeConfig[],\n limitName: BranchLimitName,\n): number {\n logger.debug(\n {\n limits: upgrades.map((upg) => {\n return { depName: upg.depName, [limitName]: upg[limitName] };\n }),\n },\n `${limitName} of the upgrades present in this branch`,\n );\n\n if (hasMultipleLimits(upgrades, limitName)) {\n logger.once.debug(\n `Branch has multiple ${limitName} limits. The lowest among these will be selected.`,\n );\n }\n\n let lowestLimit = Number.MAX_SAFE_INTEGER;\n for (const upgrade of upgrades) {\n let limit = upgrade[limitName];\n\n // inherit prConcurrentLimit value incase branchConcurrentLimit is null\n if (!is.number(limit) && limitName === 'branchConcurrentLimit') {\n limit = upgrade.prConcurrentLimit;\n }\n\n // istanbul ignore if: should never happen as all limits get a default value\n if (is.undefined(limit)) {\n limit = Number.MAX_SAFE_INTEGER;\n }\n\n // no limit\n if (limit === 0 || limit === null) {\n logger.debug(\n `${limitName} of this branch is unlimited, because atleast one of the upgrade has it's ${limitName} set to \"No limit\" ie. 0 or null`,\n );\n return 0;\n }\n\n // limit is set\n lowestLimit = limit < lowestLimit ? limit : lowestLimit;\n }\n\n logger.debug(\n `Calculated lowest ${limitName} among the upgrades present in this branch is ${lowestLimit}.`,\n );\n return lowestLimit;\n}\n\nexport function hasMultipleLimits(\n upgrades: BranchUpgradeConfig[],\n limitName: BranchLimitName,\n): boolean {\n if (upgrades.length === 1) {\n return false;\n }\n\n const distinctLimits = new Set<number>();\n for (const upgrade of upgrades) {\n let limitValue = upgrade[limitName];\n\n // inherit prConcurrentLimit value incase branchConcurrentLimit is null\n if (limitName === 'branchConcurrentLimit' && !is.number(limitValue)) {\n limitValue = upgrade.prConcurrentLimit;\n }\n\n // istanbul ignore if: should not happen as the limits are of type number\n if (limitValue === null) {\n limitValue = 0;\n }\n\n if (!is.undefined(limitValue) && !distinctLimits.has(limitValue)) {\n distinctLimits.add(limitValue);\n }\n }\n\n return distinctLimits.size > 1;\n}\n\nexport function isLimitReached(limit: 'Commits'): boolean;\nexport function isLimitReached(\n limit: 'Branches' | 'ConcurrentPRs',\n config: BranchConfig,\n): boolean;\nexport function isLimitReached(\n limit: 'Commits' | 'Branches' | 'ConcurrentPRs',\n config?: BranchConfig,\n): boolean {\n if (limit === 'Commits') {\n return handleCommitsLimit();\n }\n\n if (config) {\n return handleConcurrentLimits(limit, config);\n }\n\n // istanbul ignore next: should not happen\n throw new Error(\n 'Config is required for computing limits for Branches and PullRequests',\n );\n}\n"]}
1
+ {"version":3,"file":"limits.js","sourceRoot":"","sources":["../../../lib/workers/global/limits.ts"],"names":[],"mappings":";;;AAYA,wCAEC;AAED,kCAIC;AAED,0CAMC;AAsBD,4BAQC;AAED,4BAGC;AAED,sCAGC;AA4BD,8BAiDC;AAED,8CA4BC;AAOD,wCAgBC;AAtMD,yCAAoE;AACpE,yCAAsC;AAStC,MAAM,MAAM,GAAG,IAAI,GAAG,EAAqB,CAAC;AAE5C,SAAgB,cAAc;IAC5B,MAAM,CAAC,KAAK,EAAE,CAAC;AACjB,CAAC;AAED,SAAgB,WAAW,CAAC,GAAU,EAAE,GAAY;IAClD,MAAM,GAAG,GAAG,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC9D,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;IACrC,eAAM,CAAC,KAAK,CAAC,GAAG,GAAG,YAAY,GAAI,EAAE,CAAC,CAAC;AACzC,CAAC;AAED,SAAgB,eAAe,CA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AAK,uBAAuB,IAAI,CAAC,IAAA,aAAQ,EAAC,UAAU,CAAC,EAAE,CAAC;YACnE,UAAU,GAAG,OAAO,CAAC,iBAAiB,CAAC;QACzC,CAAC;QAED,yEAAyE;QACzE,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;YACxB,UAAU,GAAG,CAAC,CAAC;QACjB,CAAC;QAED,IAAI,CAAC,IAAA,gBAAW,EAAC,UAAU,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;YAChE,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACjC,CAAC;IACH,CAAC;IAED,OAAO,cAAc,CAAC,IAAI,GAAG,CAAC,CAAC;AACjC,CAAC;AAOD,SAAgB,cAAc,CAC5B,KAA+C,EAC/C,MAAqB;IAErB,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,kBAAkB,EAAE,CAAC;IAC9B,CAAC;IAED,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,sBAAsB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC/C,CAAC;IAED,0CAA0C;IAC1C,MAAM,IAAI,KAAK,CACb,uEAAuE,CACxE,CAAC;AACJ,CAAC","sourcesContent":["import { isInteger, isNumber, isUndefined } from '@sindresorhus/is';\nimport { logger } from '../../logger';\nimport type { BranchConfig, BranchUpgradeConfig } from '../types';\n\nexport type Limit = 'Commits';\ninterface LimitValue {\n max: number | null;\n current: number;\n}\n\nconst limits = new Map<Limit, LimitValue>();\n\nexport function resetAllLimits(): void {\n limits.clear();\n}\n\nexport function setMaxLimit(key: Limit, val: unknown): void {\n const max = typeof val === 'number' ? Math.max(0, val) : null;\n limits.set(key, { current: 0, max });\n logger.debug(`${key} limit = ${max!}`);\n}\n\nexport function incLimitedValue(key: Limit, incBy = 1): void {\n const limit = limits.get(key) ?? { max: null, current: 0 };\n limits.set(key, {\n ...limit,\n current: limit.current + incBy,\n });\n}\n\nfunction handleCommitsLimit(): boolean {\n const limit = limits.get('Commits');\n // TODO: fix me?\n // eslint-disable-next-line @typescript-eslint/prefer-optional-chain\n if (!limit || limit.max === null) {\n return false;\n }\n const { max, current } = limit;\n return max - current <= 0;\n}\n\nexport type CountName = 'ConcurrentPRs' | 'HourlyPRs' | 'Branches';\n\ntype BranchLimitName =\n | 'branchConcurrentLimit'\n | 'prConcurrentLimit'\n | 'prHourlyLimit';\n\nexport const counts = new Map<CountName, number>();\n\nexport function getCount(key: CountName): number {\n const count = counts.get(key);\n // istanbul ignore if: should not happen\n if (!isInteger(count)) {\n logger.debug(`Could not compute the count of ${key}, returning zero.`);\n return 0;\n }\n return count;\n}\n\nexport function setCount(key: CountName, val: number): void {\n counts.set(key, val);\n logger.debug(`${key} count = ${val}`);\n}\n\nexport function incCountValue(key: CountName, incBy = 1): void {\n const count = getCount(key);\n counts.set(key, count + incBy);\n}\n\nfunction handleConcurrentLimits(\n key: Exclude<CountName, 'HourlyPRs'>,\n config: BranchConfig,\n): boolean {\n const limitKey =\n key === 'Branches' ? 'branchConcurrentLimit' : 'prConcurrentLimit';\n\n // calculate the limits for this branch\n const hourlyLimit = calcLimit(config.upgrades, 'prHourlyLimit');\n const hourlyPrCount = getCount('HourlyPRs');\n\n // if a limit is defined ( >0 ) and limit reached return true ie. limit has been reached\n if (hourlyLimit && hourlyPrCount >= hourlyLimit) {\n return true;\n }\n\n const limitValue = calcLimit(config.upgrades, limitKey);\n const currentCount = getCount(key);\n\n if (limitValue && currentCount >= limitValue) {\n return true;\n }\n\n return false;\n}\n\nexport function calcLimit(\n upgrades: BranchUpgradeConfig[],\n limitName: BranchLimitName,\n): number {\n logger.debug(\n {\n limits: upgrades.map((upg) => {\n return { depName: upg.depName, [limitName]: upg[limitName] };\n }),\n },\n `${limitName} of the upgrades present in this branch`,\n );\n\n if (hasMultipleLimits(upgrades, limitName)) {\n logger.once.debug(\n `Branch has multiple ${limitName} limits. The lowest among these will be selected.`,\n );\n }\n\n let lowestLimit = Number.MAX_SAFE_INTEGER;\n for (const upgrade of upgrades) {\n let limit = upgrade[limitName];\n\n // inherit prConcurrentLimit value incase branchConcurrentLimit is null\n if (!isNumber(limit) && limitName === 'branchConcurrentLimit') {\n limit = upgrade.prConcurrentLimit;\n }\n\n // istanbul ignore if: should never happen as all limits get a default value\n if (isUndefined(limit)) {\n limit = Number.MAX_SAFE_INTEGER;\n }\n\n // no limit\n if (limit === 0 || limit === null) {\n logger.debug(\n `${limitName} of this branch is unlimited, because atleast one of the upgrade has it's ${limitName} set to \"No limit\" ie. 0 or null`,\n );\n return 0;\n }\n\n // limit is set\n lowestLimit = limit < lowestLimit ? limit : lowestLimit;\n }\n\n logger.debug(\n `Calculated lowest ${limitName} among the upgrades present in this branch is ${lowestLimit}.`,\n );\n return lowestLimit;\n}\n\nexport function hasMultipleLimits(\n upgrades: BranchUpgradeConfig[],\n limitName: BranchLimitName,\n): boolean {\n if (upgrades.length === 1) {\n return false;\n }\n\n const distinctLimits = new Set<number>();\n for (const upgrade of upgrades) {\n let limitValue = upgrade[limitName];\n\n // inherit prConcurrentLimit value incase branchConcurrentLimit is null\n if (limitName === 'branchConcurrentLimit' && !isNumber(limitValue)) {\n limitValue = upgrade.prConcurrentLimit;\n }\n\n // istanbul ignore if: should not happen as the limits are of type number\n if (limitValue === null) {\n limitValue = 0;\n }\n\n if (!isUndefined(limitValue) && !distinctLimits.has(limitValue)) {\n distinctLimits.add(limitValue);\n }\n }\n\n return distinctLimits.size > 1;\n}\n\nexport function isLimitReached(limit: 'Commits'): boolean;\nexport function isLimitReached(\n limit: 'Branches' | 'ConcurrentPRs',\n config: BranchConfig,\n): boolean;\nexport function isLimitReached(\n limit: 'Commits' | 'Branches' | 'ConcurrentPRs',\n config?: BranchConfig,\n): boolean {\n if (limit === 'Commits') {\n return handleCommitsLimit();\n }\n\n if (config) {\n return handleConcurrentLimits(limit, config);\n }\n\n // istanbul ignore next: should not happen\n throw new Error(\n 'Config is required for computing limits for Branches and PullRequests',\n );\n}\n"]}
@@ -2,8 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.checkConfigMigrationBranch = checkConfigMigrationBranch;
4
4
  exports.migrationPrExists = migrationPrExists;
5
- const tslib_1 = require("tslib");
6
- const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
5
+ const is_1 = require("@sindresorhus/is");
7
6
  const global_1 = require("../../../../config/global");
8
7
  const logger_1 = require("../../../../logger");
9
8
  const platform_1 = require("../../../../modules/platform");
@@ -16,7 +15,7 @@ async function checkConfigMigrationBranch(config, migratedConfigData) {
16
15
  logger_1.logger.debug('checkConfigMigrationBranch()');
17
16
  const configMigrationCheckboxState = config.dependencyDashboardChecks?.configMigrationCheckboxState;
18
17
  if (!config.configMigration) {
19
- if (is_1.default.undefined(configMigrationCheckboxState) ||
18
+ if ((0, is_1.isUndefined)(configMigrationCheckboxState) ||
20
19
  configMigrationCheckboxState === 'no-checkbox' ||
21
20
  configMigrationCheckboxState === 'unchecked') {
22
21
  logger_1.logger.debug('Config migration needed but config migration is disabled and checkbox not checked or not present.');
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../lib/workers/repository/config-migration/branch/index.ts"],"names":[],"mappings":";;AAoBA,gEAqGC;AAED,8CAKC;;AAhID,kEAAkC;AAClC,sDAAyD;AAEzD,+CAA4C;AAE5C,2DAAwD;AACxD,0DAAuD;AACvD,sCAAmD;AACnD,qDAAuE;AACvE,qCAAuD;AAEvD,qCAAiD;AAS1C,KAAK,UAAU,0BAA0B,CAC9C,MAAsB,EACtB,kBAAgC;IAEhC,eAAM,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAC7C,MAAM,4BAA4B,GAChC,MAAM,CAAC,yBAAyB,EAAE,4BAA4B,CAAC;IAEjE,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC;QAC5B,IACE,YAAE,CAAC,SAAS,CAAC,4BAA4B,CAAC;YAC1C,4BAA4B,KAAK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sB,EAAE,EAAM;IACpD,IAAI,MAAM,SAAG,CAAC,YAAY,CAAC,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC;QAC5C,IAAI,qBAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC/B,eAAM,CAAC,IAAI,CAAC,+BAA+B,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC;QACjE,CAAC;aAAM,CAAC;YACN,MAAM,SAAG,CAAC,YAAY,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC;QAC1C,CAAC;IACH,CAAC;AACH,CAAC;AAED,KAAK,UAAU,yBAAyB,CACtC,MAAsB,EACtB,qBAA6B;IAE7B,MAAM,UAAU,GAAG,MAAM,CAAC,aAAc,CAAC;IACzC,OAAO,MAAM,SAAG,CAAC,gBAAgB,CAAC,qBAAqB,EAAE,UAAU,CAAC,CAAC;AACvE,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { GlobalConfig } from '../../../../config/global';\nimport type { RenovateConfig } from '../../../../config/types';\nimport { logger } from '../../../../logger';\nimport type { FindPRConfig, Pr } from '../../../../modules/platform';\nimport { platform } from '../../../../modules/platform';\nimport { scm } from '../../../../modules/platform/scm';\nimport { getMigrationBranchName } from '../common';\nimport { ConfigMigrationCommitMessageFactory } from './commit-message';\nimport { createConfigMigrationBranch } from './create';\nimport type { MigratedData } from './migrated-data';\nimport { rebaseMigrationBranch } from './rebase';\n\nexport type CheckConfigMigrationBranchResult =\n | { result: 'no-migration-branch' }\n | {\n result: 'migration-branch-exists' | 'migration-branch-modified';\n migrationBranch: string;\n };\n\nexport async function checkConfigMigrationBranch(\n config: RenovateConfig,\n migratedConfigData: MigratedData,\n): Promise<CheckConfigMigrationBranchResult> {\n logger.debug('checkConfigMigrationBranch()');\n const configMigrationCheckboxState =\n config.dependencyDashboardChecks?.configMigrationCheckboxState;\n\n if (!config.configMigration) {\n if (\n is.undefined(configMigrationCheckboxState) ||\n configMigrationCheckboxState === 'no-checkbox' ||\n configMigrationCheckboxState === 'unchecked'\n ) {\n logger.debug(\n 'Config migration needed but config migration is disabled and checkbox not checked or not present.',\n );\n return { result: 'no-migration-branch' };\n }\n }\n\n const configMigrationBranch = getMigrationBranchName(config);\n\n const branchPr = await migrationPrExists(\n configMigrationBranch,\n config.baseBranch,\n ); // handles open/autoclosed PRs\n\n if (!branchPr) {\n const commitMessageFactory = new ConfigMigrationCommitMessageFactory(\n config,\n migratedConfigData.filename,\n );\n const prTitle = commitMessageFactory.getPrTitle();\n const closedPrConfig: FindPRConfig = {\n branchName: configMigrationBranch,\n prTitle,\n state: 'closed',\n targetBranch: config.baseBranch,\n };\n\n // handles closed PR\n const closedPr = await platform.findPr(closedPrConfig);\n\n // found closed migration PR\n if (closedPr) {\n logger.debug('Closed config migration PR found.');\n\n // if a closed pr exists and the checkbox for config migration is not checked\n // return no-migration-branch result so that the checkbox gets added again\n // we only want to create a config migration pr if the checkbox is checked\n if (configMigrationCheckboxState !== 'checked') {\n logger.debug(\n 'Config migration is enabled and needed. But a closed pr exists and checkbox is not checked. Skipping migration branch creation.',\n );\n return { result: 'no-migration-branch' };\n }\n\n logger.debug(\n 'Closed migration PR found and checkbox is checked. Try to delete this old branch and create a new one.',\n );\n await handlePr(config, closedPr);\n }\n }\n\n let result: CheckConfigMigrationBranchResult['result'];\n\n if (branchPr) {\n logger.debug('Config Migration PR already exists');\n\n if (await isMigrationBranchModified(config, configMigrationBranch)) {\n logger.debug(\n 'Config Migration branch has been modified. Skipping branch rebase.',\n );\n result = 'migration-branch-modified';\n } else {\n await rebaseMigrationBranch(config, migratedConfigData);\n if (platform.refreshPr) {\n const configMigrationPr = await platform.getBranchPr(\n configMigrationBranch,\n config.baseBranch,\n );\n if (configMigrationPr) {\n await platform.refreshPr(configMigrationPr.number);\n }\n }\n result = 'migration-branch-exists';\n }\n } else {\n logger.debug('Config Migration PR does not exist');\n logger.debug('Need to create migration PR');\n await createConfigMigrationBranch(config, migratedConfigData);\n result = 'migration-branch-exists';\n }\n if (!GlobalConfig.get('dryRun')) {\n await scm.checkoutBranch(configMigrationBranch);\n }\n return {\n migrationBranch: configMigrationBranch,\n result,\n };\n}\n\nexport async function migrationPrExists(\n branchName: string,\n targetBranch?: string,\n): Promise<Pr | null> {\n return await platform.getBranchPr(branchName, targetBranch);\n}\n\nasync function handlePr(config: RenovateConfig, pr: Pr): Promise<void> {\n if (await scm.branchExists(pr.sourceBranch)) {\n if (GlobalConfig.get('dryRun')) {\n logger.info('DRY-RUN: Would delete branch ' + pr.sourceBranch);\n } else {\n await scm.deleteBranch(pr.sourceBranch);\n }\n }\n}\n\nasync function isMigrationBranchModified(\n config: RenovateConfig,\n configMigrationBranch: string,\n): Promise<boolean> {\n const baseBranch = config.defaultBranch!;\n return await scm.isBranchModified(configMigrationBranch, baseBranch);\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../lib/workers/repository/config-migration/branch/index.ts"],"names":[],"mappings":";;AAoBA,gEAqGC;AAED,8CAKC;AAhID,yCAA+C;AAC/C,sDAAyD;AAEzD,+CAA4C;AAE5C,2DAAwD;AACxD,0DAAuD;AACvD,sCAAmD;AACnD,qDAAuE;AACvE,qCAAuD;AAEvD,qCAAiD;AAS1C,KAAK,UAAU,0BAA0B,CAC9C,MAAsB,EACtB,kBAAgC;IAEhC,eAAM,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAC7C,MAAM,4BAA4B,GAChC,MAAM,CAAC,yBAAyB,EAAE,4BAA4B,CAAC;IAEjE,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC;QAC5B,IACE,IAAA,gBAAW,EAAC,4BAA4B,CAAC;YACzC,4BAA4B,KAAK,aAAa;YAC9C,4BAA4B,KAAK,WAAW,EAC5C,CAAC;YACD,eAAM,CAAC,KAAK,CACV,mGAAmG,CACpG,CAAC;YACF,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,CAAC;QAC3C,CAAC;IACH,CAAC;IAED,MAAM,qBAAqB,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+BAA+B,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC;QACjE,CAAC;aAAM,CAAC;YACN,MAAM,SAAG,CAAC,YAAY,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC;QAC1C,CAAC;IACH,CAAC;AACH,CAAC;AAED,KAAK,UAAU,yBAAyB,CACtC,MAAsB,EACtB,qBAA6B;IAE7B,MAAM,UAAU,GAAG,MAAM,CAAC,aAAc,CAAC;IACzC,OAAO,MAAM,SAAG,CAAC,gBAAgB,CAAC,qBAAqB,EAAE,UAAU,CAAC,CAAC;AACvE,CAAC","sourcesContent":["import { isUndefined } from '@sindresorhus/is';\nimport { GlobalConfig } from '../../../../config/global';\nimport type { RenovateConfig } from '../../../../config/types';\nimport { logger } from '../../../../logger';\nimport type { FindPRConfig, Pr } from '../../../../modules/platform';\nimport { platform } from '../../../../modules/platform';\nimport { scm } from '../../../../modules/platform/scm';\nimport { getMigrationBranchName } from '../common';\nimport { ConfigMigrationCommitMessageFactory } from './commit-message';\nimport { createConfigMigrationBranch } from './create';\nimport type { MigratedData } from './migrated-data';\nimport { rebaseMigrationBranch } from './rebase';\n\nexport type CheckConfigMigrationBranchResult =\n | { result: 'no-migration-branch' }\n | {\n result: 'migration-branch-exists' | 'migration-branch-modified';\n migrationBranch: string;\n };\n\nexport async function checkConfigMigrationBranch(\n config: RenovateConfig,\n migratedConfigData: MigratedData,\n): Promise<CheckConfigMigrationBranchResult> {\n logger.debug('checkConfigMigrationBranch()');\n const configMigrationCheckboxState =\n config.dependencyDashboardChecks?.configMigrationCheckboxState;\n\n if (!config.configMigration) {\n if (\n isUndefined(configMigrationCheckboxState) ||\n configMigrationCheckboxState === 'no-checkbox' ||\n configMigrationCheckboxState === 'unchecked'\n ) {\n logger.debug(\n 'Config migration needed but config migration is disabled and checkbox not checked or not present.',\n );\n return { result: 'no-migration-branch' };\n }\n }\n\n const configMigrationBranch = getMigrationBranchName(config);\n\n const branchPr = await migrationPrExists(\n configMigrationBranch,\n config.baseBranch,\n ); // handles open/autoclosed PRs\n\n if (!branchPr) {\n const commitMessageFactory = new ConfigMigrationCommitMessageFactory(\n config,\n migratedConfigData.filename,\n );\n const prTitle = commitMessageFactory.getPrTitle();\n const closedPrConfig: FindPRConfig = {\n branchName: configMigrationBranch,\n prTitle,\n state: 'closed',\n targetBranch: config.baseBranch,\n };\n\n // handles closed PR\n const closedPr = await platform.findPr(closedPrConfig);\n\n // found closed migration PR\n if (closedPr) {\n logger.debug('Closed config migration PR found.');\n\n // if a closed pr exists and the checkbox for config migration is not checked\n // return no-migration-branch result so that the checkbox gets added again\n // we only want to create a config migration pr if the checkbox is checked\n if (configMigrationCheckboxState !== 'checked') {\n logger.debug(\n 'Config migration is enabled and needed. But a closed pr exists and checkbox is not checked. Skipping migration branch creation.',\n );\n return { result: 'no-migration-branch' };\n }\n\n logger.debug(\n 'Closed migration PR found and checkbox is checked. Try to delete this old branch and create a new one.',\n );\n await handlePr(config, closedPr);\n }\n }\n\n let result: CheckConfigMigrationBranchResult['result'];\n\n if (branchPr) {\n logger.debug('Config Migration PR already exists');\n\n if (await isMigrationBranchModified(config, configMigrationBranch)) {\n logger.debug(\n 'Config Migration branch has been modified. Skipping branch rebase.',\n );\n result = 'migration-branch-modified';\n } else {\n await rebaseMigrationBranch(config, migratedConfigData);\n if (platform.refreshPr) {\n const configMigrationPr = await platform.getBranchPr(\n configMigrationBranch,\n config.baseBranch,\n );\n if (configMigrationPr) {\n await platform.refreshPr(configMigrationPr.number);\n }\n }\n result = 'migration-branch-exists';\n }\n } else {\n logger.debug('Config Migration PR does not exist');\n logger.debug('Need to create migration PR');\n await createConfigMigrationBranch(config, migratedConfigData);\n result = 'migration-branch-exists';\n }\n if (!GlobalConfig.get('dryRun')) {\n await scm.checkoutBranch(configMigrationBranch);\n }\n return {\n migrationBranch: configMigrationBranch,\n result,\n };\n}\n\nexport async function migrationPrExists(\n branchName: string,\n targetBranch?: string,\n): Promise<Pr | null> {\n return await platform.getBranchPr(branchName, targetBranch);\n}\n\nasync function handlePr(config: RenovateConfig, pr: Pr): Promise<void> {\n if (await scm.branchExists(pr.sourceBranch)) {\n if (GlobalConfig.get('dryRun')) {\n logger.info('DRY-RUN: Would delete branch ' + pr.sourceBranch);\n } else {\n await scm.deleteBranch(pr.sourceBranch);\n }\n }\n}\n\nasync function isMigrationBranchModified(\n config: RenovateConfig,\n configMigrationBranch: string,\n): Promise<boolean> {\n const baseBranch = config.defaultBranch!;\n return await scm.isBranchModified(configMigrationBranch, baseBranch);\n}\n"]}
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MigratedDataFactory = void 0;
4
4
  exports.applyPrettierFormatting = applyPrettierFormatting;
5
5
  const tslib_1 = require("tslib");
6
- const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
6
+ const is_1 = require("@sindresorhus/is");
7
7
  const detect_indent_1 = tslib_1.__importDefault(require("detect-indent"));
8
8
  const json5_1 = tslib_1.__importDefault(require("json5"));
9
9
  const upath_1 = tslib_1.__importDefault(require("upath"));
@@ -57,7 +57,7 @@ async function applyPrettierFormatting(filename, content, parser, indent) {
57
57
  const editorconf = await json_writer_1.EditorConfig.getCodeFormat(filename);
58
58
  // https://github.com/prettier/prettier/blob/bab892242a1f9d8fcae50514b9304bf03f2e25ab/src/config/editorconfig/editorconfig-to-prettier.js#L47
59
59
  if (editorconf.maxLineLength) {
60
- options.printWidth = is_1.default.number(editorconf.maxLineLength)
60
+ options.printWidth = (0, is_1.isNumber)(editorconf.maxLineLength)
61
61
  ? editorconf.maxLineLength
62
62
  : Number.POSITIVE_INFINITY;
63
63
  }
@@ -1 +1 @@
1
- {"version":3,"file":"migrated-data.js","sourceRoot":"","sources":["../../../../../lib/workers/repository/config-migration/branch/migrated-data.ts"],"names":[],"mappings":";;;AA2CA,0DAwDC;;AAnGD,kEAAkC;AAClC,0EAAyC;AACzC,0DAA0B;AAE1B,0DAA0B;AAC1B,4DAA6D;AAC7D,uDAAkD;AAClD,+CA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E,CAAC;YAED,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC5B,OAAO,IAAI,IAAI,CAAC;YAClB,CAAC;YAED,GAAG,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;QACtC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,eAAM,CAAC,KAAK,CACV,EAAE,GAAG,EAAE,EACP,yEAAyE,CAC1E,CAAC;QACJ,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AAzED,kDAyEC","sourcesContent":["import is from '@sindresorhus/is';\nimport detectIndent from 'detect-indent';\nimport JSON5 from 'json5';\nimport type { BuiltInParserName, Options } from 'prettier';\nimport upath from 'upath';\nimport { migrateConfig } from '../../../../config/migration';\nimport { prettier } from '../../../../expose.cjs';\nimport { logger } from '../../../../logger';\nimport { platform } from '../../../../modules/platform';\nimport { scm } from '../../../../modules/platform/scm';\nimport { readLocalFile } from '../../../../util/fs';\nimport { EditorConfig } from '../../../../util/json-writer';\nimport { detectRepoFileConfig } from '../../init/merge';\n\nexport interface MigratedData {\n content: string;\n filename: string;\n indent: Indent;\n}\n\ninterface Indent {\n amount: number;\n indent: string;\n type?: string;\n}\n\nconst prettierConfigFilenames = new Set([\n '.prettierrc',\n '.prettierrc.json',\n '.prettierrc.yml',\n '.prettierrc.yaml',\n '.prettierrc.json5',\n '.prettierrc.js',\n '.prettierrc.cjs',\n '.prettierrc.mjs',\n 'prettier.config.js',\n 'prettier.config.cjs',\n 'prettier.config.mjs',\n '.prettierrc.toml',\n]);\n\nexport type PrettierParser = BuiltInParserName;\n\nexport async function applyPrettierFormatting(\n filename: string,\n content: string,\n parser: PrettierParser,\n indent?: Indent,\n): Promise<string> {\n try {\n logger.trace('applyPrettierFormatting - START');\n const fileList = await scm.getFileList();\n let prettierExists = fileList.some((file) =>\n prettierConfigFilenames.has(file),\n );\n\n const editorconfigExists = fileList.some(\n (file) => file === '.editorconfig',\n );\n\n if (!prettierExists) {\n try {\n const packageJsonContent = await readLocalFile('package.json', 'utf8');\n prettierExists =\n packageJsonContent && JSON.parse(packageJsonContent).prettier;\n } catch {\n logger.warn(\n 'applyPrettierFormatting - Error processing package.json file',\n );\n }\n }\n\n if (!prettierExists || !parser) {\n return content;\n }\n\n const options: Options = {\n parser,\n tabWidth: indent?.amount === 0 ? 2 : indent?.amount,\n useTabs: indent?.type === 'tab',\n };\n\n if (editorconfigExists) {\n const editorconf = await EditorConfig.getCodeFormat(filename);\n\n // https://github.com/prettier/prettier/blob/bab892242a1f9d8fcae50514b9304bf03f2e25ab/src/config/editorconfig/editorconfig-to-prettier.js#L47\n if (editorconf.maxLineLength) {\n options.printWidth = is.number(editorconf.maxLineLength)\n ? editorconf.maxLineLength\n : Number.POSITIVE_INFINITY;\n }\n\n // TODO: support editor config `indent_style` and `indent_size`\n }\n\n return prettier().format(content, options);\n } finally {\n logger.trace('applyPrettierFormatting - END');\n }\n}\n\nexport class MigratedDataFactory {\n // singleton\n private static data: MigratedData | null;\n\n static async getAsync(): Promise<MigratedData | null> {\n if (this.data) {\n return this.data;\n }\n const migrated = await this.build();\n\n if (!migrated) {\n return null;\n }\n\n this.data = migrated;\n return this.data;\n }\n\n static reset(): void {\n this.data = null;\n }\n\n static applyPrettierFormatting({\n content,\n filename,\n indent,\n }: MigratedData): Promise<string> {\n const parser = upath.extname(filename).replace('.', '') as PrettierParser;\n return applyPrettierFormatting(filename, content, parser, indent);\n }\n\n private static async build(): Promise<MigratedData | null> {\n let res: MigratedData | null = null;\n try {\n const { configFileName, configFileParsed = {} } =\n await detectRepoFileConfig();\n\n // get migrated config\n const { isMigrated, migratedConfig } = migrateConfig(configFileParsed);\n if (!isMigrated) {\n return null;\n }\n\n delete migratedConfig.errors;\n delete migratedConfig.warnings;\n\n // TODO #22198\n const raw = await platform.getRawFile(configFileName!);\n const indent = detectIndent(raw ?? '');\n // indent defaults to 2 spaces\n const indentSpace = indent.indent ?? ' ';\n const filename = configFileName!;\n let content: string;\n\n if (filename.endsWith('.json5')) {\n content = JSON5.stringify(migratedConfig, undefined, indentSpace);\n } else {\n content = JSON.stringify(migratedConfig, undefined, indentSpace);\n }\n\n if (!content.endsWith('\\n')) {\n content += '\\n';\n }\n\n res = { content, filename, indent };\n } catch (err) {\n logger.debug(\n { err },\n 'MigratedDataFactory.getAsync() Error initializing renovate MigratedData',\n );\n }\n return res;\n }\n}\n"]}
1
+ {"version":3,"file":"migrated-data.js","sourceRoot":"","sources":["../../../../../lib/workers/repository/config-migration/branch/migrated-data.ts"],"names":[],"mappings":";;;AA2CA,0DAwDC;;AAnGD,yCAA4C;AAC5C,0EAAyC;AACzC,0DAA0B;AAE1B,0DAA0B;AAC1B,4DAA6D;AAC7D,uDAAkD;AAClD,+CAA4C;AAC5C,2DAAwD;AACxD,0DAAuD;AACvD,4CAAoD;AACpD,8DAA4D;AAC5D,4CAAwD;AAcxD,MAAM,uBAAuB,GAAG,IAAI,GAAG,CAAC;IACtC,aAAa;IACb,kBAAkB;IAClB,iBAAiB;IACjB,kBAAkB;IAClB,mBAAmB;IACnB,gBAAgB;IAChB,iBAAiB;IACjB,iBAAiB;IACjB,oBAAoB;IACpB,qBAAqB;IACrB,qBAAqB;IACrB,kBAAkB;CACnB,CAAC,CAAC;AAII,KAAK,UAAU,uBAAuB,CAC3C,QAAgB,EAChB,OAAe,EACf,MAAsB,EACtB,MAAe;IAEf,IAAI,CAAC;QACH,eAAM,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;QAChD,MAAM,QAAQ,GAAG,MAAM,SAAG,CAAC,WAAW,EAAE,CAAC;QACzC,IAAI,cAAc,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAC1C,uBAAuB,CAAC,GAAG,CAAC,IAAI,CAAC,CAClC,CAAC;QAEF,MAAM,kBAAkB,GAAG,QAAQ,CAAC,IAAI,CACtC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,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Ae,CAAC,CAAC;YACvD,MAAM,MAAM,GAAG,IAAA,uBAAY,EAAC,GAAG,IAAI,EAAE,CAAC,CAAC;YACvC,8BAA8B;YAC9B,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC;YAC1C,MAAM,QAAQ,GAAG,cAAe,CAAC;YACjC,IAAI,OAAe,CAAC;YAEpB,IAAI,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAChC,OAAO,GAAG,eAAK,CAAC,SAAS,CAAC,cAAc,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;YACpE,CAAC;iBAAM,CAAC;gBACN,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;YACnE,CAAC;YAED,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC5B,OAAO,IAAI,IAAI,CAAC;YAClB,CAAC;YAED,GAAG,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;QACtC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,eAAM,CAAC,KAAK,CACV,EAAE,GAAG,EAAE,EACP,yEAAyE,CAC1E,CAAC;QACJ,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AAzED,kDAyEC","sourcesContent":["import { isNumber } from '@sindresorhus/is';\nimport detectIndent from 'detect-indent';\nimport JSON5 from 'json5';\nimport type { BuiltInParserName, Options } from 'prettier';\nimport upath from 'upath';\nimport { migrateConfig } from '../../../../config/migration';\nimport { prettier } from '../../../../expose.cjs';\nimport { logger } from '../../../../logger';\nimport { platform } from '../../../../modules/platform';\nimport { scm } from '../../../../modules/platform/scm';\nimport { readLocalFile } from '../../../../util/fs';\nimport { EditorConfig } from '../../../../util/json-writer';\nimport { detectRepoFileConfig } from '../../init/merge';\n\nexport interface MigratedData {\n content: string;\n filename: string;\n indent: Indent;\n}\n\ninterface Indent {\n amount: number;\n indent: string;\n type?: string;\n}\n\nconst prettierConfigFilenames = new Set([\n '.prettierrc',\n '.prettierrc.json',\n '.prettierrc.yml',\n '.prettierrc.yaml',\n '.prettierrc.json5',\n '.prettierrc.js',\n '.prettierrc.cjs',\n '.prettierrc.mjs',\n 'prettier.config.js',\n 'prettier.config.cjs',\n 'prettier.config.mjs',\n '.prettierrc.toml',\n]);\n\nexport type PrettierParser = BuiltInParserName;\n\nexport async function applyPrettierFormatting(\n filename: string,\n content: string,\n parser: PrettierParser,\n indent?: Indent,\n): Promise<string> {\n try {\n logger.trace('applyPrettierFormatting - START');\n const fileList = await scm.getFileList();\n let prettierExists = fileList.some((file) =>\n prettierConfigFilenames.has(file),\n );\n\n const editorconfigExists = fileList.some(\n (file) => file === '.editorconfig',\n );\n\n if (!prettierExists) {\n try {\n const packageJsonContent = await readLocalFile('package.json', 'utf8');\n prettierExists =\n packageJsonContent && JSON.parse(packageJsonContent).prettier;\n } catch {\n logger.warn(\n 'applyPrettierFormatting - Error processing package.json file',\n );\n }\n }\n\n if (!prettierExists || !parser) {\n return content;\n }\n\n const options: Options = {\n parser,\n tabWidth: indent?.amount === 0 ? 2 : indent?.amount,\n useTabs: indent?.type === 'tab',\n };\n\n if (editorconfigExists) {\n const editorconf = await EditorConfig.getCodeFormat(filename);\n\n // https://github.com/prettier/prettier/blob/bab892242a1f9d8fcae50514b9304bf03f2e25ab/src/config/editorconfig/editorconfig-to-prettier.js#L47\n if (editorconf.maxLineLength) {\n options.printWidth = isNumber(editorconf.maxLineLength)\n ? editorconf.maxLineLength\n : Number.POSITIVE_INFINITY;\n }\n\n // TODO: support editor config `indent_style` and `indent_size`\n }\n\n return prettier().format(content, options);\n } finally {\n logger.trace('applyPrettierFormatting - END');\n }\n}\n\nexport class MigratedDataFactory {\n // singleton\n private static data: MigratedData | null;\n\n static async getAsync(): Promise<MigratedData | null> {\n if (this.data) {\n return this.data;\n }\n const migrated = await this.build();\n\n if (!migrated) {\n return null;\n }\n\n this.data = migrated;\n return this.data;\n }\n\n static reset(): void {\n this.data = null;\n }\n\n static applyPrettierFormatting({\n content,\n filename,\n indent,\n }: MigratedData): Promise<string> {\n const parser = upath.extname(filename).replace('.', '') as PrettierParser;\n return applyPrettierFormatting(filename, content, parser, indent);\n }\n\n private static async build(): Promise<MigratedData | null> {\n let res: MigratedData | null = null;\n try {\n const { configFileName, configFileParsed = {} } =\n await detectRepoFileConfig();\n\n // get migrated config\n const { isMigrated, migratedConfig } = migrateConfig(configFileParsed);\n if (!isMigrated) {\n return null;\n }\n\n delete migratedConfig.errors;\n delete migratedConfig.warnings;\n\n // TODO #22198\n const raw = await platform.getRawFile(configFileName!);\n const indent = detectIndent(raw ?? '');\n // indent defaults to 2 spaces\n const indentSpace = indent.indent ?? ' ';\n const filename = configFileName!;\n let content: string;\n\n if (filename.endsWith('.json5')) {\n content = JSON5.stringify(migratedConfig, undefined, indentSpace);\n } else {\n content = JSON.stringify(migratedConfig, undefined, indentSpace);\n }\n\n if (!content.endsWith('\\n')) {\n content += '\\n';\n }\n\n res = { content, filename, indent };\n } catch (err) {\n logger.debug(\n { err },\n 'MigratedDataFactory.getAsync() Error initializing renovate MigratedData',\n );\n }\n return res;\n }\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ensureConfigMigrationPr = ensureConfigMigrationPr;
4
4
  const tslib_1 = require("tslib");
5
- const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
5
+ const is_1 = require("@sindresorhus/is");
6
6
  const global_1 = require("../../../../config/global");
7
7
  const logger_1 = require("../../../../logger");
8
8
  const platform_1 = require("../../../../modules/platform");
@@ -39,10 +39,10 @@ ${filename.endsWith('.json5')
39
39
  :no_bell: **Ignore**: Close this PR and you won't be reminded about config migration again, but one day your current config may no longer be valid.
40
40
 
41
41
  :question: Got questions? Does something look wrong to you? Please don't hesitate to [request help here](${config.productLinks?.help}).\n\n`);
42
- if (is_1.default.string(config.prHeader)) {
42
+ if ((0, is_1.isString)(config.prHeader)) {
43
43
  prBody = `${template.compile(config.prHeader, config)}\n\n${prBody}`;
44
44
  }
45
- if (is_1.default.string(config.prFooter)) {
45
+ if ((0, is_1.isString)(config.prFooter)) {
46
46
  prBody = `${prBody}\n---\n\n${template.compile(config.prFooter, config)}\n`;
47
47
  }
48
48
  logger_1.logger.trace({ prBody }, 'prBody');
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../lib/workers/repository/config-migration/pr/index.ts"],"names":[],"mappings":";;AAmBA,0DAoHC;;AAvID,kEAAkC;AAClC,sDAAyD;AAEzD,+CAA4C;AAE5C,2DAAwD;AACxD,kEAAgE;AAChE,0DAAuD;AACvD,kDAAiD;AACjD,oDAAuD;AACvD,4EAAsD;AACtD,8CAAoD;AACpD,wCAAuD;AACvD,mDAAuD;AACvD,+DAA+D;AAC/D,6DAA+E;AAE/E,sCAAmD;AAE5C,KAAK,UAAU,uBAAuB,CAC3C,MAAsB,EACtB,kBAAgC;IAEhC,eAAM,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;IAC1C,MAAM,QAAQ,GAAG,IAAA,kBAAY,EAC3B,IAAA,qBAAY,EAAC,MAAM,CAAC,YAAY,EAAE,aAAa,CAAC,EAChD,wCAAwC,CACzC,CAAC;IACF,MAAM,UAAU,GAAG,IAAA,+BAAsB,EAAC,MAAM,CAAC,CAAC;IAClD,MAAM,oBAAoB,GAAG,IAAI,oDAAmC,CAClE,MAAM,EACN,kBAAkB,CAAC,QAAQ,CAC5B,CAAC;IAEF,MAAM,OAAO,GAAG,oBAAoB,CAAC,UAAU,EAAE,CAAC;IAClD,MAAM,UAAU,GAAG,MAAM,mBAAQ,CAAC,WAAW,CAAC,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;IAC7E,MAAM,QAAQ,GAAG,kBAAkB,CAAC,QAAQ,CAAC;IAC7C,eAAM,CAAC,KAAK,CAAC,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AAC,QAAQ,EAAE,UAAU,KAAK,GAAG;YAChC,GAAG,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,UAAU,CAClD,+BAA+B,CAChC,EACD,CAAC;YACD,eAAM,CAAC,IAAI,CACT,EAAE,GAAG,EAAE,EACP,8FAA8F,CAC/F,CAAC;YACF,MAAM,SAAG,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;YACnC,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { GlobalConfig } from '../../../../config/global';\nimport type { RenovateConfig } from '../../../../config/types';\nimport { logger } from '../../../../logger';\nimport type { Pr } from '../../../../modules/platform';\nimport { platform } from '../../../../modules/platform';\nimport { hashBody } from '../../../../modules/platform/pr-body';\nimport { scm } from '../../../../modules/platform/scm';\nimport { emojify } from '../../../../util/emoji';\nimport { coerceString } from '../../../../util/string';\nimport * as template from '../../../../util/template';\nimport { joinUrlParts } from '../../../../util/url';\nimport { getPlatformPrOptions } from '../../update/pr';\nimport { prepareLabels } from '../../update/pr/labels';\nimport { addParticipants } from '../../update/pr/participants';\nimport { ConfigMigrationCommitMessageFactory } from '../branch/commit-message';\nimport type { MigratedData } from '../branch/migrated-data';\nimport { getMigrationBranchName } from '../common';\n\nexport async function ensureConfigMigrationPr(\n config: RenovateConfig,\n migratedConfigData: MigratedData,\n): Promise<Pr | null> {\n logger.debug('ensureConfigMigrationPr()');\n const docsLink = joinUrlParts(\n coerceString(config.productLinks?.documentation),\n 'configuration-options/#configmigration',\n );\n const branchName = getMigrationBranchName(config);\n const commitMessageFactory = new ConfigMigrationCommitMessageFactory(\n config,\n migratedConfigData.filename,\n );\n\n const prTitle = commitMessageFactory.getPrTitle();\n const existingPr = await platform.getBranchPr(branchName, config.baseBranch);\n const filename = migratedConfigData.filename;\n logger.debug('Filling in config migration PR template');\n let prBody = `The Renovate config in this repository needs migrating. Typically this is because one or more configuration options you are using have been renamed.\n\n You don't need to merge this PR right away, because Renovate will continue to migrate these fields internally each time it runs. But later some of these fields may be fully deprecated and the migrations removed. So it's a good idea to merge this migration PR soon. \\n\\n`;\n prBody += emojify(\n `\n\n${\n filename.endsWith('.json5')\n ? `#### [PLEASE NOTE](${docsLink}): ` +\n `JSON5 config file migrated! All comments & trailing commas were removed.`\n : ''\n}\n\n:no_bell: **Ignore**: Close this PR and you won't be reminded about config migration again, but one day your current config may no longer be valid.\n\n:question: Got questions? Does something look wrong to you? Please don't hesitate to [request help here](${\n config.productLinks?.help\n }).\\n\\n`,\n );\n\n if (is.string(config.prHeader)) {\n prBody = `${template.compile(config.prHeader, config)}\\n\\n${prBody}`;\n }\n if (is.string(config.prFooter)) {\n prBody = `${prBody}\\n---\\n\\n${template.compile(config.prFooter, config)}\\n`;\n }\n logger.trace({ prBody }, 'prBody');\n\n prBody = platform.massageMarkdown(prBody, config.rebaseLabel);\n\n if (existingPr) {\n logger.debug('Found open migration PR');\n // Check if existing PR needs updating\n const prBodyHash = hashBody(prBody);\n if (\n existingPr.bodyStruct?.hash === prBodyHash &&\n existingPr.title === prTitle\n ) {\n logger.debug(`Pr does not need updating, PrNo: ${existingPr.number}`);\n return existingPr;\n }\n // PR must need updating\n if (GlobalConfig.get('dryRun')) {\n logger.info('DRY-RUN: Would update migration PR');\n } else {\n await platform.updatePr({\n number: existingPr.number,\n prTitle,\n prBody,\n });\n logger.info({ pr: existingPr.number }, 'Migration PR updated');\n }\n return existingPr;\n }\n logger.debug('Creating migration PR');\n const labels = prepareLabels(config);\n try {\n if (GlobalConfig.get('dryRun')) {\n logger.info('DRY-RUN: Would create migration PR');\n } else {\n const pr = await platform.createPr({\n sourceBranch: branchName,\n // TODO #22198\n targetBranch: config.defaultBranch!,\n prTitle,\n prBody,\n labels,\n platformPrOptions: getPlatformPrOptions({\n ...config,\n automerge: false,\n }),\n });\n logger.info({ pr: pr?.number }, 'Migration PR created');\n if (pr) {\n await addParticipants(config, pr);\n }\n\n return pr;\n }\n } catch (err) {\n if (\n err.response?.statusCode === 422 &&\n err.response?.body?.errors?.[0]?.message?.startsWith(\n 'A pull request already exists',\n )\n ) {\n logger.warn(\n { err },\n 'Migration PR already exists but cannot find it. It was probably created by a different user.',\n );\n await scm.deleteBranch(branchName);\n return null;\n }\n throw err;\n }\n\n return null;\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../lib/workers/repository/config-migration/pr/index.ts"],"names":[],"mappings":";;AAmBA,0DAoHC;;AAvID,yCAA4C;AAC5C,sDAAyD;AAEzD,+CAA4C;AAE5C,2DAAwD;AACxD,kEAAgE;AAChE,0DAAuD;AACvD,kDAAiD;AACjD,oDAAuD;AACvD,4EAAsD;AACtD,8CAAoD;AACpD,wCAAuD;AACvD,mDAAuD;AACvD,+DAA+D;AAC/D,6DAA+E;AAE/E,sCAAmD;AAE5C,KAAK,UAAU,uBAAuB,CAC3C,MAAsB,EACtB,kBAAgC;IAEhC,eAAM,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC;IAC1C,MAAM,QAAQ,GAAG,IAAA,kBAAY,EAC3B,IAAA,qBAAY,EAAC,MAAM,CAAC,YAAY,EAAE,aAAa,CAAC,EAChD,wCAAwC,CACzC,CAAC;IACF,MAAM,UAAU,GAAG,IAAA,+BAAsB,EAAC,MAAM,CAAC,CAAC;IAClD,MAAM,oBAAoB,GAAG,IAAI,oDAAmC,CAClE,MAAM,EACN,kBAAkB,CAAC,QAAQ,CAC5B,CAAC;IAEF,MAAM,OAAO,GAAG,oBAAoB,CAAC,UAAU,EAAE,CAAC;IAClD,MAAM,UAAU,GAAG,MAAM,mBAAQ,CAAC,WAAW,CAAC,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC;IAC7E,MAAM,QAAQ,GAAG,kBAAkB,CAAC,QAAQ,CAAC;IAC7C,eAAM,CAAC,KAAK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C,QAAQ,EAAE,UAAU,KAAK,GAAG;YAChC,GAAG,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,UAAU,CAClD,+BAA+B,CAChC,EACD,CAAC;YACD,eAAM,CAAC,IAAI,CACT,EAAE,GAAG,EAAE,EACP,8FAA8F,CAC/F,CAAC;YACF,MAAM,SAAG,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;YACnC,OAAO,IAAI,CAAC;QACd,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import { isString } from '@sindresorhus/is';\nimport { GlobalConfig } from '../../../../config/global';\nimport type { RenovateConfig } from '../../../../config/types';\nimport { logger } from '../../../../logger';\nimport type { Pr } from '../../../../modules/platform';\nimport { platform } from '../../../../modules/platform';\nimport { hashBody } from '../../../../modules/platform/pr-body';\nimport { scm } from '../../../../modules/platform/scm';\nimport { emojify } from '../../../../util/emoji';\nimport { coerceString } from '../../../../util/string';\nimport * as template from '../../../../util/template';\nimport { joinUrlParts } from '../../../../util/url';\nimport { getPlatformPrOptions } from '../../update/pr';\nimport { prepareLabels } from '../../update/pr/labels';\nimport { addParticipants } from '../../update/pr/participants';\nimport { ConfigMigrationCommitMessageFactory } from '../branch/commit-message';\nimport type { MigratedData } from '../branch/migrated-data';\nimport { getMigrationBranchName } from '../common';\n\nexport async function ensureConfigMigrationPr(\n config: RenovateConfig,\n migratedConfigData: MigratedData,\n): Promise<Pr | null> {\n logger.debug('ensureConfigMigrationPr()');\n const docsLink = joinUrlParts(\n coerceString(config.productLinks?.documentation),\n 'configuration-options/#configmigration',\n );\n const branchName = getMigrationBranchName(config);\n const commitMessageFactory = new ConfigMigrationCommitMessageFactory(\n config,\n migratedConfigData.filename,\n );\n\n const prTitle = commitMessageFactory.getPrTitle();\n const existingPr = await platform.getBranchPr(branchName, config.baseBranch);\n const filename = migratedConfigData.filename;\n logger.debug('Filling in config migration PR template');\n let prBody = `The Renovate config in this repository needs migrating. Typically this is because one or more configuration options you are using have been renamed.\n\n You don't need to merge this PR right away, because Renovate will continue to migrate these fields internally each time it runs. But later some of these fields may be fully deprecated and the migrations removed. So it's a good idea to merge this migration PR soon. \\n\\n`;\n prBody += emojify(\n `\n\n${\n filename.endsWith('.json5')\n ? `#### [PLEASE NOTE](${docsLink}): ` +\n `JSON5 config file migrated! All comments & trailing commas were removed.`\n : ''\n}\n\n:no_bell: **Ignore**: Close this PR and you won't be reminded about config migration again, but one day your current config may no longer be valid.\n\n:question: Got questions? Does something look wrong to you? Please don't hesitate to [request help here](${\n config.productLinks?.help\n }).\\n\\n`,\n );\n\n if (isString(config.prHeader)) {\n prBody = `${template.compile(config.prHeader, config)}\\n\\n${prBody}`;\n }\n if (isString(config.prFooter)) {\n prBody = `${prBody}\\n---\\n\\n${template.compile(config.prFooter, config)}\\n`;\n }\n logger.trace({ prBody }, 'prBody');\n\n prBody = platform.massageMarkdown(prBody, config.rebaseLabel);\n\n if (existingPr) {\n logger.debug('Found open migration PR');\n // Check if existing PR needs updating\n const prBodyHash = hashBody(prBody);\n if (\n existingPr.bodyStruct?.hash === prBodyHash &&\n existingPr.title === prTitle\n ) {\n logger.debug(`Pr does not need updating, PrNo: ${existingPr.number}`);\n return existingPr;\n }\n // PR must need updating\n if (GlobalConfig.get('dryRun')) {\n logger.info('DRY-RUN: Would update migration PR');\n } else {\n await platform.updatePr({\n number: existingPr.number,\n prTitle,\n prBody,\n });\n logger.info({ pr: existingPr.number }, 'Migration PR updated');\n }\n return existingPr;\n }\n logger.debug('Creating migration PR');\n const labels = prepareLabels(config);\n try {\n if (GlobalConfig.get('dryRun')) {\n logger.info('DRY-RUN: Would create migration PR');\n } else {\n const pr = await platform.createPr({\n sourceBranch: branchName,\n // TODO #22198\n targetBranch: config.defaultBranch!,\n prTitle,\n prBody,\n labels,\n platformPrOptions: getPlatformPrOptions({\n ...config,\n automerge: false,\n }),\n });\n logger.info({ pr: pr?.number }, 'Migration PR created');\n if (pr) {\n await addParticipants(config, pr);\n }\n\n return pr;\n }\n } catch (err) {\n if (\n err.response?.statusCode === 422 &&\n err.response?.body?.errors?.[0]?.message?.startsWith(\n 'A pull request already exists',\n )\n ) {\n logger.warn(\n { err },\n 'Migration PR already exists but cannot find it. It was probably created by a different user.',\n );\n await scm.deleteBranch(branchName);\n return null;\n }\n throw err;\n }\n\n return null;\n}\n"]}
@@ -5,7 +5,7 @@ exports.ensureDependencyDashboard = ensureDependencyDashboard;
5
5
  exports.getAbandonedPackagesMd = getAbandonedPackagesMd;
6
6
  exports.getDashboardMarkdownVulnerabilities = getDashboardMarkdownVulnerabilities;
7
7
  const tslib_1 = require("tslib");
8
- const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
8
+ const is_1 = require("@sindresorhus/is");
9
9
  const luxon_1 = require("luxon");
10
10
  const global_1 = require("../../config/global");
11
11
  const logger_1 = require("../../logger");
@@ -252,7 +252,7 @@ async function ensureDependencyDashboard(config, allBranches, packageFiles = {},
252
252
  let hasDeprecations = false;
253
253
  const deprecatedPackages = {};
254
254
  logger_1.logger.debug('Checking packageFiles for deprecated packages');
255
- if (is_1.default.nonEmptyObject(packageFiles)) {
255
+ if ((0, is_1.isNonEmptyObject)(packageFiles)) {
256
256
  for (const [manager, fileNames] of Object.entries(packageFiles)) {
257
257
  for (const fileName of fileNames) {
258
258
  for (const dep of fileName.deps) {
@@ -267,7 +267,7 @@ async function ensureDependencyDashboard(config, allBranches, packageFiles = {},
267
267
  }
268
268
  }
269
269
  }
270
- const hasBranches = is_1.default.nonEmptyArray(branches);
270
+ const hasBranches = (0, is_1.isNonEmptyArray)(branches);
271
271
  if (config.dependencyDashboardAutoclose && !hasBranches && !hasDeprecations) {
272
272
  if (global_1.GlobalConfig.get('dryRun')) {
273
273
  logger_1.logger.info({ title: config.dependencyDashboardTitle }, 'DRY-RUN: Would close Dependency Dashboard');
@@ -455,7 +455,7 @@ function getFooter(config) {
455
455
  }
456
456
  async function getDashboardMarkdownVulnerabilities(config, packageFiles) {
457
457
  let result = '';
458
- if (is_1.default.nullOrUndefined(config.dependencyDashboardOSVVulnerabilitySummary) ||
458
+ if ((0, is_1.isNullOrUndefined)(config.dependencyDashboardOSVVulnerabilitySummary) ||
459
459
  config.dependencyDashboardOSVVulnerabilitySummary === 'none') {
460
460
  return result;
461
461
  }
@@ -467,10 +467,10 @@ async function getDashboardMarkdownVulnerabilities(config, packageFiles) {
467
467
  'Renovate has not found any CVEs on [osv.dev](https://osv.dev).\n\n';
468
468
  return result;
469
469
  }
470
- const unresolvedVulnerabilities = vulnerabilities.filter((value) => is_1.default.nullOrUndefined(value.fixedVersion));
470
+ const unresolvedVulnerabilities = vulnerabilities.filter((value) => (0, is_1.isNullOrUndefined)(value.fixedVersion));
471
471
  const resolvedVulnerabilitiesLength = vulnerabilities.length - unresolvedVulnerabilities.length;
472
472
  result += `\`${resolvedVulnerabilitiesLength}\`/\`${vulnerabilities.length}\``;
473
- if (is_1.default.truthy(config.osvVulnerabilityAlerts)) {
473
+ if ((0, is_1.isTruthy)(config.osvVulnerabilityAlerts)) {
474
474
  result += ' CVEs have Renovate fixes.\n';
475
475
  }
476
476
  else {
@@ -489,13 +489,13 @@ async function getDashboardMarkdownVulnerabilities(config, packageFiles) {
489
489
  const managerRecords = {};
490
490
  for (const vulnerability of renderedVulnerabilities) {
491
491
  const { manager, packageFile } = vulnerability.packageFileConfig;
492
- if (is_1.default.nullOrUndefined(managerRecords[manager])) {
492
+ if ((0, is_1.isNullOrUndefined)(managerRecords[manager])) {
493
493
  managerRecords[manager] = {};
494
494
  }
495
- if (is_1.default.nullOrUndefined(managerRecords[manager][packageFile])) {
495
+ if ((0, is_1.isNullOrUndefined)(managerRecords[manager][packageFile])) {
496
496
  managerRecords[manager][packageFile] = {};
497
497
  }
498
- if (is_1.default.nullOrUndefined(managerRecords[manager][packageFile][vulnerability.packageName])) {
498
+ if ((0, is_1.isNullOrUndefined)(managerRecords[manager][packageFile][vulnerability.packageName])) {
499
499
  managerRecords[manager][packageFile][vulnerability.packageName] = [];
500
500
  }
501
501
  managerRecords[manager][packageFile][vulnerability.packageName].push(vulnerability);
@@ -508,7 +508,7 @@ async function getDashboardMarkdownVulnerabilities(config, packageFiles) {
508
508
  result += `<details><summary>${packageName}</summary>\n<blockquote>\n\n`;
509
509
  for (const vul of cves) {
510
510
  const id = vul.vulnerability.id;
511
- const suffix = is_1.default.nonEmptyString(vul.fixedVersion)
511
+ const suffix = (0, is_1.isNonEmptyString)(vul.fixedVersion)
512
512
  ? ` (fixed in ${vul.fixedVersion})`
513
513
  : '';
514
514
  result += `- [${id}](https://osv.dev/vulnerability/${id})${suffix}\n`;