@release-please-oss/release-please 0.0.0-stage → 17.11.3

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 (310) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +279 -2
  3. package/build/src/bin/release-please.d.ts +22 -0
  4. package/build/src/bin/release-please.js +727 -0
  5. package/build/src/bootstrapper.d.ts +18 -0
  6. package/build/src/bootstrapper.js +64 -0
  7. package/build/src/changelog-notes/default.d.ts +15 -0
  8. package/build/src/changelog-notes/default.js +96 -0
  9. package/build/src/changelog-notes/github.d.ts +8 -0
  10. package/build/src/changelog-notes/github.js +29 -0
  11. package/build/src/changelog-notes.d.ts +22 -0
  12. package/build/src/changelog-notes.js +40 -0
  13. package/build/src/commit.d.ts +33 -0
  14. package/build/src/commit.js +422 -0
  15. package/build/src/errors/index.d.ts +36 -0
  16. package/build/src/errors/index.js +77 -0
  17. package/build/src/factories/changelog-notes-factory.d.ts +16 -0
  18. package/build/src/factories/changelog-notes-factory.js +44 -0
  19. package/build/src/factories/plugin-factory.d.ts +23 -0
  20. package/build/src/factories/plugin-factory.js +94 -0
  21. package/build/src/factories/versioning-strategy-factory.d.ts +16 -0
  22. package/build/src/factories/versioning-strategy-factory.js +52 -0
  23. package/build/src/factory.d.ts +18 -0
  24. package/build/src/factory.js +161 -0
  25. package/build/src/github-api.d.ts +260 -0
  26. package/build/src/github-api.js +714 -0
  27. package/build/src/github.d.ts +306 -0
  28. package/build/src/github.js +769 -0
  29. package/build/src/index.d.ts +17 -0
  30. package/build/src/index.js +41 -0
  31. package/build/src/local-github.d.ts +270 -0
  32. package/build/src/local-github.js +756 -0
  33. package/build/src/manifest.d.ts +370 -0
  34. package/build/src/manifest.js +1142 -0
  35. package/build/src/plugin.d.ts +37 -0
  36. package/build/src/plugin.js +57 -0
  37. package/build/src/plugins/cargo-workspace.d.ts +58 -0
  38. package/build/src/plugins/cargo-workspace.js +339 -0
  39. package/build/src/plugins/group-priority.d.ts +29 -0
  40. package/build/src/plugins/group-priority.js +82 -0
  41. package/build/src/plugins/linked-versions.d.ts +36 -0
  42. package/build/src/plugins/linked-versions.js +137 -0
  43. package/build/src/plugins/maven-workspace.d.ts +81 -0
  44. package/build/src/plugins/maven-workspace.js +431 -0
  45. package/build/src/plugins/merge.d.ts +27 -0
  46. package/build/src/plugins/merge.js +99 -0
  47. package/build/src/plugins/node-workspace.d.ts +50 -0
  48. package/build/src/plugins/node-workspace.js +352 -0
  49. package/build/src/plugins/sentence-case.d.ts +19 -0
  50. package/build/src/plugins/sentence-case.js +80 -0
  51. package/build/src/plugins/workspace.d.ts +173 -0
  52. package/build/src/plugins/workspace.js +308 -0
  53. package/build/src/pull-request.d.ts +11 -0
  54. package/build/src/pull-request.js +16 -0
  55. package/build/src/release-pull-request.d.ts +14 -0
  56. package/build/src/release-pull-request.js +16 -0
  57. package/build/src/release.d.ts +7 -0
  58. package/build/src/release.js +16 -0
  59. package/build/src/repository.d.ts +5 -0
  60. package/build/src/repository.js +16 -0
  61. package/build/src/scm.d.ts +80 -0
  62. package/build/src/scm.js +16 -0
  63. package/build/src/strategies/base.d.ts +162 -0
  64. package/build/src/strategies/base.js +494 -0
  65. package/build/src/strategies/bazel.d.ts +7 -0
  66. package/build/src/strategies/bazel.js +49 -0
  67. package/build/src/strategies/dart.d.ts +8 -0
  68. package/build/src/strategies/dart.js +73 -0
  69. package/build/src/strategies/dotnet-yoshi.d.ts +13 -0
  70. package/build/src/strategies/dotnet-yoshi.js +109 -0
  71. package/build/src/strategies/elixir.d.ts +5 -0
  72. package/build/src/strategies/elixir.js +46 -0
  73. package/build/src/strategies/expo.d.ts +15 -0
  74. package/build/src/strategies/expo.js +51 -0
  75. package/build/src/strategies/go-librarian.d.ts +11 -0
  76. package/build/src/strategies/go-librarian.js +84 -0
  77. package/build/src/strategies/go-yoshi.d.ts +14 -0
  78. package/build/src/strategies/go-yoshi.js +168 -0
  79. package/build/src/strategies/go.d.ts +7 -0
  80. package/build/src/strategies/go.js +53 -0
  81. package/build/src/strategies/helm.d.ts +8 -0
  82. package/build/src/strategies/helm.js +73 -0
  83. package/build/src/strategies/java-yoshi-mono-repo.d.ts +22 -0
  84. package/build/src/strategies/java-yoshi-mono-repo.js +308 -0
  85. package/build/src/strategies/java-yoshi.d.ts +20 -0
  86. package/build/src/strategies/java-yoshi.js +210 -0
  87. package/build/src/strategies/java.d.ts +28 -0
  88. package/build/src/strategies/java.js +176 -0
  89. package/build/src/strategies/krm-blueprint.d.ts +7 -0
  90. package/build/src/strategies/krm-blueprint.js +65 -0
  91. package/build/src/strategies/maven.d.ts +9 -0
  92. package/build/src/strategies/maven.js +56 -0
  93. package/build/src/strategies/node-librarian.d.ts +10 -0
  94. package/build/src/strategies/node-librarian.js +121 -0
  95. package/build/src/strategies/node.d.ts +10 -0
  96. package/build/src/strategies/node.js +111 -0
  97. package/build/src/strategies/ocaml.d.ts +5 -0
  98. package/build/src/strategies/ocaml.js +86 -0
  99. package/build/src/strategies/php-librarian.d.ts +6 -0
  100. package/build/src/strategies/php-librarian.js +35 -0
  101. package/build/src/strategies/php-yoshi.d.ts +13 -0
  102. package/build/src/strategies/php-yoshi.js +255 -0
  103. package/build/src/strategies/php.d.ts +6 -0
  104. package/build/src/strategies/php.js +76 -0
  105. package/build/src/strategies/python-librarian.d.ts +6 -0
  106. package/build/src/strategies/python-librarian.js +35 -0
  107. package/build/src/strategies/python.d.ts +11 -0
  108. package/build/src/strategies/python.js +175 -0
  109. package/build/src/strategies/r.d.ts +8 -0
  110. package/build/src/strategies/r.js +67 -0
  111. package/build/src/strategies/ruby-librarian.d.ts +6 -0
  112. package/build/src/strategies/ruby-librarian.js +35 -0
  113. package/build/src/strategies/ruby-yoshi.d.ts +13 -0
  114. package/build/src/strategies/ruby-yoshi.js +97 -0
  115. package/build/src/strategies/ruby.d.ts +9 -0
  116. package/build/src/strategies/ruby.js +71 -0
  117. package/build/src/strategies/rust.d.ts +17 -0
  118. package/build/src/strategies/rust.js +149 -0
  119. package/build/src/strategies/sfdx.d.ts +9 -0
  120. package/build/src/strategies/sfdx.js +67 -0
  121. package/build/src/strategies/simple.d.ts +7 -0
  122. package/build/src/strategies/simple.js +51 -0
  123. package/build/src/strategies/terraform-module.d.ts +7 -0
  124. package/build/src/strategies/terraform-module.js +90 -0
  125. package/build/src/strategy.d.ts +68 -0
  126. package/build/src/strategy.js +16 -0
  127. package/build/src/update.d.ts +24 -0
  128. package/build/src/update.js +16 -0
  129. package/build/src/updaters/base-xml.d.ts +19 -0
  130. package/build/src/updaters/base-xml.js +43 -0
  131. package/build/src/updaters/bazel/module-bazel.d.ts +7 -0
  132. package/build/src/updaters/bazel/module-bazel.js +33 -0
  133. package/build/src/updaters/changelog-json.d.ts +29 -0
  134. package/build/src/updaters/changelog-json.js +100 -0
  135. package/build/src/updaters/changelog.d.ts +13 -0
  136. package/build/src/updaters/changelog.js +55 -0
  137. package/build/src/updaters/composite.d.ts +20 -0
  138. package/build/src/updaters/composite.js +65 -0
  139. package/build/src/updaters/dart/pubspec-yaml.d.ts +13 -0
  140. package/build/src/updaters/dart/pubspec-yaml.js +50 -0
  141. package/build/src/updaters/default.d.ts +21 -0
  142. package/build/src/updaters/default.js +36 -0
  143. package/build/src/updaters/dotnet/apis.d.ts +18 -0
  144. package/build/src/updaters/dotnet/apis.js +45 -0
  145. package/build/src/updaters/dotnet/csproj.d.ts +12 -0
  146. package/build/src/updaters/dotnet/csproj.js +33 -0
  147. package/build/src/updaters/elixir/elixir-mix-exs.d.ts +13 -0
  148. package/build/src/updaters/elixir/elixir-mix-exs.js +42 -0
  149. package/build/src/updaters/expo/app-json.d.ts +31 -0
  150. package/build/src/updaters/expo/app-json.js +67 -0
  151. package/build/src/updaters/generic-json.d.ts +14 -0
  152. package/build/src/updaters/generic-json.js +54 -0
  153. package/build/src/updaters/generic-toml.d.ts +21 -0
  154. package/build/src/updaters/generic-toml.js +66 -0
  155. package/build/src/updaters/generic-xml.d.ts +8 -0
  156. package/build/src/updaters/generic-xml.js +38 -0
  157. package/build/src/updaters/generic-yaml.d.ts +23 -0
  158. package/build/src/updaters/generic-yaml.js +85 -0
  159. package/build/src/updaters/generic.d.ts +54 -0
  160. package/build/src/updaters/generic.js +187 -0
  161. package/build/src/updaters/go/version-go.d.ts +4 -0
  162. package/build/src/updaters/go/version-go.js +24 -0
  163. package/build/src/updaters/helm/chart-yaml.d.ts +13 -0
  164. package/build/src/updaters/helm/chart-yaml.js +41 -0
  165. package/build/src/updaters/java/java-released.d.ts +28 -0
  166. package/build/src/updaters/java/java-released.js +59 -0
  167. package/build/src/updaters/java/java-update.d.ts +21 -0
  168. package/build/src/updaters/java/java-update.js +80 -0
  169. package/build/src/updaters/java/pom-xml.d.ts +29 -0
  170. package/build/src/updaters/java/pom-xml.js +135 -0
  171. package/build/src/updaters/java/versions-manifest.d.ts +19 -0
  172. package/build/src/updaters/java/versions-manifest.js +71 -0
  173. package/build/src/updaters/krm/krm-blueprint-version.d.ts +13 -0
  174. package/build/src/updaters/krm/krm-blueprint-version.js +46 -0
  175. package/build/src/updaters/librarian-yaml.d.ts +45 -0
  176. package/build/src/updaters/librarian-yaml.js +149 -0
  177. package/build/src/updaters/node/package-json.d.ts +46 -0
  178. package/build/src/updaters/node/package-json.js +106 -0
  179. package/build/src/updaters/node/package-lock-json.d.ts +14 -0
  180. package/build/src/updaters/node/package-lock-json.js +83 -0
  181. package/build/src/updaters/node/samples-package-json.d.ts +24 -0
  182. package/build/src/updaters/node/samples-package-json.js +49 -0
  183. package/build/src/updaters/ocaml/dune-project.d.ts +13 -0
  184. package/build/src/updaters/ocaml/dune-project.js +37 -0
  185. package/build/src/updaters/ocaml/esy-json.d.ts +13 -0
  186. package/build/src/updaters/ocaml/esy-json.js +37 -0
  187. package/build/src/updaters/ocaml/opam.d.ts +13 -0
  188. package/build/src/updaters/ocaml/opam.js +37 -0
  189. package/build/src/updaters/php/php-client-version.d.ts +12 -0
  190. package/build/src/updaters/php/php-client-version.js +32 -0
  191. package/build/src/updaters/php/root-composer-update-packages.d.ts +13 -0
  192. package/build/src/updaters/php/root-composer-update-packages.js +60 -0
  193. package/build/src/updaters/python/pyproject-toml.d.ts +29 -0
  194. package/build/src/updaters/python/pyproject-toml.js +53 -0
  195. package/build/src/updaters/python/python-file-with-version.d.ts +12 -0
  196. package/build/src/updaters/python/python-file-with-version.js +32 -0
  197. package/build/src/updaters/python/setup-cfg.d.ts +12 -0
  198. package/build/src/updaters/python/setup-cfg.js +32 -0
  199. package/build/src/updaters/python/setup-py.d.ts +12 -0
  200. package/build/src/updaters/python/setup-py.js +32 -0
  201. package/build/src/updaters/r/description.d.ts +12 -0
  202. package/build/src/updaters/r/description.js +32 -0
  203. package/build/src/updaters/r/news.d.ts +12 -0
  204. package/build/src/updaters/r/news.js +49 -0
  205. package/build/src/updaters/raw-content.d.ts +19 -0
  206. package/build/src/updaters/raw-content.js +39 -0
  207. package/build/src/updaters/release-please-config.d.ts +8 -0
  208. package/build/src/updaters/release-please-config.js +80 -0
  209. package/build/src/updaters/release-please-manifest.d.ts +4 -0
  210. package/build/src/updaters/release-please-manifest.js +34 -0
  211. package/build/src/updaters/ruby/common.d.ts +17 -0
  212. package/build/src/updaters/ruby/common.js +46 -0
  213. package/build/src/updaters/ruby/gemfile-lock.d.ts +24 -0
  214. package/build/src/updaters/ruby/gemfile-lock.js +53 -0
  215. package/build/src/updaters/ruby/version-rb.d.ts +12 -0
  216. package/build/src/updaters/ruby/version-rb.js +34 -0
  217. package/build/src/updaters/rust/cargo-lock.d.ts +16 -0
  218. package/build/src/updaters/rust/cargo-lock.js +64 -0
  219. package/build/src/updaters/rust/cargo-toml.d.ts +13 -0
  220. package/build/src/updaters/rust/cargo-toml.js +89 -0
  221. package/build/src/updaters/rust/common.d.ts +54 -0
  222. package/build/src/updaters/rust/common.js +35 -0
  223. package/build/src/updaters/sfdx/sfdx-project-json.d.ts +21 -0
  224. package/build/src/updaters/sfdx/sfdx-project-json.js +41 -0
  225. package/build/src/updaters/terraform/metadata-version.d.ts +13 -0
  226. package/build/src/updaters/terraform/metadata-version.js +37 -0
  227. package/build/src/updaters/terraform/module-version.d.ts +13 -0
  228. package/build/src/updaters/terraform/module-version.js +37 -0
  229. package/build/src/updaters/terraform/readme.d.ts +12 -0
  230. package/build/src/updaters/terraform/readme.js +32 -0
  231. package/build/src/util/branch-name.d.ts +20 -0
  232. package/build/src/util/branch-name.js +225 -0
  233. package/build/src/util/code-suggester/default-options-handler.d.ts +10 -0
  234. package/build/src/util/code-suggester/default-options-handler.js +45 -0
  235. package/build/src/util/code-suggester/errors.d.ts +4 -0
  236. package/build/src/util/code-suggester/errors.js +24 -0
  237. package/build/src/util/code-suggester/github/branch.d.ts +45 -0
  238. package/build/src/util/code-suggester/github/branch.js +118 -0
  239. package/build/src/util/code-suggester/github/commit-and-push.d.ts +51 -0
  240. package/build/src/util/code-suggester/github/commit-and-push.js +141 -0
  241. package/build/src/util/code-suggester/github/create-commit.d.ts +20 -0
  242. package/build/src/util/code-suggester/github/create-commit.js +60 -0
  243. package/build/src/util/code-suggester/github/fork.d.ts +15 -0
  244. package/build/src/util/code-suggester/github/fork.js +48 -0
  245. package/build/src/util/code-suggester/github/labels.d.ts +14 -0
  246. package/build/src/util/code-suggester/github/labels.js +42 -0
  247. package/build/src/util/code-suggester/github/open-pull-request.d.ts +16 -0
  248. package/build/src/util/code-suggester/github/open-pull-request.js +56 -0
  249. package/build/src/util/code-suggester/index.d.ts +28 -0
  250. package/build/src/util/code-suggester/index.js +110 -0
  251. package/build/src/util/code-suggester/logger.d.ts +4 -0
  252. package/build/src/util/code-suggester/logger.js +37 -0
  253. package/build/src/util/code-suggester/types.d.ts +109 -0
  254. package/build/src/util/code-suggester/types.js +30 -0
  255. package/build/src/util/coerce-option.d.ts +1 -0
  256. package/build/src/util/coerce-option.js +40 -0
  257. package/build/src/util/commit-exclude.d.ts +10 -0
  258. package/build/src/util/commit-exclude.js +49 -0
  259. package/build/src/util/commit-split.d.ts +26 -0
  260. package/build/src/util/commit-split.js +100 -0
  261. package/build/src/util/commit-utils.d.ts +1 -0
  262. package/build/src/util/commit-utils.js +34 -0
  263. package/build/src/util/filter-commits.d.ts +12 -0
  264. package/build/src/util/filter-commits.js +59 -0
  265. package/build/src/util/indent-commit.d.ts +2 -0
  266. package/build/src/util/indent-commit.js +39 -0
  267. package/build/src/util/json-stringify.d.ts +1 -0
  268. package/build/src/util/json-stringify.js +22 -0
  269. package/build/src/util/logger.d.ts +24 -0
  270. package/build/src/util/logger.js +54 -0
  271. package/build/src/util/pull-request-body.d.ts +25 -0
  272. package/build/src/util/pull-request-body.js +147 -0
  273. package/build/src/util/pull-request-overflow-handler.d.ts +54 -0
  274. package/build/src/util/pull-request-overflow-handler.js +78 -0
  275. package/build/src/util/pull-request-title.d.ts +22 -0
  276. package/build/src/util/pull-request-title.js +146 -0
  277. package/build/src/util/signoff-commit-message.d.ts +1 -0
  278. package/build/src/util/signoff-commit-message.js +35 -0
  279. package/build/src/util/tag-name.d.ts +10 -0
  280. package/build/src/util/tag-name.js +42 -0
  281. package/build/src/util/toml-edit.d.ts +16 -0
  282. package/build/src/util/toml-edit.js +126 -0
  283. package/build/src/version.d.ts +35 -0
  284. package/build/src/version.js +74 -0
  285. package/build/src/versioning-strategies/always-bump-major.d.ts +10 -0
  286. package/build/src/versioning-strategies/always-bump-major.js +28 -0
  287. package/build/src/versioning-strategies/always-bump-minor.d.ts +10 -0
  288. package/build/src/versioning-strategies/always-bump-minor.js +28 -0
  289. package/build/src/versioning-strategies/always-bump-patch.d.ts +11 -0
  290. package/build/src/versioning-strategies/always-bump-patch.js +29 -0
  291. package/build/src/versioning-strategies/default.d.ts +48 -0
  292. package/build/src/versioning-strategies/default.js +102 -0
  293. package/build/src/versioning-strategies/dependency-manifest.d.ts +15 -0
  294. package/build/src/versioning-strategies/dependency-manifest.js +103 -0
  295. package/build/src/versioning-strategies/java-add-snapshot.d.ts +13 -0
  296. package/build/src/versioning-strategies/java-add-snapshot.js +54 -0
  297. package/build/src/versioning-strategies/java-snapshot.d.ts +13 -0
  298. package/build/src/versioning-strategies/java-snapshot.js +70 -0
  299. package/build/src/versioning-strategies/prerelease.d.ts +20 -0
  300. package/build/src/versioning-strategies/prerelease.js +163 -0
  301. package/build/src/versioning-strategies/service-pack.d.ts +12 -0
  302. package/build/src/versioning-strategies/service-pack.js +47 -0
  303. package/build/src/versioning-strategy.d.ts +90 -0
  304. package/build/src/versioning-strategy.js +82 -0
  305. package/package.json +114 -4
  306. package/schemas/config.json +513 -0
  307. package/schemas/manifest.json +9 -0
  308. package/templates/commit.hbs +2 -0
  309. package/templates/header.hbs +9 -0
  310. package/templates/template.hbs +19 -0
@@ -0,0 +1,37 @@
1
+ import { Scm } from './scm';
2
+ import { CandidateReleasePullRequest, RepositoryConfig } from './manifest';
3
+ import { Strategy } from './strategy';
4
+ import { Commit, ConventionalCommit } from './commit';
5
+ import { Release } from './release';
6
+ import { Logger } from './util/logger';
7
+ /**
8
+ * A plugin runs after a repository manifest has built candidate
9
+ * pull requests and can make updates that span across multiple
10
+ * components. A plugin *might* choose to merge pull requests or add
11
+ * or update existing files.
12
+ */
13
+ export declare abstract class ManifestPlugin {
14
+ readonly github: Scm;
15
+ readonly targetBranch: string;
16
+ readonly repositoryConfig: RepositoryConfig;
17
+ protected logger: Logger;
18
+ constructor(github: Scm, targetBranch: string, repositoryConfig: RepositoryConfig, logger?: Logger);
19
+ /**
20
+ * Perform post-processing on commits, e.g, sentence casing them.
21
+ * @param {Commit[]} commits The set of commits that will feed into release pull request.
22
+ * @returns {Commit[]} The modified commit objects.
23
+ */
24
+ processCommits(commits: ConventionalCommit[]): ConventionalCommit[];
25
+ /**
26
+ * Post-process candidate pull requests.
27
+ * @param {CandidateReleasePullRequest[]} pullRequests Candidate pull requests
28
+ * @returns {CandidateReleasePullRequest[]} Updated pull requests
29
+ */
30
+ run(pullRequests: CandidateReleasePullRequest[]): Promise<CandidateReleasePullRequest[]>;
31
+ /**
32
+ * Pre-configure strategies.
33
+ * @param {Record<string, Strategy>} strategiesByPath Strategies indexed by path
34
+ * @returns {Record<string, Strategy>} Updated strategies indexed by path
35
+ */
36
+ preconfigure(strategiesByPath: Record<string, Strategy>, _commitsByPath: Record<string, Commit[]>, _releasesByPath: Record<string, Release>): Promise<Record<string, Strategy>>;
37
+ }
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ // Copyright 2021 Google LLC
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.ManifestPlugin = void 0;
17
+ const logger_1 = require("./util/logger");
18
+ /**
19
+ * A plugin runs after a repository manifest has built candidate
20
+ * pull requests and can make updates that span across multiple
21
+ * components. A plugin *might* choose to merge pull requests or add
22
+ * or update existing files.
23
+ */
24
+ class ManifestPlugin {
25
+ constructor(github, targetBranch, repositoryConfig, logger = logger_1.logger) {
26
+ this.github = github;
27
+ this.targetBranch = targetBranch;
28
+ this.repositoryConfig = repositoryConfig;
29
+ this.logger = logger;
30
+ }
31
+ /**
32
+ * Perform post-processing on commits, e.g, sentence casing them.
33
+ * @param {Commit[]} commits The set of commits that will feed into release pull request.
34
+ * @returns {Commit[]} The modified commit objects.
35
+ */
36
+ processCommits(commits) {
37
+ return commits;
38
+ }
39
+ /**
40
+ * Post-process candidate pull requests.
41
+ * @param {CandidateReleasePullRequest[]} pullRequests Candidate pull requests
42
+ * @returns {CandidateReleasePullRequest[]} Updated pull requests
43
+ */
44
+ async run(pullRequests) {
45
+ return pullRequests;
46
+ }
47
+ /**
48
+ * Pre-configure strategies.
49
+ * @param {Record<string, Strategy>} strategiesByPath Strategies indexed by path
50
+ * @returns {Record<string, Strategy>} Updated strategies indexed by path
51
+ */
52
+ async preconfigure(strategiesByPath, _commitsByPath, _releasesByPath) {
53
+ return strategiesByPath;
54
+ }
55
+ }
56
+ exports.ManifestPlugin = ManifestPlugin;
57
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1,58 @@
1
+ import { CandidateReleasePullRequest } from '../manifest';
2
+ import { WorkspacePlugin, DependencyGraph } from './workspace';
3
+ import { CargoManifest } from '../updaters/rust/common';
4
+ import { VersionsMap, Version } from '../version';
5
+ import { Strategy } from '../strategy';
6
+ import { Commit } from '../commit';
7
+ import { Release } from '../release';
8
+ interface CrateInfo {
9
+ /**
10
+ * e.g. `crates/crate-a`
11
+ */
12
+ path: string;
13
+ /**
14
+ * e.g. `crate-a`
15
+ */
16
+ name: string;
17
+ /**
18
+ * e.g. `1.0.0`
19
+ */
20
+ version: string;
21
+ /**
22
+ * e.g. `crates/crate-a/Cargo.toml`
23
+ */
24
+ manifestPath: string;
25
+ /**
26
+ * text content of the manifest, used for updates
27
+ */
28
+ manifestContent: string;
29
+ /**
30
+ * Parsed cargo manifest
31
+ */
32
+ manifest: CargoManifest;
33
+ }
34
+ /**
35
+ * The plugin analyzed a cargo workspace and will bump dependencies
36
+ * of managed packages if those dependencies are being updated.
37
+ *
38
+ * If multiple rust packages are being updated, it will merge them
39
+ * into a single rust package.
40
+ */
41
+ export declare class CargoWorkspace extends WorkspacePlugin<CrateInfo> {
42
+ private strategiesByPath;
43
+ private releasesByPath;
44
+ protected buildAllPackages(candidates: CandidateReleasePullRequest[]): Promise<{
45
+ allPackages: CrateInfo[];
46
+ candidatesByPackage: Record<string, CandidateReleasePullRequest>;
47
+ }>;
48
+ protected bumpVersion(pkg: CrateInfo): Version;
49
+ protected updateCandidate(existingCandidate: CandidateReleasePullRequest, pkg: CrateInfo, updatedVersions: VersionsMap): CandidateReleasePullRequest;
50
+ protected newCandidate(pkg: CrateInfo, updatedVersions: VersionsMap): Promise<CandidateReleasePullRequest>;
51
+ protected postProcessCandidates(candidates: CandidateReleasePullRequest[], updatedVersions: VersionsMap): CandidateReleasePullRequest[];
52
+ protected buildGraph(allPackages: CrateInfo[]): Promise<DependencyGraph<CrateInfo>>;
53
+ protected inScope(candidate: CandidateReleasePullRequest): boolean;
54
+ protected packageNameFromPackage(pkg: CrateInfo): string;
55
+ protected pathFromPackage(pkg: CrateInfo): string;
56
+ preconfigure(strategiesByPath: Record<string, Strategy>, _commitsByPath: Record<string, Commit[]>, _releasesByPath: Record<string, Release>): Promise<Record<string, Strategy>>;
57
+ }
58
+ export {};
@@ -0,0 +1,339 @@
1
+ "use strict";
2
+ // Copyright 2021 Google LLC
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.CargoWorkspace = void 0;
17
+ const manifest_1 = require("../manifest");
18
+ const workspace_1 = require("./workspace");
19
+ const common_1 = require("../updaters/rust/common");
20
+ const version_1 = require("../version");
21
+ const cargo_toml_1 = require("../updaters/rust/cargo-toml");
22
+ const raw_content_1 = require("../updaters/raw-content");
23
+ const changelog_1 = require("../updaters/changelog");
24
+ const pull_request_title_1 = require("../util/pull-request-title");
25
+ const pull_request_body_1 = require("../util/pull-request-body");
26
+ const branch_name_1 = require("../util/branch-name");
27
+ const versioning_strategy_1 = require("../versioning-strategy");
28
+ const cargo_lock_1 = require("../updaters/rust/cargo-lock");
29
+ const errors_1 = require("../errors");
30
+ /**
31
+ * The plugin analyzed a cargo workspace and will bump dependencies
32
+ * of managed packages if those dependencies are being updated.
33
+ *
34
+ * If multiple rust packages are being updated, it will merge them
35
+ * into a single rust package.
36
+ */
37
+ class CargoWorkspace extends workspace_1.WorkspacePlugin {
38
+ constructor() {
39
+ super(...arguments);
40
+ this.strategiesByPath = {};
41
+ this.releasesByPath = {};
42
+ }
43
+ async buildAllPackages(candidates) {
44
+ var _a, _b, _c, _d;
45
+ const cargoManifestContent = await this.github.getFileContentsOnBranch('Cargo.toml', this.targetBranch);
46
+ const cargoManifest = (0, common_1.parseCargoManifest)(cargoManifestContent.parsedContent);
47
+ if (!((_a = cargoManifest.workspace) === null || _a === void 0 ? void 0 : _a.members)) {
48
+ this.logger.warn("cargo-workspace plugin used, but top-level Cargo.toml isn't a cargo workspace");
49
+ return { allPackages: [], candidatesByPackage: {} };
50
+ }
51
+ const allCrates = [];
52
+ const candidatesByPackage = {};
53
+ const members = (await Promise.all(cargoManifest.workspace.members.map(member => this.github.findFilesByGlobAndRef(member, this.targetBranch)))).flat();
54
+ members.push(manifest_1.ROOT_PROJECT_PATH);
55
+ for (const path of members) {
56
+ const manifestPath = (0, workspace_1.addPath)(path, 'Cargo.toml');
57
+ this.logger.info(`looking for candidate with path: ${path}`);
58
+ const candidate = candidates.find(c => c.path === path);
59
+ // get original content of the crate
60
+ const manifestContent = ((_b = candidate === null || candidate === void 0 ? void 0 : candidate.pullRequest.updates.find(update => update.path === manifestPath)) === null || _b === void 0 ? void 0 : _b.cachedFileContents) ||
61
+ (await this.github.getFileContentsOnBranch(manifestPath, this.targetBranch));
62
+ const manifest = (0, common_1.parseCargoManifest)(manifestContent.parsedContent);
63
+ const packageName = (_c = manifest.package) === null || _c === void 0 ? void 0 : _c.name;
64
+ if (!packageName) {
65
+ this.logger.warn(`package manifest at ${manifestPath} is missing [package.name]`);
66
+ continue;
67
+ }
68
+ if (candidate) {
69
+ candidatesByPackage[packageName] = candidate;
70
+ }
71
+ const version = (_d = manifest.package) === null || _d === void 0 ? void 0 : _d.version;
72
+ if (!version) {
73
+ throw new errors_1.ConfigurationError(`package manifest at ${manifestPath} is missing [package.version]`, 'cargo-workspace', `${this.github.repository.owner}/${this.github.repository.repo}`);
74
+ }
75
+ else if (typeof version !== 'string') {
76
+ throw new errors_1.ConfigurationError(`package manifest at ${manifestPath} has an invalid [package.version]`, 'cargo-workspace', `${this.github.repository.owner}/${this.github.repository.repo}`);
77
+ }
78
+ allCrates.push({
79
+ path,
80
+ name: packageName,
81
+ version,
82
+ manifest,
83
+ manifestContent: manifestContent.parsedContent,
84
+ manifestPath,
85
+ });
86
+ }
87
+ return {
88
+ allPackages: allCrates,
89
+ candidatesByPackage,
90
+ };
91
+ }
92
+ bumpVersion(pkg) {
93
+ const version = version_1.Version.parse(pkg.version);
94
+ return new versioning_strategy_1.PatchVersionUpdate().bump(version);
95
+ }
96
+ updateCandidate(existingCandidate, pkg, updatedVersions) {
97
+ const version = updatedVersions.get(pkg.name);
98
+ if (!version) {
99
+ throw new Error(`Didn't find updated version for ${pkg.name}`);
100
+ }
101
+ const updater = new cargo_toml_1.CargoToml({
102
+ version,
103
+ versionsMap: updatedVersions,
104
+ });
105
+ const updatedContent = updater.updateContent(pkg.manifestContent);
106
+ const originalManifest = (0, common_1.parseCargoManifest)(pkg.manifestContent);
107
+ const updatedManifest = (0, common_1.parseCargoManifest)(updatedContent);
108
+ const dependencyNotes = getChangelogDepsNotes(originalManifest, updatedManifest);
109
+ existingCandidate.pullRequest.updates =
110
+ existingCandidate.pullRequest.updates.map(update => {
111
+ if (update.path === (0, workspace_1.addPath)(existingCandidate.path, 'Cargo.toml')) {
112
+ update.updater = new raw_content_1.RawContent(updatedContent);
113
+ }
114
+ else if (update.updater instanceof changelog_1.Changelog && dependencyNotes) {
115
+ update.updater.changelogEntry = (0, workspace_1.appendDependenciesSectionToChangelog)(update.updater.changelogEntry, dependencyNotes, this.logger);
116
+ }
117
+ else if (update.path === (0, workspace_1.addPath)(existingCandidate.path, 'Cargo.lock')) {
118
+ update.updater = new cargo_lock_1.CargoLock(updatedVersions);
119
+ }
120
+ return update;
121
+ });
122
+ // append dependency notes
123
+ if (dependencyNotes) {
124
+ if (existingCandidate.pullRequest.body.releaseData.length > 0) {
125
+ existingCandidate.pullRequest.body.releaseData[0].notes =
126
+ (0, workspace_1.appendDependenciesSectionToChangelog)(existingCandidate.pullRequest.body.releaseData[0].notes, dependencyNotes, this.logger);
127
+ }
128
+ else {
129
+ existingCandidate.pullRequest.body.releaseData.push({
130
+ component: pkg.name,
131
+ version: existingCandidate.pullRequest.version,
132
+ notes: (0, workspace_1.appendDependenciesSectionToChangelog)('', dependencyNotes, this.logger),
133
+ });
134
+ }
135
+ }
136
+ return existingCandidate;
137
+ }
138
+ async newCandidate(pkg, updatedVersions) {
139
+ const version = updatedVersions.get(pkg.name);
140
+ if (!version) {
141
+ throw new Error(`Didn't find updated version for ${pkg.name}`);
142
+ }
143
+ const updater = new cargo_toml_1.CargoToml({
144
+ version,
145
+ versionsMap: updatedVersions,
146
+ });
147
+ const updatedContent = updater.updateContent(pkg.manifestContent);
148
+ const originalManifest = (0, common_1.parseCargoManifest)(pkg.manifestContent);
149
+ const updatedManifest = (0, common_1.parseCargoManifest)(updatedContent);
150
+ const dependencyNotes = getChangelogDepsNotes(originalManifest, updatedManifest);
151
+ const updatedPackage = {
152
+ ...pkg,
153
+ version: version.toString(),
154
+ };
155
+ const strategy = this.strategiesByPath[updatedPackage.path];
156
+ const latestRelease = this.releasesByPath[updatedPackage.path];
157
+ const basePullRequest = strategy
158
+ ? await strategy.buildReleasePullRequest([], latestRelease, false, [], {
159
+ newVersion: version,
160
+ })
161
+ : undefined;
162
+ if (basePullRequest) {
163
+ return this.updateCandidate({
164
+ path: pkg.path,
165
+ pullRequest: basePullRequest,
166
+ config: {
167
+ releaseType: 'rust',
168
+ },
169
+ }, pkg, updatedVersions);
170
+ }
171
+ const pullRequest = {
172
+ title: pull_request_title_1.PullRequestTitle.ofTargetBranch(this.targetBranch),
173
+ body: new pull_request_body_1.PullRequestBody([
174
+ {
175
+ component: pkg.name,
176
+ version,
177
+ notes: (0, workspace_1.appendDependenciesSectionToChangelog)('', dependencyNotes, this.logger),
178
+ },
179
+ ]),
180
+ updates: [
181
+ {
182
+ path: (0, workspace_1.addPath)(pkg.path, 'Cargo.toml'),
183
+ createIfMissing: false,
184
+ updater: new raw_content_1.RawContent(updatedContent),
185
+ },
186
+ {
187
+ path: (0, workspace_1.addPath)(pkg.path, 'CHANGELOG.md'),
188
+ createIfMissing: false,
189
+ updater: new changelog_1.Changelog({
190
+ version,
191
+ changelogEntry: dependencyNotes,
192
+ }),
193
+ },
194
+ ],
195
+ labels: [],
196
+ headRefName: branch_name_1.BranchName.ofTargetBranch(this.targetBranch).toString(),
197
+ version,
198
+ draft: false,
199
+ };
200
+ return {
201
+ path: pkg.path,
202
+ pullRequest,
203
+ config: {
204
+ releaseType: 'rust',
205
+ },
206
+ };
207
+ }
208
+ postProcessCandidates(candidates, updatedVersions) {
209
+ let rootCandidate = candidates.find(c => c.path === manifest_1.ROOT_PROJECT_PATH);
210
+ if (!rootCandidate) {
211
+ this.logger.warn('Unable to find root candidate pull request');
212
+ rootCandidate = candidates.find(c => c.config.releaseType === 'rust');
213
+ }
214
+ if (!rootCandidate) {
215
+ this.logger.warn('Unable to find a rust candidate pull request');
216
+ return candidates;
217
+ }
218
+ // Update the root Cargo.lock if it exists
219
+ rootCandidate.pullRequest.updates.push({
220
+ path: 'Cargo.lock',
221
+ createIfMissing: false,
222
+ updater: new cargo_lock_1.CargoLock(updatedVersions),
223
+ });
224
+ return candidates;
225
+ }
226
+ async buildGraph(allPackages) {
227
+ var _a, _b, _c, _d, _e, _f;
228
+ const workspaceCrateNames = new Set(allPackages.map(crateInfo => crateInfo.name));
229
+ const graph = new Map();
230
+ for (const crateInfo of allPackages) {
231
+ const allDeps = Object.keys({
232
+ ...((_a = crateInfo.manifest.dependencies) !== null && _a !== void 0 ? _a : {}),
233
+ ...((_b = crateInfo.manifest['dev-dependencies']) !== null && _b !== void 0 ? _b : {}),
234
+ ...((_c = crateInfo.manifest['build-dependencies']) !== null && _c !== void 0 ? _c : {}),
235
+ });
236
+ const targets = crateInfo.manifest.target;
237
+ if (targets) {
238
+ for (const targetName in targets) {
239
+ const target = targets[targetName];
240
+ allDeps.push(...Object.keys({
241
+ ...((_d = target.dependencies) !== null && _d !== void 0 ? _d : {}),
242
+ ...((_e = target['dev-dependencies']) !== null && _e !== void 0 ? _e : {}),
243
+ ...((_f = target['build-dependencies']) !== null && _f !== void 0 ? _f : {}),
244
+ }));
245
+ }
246
+ }
247
+ const workspaceDeps = allDeps.filter(dep => workspaceCrateNames.has(dep));
248
+ graph.set(crateInfo.name, {
249
+ deps: workspaceDeps,
250
+ value: crateInfo,
251
+ });
252
+ }
253
+ return graph;
254
+ }
255
+ inScope(candidate) {
256
+ return candidate.config.releaseType === 'rust';
257
+ }
258
+ packageNameFromPackage(pkg) {
259
+ return pkg.name;
260
+ }
261
+ pathFromPackage(pkg) {
262
+ return pkg.path;
263
+ }
264
+ async preconfigure(strategiesByPath, _commitsByPath, _releasesByPath) {
265
+ // Using preconfigure to siphon releases and strategies.
266
+ this.strategiesByPath = strategiesByPath;
267
+ this.releasesByPath = _releasesByPath;
268
+ return strategiesByPath;
269
+ }
270
+ }
271
+ exports.CargoWorkspace = CargoWorkspace;
272
+ function getChangelogDepsNotes(originalManifest, updatedManifest) {
273
+ let depUpdateNotes = '';
274
+ const depTypes = [
275
+ 'dependencies',
276
+ 'dev-dependencies',
277
+ 'build-dependencies',
278
+ ];
279
+ const depVer = (s) => {
280
+ if (s === undefined) {
281
+ return undefined;
282
+ }
283
+ if (typeof s === 'string') {
284
+ return s;
285
+ }
286
+ else {
287
+ return s.version;
288
+ }
289
+ };
290
+ const getDepMap = (cargoDeps) => {
291
+ const result = {};
292
+ for (const [key, val] of Object.entries(cargoDeps)) {
293
+ const ver = depVer(val);
294
+ if (ver) {
295
+ result[key] = ver;
296
+ }
297
+ }
298
+ return result;
299
+ };
300
+ const populateUpdates = (originalScope, updatedScope, updates) => {
301
+ var _a;
302
+ for (const depType of depTypes) {
303
+ const depUpdates = [];
304
+ const pkgDepTypes = updatedScope[depType];
305
+ if (pkgDepTypes === undefined) {
306
+ continue;
307
+ }
308
+ for (const [depName, currentDepVer] of Object.entries(getDepMap(pkgDepTypes))) {
309
+ const origDepVer = depVer((_a = originalScope[depType]) === null || _a === void 0 ? void 0 : _a[depName]);
310
+ if (currentDepVer !== origDepVer) {
311
+ depUpdates.push(`\n * ${depName} bumped from ${origDepVer} to ${currentDepVer}`);
312
+ }
313
+ }
314
+ if (depUpdates.length > 0) {
315
+ const updatesForType = updates.get(depType) || new Set();
316
+ depUpdates.forEach(update => updatesForType.add(update));
317
+ updates.set(depType, updatesForType);
318
+ }
319
+ }
320
+ };
321
+ const updates = new Map();
322
+ populateUpdates(originalManifest, updatedManifest, updates);
323
+ if (updatedManifest.target && originalManifest.target) {
324
+ for (const targetName in updatedManifest.target) {
325
+ populateUpdates(originalManifest.target[targetName], updatedManifest.target[targetName], updates);
326
+ }
327
+ }
328
+ for (const [dt, notes] of updates) {
329
+ depUpdateNotes += `\n * ${dt}`;
330
+ for (const note of notes) {
331
+ depUpdateNotes += note;
332
+ }
333
+ }
334
+ if (depUpdateNotes) {
335
+ return `* The following workspace dependencies were updated${depUpdateNotes}`;
336
+ }
337
+ return '';
338
+ }
339
+ //# sourceMappingURL=cargo-workspace.js.map
@@ -0,0 +1,29 @@
1
+ import { ManifestPlugin } from '../plugin';
2
+ import { Scm } from '../scm';
3
+ import { RepositoryConfig, CandidateReleasePullRequest } from '../manifest';
4
+ /**
5
+ * This plugin allows configuring a priority of release groups. For example, you could
6
+ * prioritize Java snapshot pull requests over other releases.
7
+ */
8
+ export declare class GroupPriority extends ManifestPlugin {
9
+ readonly groups: string[];
10
+ /**
11
+ * Instantiate a new GroupPriority plugin.
12
+ *
13
+ * @param {GitHub} github GitHub client
14
+ * @param {string} targetBranch Release branch
15
+ * @param {RepositoryConfig} repositoryConfig Parsed configuration for the entire
16
+ * repository. This allows plugins to know how components interact.
17
+ * @param {string[]} groups List of group names ordered with highest priority first
18
+ */
19
+ constructor(github: Scm, targetBranch: string, repositoryConfig: RepositoryConfig, groups: string[]);
20
+ /**
21
+ * Group candidate release PRs by grouping and check our list of preferred
22
+ * groups in order. If a preferred group is found, only return pull requests for
23
+ * that group.
24
+ * @param {CandidateReleasePullRequest[]} pullRequests Candidate pull requests
25
+ * @returns {CandidateReleasePullRequest[]} Possibly a subset of the candidate
26
+ * pull requests if a preferred group is found.
27
+ */
28
+ run(pullRequests: CandidateReleasePullRequest[]): Promise<CandidateReleasePullRequest[]>;
29
+ }
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ // Copyright 2022 Google LLC
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.GroupPriority = void 0;
17
+ const plugin_1 = require("../plugin");
18
+ /**
19
+ * This plugin allows configuring a priority of release groups. For example, you could
20
+ * prioritize Java snapshot pull requests over other releases.
21
+ */
22
+ class GroupPriority extends plugin_1.ManifestPlugin {
23
+ /**
24
+ * Instantiate a new GroupPriority plugin.
25
+ *
26
+ * @param {GitHub} github GitHub client
27
+ * @param {string} targetBranch Release branch
28
+ * @param {RepositoryConfig} repositoryConfig Parsed configuration for the entire
29
+ * repository. This allows plugins to know how components interact.
30
+ * @param {string[]} groups List of group names ordered with highest priority first
31
+ */
32
+ constructor(github, targetBranch, repositoryConfig, groups) {
33
+ super(github, targetBranch, repositoryConfig);
34
+ this.groups = groups;
35
+ }
36
+ /**
37
+ * Group candidate release PRs by grouping and check our list of preferred
38
+ * groups in order. If a preferred group is found, only return pull requests for
39
+ * that group.
40
+ * @param {CandidateReleasePullRequest[]} pullRequests Candidate pull requests
41
+ * @returns {CandidateReleasePullRequest[]} Possibly a subset of the candidate
42
+ * pull requests if a preferred group is found.
43
+ */
44
+ async run(pullRequests) {
45
+ this.logger.debug(`Group priority plugin running with groups: ${this.groups}`);
46
+ const groupedCandidates = groupCandidatesByType(pullRequests);
47
+ for (const group of this.groups) {
48
+ this.logger.debug(`Considering group: ${group}`);
49
+ const groupCandidates = groupedCandidates.get(group);
50
+ if (groupCandidates) {
51
+ this.logger.debug(`Found preferred group: ${group} with ${groupCandidates.length} candidate pull requests`);
52
+ return groupCandidates;
53
+ }
54
+ }
55
+ // fallback to returning all candidates
56
+ this.logger.debug('No preferred group found, returning full set.');
57
+ return pullRequests;
58
+ }
59
+ }
60
+ exports.GroupPriority = GroupPriority;
61
+ /**
62
+ * Helper to group candidates by their `type` field.
63
+ * @param {CandidateReleasePullRequest[]} inScopeCandidates The candidates to group.
64
+ * @returns {Map<string|undefined, CandidateReleasePullRequest[]>} The grouped
65
+ * pull requests.
66
+ */
67
+ function groupCandidatesByType(inScopeCandidates) {
68
+ const groupedCandidates = new Map();
69
+ for (const candidatePullRequest of inScopeCandidates) {
70
+ const candidates = groupedCandidates.get(candidatePullRequest.pullRequest.group);
71
+ if (candidates) {
72
+ candidates.push(candidatePullRequest);
73
+ }
74
+ else {
75
+ groupedCandidates.set(candidatePullRequest.pullRequest.group, [
76
+ candidatePullRequest,
77
+ ]);
78
+ }
79
+ }
80
+ return groupedCandidates;
81
+ }
82
+ //# sourceMappingURL=group-priority.js.map
@@ -0,0 +1,36 @@
1
+ import { ManifestPlugin } from '../plugin';
2
+ import { RepositoryConfig, CandidateReleasePullRequest } from '../manifest';
3
+ import { Scm } from '../scm';
4
+ import { Logger } from '../util/logger';
5
+ import { Strategy } from '../strategy';
6
+ import { Commit } from '../commit';
7
+ import { Release } from '../release';
8
+ interface LinkedVersionsPluginOptions {
9
+ merge?: boolean;
10
+ logger?: Logger;
11
+ }
12
+ /**
13
+ * This plugin reconfigures strategies by linking multiple components
14
+ * together.
15
+ *
16
+ * Release notes are broken up using `<summary>`/`<details>` blocks.
17
+ */
18
+ export declare class LinkedVersions extends ManifestPlugin {
19
+ readonly groupName: string;
20
+ readonly components: Set<string>;
21
+ readonly merge: boolean;
22
+ constructor(github: Scm, targetBranch: string, repositoryConfig: RepositoryConfig, groupName: string, components: string[], options?: LinkedVersionsPluginOptions);
23
+ /**
24
+ * Pre-configure strategies.
25
+ * @param {Record<string, Strategy>} strategiesByPath Strategies indexed by path
26
+ * @returns {Record<string, Strategy>} Updated strategies indexed by path
27
+ */
28
+ preconfigure(strategiesByPath: Record<string, Strategy>, commitsByPath: Record<string, Commit[]>, releasesByPath: Record<string, Release>): Promise<Record<string, Strategy>>;
29
+ /**
30
+ * Post-process candidate pull requests.
31
+ * @param {CandidateReleasePullRequest[]} pullRequests Candidate pull requests
32
+ * @returns {CandidateReleasePullRequest[]} Updated pull requests
33
+ */
34
+ run(candidates: CandidateReleasePullRequest[]): Promise<CandidateReleasePullRequest[]>;
35
+ }
36
+ export {};