@release-please-oss/release-please 0.0.0 → 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 +280 -0
  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 +113 -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,94 @@
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.getPluginTypes = exports.unregisterPlugin = exports.registerPlugin = exports.buildPlugin = void 0;
17
+ const linked_versions_1 = require("../plugins/linked-versions");
18
+ const cargo_workspace_1 = require("../plugins/cargo-workspace");
19
+ const node_workspace_1 = require("../plugins/node-workspace");
20
+ const maven_workspace_1 = require("../plugins/maven-workspace");
21
+ const errors_1 = require("../errors");
22
+ const sentence_case_1 = require("../plugins/sentence-case");
23
+ const group_priority_1 = require("../plugins/group-priority");
24
+ const pluginFactories = {
25
+ 'linked-versions': options =>
26
+ // NOTE: linked-versions had already have a different behavior about merging
27
+ // see test/plugins/compatibility/linked-versions-workspace.ts
28
+ new linked_versions_1.LinkedVersions(options.github, options.targetBranch, options.repositoryConfig, options.type.groupName, options.type.components, {
29
+ ...options,
30
+ ...options.type,
31
+ }),
32
+ 'cargo-workspace': options => {
33
+ var _a;
34
+ return new cargo_workspace_1.CargoWorkspace(options.github, options.targetBranch, options.repositoryConfig, {
35
+ ...options,
36
+ ...options.type,
37
+ merge: (_a = options.type.merge) !== null && _a !== void 0 ? _a : !options.separatePullRequests,
38
+ });
39
+ },
40
+ 'node-workspace': options => {
41
+ var _a;
42
+ return new node_workspace_1.NodeWorkspace(options.github, options.targetBranch, options.repositoryConfig, {
43
+ ...options,
44
+ ...options.type,
45
+ merge: (_a = options.type.merge) !== null && _a !== void 0 ? _a : !options.separatePullRequests,
46
+ });
47
+ },
48
+ 'maven-workspace': options => {
49
+ var _a;
50
+ return new maven_workspace_1.MavenWorkspace(options.github, options.targetBranch, options.repositoryConfig, {
51
+ ...options,
52
+ ...options.type,
53
+ merge: (_a = options.type.merge) !== null && _a !== void 0 ? _a : !options.separatePullRequests,
54
+ });
55
+ },
56
+ 'sentence-case': options => new sentence_case_1.SentenceCase(options.github, options.targetBranch, options.repositoryConfig, options.type.specialWords),
57
+ 'group-priority': options => new group_priority_1.GroupPriority(options.github, options.targetBranch, options.repositoryConfig, options.type.groups),
58
+ };
59
+ function buildPlugin(options) {
60
+ if (!options.separatePullRequests) {
61
+ options.separatePullRequests = false;
62
+ }
63
+ if (typeof options.type === 'object') {
64
+ const builder = pluginFactories[options.type.type];
65
+ if (builder) {
66
+ return builder({
67
+ ...options.type,
68
+ ...options,
69
+ });
70
+ }
71
+ throw new errors_1.ConfigurationError(`Unknown plugin type: ${options.type.type}`, 'core', `${options.github.repository.owner}/${options.github.repository.repo}`);
72
+ }
73
+ else {
74
+ const builder = pluginFactories[options.type];
75
+ if (builder) {
76
+ return builder(options);
77
+ }
78
+ throw new errors_1.ConfigurationError(`Unknown plugin type: ${options.type}`, 'core', `${options.github.repository.owner}/${options.github.repository.repo}`);
79
+ }
80
+ }
81
+ exports.buildPlugin = buildPlugin;
82
+ function registerPlugin(name, pluginBuilder) {
83
+ pluginFactories[name] = pluginBuilder;
84
+ }
85
+ exports.registerPlugin = registerPlugin;
86
+ function unregisterPlugin(name) {
87
+ delete pluginFactories[name];
88
+ }
89
+ exports.unregisterPlugin = unregisterPlugin;
90
+ function getPluginTypes() {
91
+ return Object.keys(pluginFactories).sort();
92
+ }
93
+ exports.getPluginTypes = getPluginTypes;
94
+ //# sourceMappingURL=plugin-factory.js.map
@@ -0,0 +1,16 @@
1
+ import { VersioningStrategy } from '../versioning-strategy';
2
+ import { Scm } from '../scm';
3
+ export type VersioningStrategyType = string;
4
+ export interface VersioningStrategyFactoryOptions {
5
+ type?: VersioningStrategyType;
6
+ bumpMinorPreMajor?: boolean;
7
+ bumpPatchForMinorPreMajor?: boolean;
8
+ prereleaseType?: string;
9
+ prerelease?: boolean;
10
+ github: Scm;
11
+ }
12
+ export type VersioningStrategyBuilder = (options: VersioningStrategyFactoryOptions) => VersioningStrategy;
13
+ export declare function buildVersioningStrategy(options: VersioningStrategyFactoryOptions): VersioningStrategy;
14
+ export declare function registerVersioningStrategy(name: string, versioningStrategyBuilder: VersioningStrategyBuilder): void;
15
+ export declare function unregisterVersioningStrategy(name: string): void;
16
+ export declare function getVersioningStrategyTypes(): readonly VersioningStrategyType[];
@@ -0,0 +1,52 @@
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.getVersioningStrategyTypes = exports.unregisterVersioningStrategy = exports.registerVersioningStrategy = exports.buildVersioningStrategy = void 0;
17
+ const default_1 = require("../versioning-strategies/default");
18
+ const always_bump_patch_1 = require("../versioning-strategies/always-bump-patch");
19
+ const always_bump_minor_1 = require("../versioning-strategies/always-bump-minor");
20
+ const always_bump_major_1 = require("../versioning-strategies/always-bump-major");
21
+ const service_pack_1 = require("../versioning-strategies/service-pack");
22
+ const errors_1 = require("../errors");
23
+ const prerelease_1 = require("../versioning-strategies/prerelease");
24
+ const versioningTypes = {
25
+ default: options => new default_1.DefaultVersioningStrategy(options),
26
+ 'always-bump-patch': options => new always_bump_patch_1.AlwaysBumpPatch(options),
27
+ 'always-bump-minor': options => new always_bump_minor_1.AlwaysBumpMinor(options),
28
+ 'always-bump-major': options => new always_bump_major_1.AlwaysBumpMajor(options),
29
+ 'service-pack': options => new service_pack_1.ServicePackVersioningStrategy(options),
30
+ prerelease: options => new prerelease_1.PrereleaseVersioningStrategy(options),
31
+ };
32
+ function buildVersioningStrategy(options) {
33
+ const builder = versioningTypes[options.type || 'default'];
34
+ if (builder) {
35
+ return builder(options);
36
+ }
37
+ throw new errors_1.ConfigurationError(`Unknown versioning strategy type: ${options.type}`, 'core', `${options.github.repository.owner}/${options.github.repository.repo}`);
38
+ }
39
+ exports.buildVersioningStrategy = buildVersioningStrategy;
40
+ function registerVersioningStrategy(name, versioningStrategyBuilder) {
41
+ versioningTypes[name] = versioningStrategyBuilder;
42
+ }
43
+ exports.registerVersioningStrategy = registerVersioningStrategy;
44
+ function unregisterVersioningStrategy(name) {
45
+ delete versioningTypes[name];
46
+ }
47
+ exports.unregisterVersioningStrategy = unregisterVersioningStrategy;
48
+ function getVersioningStrategyTypes() {
49
+ return Object.keys(versioningTypes).sort();
50
+ }
51
+ exports.getVersioningStrategyTypes = getVersioningStrategyTypes;
52
+ //# sourceMappingURL=versioning-strategy-factory.js.map
@@ -0,0 +1,18 @@
1
+ import { Scm } from './scm';
2
+ import { ReleaserConfig } from './manifest';
3
+ import { BaseStrategyOptions } from './strategies/base';
4
+ import { Strategy } from './strategy';
5
+ export * from './factories/changelog-notes-factory';
6
+ export * from './factories/plugin-factory';
7
+ export * from './factories/versioning-strategy-factory';
8
+ export type ReleaseType = string;
9
+ export type ReleaseBuilder = (options: BaseStrategyOptions) => Strategy;
10
+ export interface StrategyFactoryOptions extends ReleaserConfig {
11
+ github: Scm;
12
+ path?: string;
13
+ targetBranch?: string;
14
+ }
15
+ export declare function buildStrategy(options: StrategyFactoryOptions): Promise<Strategy>;
16
+ export declare function registerReleaseType(name: string, strategyBuilder: ReleaseBuilder): void;
17
+ export declare function unregisterReleaseType(name: string): void;
18
+ export declare function getReleaserTypes(): readonly ReleaseType[];
@@ -0,0 +1,161 @@
1
+ "use strict";
2
+ // Copyright 2019 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
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16
+ if (k2 === undefined) k2 = k;
17
+ var desc = Object.getOwnPropertyDescriptor(m, k);
18
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
19
+ desc = { enumerable: true, get: function() { return m[k]; } };
20
+ }
21
+ Object.defineProperty(o, k2, desc);
22
+ }) : (function(o, m, k, k2) {
23
+ if (k2 === undefined) k2 = k;
24
+ o[k2] = m[k];
25
+ }));
26
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
27
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
28
+ };
29
+ Object.defineProperty(exports, "__esModule", { value: true });
30
+ exports.getReleaserTypes = exports.unregisterReleaseType = exports.registerReleaseType = exports.buildStrategy = void 0;
31
+ const errors_1 = require("./errors");
32
+ const changelog_notes_factory_1 = require("./factories/changelog-notes-factory");
33
+ const versioning_strategy_factory_1 = require("./factories/versioning-strategy-factory");
34
+ const bazel_1 = require("./strategies/bazel");
35
+ const dart_1 = require("./strategies/dart");
36
+ const dotnet_yoshi_1 = require("./strategies/dotnet-yoshi");
37
+ const elixir_1 = require("./strategies/elixir");
38
+ const expo_1 = require("./strategies/expo");
39
+ const go_1 = require("./strategies/go");
40
+ const go_yoshi_1 = require("./strategies/go-yoshi");
41
+ const go_librarian_1 = require("./strategies/go-librarian");
42
+ const helm_1 = require("./strategies/helm");
43
+ const java_1 = require("./strategies/java");
44
+ const java_yoshi_1 = require("./strategies/java-yoshi");
45
+ const java_yoshi_mono_repo_1 = require("./strategies/java-yoshi-mono-repo");
46
+ const krm_blueprint_1 = require("./strategies/krm-blueprint");
47
+ const maven_1 = require("./strategies/maven");
48
+ const node_1 = require("./strategies/node");
49
+ const node_librarian_1 = require("./strategies/node-librarian");
50
+ const ocaml_1 = require("./strategies/ocaml");
51
+ const php_1 = require("./strategies/php");
52
+ const php_yoshi_1 = require("./strategies/php-yoshi");
53
+ const php_librarian_1 = require("./strategies/php-librarian");
54
+ const python_1 = require("./strategies/python");
55
+ const python_librarian_1 = require("./strategies/python-librarian");
56
+ const r_1 = require("./strategies/r");
57
+ const ruby_1 = require("./strategies/ruby");
58
+ const ruby_yoshi_1 = require("./strategies/ruby-yoshi");
59
+ const ruby_librarian_1 = require("./strategies/ruby-librarian");
60
+ const rust_1 = require("./strategies/rust");
61
+ const sfdx_1 = require("./strategies/sfdx");
62
+ const simple_1 = require("./strategies/simple");
63
+ const terraform_module_1 = require("./strategies/terraform-module");
64
+ const always_bump_patch_1 = require("./versioning-strategies/always-bump-patch");
65
+ const dependency_manifest_1 = require("./versioning-strategies/dependency-manifest");
66
+ const service_pack_1 = require("./versioning-strategies/service-pack");
67
+ __exportStar(require("./factories/changelog-notes-factory"), exports);
68
+ __exportStar(require("./factories/plugin-factory"), exports);
69
+ __exportStar(require("./factories/versioning-strategy-factory"), exports);
70
+ const releasers = {
71
+ 'dotnet-yoshi': options => new dotnet_yoshi_1.DotnetYoshi(options),
72
+ go: options => new go_1.Go(options),
73
+ 'go-yoshi': options => new go_yoshi_1.GoYoshi(options),
74
+ 'go-librarian': options => new go_librarian_1.GoLibrarian(options),
75
+ java: options => new java_1.Java(options),
76
+ maven: options => new maven_1.Maven(options),
77
+ 'java-yoshi': options => new java_yoshi_1.JavaYoshi(options),
78
+ 'java-yoshi-mono-repo': options => new java_yoshi_mono_repo_1.JavaYoshiMonoRepo(options),
79
+ 'java-backport': options => new java_yoshi_1.JavaYoshi({
80
+ ...options,
81
+ versioningStrategy: new always_bump_patch_1.AlwaysBumpPatch(),
82
+ }),
83
+ 'java-bom': options => new java_yoshi_1.JavaYoshi({
84
+ ...options,
85
+ versioningStrategy: new dependency_manifest_1.DependencyManifest({
86
+ bumpMinorPreMajor: options.bumpMinorPreMajor,
87
+ bumpPatchForMinorPreMajor: options.bumpPatchForMinorPreMajor,
88
+ }),
89
+ }),
90
+ 'java-lts': options => new java_yoshi_1.JavaYoshi({
91
+ ...options,
92
+ versioningStrategy: new service_pack_1.ServicePackVersioningStrategy(),
93
+ }),
94
+ 'krm-blueprint': options => new krm_blueprint_1.KRMBlueprint(options),
95
+ node: options => new node_1.Node(options),
96
+ 'node-librarian': options => new node_librarian_1.NodeLibrarian(options),
97
+ expo: options => new expo_1.Expo(options),
98
+ ocaml: options => new ocaml_1.OCaml(options),
99
+ php: options => new php_1.PHP(options),
100
+ 'php-yoshi': options => new php_yoshi_1.PHPYoshi(options),
101
+ 'php-librarian': options => new php_librarian_1.PHPLibrarian(options),
102
+ python: options => new python_1.Python(options),
103
+ 'python-librarian': options => new python_librarian_1.PythonLibrarian(options),
104
+ r: options => new r_1.R(options),
105
+ ruby: options => new ruby_1.Ruby(options),
106
+ 'ruby-yoshi': options => new ruby_yoshi_1.RubyYoshi(options),
107
+ 'ruby-librarian': options => new ruby_librarian_1.RubyLibrarian(options),
108
+ rust: options => new rust_1.Rust(options),
109
+ salesforce: options => new sfdx_1.Sfdx(options),
110
+ sfdx: options => new sfdx_1.Sfdx(options),
111
+ simple: options => new simple_1.Simple(options),
112
+ 'terraform-module': options => new terraform_module_1.TerraformModule(options),
113
+ helm: options => new helm_1.Helm(options),
114
+ elixir: options => new elixir_1.Elixir(options),
115
+ dart: options => new dart_1.Dart(options),
116
+ bazel: options => new bazel_1.Bazel(options),
117
+ };
118
+ async function buildStrategy(options) {
119
+ var _a;
120
+ const targetBranch = (_a = options.targetBranch) !== null && _a !== void 0 ? _a : options.github.repository.defaultBranch;
121
+ const versioningStrategy = (0, versioning_strategy_factory_1.buildVersioningStrategy)({
122
+ github: options.github,
123
+ type: options.versioning,
124
+ bumpMinorPreMajor: options.bumpMinorPreMajor,
125
+ bumpPatchForMinorPreMajor: options.bumpPatchForMinorPreMajor,
126
+ prereleaseType: options.prereleaseType,
127
+ prerelease: options.prerelease,
128
+ });
129
+ const changelogNotes = (0, changelog_notes_factory_1.buildChangelogNotes)({
130
+ type: options.changelogType || 'default',
131
+ github: options.github,
132
+ changelogSections: options.changelogSections,
133
+ });
134
+ const strategyOptions = {
135
+ skipGitHubRelease: options.skipGithubRelease,
136
+ skipChangelog: options.skipChangelog,
137
+ ...options,
138
+ targetBranch,
139
+ versioningStrategy,
140
+ changelogNotes,
141
+ };
142
+ const builder = releasers[options.releaseType];
143
+ if (builder) {
144
+ return builder(strategyOptions);
145
+ }
146
+ throw new errors_1.ConfigurationError(`Unknown release type: ${options.releaseType}`, 'core', `${options.github.repository.owner}/${options.github.repository.repo}`);
147
+ }
148
+ exports.buildStrategy = buildStrategy;
149
+ function registerReleaseType(name, strategyBuilder) {
150
+ releasers[name] = strategyBuilder;
151
+ }
152
+ exports.registerReleaseType = registerReleaseType;
153
+ function unregisterReleaseType(name) {
154
+ delete releasers[name];
155
+ }
156
+ exports.unregisterReleaseType = unregisterReleaseType;
157
+ function getReleaserTypes() {
158
+ return Object.keys(releasers).sort();
159
+ }
160
+ exports.getReleaserTypes = getReleaserTypes;
161
+ //# sourceMappingURL=factory.js.map
@@ -0,0 +1,260 @@
1
+ import { Octokit } from '@octokit/rest';
2
+ import { request } from '@octokit/request';
3
+ import { Logger } from './util/code-suggester/types';
4
+ import { PullRequest } from './pull-request';
5
+ import { Repository } from './repository';
6
+ import { Release } from './release';
7
+ import { ScmRelease, ScmReleaseIteratorOptions, ScmReleaseOptions, ScmCommitIteratorOptions } from './scm';
8
+ import { HttpsProxyAgent } from 'https-proxy-agent';
9
+ import { HttpProxyAgent } from 'http-proxy-agent';
10
+ export declare const GH_API_URL = "https://api.github.com";
11
+ export declare const GH_GRAPHQL_URL = "https://api.github.com";
12
+ export type OctokitType = InstanceType<typeof Octokit>;
13
+ type RequestBuilderType = typeof request;
14
+ type DefaultFunctionType = RequestBuilderType['defaults'];
15
+ type RequestFunctionType = ReturnType<DefaultFunctionType>;
16
+ export interface OctokitAPIs {
17
+ graphql: Function;
18
+ request: RequestFunctionType;
19
+ octokit: OctokitType;
20
+ }
21
+ export interface ProxyOption {
22
+ host: string;
23
+ port: number;
24
+ }
25
+ export interface GitHubCreateOptions {
26
+ owner: string;
27
+ repo: string;
28
+ defaultBranch?: string;
29
+ apiUrl?: string;
30
+ graphqlUrl?: string;
31
+ octokitAPIs?: OctokitAPIs;
32
+ token?: string;
33
+ logger?: Logger;
34
+ proxy?: ProxyOption;
35
+ fetch?: any;
36
+ }
37
+ export interface GitHubApiOptions {
38
+ repository: Repository;
39
+ octokitAPIs: OctokitAPIs;
40
+ logger?: Logger;
41
+ }
42
+ export interface GraphQLCommit {
43
+ sha: string;
44
+ message: string;
45
+ associatedPullRequests: {
46
+ nodes: GraphQLPullRequest[];
47
+ };
48
+ }
49
+ export interface GraphQLPullRequest {
50
+ number: number;
51
+ title: string;
52
+ body: string;
53
+ baseRefName: string;
54
+ headRefName: string;
55
+ labels: {
56
+ nodes: {
57
+ name: string;
58
+ }[];
59
+ };
60
+ mergeCommit?: {
61
+ oid: string;
62
+ };
63
+ files: {
64
+ nodes: {
65
+ path: string;
66
+ }[];
67
+ pageInfo: {
68
+ hasNextPage: boolean;
69
+ };
70
+ };
71
+ }
72
+ export interface PullRequestHistory {
73
+ pageInfo: {
74
+ hasNextPage: boolean;
75
+ endCursor: string | undefined;
76
+ };
77
+ data: PullRequest[];
78
+ }
79
+ export interface CommitHistory {
80
+ pageInfo: {
81
+ hasNextPage: boolean;
82
+ endCursor: string | undefined;
83
+ };
84
+ data: ScmRelease[];
85
+ }
86
+ export type CommitIteratorOptions = ScmCommitIteratorOptions;
87
+ export interface GraphQLRelease {
88
+ name: string;
89
+ tag: {
90
+ name: string;
91
+ };
92
+ tagCommit: {
93
+ oid: string;
94
+ };
95
+ url: string;
96
+ description: string;
97
+ isDraft: boolean;
98
+ }
99
+ export interface ReleaseHistory {
100
+ pageInfo: {
101
+ hasNextPage: boolean;
102
+ endCursor: string | undefined;
103
+ };
104
+ data: ScmRelease[];
105
+ }
106
+ export type ReleaseIteratorOptions = ScmReleaseIteratorOptions;
107
+ export declare const MAX_SLEEP_SECONDS = 20;
108
+ export declare const MAX_ISSUE_BODY_SIZE = 65536;
109
+ export declare class GitHubApi {
110
+ readonly repository: Repository;
111
+ readonly octokitAPIs: OctokitAPIs;
112
+ octokit: OctokitType;
113
+ private graphql;
114
+ private logger;
115
+ constructor(options: GitHubApiOptions);
116
+ static createDefaultAgent(baseUrl: string, defaultProxy?: ProxyOption): HttpProxyAgent<`http://${string}:${number}`> | HttpsProxyAgent<`https://${string}:${number}`> | undefined;
117
+ static create(options: GitHubCreateOptions): Promise<GitHubApi>;
118
+ static defaultBranch(owner: string, repo: string, octokit: OctokitType): Promise<string>;
119
+ private graphqlRequest;
120
+ /**
121
+ * Iterate through merged pull requests with a max number of results scanned.
122
+ *
123
+ * @param {string} targetBranch Target branch of commit.
124
+ * @param {string} status The status of the pull request. Defaults to 'MERGED'.
125
+ * @param {number} maxResults Limit the number of results searched. Defaults to
126
+ * unlimited.
127
+ * @param {boolean} includeFiles Whether to fetch the list of files included in
128
+ * the pull request. Defaults to `true`.
129
+ * @yields {PullRequest}
130
+ * @throws {GitHubAPIError} on an API error
131
+ */
132
+ pullRequestIterator(targetBranch: string, status?: 'OPEN' | 'CLOSED' | 'MERGED', maxResults?: number, includeFiles?: boolean): AsyncGenerator<PullRequest, void, void>;
133
+ /**
134
+ * Helper implementation of pullRequestIterator that includes files via
135
+ * the graphQL API.
136
+ *
137
+ * @param {string} targetBranch The base branch of the pull request
138
+ * @param {string} status The status of the pull request
139
+ * @param {number} maxResults Limit the number of results searched
140
+ */
141
+ private pullRequestIteratorWithFiles;
142
+ /**
143
+ * Helper implementation of pullRequestIterator that excludes files
144
+ * via the REST API.
145
+ *
146
+ * @param {string} targetBranch The base branch of the pull request
147
+ * @param {string} status The status of the pull request
148
+ * @param {number} maxResults Limit the number of results searched
149
+ */
150
+ private pullRequestIteratorWithoutFiles;
151
+ /**
152
+ * Return a list of merged pull requests. The list is not guaranteed to be sorted
153
+ * by merged_at, but is generally most recent first.
154
+ *
155
+ * @param {string} targetBranch - Base branch of the pull request. Defaults to
156
+ * the configured default branch.
157
+ * @param {number} page - Page of results. Defaults to 1.
158
+ * @param {number} perPage - Number of results per page. Defaults to 100.
159
+ * @returns {PullRequestHistory | null} - List of merged pull requests
160
+ * @throws {GitHubAPIError} on an API error
161
+ */
162
+ private pullRequestsGraphQL;
163
+ /**
164
+ * Iterate through releases with a max number of results scanned.
165
+ *
166
+ * @param {ReleaseIteratorOptions} options Query options
167
+ * @param {number} options.maxResults Limit the number of results scanned.
168
+ * Defaults to unlimited.
169
+ * @yields {ScmRelease}
170
+ * @throws {GitHubAPIError} on an API error
171
+ */
172
+ releaseIterator(options?: ReleaseIteratorOptions): AsyncGenerator<ScmRelease, void, unknown>;
173
+ private releaseGraphQL;
174
+ createPullRequest: (pullRequest: PullRequest, targetBranch: string, options?: {
175
+ draft?: boolean | undefined;
176
+ } | undefined) => Promise<PullRequest>;
177
+ /**
178
+ * Fetch a pull request given the pull number
179
+ * @param {number} number The pull request number
180
+ * @returns {PullRequest}
181
+ */
182
+ getPullRequest: (number: number) => Promise<PullRequest>;
183
+ updatePullRequest: (number: number, title: string, body: string) => Promise<{
184
+ headBranchName: string;
185
+ baseBranchName: string;
186
+ number: number;
187
+ title: string;
188
+ body: string;
189
+ files: never[];
190
+ labels: string[];
191
+ }>;
192
+ /**
193
+ * Create a GitHub release
194
+ *
195
+ * @param {Release} release Release parameters
196
+ * @param {ScmReleaseOptions} options Release option parameters
197
+ * @throws {DuplicateReleaseError} if the release tag already exists
198
+ * @throws {GitHubAPIError} on other API errors
199
+ */
200
+ createRelease: (release: Release, options?: ScmReleaseOptions | undefined) => Promise<ScmRelease>;
201
+ /**
202
+ * Makes a comment on a issue/pull request.
203
+ *
204
+ * @param {string} comment - The body of the comment to post.
205
+ * @param {number} number - The issue or pull request number.
206
+ * @throws {GitHubAPIError} on an API error
207
+ */
208
+ commentOnIssue: (comment: string, number: number) => Promise<string>;
209
+ /**
210
+ * Removes labels from an issue/pull request.
211
+ *
212
+ * @param {string[]} labels The labels to remove.
213
+ * @param {number} number The issue/pull request number.
214
+ */
215
+ removeIssueLabels: (labels: string[], number: number) => Promise<void>;
216
+ /**
217
+ * Adds label to an issue/pull request.
218
+ *
219
+ * @param {string[]} labels The labels to add.
220
+ * @param {number} number The issue/pull request number.
221
+ */
222
+ addIssueLabels: (labels: string[], number: number) => Promise<void>;
223
+ /**
224
+ * Generate release notes from GitHub at tag
225
+ * @param {string} tagName Name of new release tag
226
+ * @param {string} targetCommitish Target commitish for new tag
227
+ * @param {string} previousTag Optional. Name of previous tag to analyze commits since
228
+ */
229
+ generateReleaseNotes(tagName: string, targetCommitish: string, previousTag?: string): Promise<string>;
230
+ /**
231
+ * Create a single file on a new branch based on an existing
232
+ * branch. This will force-push to that branch.
233
+ * @param {string} filename Filename with path in the repository
234
+ * @param {string} contents Contents of the file
235
+ * @param {string} newBranchName Name of the new branch
236
+ * @param {string} baseBranchName Name of the base branch (where
237
+ * new branch is forked from)
238
+ * @returns {string} HTML URL of the new file
239
+ */
240
+ createFileOnNewBranch(filename: string, contents: string, newBranchName: string, baseBranchName: string): Promise<string>;
241
+ /**
242
+ * Fork a branch from a base branch.
243
+ */
244
+ private forkBranch;
245
+ /**
246
+ * Helper to fetch the SHA of a branch
247
+ */
248
+ private getBranchSha;
249
+ /**
250
+ * Helper to create a new branch from a given SHA.
251
+ */
252
+ private createNewBranch;
253
+ /**
254
+ * Helper to update branch SHA.
255
+ */
256
+ private updateBranchSha;
257
+ }
258
+ export declare const wrapAsync: <T extends any[], V>(fn: (...args: T) => Promise<V>, errorHandler?: ((e: Error) => void) | undefined) => (...args: T) => Promise<V>;
259
+ export declare const sleepInMs: (ms: number) => Promise<unknown>;
260
+ export {};