renovate 40.0.0-next.25 → 40.0.0-next.27

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 (520) hide show
  1. package/dist/config/decrypt.js +1 -1
  2. package/dist/config/decrypt.js.map +1 -1
  3. package/dist/config/migrate-validate.js +2 -2
  4. package/dist/config/migrate-validate.js.map +1 -1
  5. package/dist/config/migration.js +1 -1
  6. package/dist/config/migration.js.map +1 -1
  7. package/dist/config/options/index.js +2 -1
  8. package/dist/config/options/index.js.map +1 -1
  9. package/dist/config/presets/internal/group.js +30 -1
  10. package/dist/config/presets/internal/group.js.map +1 -1
  11. package/dist/config/presets/internal/workarounds.js +1 -0
  12. package/dist/config/presets/internal/workarounds.js.map +1 -1
  13. package/dist/config/presets/parse.js +2 -1
  14. package/dist/config/presets/parse.js.map +1 -1
  15. package/dist/config/types.d.ts +4 -1
  16. package/dist/config/types.js.map +1 -1
  17. package/dist/config/validation.js +2 -2
  18. package/dist/config/validation.js.map +1 -1
  19. package/dist/data/monorepo.json +3 -0
  20. package/dist/data/source-urls.json +1 -0
  21. package/dist/instrumentation/index.js +14 -12
  22. package/dist/instrumentation/index.js.map +1 -1
  23. package/dist/logger/index.js +1 -1
  24. package/dist/logger/index.js.map +1 -1
  25. package/dist/logger/once.js +2 -2
  26. package/dist/logger/once.js.map +1 -1
  27. package/dist/logger/renovate-logger.js +1 -1
  28. package/dist/logger/renovate-logger.js.map +1 -1
  29. package/dist/logger/utils.js +1 -1
  30. package/dist/logger/utils.js.map +1 -1
  31. package/dist/modules/datasource/api.js +2 -0
  32. package/dist/modules/datasource/api.js.map +1 -1
  33. package/dist/modules/datasource/artifactory/index.js +0 -1
  34. package/dist/modules/datasource/artifactory/index.js.map +1 -1
  35. package/dist/modules/datasource/aws-eks-addon/index.d.ts +11 -0
  36. package/dist/modules/datasource/aws-eks-addon/index.js +75 -0
  37. package/dist/modules/datasource/aws-eks-addon/index.js.map +1 -0
  38. package/dist/modules/datasource/aws-eks-addon/schema.d.ts +40 -0
  39. package/dist/modules/datasource/aws-eks-addon/schema.js +31 -0
  40. package/dist/modules/datasource/aws-eks-addon/schema.js.map +1 -0
  41. package/dist/modules/datasource/aws-machine-image/index.js +6 -5
  42. package/dist/modules/datasource/aws-machine-image/index.js.map +1 -1
  43. package/dist/modules/datasource/bazel/index.js +0 -1
  44. package/dist/modules/datasource/bazel/index.js.map +1 -1
  45. package/dist/modules/datasource/bitrise/index.js +1 -1
  46. package/dist/modules/datasource/bitrise/index.js.map +1 -1
  47. package/dist/modules/datasource/cdnjs/schema.d.ts +2 -2
  48. package/dist/modules/datasource/conda/index.js +18 -1
  49. package/dist/modules/datasource/conda/index.js.map +1 -1
  50. package/dist/modules/datasource/conda/prefix-dev.d.ts +3 -0
  51. package/dist/modules/datasource/conda/prefix-dev.js +83 -0
  52. package/dist/modules/datasource/conda/prefix-dev.js.map +1 -0
  53. package/dist/modules/datasource/conda/schema/prefix-dev.d.ts +189 -0
  54. package/dist/modules/datasource/conda/schema/prefix-dev.js +31 -0
  55. package/dist/modules/datasource/conda/schema/prefix-dev.js.map +1 -0
  56. package/dist/modules/datasource/conda/types.d.ts +1 -20
  57. package/dist/modules/datasource/conda/types.js.map +1 -1
  58. package/dist/modules/datasource/cpan/index.js +1 -1
  59. package/dist/modules/datasource/cpan/index.js.map +1 -1
  60. package/dist/modules/datasource/crate/index.js +2 -2
  61. package/dist/modules/datasource/crate/index.js.map +1 -1
  62. package/dist/modules/datasource/custom/index.js +4 -2
  63. package/dist/modules/datasource/custom/index.js.map +1 -1
  64. package/dist/modules/datasource/custom/schema.d.ts +27 -27
  65. package/dist/modules/datasource/custom/utils.js +1 -0
  66. package/dist/modules/datasource/custom/utils.js.map +1 -1
  67. package/dist/modules/datasource/dart/index.js +1 -1
  68. package/dist/modules/datasource/dart/index.js.map +1 -1
  69. package/dist/modules/datasource/dart-version/index.js +1 -1
  70. package/dist/modules/datasource/dart-version/index.js.map +1 -1
  71. package/dist/modules/datasource/datasource.js +0 -1
  72. package/dist/modules/datasource/datasource.js.map +1 -1
  73. package/dist/modules/datasource/deb/index.js +1 -1
  74. package/dist/modules/datasource/deb/index.js.map +1 -1
  75. package/dist/modules/datasource/deno/index.js +1 -1
  76. package/dist/modules/datasource/deno/index.js.map +1 -1
  77. package/dist/modules/datasource/deno/schema.d.ts +7 -7
  78. package/dist/modules/datasource/devbox/index.js +0 -1
  79. package/dist/modules/datasource/devbox/index.js.map +1 -1
  80. package/dist/modules/datasource/docker/common.js +4 -1
  81. package/dist/modules/datasource/docker/common.js.map +1 -1
  82. package/dist/modules/datasource/docker/index.js +5 -5
  83. package/dist/modules/datasource/docker/index.js.map +1 -1
  84. package/dist/modules/datasource/docker/schema.d.ts +27 -27
  85. package/dist/modules/datasource/docker/schema.js +2 -1
  86. package/dist/modules/datasource/docker/schema.js.map +1 -1
  87. package/dist/modules/datasource/flutter-version/index.js +1 -1
  88. package/dist/modules/datasource/flutter-version/index.js.map +1 -1
  89. package/dist/modules/datasource/galaxy-collection/schema.d.ts +5 -5
  90. package/dist/modules/datasource/git-refs/index.js +1 -1
  91. package/dist/modules/datasource/git-refs/index.js.map +1 -1
  92. package/dist/modules/datasource/gitea-releases/schema.d.ts +6 -6
  93. package/dist/modules/datasource/gitlab-packages/index.js +1 -1
  94. package/dist/modules/datasource/gitlab-packages/index.js.map +1 -1
  95. package/dist/modules/datasource/gitlab-releases/index.js +1 -3
  96. package/dist/modules/datasource/gitlab-releases/index.js.map +1 -1
  97. package/dist/modules/datasource/go/index.js +1 -1
  98. package/dist/modules/datasource/go/index.js.map +1 -1
  99. package/dist/modules/datasource/go/releases-direct.js +7 -4
  100. package/dist/modules/datasource/go/releases-direct.js.map +1 -1
  101. package/dist/modules/datasource/golang-version/index.js +1 -1
  102. package/dist/modules/datasource/golang-version/index.js.map +1 -1
  103. package/dist/modules/datasource/gradle-version/index.js +1 -1
  104. package/dist/modules/datasource/gradle-version/index.js.map +1 -1
  105. package/dist/modules/datasource/helm/index.js +1 -1
  106. package/dist/modules/datasource/helm/index.js.map +1 -1
  107. package/dist/modules/datasource/hex/index.js +1 -1
  108. package/dist/modules/datasource/hex/index.js.map +1 -1
  109. package/dist/modules/datasource/index.js +2 -2
  110. package/dist/modules/datasource/index.js.map +1 -1
  111. package/dist/modules/datasource/java-version/index.js +0 -1
  112. package/dist/modules/datasource/java-version/index.js.map +1 -1
  113. package/dist/modules/datasource/jenkins-plugins/index.js +1 -1
  114. package/dist/modules/datasource/jenkins-plugins/index.js.map +1 -1
  115. package/dist/modules/datasource/maven/index.js +35 -27
  116. package/dist/modules/datasource/maven/index.js.map +1 -1
  117. package/dist/modules/datasource/maven/types.d.ts +3 -6
  118. package/dist/modules/datasource/maven/types.js.map +1 -1
  119. package/dist/modules/datasource/maven/util.d.ts +4 -5
  120. package/dist/modules/datasource/maven/util.js +93 -156
  121. package/dist/modules/datasource/maven/util.js.map +1 -1
  122. package/dist/modules/datasource/node-version/index.js +1 -1
  123. package/dist/modules/datasource/node-version/index.js.map +1 -1
  124. package/dist/modules/datasource/npm/index.js +1 -1
  125. package/dist/modules/datasource/npm/index.js.map +1 -1
  126. package/dist/modules/datasource/npm/npmrc.js +1 -1
  127. package/dist/modules/datasource/npm/npmrc.js.map +1 -1
  128. package/dist/modules/datasource/nuget/index.js +1 -1
  129. package/dist/modules/datasource/nuget/index.js.map +1 -1
  130. package/dist/modules/datasource/nuget/v3.js +5 -5
  131. package/dist/modules/datasource/nuget/v3.js.map +1 -1
  132. package/dist/modules/datasource/orb/index.js +1 -1
  133. package/dist/modules/datasource/orb/index.js.map +1 -1
  134. package/dist/modules/datasource/packagist/index.js +2 -2
  135. package/dist/modules/datasource/packagist/index.js.map +1 -1
  136. package/dist/modules/datasource/packagist/schema.d.ts +18 -18
  137. package/dist/modules/datasource/pod/index.js +1 -1
  138. package/dist/modules/datasource/pod/index.js.map +1 -1
  139. package/dist/modules/datasource/postprocess-release.js +1 -1
  140. package/dist/modules/datasource/postprocess-release.js.map +1 -1
  141. package/dist/modules/datasource/python-version/index.js +1 -1
  142. package/dist/modules/datasource/python-version/index.js.map +1 -1
  143. package/dist/modules/datasource/repology/index.js +1 -1
  144. package/dist/modules/datasource/repology/index.js.map +1 -1
  145. package/dist/modules/datasource/rubygems/index.js +1 -1
  146. package/dist/modules/datasource/rubygems/index.js.map +1 -1
  147. package/dist/modules/datasource/sbt-package/index.js +1 -1
  148. package/dist/modules/datasource/sbt-package/index.js.map +1 -1
  149. package/dist/modules/datasource/sbt-plugin/index.js +1 -1
  150. package/dist/modules/datasource/sbt-plugin/index.js.map +1 -1
  151. package/dist/modules/datasource/schema.d.ts +4 -4
  152. package/dist/modules/datasource/terraform-module/index.js +1 -1
  153. package/dist/modules/datasource/terraform-module/index.js.map +1 -1
  154. package/dist/modules/datasource/terraform-provider/index.js +1 -2
  155. package/dist/modules/datasource/terraform-provider/index.js.map +1 -1
  156. package/dist/modules/datasource/types.d.ts +1 -0
  157. package/dist/modules/datasource/types.js.map +1 -1
  158. package/dist/modules/manager/api.js +2 -0
  159. package/dist/modules/manager/api.js.map +1 -1
  160. package/dist/modules/manager/argocd/extract.js +1 -1
  161. package/dist/modules/manager/argocd/extract.js.map +1 -1
  162. package/dist/modules/manager/asdf/upgradeable-tooling.js +94 -0
  163. package/dist/modules/manager/asdf/upgradeable-tooling.js.map +1 -1
  164. package/dist/modules/manager/azure-pipelines/schema.d.ts +24 -24
  165. package/dist/modules/manager/batect/schema.d.ts +2 -2
  166. package/dist/modules/manager/bazel/rules/docker.d.ts +3 -3
  167. package/dist/modules/manager/bazel/rules/git.js +2 -1
  168. package/dist/modules/manager/bazel/rules/git.js.map +1 -1
  169. package/dist/modules/manager/bazel/rules/maven.d.ts +7 -7
  170. package/dist/modules/manager/bazel/rules/oci.d.ts +3 -3
  171. package/dist/modules/manager/bazel-module/parser/maven.d.ts +13 -13
  172. package/dist/modules/manager/bun/artifacts.js +0 -1
  173. package/dist/modules/manager/bun/artifacts.js.map +1 -1
  174. package/dist/modules/manager/bundler/artifacts.js +0 -1
  175. package/dist/modules/manager/bundler/artifacts.js.map +1 -1
  176. package/dist/modules/manager/bundler/extract.js +2 -1
  177. package/dist/modules/manager/bundler/extract.js.map +1 -1
  178. package/dist/modules/manager/cake/index.js +4 -2
  179. package/dist/modules/manager/cake/index.js.map +1 -1
  180. package/dist/modules/manager/cargo/artifacts.js +5 -7
  181. package/dist/modules/manager/cargo/artifacts.js.map +1 -1
  182. package/dist/modules/manager/cargo/schema.d.ts +164 -164
  183. package/dist/modules/manager/circleci/schema.d.ts +6 -6
  184. package/dist/modules/manager/cocoapods/artifacts.js +1 -2
  185. package/dist/modules/manager/cocoapods/artifacts.js.map +1 -1
  186. package/dist/modules/manager/composer/artifacts.js +1 -2
  187. package/dist/modules/manager/composer/artifacts.js.map +1 -1
  188. package/dist/modules/manager/composer/schema.d.ts +36 -36
  189. package/dist/modules/manager/composer/schema.js +1 -1
  190. package/dist/modules/manager/composer/schema.js.map +1 -1
  191. package/dist/modules/manager/composer/utils.d.ts +1 -0
  192. package/dist/modules/manager/composer/utils.js +9 -0
  193. package/dist/modules/manager/composer/utils.js.map +1 -1
  194. package/dist/modules/manager/copier/artifacts.js +0 -1
  195. package/dist/modules/manager/copier/artifacts.js.map +1 -1
  196. package/dist/modules/manager/custom/jsonata/schema.d.ts +28 -28
  197. package/dist/modules/manager/custom/regex/index.js +2 -0
  198. package/dist/modules/manager/custom/regex/index.js.map +1 -1
  199. package/dist/modules/manager/deps-edn/extract.js +2 -1
  200. package/dist/modules/manager/deps-edn/extract.js.map +1 -1
  201. package/dist/modules/manager/devbox/artifacts.d.ts +1 -1
  202. package/dist/modules/manager/devbox/artifacts.js +1 -2
  203. package/dist/modules/manager/devbox/artifacts.js.map +1 -1
  204. package/dist/modules/manager/devbox/schema.js +1 -1
  205. package/dist/modules/manager/devbox/schema.js.map +1 -1
  206. package/dist/modules/manager/devcontainer/extract.js +43 -1
  207. package/dist/modules/manager/devcontainer/extract.js.map +1 -1
  208. package/dist/modules/manager/devcontainer/index.js +11 -1
  209. package/dist/modules/manager/devcontainer/index.js.map +1 -1
  210. package/dist/modules/manager/devcontainer/schema.d.ts +7 -3
  211. package/dist/modules/manager/devcontainer/schema.js +3 -1
  212. package/dist/modules/manager/devcontainer/schema.js.map +1 -1
  213. package/dist/modules/manager/docker-compose/schema.d.ts +6 -6
  214. package/dist/modules/manager/fingerprint.generated.js +83 -82
  215. package/dist/modules/manager/fingerprint.generated.js.map +1 -1
  216. package/dist/modules/manager/fleet/schema.d.ts +12 -12
  217. package/dist/modules/manager/flux/artifacts.js +0 -1
  218. package/dist/modules/manager/flux/artifacts.js.map +1 -1
  219. package/dist/modules/manager/flux/extract.js +27 -24
  220. package/dist/modules/manager/flux/extract.js.map +1 -1
  221. package/dist/modules/manager/flux/schema.d.ts +44 -44
  222. package/dist/modules/manager/github-actions/extract.js +60 -39
  223. package/dist/modules/manager/github-actions/extract.js.map +1 -1
  224. package/dist/modules/manager/github-actions/schema.d.ts +66 -0
  225. package/dist/modules/manager/github-actions/schema.js +38 -0
  226. package/dist/modules/manager/github-actions/schema.js.map +1 -0
  227. package/dist/modules/manager/gitlabci/extract.d.ts +1 -5
  228. package/dist/modules/manager/gitlabci/extract.js +27 -126
  229. package/dist/modules/manager/gitlabci/extract.js.map +1 -1
  230. package/dist/modules/manager/gitlabci/schema.d.ts +55 -0
  231. package/dist/modules/manager/gitlabci/schema.js +63 -0
  232. package/dist/modules/manager/gitlabci/schema.js.map +1 -0
  233. package/dist/modules/manager/gitlabci-include/extract.js +6 -54
  234. package/dist/modules/manager/gitlabci-include/extract.js.map +1 -1
  235. package/dist/modules/manager/gitlabci-include/schema.d.ts +13 -0
  236. package/dist/modules/manager/gitlabci-include/schema.js +46 -0
  237. package/dist/modules/manager/gitlabci-include/schema.js.map +1 -0
  238. package/dist/modules/manager/gomod/artifacts.js +24 -10
  239. package/dist/modules/manager/gomod/artifacts.js.map +1 -1
  240. package/dist/modules/manager/gomod/extract.js +23 -0
  241. package/dist/modules/manager/gomod/extract.js.map +1 -1
  242. package/dist/modules/manager/gomod/line-parser.js +16 -0
  243. package/dist/modules/manager/gomod/line-parser.js.map +1 -1
  244. package/dist/modules/manager/gomod/update.js +2 -2
  245. package/dist/modules/manager/gomod/update.js.map +1 -1
  246. package/dist/modules/manager/gradle/artifacts.js +0 -1
  247. package/dist/modules/manager/gradle/artifacts.js.map +1 -1
  248. package/dist/modules/manager/gradle/extract/catalog.js +1 -1
  249. package/dist/modules/manager/gradle/extract/catalog.js.map +1 -1
  250. package/dist/modules/manager/gradle/parser/assignments.js +2 -2
  251. package/dist/modules/manager/gradle/parser/assignments.js.map +1 -1
  252. package/dist/modules/manager/gradle/parser/handlers.d.ts +1 -2
  253. package/dist/modules/manager/gradle/parser/handlers.js +10 -25
  254. package/dist/modules/manager/gradle/parser/handlers.js.map +1 -1
  255. package/dist/modules/manager/gradle/parser/registry-urls.js +11 -3
  256. package/dist/modules/manager/gradle/parser/registry-urls.js.map +1 -1
  257. package/dist/modules/manager/gradle-wrapper/artifacts.js +0 -1
  258. package/dist/modules/manager/gradle-wrapper/artifacts.js.map +1 -1
  259. package/dist/modules/manager/helmfile/artifacts.js +0 -1
  260. package/dist/modules/manager/helmfile/artifacts.js.map +1 -1
  261. package/dist/modules/manager/helmfile/extract.js +4 -0
  262. package/dist/modules/manager/helmfile/extract.js.map +1 -1
  263. package/dist/modules/manager/helmfile/schema.d.ts +9 -9
  264. package/dist/modules/manager/helmv3/artifacts.js +0 -1
  265. package/dist/modules/manager/helmv3/artifacts.js.map +1 -1
  266. package/dist/modules/manager/helmv3/utils.js +3 -1
  267. package/dist/modules/manager/helmv3/utils.js.map +1 -1
  268. package/dist/modules/manager/hermit/artifacts.js +0 -1
  269. package/dist/modules/manager/hermit/artifacts.js.map +1 -1
  270. package/dist/modules/manager/homebrew/extract.js +0 -1
  271. package/dist/modules/manager/homebrew/extract.js.map +1 -1
  272. package/dist/modules/manager/jsonnet-bundler/artifacts.js +0 -1
  273. package/dist/modules/manager/jsonnet-bundler/artifacts.js.map +1 -1
  274. package/dist/modules/manager/kustomize/artifacts.d.ts +2 -0
  275. package/dist/modules/manager/kustomize/artifacts.js +154 -0
  276. package/dist/modules/manager/kustomize/artifacts.js.map +1 -0
  277. package/dist/modules/manager/kustomize/common.d.ts +3 -0
  278. package/dist/modules/manager/kustomize/common.js +22 -0
  279. package/dist/modules/manager/kustomize/common.js.map +1 -0
  280. package/dist/modules/manager/kustomize/index.d.ts +1 -0
  281. package/dist/modules/manager/kustomize/index.js +3 -1
  282. package/dist/modules/manager/kustomize/index.js.map +1 -1
  283. package/dist/modules/manager/kustomize/types.d.ts +4 -0
  284. package/dist/modules/manager/kustomize/types.js.map +1 -1
  285. package/dist/modules/manager/maven-wrapper/artifacts.js +0 -1
  286. package/dist/modules/manager/maven-wrapper/artifacts.js.map +1 -1
  287. package/dist/modules/manager/mix/artifacts.js +64 -14
  288. package/dist/modules/manager/mix/artifacts.js.map +1 -1
  289. package/dist/modules/manager/mix/index.d.ts +1 -0
  290. package/dist/modules/manager/mix/index.js +2 -1
  291. package/dist/modules/manager/mix/index.js.map +1 -1
  292. package/dist/modules/manager/nix/artifacts.js +0 -1
  293. package/dist/modules/manager/nix/artifacts.js.map +1 -1
  294. package/dist/modules/manager/nix/extract.js +1 -1
  295. package/dist/modules/manager/nix/extract.js.map +1 -1
  296. package/dist/modules/manager/nix/schema.d.ts +6 -6
  297. package/dist/modules/manager/npm/artifacts.js +0 -1
  298. package/dist/modules/manager/npm/artifacts.js.map +1 -1
  299. package/dist/modules/manager/npm/extract/yarn.js +2 -2
  300. package/dist/modules/manager/npm/extract/yarn.js.map +1 -1
  301. package/dist/modules/manager/npm/post-update/npm.js +0 -1
  302. package/dist/modules/manager/npm/post-update/npm.js.map +1 -1
  303. package/dist/modules/manager/npm/post-update/pnpm.js +13 -2
  304. package/dist/modules/manager/npm/post-update/pnpm.js.map +1 -1
  305. package/dist/modules/manager/npm/post-update/rules.js +11 -1
  306. package/dist/modules/manager/npm/post-update/rules.js.map +1 -1
  307. package/dist/modules/manager/npm/post-update/yarn.js +0 -1
  308. package/dist/modules/manager/npm/post-update/yarn.js.map +1 -1
  309. package/dist/modules/manager/npm/update/dependency/index.js +1 -1
  310. package/dist/modules/manager/npm/update/dependency/index.js.map +1 -1
  311. package/dist/modules/manager/nuget/artifacts.js +1 -2
  312. package/dist/modules/manager/nuget/artifacts.js.map +1 -1
  313. package/dist/modules/manager/nuget/package-tree.js +4 -0
  314. package/dist/modules/manager/nuget/package-tree.js.map +1 -1
  315. package/dist/modules/manager/nuget/util.js +4 -1
  316. package/dist/modules/manager/nuget/util.js.map +1 -1
  317. package/dist/modules/manager/pep621/processors/pdm.js +0 -1
  318. package/dist/modules/manager/pep621/processors/pdm.js.map +1 -1
  319. package/dist/modules/manager/pep621/processors/uv.js +0 -1
  320. package/dist/modules/manager/pep621/processors/uv.js.map +1 -1
  321. package/dist/modules/manager/pep621/schema.d.ts +35 -30
  322. package/dist/modules/manager/pep621/schema.js +2 -0
  323. package/dist/modules/manager/pep621/schema.js.map +1 -1
  324. package/dist/modules/manager/pip-compile/common.js +0 -1
  325. package/dist/modules/manager/pip-compile/common.js.map +1 -1
  326. package/dist/modules/manager/pip_requirements/artifacts.js +0 -1
  327. package/dist/modules/manager/pip_requirements/artifacts.js.map +1 -1
  328. package/dist/modules/manager/pipenv/artifacts.js +0 -1
  329. package/dist/modules/manager/pipenv/artifacts.js.map +1 -1
  330. package/dist/modules/manager/pixi/artifacts.d.ts +3 -0
  331. package/dist/modules/manager/pixi/artifacts.js +84 -0
  332. package/dist/modules/manager/pixi/artifacts.js.map +1 -0
  333. package/dist/modules/manager/pixi/extract.d.ts +2 -0
  334. package/dist/modules/manager/pixi/extract.js +53 -0
  335. package/dist/modules/manager/pixi/extract.js.map +1 -0
  336. package/dist/modules/manager/pixi/index.d.ts +11 -0
  337. package/dist/modules/manager/pixi/index.js +22 -0
  338. package/dist/modules/manager/pixi/index.js.map +1 -0
  339. package/dist/modules/manager/pixi/lockfile.d.ts +6 -0
  340. package/dist/modules/manager/pixi/lockfile.js +25 -0
  341. package/dist/modules/manager/pixi/lockfile.js.map +1 -0
  342. package/dist/modules/manager/pixi/schema.d.ts +14 -0
  343. package/dist/modules/manager/pixi/schema.js +14 -0
  344. package/dist/modules/manager/pixi/schema.js.map +1 -0
  345. package/dist/modules/manager/poetry/artifacts.js +0 -1
  346. package/dist/modules/manager/poetry/artifacts.js.map +1 -1
  347. package/dist/modules/manager/poetry/schema.d.ts +31 -31
  348. package/dist/modules/manager/pub/artifacts.js +0 -1
  349. package/dist/modules/manager/pub/artifacts.js.map +1 -1
  350. package/dist/modules/manager/pub/schema.d.ts +8 -8
  351. package/dist/modules/manager/scalafmt/extract.js +1 -1
  352. package/dist/modules/manager/scalafmt/extract.js.map +1 -1
  353. package/dist/modules/manager/types.d.ts +6 -2
  354. package/dist/modules/manager/types.js.map +1 -1
  355. package/dist/modules/manager/vendir/schema.d.ts +23 -23
  356. package/dist/modules/platform/azure/azure-helper.js +2 -2
  357. package/dist/modules/platform/azure/azure-helper.js.map +1 -1
  358. package/dist/modules/platform/azure/index.js +14 -14
  359. package/dist/modules/platform/azure/index.js.map +1 -1
  360. package/dist/modules/platform/bitbucket/comments.js +4 -4
  361. package/dist/modules/platform/bitbucket/comments.js.map +1 -1
  362. package/dist/modules/platform/bitbucket/index.js +48 -43
  363. package/dist/modules/platform/bitbucket/index.js.map +1 -1
  364. package/dist/modules/platform/bitbucket/schema.d.ts +13 -13
  365. package/dist/modules/platform/bitbucket/utils.js +3 -3
  366. package/dist/modules/platform/bitbucket/utils.js.map +1 -1
  367. package/dist/modules/platform/bitbucket-server/index.d.ts +2 -2
  368. package/dist/modules/platform/bitbucket-server/index.js +70 -72
  369. package/dist/modules/platform/bitbucket-server/index.js.map +1 -1
  370. package/dist/modules/platform/bitbucket-server/pr-cache.d.ts +23 -0
  371. package/dist/modules/platform/bitbucket-server/pr-cache.js +125 -0
  372. package/dist/modules/platform/bitbucket-server/pr-cache.js.map +1 -0
  373. package/dist/modules/platform/bitbucket-server/types.d.ts +6 -1
  374. package/dist/modules/platform/bitbucket-server/types.js.map +1 -1
  375. package/dist/modules/platform/bitbucket-server/utils.js +5 -1
  376. package/dist/modules/platform/bitbucket-server/utils.js.map +1 -1
  377. package/dist/modules/platform/codecommit/codecommit-client.js +6 -6
  378. package/dist/modules/platform/codecommit/codecommit-client.js.map +1 -1
  379. package/dist/modules/platform/codecommit/index.js +24 -24
  380. package/dist/modules/platform/codecommit/index.js.map +1 -1
  381. package/dist/modules/platform/gerrit/client.js +12 -1
  382. package/dist/modules/platform/gerrit/client.js.map +1 -1
  383. package/dist/modules/platform/gerrit/utils.js +1 -1
  384. package/dist/modules/platform/gerrit/utils.js.map +1 -1
  385. package/dist/modules/platform/gitea/gitea-helper.d.ts +1 -0
  386. package/dist/modules/platform/gitea/gitea-helper.js +16 -0
  387. package/dist/modules/platform/gitea/gitea-helper.js.map +1 -1
  388. package/dist/modules/platform/gitea/index.js +15 -7
  389. package/dist/modules/platform/gitea/index.js.map +1 -1
  390. package/dist/modules/platform/gitea/schema.d.ts +4 -4
  391. package/dist/modules/platform/gitea/types.d.ts +1 -1
  392. package/dist/modules/platform/gitea/types.js.map +1 -1
  393. package/dist/modules/platform/github/index.js +81 -78
  394. package/dist/modules/platform/github/index.js.map +1 -1
  395. package/dist/modules/platform/github/issue.d.ts +3 -3
  396. package/dist/modules/platform/github/massage-markdown-links.js +2 -2
  397. package/dist/modules/platform/github/massage-markdown-links.js.map +1 -1
  398. package/dist/modules/platform/github/pr.js +3 -3
  399. package/dist/modules/platform/github/pr.js.map +1 -1
  400. package/dist/modules/platform/github/schema.d.ts +11 -11
  401. package/dist/modules/platform/github/schema.js +3 -1
  402. package/dist/modules/platform/github/schema.js.map +1 -1
  403. package/dist/modules/platform/gitlab/index.js +61 -43
  404. package/dist/modules/platform/gitlab/index.js.map +1 -1
  405. package/dist/modules/platform/index.js +0 -1
  406. package/dist/modules/platform/index.js.map +1 -1
  407. package/dist/modules/versioning/api.js +2 -0
  408. package/dist/modules/versioning/api.js.map +1 -1
  409. package/dist/modules/versioning/conda/index.d.ts +41 -0
  410. package/dist/modules/versioning/conda/index.js +178 -0
  411. package/dist/modules/versioning/conda/index.js.map +1 -0
  412. package/dist/modules/versioning/hashicorp/convertor.d.ts +2 -1
  413. package/dist/modules/versioning/hashicorp/convertor.js +13 -8
  414. package/dist/modules/versioning/hashicorp/convertor.js.map +1 -1
  415. package/dist/modules/versioning/hex/index.js +3 -3
  416. package/dist/modules/versioning/hex/index.js.map +1 -1
  417. package/dist/proxy.js +1 -1
  418. package/dist/proxy.js.map +1 -1
  419. package/dist/renovate.js +2 -2
  420. package/dist/renovate.js.map +1 -1
  421. package/dist/util/cache/package/types.d.ts +1 -1
  422. package/dist/util/cache/package/types.js.map +1 -1
  423. package/dist/util/cache/repository/schema.d.ts +4 -4
  424. package/dist/util/cache/repository/types.d.ts +3 -0
  425. package/dist/util/cache/repository/types.js.map +1 -1
  426. package/dist/util/env.d.ts +4 -0
  427. package/dist/util/env.js +22 -0
  428. package/dist/util/env.js.map +1 -0
  429. package/dist/util/exec/containerbase.js +6 -0
  430. package/dist/util/exec/containerbase.js.map +1 -1
  431. package/dist/util/exec/index.js +5 -2
  432. package/dist/util/exec/index.js.map +1 -1
  433. package/dist/util/exec/types.d.ts +0 -2
  434. package/dist/util/exec/types.js.map +1 -1
  435. package/dist/util/exec/utils.d.ts +1 -1
  436. package/dist/util/exec/utils.js +6 -5
  437. package/dist/util/exec/utils.js.map +1 -1
  438. package/dist/util/git/author.js +1 -1
  439. package/dist/util/git/author.js.map +1 -1
  440. package/dist/util/git/config.js +0 -1
  441. package/dist/util/git/config.js.map +1 -1
  442. package/dist/util/git/error.js +4 -2
  443. package/dist/util/git/error.js.map +1 -1
  444. package/dist/util/git/index.js +73 -46
  445. package/dist/util/git/index.js.map +1 -1
  446. package/dist/util/git/private-key.js +1 -1
  447. package/dist/util/git/private-key.js.map +1 -1
  448. package/dist/util/github/graphql/query-adapters/releases-query-adapter.d.ts +5 -5
  449. package/dist/util/github/graphql/query-adapters/tags-query-adapter.d.ts +2 -2
  450. package/dist/util/http/bitbucket-server.js +4 -0
  451. package/dist/util/http/bitbucket-server.js.map +1 -1
  452. package/dist/util/http/bitbucket.js +5 -1
  453. package/dist/util/http/bitbucket.js.map +1 -1
  454. package/dist/util/http/cache/abstract-http-cache-provider.js +2 -2
  455. package/dist/util/http/cache/abstract-http-cache-provider.js.map +1 -1
  456. package/dist/util/http/cache/memory-http-cache-provider.d.ts +10 -0
  457. package/dist/util/http/cache/memory-http-cache-provider.js +29 -0
  458. package/dist/util/http/cache/memory-http-cache-provider.js.map +1 -0
  459. package/dist/util/http/gitea.js +2 -0
  460. package/dist/util/http/gitea.js.map +1 -1
  461. package/dist/util/http/github.js +1 -0
  462. package/dist/util/http/github.js.map +1 -1
  463. package/dist/util/http/gitlab.js +2 -0
  464. package/dist/util/http/gitlab.js.map +1 -1
  465. package/dist/util/http/host-rules.js +5 -4
  466. package/dist/util/http/host-rules.js.map +1 -1
  467. package/dist/util/http/http.js +12 -5
  468. package/dist/util/http/http.js.map +1 -1
  469. package/dist/util/stats.d.ts +10 -0
  470. package/dist/util/stats.js +45 -1
  471. package/dist/util/stats.js.map +1 -1
  472. package/dist/workers/global/config/parse/file.js +2 -2
  473. package/dist/workers/global/config/parse/file.js.map +1 -1
  474. package/dist/workers/global/config/parse/index.js +5 -0
  475. package/dist/workers/global/config/parse/index.js.map +1 -1
  476. package/dist/workers/repository/cache.js +1 -1
  477. package/dist/workers/repository/cache.js.map +1 -1
  478. package/dist/workers/repository/config-migration/branch/migrated-data.js +2 -0
  479. package/dist/workers/repository/config-migration/branch/migrated-data.js.map +1 -1
  480. package/dist/workers/repository/index.js +1 -0
  481. package/dist/workers/repository/index.js.map +1 -1
  482. package/dist/workers/repository/init/merge.js +6 -3
  483. package/dist/workers/repository/init/merge.js.map +1 -1
  484. package/dist/workers/repository/process/extract-update.js +0 -1
  485. package/dist/workers/repository/process/extract-update.js.map +1 -1
  486. package/dist/workers/repository/process/fingerprint-fields.js +0 -1
  487. package/dist/workers/repository/process/fingerprint-fields.js.map +1 -1
  488. package/dist/workers/repository/process/libyear.js +2 -2
  489. package/dist/workers/repository/process/libyear.js.map +1 -1
  490. package/dist/workers/repository/process/lookup/index.js +13 -4
  491. package/dist/workers/repository/process/lookup/index.js.map +1 -1
  492. package/dist/workers/repository/process/vulnerabilities.js +1 -1
  493. package/dist/workers/repository/process/vulnerabilities.js.map +1 -1
  494. package/dist/workers/repository/process/write.js +1 -8
  495. package/dist/workers/repository/process/write.js.map +1 -1
  496. package/dist/workers/repository/reconfigure/validate.js +1 -0
  497. package/dist/workers/repository/reconfigure/validate.js.map +1 -1
  498. package/dist/workers/repository/update/branch/execute-post-upgrade-commands.js +10 -1
  499. package/dist/workers/repository/update/branch/execute-post-upgrade-commands.js.map +1 -1
  500. package/dist/workers/repository/update/pr/changelog/github/index.js +6 -3
  501. package/dist/workers/repository/update/pr/changelog/github/index.js.map +1 -1
  502. package/dist/workers/repository/update/pr/changelog/source.js +1 -0
  503. package/dist/workers/repository/update/pr/changelog/source.js.map +1 -1
  504. package/dist/workers/repository/updates/flatten.js +8 -4
  505. package/dist/workers/repository/updates/flatten.js.map +1 -1
  506. package/dist/workers/repository/updates/generate.js +1 -2
  507. package/dist/workers/repository/updates/generate.js.map +1 -1
  508. package/dist/workers/types.d.ts +1 -4
  509. package/dist/workers/types.js.map +1 -1
  510. package/package.json +45 -43
  511. package/renovate-schema.json +14 -1
  512. package/dist/modules/manager/github-actions/types.d.ts +0 -30
  513. package/dist/modules/manager/github-actions/types.js +0 -3
  514. package/dist/modules/manager/github-actions/types.js.map +0 -1
  515. package/dist/modules/manager/gitlabci/common.d.ts +0 -6
  516. package/dist/modules/manager/gitlabci/common.js +0 -30
  517. package/dist/modules/manager/gitlabci/common.js.map +0 -1
  518. package/dist/modules/manager/gitlabci/types.d.ts +0 -35
  519. package/dist/modules/manager/gitlabci/types.js +0 -3
  520. package/dist/modules/manager/gitlabci/types.js.map +0 -1
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.commandLock = void 0;
4
+ exports.updateArtifacts = updateArtifacts;
5
+ const tslib_1 = require("tslib");
6
+ const is_1 = tslib_1.__importDefault(require("@sindresorhus/is"));
7
+ const error_messages_1 = require("../../../constants/error-messages");
8
+ const logger_1 = require("../../../logger");
9
+ const exec_1 = require("../../../util/exec");
10
+ const fs_1 = require("../../../util/fs");
11
+ const result_1 = require("../../../util/result");
12
+ const lockfile_1 = require("./lockfile");
13
+ const schema_1 = require("./schema");
14
+ exports.commandLock = 'pixi lock --no-progress --color=never --quiet';
15
+ async function updateArtifacts({ packageFileName, updatedDeps, newPackageFileContent, config, }) {
16
+ logger_1.logger.debug(`pixi.updateArtifacts(${packageFileName})`);
17
+ const { isLockFileMaintenance } = config;
18
+ if (!is_1.default.nonEmptyArray(updatedDeps) && !isLockFileMaintenance) {
19
+ logger_1.logger.debug('No updated pixi deps - returning null');
20
+ return null;
21
+ }
22
+ const lockFileName = (0, fs_1.getSiblingFileName)(packageFileName, 'pixi.lock');
23
+ const existingLockFileContent = await (0, fs_1.readLocalFile)(lockFileName, 'utf8');
24
+ if (!existingLockFileContent) {
25
+ logger_1.logger.debug(`No lock file found`);
26
+ return null;
27
+ }
28
+ logger_1.logger.trace(`Updating ${lockFileName}`);
29
+ const cmd = [exports.commandLock];
30
+ const constraint = config.constraints?.pixi ?? getPixiConstraint(existingLockFileContent);
31
+ try {
32
+ await (0, fs_1.writeLocalFile)(packageFileName, newPackageFileContent);
33
+ if (isLockFileMaintenance) {
34
+ await (0, fs_1.deleteLocalFile)(lockFileName);
35
+ }
36
+ // https://pixi.sh/latest/features/environment/#caching-packages
37
+ const PIXI_CACHE_DIR = await (0, fs_1.ensureCacheDir)('pixi');
38
+ const extraEnv = {
39
+ PIXI_CACHE_DIR,
40
+ RATTLER_CACHE_DIR: PIXI_CACHE_DIR,
41
+ };
42
+ const execOptions = {
43
+ cwdFile: packageFileName,
44
+ extraEnv,
45
+ docker: {},
46
+ toolConstraints: [{ toolName: 'pixi', constraint }],
47
+ };
48
+ await (0, exec_1.exec)(cmd, execOptions);
49
+ const newPixiLockContent = await (0, fs_1.readLocalFile)(lockFileName, 'utf8');
50
+ if (existingLockFileContent === newPixiLockContent) {
51
+ logger_1.logger.debug(`${lockFileName} is unchanged`);
52
+ return null;
53
+ }
54
+ return [
55
+ {
56
+ file: {
57
+ type: 'addition',
58
+ path: lockFileName,
59
+ contents: newPixiLockContent,
60
+ },
61
+ },
62
+ ];
63
+ }
64
+ catch (err) {
65
+ if (err.message === error_messages_1.TEMPORARY_ERROR) {
66
+ throw err;
67
+ }
68
+ logger_1.logger.debug({ err }, `Failed to update ${lockFileName} file`);
69
+ return [
70
+ {
71
+ artifactError: {
72
+ lockFile: lockFileName,
73
+ stderr: `${err}\n${String(err.stdout)}\n${String(err.stderr)}`,
74
+ },
75
+ },
76
+ ];
77
+ }
78
+ }
79
+ function getPixiConstraint(existingLockFileContent) {
80
+ const { val } = result_1.Result.parse(existingLockFileContent, schema_1.LockfileYaml).unwrap();
81
+ const cfg = (0, lockfile_1.pickConfig)(val?.version);
82
+ return cfg?.range ?? undefined;
83
+ }
84
+ //# sourceMappingURL=artifacts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pixi/artifacts.ts"],"names":[],"mappings":";;;AAmBA,0CA4EC;;AA/FD,kEAAkC;AAClC,sEAAoE;AACpE,4CAAyC;AACzC,6CAA0C;AAE1C,yCAM0B;AAC1B,iDAA8C;AAE9C,yCAAwC;AACxC,qCAAwC;AAE3B,QAAA,WAAW,GAAG,+CAA+C,CAAC;AAEpE,KAAK,UAAU,eAAe,CAAC,EACpC,eAAe,EACf,WAAW,EACX,qBAAqB,EACrB,MAAM,GACS;I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ARY_ERROR } from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport { exec } from '../../../util/exec';\nimport type { ExecOptions } from '../../../util/exec/types';\nimport {\n deleteLocalFile,\n ensureCacheDir,\n getSiblingFileName,\n readLocalFile,\n writeLocalFile,\n} from '../../../util/fs';\nimport { Result } from '../../../util/result';\nimport type { UpdateArtifact, UpdateArtifactsResult } from '../types';\nimport { pickConfig } from './lockfile';\nimport { LockfileYaml } from './schema';\n\nexport const commandLock = 'pixi lock --no-progress --color=never --quiet';\n\nexport async function updateArtifacts({\n packageFileName,\n updatedDeps,\n newPackageFileContent,\n config,\n}: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> {\n logger.debug(`pixi.updateArtifacts(${packageFileName})`);\n const { isLockFileMaintenance } = config;\n\n if (!is.nonEmptyArray(updatedDeps) && !isLockFileMaintenance) {\n logger.debug('No updated pixi deps - returning null');\n return null;\n }\n\n const lockFileName = getSiblingFileName(packageFileName, 'pixi.lock');\n const existingLockFileContent = await readLocalFile(lockFileName, 'utf8');\n if (!existingLockFileContent) {\n logger.debug(`No lock file found`);\n return null;\n }\n logger.trace(`Updating ${lockFileName}`);\n\n const cmd = [commandLock];\n\n const constraint =\n config.constraints?.pixi ?? getPixiConstraint(existingLockFileContent);\n\n try {\n await writeLocalFile(packageFileName, newPackageFileContent);\n if (isLockFileMaintenance) {\n await deleteLocalFile(lockFileName);\n }\n\n // https://pixi.sh/latest/features/environment/#caching-packages\n const PIXI_CACHE_DIR = await ensureCacheDir('pixi');\n const extraEnv = {\n PIXI_CACHE_DIR,\n RATTLER_CACHE_DIR: PIXI_CACHE_DIR,\n };\n\n const execOptions: ExecOptions = {\n cwdFile: packageFileName,\n extraEnv,\n docker: {},\n toolConstraints: [{ toolName: 'pixi', constraint }],\n };\n await exec(cmd, execOptions);\n const newPixiLockContent = await readLocalFile(lockFileName, 'utf8');\n if (existingLockFileContent === newPixiLockContent) {\n logger.debug(`${lockFileName} is unchanged`);\n return null;\n }\n return [\n {\n file: {\n type: 'addition',\n path: lockFileName,\n contents: newPixiLockContent,\n },\n },\n ];\n } catch (err) {\n if (err.message === TEMPORARY_ERROR) {\n throw err;\n }\n\n logger.debug({ err }, `Failed to update ${lockFileName} file`);\n return [\n {\n artifactError: {\n lockFile: lockFileName,\n stderr: `${err}\\n${String(err.stdout)}\\n${String(err.stderr)}`,\n },\n },\n ];\n }\n}\n\nfunction getPixiConstraint(\n existingLockFileContent: string,\n): string | undefined {\n const { val } = Result.parse(existingLockFileContent, LockfileYaml).unwrap();\n const cfg = pickConfig(val?.version);\n\n return cfg?.range ?? undefined;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import type { PackageFileContent } from '../types';
2
+ export declare function extractPackageFile(content: string, packageFile: string): Promise<PackageFileContent | null>;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.extractPackageFile = extractPackageFile;
4
+ const zod_1 = require("zod");
5
+ const logger_1 = require("../../../logger");
6
+ const fs_1 = require("../../../util/fs");
7
+ const result_1 = require("../../../util/result");
8
+ const schema_utils_1 = require("../../../util/schema-utils");
9
+ const schema_1 = require("../pep621/schema");
10
+ const schema_2 = require("./schema");
11
+ const PyProjectToml = schema_utils_1.Toml.pipe(schema_1.PyProjectSchema);
12
+ function getUserPixiConfig(content, packageFile) {
13
+ if (packageFile === 'pyproject.toml' ||
14
+ packageFile.endsWith('/pyproject.toml')) {
15
+ const { val, err } = result_1.Result.parse(content, PyProjectToml).unwrap();
16
+ if (err) {
17
+ logger_1.logger.debug({ packageFile, err }, `error parsing ${packageFile}`);
18
+ return null;
19
+ }
20
+ return val.tool?.pixi ?? null;
21
+ }
22
+ if (packageFile === 'pixi.toml' || packageFile.endsWith('/pixi.toml')) {
23
+ const { val, err } = result_1.Result.parse(content, schema_2.PixiToml).unwrap();
24
+ if (err) {
25
+ logger_1.logger.debug({ packageFile, err }, `error parsing ${packageFile}`);
26
+ return null;
27
+ }
28
+ return val;
29
+ }
30
+ const { val, err } = result_1.Result.parse(content, zod_1.z.union([schema_2.PixiToml, PyProjectToml.transform((p) => p.tool?.pixi)])).unwrap();
31
+ if (err) {
32
+ logger_1.logger.debug({ packageFile, err }, `error parsing ${packageFile}`);
33
+ return null;
34
+ }
35
+ return val ?? null;
36
+ }
37
+ async function extractPackageFile(content, packageFile) {
38
+ logger_1.logger.trace(`pixi.extractPackageFile(${packageFile})`);
39
+ const config = getUserPixiConfig(content, packageFile);
40
+ if (!config) {
41
+ return null;
42
+ }
43
+ const lockfileName = (0, fs_1.getSiblingFileName)(packageFile, 'pixi.lock');
44
+ const lockFiles = [];
45
+ if (await (0, fs_1.localPathExists)(lockfileName)) {
46
+ lockFiles.push(lockfileName);
47
+ }
48
+ return {
49
+ lockFiles,
50
+ deps: [],
51
+ };
52
+ }
53
+ //# sourceMappingURL=extract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pixi/extract.ts"],"names":[],"mappings":";;AAkDA,gDAqBC;AAvED,6BAAwB;AACxB,4CAAyC;AACzC,yCAAuE;AACvE,iDAA8C;AAC9C,6DAAkD;AAClD,6CAAmD;AAEnD,qCAAqD;AAErD,MAAM,aAAa,GAAG,mBAAI,CAAC,IAAI,CAAC,wBAAe,CAAC,CAAC;AAEjD,SAAS,iBAAiB,CACxB,OAAe,EACf,WAAmB;IAEnB,IACE,WAAW,KAAK,gBAAgB;QAChC,WAAW,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EACvC,CAAC;QACD,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,eAAM,CAAC,KAAK,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC,MAAM,EAAE,CAAC;QACnE,IAAI,GAAG,EAAE,CAAC;YACR,eAAM,CAAC,KAAK,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,EAAE,iBAAiB,WAAW,EAAE,CAAC,CAAC;YACnE,OAAO,IAAI,CAAC;QACd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A,uBAAkB,EAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAClE,MAAM,SAAS,GAAa,EAAE,CAAC;IAC/B,IAAI,MAAM,IAAA,oBAAe,EAAC,YAAY,CAAC,EAAE,CAAC;QACxC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC/B,CAAC;IAED,OAAO;QACL,SAAS;QACT,IAAI,EAAE,EAAE;KACT,CAAC;AACJ,CAAC","sourcesContent":["import { z } from 'zod';\nimport { logger } from '../../../logger';\nimport { getSiblingFileName, localPathExists } from '../../../util/fs';\nimport { Result } from '../../../util/result';\nimport { Toml } from '../../../util/schema-utils';\nimport { PyProjectSchema } from '../pep621/schema';\nimport type { PackageFileContent } from '../types';\nimport { type PixiConfig, PixiToml } from './schema';\n\nconst PyProjectToml = Toml.pipe(PyProjectSchema);\n\nfunction getUserPixiConfig(\n content: string,\n packageFile: string,\n): null | PixiConfig {\n if (\n packageFile === 'pyproject.toml' ||\n packageFile.endsWith('/pyproject.toml')\n ) {\n const { val, err } = Result.parse(content, PyProjectToml).unwrap();\n if (err) {\n logger.debug({ packageFile, err }, `error parsing ${packageFile}`);\n return null;\n }\n\n return val.tool?.pixi ?? null;\n }\n\n if (packageFile === 'pixi.toml' || packageFile.endsWith('/pixi.toml')) {\n const { val, err } = Result.parse(content, PixiToml).unwrap();\n if (err) {\n logger.debug({ packageFile, err }, `error parsing ${packageFile}`);\n return null;\n }\n\n return val;\n }\n\n const { val, err } = Result.parse(\n content,\n z.union([PixiToml, PyProjectToml.transform((p) => p.tool?.pixi)]),\n ).unwrap();\n\n if (err) {\n logger.debug({ packageFile, err }, `error parsing ${packageFile}`);\n return null;\n }\n return val ?? null;\n}\n\nexport async function extractPackageFile(\n content: string,\n packageFile: string,\n): Promise<PackageFileContent | null> {\n logger.trace(`pixi.extractPackageFile(${packageFile})`);\n\n const config = getUserPixiConfig(content, packageFile);\n if (!config) {\n return null;\n }\n\n const lockfileName = getSiblingFileName(packageFile, 'pixi.lock');\n const lockFiles: string[] = [];\n if (await localPathExists(lockfileName)) {\n lockFiles.push(lockfileName);\n }\n\n return {\n lockFiles,\n deps: [],\n };\n}\n"]}
@@ -0,0 +1,11 @@
1
+ import type { Category } from '../../../constants';
2
+ export { bumpPackageVersion } from '../pep621/update';
3
+ export { extractPackageFile } from './extract';
4
+ export { updateArtifacts } from './artifacts';
5
+ export declare const supportsLockFileMaintenance = true;
6
+ export declare const url = "https://github.com/prefix-dev/pixi/";
7
+ export declare const categories: Category[];
8
+ export declare const defaultConfig: {
9
+ fileMatch: string[];
10
+ };
11
+ export declare const supportedDatasources: string[];
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.supportedDatasources = exports.defaultConfig = exports.categories = exports.url = exports.supportsLockFileMaintenance = exports.updateArtifacts = exports.extractPackageFile = exports.bumpPackageVersion = void 0;
4
+ const conda_1 = require("../../datasource/conda");
5
+ const pypi_1 = require("../../datasource/pypi");
6
+ var update_1 = require("../pep621/update");
7
+ Object.defineProperty(exports, "bumpPackageVersion", { enumerable: true, get: function () { return update_1.bumpPackageVersion; } });
8
+ var extract_1 = require("./extract");
9
+ Object.defineProperty(exports, "extractPackageFile", { enumerable: true, get: function () { return extract_1.extractPackageFile; } });
10
+ var artifacts_1 = require("./artifacts");
11
+ Object.defineProperty(exports, "updateArtifacts", { enumerable: true, get: function () { return artifacts_1.updateArtifacts; } });
12
+ exports.supportsLockFileMaintenance = true;
13
+ exports.url = 'https://github.com/prefix-dev/pixi/';
14
+ exports.categories = ['python'];
15
+ exports.defaultConfig = {
16
+ fileMatch: [
17
+ '(^|/)pyproject\\.toml$', // `tool.pixi` section
18
+ '(^|/)pixi\\.toml$', // root object
19
+ ],
20
+ };
21
+ exports.supportedDatasources = [pypi_1.PypiDatasource.id, conda_1.CondaDatasource.id];
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pixi/index.ts"],"names":[],"mappings":";;;AACA,kDAAyD;AACzD,gDAAuD;AAEvD,2CAAsD;AAA7C,4GAAA,kBAAkB,OAAA;AAC3B,qCAA+C;AAAtC,6GAAA,kBAAkB,OAAA;AAC3B,yCAA8C;AAArC,4GAAA,eAAe,OAAA;AAEX,QAAA,2BAA2B,GAAG,IAAI,CAAC;AAEnC,QAAA,GAAG,GAAG,qCAAqC,CAAC;AAC5C,QAAA,UAAU,GAAe,CAAC,QAAQ,CAAC,CAAC;AAEpC,QAAA,aAAa,GAAG;IAC3B,SAAS,EAAE;QACT,wBAAwB,EAAE,sBAAsB;QAChD,mBAAmB,EAAE,cAAc;KACpC;CACF,CAAC;AAEW,QAAA,oBAAoB,GAAG,CAAC,qBAAc,CAAC,EAAE,EAAE,uBAAe,CAAC,EAAE,CAAC,CAAC","sourcesContent":["import type { Category } from '../../../constants';\nimport { CondaDatasource } from '../../datasource/conda';\nimport { PypiDatasource } from '../../datasource/pypi';\n\nexport { bumpPackageVersion } from '../pep621/update';\nexport { extractPackageFile } from './extract';\nexport { updateArtifacts } from './artifacts';\n\nexport const supportsLockFileMaintenance = true;\n\nexport const url = 'https://github.com/prefix-dev/pixi/';\nexport const categories: Category[] = ['python'];\n\nexport const defaultConfig = {\n fileMatch: [\n '(^|/)pyproject\\\\.toml$', // `tool.pixi` section\n '(^|/)pixi\\\\.toml$', // root object\n ],\n};\n\nexport const supportedDatasources = [PypiDatasource.id, CondaDatasource.id];\n"]}
@@ -0,0 +1,6 @@
1
+ interface Config {
2
+ lockVersion: number;
3
+ range: string;
4
+ }
5
+ export declare function pickConfig(lockVersion?: number): Config | null;
6
+ export {};
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pickConfig = pickConfig;
4
+ /**
5
+ * There is no way to know which version we should pick based on `pixi.toml` and `pixi.lock`
6
+ * so we need to maintain a mapping from pixi version and it's generated lock file version.
7
+ *
8
+ * it should support lock version < 6 but old version of pixi doesn't release the binary we need, so just skip them and support only lock file version >=6
9
+ *
10
+ */
11
+ const pixiGenerateLockFileVersion = [
12
+ { lockVersion: 6, range: '>=0.39.2, <0.43.0' },
13
+ ];
14
+ function pickConfig(lockVersion) {
15
+ if (!lockVersion) {
16
+ return null;
17
+ }
18
+ for (const pixi of pixiGenerateLockFileVersion) {
19
+ if (lockVersion === pixi.lockVersion) {
20
+ return pixi;
21
+ }
22
+ }
23
+ return null;
24
+ }
25
+ //# sourceMappingURL=lockfile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lockfile.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pixi/lockfile.ts"],"names":[],"mappings":";;AAgBA,gCAYC;AA5BD;;;;;;GAMG;AACH,MAAM,2BAA2B,GAAa;IAC5C,EAAE,WAAW,EAAE,CAAC,EAAE,KAAK,EAAE,mBAAmB,EAAE;CACtC,CAAC;AAOX,SAAgB,UAAU,CAAC,WAAoB;IAC7C,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK,MAAM,IAAI,IAAI,2BAA2B,EAAE,CAAC;QAC/C,IAAI,WAAW,KAAK,IAAI,CAAC,WAAW,EAAE,CAAC;YACrC,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["/**\n * There is no way to know which version we should pick based on `pixi.toml` and `pixi.lock`\n * so we need to maintain a mapping from pixi version and it's generated lock file version.\n *\n * it should support lock version < 6 but old version of pixi doesn't release the binary we need, so just skip them and support only lock file version >=6\n *\n */\nconst pixiGenerateLockFileVersion: Config[] = [\n { lockVersion: 6, range: '>=0.39.2, <0.43.0' },\n] as const;\n\ninterface Config {\n lockVersion: number;\n range: string;\n}\n\nexport function pickConfig(lockVersion?: number): Config | null {\n if (!lockVersion) {\n return null;\n }\n\n for (const pixi of pixiGenerateLockFileVersion) {\n if (lockVersion === pixi.lockVersion) {\n return pixi;\n }\n }\n\n return null;\n}\n"]}
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * config of `pixi.toml` of `tool.pixi` of `pyproject.toml`
4
+ */
5
+ export declare const PixiConfigSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
6
+ export type PixiConfig = z.infer<typeof PixiConfigSchema>;
7
+ export declare const PixiToml: z.ZodPipeline<z.ZodEffects<z.ZodString, unknown, string>, z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
8
+ export declare const LockfileYaml: z.ZodPipeline<z.ZodEffects<z.ZodString, string | number | boolean | import("type-fest").JsonObject | import("type-fest").JsonValue[] | readonly import("type-fest").JsonValue[] | null, string>, z.ZodObject<{
9
+ version: z.ZodNumber;
10
+ }, "strip", z.ZodTypeAny, {
11
+ version: number;
12
+ }, {
13
+ version: number;
14
+ }>>;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LockfileYaml = exports.PixiToml = exports.PixiConfigSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const schema_utils_1 = require("../../../util/schema-utils");
6
+ /**
7
+ * config of `pixi.toml` of `tool.pixi` of `pyproject.toml`
8
+ */
9
+ exports.PixiConfigSchema = zod_1.z.object({});
10
+ exports.PixiToml = schema_utils_1.Toml.pipe(exports.PixiConfigSchema);
11
+ exports.LockfileYaml = schema_utils_1.Yaml.pipe(zod_1.z.object({
12
+ version: zod_1.z.number(),
13
+ }));
14
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pixi/schema.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,6DAAwD;AAExD;;GAEG;AACU,QAAA,gBAAgB,GAAG,OAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAIhC,QAAA,QAAQ,GAAG,mBAAI,CAAC,IAAI,CAAC,wBAAgB,CAAC,CAAC;AAEvC,QAAA,YAAY,GAAG,mBAAI,CAAC,IAAI,CACnC,OAAC,CAAC,MAAM,CAAC;IACP,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;CACpB,CAAC,CACH,CAAC","sourcesContent":["import { z } from 'zod';\nimport { Toml, Yaml } from '../../../util/schema-utils';\n\n/**\n * config of `pixi.toml` of `tool.pixi` of `pyproject.toml`\n */\nexport const PixiConfigSchema = z.object({});\n\nexport type PixiConfig = z.infer<typeof PixiConfigSchema>;\n\nexport const PixiToml = Toml.pipe(PixiConfigSchema);\n\nexport const LockfileYaml = Yaml.pipe(\n z.object({\n version: z.number(),\n }),\n);\n"]}
@@ -163,7 +163,6 @@ async function updateArtifacts({ packageFileName, updatedDeps, newPackageFileCon
163
163
  cwdFile: packageFileName,
164
164
  extraEnv,
165
165
  docker: {},
166
- userConfiguredEnv: config.env,
167
166
  toolConstraints: [
168
167
  { toolName: 'python', constraint: pythonConstraint },
169
168
  { toolName: 'poetry', constraint: poetryConstraint },
@@ -1 +1 @@
1
- {"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../../../lib/modules/manager/poetry/artifacts.ts"],"names":[],"mappings":";;AA0BA,kDA4BC;AAED,oDAsCC;AAyED,0CAiGC;;AAxQD,kEAAkC;AAClC,iCAA8B;AAC9B,sEAAoE;AACpE,4CAAyC;AAEzC,6CAA0C;AAE1C,yCAM0B;AAC1B,iDAAoE;AACpE,yDAAgD;AAChD,+CAA4C;AAC5C,iDAA8C;AAC9C,6CAAgF;AAChF,2CAA6C;AAC7C,gDAAuD;AACvD,gDAA8D;AAE9D,qCAAsD;AAGtD,SAAgB,mBAAmB,CACjC,gBAAwB,EACxB,uBAA+B;IAE/B,gFAAgF;IAChF,MAAM,yBAAyB,GAAG,eAAM,CAAC,KAAK,CAC5C,IAAA,cAAW,EAAC,gBAAgB,CAAC,EAC7B,yBAAgB,CAAC,SAAS,CACxB,CAAC,EAAE,kBAAkB,EAAE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eAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,oBAAoB,YAAY,OAAO,CAAC,CAAC;QAC/D,OAAO;YACL;gBACE,aAAa,EAAE;oBACb,QAAQ,EAAE,YAAY;oBACtB,MAAM,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;iBACvD;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { quote } from 'shlex';\nimport { TEMPORARY_ERROR } from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport type { HostRule } from '../../../types';\nimport { exec } from '../../../util/exec';\nimport type { ExecOptions } from '../../../util/exec/types';\nimport {\n deleteLocalFile,\n ensureCacheDir,\n getSiblingFileName,\n readLocalFile,\n writeLocalFile,\n} from '../../../util/fs';\nimport { getGitEnvironmentVariables } from '../../../util/git/auth';\nimport { find } from '../../../util/host-rules';\nimport { regEx } from '../../../util/regex';\nimport { Result } from '../../../util/result';\nimport { massage as massageToml, parse as parseToml } from '../../../util/toml';\nimport { parseUrl } from '../../../util/url';\nimport { PypiDatasource } from '../../datasource/pypi';\nimport { getGoogleAuthHostRule } from '../../datasource/util';\nimport type { UpdateArtifact, UpdateArtifactsResult } from '../types';\nimport { Lockfile, PoetrySchemaToml } from './schema';\nimport type { PoetryFile, PoetrySource } from './types';\n\nexport function getPythonConstraint(\n pyProjectContent: string,\n existingLockFileContent: string,\n): string | null {\n // Read Python version from `pyproject.toml` first as it could have been updated\n const pyprojectPythonConstraint = Result.parse(\n massageToml(pyProjectContent),\n PoetrySchemaToml.transform(\n ({ packageFileContent }) =>\n packageFileContent.deps.find((dep) => dep.depName === 'python')\n ?.currentValue,\n ),\n ).unwrapOrNull();\n if (pyprojectPythonConstraint) {\n logger.debug('Using python version from pyproject.toml');\n return pyprojectPythonConstraint;\n }\n\n const lockfilePythonConstraint = Result.parse(\n existingLockFileContent,\n Lockfile.transform(({ pythonVersions }) => pythonVersions),\n ).unwrapOrNull();\n if (lockfilePythonConstraint) {\n logger.debug('Using python version from poetry.lock');\n return lockfilePythonConstraint;\n }\n\n return null;\n}\n\nexport function getPoetryRequirement(\n pyProjectContent: string,\n existingLockFileContent: string,\n): undefined | string | null {\n // Read Poetry version from first line of poetry.lock\n const firstLine = existingLockFileContent.split('\\n')[0];\n const poetryVersionMatch = /by Poetry ([\\d\\\\.]+)/.exec(firstLine);\n if (poetryVersionMatch?.[1]) {\n const poetryVersion = poetryVersionMatch[1];\n logger.debug(\n `Using poetry version ${poetryVersion} from poetry.lock header`,\n );\n return poetryVersion;\n }\n\n const { val: lockfilePoetryConstraint } = Result.parse(\n existingLockFileContent,\n Lockfile.transform(({ poetryConstraint }) => poetryConstraint),\n ).unwrap();\n if (lockfilePoetryConstraint) {\n logger.debug(\n `Using poetry version ${lockfilePoetryConstraint} from poetry.lock metadata`,\n );\n return lockfilePoetryConstraint;\n }\n\n const { val: pyprojectPoetryConstraint } = Result.parse(\n massageToml(pyProjectContent),\n PoetrySchemaToml.transform(({ poetryRequirement }) => poetryRequirement),\n ).unwrap();\n if (pyprojectPoetryConstraint) {\n logger.debug(\n `Using poetry version ${pyprojectPoetryConstraint} from pyproject.toml`,\n );\n return pyprojectPoetryConstraint;\n }\n\n return null;\n}\n\nfunction getPoetrySources(content: string, fileName: string): PoetrySource[] {\n let pyprojectFile: PoetryFile;\n try {\n pyprojectFile = parseToml(massageToml(content)) as PoetryFile;\n } catch (err) {\n logger.debug({ err }, 'Error parsing pyproject.toml file');\n return [];\n }\n if (!pyprojectFile.tool?.poetry) {\n logger.debug(`${fileName} contains no poetry section`);\n return [];\n }\n\n const sources = pyprojectFile.tool?.poetry?.source ?? [];\n const sourceArray: PoetrySource[] = [];\n for (const source of sources) {\n if (source.name && source.url) {\n sourceArray.push({ name: source.name, url: source.url });\n }\n }\n return sourceArray;\n}\n\nasync function getMatchingHostRule(url: string | undefined): Promise<HostRule> {\n const scopedMatch = find({ hostType: PypiDatasource.id, url });\n const hostRule = is.nonEmptyObject(scopedMatch) ? scopedMatch : find({ url });\n if (hostRule && Object.keys(hostRule).length !== 0) {\n return hostRule;\n }\n\n const parsedUrl = parseUrl(url);\n if (!parsedUrl) {\n logger.once.debug(`Failed to parse URL ${url}`);\n return {};\n }\n\n if (parsedUrl.hostname.endsWith('.pkg.dev')) {\n const hostRule = await getGoogleAuthHostRule();\n if (hostRule && Object.keys(hostRule).length !== 0) {\n return hostRule;\n }\n logger.once.debug(`Could not get Google access token (url=${url})`);\n }\n\n return {};\n}\n\nasync function getSourceCredentialVars(\n pyprojectContent: string,\n packageFileName: string,\n): Promise<NodeJS.ProcessEnv> {\n const poetrySources = getPoetrySources(pyprojectContent, packageFileName);\n const envVars: NodeJS.ProcessEnv = {};\n\n for (const source of poetrySources) {\n const matchingHostRule = await getMatchingHostRule(source.url);\n const formattedSourceName = source.name\n .replace(regEx(/(\\.|-)+/g), '_')\n .toUpperCase();\n if (matchingHostRule.username) {\n envVars[`POETRY_HTTP_BASIC_${formattedSourceName}_USERNAME`] =\n matchingHostRule.username;\n }\n if (matchingHostRule.password) {\n envVars[`POETRY_HTTP_BASIC_${formattedSourceName}_PASSWORD`] =\n matchingHostRule.password;\n }\n }\n return envVars;\n}\n\nexport async function updateArtifacts({\n packageFileName,\n updatedDeps,\n newPackageFileContent,\n config,\n}: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> {\n logger.debug(`poetry.updateArtifacts(${packageFileName})`);\n const { isLockFileMaintenance } = config;\n\n if (!is.nonEmptyArray(updatedDeps) && !isLockFileMaintenance) {\n logger.debug('No updated poetry deps - returning null');\n return null;\n }\n // Try poetry.lock first\n let lockFileName = getSiblingFileName(packageFileName, 'poetry.lock');\n let existingLockFileContent = await readLocalFile(lockFileName, 'utf8');\n if (!existingLockFileContent) {\n // Try pyproject.lock next\n lockFileName = getSiblingFileName(packageFileName, 'pyproject.lock');\n existingLockFileContent = await readLocalFile(lockFileName, 'utf8');\n if (!existingLockFileContent) {\n logger.debug(`No lock file found`);\n return null;\n }\n }\n logger.debug(`Updating ${lockFileName}`);\n try {\n await writeLocalFile(packageFileName, newPackageFileContent);\n const cmd: string[] = [];\n if (isLockFileMaintenance) {\n await deleteLocalFile(lockFileName);\n cmd.push('poetry update --lock --no-interaction');\n } else {\n cmd.push(\n `poetry update --lock --no-interaction ${updatedDeps\n .map((dep) => dep.depName)\n .filter(is.string)\n .map((dep) => quote(dep))\n .join(' ')}`,\n );\n }\n const pythonConstraint =\n config?.constraints?.python ??\n getPythonConstraint(newPackageFileContent, existingLockFileContent);\n const poetryConstraint =\n config.constraints?.poetry ??\n getPoetryRequirement(newPackageFileContent, existingLockFileContent);\n const extraEnv = {\n ...(await getSourceCredentialVars(\n newPackageFileContent,\n packageFileName,\n )),\n ...getGitEnvironmentVariables(['poetry']),\n PIP_CACHE_DIR: await ensureCacheDir('pip'),\n };\n\n const execOptions: ExecOptions = {\n cwdFile: packageFileName,\n extraEnv,\n docker: {},\n userConfiguredEnv: config.env,\n toolConstraints: [\n { toolName: 'python', constraint: pythonConstraint },\n { toolName: 'poetry', constraint: poetryConstraint },\n ],\n };\n await exec(cmd, execOptions);\n const newPoetryLockContent = await readLocalFile(lockFileName, 'utf8');\n if (existingLockFileContent === newPoetryLockContent) {\n logger.debug(`${lockFileName} is unchanged`);\n return null;\n }\n logger.debug(`Returning updated ${lockFileName}`);\n return [\n {\n file: {\n type: 'addition',\n path: lockFileName,\n contents: newPoetryLockContent,\n },\n },\n ];\n } catch (err) {\n // istanbul ignore if\n if (err.message === TEMPORARY_ERROR) {\n throw err;\n }\n logger.debug({ err }, `Failed to update ${lockFileName} file`);\n return [\n {\n artifactError: {\n lockFile: lockFileName,\n stderr: `${String(err.stdout)}\\n${String(err.stderr)}`,\n },\n },\n ];\n }\n}\n"]}
1
+ {"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../../../lib/modules/manager/poetry/artifacts.ts"],"names":[],"mappings":";;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,eAAM,CAAC,KAAK,CAAC,GAAG,YAAY,eAAe,CAAC,CAAC;YAC7C,OAAO,IAAI,CAAC;QACd,CAAC;QACD,eAAM,CAAC,KAAK,CAAC,qBAAqB,YAAY,EAAE,CAAC,CAAC;QAClD,OAAO;YACL;gBACE,IAAI,EAAE;oBACJ,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,YAAY;oBAClB,QAAQ,EAAE,oBAAoB;iBAC/B;aACF;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,qBAAqB;QACrB,IAAI,GAAG,CAAC,OAAO,KAAK,gCAAe,EAAE,CAAC;YACpC,MAAM,GAAG,CAAC;QACZ,CAAC;QACD,eAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,oBAAoB,YAAY,OAAO,CAAC,CAAC;QAC/D,OAAO;YACL;gBACE,aAAa,EAAE;oBACb,QAAQ,EAAE,YAAY;oBACtB,MAAM,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;iBACvD;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { quote } from 'shlex';\nimport { TEMPORARY_ERROR } from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport type { HostRule } from '../../../types';\nimport { exec } from '../../../util/exec';\nimport type { ExecOptions } from '../../../util/exec/types';\nimport {\n deleteLocalFile,\n ensureCacheDir,\n getSiblingFileName,\n readLocalFile,\n writeLocalFile,\n} from '../../../util/fs';\nimport { getGitEnvironmentVariables } from '../../../util/git/auth';\nimport { find } from '../../../util/host-rules';\nimport { regEx } from '../../../util/regex';\nimport { Result } from '../../../util/result';\nimport { massage as massageToml, parse as parseToml } from '../../../util/toml';\nimport { parseUrl } from '../../../util/url';\nimport { PypiDatasource } from '../../datasource/pypi';\nimport { getGoogleAuthHostRule } from '../../datasource/util';\nimport type { UpdateArtifact, UpdateArtifactsResult } from '../types';\nimport { Lockfile, PoetrySchemaToml } from './schema';\nimport type { PoetryFile, PoetrySource } from './types';\n\nexport function getPythonConstraint(\n pyProjectContent: string,\n existingLockFileContent: string,\n): string | null {\n // Read Python version from `pyproject.toml` first as it could have been updated\n const pyprojectPythonConstraint = Result.parse(\n massageToml(pyProjectContent),\n PoetrySchemaToml.transform(\n ({ packageFileContent }) =>\n packageFileContent.deps.find((dep) => dep.depName === 'python')\n ?.currentValue,\n ),\n ).unwrapOrNull();\n if (pyprojectPythonConstraint) {\n logger.debug('Using python version from pyproject.toml');\n return pyprojectPythonConstraint;\n }\n\n const lockfilePythonConstraint = Result.parse(\n existingLockFileContent,\n Lockfile.transform(({ pythonVersions }) => pythonVersions),\n ).unwrapOrNull();\n if (lockfilePythonConstraint) {\n logger.debug('Using python version from poetry.lock');\n return lockfilePythonConstraint;\n }\n\n return null;\n}\n\nexport function getPoetryRequirement(\n pyProjectContent: string,\n existingLockFileContent: string,\n): undefined | string | null {\n // Read Poetry version from first line of poetry.lock\n const firstLine = existingLockFileContent.split('\\n')[0];\n const poetryVersionMatch = /by Poetry ([\\d\\\\.]+)/.exec(firstLine);\n if (poetryVersionMatch?.[1]) {\n const poetryVersion = poetryVersionMatch[1];\n logger.debug(\n `Using poetry version ${poetryVersion} from poetry.lock header`,\n );\n return poetryVersion;\n }\n\n const { val: lockfilePoetryConstraint } = Result.parse(\n existingLockFileContent,\n Lockfile.transform(({ poetryConstraint }) => poetryConstraint),\n ).unwrap();\n if (lockfilePoetryConstraint) {\n logger.debug(\n `Using poetry version ${lockfilePoetryConstraint} from poetry.lock metadata`,\n );\n return lockfilePoetryConstraint;\n }\n\n const { val: pyprojectPoetryConstraint } = Result.parse(\n massageToml(pyProjectContent),\n PoetrySchemaToml.transform(({ poetryRequirement }) => poetryRequirement),\n ).unwrap();\n if (pyprojectPoetryConstraint) {\n logger.debug(\n `Using poetry version ${pyprojectPoetryConstraint} from pyproject.toml`,\n );\n return pyprojectPoetryConstraint;\n }\n\n return null;\n}\n\nfunction getPoetrySources(content: string, fileName: string): PoetrySource[] {\n let pyprojectFile: PoetryFile;\n try {\n pyprojectFile = parseToml(massageToml(content)) as PoetryFile;\n } catch (err) {\n logger.debug({ err }, 'Error parsing pyproject.toml file');\n return [];\n }\n if (!pyprojectFile.tool?.poetry) {\n logger.debug(`${fileName} contains no poetry section`);\n return [];\n }\n\n const sources = pyprojectFile.tool?.poetry?.source ?? [];\n const sourceArray: PoetrySource[] = [];\n for (const source of sources) {\n if (source.name && source.url) {\n sourceArray.push({ name: source.name, url: source.url });\n }\n }\n return sourceArray;\n}\n\nasync function getMatchingHostRule(url: string | undefined): Promise<HostRule> {\n const scopedMatch = find({ hostType: PypiDatasource.id, url });\n const hostRule = is.nonEmptyObject(scopedMatch) ? scopedMatch : find({ url });\n if (hostRule && Object.keys(hostRule).length !== 0) {\n return hostRule;\n }\n\n const parsedUrl = parseUrl(url);\n if (!parsedUrl) {\n logger.once.debug(`Failed to parse URL ${url}`);\n return {};\n }\n\n if (parsedUrl.hostname.endsWith('.pkg.dev')) {\n const hostRule = await getGoogleAuthHostRule();\n if (hostRule && Object.keys(hostRule).length !== 0) {\n return hostRule;\n }\n logger.once.debug(`Could not get Google access token (url=${url})`);\n }\n\n return {};\n}\n\nasync function getSourceCredentialVars(\n pyprojectContent: string,\n packageFileName: string,\n): Promise<NodeJS.ProcessEnv> {\n const poetrySources = getPoetrySources(pyprojectContent, packageFileName);\n const envVars: NodeJS.ProcessEnv = {};\n\n for (const source of poetrySources) {\n const matchingHostRule = await getMatchingHostRule(source.url);\n const formattedSourceName = source.name\n .replace(regEx(/(\\.|-)+/g), '_')\n .toUpperCase();\n if (matchingHostRule.username) {\n envVars[`POETRY_HTTP_BASIC_${formattedSourceName}_USERNAME`] =\n matchingHostRule.username;\n }\n if (matchingHostRule.password) {\n envVars[`POETRY_HTTP_BASIC_${formattedSourceName}_PASSWORD`] =\n matchingHostRule.password;\n }\n }\n return envVars;\n}\n\nexport async function updateArtifacts({\n packageFileName,\n updatedDeps,\n newPackageFileContent,\n config,\n}: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> {\n logger.debug(`poetry.updateArtifacts(${packageFileName})`);\n const { isLockFileMaintenance } = config;\n\n if (!is.nonEmptyArray(updatedDeps) && !isLockFileMaintenance) {\n logger.debug('No updated poetry deps - returning null');\n return null;\n }\n // Try poetry.lock first\n let lockFileName = getSiblingFileName(packageFileName, 'poetry.lock');\n let existingLockFileContent = await readLocalFile(lockFileName, 'utf8');\n if (!existingLockFileContent) {\n // Try pyproject.lock next\n lockFileName = getSiblingFileName(packageFileName, 'pyproject.lock');\n existingLockFileContent = await readLocalFile(lockFileName, 'utf8');\n if (!existingLockFileContent) {\n logger.debug(`No lock file found`);\n return null;\n }\n }\n logger.debug(`Updating ${lockFileName}`);\n try {\n await writeLocalFile(packageFileName, newPackageFileContent);\n const cmd: string[] = [];\n if (isLockFileMaintenance) {\n await deleteLocalFile(lockFileName);\n cmd.push('poetry update --lock --no-interaction');\n } else {\n cmd.push(\n `poetry update --lock --no-interaction ${updatedDeps\n .map((dep) => dep.depName)\n .filter(is.string)\n .map((dep) => quote(dep))\n .join(' ')}`,\n );\n }\n const pythonConstraint =\n config?.constraints?.python ??\n getPythonConstraint(newPackageFileContent, existingLockFileContent);\n const poetryConstraint =\n config.constraints?.poetry ??\n getPoetryRequirement(newPackageFileContent, existingLockFileContent);\n const extraEnv = {\n ...(await getSourceCredentialVars(\n newPackageFileContent,\n packageFileName,\n )),\n ...getGitEnvironmentVariables(['poetry']),\n PIP_CACHE_DIR: await ensureCacheDir('pip'),\n };\n\n const execOptions: ExecOptions = {\n cwdFile: packageFileName,\n extraEnv,\n docker: {},\n toolConstraints: [\n { toolName: 'python', constraint: pythonConstraint },\n { toolName: 'poetry', constraint: poetryConstraint },\n ],\n };\n await exec(cmd, execOptions);\n const newPoetryLockContent = await readLocalFile(lockFileName, 'utf8');\n if (existingLockFileContent === newPoetryLockContent) {\n logger.debug(`${lockFileName} is unchanged`);\n return null;\n }\n logger.debug(`Returning updated ${lockFileName}`);\n return [\n {\n file: {\n type: 'addition',\n path: lockFileName,\n contents: newPoetryLockContent,\n },\n },\n ];\n } catch (err) {\n // istanbul ignore if\n if (err.message === TEMPORARY_ERROR) {\n throw err;\n }\n logger.debug({ err }, `Failed to update ${lockFileName} file`);\n return [\n {\n artifactError: {\n lockFile: lockFileName,\n stderr: `${String(err.stdout)}\\n${String(err.stderr)}`,\n },\n },\n ];\n }\n}\n"]}
@@ -45,21 +45,21 @@ export declare const PoetrySectionSchema: z.ZodEffects<z.ZodObject<{
45
45
  priority: "default" | "explicit" | "primary" | "secondary" | "supplemental";
46
46
  url?: string | undefined;
47
47
  }[];
48
+ version?: string | undefined;
48
49
  group?: PackageDependency<Record<string, any>>[] | undefined;
49
50
  dependencies?: PackageDependency<Record<string, any>>[] | undefined;
50
- version?: string | undefined;
51
51
  'dev-dependencies'?: PackageDependency<Record<string, any>>[] | undefined;
52
52
  }, {
53
- group?: Record<string, any> | undefined;
54
- dependencies?: Record<string, any> | undefined;
55
53
  version?: unknown;
54
+ group?: Record<string, any> | undefined;
56
55
  source?: unknown;
56
+ dependencies?: Record<string, any> | undefined;
57
57
  'dev-dependencies'?: Record<string, any> | undefined;
58
58
  }>, PackageFileContent<Record<string, any>>, {
59
- group?: Record<string, any> | undefined;
60
- dependencies?: Record<string, any> | undefined;
61
59
  version?: unknown;
60
+ group?: Record<string, any> | undefined;
62
61
  source?: unknown;
62
+ dependencies?: Record<string, any> | undefined;
63
63
  'dev-dependencies'?: Record<string, any> | undefined;
64
64
  }>;
65
65
  export type PoetrySectionSchema = z.infer<typeof PoetrySectionSchema>;
@@ -85,39 +85,39 @@ export declare const PoetrySchema: z.ZodEffects<z.ZodObject<{
85
85
  priority: "default" | "explicit" | "primary" | "secondary" | "supplemental";
86
86
  url?: string | undefined;
87
87
  }[];
88
+ version?: string | undefined;
88
89
  group?: PackageDependency<Record<string, any>>[] | undefined;
89
90
  dependencies?: PackageDependency<Record<string, any>>[] | undefined;
90
- version?: string | undefined;
91
91
  'dev-dependencies'?: PackageDependency<Record<string, any>>[] | undefined;
92
92
  }, {
93
- group?: Record<string, any> | undefined;
94
- dependencies?: Record<string, any> | undefined;
95
93
  version?: unknown;
94
+ group?: Record<string, any> | undefined;
96
95
  source?: unknown;
96
+ dependencies?: Record<string, any> | undefined;
97
97
  'dev-dependencies'?: Record<string, any> | undefined;
98
98
  }>, PackageFileContent<Record<string, any>>, {
99
- group?: Record<string, any> | undefined;
100
- dependencies?: Record<string, any> | undefined;
101
99
  version?: unknown;
100
+ group?: Record<string, any> | undefined;
102
101
  source?: unknown;
102
+ dependencies?: Record<string, any> | undefined;
103
103
  'dev-dependencies'?: Record<string, any> | undefined;
104
104
  }>;
105
105
  }, "strip", z.ZodTypeAny, {
106
106
  poetry: PackageFileContent<Record<string, any>>;
107
107
  }, {
108
108
  poetry: {
109
- group?: Record<string, any> | undefined;
110
- dependencies?: Record<string, any> | undefined;
111
109
  version?: unknown;
110
+ group?: Record<string, any> | undefined;
112
111
  source?: unknown;
112
+ dependencies?: Record<string, any> | undefined;
113
113
  'dev-dependencies'?: Record<string, any> | undefined;
114
114
  };
115
115
  }>, PackageFileContent<Record<string, any>>, {
116
116
  poetry: {
117
- group?: Record<string, any> | undefined;
118
- dependencies?: Record<string, any> | undefined;
119
117
  version?: unknown;
118
+ group?: Record<string, any> | undefined;
120
119
  source?: unknown;
120
+ dependencies?: Record<string, any> | undefined;
121
121
  'dev-dependencies'?: Record<string, any> | undefined;
122
122
  };
123
123
  }>;
@@ -143,10 +143,10 @@ export declare const PoetrySchema: z.ZodEffects<z.ZodObject<{
143
143
  }, {
144
144
  tool: {
145
145
  poetry: {
146
- group?: Record<string, any> | undefined;
147
- dependencies?: Record<string, any> | undefined;
148
146
  version?: unknown;
147
+ group?: Record<string, any> | undefined;
149
148
  source?: unknown;
149
+ dependencies?: Record<string, any> | undefined;
150
150
  'dev-dependencies'?: Record<string, any> | undefined;
151
151
  };
152
152
  };
@@ -157,10 +157,10 @@ export declare const PoetrySchema: z.ZodEffects<z.ZodObject<{
157
157
  }, {
158
158
  tool: {
159
159
  poetry: {
160
- group?: Record<string, any> | undefined;
161
- dependencies?: Record<string, any> | undefined;
162
160
  version?: unknown;
161
+ group?: Record<string, any> | undefined;
163
162
  source?: unknown;
163
+ dependencies?: Record<string, any> | undefined;
164
164
  'dev-dependencies'?: Record<string, any> | undefined;
165
165
  };
166
166
  };
@@ -189,39 +189,39 @@ export declare const PoetrySchemaToml: z.ZodPipeline<z.ZodEffects<z.ZodString, u
189
189
  priority: "default" | "explicit" | "primary" | "secondary" | "supplemental";
190
190
  url?: string | undefined;
191
191
  }[];
192
+ version?: string | undefined;
192
193
  group?: PackageDependency<Record<string, any>>[] | undefined;
193
194
  dependencies?: PackageDependency<Record<string, any>>[] | undefined;
194
- version?: string | undefined;
195
195
  'dev-dependencies'?: PackageDependency<Record<string, any>>[] | undefined;
196
196
  }, {
197
- group?: Record<string, any> | undefined;
198
- dependencies?: Record<string, any> | undefined;
199
197
  version?: unknown;
198
+ group?: Record<string, any> | undefined;
200
199
  source?: unknown;
200
+ dependencies?: Record<string, any> | undefined;
201
201
  'dev-dependencies'?: Record<string, any> | undefined;
202
202
  }>, PackageFileContent<Record<string, any>>, {
203
- group?: Record<string, any> | undefined;
204
- dependencies?: Record<string, any> | undefined;
205
203
  version?: unknown;
204
+ group?: Record<string, any> | undefined;
206
205
  source?: unknown;
206
+ dependencies?: Record<string, any> | undefined;
207
207
  'dev-dependencies'?: Record<string, any> | undefined;
208
208
  }>;
209
209
  }, "strip", z.ZodTypeAny, {
210
210
  poetry: PackageFileContent<Record<string, any>>;
211
211
  }, {
212
212
  poetry: {
213
- group?: Record<string, any> | undefined;
214
- dependencies?: Record<string, any> | undefined;
215
213
  version?: unknown;
214
+ group?: Record<string, any> | undefined;
216
215
  source?: unknown;
216
+ dependencies?: Record<string, any> | undefined;
217
217
  'dev-dependencies'?: Record<string, any> | undefined;
218
218
  };
219
219
  }>, PackageFileContent<Record<string, any>>, {
220
220
  poetry: {
221
- group?: Record<string, any> | undefined;
222
- dependencies?: Record<string, any> | undefined;
223
221
  version?: unknown;
222
+ group?: Record<string, any> | undefined;
224
223
  source?: unknown;
224
+ dependencies?: Record<string, any> | undefined;
225
225
  'dev-dependencies'?: Record<string, any> | undefined;
226
226
  };
227
227
  }>;
@@ -247,10 +247,10 @@ export declare const PoetrySchemaToml: z.ZodPipeline<z.ZodEffects<z.ZodString, u
247
247
  }, {
248
248
  tool: {
249
249
  poetry: {
250
- group?: Record<string, any> | undefined;
251
- dependencies?: Record<string, any> | undefined;
252
250
  version?: unknown;
251
+ group?: Record<string, any> | undefined;
253
252
  source?: unknown;
253
+ dependencies?: Record<string, any> | undefined;
254
254
  'dev-dependencies'?: Record<string, any> | undefined;
255
255
  };
256
256
  };
@@ -261,10 +261,10 @@ export declare const PoetrySchemaToml: z.ZodPipeline<z.ZodEffects<z.ZodString, u
261
261
  }, {
262
262
  tool: {
263
263
  poetry: {
264
- group?: Record<string, any> | undefined;
265
- dependencies?: Record<string, any> | undefined;
266
264
  version?: unknown;
265
+ group?: Record<string, any> | undefined;
267
266
  source?: unknown;
267
+ dependencies?: Record<string, any> | undefined;
268
268
  'dev-dependencies'?: Record<string, any> | undefined;
269
269
  };
270
270
  };
@@ -42,7 +42,6 @@ async function updateArtifacts({ packageFileName, updatedDeps, newPackageFileCon
42
42
  const execOptions = {
43
43
  cwdFile: packageFileName,
44
44
  docker: {},
45
- userConfiguredEnv: config.env,
46
45
  toolConstraints: [
47
46
  {
48
47
  toolName,
@@ -1 +1 @@
1
- {"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pub/artifacts.ts"],"names":[],"mappings":";;AAiBA,0CAiFC;;AAlGD,kEAAkC;AAClC,iCAA8B;AAC9B,sEAAoE;AACpE,4CAAyC;AACzC,6CAA0C;AAE1C,yCAI0B;AAE1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MAAM,EAAE,GAAG,CAAC,OAAO;iBACpB;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC;AAED,SAAS,cAAc,CACrB,QAAgB,EAChB,WAA+C,EAC/C,qBAA0C;IAE1C,IAAI,qBAAqB,EAAE,CAAC;QAC1B,OAAO,GAAG,QAAQ,cAAc,CAAC;IACnC,CAAC;SAAM,CAAC;QACN,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,YAAE,CAAC,MAAM,CAAC,CAAC;QACzE,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC7D,OAAO,GAAG,QAAQ,IAAI,eAAe,EAAE,CAAC;QAC1C,CAAC;QACD,6FAA6F;QAC7F,wEAAwE;aACnE,IACH,QAAQ,CAAC,MAAM,KAAK,CAAC;YACrB,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,EACtE,CAAC;YACD,OAAO,WAAW,eAAe,EAAE,CAAC;QACtC,CAAC;aAAM,CAAC;YACN,MAAM,WAAW,GAAG,QAAQ;iBACzB,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;iBACjD,GAAG,CAAC,aAAK,CAAC;iBACV,IAAI,CAAC,GAAG,CAAC,CAAC;YACb,OAAO,GAAG,QAAQ,gBAAgB,WAAW,EAAE,CAAC;QAClD,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { quote } from 'shlex';\nimport { TEMPORARY_ERROR } from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport { exec } from '../../../util/exec';\nimport type { ExecOptions } from '../../../util/exec/types';\nimport {\n getSiblingFileName,\n readLocalFile,\n writeLocalFile,\n} from '../../../util/fs';\nimport type { UpdateArtifact, UpdateArtifactsResult, Upgrade } from '../types';\nimport { parsePubspec, parsePubspecLock } from './utils';\n\nconst SDK_NAMES = ['dart', 'flutter'];\nconst PUB_GET_COMMAND = 'pub get --no-precompile';\n\nexport async function updateArtifacts({\n packageFileName,\n updatedDeps,\n newPackageFileContent,\n config,\n}: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> {\n logger.debug(`pub.updateArtifacts(${packageFileName})`);\n const { isLockFileMaintenance } = config;\n\n if (is.emptyArray(updatedDeps) && !isLockFileMaintenance) {\n logger.debug('No updated pub deps - returning null');\n return null;\n }\n\n const lockFileName = getSiblingFileName(packageFileName, 'pubspec.lock');\n const oldLockFileContent = await readLocalFile(lockFileName, 'utf8');\n if (!oldLockFileContent) {\n logger.debug('No pubspec.lock found');\n return null;\n }\n\n try {\n await writeLocalFile(packageFileName, newPackageFileContent);\n\n const isFlutter = newPackageFileContent.includes('sdk: flutter');\n const toolName = isFlutter ? 'flutter' : 'dart';\n const cmd = getExecCommand(toolName, updatedDeps, isLockFileMaintenance);\n\n let constraint = config.constraints?.[toolName];\n if (!constraint) {\n const pubspec = parsePubspec(packageFileName, newPackageFileContent);\n const pubspecToolName = isFlutter ? 'flutter' : 'sdk';\n constraint = pubspec?.environment[pubspecToolName];\n\n if (!constraint) {\n const pubspecLock = parsePubspecLock(lockFileName, oldLockFileContent);\n constraint = pubspecLock?.sdks[toolName];\n }\n }\n\n const execOptions: ExecOptions = {\n cwdFile: packageFileName,\n docker: {},\n userConfiguredEnv: config.env,\n toolConstraints: [\n {\n toolName,\n constraint,\n },\n ],\n };\n\n await exec(cmd, execOptions);\n const newLockFileContent = await readLocalFile(lockFileName, 'utf8');\n if (oldLockFileContent === newLockFileContent) {\n return null;\n }\n return [\n {\n file: {\n type: 'addition',\n path: lockFileName,\n contents: newLockFileContent,\n },\n },\n ];\n } catch (err) {\n // istanbul ignore if\n if (err.message === TEMPORARY_ERROR) {\n throw err;\n }\n logger.warn({ lockfile: lockFileName, err }, `Failed to update lock file`);\n return [\n {\n artifactError: {\n lockFile: lockFileName,\n stderr: err.message,\n },\n },\n ];\n }\n}\n\nfunction getExecCommand(\n toolName: string,\n updatedDeps: Upgrade<Record<string, unknown>>[],\n isLockFileMaintenance: boolean | undefined,\n): string {\n if (isLockFileMaintenance) {\n return `${toolName} pub upgrade`;\n } else {\n const depNames = updatedDeps.map((dep) => dep.depName).filter(is.string);\n if (depNames.length === 1 && SDK_NAMES.includes(depNames[0])) {\n return `${toolName} ${PUB_GET_COMMAND}`;\n }\n // If there are two updated dependencies and both of them are SDK updates (Dart and Flutter),\n // we use Flutter over Dart to run `pub get` as it is a Flutter project.\n else if (\n depNames.length === 2 &&\n depNames.filter((depName) => SDK_NAMES.includes(depName)).length === 2\n ) {\n return `flutter ${PUB_GET_COMMAND}`;\n } else {\n const depNamesCmd = depNames\n .filter((depName) => !SDK_NAMES.includes(depName))\n .map(quote)\n .join(' ');\n return `${toolName} pub upgrade ${depNamesCmd}`;\n }\n }\n}\n"]}
1
+ {"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../../../lib/modules/manager/pub/artifacts.ts"],"names":[],"mappings":";;AAiBA,0CAgFC;;AAjGD,kEAAkC;AAClC,iCAA8B;AAC9B,sEAAoE;AACpE,4CAAyC;AACzC,6CAA0C;AAE1C,yCAI0B;AAE1B,mCAAyD;AAEzD,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AACtC,MAAM,eAAe,GAAG,yBAAyB,CAAC;AAE3C,KAAK,UAAU,eAAe,CAAC,EACpC,eAAe,EACf,WAAW,EACX,qBAAqB,EACrB,MAAM,GACS;IACf,eAAM,CAAC,KAAK,CAAC,uBAAuB,eAAe,GAAG,CAAC,CAAC;IACxD,MAAM,EAAE,qBAAqB,EAAE,GAAG,MAAM,CAAC;I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AC,YAAE,CAAC,MAAM,CAAC,CAAC;QACzE,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC7D,OAAO,GAAG,QAAQ,IAAI,eAAe,EAAE,CAAC;QAC1C,CAAC;QACD,6FAA6F;QAC7F,wEAAwE;aACnE,IACH,QAAQ,CAAC,MAAM,KAAK,CAAC;YACrB,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,EACtE,CAAC;YACD,OAAO,WAAW,eAAe,EAAE,CAAC;QACtC,CAAC;aAAM,CAAC;YACN,MAAM,WAAW,GAAG,QAAQ;iBACzB,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;iBACjD,GAAG,CAAC,aAAK,CAAC;iBACV,IAAI,CAAC,GAAG,CAAC,CAAC;YACb,OAAO,GAAG,QAAQ,gBAAgB,WAAW,EAAE,CAAC;QAClD,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import is from '@sindresorhus/is';\nimport { quote } from 'shlex';\nimport { TEMPORARY_ERROR } from '../../../constants/error-messages';\nimport { logger } from '../../../logger';\nimport { exec } from '../../../util/exec';\nimport type { ExecOptions } from '../../../util/exec/types';\nimport {\n getSiblingFileName,\n readLocalFile,\n writeLocalFile,\n} from '../../../util/fs';\nimport type { UpdateArtifact, UpdateArtifactsResult, Upgrade } from '../types';\nimport { parsePubspec, parsePubspecLock } from './utils';\n\nconst SDK_NAMES = ['dart', 'flutter'];\nconst PUB_GET_COMMAND = 'pub get --no-precompile';\n\nexport async function updateArtifacts({\n packageFileName,\n updatedDeps,\n newPackageFileContent,\n config,\n}: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> {\n logger.debug(`pub.updateArtifacts(${packageFileName})`);\n const { isLockFileMaintenance } = config;\n\n if (is.emptyArray(updatedDeps) && !isLockFileMaintenance) {\n logger.debug('No updated pub deps - returning null');\n return null;\n }\n\n const lockFileName = getSiblingFileName(packageFileName, 'pubspec.lock');\n const oldLockFileContent = await readLocalFile(lockFileName, 'utf8');\n if (!oldLockFileContent) {\n logger.debug('No pubspec.lock found');\n return null;\n }\n\n try {\n await writeLocalFile(packageFileName, newPackageFileContent);\n\n const isFlutter = newPackageFileContent.includes('sdk: flutter');\n const toolName = isFlutter ? 'flutter' : 'dart';\n const cmd = getExecCommand(toolName, updatedDeps, isLockFileMaintenance);\n\n let constraint = config.constraints?.[toolName];\n if (!constraint) {\n const pubspec = parsePubspec(packageFileName, newPackageFileContent);\n const pubspecToolName = isFlutter ? 'flutter' : 'sdk';\n constraint = pubspec?.environment[pubspecToolName];\n\n if (!constraint) {\n const pubspecLock = parsePubspecLock(lockFileName, oldLockFileContent);\n constraint = pubspecLock?.sdks[toolName];\n }\n }\n\n const execOptions: ExecOptions = {\n cwdFile: packageFileName,\n docker: {},\n toolConstraints: [\n {\n toolName,\n constraint,\n },\n ],\n };\n\n await exec(cmd, execOptions);\n const newLockFileContent = await readLocalFile(lockFileName, 'utf8');\n if (oldLockFileContent === newLockFileContent) {\n return null;\n }\n return [\n {\n file: {\n type: 'addition',\n path: lockFileName,\n contents: newLockFileContent,\n },\n },\n ];\n } catch (err) {\n // istanbul ignore if\n if (err.message === TEMPORARY_ERROR) {\n throw err;\n }\n logger.warn({ lockfile: lockFileName, err }, `Failed to update lock file`);\n return [\n {\n artifactError: {\n lockFile: lockFileName,\n stderr: err.message,\n },\n },\n ];\n }\n}\n\nfunction getExecCommand(\n toolName: string,\n updatedDeps: Upgrade<Record<string, unknown>>[],\n isLockFileMaintenance: boolean | undefined,\n): string {\n if (isLockFileMaintenance) {\n return `${toolName} pub upgrade`;\n } else {\n const depNames = updatedDeps.map((dep) => dep.depName).filter(is.string);\n if (depNames.length === 1 && SDK_NAMES.includes(depNames[0])) {\n return `${toolName} ${PUB_GET_COMMAND}`;\n }\n // If there are two updated dependencies and both of them are SDK updates (Dart and Flutter),\n // we use Flutter over Dart to run `pub get` as it is a Flutter project.\n else if (\n depNames.length === 2 &&\n depNames.filter((depName) => SDK_NAMES.includes(depName)).length === 2\n ) {\n return `flutter ${PUB_GET_COMMAND}`;\n } else {\n const depNamesCmd = depNames\n .filter((depName) => !SDK_NAMES.includes(depName))\n .map(quote)\n .join(' ');\n return `${toolName} pub upgrade ${depNamesCmd}`;\n }\n }\n}\n"]}