release-please 12.5.0 → 13.0.0-candidate.2

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 (253) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +4 -0
  3. package/build/src/bin/release-please.d.ts +55 -11
  4. package/build/src/bin/release-please.js +419 -152
  5. package/build/src/bootstrapper.d.ts +12 -0
  6. package/build/src/bootstrapper.js +60 -0
  7. package/build/src/changelog-notes/default.d.ts +17 -0
  8. package/build/src/changelog-notes/default.js +72 -0
  9. package/build/src/changelog-notes.d.ts +17 -0
  10. package/build/src/{updaters/java/readme.js → changelog-notes.js} +2 -7
  11. package/build/src/commit.d.ts +26 -0
  12. package/build/src/{util/to-conventional-changelog-format.js → commit.js} +97 -2
  13. package/build/src/errors/index.d.ts +0 -5
  14. package/build/src/errors/index.js +1 -10
  15. package/build/src/factory.d.ts +25 -37
  16. package/build/src/factory.js +160 -150
  17. package/build/src/github.d.ts +154 -884
  18. package/build/src/github.js +608 -1036
  19. package/build/src/manifest.d.ts +191 -47
  20. package/build/src/manifest.js +599 -487
  21. package/build/src/plugin.d.ts +20 -0
  22. package/build/src/{plugins/plugin.js → plugin.js} +10 -9
  23. package/build/src/plugins/cargo-workspace.d.ts +48 -18
  24. package/build/src/plugins/cargo-workspace.js +247 -328
  25. package/build/src/plugins/merge.d.ts +11 -0
  26. package/build/src/plugins/merge.js +83 -0
  27. package/build/src/plugins/node-workspace.d.ts +35 -17
  28. package/build/src/plugins/node-workspace.js +234 -271
  29. package/build/src/plugins/workspace.d.ts +102 -0
  30. package/build/src/plugins/workspace.js +170 -0
  31. package/build/src/pull-request.d.ts +10 -0
  32. package/build/src/{updaters/java/pom-xml.js → pull-request.js} +2 -7
  33. package/build/src/release-notes.d.ts +29 -0
  34. package/build/src/release-notes.js +71 -0
  35. package/build/src/release-pull-request.d.ts +13 -0
  36. package/build/src/release-pull-request.js +16 -0
  37. package/build/src/release.d.ts +6 -0
  38. package/build/src/release.js +16 -0
  39. package/build/src/repository.d.ts +5 -0
  40. package/build/src/repository.js +16 -0
  41. package/build/src/strategies/dart.d.ts +8 -0
  42. package/build/src/strategies/dart.js +63 -0
  43. package/build/src/strategies/elixir.d.ts +5 -0
  44. package/build/src/{releasers → strategies}/elixir.js +18 -14
  45. package/build/src/strategies/go-yoshi.d.ts +13 -0
  46. package/build/src/strategies/go-yoshi.js +106 -0
  47. package/build/src/strategies/go.d.ts +5 -0
  48. package/build/src/{releasers → strategies}/go.js +11 -12
  49. package/build/src/strategies/helm.d.ts +8 -0
  50. package/build/src/strategies/helm.js +63 -0
  51. package/build/src/strategies/java-yoshi.d.ts +24 -0
  52. package/build/src/strategies/java-yoshi.js +203 -0
  53. package/build/src/strategies/krm-blueprint.d.ts +7 -0
  54. package/build/src/{releasers → strategies}/krm-blueprint.js +26 -22
  55. package/build/src/strategies/node.d.ts +9 -0
  56. package/build/src/strategies/node.js +82 -0
  57. package/build/src/strategies/ocaml.d.ts +5 -0
  58. package/build/src/{releasers → strategies}/ocaml.js +34 -28
  59. package/build/src/strategies/php-yoshi.d.ts +10 -0
  60. package/build/src/strategies/php-yoshi.js +213 -0
  61. package/build/src/strategies/php.d.ts +6 -0
  62. package/build/src/{releasers → strategies}/php.js +24 -23
  63. package/build/src/strategies/python.d.ts +8 -0
  64. package/build/src/strategies/python.js +117 -0
  65. package/build/src/strategies/ruby-yoshi.d.ts +17 -0
  66. package/build/src/strategies/ruby-yoshi.js +116 -0
  67. package/build/src/strategies/ruby.d.ts +13 -0
  68. package/build/src/{releasers → strategies}/ruby.js +26 -27
  69. package/build/src/strategies/rust.d.ts +20 -0
  70. package/build/src/strategies/rust.js +120 -0
  71. package/build/src/strategies/simple.d.ts +5 -0
  72. package/build/src/{releasers → strategies}/simple.js +18 -14
  73. package/build/src/strategies/terraform-module.d.ts +7 -0
  74. package/build/src/{releasers → strategies}/terraform-module.js +29 -23
  75. package/build/src/strategy.d.ts +100 -0
  76. package/build/src/strategy.js +233 -0
  77. package/build/src/update.d.ts +23 -0
  78. package/build/src/{updaters/update.js → update.js} +1 -1
  79. package/build/src/updaters/changelog.d.ts +7 -10
  80. package/build/src/updaters/changelog.js +3 -9
  81. package/build/src/updaters/changelog.js.map +1 -1
  82. package/build/src/updaters/composite.d.ts +19 -0
  83. package/build/src/updaters/composite.js +42 -0
  84. package/build/src/updaters/dart/pubspec-yaml.d.ts +12 -0
  85. package/build/src/updaters/{pubspec-yaml.js → dart/pubspec-yaml.js} +13 -12
  86. package/build/src/updaters/default.d.ts +21 -0
  87. package/build/src/updaters/{version-txt.js → default.js} +16 -10
  88. package/build/src/updaters/dotnet/csproj.d.ts +12 -0
  89. package/build/src/updaters/{java/google-utils.js → dotnet/csproj.js} +16 -13
  90. package/build/src/updaters/elixir/elixir-mix-exs.d.ts +12 -0
  91. package/build/src/updaters/{elixir-mix-exs.js → elixir/elixir-mix-exs.js} +12 -10
  92. package/build/src/updaters/helm/chart-yaml.d.ts +10 -11
  93. package/build/src/updaters/helm/chart-yaml.js +12 -10
  94. package/build/src/updaters/java/java-update.d.ts +14 -0
  95. package/build/src/updaters/java/{java_update.js → java-update.js} +22 -22
  96. package/build/src/updaters/java/versions-manifest.d.ts +12 -2
  97. package/build/src/updaters/java/versions-manifest.js +20 -4
  98. package/build/src/updaters/krm/krm-blueprint-version.d.ts +10 -11
  99. package/build/src/updaters/krm/krm-blueprint-version.js +13 -12
  100. package/build/src/updaters/node/package-json.d.ts +12 -0
  101. package/build/src/updaters/{package-json.js → node/package-json.js} +14 -16
  102. package/build/src/updaters/node/package-lock-json.d.ts +8 -0
  103. package/build/src/updaters/node/package-lock-json.js +36 -0
  104. package/build/src/updaters/node/samples-package-json.d.ts +23 -0
  105. package/build/src/updaters/{samples-package-json.js → node/samples-package-json.js} +19 -8
  106. package/build/src/updaters/ocaml/dune-project.d.ts +10 -11
  107. package/build/src/updaters/ocaml/dune-project.js +11 -9
  108. package/build/src/updaters/ocaml/esy-json.d.ts +10 -11
  109. package/build/src/updaters/ocaml/esy-json.js +12 -10
  110. package/build/src/updaters/ocaml/opam.d.ts +10 -11
  111. package/build/src/updaters/ocaml/opam.js +11 -9
  112. package/build/src/updaters/php/php-client-version.d.ts +12 -0
  113. package/build/src/updaters/{php-client-version.js → php/php-client-version.js} +10 -9
  114. package/build/src/updaters/php/php-manifest.d.ts +13 -0
  115. package/build/src/updaters/{php-manifest.js → php/php-manifest.js} +17 -15
  116. package/build/src/updaters/php/root-composer-update-packages.d.ts +12 -0
  117. package/build/src/updaters/{root-composer-update-packages.js → php/root-composer-update-packages.js} +17 -16
  118. package/build/src/updaters/python/pyproject-toml.d.ts +10 -11
  119. package/build/src/updaters/python/pyproject-toml.js +13 -11
  120. package/build/src/updaters/python/python-file-with-version.d.ts +7 -11
  121. package/build/src/updaters/python/python-file-with-version.js +7 -8
  122. package/build/src/updaters/python/setup-cfg.d.ts +10 -11
  123. package/build/src/updaters/python/setup-cfg.js +10 -8
  124. package/build/src/updaters/python/setup-py.d.ts +10 -11
  125. package/build/src/updaters/python/setup-py.js +10 -8
  126. package/build/src/updaters/raw-content.d.ts +19 -0
  127. package/build/src/{plugins/index.js → updaters/raw-content.js} +23 -12
  128. package/build/src/updaters/release-please-config.d.ts +8 -0
  129. package/build/src/updaters/release-please-config.js +41 -0
  130. package/build/src/updaters/release-please-manifest.d.ts +2 -11
  131. package/build/src/updaters/release-please-manifest.js +11 -14
  132. package/build/src/updaters/ruby/version-rb.d.ts +12 -0
  133. package/build/src/updaters/{version-rb.js → ruby/version-rb.js} +10 -8
  134. package/build/src/updaters/rust/cargo-lock.d.ts +7 -11
  135. package/build/src/updaters/rust/cargo-lock.js +14 -16
  136. package/build/src/updaters/rust/cargo-toml.d.ts +7 -11
  137. package/build/src/updaters/rust/cargo-toml.js +19 -21
  138. package/build/src/updaters/terraform/module-version.d.ts +10 -11
  139. package/build/src/updaters/terraform/module-version.js +11 -9
  140. package/build/src/updaters/terraform/readme.d.ts +10 -11
  141. package/build/src/updaters/terraform/readme.js +11 -10
  142. package/build/src/updaters/terraform/readme.js.map +1 -1
  143. package/build/src/util/branch-name.d.ts +5 -4
  144. package/build/src/util/branch-name.js +13 -10
  145. package/build/src/{commit-split.d.ts → util/commit-split.d.ts} +2 -4
  146. package/build/src/{commit-split.js → util/commit-split.js} +4 -2
  147. package/build/src/util/indent-commit.d.ts +1 -1
  148. package/build/src/util/logger.d.ts +5 -2
  149. package/build/src/util/logger.js +9 -4
  150. package/build/src/util/pull-request-body.d.ts +20 -0
  151. package/build/src/util/pull-request-body.js +129 -0
  152. package/build/src/util/pull-request-title.d.ts +8 -6
  153. package/build/src/util/pull-request-title.js +20 -6
  154. package/build/src/util/tag-name.d.ts +9 -0
  155. package/build/src/util/tag-name.js +41 -0
  156. package/build/src/{updaters → util}/toml-edit.d.ts +0 -0
  157. package/build/src/{updaters → util}/toml-edit.js +0 -0
  158. package/build/src/version.d.ts +11 -0
  159. package/build/src/version.js +45 -0
  160. package/build/src/versioning-strategies/always-bump-patch.d.ts +7 -0
  161. package/build/src/{updaters/package-lock-json.js → versioning-strategies/always-bump-patch.js} +8 -11
  162. package/build/src/versioning-strategies/default.d.ts +15 -0
  163. package/build/src/versioning-strategies/default.js +67 -0
  164. package/build/src/versioning-strategies/dependency-manifest.d.ts +7 -0
  165. package/build/src/versioning-strategies/dependency-manifest.js +90 -0
  166. package/build/src/versioning-strategies/java-add-snapshot.d.ts +9 -0
  167. package/build/src/versioning-strategies/java-add-snapshot.js +53 -0
  168. package/build/src/versioning-strategies/java-snapshot.d.ts +9 -0
  169. package/build/src/versioning-strategies/java-snapshot.js +67 -0
  170. package/build/src/versioning-strategies/service-pack.d.ts +7 -0
  171. package/build/src/versioning-strategies/service-pack.js +40 -0
  172. package/build/src/versioning-strategy.d.ts +28 -0
  173. package/build/src/versioning-strategy.js +55 -0
  174. package/package.json +9 -8
  175. package/build/src/constants.d.ts +0 -6
  176. package/build/src/constants.js +0 -23
  177. package/build/src/conventional-commits.d.ts +0 -53
  178. package/build/src/conventional-commits.js +0 -167
  179. package/build/src/github-release.d.ts +0 -34
  180. package/build/src/github-release.js +0 -92
  181. package/build/src/graphql-to-commits.d.ts +0 -60
  182. package/build/src/graphql-to-commits.js +0 -112
  183. package/build/src/index.d.ts +0 -94
  184. package/build/src/index.js +0 -32
  185. package/build/src/plugins/index.d.ts +0 -5
  186. package/build/src/plugins/plugin.d.ts +0 -21
  187. package/build/src/release-pr.d.ts +0 -101
  188. package/build/src/release-pr.js +0 -461
  189. package/build/src/releasers/dart.d.ts +0 -9
  190. package/build/src/releasers/dart.js +0 -65
  191. package/build/src/releasers/elixir.d.ts +0 -5
  192. package/build/src/releasers/go-yoshi.d.ts +0 -10
  193. package/build/src/releasers/go-yoshi.js +0 -162
  194. package/build/src/releasers/go.d.ts +0 -6
  195. package/build/src/releasers/helm.d.ts +0 -9
  196. package/build/src/releasers/helm.js +0 -66
  197. package/build/src/releasers/index.d.ts +0 -7
  198. package/build/src/releasers/index.js +0 -76
  199. package/build/src/releasers/java/bump_type.d.ts +0 -4
  200. package/build/src/releasers/java/bump_type.js +0 -38
  201. package/build/src/releasers/java/stability.d.ts +0 -5
  202. package/build/src/releasers/java/stability.js +0 -37
  203. package/build/src/releasers/java/version.d.ts +0 -13
  204. package/build/src/releasers/java/version.js +0 -112
  205. package/build/src/releasers/java-backport.d.ts +0 -9
  206. package/build/src/releasers/java-backport.js +0 -43
  207. package/build/src/releasers/java-bom.d.ts +0 -16
  208. package/build/src/releasers/java-bom.js +0 -83
  209. package/build/src/releasers/java-lts.d.ts +0 -9
  210. package/build/src/releasers/java-lts.js +0 -47
  211. package/build/src/releasers/java-yoshi.d.ts +0 -28
  212. package/build/src/releasers/java-yoshi.js +0 -304
  213. package/build/src/releasers/krm-blueprint.d.ts +0 -6
  214. package/build/src/releasers/node.d.ts +0 -10
  215. package/build/src/releasers/node.js +0 -84
  216. package/build/src/releasers/ocaml.d.ts +0 -5
  217. package/build/src/releasers/php-yoshi.d.ts +0 -5
  218. package/build/src/releasers/php-yoshi.js +0 -191
  219. package/build/src/releasers/php.d.ts +0 -7
  220. package/build/src/releasers/python.d.ts +0 -11
  221. package/build/src/releasers/python.js +0 -127
  222. package/build/src/releasers/ruby-yoshi.d.ts +0 -5
  223. package/build/src/releasers/ruby-yoshi.js +0 -142
  224. package/build/src/releasers/ruby.d.ts +0 -11
  225. package/build/src/releasers/rust.d.ts +0 -30
  226. package/build/src/releasers/rust.js +0 -163
  227. package/build/src/releasers/simple.d.ts +0 -5
  228. package/build/src/releasers/terraform-module.d.ts +0 -6
  229. package/build/src/updaters/elixir-mix-exs.d.ts +0 -13
  230. package/build/src/updaters/java/google-utils.d.ts +0 -13
  231. package/build/src/updaters/java/java_update.d.ts +0 -13
  232. package/build/src/updaters/java/pom-xml.d.ts +0 -3
  233. package/build/src/updaters/java/readme.d.ts +0 -3
  234. package/build/src/updaters/java/readme.js.map +0 -1
  235. package/build/src/updaters/package-json.d.ts +0 -16
  236. package/build/src/updaters/package-lock-json.d.ts +0 -7
  237. package/build/src/updaters/php-client-version.d.ts +0 -13
  238. package/build/src/updaters/php-manifest.d.ts +0 -13
  239. package/build/src/updaters/pubspec-yaml.d.ts +0 -13
  240. package/build/src/updaters/root-composer-update-package.d.ts +0 -13
  241. package/build/src/updaters/root-composer-update-package.js +0 -45
  242. package/build/src/updaters/root-composer-update-packages.d.ts +0 -13
  243. package/build/src/updaters/samples-package-json.d.ts +0 -13
  244. package/build/src/updaters/update.d.ts +0 -20
  245. package/build/src/updaters/version-rb.d.ts +0 -13
  246. package/build/src/updaters/version-txt.d.ts +0 -12
  247. package/build/src/updaters/version.d.ts +0 -13
  248. package/build/src/updaters/version.js +0 -31
  249. package/build/src/util/checkpoint.d.ts +0 -6
  250. package/build/src/util/checkpoint.js +0 -33
  251. package/build/src/util/release-notes.d.ts +0 -7
  252. package/build/src/util/release-notes.js +0 -34
  253. package/build/src/util/to-conventional-changelog-format.d.ts +0 -2
@@ -1,191 +0,0 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.PHPYoshi = void 0;
17
- const release_pr_1 = require("../release-pr");
18
- const conventional_commits_1 = require("../conventional-commits");
19
- const commit_split_1 = require("../commit-split");
20
- const semver = require("semver");
21
- // Generic
22
- const changelog_1 = require("../updaters/changelog");
23
- // Yoshi PHP Monorepo
24
- const php_client_version_1 = require("../updaters/php-client-version");
25
- const php_manifest_1 = require("../updaters/php-manifest");
26
- const version_1 = require("../updaters/version");
27
- const logger_1 = require("../util/logger");
28
- const root_composer_update_packages_1 = require("../updaters/root-composer-update-packages");
29
- const CHANGELOG_SECTIONS = [
30
- { type: 'feat', section: 'Features' },
31
- { type: 'fix', section: 'Bug Fixes' },
32
- { type: 'perf', section: 'Performance Improvements' },
33
- { type: 'revert', section: 'Reverts' },
34
- { type: 'docs', section: 'Documentation' },
35
- { type: 'chore', section: 'Miscellaneous Chores' },
36
- { type: 'style', section: 'Styles', hidden: true },
37
- { type: 'refactor', section: 'Code Refactoring', hidden: true },
38
- { type: 'test', section: 'Tests', hidden: true },
39
- { type: 'build', section: 'Build System', hidden: true },
40
- { type: 'ci', section: 'Continuous Integration', hidden: true },
41
- ];
42
- class PHPYoshi extends release_pr_1.ReleasePR {
43
- async _run() {
44
- const latestTag = await this.latestTag();
45
- const commits = await this.commits({
46
- sha: latestTag ? latestTag.sha : undefined,
47
- });
48
- // we create an instance of conventional CHANGELOG for bumping the
49
- // top-level tag version we maintain on the mono-repo itself.
50
- const ccb = new conventional_commits_1.ConventionalCommits({
51
- commits,
52
- owner: this.gh.owner,
53
- repository: this.gh.repo,
54
- bumpMinorPreMajor: true,
55
- changelogSections: CHANGELOG_SECTIONS,
56
- });
57
- const candidate = await this.coerceReleaseCandidate(ccb, latestTag);
58
- // partition a set of packages in the mono-repo that need to be
59
- // updated since our last release -- the set of string keys
60
- // is sorted to ensure consistency in the CHANGELOG.
61
- const updates = [];
62
- let changelogEntry = `## ${candidate.version}`;
63
- const bulkUpdate = await this.releaseAllPHPLibraries(commits, updates, changelogEntry);
64
- changelogEntry = bulkUpdate.changelogEntry;
65
- const packageName = await this.getPackageName();
66
- // update the aggregate package information in the root
67
- // composer.json and manifest.json.
68
- updates.push(new root_composer_update_packages_1.RootComposerUpdatePackages({
69
- path: 'composer.json',
70
- changelogEntry,
71
- version: candidate.version,
72
- versions: bulkUpdate.versionUpdates,
73
- packageName: packageName.name,
74
- }));
75
- updates.push(new php_manifest_1.PHPManifest({
76
- path: 'docs/manifest.json',
77
- changelogEntry,
78
- version: candidate.version,
79
- versions: bulkUpdate.versionUpdates,
80
- packageName: packageName.name,
81
- }));
82
- updates.push(new changelog_1.Changelog({
83
- path: this.changelogPath,
84
- changelogEntry,
85
- version: candidate.version,
86
- packageName: packageName.name,
87
- }));
88
- ['src/Version.php', 'src/ServiceBuilder.php'].forEach((path) => {
89
- updates.push(new php_client_version_1.PHPClientVersion({
90
- path,
91
- changelogEntry,
92
- version: candidate.version,
93
- packageName: packageName.name,
94
- }));
95
- });
96
- return await this.openPR({
97
- sha: commits[0].sha,
98
- changelogEntry,
99
- updates,
100
- version: candidate.version,
101
- includePackageName: this.monorepoTags,
102
- });
103
- }
104
- async releaseAllPHPLibraries(commits, updates, changelogEntry) {
105
- const cs = new commit_split_1.CommitSplit();
106
- const commitLookup = cs.split(commits);
107
- const pkgKeys = Object.keys(commitLookup).sort();
108
- // map of library names that need to be updated in the top level
109
- // composer.json and manifest.json.
110
- const versionUpdates = new Map();
111
- // walk each individual library updating the VERSION file, and
112
- // if necessary the `const VERSION` in the client library.
113
- for (let i = 0; i < pkgKeys.length; i++) {
114
- const pkgKey = pkgKeys[i];
115
- const cc = new conventional_commits_1.ConventionalCommits({
116
- commits: commitLookup[pkgKey],
117
- owner: this.gh.owner,
118
- repository: this.gh.repo,
119
- bumpMinorPreMajor: this.bumpMinorPreMajor,
120
- changelogSections: CHANGELOG_SECTIONS,
121
- });
122
- // some packages in the mono-repo might have only had chores,
123
- // build updates, etc., applied.
124
- if (!this.changelogEmpty(await cc.generateChangelogEntry({ version: '0.0.0' }))) {
125
- try {
126
- const contents = await this.gh.getFileContents(`${pkgKey}/VERSION`);
127
- const bump = await cc.suggestBump(contents.parsedContent);
128
- const candidate = semver.inc(contents.parsedContent, bump.releaseType);
129
- if (!candidate) {
130
- logger_1.logger.error(`failed to update ${pkgKey} version`);
131
- continue;
132
- }
133
- const meta = JSON.parse((await this.gh.getFileContents(`${pkgKey}/composer.json`))
134
- .parsedContent);
135
- versionUpdates.set(meta.name, candidate);
136
- changelogEntry = updatePHPChangelogEntry(`${meta.name} ${candidate}`, changelogEntry, await cc.generateChangelogEntry({ version: candidate }));
137
- const packageName = await this.getPackageName();
138
- updates.push(new version_1.Version({
139
- path: `${pkgKey}/VERSION`,
140
- changelogEntry,
141
- version: candidate,
142
- packageName: packageName.name,
143
- contents,
144
- }));
145
- // extra.component indicates an entry-point class file
146
- // that must have its version # updatd.
147
- if (meta.extra &&
148
- meta.extra.component &&
149
- meta.extra.component.entry) {
150
- updates.push(new php_client_version_1.PHPClientVersion({
151
- path: `${pkgKey}/${meta.extra.component.entry}`,
152
- changelogEntry,
153
- version: candidate,
154
- packageName: packageName.name,
155
- }));
156
- }
157
- }
158
- catch (err) {
159
- if (err.status === 404) {
160
- // if the updated path has no VERSION, assume this isn't a
161
- // module that needs updating.
162
- continue;
163
- }
164
- else {
165
- throw err;
166
- }
167
- }
168
- }
169
- }
170
- return { changelogEntry, versionUpdates };
171
- }
172
- }
173
- exports.PHPYoshi = PHPYoshi;
174
- function updatePHPChangelogEntry(pkgKey, changelogEntry, entryUpdate) {
175
- {
176
- // Remove the first line of the entry, in favor of <summary>.
177
- // This also allows us to use the same regex for extracting release
178
- // notes (since the string "## v0.0.0" doesn't show up multiple times).
179
- const entryUpdateSplit = entryUpdate.split(/\r?\n/);
180
- entryUpdateSplit.shift();
181
- entryUpdate = entryUpdateSplit.join('\n');
182
- }
183
- return `${changelogEntry}
184
-
185
- <details><summary>${pkgKey}</summary>
186
-
187
- ${entryUpdate}
188
-
189
- </details>`;
190
- }
191
- //# sourceMappingURL=php-yoshi.js.map
@@ -1,7 +0,0 @@
1
- import { ReleasePR, ReleaseCandidate, PackageName } from '../release-pr';
2
- import { Update } from '../updaters/update';
3
- import { ReleasePRConstructorOptions } from '..';
4
- export declare class PHP extends ReleasePR {
5
- constructor(options: ReleasePRConstructorOptions);
6
- protected buildUpdates(changelogEntry: string, candidate: ReleaseCandidate, packageName: PackageName): Promise<Update[]>;
7
- }
@@ -1,11 +0,0 @@
1
- import { ReleasePR, ReleaseCandidate, PackageName } from '../release-pr';
2
- import { Update } from '../updaters/update';
3
- import { ReleasePRConstructorOptions } from '..';
4
- import { PyProject } from '../updaters/python/pyproject-toml';
5
- export declare class Python extends ReleasePR {
6
- enableSimplePrereleaseParsing: boolean;
7
- constructor(options: ReleasePRConstructorOptions);
8
- protected buildUpdates(changelogEntry: string, candidate: ReleaseCandidate, packageName: PackageName): Promise<Update[]>;
9
- protected getPyProject(): Promise<PyProject | null>;
10
- defaultInitialVersion(): string;
11
- }
@@ -1,127 +0,0 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.Python = void 0;
17
- const chalk = require("chalk");
18
- const release_pr_1 = require("../release-pr");
19
- // Generic
20
- const changelog_1 = require("../updaters/changelog");
21
- // Python specific.
22
- const setup_py_1 = require("../updaters/python/setup-py");
23
- const setup_cfg_1 = require("../updaters/python/setup-cfg");
24
- const python_file_with_version_1 = require("../updaters/python/python-file-with-version");
25
- const pyproject_toml_1 = require("../updaters/python/pyproject-toml");
26
- const logger_1 = require("../util/logger");
27
- const CHANGELOG_SECTIONS = [
28
- { type: 'feat', section: 'Features' },
29
- { type: 'fix', section: 'Bug Fixes' },
30
- { type: 'perf', section: 'Performance Improvements' },
31
- { type: 'deps', section: 'Dependencies' },
32
- { type: 'revert', section: 'Reverts' },
33
- { type: 'docs', section: 'Documentation' },
34
- { type: 'style', section: 'Styles', hidden: true },
35
- { type: 'chore', section: 'Miscellaneous Chores', hidden: true },
36
- { type: 'refactor', section: 'Code Refactoring', hidden: true },
37
- { type: 'test', section: 'Tests', hidden: true },
38
- { type: 'build', section: 'Build System', hidden: true },
39
- { type: 'ci', section: 'Continuous Integration', hidden: true },
40
- ];
41
- class Python extends release_pr_1.ReleasePR {
42
- constructor(options) {
43
- var _a;
44
- super(options);
45
- this.enableSimplePrereleaseParsing = true;
46
- this.changelogSections = (_a = options.changelogSections) !== null && _a !== void 0 ? _a : CHANGELOG_SECTIONS;
47
- }
48
- async buildUpdates(changelogEntry, candidate, packageName) {
49
- var _a;
50
- const updates = [];
51
- updates.push(new changelog_1.Changelog({
52
- path: this.addPath(this.changelogPath),
53
- changelogEntry,
54
- version: candidate.version,
55
- packageName: packageName.name,
56
- }));
57
- updates.push(new setup_cfg_1.SetupCfg({
58
- path: this.addPath('setup.cfg'),
59
- changelogEntry,
60
- version: candidate.version,
61
- packageName: packageName.name,
62
- }));
63
- updates.push(new setup_py_1.SetupPy({
64
- path: this.addPath('setup.py'),
65
- changelogEntry,
66
- version: candidate.version,
67
- packageName: packageName.name,
68
- }));
69
- const parsedPyProject = await this.getPyProject();
70
- const pyProject = (parsedPyProject === null || parsedPyProject === void 0 ? void 0 : parsedPyProject.project) || ((_a = parsedPyProject === null || parsedPyProject === void 0 ? void 0 : parsedPyProject.tool) === null || _a === void 0 ? void 0 : _a.poetry);
71
- let projectName = packageName.name;
72
- if (pyProject) {
73
- updates.push(new pyproject_toml_1.PyProjectToml({
74
- path: this.addPath('pyproject.toml'),
75
- changelogEntry,
76
- version: candidate.version,
77
- packageName: packageName.name,
78
- }));
79
- projectName = pyProject.name;
80
- }
81
- else {
82
- logger_1.logger.warn(parsedPyProject
83
- ? 'invalid pyproject.toml'
84
- : `file ${chalk.green('pyproject.toml')} did not exist`);
85
- }
86
- // TODO: figure out refactor that makes logic for updating __init__.py, version.py, __version__.py etc., configurable
87
- updates.push(new python_file_with_version_1.PythonFileWithVersion({
88
- path: this.addPath(`${projectName}/__init__.py`),
89
- changelogEntry,
90
- version: candidate.version,
91
- packageName: packageName.name,
92
- }));
93
- updates.push(new python_file_with_version_1.PythonFileWithVersion({
94
- path: this.addPath(`src/${projectName}/__init__.py`),
95
- changelogEntry,
96
- version: candidate.version,
97
- packageName: packageName.name,
98
- }));
99
- // There should be only one version.py, but foreach in case that is incorrect
100
- const versionPyFilesSearch = this.gh.findFilesByFilename('version.py', this.path);
101
- const versionPyFiles = await versionPyFilesSearch;
102
- versionPyFiles.forEach(path => {
103
- updates.push(new python_file_with_version_1.PythonFileWithVersion({
104
- path: this.addPath(path),
105
- changelogEntry,
106
- version: candidate.version,
107
- packageName: packageName.name,
108
- }));
109
- });
110
- return updates;
111
- }
112
- async getPyProject() {
113
- let content;
114
- try {
115
- content = await this.gh.getFileContents('pyproject.toml');
116
- }
117
- catch (e) {
118
- return null;
119
- }
120
- return pyproject_toml_1.parsePyProject(content.parsedContent);
121
- }
122
- defaultInitialVersion() {
123
- return '0.1.0';
124
- }
125
- }
126
- exports.Python = Python;
127
- //# sourceMappingURL=python.js.map
@@ -1,5 +0,0 @@
1
- import { ReleasePR } from '../release-pr';
2
- export declare class RubyYoshi extends ReleasePR {
3
- protected _run(): Promise<number | undefined>;
4
- private summarizeCommits;
5
- }
@@ -1,142 +0,0 @@
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
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.RubyYoshi = void 0;
17
- const fs_1 = require("fs");
18
- const path_1 = require("path");
19
- const release_pr_1 = require("../release-pr");
20
- const conventional_commits_1 = require("../conventional-commits");
21
- const indent_commit_1 = require("../util/indent-commit");
22
- const changelog_1 = require("../updaters/changelog");
23
- const version_rb_1 = require("../updaters/version-rb");
24
- const logger_1 = require("../util/logger");
25
- const CHANGELOG_SECTIONS = [
26
- { type: 'feat', section: 'Features' },
27
- { type: 'fix', section: 'Bug Fixes' },
28
- { type: 'perf', section: 'Performance Improvements' },
29
- { type: 'revert', section: 'Reverts' },
30
- { type: 'docs', section: 'Documentation' },
31
- { type: 'style', section: 'Styles', hidden: true },
32
- { type: 'chore', section: 'Miscellaneous Chores', hidden: true },
33
- { type: 'refactor', section: 'Code Refactoring', hidden: true },
34
- { type: 'test', section: 'Tests', hidden: true },
35
- { type: 'build', section: 'Build System', hidden: true },
36
- { type: 'ci', section: 'Continuous Integration', hidden: true },
37
- ];
38
- class RubyYoshi extends release_pr_1.ReleasePR {
39
- async _run() {
40
- const packageName = await this.getPackageName();
41
- const lastReleaseSha = this.lastPackageVersion
42
- ? await this.gh.getTagSha(`${packageName.getComponent()}/v${this.lastPackageVersion}`)
43
- : undefined;
44
- const commits = await this.commits({
45
- sha: lastReleaseSha,
46
- path: packageName.name,
47
- });
48
- if (commits.length === 0) {
49
- logger_1.logger.warn(`no commits found since ${lastReleaseSha}`);
50
- return undefined;
51
- }
52
- else {
53
- const cc = new conventional_commits_1.ConventionalCommits({
54
- commits: postProcessCommits(commits),
55
- owner: this.gh.owner,
56
- repository: this.gh.repo,
57
- bumpMinorPreMajor: this.bumpMinorPreMajor,
58
- commitPartial: fs_1.readFileSync(path_1.resolve(__dirname, '../../../templates/commit.hbs'), 'utf8'),
59
- headerPartial: fs_1.readFileSync(path_1.resolve(__dirname, '../../../templates/header.hbs'), 'utf8'),
60
- mainTemplate: fs_1.readFileSync(path_1.resolve(__dirname, '../../../templates/template.hbs'), 'utf8'),
61
- changelogSections: CHANGELOG_SECTIONS,
62
- });
63
- const githubTag = this.lastPackageVersion
64
- ? {
65
- version: this.lastPackageVersion,
66
- name: this.lastPackageVersion,
67
- }
68
- : undefined;
69
- const candidate = await this.coerceReleaseCandidate(cc, githubTag);
70
- const changelogEntry = await cc.generateChangelogEntry({
71
- version: candidate.version,
72
- currentTag: `v${candidate.version}`,
73
- previousTag: undefined,
74
- });
75
- // don't create a release candidate until user facing changes
76
- // (fix, feat, BREAKING CHANGE) have been made; a CHANGELOG that's
77
- // one line is a good indicator that there were no interesting commits.
78
- if (this.changelogEmpty(changelogEntry)) {
79
- logger_1.logger.warn(`no user facing commits found since ${lastReleaseSha ? lastReleaseSha : 'beginning of time'}`);
80
- return undefined;
81
- }
82
- const updates = [];
83
- updates.push(new changelog_1.Changelog({
84
- path: `${packageName.name}/CHANGELOG.md`,
85
- changelogEntry,
86
- version: candidate.version,
87
- packageName: packageName.name,
88
- }));
89
- updates.push(new version_rb_1.VersionRB({
90
- path: `${packageName.name}/lib/${packageName.name.replace(/-/g, '/')}/version.rb`,
91
- changelogEntry,
92
- version: candidate.version,
93
- packageName: packageName.name,
94
- }));
95
- return await this.openPR({
96
- sha: commits[0].sha,
97
- changelogEntry: `${changelogEntry}\n---\n${this.summarizeCommits(lastReleaseSha, commits, packageName.name)}\n`,
98
- updates,
99
- version: candidate.version,
100
- includePackageName: true,
101
- });
102
- }
103
- }
104
- // create a summary of the commits landed since the last release,
105
- // for the benefit of the release PR.
106
- summarizeCommits(lastReleaseSha, commits, packageName) {
107
- // summarize the commits that landed:
108
- let summary = '### Commits since last release:\n\n';
109
- const updatedFiles = {};
110
- const repoUrl = `${this.gh.owner}/${this.gh.repo}`;
111
- commits.forEach(commit => {
112
- if (commit.sha === null)
113
- return;
114
- const splitMessage = commit.message.split('\n');
115
- summary += `* [${splitMessage[0]}](https://github.com/${repoUrl}/commit/${commit.sha})\n`;
116
- if (splitMessage.length > 2) {
117
- summary = `${summary}<pre><code>${splitMessage
118
- .slice(1)
119
- .join('\n')}</code></pre>\n`;
120
- }
121
- commit.files.forEach(file => {
122
- if (file.startsWith(packageName)) {
123
- updatedFiles[file] = true;
124
- }
125
- });
126
- });
127
- // summarize the files that changed:
128
- summary = `${summary}\n### Files edited since last release:\n\n<pre><code>`;
129
- Object.keys(updatedFiles).forEach(file => {
130
- summary += `${file}\n`;
131
- });
132
- return `${summary}</code></pre>\n[Compare Changes](https://github.com/${repoUrl}/compare/${lastReleaseSha}...HEAD)\n`;
133
- }
134
- }
135
- exports.RubyYoshi = RubyYoshi;
136
- function postProcessCommits(commits) {
137
- commits.forEach(commit => {
138
- commit.message = indent_commit_1.indentCommit(commit);
139
- });
140
- return commits;
141
- }
142
- //# sourceMappingURL=ruby-yoshi.js.map
@@ -1,11 +0,0 @@
1
- import { ReleasePRConstructorOptions } from '..';
2
- import { ReleasePR, ReleaseCandidate, GetCommitsOptions, PackageName } from '../release-pr';
3
- import { Update } from '../updaters/update';
4
- import { Commit } from '../graphql-to-commits';
5
- export declare class Ruby extends ReleasePR {
6
- versionFile: string;
7
- constructor(options: ReleasePRConstructorOptions);
8
- protected buildUpdates(changelogEntry: string, candidate: ReleaseCandidate, packageName: PackageName): Promise<Update[]>;
9
- tagSeparator(): string;
10
- protected commits(opts: GetCommitsOptions): Promise<Commit[]>;
11
- }
@@ -1,30 +0,0 @@
1
- import { ReleasePR, ReleaseCandidate, PackageName } from '../release-pr';
2
- import { Update } from '../updaters/update';
3
- import { Commit } from '../graphql-to-commits';
4
- import { CargoManifest } from '../updaters/rust/common';
5
- export declare class Rust extends ReleasePR {
6
- private packageManifest?;
7
- private workspaceManifest?;
8
- private _packageName?;
9
- protected buildUpdates(changelogEntry: string, candidate: ReleaseCandidate, packageName: PackageName): Promise<Update[]>;
10
- protected commits(opts: GetCommitsOptions): Promise<Commit[]>;
11
- defaultInitialVersion(): string;
12
- getPackageName(): Promise<PackageName>;
13
- /**
14
- * @returns the package's manifest, ie. `crates/foobar/Cargo.toml`
15
- */
16
- protected getPackageManifest(): Promise<CargoManifest | null>;
17
- /**
18
- * @returns the workspace's manifest, ie. `Cargo.toml` (top-level)
19
- */
20
- protected getWorkspaceManifest(): Promise<CargoManifest | null>;
21
- protected getManifest(path: string): Promise<CargoManifest | null>;
22
- protected exists(path: string): Promise<boolean>;
23
- }
24
- interface GetCommitsOptions {
25
- sha?: string;
26
- perPage?: number;
27
- labels?: boolean;
28
- path?: string;
29
- }
30
- export {};