release-please 12.6.1 → 12.6.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.
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/build/src/bootstrapper.d.ts +0 -12
- package/build/src/bootstrapper.js +0 -60
- package/build/src/changelog-notes/default.d.ts +0 -15
- package/build/src/changelog-notes/default.js +0 -71
- package/build/src/changelog-notes/github.d.ts +0 -8
- package/build/src/changelog-notes/github.js +0 -26
- package/build/src/changelog-notes.d.ts +0 -19
- package/build/src/changelog-notes.js +0 -16
- package/build/src/commit.d.ts +0 -26
- package/build/src/commit.js +0 -316
- package/build/src/plugin.d.ts +0 -20
- package/build/src/plugin.js +0 -31
- package/build/src/plugins/merge.d.ts +0 -11
- package/build/src/plugins/merge.js +0 -83
- package/build/src/plugins/workspace.d.ts +0 -102
- package/build/src/plugins/workspace.js +0 -170
- package/build/src/pull-request.d.ts +0 -10
- package/build/src/pull-request.js +0 -16
- package/build/src/release-notes.d.ts +0 -29
- package/build/src/release-notes.js +0 -71
- package/build/src/release-pull-request.d.ts +0 -13
- package/build/src/release-pull-request.js +0 -16
- package/build/src/release.d.ts +0 -6
- package/build/src/release.js +0 -16
- package/build/src/repository.d.ts +0 -5
- package/build/src/repository.js +0 -16
- package/build/src/strategies/dart.d.ts +0 -8
- package/build/src/strategies/dart.js +0 -63
- package/build/src/strategies/elixir.d.ts +0 -5
- package/build/src/strategies/elixir.js +0 -45
- package/build/src/strategies/go-yoshi.d.ts +0 -13
- package/build/src/strategies/go-yoshi.js +0 -114
- package/build/src/strategies/go.d.ts +0 -5
- package/build/src/strategies/go.js +0 -36
- package/build/src/strategies/helm.d.ts +0 -8
- package/build/src/strategies/helm.js +0 -63
- package/build/src/strategies/java-yoshi.d.ts +0 -25
- package/build/src/strategies/java-yoshi.js +0 -259
- package/build/src/strategies/krm-blueprint.d.ts +0 -7
- package/build/src/strategies/krm-blueprint.js +0 -64
- package/build/src/strategies/node.d.ts +0 -9
- package/build/src/strategies/node.js +0 -82
- package/build/src/strategies/ocaml.d.ts +0 -5
- package/build/src/strategies/ocaml.js +0 -75
- package/build/src/strategies/php-yoshi.d.ts +0 -10
- package/build/src/strategies/php-yoshi.js +0 -214
- package/build/src/strategies/php.d.ts +0 -6
- package/build/src/strategies/php.js +0 -67
- package/build/src/strategies/python.d.ts +0 -8
- package/build/src/strategies/python.js +0 -117
- package/build/src/strategies/ruby-yoshi.d.ts +0 -17
- package/build/src/strategies/ruby-yoshi.js +0 -116
- package/build/src/strategies/ruby.d.ts +0 -13
- package/build/src/strategies/ruby.js +0 -61
- package/build/src/strategies/rust.d.ts +0 -20
- package/build/src/strategies/rust.js +0 -120
- package/build/src/strategies/simple.d.ts +0 -5
- package/build/src/strategies/simple.js +0 -45
- package/build/src/strategies/terraform-module.d.ts +0 -7
- package/build/src/strategies/terraform-module.js +0 -72
- package/build/src/strategy.d.ts +0 -103
- package/build/src/strategy.js +0 -249
- package/build/src/update.d.ts +0 -23
- package/build/src/update.js +0 -16
- package/build/src/updaters/composite.d.ts +0 -19
- package/build/src/updaters/composite.js +0 -42
- package/build/src/updaters/dart/pubspec-yaml.d.ts +0 -12
- package/build/src/updaters/dart/pubspec-yaml.js +0 -45
- package/build/src/updaters/default.d.ts +0 -21
- package/build/src/updaters/default.js +0 -36
- package/build/src/updaters/dotnet/csproj.d.ts +0 -12
- package/build/src/updaters/dotnet/csproj.js +0 -33
- package/build/src/updaters/elixir/elixir-mix-exs.d.ts +0 -12
- package/build/src/updaters/elixir/elixir-mix-exs.js +0 -37
- package/build/src/updaters/go/version-go.d.ts +0 -4
- package/build/src/updaters/go/version-go.js +0 -24
- package/build/src/updaters/java/java-update.d.ts +0 -14
- package/build/src/updaters/java/java-update.js +0 -76
- package/build/src/updaters/node/package-json.d.ts +0 -12
- package/build/src/updaters/node/package-json.js +0 -37
- package/build/src/updaters/node/package-lock-json.d.ts +0 -8
- package/build/src/updaters/node/package-lock-json.js +0 -36
- package/build/src/updaters/node/samples-package-json.d.ts +0 -23
- package/build/src/updaters/node/samples-package-json.js +0 -49
- package/build/src/updaters/php/php-client-version.d.ts +0 -12
- package/build/src/updaters/php/php-client-version.js +0 -32
- package/build/src/updaters/php/php-manifest.d.ts +0 -13
- package/build/src/updaters/php/php-manifest.js +0 -55
- package/build/src/updaters/php/root-composer-update-packages.d.ts +0 -12
- package/build/src/updaters/php/root-composer-update-packages.js +0 -47
- package/build/src/updaters/raw-content.d.ts +0 -19
- package/build/src/updaters/raw-content.js +0 -39
- package/build/src/updaters/release-please-config.d.ts +0 -8
- package/build/src/updaters/release-please-config.js +0 -41
- package/build/src/updaters/ruby/version-rb.d.ts +0 -12
- package/build/src/updaters/ruby/version-rb.js +0 -32
- package/build/src/util/commit-split.d.ts +0 -11
- package/build/src/util/commit-split.js +0 -94
- package/build/src/util/pull-request-body.d.ts +0 -20
- package/build/src/util/pull-request-body.js +0 -129
- package/build/src/util/tag-name.d.ts +0 -9
- package/build/src/util/tag-name.js +0 -41
- package/build/src/util/toml-edit.d.ts +0 -8
- package/build/src/util/toml-edit.js +0 -125
- package/build/src/version.d.ts +0 -11
- package/build/src/version.js +0 -45
- package/build/src/versioning-strategies/always-bump-patch.d.ts +0 -7
- package/build/src/versioning-strategies/always-bump-patch.js +0 -25
- package/build/src/versioning-strategies/default.d.ts +0 -15
- package/build/src/versioning-strategies/default.js +0 -67
- package/build/src/versioning-strategies/dependency-manifest.d.ts +0 -7
- package/build/src/versioning-strategies/dependency-manifest.js +0 -90
- package/build/src/versioning-strategies/java-add-snapshot.d.ts +0 -9
- package/build/src/versioning-strategies/java-add-snapshot.js +0 -53
- package/build/src/versioning-strategies/java-snapshot.d.ts +0 -9
- package/build/src/versioning-strategies/java-snapshot.js +0 -67
- package/build/src/versioning-strategies/service-pack.d.ts +0 -7
- package/build/src/versioning-strategies/service-pack.js +0 -40
- package/build/src/versioning-strategy.d.ts +0 -28
- package/build/src/versioning-strategy.js +0 -55
|
@@ -1,116 +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 indent_commit_1 = require("../util/indent-commit");
|
|
18
|
-
// Generic
|
|
19
|
-
const changelog_1 = require("../updaters/changelog");
|
|
20
|
-
// RubyYoshi
|
|
21
|
-
const version_rb_1 = require("../updaters/ruby/version-rb");
|
|
22
|
-
const strategy_1 = require("../strategy");
|
|
23
|
-
const fs_1 = require("fs");
|
|
24
|
-
const path_1 = require("path");
|
|
25
|
-
const manifest_1 = require("../manifest");
|
|
26
|
-
const CHANGELOG_SECTIONS = [
|
|
27
|
-
{ type: 'feat', section: 'Features' },
|
|
28
|
-
{ type: 'fix', section: 'Bug Fixes' },
|
|
29
|
-
{ type: 'perf', section: 'Performance Improvements' },
|
|
30
|
-
{ type: 'revert', section: 'Reverts' },
|
|
31
|
-
{ type: 'docs', section: 'Documentation' },
|
|
32
|
-
{ type: 'style', section: 'Styles', hidden: true },
|
|
33
|
-
{ type: 'chore', section: 'Miscellaneous Chores', hidden: true },
|
|
34
|
-
{ type: 'refactor', section: 'Code Refactoring', hidden: true },
|
|
35
|
-
{ type: 'test', section: 'Tests', hidden: true },
|
|
36
|
-
{ type: 'build', section: 'Build System', hidden: true },
|
|
37
|
-
{ type: 'ci', section: 'Continuous Integration', hidden: true },
|
|
38
|
-
];
|
|
39
|
-
class RubyYoshi extends strategy_1.Strategy {
|
|
40
|
-
constructor(options) {
|
|
41
|
-
var _a;
|
|
42
|
-
super({
|
|
43
|
-
...options,
|
|
44
|
-
changelogSections: CHANGELOG_SECTIONS,
|
|
45
|
-
commitPartial: fs_1.readFileSync(path_1.resolve(__dirname, '../../../templates/commit.hbs'), 'utf8'),
|
|
46
|
-
headerPartial: fs_1.readFileSync(path_1.resolve(__dirname, '../../../templates/header.hbs'), 'utf8'),
|
|
47
|
-
mainTemplate: fs_1.readFileSync(path_1.resolve(__dirname, '../../../templates/template.hbs'), 'utf8'),
|
|
48
|
-
tagSeparator: '/',
|
|
49
|
-
});
|
|
50
|
-
this.versionFile = (_a = options.versionFile) !== null && _a !== void 0 ? _a : '';
|
|
51
|
-
}
|
|
52
|
-
async buildUpdates(options) {
|
|
53
|
-
const updates = [];
|
|
54
|
-
const version = options.newVersion;
|
|
55
|
-
updates.push({
|
|
56
|
-
path: this.addPath(this.changelogPath),
|
|
57
|
-
createIfMissing: true,
|
|
58
|
-
updater: new changelog_1.Changelog({
|
|
59
|
-
version,
|
|
60
|
-
changelogEntry: options.changelogEntry,
|
|
61
|
-
}),
|
|
62
|
-
});
|
|
63
|
-
const versionFile = this.versionFile
|
|
64
|
-
? this.versionFile
|
|
65
|
-
: `lib/${(this.component || '').replace(/-/g, '/')}/version.rb`;
|
|
66
|
-
updates.push({
|
|
67
|
-
path: this.addPath(versionFile),
|
|
68
|
-
createIfMissing: false,
|
|
69
|
-
updater: new version_rb_1.VersionRB({
|
|
70
|
-
version,
|
|
71
|
-
}),
|
|
72
|
-
});
|
|
73
|
-
return updates;
|
|
74
|
-
}
|
|
75
|
-
postProcessCommits(commits) {
|
|
76
|
-
commits.forEach(commit => {
|
|
77
|
-
commit.message = indent_commit_1.indentCommit(commit);
|
|
78
|
-
});
|
|
79
|
-
return commits;
|
|
80
|
-
}
|
|
81
|
-
async buildReleaseNotes(conventionalCommits, newVersion, newVersionTag, latestRelease) {
|
|
82
|
-
const releaseNotes = await super.buildReleaseNotes(conventionalCommits, newVersion, newVersionTag, latestRelease);
|
|
83
|
-
if (!latestRelease) {
|
|
84
|
-
return releaseNotes;
|
|
85
|
-
}
|
|
86
|
-
// summarize the commits that landed:
|
|
87
|
-
let summary = '### Commits since last release:\n\n';
|
|
88
|
-
const updatedFiles = {};
|
|
89
|
-
const repoUrl = `${this.repository.owner}/${this.repository.repo}`;
|
|
90
|
-
for (const commit of conventionalCommits) {
|
|
91
|
-
if (!commit.sha)
|
|
92
|
-
continue;
|
|
93
|
-
const splitMessage = commit.message.split('\n');
|
|
94
|
-
summary += `* [${splitMessage[0]}](https://github.com/${repoUrl}/commit/${commit.sha})\n`;
|
|
95
|
-
if (splitMessage.length > 2) {
|
|
96
|
-
summary = `${summary}<pre><code>${splitMessage
|
|
97
|
-
.slice(1)
|
|
98
|
-
.join('\n')}</code></pre>\n`;
|
|
99
|
-
}
|
|
100
|
-
commit.files.forEach(file => {
|
|
101
|
-
if (this.path === manifest_1.ROOT_PROJECT_PATH || file.startsWith(this.path)) {
|
|
102
|
-
updatedFiles[file] = true;
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
// summarize the files that changed:
|
|
107
|
-
summary = `${summary}\n### Files edited since last release:\n\n<pre><code>`;
|
|
108
|
-
Object.keys(updatedFiles).forEach(file => {
|
|
109
|
-
summary += `${file}\n`;
|
|
110
|
-
});
|
|
111
|
-
summary += `</code></pre>\n[Compare Changes](https://github.com/${repoUrl}/compare/${latestRelease.sha}...HEAD)\n`;
|
|
112
|
-
return releaseNotes + `\n---\n${summary}`;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
exports.RubyYoshi = RubyYoshi;
|
|
116
|
-
//# sourceMappingURL=ruby-yoshi.js.map
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { StrategyOptions, Strategy, BuildUpdatesOptions } from '../strategy';
|
|
2
|
-
import { ConventionalCommit } from '../commit';
|
|
3
|
-
import { Update } from '../update';
|
|
4
|
-
interface RubyStrategyOptions extends StrategyOptions {
|
|
5
|
-
versionFile?: string;
|
|
6
|
-
}
|
|
7
|
-
export declare class Ruby extends Strategy {
|
|
8
|
-
readonly versionFile: string;
|
|
9
|
-
constructor(options: RubyStrategyOptions);
|
|
10
|
-
protected buildUpdates(options: BuildUpdatesOptions): Promise<Update[]>;
|
|
11
|
-
protected postProcessCommits(commits: ConventionalCommit[]): ConventionalCommit[];
|
|
12
|
-
}
|
|
13
|
-
export {};
|
|
@@ -1,61 +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.Ruby = void 0;
|
|
17
|
-
const indent_commit_1 = require("../util/indent-commit");
|
|
18
|
-
// Generic
|
|
19
|
-
const changelog_1 = require("../updaters/changelog");
|
|
20
|
-
// Ruby
|
|
21
|
-
const version_rb_1 = require("../updaters/ruby/version-rb");
|
|
22
|
-
const strategy_1 = require("../strategy");
|
|
23
|
-
class Ruby extends strategy_1.Strategy {
|
|
24
|
-
constructor(options) {
|
|
25
|
-
var _a;
|
|
26
|
-
super(options);
|
|
27
|
-
this.versionFile = (_a = options.versionFile) !== null && _a !== void 0 ? _a : '';
|
|
28
|
-
this.tagSeparator = '/';
|
|
29
|
-
}
|
|
30
|
-
async buildUpdates(options) {
|
|
31
|
-
const updates = [];
|
|
32
|
-
const version = options.newVersion;
|
|
33
|
-
updates.push({
|
|
34
|
-
path: this.addPath(this.changelogPath),
|
|
35
|
-
createIfMissing: true,
|
|
36
|
-
updater: new changelog_1.Changelog({
|
|
37
|
-
version,
|
|
38
|
-
changelogEntry: options.changelogEntry,
|
|
39
|
-
}),
|
|
40
|
-
});
|
|
41
|
-
const versionFile = this.versionFile
|
|
42
|
-
? this.versionFile
|
|
43
|
-
: `lib/${(this.component || '').replace(/-/g, '/')}/version.rb`;
|
|
44
|
-
updates.push({
|
|
45
|
-
path: this.addPath(versionFile),
|
|
46
|
-
createIfMissing: false,
|
|
47
|
-
updater: new version_rb_1.VersionRB({
|
|
48
|
-
version,
|
|
49
|
-
}),
|
|
50
|
-
});
|
|
51
|
-
return updates;
|
|
52
|
-
}
|
|
53
|
-
postProcessCommits(commits) {
|
|
54
|
-
commits.forEach(commit => {
|
|
55
|
-
commit.message = indent_commit_1.indentCommit(commit);
|
|
56
|
-
});
|
|
57
|
-
return commits;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
exports.Ruby = Ruby;
|
|
61
|
-
//# sourceMappingURL=ruby.js.map
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { CargoManifest } from '../updaters/rust/common';
|
|
2
|
-
import { Strategy, BuildUpdatesOptions } from '../strategy';
|
|
3
|
-
import { Version } from '../version';
|
|
4
|
-
import { Update } from '../update';
|
|
5
|
-
export declare class Rust extends Strategy {
|
|
6
|
-
private packageManifest?;
|
|
7
|
-
private workspaceManifest?;
|
|
8
|
-
protected buildUpdates(options: BuildUpdatesOptions): Promise<Update[]>;
|
|
9
|
-
protected initialReleaseVersion(): Version;
|
|
10
|
-
getDefaultPackageName(): Promise<string | undefined>;
|
|
11
|
-
/**
|
|
12
|
-
* @returns the package's manifest, ie. `crates/foobar/Cargo.toml`
|
|
13
|
-
*/
|
|
14
|
-
protected getPackageManifest(): Promise<CargoManifest | null>;
|
|
15
|
-
/**
|
|
16
|
-
* @returns the workspace's manifest, ie. `Cargo.toml` (top-level)
|
|
17
|
-
*/
|
|
18
|
-
protected getWorkspaceManifest(): Promise<CargoManifest | null>;
|
|
19
|
-
protected getManifest(path: string): Promise<CargoManifest | null>;
|
|
20
|
-
}
|
|
@@ -1,120 +0,0 @@
|
|
|
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.Rust = void 0;
|
|
17
|
-
// Generic
|
|
18
|
-
const changelog_1 = require("../updaters/changelog");
|
|
19
|
-
// Cargo.toml support
|
|
20
|
-
const cargo_toml_1 = require("../updaters/rust/cargo-toml");
|
|
21
|
-
const cargo_lock_1 = require("../updaters/rust/cargo-lock");
|
|
22
|
-
const common_1 = require("../updaters/rust/common");
|
|
23
|
-
const logger_1 = require("../util/logger");
|
|
24
|
-
const strategy_1 = require("../strategy");
|
|
25
|
-
const version_1 = require("../version");
|
|
26
|
-
class Rust extends strategy_1.Strategy {
|
|
27
|
-
async buildUpdates(options) {
|
|
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
|
-
const workspaceManifest = await this.getWorkspaceManifest();
|
|
39
|
-
const manifestPaths = [];
|
|
40
|
-
let lockPath;
|
|
41
|
-
if (workspaceManifest &&
|
|
42
|
-
workspaceManifest.workspace &&
|
|
43
|
-
workspaceManifest.workspace.members) {
|
|
44
|
-
const members = workspaceManifest.workspace.members;
|
|
45
|
-
logger_1.logger.info(`found workspace with ${members.length} members, upgrading all`);
|
|
46
|
-
for (const member of members) {
|
|
47
|
-
manifestPaths.push(`${member}/Cargo.toml`);
|
|
48
|
-
}
|
|
49
|
-
lockPath = 'Cargo.lock';
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
const manifestPath = this.addPath('Cargo.toml');
|
|
53
|
-
logger_1.logger.info(`single crate found, updating ${manifestPath}`);
|
|
54
|
-
manifestPaths.push(manifestPath);
|
|
55
|
-
lockPath = this.addPath('Cargo.lock');
|
|
56
|
-
}
|
|
57
|
-
const versionsMap = new Map();
|
|
58
|
-
versionsMap.set(this.component || '', version);
|
|
59
|
-
for (const path of manifestPaths) {
|
|
60
|
-
updates.push({
|
|
61
|
-
path,
|
|
62
|
-
createIfMissing: false,
|
|
63
|
-
updater: new cargo_toml_1.CargoToml({
|
|
64
|
-
version,
|
|
65
|
-
versionsMap,
|
|
66
|
-
}),
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
updates.push({
|
|
70
|
-
path: lockPath,
|
|
71
|
-
createIfMissing: false,
|
|
72
|
-
updater: new cargo_lock_1.CargoLock({
|
|
73
|
-
version,
|
|
74
|
-
versionsMap,
|
|
75
|
-
}),
|
|
76
|
-
});
|
|
77
|
-
return updates;
|
|
78
|
-
}
|
|
79
|
-
initialReleaseVersion() {
|
|
80
|
-
return version_1.Version.parse('0.1.0');
|
|
81
|
-
}
|
|
82
|
-
async getDefaultPackageName() {
|
|
83
|
-
var _a;
|
|
84
|
-
const packageManifest = await this.getPackageManifest();
|
|
85
|
-
if (packageManifest) {
|
|
86
|
-
return (_a = packageManifest.package) === null || _a === void 0 ? void 0 : _a.name;
|
|
87
|
-
}
|
|
88
|
-
return undefined;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* @returns the package's manifest, ie. `crates/foobar/Cargo.toml`
|
|
92
|
-
*/
|
|
93
|
-
async getPackageManifest() {
|
|
94
|
-
if (this.packageManifest === undefined) {
|
|
95
|
-
this.packageManifest = await this.getManifest(this.addPath('Cargo.toml'));
|
|
96
|
-
}
|
|
97
|
-
return this.packageManifest;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* @returns the workspace's manifest, ie. `Cargo.toml` (top-level)
|
|
101
|
-
*/
|
|
102
|
-
async getWorkspaceManifest() {
|
|
103
|
-
if (this.workspaceManifest === undefined) {
|
|
104
|
-
this.workspaceManifest = await this.getManifest('Cargo.toml');
|
|
105
|
-
}
|
|
106
|
-
return this.workspaceManifest;
|
|
107
|
-
}
|
|
108
|
-
async getManifest(path) {
|
|
109
|
-
let content;
|
|
110
|
-
try {
|
|
111
|
-
content = await this.github.getFileContentsOnBranch(path, this.targetBranch);
|
|
112
|
-
}
|
|
113
|
-
catch (e) {
|
|
114
|
-
return null;
|
|
115
|
-
}
|
|
116
|
-
return common_1.parseCargoManifest(content.parsedContent);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
exports.Rust = Rust;
|
|
120
|
-
//# sourceMappingURL=rust.js.map
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright 2020 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.Simple = void 0;
|
|
17
|
-
// Generic
|
|
18
|
-
const changelog_1 = require("../updaters/changelog");
|
|
19
|
-
// version.txt support
|
|
20
|
-
const strategy_1 = require("../strategy");
|
|
21
|
-
const default_1 = require("../updaters/default");
|
|
22
|
-
class Simple extends strategy_1.Strategy {
|
|
23
|
-
async buildUpdates(options) {
|
|
24
|
-
const updates = [];
|
|
25
|
-
const version = options.newVersion;
|
|
26
|
-
updates.push({
|
|
27
|
-
path: this.addPath(this.changelogPath),
|
|
28
|
-
createIfMissing: true,
|
|
29
|
-
updater: new changelog_1.Changelog({
|
|
30
|
-
version,
|
|
31
|
-
changelogEntry: options.changelogEntry,
|
|
32
|
-
}),
|
|
33
|
-
});
|
|
34
|
-
updates.push({
|
|
35
|
-
path: this.addPath('version.txt'),
|
|
36
|
-
createIfMissing: false,
|
|
37
|
-
updater: new default_1.DefaultUpdater({
|
|
38
|
-
version,
|
|
39
|
-
}),
|
|
40
|
-
});
|
|
41
|
-
return updates;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.Simple = Simple;
|
|
45
|
-
//# sourceMappingURL=simple.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Strategy, BuildUpdatesOptions } from '../strategy';
|
|
2
|
-
import { Update } from '../update';
|
|
3
|
-
import { Version } from '../version';
|
|
4
|
-
export declare class TerraformModule extends Strategy {
|
|
5
|
-
protected buildUpdates(options: BuildUpdatesOptions): Promise<Update[]>;
|
|
6
|
-
protected initialReleaseVersion(): Version;
|
|
7
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright 2020 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.TerraformModule = void 0;
|
|
17
|
-
// Generic
|
|
18
|
-
const changelog_1 = require("../updaters/changelog");
|
|
19
|
-
// Terraform specific.
|
|
20
|
-
const readme_1 = require("../updaters/terraform/readme");
|
|
21
|
-
const module_version_1 = require("../updaters/terraform/module-version");
|
|
22
|
-
const strategy_1 = require("../strategy");
|
|
23
|
-
const version_1 = require("../version");
|
|
24
|
-
class TerraformModule extends strategy_1.Strategy {
|
|
25
|
-
async buildUpdates(options) {
|
|
26
|
-
const updates = [];
|
|
27
|
-
const version = options.newVersion;
|
|
28
|
-
updates.push({
|
|
29
|
-
path: this.addPath(this.changelogPath),
|
|
30
|
-
createIfMissing: true,
|
|
31
|
-
updater: new changelog_1.Changelog({
|
|
32
|
-
version,
|
|
33
|
-
changelogEntry: options.changelogEntry,
|
|
34
|
-
}),
|
|
35
|
-
});
|
|
36
|
-
// Update version in README to current candidate version.
|
|
37
|
-
// A module may have submodules, so find all submodules.
|
|
38
|
-
const readmeFiles = await this.github.findFilesByFilename('readme.md', this.path);
|
|
39
|
-
readmeFiles.forEach(path => {
|
|
40
|
-
updates.push({
|
|
41
|
-
path: this.addPath(path),
|
|
42
|
-
createIfMissing: false,
|
|
43
|
-
updater: new readme_1.ReadMe({
|
|
44
|
-
version,
|
|
45
|
-
}),
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
// Update versions.tf to current candidate version.
|
|
49
|
-
// A module may have submodules, so find all versions.tfand versions.tf.tmpl to update.
|
|
50
|
-
const versionFiles = await Promise.all([
|
|
51
|
-
this.github.findFilesByFilename('versions.tf', this.path),
|
|
52
|
-
this.github.findFilesByFilename('versions.tf.tmpl', this.path),
|
|
53
|
-
]).then(([v, vt]) => {
|
|
54
|
-
return v.concat(vt);
|
|
55
|
-
});
|
|
56
|
-
versionFiles.forEach(path => {
|
|
57
|
-
updates.push({
|
|
58
|
-
path: this.addPath(path),
|
|
59
|
-
createIfMissing: false,
|
|
60
|
-
updater: new module_version_1.ModuleVersion({
|
|
61
|
-
version,
|
|
62
|
-
}),
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
return updates;
|
|
66
|
-
}
|
|
67
|
-
initialReleaseVersion() {
|
|
68
|
-
return version_1.Version.parse('0.1.0');
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
exports.TerraformModule = TerraformModule;
|
|
72
|
-
//# sourceMappingURL=terraform-module.js.map
|
package/build/src/strategy.d.ts
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { ReleasePullRequest } from './release-pull-request';
|
|
2
|
-
import { Release } from './release';
|
|
3
|
-
import { GitHub } from './github';
|
|
4
|
-
import { Version, VersionsMap } from './version';
|
|
5
|
-
import { Commit, ConventionalCommit } from './commit';
|
|
6
|
-
import { VersioningStrategy } from './versioning-strategy';
|
|
7
|
-
import { ChangelogNotes, ChangelogSection } from './changelog-notes';
|
|
8
|
-
import { Update } from './update';
|
|
9
|
-
import { Repository } from './repository';
|
|
10
|
-
import { PullRequest } from './pull-request';
|
|
11
|
-
import { TagName } from './util/tag-name';
|
|
12
|
-
export interface BuildUpdatesOptions {
|
|
13
|
-
changelogEntry: string;
|
|
14
|
-
newVersion: Version;
|
|
15
|
-
versionsMap: VersionsMap;
|
|
16
|
-
latestVersion?: Version;
|
|
17
|
-
}
|
|
18
|
-
export interface StrategyOptions {
|
|
19
|
-
path?: string;
|
|
20
|
-
bumpMinorPreMajor?: boolean;
|
|
21
|
-
bumpPatchForMinorPreMajor?: boolean;
|
|
22
|
-
github: GitHub;
|
|
23
|
-
component?: string;
|
|
24
|
-
packageName?: string;
|
|
25
|
-
versioningStrategy?: VersioningStrategy;
|
|
26
|
-
targetBranch: string;
|
|
27
|
-
changelogPath?: string;
|
|
28
|
-
changelogSections?: ChangelogSection[];
|
|
29
|
-
commitPartial?: string;
|
|
30
|
-
headerPartial?: string;
|
|
31
|
-
mainTemplate?: string;
|
|
32
|
-
tagSeparator?: string;
|
|
33
|
-
skipGitHubRelease?: boolean;
|
|
34
|
-
releaseAs?: string;
|
|
35
|
-
changelogNotes?: ChangelogNotes;
|
|
36
|
-
includeComponentInTag?: boolean;
|
|
37
|
-
pullRequestTitlePattern?: string;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* A strategy is responsible for determining which files are
|
|
41
|
-
* necessary to update in a release pull request.
|
|
42
|
-
*/
|
|
43
|
-
export declare abstract class Strategy {
|
|
44
|
-
readonly path: string;
|
|
45
|
-
protected github: GitHub;
|
|
46
|
-
readonly component?: string;
|
|
47
|
-
protected packageName?: string;
|
|
48
|
-
readonly versioningStrategy: VersioningStrategy;
|
|
49
|
-
protected targetBranch: string;
|
|
50
|
-
protected repository: Repository;
|
|
51
|
-
readonly changelogPath: string;
|
|
52
|
-
protected tagSeparator?: string;
|
|
53
|
-
private skipGitHubRelease;
|
|
54
|
-
private releaseAs?;
|
|
55
|
-
private includeComponentInTag;
|
|
56
|
-
private pullRequestTitlePattern?;
|
|
57
|
-
readonly changelogNotes: ChangelogNotes;
|
|
58
|
-
protected changelogSections?: ChangelogSection[];
|
|
59
|
-
constructor(options: StrategyOptions);
|
|
60
|
-
/**
|
|
61
|
-
* Specify the files necessary to update in a release pull request.
|
|
62
|
-
* @param {BuildUpdatesOptions} options
|
|
63
|
-
*/
|
|
64
|
-
protected abstract buildUpdates(options: BuildUpdatesOptions): Promise<Update[]>;
|
|
65
|
-
getComponent(): Promise<string | undefined>;
|
|
66
|
-
getDefaultComponent(): Promise<string | undefined>;
|
|
67
|
-
getDefaultPackageName(): Promise<string | undefined>;
|
|
68
|
-
protected normalizeComponent(component: string | undefined): string;
|
|
69
|
-
/**
|
|
70
|
-
* Override this method to post process commits
|
|
71
|
-
* @param {ConventionalCommit[]} commits parsed commits
|
|
72
|
-
* @returns {ConventionalCommit[]} modified commits
|
|
73
|
-
*/
|
|
74
|
-
protected postProcessCommits(commits: ConventionalCommit[]): ConventionalCommit[];
|
|
75
|
-
protected buildReleaseNotes(conventionalCommits: ConventionalCommit[], newVersion: Version, newVersionTag: TagName, latestRelease?: Release): Promise<string>;
|
|
76
|
-
/**
|
|
77
|
-
* Builds a candidate release pull request
|
|
78
|
-
* @param {Commit[]} commits Raw commits to consider for this release.
|
|
79
|
-
* @param {Release} latestRelease Optional. The last release for this
|
|
80
|
-
* component if available.
|
|
81
|
-
* @param {boolean} draft Optional. Whether or not to create the pull
|
|
82
|
-
* request as a draft. Defaults to `false`.
|
|
83
|
-
* @returns {ReleasePullRequest | undefined} The release pull request to
|
|
84
|
-
* open for this path/component. Returns undefined if we should not
|
|
85
|
-
* open a pull request.
|
|
86
|
-
*/
|
|
87
|
-
buildReleasePullRequest(commits: Commit[], latestRelease?: Release, draft?: boolean, labels?: string[]): Promise<ReleasePullRequest | undefined>;
|
|
88
|
-
protected changelogEmpty(changelogEntry: string): boolean;
|
|
89
|
-
protected updateVersionsMap(versionsMap: VersionsMap, conventionalCommits: ConventionalCommit[]): Promise<VersionsMap>;
|
|
90
|
-
protected buildNewVersion(conventionalCommits: ConventionalCommit[], latestRelease?: Release): Promise<Version>;
|
|
91
|
-
protected buildVersionsMap(_conventionalCommits: ConventionalCommit[]): Promise<VersionsMap>;
|
|
92
|
-
/**
|
|
93
|
-
* Given a merged pull request, build the candidate release.
|
|
94
|
-
* @param {PullRequest} mergedPullRequest The merged release pull request.
|
|
95
|
-
* @returns {Release} The candidate release.
|
|
96
|
-
*/
|
|
97
|
-
buildRelease(mergedPullRequest: PullRequest): Promise<Release | undefined>;
|
|
98
|
-
/**
|
|
99
|
-
* Override this to handle the initial version of a new library.
|
|
100
|
-
*/
|
|
101
|
-
protected initialReleaseVersion(): Version;
|
|
102
|
-
protected addPath(file: string): string;
|
|
103
|
-
}
|