release-please 12.6.0 → 12.6.1

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 (124) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/build/src/bootstrapper.d.ts +12 -0
  3. package/build/src/bootstrapper.js +60 -0
  4. package/build/src/changelog-notes/default.d.ts +15 -0
  5. package/build/src/changelog-notes/default.js +71 -0
  6. package/build/src/changelog-notes/github.d.ts +8 -0
  7. package/build/src/changelog-notes/github.js +26 -0
  8. package/build/src/changelog-notes.d.ts +19 -0
  9. package/build/src/changelog-notes.js +16 -0
  10. package/build/src/commit.d.ts +26 -0
  11. package/build/src/commit.js +316 -0
  12. package/build/src/github.js +1 -1
  13. package/build/src/plugin.d.ts +20 -0
  14. package/build/src/plugin.js +31 -0
  15. package/build/src/plugins/merge.d.ts +11 -0
  16. package/build/src/plugins/merge.js +83 -0
  17. package/build/src/plugins/workspace.d.ts +102 -0
  18. package/build/src/plugins/workspace.js +170 -0
  19. package/build/src/pull-request.d.ts +10 -0
  20. package/build/src/pull-request.js +16 -0
  21. package/build/src/release-notes.d.ts +29 -0
  22. package/build/src/release-notes.js +71 -0
  23. package/build/src/release-pull-request.d.ts +13 -0
  24. package/build/src/release-pull-request.js +16 -0
  25. package/build/src/release.d.ts +6 -0
  26. package/build/src/release.js +16 -0
  27. package/build/src/repository.d.ts +5 -0
  28. package/build/src/repository.js +16 -0
  29. package/build/src/strategies/dart.d.ts +8 -0
  30. package/build/src/strategies/dart.js +63 -0
  31. package/build/src/strategies/elixir.d.ts +5 -0
  32. package/build/src/strategies/elixir.js +45 -0
  33. package/build/src/strategies/go-yoshi.d.ts +13 -0
  34. package/build/src/strategies/go-yoshi.js +114 -0
  35. package/build/src/strategies/go.d.ts +5 -0
  36. package/build/src/strategies/go.js +36 -0
  37. package/build/src/strategies/helm.d.ts +8 -0
  38. package/build/src/strategies/helm.js +63 -0
  39. package/build/src/strategies/java-yoshi.d.ts +25 -0
  40. package/build/src/strategies/java-yoshi.js +259 -0
  41. package/build/src/strategies/krm-blueprint.d.ts +7 -0
  42. package/build/src/strategies/krm-blueprint.js +64 -0
  43. package/build/src/strategies/node.d.ts +9 -0
  44. package/build/src/strategies/node.js +82 -0
  45. package/build/src/strategies/ocaml.d.ts +5 -0
  46. package/build/src/strategies/ocaml.js +75 -0
  47. package/build/src/strategies/php-yoshi.d.ts +10 -0
  48. package/build/src/strategies/php-yoshi.js +214 -0
  49. package/build/src/strategies/php.d.ts +6 -0
  50. package/build/src/strategies/php.js +67 -0
  51. package/build/src/strategies/python.d.ts +8 -0
  52. package/build/src/strategies/python.js +117 -0
  53. package/build/src/strategies/ruby-yoshi.d.ts +17 -0
  54. package/build/src/strategies/ruby-yoshi.js +116 -0
  55. package/build/src/strategies/ruby.d.ts +13 -0
  56. package/build/src/strategies/ruby.js +61 -0
  57. package/build/src/strategies/rust.d.ts +20 -0
  58. package/build/src/strategies/rust.js +120 -0
  59. package/build/src/strategies/simple.d.ts +5 -0
  60. package/build/src/strategies/simple.js +45 -0
  61. package/build/src/strategies/terraform-module.d.ts +7 -0
  62. package/build/src/strategies/terraform-module.js +72 -0
  63. package/build/src/strategy.d.ts +103 -0
  64. package/build/src/strategy.js +249 -0
  65. package/build/src/update.d.ts +23 -0
  66. package/build/src/update.js +16 -0
  67. package/build/src/updaters/composite.d.ts +19 -0
  68. package/build/src/updaters/composite.js +42 -0
  69. package/build/src/updaters/dart/pubspec-yaml.d.ts +12 -0
  70. package/build/src/updaters/dart/pubspec-yaml.js +45 -0
  71. package/build/src/updaters/default.d.ts +21 -0
  72. package/build/src/updaters/default.js +36 -0
  73. package/build/src/updaters/dotnet/csproj.d.ts +12 -0
  74. package/build/src/updaters/dotnet/csproj.js +33 -0
  75. package/build/src/updaters/elixir/elixir-mix-exs.d.ts +12 -0
  76. package/build/src/updaters/elixir/elixir-mix-exs.js +37 -0
  77. package/build/src/updaters/go/version-go.d.ts +4 -0
  78. package/build/src/updaters/go/version-go.js +24 -0
  79. package/build/src/updaters/java/java-update.d.ts +14 -0
  80. package/build/src/updaters/java/java-update.js +76 -0
  81. package/build/src/updaters/node/package-json.d.ts +12 -0
  82. package/build/src/updaters/node/package-json.js +37 -0
  83. package/build/src/updaters/node/package-lock-json.d.ts +8 -0
  84. package/build/src/updaters/node/package-lock-json.js +36 -0
  85. package/build/src/updaters/node/samples-package-json.d.ts +23 -0
  86. package/build/src/updaters/node/samples-package-json.js +49 -0
  87. package/build/src/updaters/php/php-client-version.d.ts +12 -0
  88. package/build/src/updaters/php/php-client-version.js +32 -0
  89. package/build/src/updaters/php/php-manifest.d.ts +13 -0
  90. package/build/src/updaters/php/php-manifest.js +55 -0
  91. package/build/src/updaters/php/root-composer-update-packages.d.ts +12 -0
  92. package/build/src/updaters/php/root-composer-update-packages.js +47 -0
  93. package/build/src/updaters/raw-content.d.ts +19 -0
  94. package/build/src/updaters/raw-content.js +39 -0
  95. package/build/src/updaters/release-please-config.d.ts +8 -0
  96. package/build/src/updaters/release-please-config.js +41 -0
  97. package/build/src/updaters/ruby/version-rb.d.ts +12 -0
  98. package/build/src/updaters/ruby/version-rb.js +32 -0
  99. package/build/src/updaters/rust/cargo-toml.js +5 -1
  100. package/build/src/util/commit-split.d.ts +11 -0
  101. package/build/src/util/commit-split.js +94 -0
  102. package/build/src/util/pull-request-body.d.ts +20 -0
  103. package/build/src/util/pull-request-body.js +129 -0
  104. package/build/src/util/tag-name.d.ts +9 -0
  105. package/build/src/util/tag-name.js +41 -0
  106. package/build/src/util/toml-edit.d.ts +8 -0
  107. package/build/src/util/toml-edit.js +125 -0
  108. package/build/src/version.d.ts +11 -0
  109. package/build/src/version.js +45 -0
  110. package/build/src/versioning-strategies/always-bump-patch.d.ts +7 -0
  111. package/build/src/versioning-strategies/always-bump-patch.js +25 -0
  112. package/build/src/versioning-strategies/default.d.ts +15 -0
  113. package/build/src/versioning-strategies/default.js +67 -0
  114. package/build/src/versioning-strategies/dependency-manifest.d.ts +7 -0
  115. package/build/src/versioning-strategies/dependency-manifest.js +90 -0
  116. package/build/src/versioning-strategies/java-add-snapshot.d.ts +9 -0
  117. package/build/src/versioning-strategies/java-add-snapshot.js +53 -0
  118. package/build/src/versioning-strategies/java-snapshot.d.ts +9 -0
  119. package/build/src/versioning-strategies/java-snapshot.js +67 -0
  120. package/build/src/versioning-strategies/service-pack.d.ts +7 -0
  121. package/build/src/versioning-strategies/service-pack.js +40 -0
  122. package/build/src/versioning-strategy.d.ts +28 -0
  123. package/build/src/versioning-strategy.js +55 -0
  124. package/package.json +2 -2
@@ -0,0 +1,82 @@
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.Node = void 0;
17
+ const strategy_1 = require("../strategy");
18
+ const package_lock_json_1 = require("../updaters/node/package-lock-json");
19
+ const samples_package_json_1 = require("../updaters/node/samples-package-json");
20
+ const changelog_1 = require("../updaters/changelog");
21
+ const package_json_1 = require("../updaters/node/package-json");
22
+ class Node extends strategy_1.Strategy {
23
+ async buildUpdates(options) {
24
+ const updates = [];
25
+ const version = options.newVersion;
26
+ const packageName = this.component || '';
27
+ const lockFiles = ['package-lock.json', 'npm-shrinkwrap.json'];
28
+ lockFiles.forEach(lockFile => {
29
+ updates.push({
30
+ path: this.addPath(lockFile),
31
+ createIfMissing: false,
32
+ updater: new package_lock_json_1.PackageLockJson({
33
+ version,
34
+ }),
35
+ });
36
+ });
37
+ updates.push({
38
+ path: this.addPath('samples/package.json'),
39
+ createIfMissing: false,
40
+ updater: new samples_package_json_1.SamplesPackageJson({
41
+ version,
42
+ packageName,
43
+ }),
44
+ });
45
+ updates.push({
46
+ path: this.addPath(this.changelogPath),
47
+ createIfMissing: true,
48
+ updater: new changelog_1.Changelog({
49
+ version,
50
+ changelogEntry: options.changelogEntry,
51
+ }),
52
+ });
53
+ updates.push({
54
+ path: this.addPath('package.json'),
55
+ createIfMissing: false,
56
+ cachedFileContents: this.pkgJsonContents,
57
+ updater: new package_json_1.PackageJson({
58
+ version,
59
+ }),
60
+ });
61
+ return updates;
62
+ }
63
+ async getDefaultPackageName() {
64
+ const pkgJsonContents = await this.getPkgJsonContents();
65
+ const pkg = JSON.parse(pkgJsonContents.parsedContent);
66
+ return pkg.name;
67
+ }
68
+ normalizeComponent(component) {
69
+ if (!component) {
70
+ return '';
71
+ }
72
+ return component.match(/^@[\w-]+\//) ? component.split('/')[1] : component;
73
+ }
74
+ async getPkgJsonContents() {
75
+ if (!this.pkgJsonContents) {
76
+ this.pkgJsonContents = await this.github.getFileContentsOnBranch(this.addPath('package.json'), this.targetBranch);
77
+ }
78
+ return this.pkgJsonContents;
79
+ }
80
+ }
81
+ exports.Node = Node;
82
+ //# sourceMappingURL=node.js.map
@@ -0,0 +1,5 @@
1
+ import { Strategy, BuildUpdatesOptions } from '../strategy';
2
+ import { Update } from '../update';
3
+ export declare class OCaml extends Strategy {
4
+ protected buildUpdates(options: BuildUpdatesOptions): Promise<Update[]>;
5
+ }
@@ -0,0 +1,75 @@
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.OCaml = void 0;
17
+ // Generic
18
+ const changelog_1 = require("../updaters/changelog");
19
+ // OCaml
20
+ const opam_1 = require("../updaters/ocaml/opam");
21
+ const esy_json_1 = require("../updaters/ocaml/esy-json");
22
+ const dune_project_1 = require("../updaters/ocaml/dune-project");
23
+ const strategy_1 = require("../strategy");
24
+ const notEsyLock = (path) => !path.startsWith('esy.lock');
25
+ class OCaml extends strategy_1.Strategy {
26
+ async buildUpdates(options) {
27
+ const updates = [];
28
+ const version = options.newVersion;
29
+ updates.push({
30
+ path: this.addPath(this.changelogPath),
31
+ createIfMissing: true,
32
+ updater: new changelog_1.Changelog({
33
+ version,
34
+ changelogEntry: options.changelogEntry,
35
+ }),
36
+ });
37
+ const jsonPaths = await this.github.findFilesByExtension('json', this.path);
38
+ for (const path of jsonPaths) {
39
+ if (notEsyLock(path)) {
40
+ const contents = await this.github.getFileContents(this.addPath(path));
41
+ const pkg = JSON.parse(contents.parsedContent);
42
+ if (pkg.version !== undefined) {
43
+ updates.push({
44
+ path: this.addPath(path),
45
+ createIfMissing: false,
46
+ cachedFileContents: contents,
47
+ updater: new esy_json_1.EsyJson({
48
+ version,
49
+ }),
50
+ });
51
+ }
52
+ }
53
+ }
54
+ const opamPaths = await this.github.findFilesByExtension('opam', this.path);
55
+ opamPaths.filter(notEsyLock).forEach(path => {
56
+ updates.push({
57
+ path: this.addPath(path),
58
+ createIfMissing: false,
59
+ updater: new opam_1.Opam({
60
+ version,
61
+ }),
62
+ });
63
+ });
64
+ updates.push({
65
+ path: this.addPath('dune-project'),
66
+ createIfMissing: false,
67
+ updater: new dune_project_1.DuneProject({
68
+ version,
69
+ }),
70
+ });
71
+ return updates;
72
+ }
73
+ }
74
+ exports.OCaml = OCaml;
75
+ //# sourceMappingURL=ocaml.js.map
@@ -0,0 +1,10 @@
1
+ import { Strategy, BuildUpdatesOptions, StrategyOptions } from '../strategy';
2
+ import { Update } from '../update';
3
+ import { Commit } from '../commit';
4
+ import { Release } from '../release';
5
+ import { ReleasePullRequest } from '../release-pull-request';
6
+ export declare class PHPYoshi extends Strategy {
7
+ constructor(options: StrategyOptions);
8
+ buildReleasePullRequest(commits: Commit[], latestRelease?: Release, draft?: boolean, labels?: string[]): Promise<ReleasePullRequest>;
9
+ protected buildUpdates(options: BuildUpdatesOptions): Promise<Update[]>;
10
+ }
@@ -0,0 +1,214 @@
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.PHPYoshi = void 0;
17
+ const strategy_1 = require("../strategy");
18
+ const changelog_1 = require("../updaters/changelog");
19
+ const root_composer_update_packages_1 = require("../updaters/php/root-composer-update-packages");
20
+ const php_manifest_1 = require("../updaters/php/php-manifest");
21
+ const php_client_version_1 = require("../updaters/php/php-client-version");
22
+ const version_1 = require("../version");
23
+ const commit_1 = require("../commit");
24
+ const commit_split_1 = require("../util/commit-split");
25
+ const default_1 = require("../updaters/default");
26
+ const logger_1 = require("../util/logger");
27
+ const tag_name_1 = require("../util/tag-name");
28
+ const pull_request_title_1 = require("../util/pull-request-title");
29
+ const branch_name_1 = require("../util/branch-name");
30
+ const pull_request_body_1 = require("../util/pull-request-body");
31
+ const CHANGELOG_SECTIONS = [
32
+ { type: 'feat', section: 'Features' },
33
+ { type: 'fix', section: 'Bug Fixes' },
34
+ { type: 'perf', section: 'Performance Improvements' },
35
+ { type: 'revert', section: 'Reverts' },
36
+ { type: 'docs', section: 'Documentation' },
37
+ { type: 'chore', section: 'Miscellaneous Chores' },
38
+ { type: 'style', section: 'Styles', hidden: true },
39
+ { type: 'refactor', section: 'Code Refactoring', hidden: true },
40
+ { type: 'test', section: 'Tests', hidden: true },
41
+ { type: 'build', section: 'Build System', hidden: true },
42
+ { type: 'ci', section: 'Continuous Integration', hidden: true },
43
+ ];
44
+ class PHPYoshi extends strategy_1.Strategy {
45
+ constructor(options) {
46
+ super({
47
+ ...options,
48
+ changelogSections: CHANGELOG_SECTIONS,
49
+ });
50
+ }
51
+ async buildReleasePullRequest(commits, latestRelease, draft, labels = []) {
52
+ var _a, _b, _c;
53
+ const conventionalCommits = this.postProcessCommits(commit_1.parseConventionalCommits(commits));
54
+ const newVersion = latestRelease
55
+ ? await this.versioningStrategy.bump(latestRelease.tag.version, conventionalCommits)
56
+ : this.initialReleaseVersion();
57
+ const cs = new commit_split_1.CommitSplit();
58
+ const splitCommits = cs.split(conventionalCommits);
59
+ const topLevelDirectories = Object.keys(splitCommits).sort();
60
+ const versionsMap = new Map();
61
+ const directoryVersionContents = {};
62
+ const component = await this.getComponent();
63
+ const newVersionTag = new tag_name_1.TagName(newVersion, component);
64
+ let releaseNotesBody = `## ${newVersion.toString()}`;
65
+ for (const directory of topLevelDirectories) {
66
+ try {
67
+ const contents = await this.github.getFileContentsOnBranch(this.addPath(`${directory}/VERSION`), this.targetBranch);
68
+ const version = version_1.Version.parse(contents.parsedContent);
69
+ const composer = await this.github.getFileJson(this.addPath(`${directory}/composer.json`), this.targetBranch);
70
+ directoryVersionContents[directory] = {
71
+ versionContents: contents,
72
+ composer,
73
+ };
74
+ const newVersion = await this.versioningStrategy.bump(version, splitCommits[directory]);
75
+ versionsMap.set(composer.name, newVersion);
76
+ const partialReleaseNotes = await this.changelogNotes.buildNotes(splitCommits[directory], {
77
+ owner: this.repository.owner,
78
+ repository: this.repository.repo,
79
+ version: newVersion.toString(),
80
+ previousTag: (_a = latestRelease === null || latestRelease === void 0 ? void 0 : latestRelease.tag) === null || _a === void 0 ? void 0 : _a.toString(),
81
+ currentTag: newVersionTag.toString(),
82
+ targetBranch: this.targetBranch,
83
+ });
84
+ releaseNotesBody = updatePHPChangelogEntry(`${composer.name} ${newVersion.toString()}`, releaseNotesBody, partialReleaseNotes);
85
+ }
86
+ catch (err) {
87
+ if (err.status === 404) {
88
+ // if the updated path has no VERSION, assume this isn't a
89
+ // module that needs updating.
90
+ continue;
91
+ }
92
+ else {
93
+ throw err;
94
+ }
95
+ }
96
+ }
97
+ const pullRequestTitle = pull_request_title_1.PullRequestTitle.ofComponentTargetBranchVersion(component || '', this.targetBranch, newVersion);
98
+ const branchName = component
99
+ ? branch_name_1.BranchName.ofComponentTargetBranch(component, this.targetBranch)
100
+ : branch_name_1.BranchName.ofTargetBranch(this.targetBranch);
101
+ const updates = await this.buildUpdates({
102
+ changelogEntry: releaseNotesBody,
103
+ newVersion,
104
+ versionsMap,
105
+ latestVersion: latestRelease === null || latestRelease === void 0 ? void 0 : latestRelease.tag.version,
106
+ });
107
+ for (const directory in directoryVersionContents) {
108
+ const componentInfo = directoryVersionContents[directory];
109
+ const version = versionsMap.get(componentInfo.composer.name);
110
+ if (!version) {
111
+ logger_1.logger.warn(`No version found for ${componentInfo.composer.name}`);
112
+ continue;
113
+ }
114
+ updates.push({
115
+ path: this.addPath(`${directory}/VERSION`),
116
+ createIfMissing: false,
117
+ cachedFileContents: componentInfo.versionContents,
118
+ updater: new default_1.DefaultUpdater({
119
+ version,
120
+ }),
121
+ });
122
+ if ((_c = (_b = componentInfo.composer.extra) === null || _b === void 0 ? void 0 : _b.component) === null || _c === void 0 ? void 0 : _c.entry) {
123
+ updates.push({
124
+ path: this.addPath(`${directory}/${componentInfo.composer.extra.component.entry}`),
125
+ createIfMissing: false,
126
+ updater: new php_client_version_1.PHPClientVersion({
127
+ version,
128
+ }),
129
+ });
130
+ }
131
+ }
132
+ const pullRequestBody = new pull_request_body_1.PullRequestBody([
133
+ {
134
+ component,
135
+ version: newVersion,
136
+ notes: releaseNotesBody,
137
+ },
138
+ ]);
139
+ return {
140
+ title: pullRequestTitle,
141
+ body: pullRequestBody,
142
+ updates,
143
+ labels,
144
+ headRefName: branchName.toString(),
145
+ version: newVersion,
146
+ draft: draft !== null && draft !== void 0 ? draft : false,
147
+ };
148
+ }
149
+ async buildUpdates(options) {
150
+ const updates = [];
151
+ const version = options.newVersion;
152
+ const versionsMap = options.versionsMap;
153
+ updates.push({
154
+ path: this.addPath(this.changelogPath),
155
+ createIfMissing: true,
156
+ updater: new changelog_1.Changelog({
157
+ version,
158
+ changelogEntry: options.changelogEntry,
159
+ }),
160
+ });
161
+ // update the aggregate package information in the root
162
+ // composer.json and manifest.json.
163
+ updates.push({
164
+ path: this.addPath('composer.json'),
165
+ createIfMissing: false,
166
+ updater: new root_composer_update_packages_1.RootComposerUpdatePackages({
167
+ version,
168
+ versionsMap,
169
+ }),
170
+ });
171
+ updates.push({
172
+ path: this.addPath('docs/manifest.json'),
173
+ createIfMissing: false,
174
+ updater: new php_manifest_1.PHPManifest({
175
+ version,
176
+ versionsMap,
177
+ }),
178
+ });
179
+ updates.push({
180
+ path: this.addPath('src/Version.php'),
181
+ createIfMissing: false,
182
+ updater: new php_client_version_1.PHPClientVersion({
183
+ version,
184
+ versionsMap,
185
+ }),
186
+ });
187
+ updates.push({
188
+ path: this.addPath('src/ServiceBuilder.php'),
189
+ createIfMissing: false,
190
+ updater: new php_client_version_1.PHPClientVersion({
191
+ version,
192
+ versionsMap,
193
+ }),
194
+ });
195
+ return updates;
196
+ }
197
+ }
198
+ exports.PHPYoshi = PHPYoshi;
199
+ function updatePHPChangelogEntry(pkgKey, changelogEntry, entryUpdate) {
200
+ // Remove the first line of the entry, in favor of <summary>.
201
+ // This also allows us to use the same regex for extracting release
202
+ // notes (since the string "## v0.0.0" doesn't show up multiple times).
203
+ const entryUpdateSplit = entryUpdate.split(/\r?\n/);
204
+ entryUpdateSplit.shift();
205
+ entryUpdate = entryUpdateSplit.join('\n');
206
+ return `${changelogEntry}
207
+
208
+ <details><summary>${pkgKey}</summary>
209
+
210
+ ${entryUpdate}
211
+
212
+ </details>`;
213
+ }
214
+ //# sourceMappingURL=php-yoshi.js.map
@@ -0,0 +1,6 @@
1
+ import { Strategy, BuildUpdatesOptions, StrategyOptions } from '../strategy';
2
+ import { Update } from '../update';
3
+ export declare class PHP extends Strategy {
4
+ constructor(options: StrategyOptions);
5
+ protected buildUpdates(options: BuildUpdatesOptions): Promise<Update[]>;
6
+ }
@@ -0,0 +1,67 @@
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.PHP = void 0;
17
+ // Generic
18
+ const changelog_1 = require("../updaters/changelog");
19
+ // PHP Specific.
20
+ const root_composer_update_packages_1 = require("../updaters/php/root-composer-update-packages");
21
+ const strategy_1 = require("../strategy");
22
+ const CHANGELOG_SECTIONS = [
23
+ { type: 'feat', section: 'Features' },
24
+ { type: 'fix', section: 'Bug Fixes' },
25
+ { type: 'perf', section: 'Performance Improvements' },
26
+ { type: 'revert', section: 'Reverts' },
27
+ { type: 'chore', section: 'Miscellaneous Chores' },
28
+ { type: 'docs', section: 'Documentation', hidden: true },
29
+ { type: 'style', section: 'Styles', hidden: true },
30
+ { type: 'refactor', section: 'Code Refactoring', hidden: true },
31
+ { type: 'test', section: 'Tests', hidden: true },
32
+ { type: 'build', section: 'Build System', hidden: true },
33
+ { type: 'ci', section: 'Continuous Integration', hidden: true },
34
+ ];
35
+ class PHP extends strategy_1.Strategy {
36
+ constructor(options) {
37
+ var _a;
38
+ options.changelogSections = (_a = options.changelogSections) !== null && _a !== void 0 ? _a : CHANGELOG_SECTIONS;
39
+ super(options);
40
+ }
41
+ async buildUpdates(options) {
42
+ const updates = [];
43
+ const version = options.newVersion;
44
+ const versionsMap = new Map();
45
+ versionsMap.set('version', version);
46
+ updates.push({
47
+ path: this.addPath(this.changelogPath),
48
+ createIfMissing: true,
49
+ updater: new changelog_1.Changelog({
50
+ version,
51
+ changelogEntry: options.changelogEntry,
52
+ }),
53
+ });
54
+ // update composer.json
55
+ updates.push({
56
+ path: this.addPath('composer.json'),
57
+ createIfMissing: false,
58
+ updater: new root_composer_update_packages_1.RootComposerUpdatePackages({
59
+ version,
60
+ versionsMap,
61
+ }),
62
+ });
63
+ return updates;
64
+ }
65
+ }
66
+ exports.PHP = PHP;
67
+ //# sourceMappingURL=php.js.map
@@ -0,0 +1,8 @@
1
+ import { Strategy, BuildUpdatesOptions } from '../strategy';
2
+ import { Update } from '../update';
3
+ import { Version } from '../version';
4
+ export declare class Python extends Strategy {
5
+ protected buildUpdates(options: BuildUpdatesOptions): Promise<Update[]>;
6
+ private getPyProject;
7
+ protected initialReleaseVersion(): Version;
8
+ }
@@ -0,0 +1,117 @@
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 strategy_1 = require("../strategy");
18
+ const changelog_1 = require("../updaters/changelog");
19
+ const version_1 = require("../version");
20
+ const setup_cfg_1 = require("../updaters/python/setup-cfg");
21
+ const setup_py_1 = require("../updaters/python/setup-py");
22
+ const pyproject_toml_1 = require("../updaters/python/pyproject-toml");
23
+ const logger_1 = require("../util/logger");
24
+ const python_file_with_version_1 = require("../updaters/python/python-file-with-version");
25
+ class Python extends strategy_1.Strategy {
26
+ async buildUpdates(options) {
27
+ var _a;
28
+ const updates = [];
29
+ const version = options.newVersion;
30
+ updates.push({
31
+ path: this.addPath(this.changelogPath),
32
+ createIfMissing: true,
33
+ updater: new changelog_1.Changelog({
34
+ version,
35
+ changelogEntry: options.changelogEntry,
36
+ }),
37
+ });
38
+ updates.push({
39
+ path: this.addPath('setup.cfg'),
40
+ createIfMissing: false,
41
+ updater: new setup_cfg_1.SetupCfg({
42
+ version,
43
+ }),
44
+ });
45
+ updates.push({
46
+ path: this.addPath('setup.py'),
47
+ createIfMissing: false,
48
+ updater: new setup_py_1.SetupPy({
49
+ version,
50
+ }),
51
+ });
52
+ const parsedPyProject = await this.getPyProject(this.addPath('pyproject.toml'));
53
+ 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);
54
+ let projectName = this.component;
55
+ if (pyProject) {
56
+ updates.push({
57
+ path: this.addPath('pyproject.toml'),
58
+ createIfMissing: false,
59
+ updater: new pyproject_toml_1.PyProjectToml({
60
+ version,
61
+ }),
62
+ });
63
+ projectName = pyProject.name;
64
+ }
65
+ else {
66
+ logger_1.logger.warn(parsedPyProject
67
+ ? 'invalid pyproject.toml'
68
+ : `file ${this.addPath('pyproject.toml')} did not exist`);
69
+ }
70
+ if (!projectName) {
71
+ logger_1.logger.warn('No project/component found.');
72
+ }
73
+ else {
74
+ updates.push({
75
+ path: this.addPath(`${projectName}/__init__.py`),
76
+ createIfMissing: false,
77
+ updater: new python_file_with_version_1.PythonFileWithVersion({
78
+ version,
79
+ }),
80
+ });
81
+ updates.push({
82
+ path: this.addPath(`src/${projectName}/__init__.py`),
83
+ createIfMissing: false,
84
+ updater: new python_file_with_version_1.PythonFileWithVersion({
85
+ version,
86
+ }),
87
+ });
88
+ }
89
+ // There should be only one version.py, but foreach in case that is incorrect
90
+ const versionPyFilesSearch = this.github.findFilesByFilename('version.py', this.path);
91
+ const versionPyFiles = await versionPyFilesSearch;
92
+ versionPyFiles.forEach(path => {
93
+ updates.push({
94
+ path: this.addPath(path),
95
+ createIfMissing: false,
96
+ updater: new python_file_with_version_1.PythonFileWithVersion({
97
+ version,
98
+ }),
99
+ });
100
+ });
101
+ return updates;
102
+ }
103
+ async getPyProject(path) {
104
+ try {
105
+ const content = await this.github.getFileContentsOnBranch(path, this.targetBranch);
106
+ return pyproject_toml_1.parsePyProject(content.parsedContent);
107
+ }
108
+ catch (e) {
109
+ return null;
110
+ }
111
+ }
112
+ initialReleaseVersion() {
113
+ return version_1.Version.parse('0.1.0');
114
+ }
115
+ }
116
+ exports.Python = Python;
117
+ //# sourceMappingURL=python.js.map
@@ -0,0 +1,17 @@
1
+ import { StrategyOptions, Strategy, BuildUpdatesOptions } from '../strategy';
2
+ import { ConventionalCommit } from '../commit';
3
+ import { Update } from '../update';
4
+ import { Release } from '../release';
5
+ import { Version } from '../version';
6
+ import { TagName } from '../util/tag-name';
7
+ interface RubyYoshiStrategyOptions extends StrategyOptions {
8
+ versionFile?: string;
9
+ }
10
+ export declare class RubyYoshi extends Strategy {
11
+ readonly versionFile: string;
12
+ constructor(options: RubyYoshiStrategyOptions);
13
+ protected buildUpdates(options: BuildUpdatesOptions): Promise<Update[]>;
14
+ protected postProcessCommits(commits: ConventionalCommit[]): ConventionalCommit[];
15
+ protected buildReleaseNotes(conventionalCommits: ConventionalCommit[], newVersion: Version, newVersionTag: TagName, latestRelease?: Release): Promise<string>;
16
+ }
17
+ export {};