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.
- package/CHANGELOG.md +7 -0
- package/README.md +4 -0
- package/build/src/bin/release-please.d.ts +55 -11
- package/build/src/bin/release-please.js +419 -152
- package/build/src/bootstrapper.d.ts +12 -0
- package/build/src/bootstrapper.js +60 -0
- package/build/src/changelog-notes/default.d.ts +17 -0
- package/build/src/changelog-notes/default.js +72 -0
- package/build/src/changelog-notes.d.ts +17 -0
- package/build/src/{updaters/java/readme.js → changelog-notes.js} +2 -7
- package/build/src/commit.d.ts +26 -0
- package/build/src/{util/to-conventional-changelog-format.js → commit.js} +97 -2
- package/build/src/errors/index.d.ts +0 -5
- package/build/src/errors/index.js +1 -10
- package/build/src/factory.d.ts +25 -37
- package/build/src/factory.js +160 -150
- package/build/src/github.d.ts +154 -884
- package/build/src/github.js +608 -1036
- package/build/src/manifest.d.ts +191 -47
- package/build/src/manifest.js +599 -487
- package/build/src/plugin.d.ts +20 -0
- package/build/src/{plugins/plugin.js → plugin.js} +10 -9
- package/build/src/plugins/cargo-workspace.d.ts +48 -18
- package/build/src/plugins/cargo-workspace.js +247 -328
- package/build/src/plugins/merge.d.ts +11 -0
- package/build/src/plugins/merge.js +83 -0
- package/build/src/plugins/node-workspace.d.ts +35 -17
- package/build/src/plugins/node-workspace.js +234 -271
- package/build/src/plugins/workspace.d.ts +102 -0
- package/build/src/plugins/workspace.js +170 -0
- package/build/src/pull-request.d.ts +10 -0
- package/build/src/{updaters/java/pom-xml.js → pull-request.js} +2 -7
- package/build/src/release-notes.d.ts +29 -0
- package/build/src/release-notes.js +71 -0
- package/build/src/release-pull-request.d.ts +13 -0
- package/build/src/release-pull-request.js +16 -0
- package/build/src/release.d.ts +6 -0
- package/build/src/release.js +16 -0
- package/build/src/repository.d.ts +5 -0
- package/build/src/repository.js +16 -0
- package/build/src/strategies/dart.d.ts +8 -0
- package/build/src/strategies/dart.js +63 -0
- package/build/src/strategies/elixir.d.ts +5 -0
- package/build/src/{releasers → strategies}/elixir.js +18 -14
- package/build/src/strategies/go-yoshi.d.ts +13 -0
- package/build/src/strategies/go-yoshi.js +106 -0
- package/build/src/strategies/go.d.ts +5 -0
- package/build/src/{releasers → strategies}/go.js +11 -12
- package/build/src/strategies/helm.d.ts +8 -0
- package/build/src/strategies/helm.js +63 -0
- package/build/src/strategies/java-yoshi.d.ts +24 -0
- package/build/src/strategies/java-yoshi.js +203 -0
- package/build/src/strategies/krm-blueprint.d.ts +7 -0
- package/build/src/{releasers → strategies}/krm-blueprint.js +26 -22
- package/build/src/strategies/node.d.ts +9 -0
- package/build/src/strategies/node.js +82 -0
- package/build/src/strategies/ocaml.d.ts +5 -0
- package/build/src/{releasers → strategies}/ocaml.js +34 -28
- package/build/src/strategies/php-yoshi.d.ts +10 -0
- package/build/src/strategies/php-yoshi.js +213 -0
- package/build/src/strategies/php.d.ts +6 -0
- package/build/src/{releasers → strategies}/php.js +24 -23
- package/build/src/strategies/python.d.ts +8 -0
- package/build/src/strategies/python.js +117 -0
- package/build/src/strategies/ruby-yoshi.d.ts +17 -0
- package/build/src/strategies/ruby-yoshi.js +116 -0
- package/build/src/strategies/ruby.d.ts +13 -0
- package/build/src/{releasers → strategies}/ruby.js +26 -27
- package/build/src/strategies/rust.d.ts +20 -0
- package/build/src/strategies/rust.js +120 -0
- package/build/src/strategies/simple.d.ts +5 -0
- package/build/src/{releasers → strategies}/simple.js +18 -14
- package/build/src/strategies/terraform-module.d.ts +7 -0
- package/build/src/{releasers → strategies}/terraform-module.js +29 -23
- package/build/src/strategy.d.ts +100 -0
- package/build/src/strategy.js +233 -0
- package/build/src/update.d.ts +23 -0
- package/build/src/{updaters/update.js → update.js} +1 -1
- package/build/src/updaters/changelog.d.ts +7 -10
- package/build/src/updaters/changelog.js +3 -9
- package/build/src/updaters/changelog.js.map +1 -1
- package/build/src/updaters/composite.d.ts +19 -0
- package/build/src/updaters/composite.js +42 -0
- package/build/src/updaters/dart/pubspec-yaml.d.ts +12 -0
- package/build/src/updaters/{pubspec-yaml.js → dart/pubspec-yaml.js} +13 -12
- package/build/src/updaters/default.d.ts +21 -0
- package/build/src/updaters/{version-txt.js → default.js} +16 -10
- package/build/src/updaters/dotnet/csproj.d.ts +12 -0
- package/build/src/updaters/{java/google-utils.js → dotnet/csproj.js} +16 -13
- package/build/src/updaters/elixir/elixir-mix-exs.d.ts +12 -0
- package/build/src/updaters/{elixir-mix-exs.js → elixir/elixir-mix-exs.js} +12 -10
- package/build/src/updaters/helm/chart-yaml.d.ts +10 -11
- package/build/src/updaters/helm/chart-yaml.js +12 -10
- package/build/src/updaters/java/java-update.d.ts +14 -0
- package/build/src/updaters/java/{java_update.js → java-update.js} +22 -22
- package/build/src/updaters/java/versions-manifest.d.ts +12 -2
- package/build/src/updaters/java/versions-manifest.js +20 -4
- package/build/src/updaters/krm/krm-blueprint-version.d.ts +10 -11
- package/build/src/updaters/krm/krm-blueprint-version.js +13 -12
- package/build/src/updaters/node/package-json.d.ts +12 -0
- package/build/src/updaters/{package-json.js → node/package-json.js} +14 -16
- package/build/src/updaters/node/package-lock-json.d.ts +8 -0
- package/build/src/updaters/node/package-lock-json.js +36 -0
- package/build/src/updaters/node/samples-package-json.d.ts +23 -0
- package/build/src/updaters/{samples-package-json.js → node/samples-package-json.js} +19 -8
- package/build/src/updaters/ocaml/dune-project.d.ts +10 -11
- package/build/src/updaters/ocaml/dune-project.js +11 -9
- package/build/src/updaters/ocaml/esy-json.d.ts +10 -11
- package/build/src/updaters/ocaml/esy-json.js +12 -10
- package/build/src/updaters/ocaml/opam.d.ts +10 -11
- package/build/src/updaters/ocaml/opam.js +11 -9
- package/build/src/updaters/php/php-client-version.d.ts +12 -0
- package/build/src/updaters/{php-client-version.js → php/php-client-version.js} +10 -9
- package/build/src/updaters/php/php-manifest.d.ts +13 -0
- package/build/src/updaters/{php-manifest.js → php/php-manifest.js} +17 -15
- package/build/src/updaters/php/root-composer-update-packages.d.ts +12 -0
- package/build/src/updaters/{root-composer-update-packages.js → php/root-composer-update-packages.js} +17 -16
- package/build/src/updaters/python/pyproject-toml.d.ts +10 -11
- package/build/src/updaters/python/pyproject-toml.js +13 -11
- package/build/src/updaters/python/python-file-with-version.d.ts +7 -11
- package/build/src/updaters/python/python-file-with-version.js +7 -8
- package/build/src/updaters/python/setup-cfg.d.ts +10 -11
- package/build/src/updaters/python/setup-cfg.js +10 -8
- package/build/src/updaters/python/setup-py.d.ts +10 -11
- package/build/src/updaters/python/setup-py.js +10 -8
- package/build/src/updaters/raw-content.d.ts +19 -0
- package/build/src/{plugins/index.js → updaters/raw-content.js} +23 -12
- package/build/src/updaters/release-please-config.d.ts +8 -0
- package/build/src/updaters/release-please-config.js +41 -0
- package/build/src/updaters/release-please-manifest.d.ts +2 -11
- package/build/src/updaters/release-please-manifest.js +11 -14
- package/build/src/updaters/ruby/version-rb.d.ts +12 -0
- package/build/src/updaters/{version-rb.js → ruby/version-rb.js} +10 -8
- package/build/src/updaters/rust/cargo-lock.d.ts +7 -11
- package/build/src/updaters/rust/cargo-lock.js +14 -16
- package/build/src/updaters/rust/cargo-toml.d.ts +7 -11
- package/build/src/updaters/rust/cargo-toml.js +19 -21
- package/build/src/updaters/terraform/module-version.d.ts +10 -11
- package/build/src/updaters/terraform/module-version.js +11 -9
- package/build/src/updaters/terraform/readme.d.ts +10 -11
- package/build/src/updaters/terraform/readme.js +11 -10
- package/build/src/updaters/terraform/readme.js.map +1 -1
- package/build/src/util/branch-name.d.ts +5 -4
- package/build/src/util/branch-name.js +13 -10
- package/build/src/{commit-split.d.ts → util/commit-split.d.ts} +2 -4
- package/build/src/{commit-split.js → util/commit-split.js} +4 -2
- package/build/src/util/indent-commit.d.ts +1 -1
- package/build/src/util/logger.d.ts +5 -2
- package/build/src/util/logger.js +9 -4
- package/build/src/util/pull-request-body.d.ts +20 -0
- package/build/src/util/pull-request-body.js +129 -0
- package/build/src/util/pull-request-title.d.ts +8 -6
- package/build/src/util/pull-request-title.js +20 -6
- package/build/src/util/tag-name.d.ts +9 -0
- package/build/src/util/tag-name.js +41 -0
- package/build/src/{updaters → util}/toml-edit.d.ts +0 -0
- package/build/src/{updaters → util}/toml-edit.js +0 -0
- package/build/src/version.d.ts +11 -0
- package/build/src/version.js +45 -0
- package/build/src/versioning-strategies/always-bump-patch.d.ts +7 -0
- package/build/src/{updaters/package-lock-json.js → versioning-strategies/always-bump-patch.js} +8 -11
- package/build/src/versioning-strategies/default.d.ts +15 -0
- package/build/src/versioning-strategies/default.js +67 -0
- package/build/src/versioning-strategies/dependency-manifest.d.ts +7 -0
- package/build/src/versioning-strategies/dependency-manifest.js +90 -0
- package/build/src/versioning-strategies/java-add-snapshot.d.ts +9 -0
- package/build/src/versioning-strategies/java-add-snapshot.js +53 -0
- package/build/src/versioning-strategies/java-snapshot.d.ts +9 -0
- package/build/src/versioning-strategies/java-snapshot.js +67 -0
- package/build/src/versioning-strategies/service-pack.d.ts +7 -0
- package/build/src/versioning-strategies/service-pack.js +40 -0
- package/build/src/versioning-strategy.d.ts +28 -0
- package/build/src/versioning-strategy.js +55 -0
- package/package.json +9 -8
- package/build/src/constants.d.ts +0 -6
- package/build/src/constants.js +0 -23
- package/build/src/conventional-commits.d.ts +0 -53
- package/build/src/conventional-commits.js +0 -167
- package/build/src/github-release.d.ts +0 -34
- package/build/src/github-release.js +0 -92
- package/build/src/graphql-to-commits.d.ts +0 -60
- package/build/src/graphql-to-commits.js +0 -112
- package/build/src/index.d.ts +0 -94
- package/build/src/index.js +0 -32
- package/build/src/plugins/index.d.ts +0 -5
- package/build/src/plugins/plugin.d.ts +0 -21
- package/build/src/release-pr.d.ts +0 -101
- package/build/src/release-pr.js +0 -461
- package/build/src/releasers/dart.d.ts +0 -9
- package/build/src/releasers/dart.js +0 -65
- package/build/src/releasers/elixir.d.ts +0 -5
- package/build/src/releasers/go-yoshi.d.ts +0 -10
- package/build/src/releasers/go-yoshi.js +0 -162
- package/build/src/releasers/go.d.ts +0 -6
- package/build/src/releasers/helm.d.ts +0 -9
- package/build/src/releasers/helm.js +0 -66
- package/build/src/releasers/index.d.ts +0 -7
- package/build/src/releasers/index.js +0 -76
- package/build/src/releasers/java/bump_type.d.ts +0 -4
- package/build/src/releasers/java/bump_type.js +0 -38
- package/build/src/releasers/java/stability.d.ts +0 -5
- package/build/src/releasers/java/stability.js +0 -37
- package/build/src/releasers/java/version.d.ts +0 -13
- package/build/src/releasers/java/version.js +0 -112
- package/build/src/releasers/java-backport.d.ts +0 -9
- package/build/src/releasers/java-backport.js +0 -43
- package/build/src/releasers/java-bom.d.ts +0 -16
- package/build/src/releasers/java-bom.js +0 -83
- package/build/src/releasers/java-lts.d.ts +0 -9
- package/build/src/releasers/java-lts.js +0 -47
- package/build/src/releasers/java-yoshi.d.ts +0 -28
- package/build/src/releasers/java-yoshi.js +0 -304
- package/build/src/releasers/krm-blueprint.d.ts +0 -6
- package/build/src/releasers/node.d.ts +0 -10
- package/build/src/releasers/node.js +0 -84
- package/build/src/releasers/ocaml.d.ts +0 -5
- package/build/src/releasers/php-yoshi.d.ts +0 -5
- package/build/src/releasers/php-yoshi.js +0 -191
- package/build/src/releasers/php.d.ts +0 -7
- package/build/src/releasers/python.d.ts +0 -11
- package/build/src/releasers/python.js +0 -127
- package/build/src/releasers/ruby-yoshi.d.ts +0 -5
- package/build/src/releasers/ruby-yoshi.js +0 -142
- package/build/src/releasers/ruby.d.ts +0 -11
- package/build/src/releasers/rust.d.ts +0 -30
- package/build/src/releasers/rust.js +0 -163
- package/build/src/releasers/simple.d.ts +0 -5
- package/build/src/releasers/terraform-module.d.ts +0 -6
- package/build/src/updaters/elixir-mix-exs.d.ts +0 -13
- package/build/src/updaters/java/google-utils.d.ts +0 -13
- package/build/src/updaters/java/java_update.d.ts +0 -13
- package/build/src/updaters/java/pom-xml.d.ts +0 -3
- package/build/src/updaters/java/readme.d.ts +0 -3
- package/build/src/updaters/java/readme.js.map +0 -1
- package/build/src/updaters/package-json.d.ts +0 -16
- package/build/src/updaters/package-lock-json.d.ts +0 -7
- package/build/src/updaters/php-client-version.d.ts +0 -13
- package/build/src/updaters/php-manifest.d.ts +0 -13
- package/build/src/updaters/pubspec-yaml.d.ts +0 -13
- package/build/src/updaters/root-composer-update-package.d.ts +0 -13
- package/build/src/updaters/root-composer-update-package.js +0 -45
- package/build/src/updaters/root-composer-update-packages.d.ts +0 -13
- package/build/src/updaters/samples-package-json.d.ts +0 -13
- package/build/src/updaters/update.d.ts +0 -20
- package/build/src/updaters/version-rb.d.ts +0 -13
- package/build/src/updaters/version-txt.d.ts +0 -12
- package/build/src/updaters/version.d.ts +0 -13
- package/build/src/updaters/version.js +0 -31
- package/build/src/util/checkpoint.d.ts +0 -6
- package/build/src/util/checkpoint.js +0 -33
- package/build/src/util/release-notes.d.ts +0 -7
- package/build/src/util/release-notes.js +0 -34
- package/build/src/util/to-conventional-changelog-format.d.ts +0 -2
package/build/src/factory.js
CHANGED
|
@@ -13,170 +13,180 @@
|
|
|
13
13
|
// See the License for the specific language governing permissions and
|
|
14
14
|
// limitations under the License.
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.
|
|
16
|
+
exports.buildPlugin = exports.buildStrategy = exports.getVersioningStrategyTypes = exports.getReleaserTypes = void 0;
|
|
17
|
+
const go_1 = require("./strategies/go");
|
|
18
|
+
const go_yoshi_1 = require("./strategies/go-yoshi");
|
|
19
|
+
const java_yoshi_1 = require("./strategies/java-yoshi");
|
|
20
|
+
const krm_blueprint_1 = require("./strategies/krm-blueprint");
|
|
21
|
+
const ocaml_1 = require("./strategies/ocaml");
|
|
22
|
+
const php_1 = require("./strategies/php");
|
|
23
|
+
const php_yoshi_1 = require("./strategies/php-yoshi");
|
|
24
|
+
const python_1 = require("./strategies/python");
|
|
25
|
+
const ruby_1 = require("./strategies/ruby");
|
|
26
|
+
const ruby_yoshi_1 = require("./strategies/ruby-yoshi");
|
|
27
|
+
const rust_1 = require("./strategies/rust");
|
|
28
|
+
const simple_1 = require("./strategies/simple");
|
|
29
|
+
const terraform_module_1 = require("./strategies/terraform-module");
|
|
30
|
+
const helm_1 = require("./strategies/helm");
|
|
31
|
+
const elixir_1 = require("./strategies/elixir");
|
|
32
|
+
const dart_1 = require("./strategies/dart");
|
|
33
|
+
const node_1 = require("./strategies/node");
|
|
34
|
+
const default_1 = require("./versioning-strategies/default");
|
|
35
|
+
const always_bump_patch_1 = require("./versioning-strategies/always-bump-patch");
|
|
36
|
+
const service_pack_1 = require("./versioning-strategies/service-pack");
|
|
37
|
+
const dependency_manifest_1 = require("./versioning-strategies/dependency-manifest");
|
|
38
|
+
const node_workspace_1 = require("./plugins/node-workspace");
|
|
39
|
+
const cargo_workspace_1 = require("./plugins/cargo-workspace");
|
|
17
40
|
// Factory shared by GitHub Action and CLI for creating Release PRs
|
|
18
41
|
// and GitHub Releases:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
42
|
+
// add any new releasers you create to this type as well as the `releasers`
|
|
43
|
+
// object below.
|
|
44
|
+
const allReleaseTypes = [
|
|
45
|
+
'dart',
|
|
46
|
+
'elixir',
|
|
47
|
+
'go',
|
|
48
|
+
'go-yoshi',
|
|
49
|
+
'helm',
|
|
50
|
+
'java-backport',
|
|
51
|
+
'java-bom',
|
|
52
|
+
'java-lts',
|
|
53
|
+
'java-yoshi',
|
|
54
|
+
'krm-blueprint',
|
|
55
|
+
'node',
|
|
56
|
+
'ocaml',
|
|
57
|
+
'php',
|
|
58
|
+
'php-yoshi',
|
|
59
|
+
'python',
|
|
60
|
+
'ruby',
|
|
61
|
+
'ruby-yoshi',
|
|
62
|
+
'rust',
|
|
63
|
+
'simple',
|
|
64
|
+
'terraform-module',
|
|
65
|
+
];
|
|
66
|
+
const releasers = {
|
|
67
|
+
go: options => new go_1.Go(options),
|
|
68
|
+
'go-yoshi': options => new go_yoshi_1.GoYoshi(options),
|
|
69
|
+
'krm-blueprint': options => new krm_blueprint_1.KRMBlueprint(options),
|
|
70
|
+
node: options => new node_1.Node(options),
|
|
71
|
+
ocaml: options => new ocaml_1.OCaml(options),
|
|
72
|
+
php: options => new php_1.PHP(options),
|
|
73
|
+
'php-yoshi': options => new php_yoshi_1.PHPYoshi(options),
|
|
74
|
+
python: options => new python_1.Python(options),
|
|
75
|
+
rust: options => new rust_1.Rust(options),
|
|
76
|
+
simple: options => new simple_1.Simple(options),
|
|
77
|
+
'terraform-module': options => new terraform_module_1.TerraformModule(options),
|
|
78
|
+
helm: options => new helm_1.Helm(options),
|
|
79
|
+
elixir: options => new elixir_1.Elixir(options),
|
|
80
|
+
dart: options => new dart_1.Dart(options),
|
|
81
|
+
};
|
|
82
|
+
function getReleaserTypes() {
|
|
83
|
+
return allReleaseTypes;
|
|
35
84
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return
|
|
39
|
-
typeof options === 'object');
|
|
85
|
+
exports.getReleaserTypes = getReleaserTypes;
|
|
86
|
+
function getVersioningStrategyTypes() {
|
|
87
|
+
return allVersioningTypes;
|
|
40
88
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
89
|
+
exports.getVersioningStrategyTypes = getVersioningStrategyTypes;
|
|
90
|
+
async function buildStrategy(options) {
|
|
91
|
+
var _a;
|
|
92
|
+
const targetBranch = (_a = options.targetBranch) !== null && _a !== void 0 ? _a : options.github.repository.defaultBranch;
|
|
93
|
+
const versioningStrategy = buildVersioningStrategy({
|
|
94
|
+
type: options.versioning,
|
|
95
|
+
bumpMinorPreMajor: options.bumpMinorPreMajor,
|
|
96
|
+
bumpPatchForMinorPreMajor: options.bumpPatchForMinorPreMajor,
|
|
97
|
+
});
|
|
98
|
+
const strategyOptions = {
|
|
99
|
+
github: options.github,
|
|
100
|
+
targetBranch,
|
|
101
|
+
path: options.path,
|
|
102
|
+
bumpMinorPreMajor: options.bumpMinorPreMajor,
|
|
103
|
+
bumpPatchForMinorPreMajor: options.bumpPatchForMinorPreMajor,
|
|
104
|
+
component: options.component,
|
|
105
|
+
packageName: options.packageName,
|
|
106
|
+
changelogPath: options.changelogPath,
|
|
107
|
+
changelogSections: options.changelogSections,
|
|
108
|
+
versioningStrategy,
|
|
109
|
+
skipGitHubRelease: options.skipGithubRelease,
|
|
110
|
+
releaseAs: options.releaseAs,
|
|
111
|
+
includeComponentInTag: options.includeComponentInTag,
|
|
112
|
+
};
|
|
113
|
+
switch (options.releaseType) {
|
|
114
|
+
case 'ruby': {
|
|
115
|
+
return new ruby_1.Ruby({
|
|
116
|
+
...strategyOptions,
|
|
117
|
+
versionFile: options.versionFile,
|
|
118
|
+
});
|
|
49
119
|
}
|
|
50
|
-
|
|
51
|
-
|
|
120
|
+
case 'ruby-yoshi': {
|
|
121
|
+
return new ruby_yoshi_1.RubyYoshi({
|
|
122
|
+
...strategyOptions,
|
|
123
|
+
versionFile: options.versionFile,
|
|
124
|
+
});
|
|
52
125
|
}
|
|
53
|
-
|
|
54
|
-
|
|
126
|
+
case 'java-yoshi': {
|
|
127
|
+
return new java_yoshi_1.JavaYoshi({
|
|
128
|
+
...strategyOptions,
|
|
129
|
+
extraFiles: options.extraFiles,
|
|
130
|
+
});
|
|
55
131
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
if (cmdOpts.command === 'release-pr') {
|
|
63
|
-
result = exports.factory.call(releasePr, 'run');
|
|
132
|
+
case 'java-backport': {
|
|
133
|
+
return new java_yoshi_1.JavaYoshi({
|
|
134
|
+
...strategyOptions,
|
|
135
|
+
extraFiles: options.extraFiles,
|
|
136
|
+
versioningStrategy: new always_bump_patch_1.AlwaysBumpPatch(),
|
|
137
|
+
});
|
|
64
138
|
}
|
|
65
|
-
|
|
66
|
-
|
|
139
|
+
case 'java-bom': {
|
|
140
|
+
return new java_yoshi_1.JavaYoshi({
|
|
141
|
+
...strategyOptions,
|
|
142
|
+
extraFiles: options.extraFiles,
|
|
143
|
+
versioningStrategy: new dependency_manifest_1.DependencyManifest({
|
|
144
|
+
bumpMinorPreMajor: options.bumpMinorPreMajor,
|
|
145
|
+
bumpPatchForMinorPreMajor: options.bumpPatchForMinorPreMajor,
|
|
146
|
+
}),
|
|
147
|
+
});
|
|
67
148
|
}
|
|
68
|
-
|
|
69
|
-
|
|
149
|
+
case 'java-lts': {
|
|
150
|
+
return new java_yoshi_1.JavaYoshi({
|
|
151
|
+
...strategyOptions,
|
|
152
|
+
extraFiles: options.extraFiles,
|
|
153
|
+
versioningStrategy: new service_pack_1.ServicePackVersioningStrategy(),
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
default: {
|
|
157
|
+
const builder = releasers[options.releaseType];
|
|
158
|
+
if (builder) {
|
|
159
|
+
return builder(strategyOptions);
|
|
160
|
+
}
|
|
161
|
+
throw new Error(`Unknown release type: ${options.releaseType}`);
|
|
70
162
|
}
|
|
71
163
|
}
|
|
72
|
-
else {
|
|
73
|
-
throw new Error(errMsg);
|
|
74
|
-
}
|
|
75
|
-
return result;
|
|
76
164
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
else {
|
|
92
|
-
throw new Error('Unknown instance.');
|
|
165
|
+
exports.buildStrategy = buildStrategy;
|
|
166
|
+
const allVersioningTypes = [
|
|
167
|
+
'default',
|
|
168
|
+
'always-bump-patch',
|
|
169
|
+
'service-pack',
|
|
170
|
+
];
|
|
171
|
+
function buildVersioningStrategy(options) {
|
|
172
|
+
switch (options.type) {
|
|
173
|
+
case 'always-bump-patch':
|
|
174
|
+
return new always_bump_patch_1.AlwaysBumpPatch(options);
|
|
175
|
+
case 'service-pack':
|
|
176
|
+
return new service_pack_1.ServicePackVersioningStrategy(options);
|
|
177
|
+
default:
|
|
178
|
+
return new default_1.DefaultVersioningStrategy(options);
|
|
93
179
|
}
|
|
94
|
-
return result;
|
|
95
180
|
}
|
|
96
|
-
function
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
defaultBranch,
|
|
105
|
-
fork,
|
|
106
|
-
token,
|
|
107
|
-
apiUrl,
|
|
108
|
-
octokitAPIs,
|
|
109
|
-
},
|
|
110
|
-
remaining,
|
|
111
|
-
];
|
|
112
|
-
}
|
|
113
|
-
function manifest(options) {
|
|
114
|
-
const [GHFactoryOptions, ManifestFactoryOptions] = getGitHubFactoryOpts(options);
|
|
115
|
-
const github = gitHubInstance(GHFactoryOptions);
|
|
116
|
-
return new manifest_1.Manifest({ github, ...ManifestFactoryOptions });
|
|
117
|
-
}
|
|
118
|
-
function githubRelease(options) {
|
|
119
|
-
const [GHFactoryOptions, GHRAndRPFactoryOptions] = getGitHubFactoryOpts(options);
|
|
120
|
-
const github = gitHubInstance(GHFactoryOptions);
|
|
121
|
-
const { releaseType, label, path, packageName, bumpMinorPreMajor, releaseAs, snapshot, monorepoTags, changelogSections, changelogPath, lastPackageVersion, versionFile, ...GHRFactoryOptions } = GHRAndRPFactoryOptions;
|
|
122
|
-
const labels = getLabels(label);
|
|
123
|
-
const releasePR = new (releasePRClass(releaseType))({
|
|
124
|
-
github,
|
|
125
|
-
labels,
|
|
126
|
-
path,
|
|
127
|
-
packageName,
|
|
128
|
-
bumpMinorPreMajor,
|
|
129
|
-
releaseAs,
|
|
130
|
-
snapshot,
|
|
131
|
-
monorepoTags,
|
|
132
|
-
changelogSections,
|
|
133
|
-
changelogPath,
|
|
134
|
-
lastPackageVersion,
|
|
135
|
-
versionFile,
|
|
136
|
-
});
|
|
137
|
-
return new github_release_1.GitHubRelease({ github, releasePR, ...GHRFactoryOptions });
|
|
138
|
-
}
|
|
139
|
-
function releasePR(options) {
|
|
140
|
-
const [GHFactoryOptions, RPFactoryOptions] = getGitHubFactoryOpts(options);
|
|
141
|
-
const github = gitHubInstance(GHFactoryOptions);
|
|
142
|
-
const { releaseType, label, latestTagName, latestTagSha, latestTagVersion, ...RPConstructorOptions } = RPFactoryOptions;
|
|
143
|
-
let latestTag = undefined;
|
|
144
|
-
if (latestTagName && latestTagSha && latestTagVersion) {
|
|
145
|
-
latestTag = {
|
|
146
|
-
name: latestTagName,
|
|
147
|
-
sha: latestTagSha,
|
|
148
|
-
version: latestTagVersion,
|
|
149
|
-
};
|
|
181
|
+
function buildPlugin(options) {
|
|
182
|
+
switch (options.type) {
|
|
183
|
+
case 'cargo-workspace':
|
|
184
|
+
return new cargo_workspace_1.CargoWorkspace(options.github, options.targetBranch, options.repositoryConfig, options);
|
|
185
|
+
case 'node-workspace':
|
|
186
|
+
return new node_workspace_1.NodeWorkspace(options.github, options.targetBranch, options.repositoryConfig, options);
|
|
187
|
+
default:
|
|
188
|
+
throw new Error(`Unknown plugin type: ${options.type}`);
|
|
150
189
|
}
|
|
151
|
-
const labels = getLabels(label);
|
|
152
|
-
return new (exports.factory.releasePRClass(releaseType))({
|
|
153
|
-
github,
|
|
154
|
-
labels,
|
|
155
|
-
latestTag,
|
|
156
|
-
...RPConstructorOptions,
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
function gitHubInstance(options) {
|
|
160
|
-
const { repoUrl, ...remaining } = options;
|
|
161
|
-
const [owner, repo] = parseGithubRepoUrl(repoUrl);
|
|
162
|
-
return new github_1.GitHub({
|
|
163
|
-
owner,
|
|
164
|
-
repo,
|
|
165
|
-
...remaining,
|
|
166
|
-
});
|
|
167
190
|
}
|
|
168
|
-
|
|
169
|
-
const releasers = releasers_1.getReleasers();
|
|
170
|
-
const releaser = releaseType ? releasers[releaseType] : release_pr_1.ReleasePR;
|
|
171
|
-
return releaser;
|
|
172
|
-
}
|
|
173
|
-
exports.factory = {
|
|
174
|
-
gitHubInstance,
|
|
175
|
-
githubRelease,
|
|
176
|
-
manifest,
|
|
177
|
-
releasePR,
|
|
178
|
-
releasePRClass,
|
|
179
|
-
call,
|
|
180
|
-
runCommand,
|
|
181
|
-
};
|
|
191
|
+
exports.buildPlugin = buildPlugin;
|
|
182
192
|
//# sourceMappingURL=factory.js.map
|