release-please 12.3.0 → 13.0.0-candidate.0
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 +21 -0
- package/README.md +5 -0
- package/build/src/bin/release-please.d.ts +51 -11
- package/build/src/bin/release-please.js +409 -150
- package/build/src/bootstrapper.d.ts +12 -0
- package/build/src/bootstrapper.js +60 -0
- 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 +159 -150
- package/build/src/github.d.ts +151 -883
- package/build/src/github.js +584 -1013
- package/build/src/manifest.d.ts +177 -48
- package/build/src/manifest.js +583 -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/readme.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/{updaters/java/pom-xml.js → release-pull-request.js} +2 -7
- 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 +9 -0
- package/build/src/strategies/php-yoshi.js +214 -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 +99 -0
- package/build/src/strategy.js +237 -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/dart/pubspec-yaml.js +45 -0
- 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/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 -72
- 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-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/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
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
// limitations under the License.
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.PullRequestTitle = exports.generateMatchPattern = void 0;
|
|
17
|
+
const logger_1 = require("./logger");
|
|
18
|
+
const version_1 = require("../version");
|
|
17
19
|
// cannot import from '..' - transpiled code references to RELEASE_PLEASE
|
|
18
20
|
// at the script level are undefined, they are only defined inside function
|
|
19
21
|
// or instance methods/properties.
|
|
@@ -21,17 +23,18 @@ const DEFAULT_PR_TITLE_PATTERN = 'chore${scope}: release${component} ${version}'
|
|
|
21
23
|
function generateMatchPattern(pullRequestTitlePattern) {
|
|
22
24
|
if (pullRequestTitlePattern &&
|
|
23
25
|
pullRequestTitlePattern.search(/\$\{scope\}/) === -1)
|
|
24
|
-
|
|
26
|
+
logger_1.logger.warn("pullRequestTitlePattern miss the part of '${scope}'");
|
|
25
27
|
if (pullRequestTitlePattern &&
|
|
26
28
|
pullRequestTitlePattern.search(/\$\{component\}/) === -1)
|
|
27
|
-
|
|
29
|
+
logger_1.logger.warn("pullRequestTitlePattern miss the part of '${component}'");
|
|
28
30
|
if (pullRequestTitlePattern &&
|
|
29
31
|
pullRequestTitlePattern.search(/\$\{version\}/) === -1)
|
|
30
|
-
|
|
32
|
+
logger_1.logger.warn("pullRequestTitlePattern miss the part of '${version}'");
|
|
31
33
|
return new RegExp(`^${(pullRequestTitlePattern || DEFAULT_PR_TITLE_PATTERN)
|
|
32
34
|
.replace('${scope}', '(\\((?<branch>[\\w-.]+)\\))?')
|
|
33
35
|
.replace('${component}', ' ?(?<component>[\\w-.]*)?')
|
|
34
|
-
.replace('${version}', 'v?(?<version>[0-9].*)')
|
|
36
|
+
.replace('${version}', 'v?(?<version>[0-9].*)')
|
|
37
|
+
.replace('${branch}', '(?<branch>[\\w-.]+)?')}$`);
|
|
35
38
|
}
|
|
36
39
|
exports.generateMatchPattern = generateMatchPattern;
|
|
37
40
|
class PullRequestTitle {
|
|
@@ -48,7 +51,9 @@ class PullRequestTitle {
|
|
|
48
51
|
const match = title.match(matchPattern);
|
|
49
52
|
if (match === null || match === void 0 ? void 0 : match.groups) {
|
|
50
53
|
return new PullRequestTitle({
|
|
51
|
-
version: match.groups['version']
|
|
54
|
+
version: match.groups['version']
|
|
55
|
+
? version_1.Version.parse(match.groups['version'])
|
|
56
|
+
: undefined,
|
|
52
57
|
component: match.groups['component'],
|
|
53
58
|
targetBranch: match.groups['branch'],
|
|
54
59
|
pullRequestTitlePattern: pullRequestTitlePattern,
|
|
@@ -77,6 +82,12 @@ class PullRequestTitle {
|
|
|
77
82
|
pullRequestTitlePattern,
|
|
78
83
|
});
|
|
79
84
|
}
|
|
85
|
+
static ofTargetBranch(targetBranch, pullRequestTitlePattern) {
|
|
86
|
+
return new PullRequestTitle({
|
|
87
|
+
targetBranch,
|
|
88
|
+
pullRequestTitlePattern,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
80
91
|
getTargetBranch() {
|
|
81
92
|
return this.targetBranch;
|
|
82
93
|
}
|
|
@@ -87,12 +98,15 @@ class PullRequestTitle {
|
|
|
87
98
|
return this.version;
|
|
88
99
|
}
|
|
89
100
|
toString() {
|
|
101
|
+
var _a;
|
|
90
102
|
const scope = this.targetBranch ? `(${this.targetBranch})` : '';
|
|
91
103
|
const component = this.component ? ` ${this.component}` : '';
|
|
104
|
+
const version = (_a = this.version) !== null && _a !== void 0 ? _a : '';
|
|
92
105
|
return this.pullRequestTitlePattern
|
|
93
106
|
.replace('${scope}', scope)
|
|
94
107
|
.replace('${component}', component)
|
|
95
|
-
.replace('${version}',
|
|
108
|
+
.replace('${version}', version.toString())
|
|
109
|
+
.trim();
|
|
96
110
|
}
|
|
97
111
|
}
|
|
98
112
|
exports.PullRequestTitle = PullRequestTitle;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Version } from '../version';
|
|
2
|
+
export declare class TagName {
|
|
3
|
+
component?: string;
|
|
4
|
+
version: Version;
|
|
5
|
+
separator: string;
|
|
6
|
+
constructor(version: Version, component?: string, separator?: string);
|
|
7
|
+
static parse(tagName: string): TagName | undefined;
|
|
8
|
+
toString(): string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
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.TagName = void 0;
|
|
17
|
+
const version_1 = require("../version");
|
|
18
|
+
const TAG_PATTERN = /^((?<component>.*)(?<separator>[^a-zA-Z]))?v(?<version>\d+\.\d+\.\d+.*)$/;
|
|
19
|
+
const DEFAULT_SEPARATOR = '-';
|
|
20
|
+
class TagName {
|
|
21
|
+
constructor(version, component, separator = DEFAULT_SEPARATOR) {
|
|
22
|
+
this.version = version;
|
|
23
|
+
this.component = component;
|
|
24
|
+
this.separator = separator;
|
|
25
|
+
}
|
|
26
|
+
static parse(tagName) {
|
|
27
|
+
const match = tagName.match(TAG_PATTERN);
|
|
28
|
+
if (match === null || match === void 0 ? void 0 : match.groups) {
|
|
29
|
+
return new TagName(version_1.Version.parse(match.groups.version), match.groups.component, match.groups.separator);
|
|
30
|
+
}
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
toString() {
|
|
34
|
+
if (this.component) {
|
|
35
|
+
return `${this.component}${this.separator}v${this.version.toString()}`;
|
|
36
|
+
}
|
|
37
|
+
return `v${this.version.toString()}`;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.TagName = TagName;
|
|
41
|
+
//# sourceMappingURL=tag-name.js.map
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class Version {
|
|
2
|
+
major: number;
|
|
3
|
+
minor: number;
|
|
4
|
+
patch: number;
|
|
5
|
+
preRelease?: string;
|
|
6
|
+
build?: string;
|
|
7
|
+
constructor(major: number, minor: number, patch: number, preRelease?: string, build?: string);
|
|
8
|
+
static parse(versionString: string): Version;
|
|
9
|
+
toString(): string;
|
|
10
|
+
}
|
|
11
|
+
export declare type VersionsMap = Map<string, Version>;
|
|
@@ -0,0 +1,45 @@
|
|
|
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.Version = void 0;
|
|
17
|
+
const VERSION_REGEX = /(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)(-(?<preRelease>[^+]+))?(\+(?<build>.*))?/;
|
|
18
|
+
class Version {
|
|
19
|
+
constructor(major, minor, patch, preRelease, build) {
|
|
20
|
+
this.major = major;
|
|
21
|
+
this.minor = minor;
|
|
22
|
+
this.patch = patch;
|
|
23
|
+
this.preRelease = preRelease;
|
|
24
|
+
this.build = build;
|
|
25
|
+
}
|
|
26
|
+
static parse(versionString) {
|
|
27
|
+
const match = versionString.match(VERSION_REGEX);
|
|
28
|
+
if (!(match === null || match === void 0 ? void 0 : match.groups)) {
|
|
29
|
+
throw Error(`unable to parse version string: ${versionString}`);
|
|
30
|
+
}
|
|
31
|
+
const major = Number(match.groups.major);
|
|
32
|
+
const minor = Number(match.groups.minor);
|
|
33
|
+
const patch = Number(match.groups.patch);
|
|
34
|
+
const preRelease = match.groups.preRelease;
|
|
35
|
+
const build = match.groups.build;
|
|
36
|
+
return new Version(major, minor, patch, preRelease, build);
|
|
37
|
+
}
|
|
38
|
+
toString() {
|
|
39
|
+
const preReleasePart = this.preRelease ? `-${this.preRelease}` : '';
|
|
40
|
+
const buildPart = this.build ? `+${this.build}` : '';
|
|
41
|
+
return `${this.major}.${this.minor}.${this.patch}${preReleasePart}${buildPart}`;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.Version = Version;
|
|
45
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Version } from '../version';
|
|
2
|
+
import { ConventionalCommit } from '../commit';
|
|
3
|
+
import { DefaultVersioningStrategy } from './default';
|
|
4
|
+
import { VersionUpdater } from '../versioning-strategy';
|
|
5
|
+
export declare class AlwaysBumpPatch extends DefaultVersioningStrategy {
|
|
6
|
+
determineReleaseType(_version: Version, _commits: ConventionalCommit[]): VersionUpdater;
|
|
7
|
+
}
|
package/build/src/{updaters/package-lock-json.js → versioning-strategies/always-bump-patch.js}
RENAMED
|
@@ -13,16 +13,13 @@
|
|
|
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.
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const lockFileV2 = parsed;
|
|
23
|
-
lockFileV2.packages[''].version = this.version;
|
|
24
|
-
}
|
|
16
|
+
exports.AlwaysBumpPatch = void 0;
|
|
17
|
+
const default_1 = require("./default");
|
|
18
|
+
const versioning_strategy_1 = require("../versioning-strategy");
|
|
19
|
+
class AlwaysBumpPatch extends default_1.DefaultVersioningStrategy {
|
|
20
|
+
determineReleaseType(_version, _commits) {
|
|
21
|
+
return new versioning_strategy_1.PatchVersionUpdate();
|
|
25
22
|
}
|
|
26
23
|
}
|
|
27
|
-
exports.
|
|
28
|
-
//# sourceMappingURL=
|
|
24
|
+
exports.AlwaysBumpPatch = AlwaysBumpPatch;
|
|
25
|
+
//# sourceMappingURL=always-bump-patch.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { VersioningStrategy, VersionUpdater } from '../versioning-strategy';
|
|
2
|
+
import { ConventionalCommit } from '../commit';
|
|
3
|
+
import { Version } from '../version';
|
|
4
|
+
interface DefaultVersioningStrategyOptions {
|
|
5
|
+
bumpMinorPreMajor?: boolean;
|
|
6
|
+
bumpPatchForMinorPreMajor?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare class DefaultVersioningStrategy implements VersioningStrategy {
|
|
9
|
+
readonly bumpMinorPreMajor: boolean;
|
|
10
|
+
readonly bumpPatchForMinorPreMajor: boolean;
|
|
11
|
+
constructor(options?: DefaultVersioningStrategyOptions);
|
|
12
|
+
determineReleaseType(version: Version, commits: ConventionalCommit[]): VersionUpdater;
|
|
13
|
+
bump(version: Version, commits: ConventionalCommit[]): Version;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -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.DefaultVersioningStrategy = void 0;
|
|
17
|
+
const versioning_strategy_1 = require("../versioning-strategy");
|
|
18
|
+
const version_1 = require("../version");
|
|
19
|
+
class DefaultVersioningStrategy {
|
|
20
|
+
constructor(options = {}) {
|
|
21
|
+
this.bumpMinorPreMajor = options.bumpMinorPreMajor === true;
|
|
22
|
+
this.bumpPatchForMinorPreMajor = options.bumpPatchForMinorPreMajor === true;
|
|
23
|
+
}
|
|
24
|
+
determineReleaseType(version, commits) {
|
|
25
|
+
// iterate through list of commits and find biggest commit type
|
|
26
|
+
let breaking = 0;
|
|
27
|
+
let features = 0;
|
|
28
|
+
let customVersion;
|
|
29
|
+
for (const commit of commits) {
|
|
30
|
+
const releaseAs = commit.notes.find(note => note.title === 'RELEASE AS');
|
|
31
|
+
if (releaseAs) {
|
|
32
|
+
customVersion = version_1.Version.parse(releaseAs.text);
|
|
33
|
+
}
|
|
34
|
+
if (commit.breaking) {
|
|
35
|
+
breaking++;
|
|
36
|
+
}
|
|
37
|
+
else if (commit.type === 'feat' || commit.type === 'feature') {
|
|
38
|
+
features++;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (customVersion) {
|
|
42
|
+
return new versioning_strategy_1.CustomVersionUpdate(customVersion.toString());
|
|
43
|
+
}
|
|
44
|
+
if (breaking > 0) {
|
|
45
|
+
if (version.major < 1 && this.bumpMinorPreMajor) {
|
|
46
|
+
return new versioning_strategy_1.MinorVersionUpdate();
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
return new versioning_strategy_1.MajorVersionUpdate();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
else if (features > 0) {
|
|
53
|
+
if (version.major < 1 && this.bumpPatchForMinorPreMajor) {
|
|
54
|
+
return new versioning_strategy_1.PatchVersionUpdate();
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
return new versioning_strategy_1.MinorVersionUpdate();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return new versioning_strategy_1.PatchVersionUpdate();
|
|
61
|
+
}
|
|
62
|
+
bump(version, commits) {
|
|
63
|
+
return this.determineReleaseType(version, commits).bump(version);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.DefaultVersioningStrategy = DefaultVersioningStrategy;
|
|
67
|
+
//# sourceMappingURL=default.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Version } from '../version';
|
|
2
|
+
import { ConventionalCommit } from '../commit';
|
|
3
|
+
import { DefaultVersioningStrategy } from './default';
|
|
4
|
+
import { VersionUpdater } from '../versioning-strategy';
|
|
5
|
+
export declare class DependencyManifest extends DefaultVersioningStrategy {
|
|
6
|
+
determineReleaseType(version: Version, commits: ConventionalCommit[]): VersionUpdater;
|
|
7
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
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.DependencyManifest = void 0;
|
|
17
|
+
const version_1 = require("../version");
|
|
18
|
+
const semver = require("semver");
|
|
19
|
+
const default_1 = require("./default");
|
|
20
|
+
const versioning_strategy_1 = require("../versioning-strategy");
|
|
21
|
+
const DEPENDENCY_UPDATE_REGEX = /^deps: update dependency (.*) to (v.*)(\s\(#\d+\))?$/m;
|
|
22
|
+
class DependencyManifest extends default_1.DefaultVersioningStrategy {
|
|
23
|
+
determineReleaseType(version, commits) {
|
|
24
|
+
const regularBump = super.determineReleaseType(version, commits);
|
|
25
|
+
const dependencyUpdates = buildDependencyUpdates(commits);
|
|
26
|
+
let breaking = 0;
|
|
27
|
+
let features = 0;
|
|
28
|
+
for (const dep in dependencyUpdates) {
|
|
29
|
+
const version = dependencyUpdates[dep];
|
|
30
|
+
if (version.patch === 0) {
|
|
31
|
+
if (version.minor === 0) {
|
|
32
|
+
breaking++;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
features++;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
let dependencyBump;
|
|
40
|
+
if (breaking > 0) {
|
|
41
|
+
if (version.major < 1 && this.bumpMinorPreMajor) {
|
|
42
|
+
dependencyBump = new versioning_strategy_1.MinorVersionUpdate();
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
dependencyBump = new versioning_strategy_1.MajorVersionUpdate();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else if (features > 0) {
|
|
49
|
+
if (version.major < 1 && this.bumpPatchForMinorPreMajor) {
|
|
50
|
+
dependencyBump = new versioning_strategy_1.PatchVersionUpdate();
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
dependencyBump = new versioning_strategy_1.MinorVersionUpdate();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
dependencyBump = new versioning_strategy_1.PatchVersionUpdate();
|
|
58
|
+
}
|
|
59
|
+
if (semver.lte(dependencyBump.bump(version).toString(), regularBump.bump(version).toString())) {
|
|
60
|
+
return regularBump;
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
return dependencyBump;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.DependencyManifest = DependencyManifest;
|
|
68
|
+
function buildDependencyUpdates(commits) {
|
|
69
|
+
const versionsMap = {};
|
|
70
|
+
for (const commit of commits) {
|
|
71
|
+
const match = commit.message.match(DEPENDENCY_UPDATE_REGEX);
|
|
72
|
+
if (!match)
|
|
73
|
+
continue;
|
|
74
|
+
const versionString = match[2];
|
|
75
|
+
let version;
|
|
76
|
+
try {
|
|
77
|
+
version = version_1.Version.parse(versionString);
|
|
78
|
+
}
|
|
79
|
+
catch (_a) {
|
|
80
|
+
version = version_1.Version.parse(`${versionString}.0.0`);
|
|
81
|
+
}
|
|
82
|
+
// commits are sorted by latest first, so if there is a collision,
|
|
83
|
+
// then we've already recorded the latest version
|
|
84
|
+
if (versionsMap[match[1]])
|
|
85
|
+
continue;
|
|
86
|
+
versionsMap[match[1]] = version;
|
|
87
|
+
}
|
|
88
|
+
return versionsMap;
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=dependency-manifest.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VersioningStrategy, VersionUpdater } from '../versioning-strategy';
|
|
2
|
+
import { Version } from '../version';
|
|
3
|
+
import { ConventionalCommit } from '../commit';
|
|
4
|
+
export declare class JavaAddSnapshot implements VersioningStrategy {
|
|
5
|
+
strategy: VersioningStrategy;
|
|
6
|
+
constructor(strategy: VersioningStrategy);
|
|
7
|
+
determineReleaseType(_version: Version, _commits: ConventionalCommit[]): VersionUpdater;
|
|
8
|
+
bump(version: Version, commits: ConventionalCommit[]): Version;
|
|
9
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
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.JavaAddSnapshot = void 0;
|
|
17
|
+
const fakeCommit = {
|
|
18
|
+
message: 'fix: fake fix',
|
|
19
|
+
type: 'fix',
|
|
20
|
+
scope: null,
|
|
21
|
+
notes: [],
|
|
22
|
+
references: [],
|
|
23
|
+
bareMessage: 'fake fix',
|
|
24
|
+
breaking: false,
|
|
25
|
+
sha: 'abc123',
|
|
26
|
+
files: [],
|
|
27
|
+
};
|
|
28
|
+
class AddSnapshotVersionUpdate {
|
|
29
|
+
constructor(strategy) {
|
|
30
|
+
this.name = 'java-snapshot';
|
|
31
|
+
this.strategy = strategy;
|
|
32
|
+
}
|
|
33
|
+
bump(version) {
|
|
34
|
+
const nextPatch = this.strategy.bump(version, [fakeCommit]);
|
|
35
|
+
nextPatch.preRelease = nextPatch.preRelease
|
|
36
|
+
? `${nextPatch.preRelease}-SNAPSHOT`
|
|
37
|
+
: 'SNAPSHOT';
|
|
38
|
+
return nextPatch;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
class JavaAddSnapshot {
|
|
42
|
+
constructor(strategy) {
|
|
43
|
+
this.strategy = strategy;
|
|
44
|
+
}
|
|
45
|
+
determineReleaseType(_version, _commits) {
|
|
46
|
+
return new AddSnapshotVersionUpdate(this.strategy);
|
|
47
|
+
}
|
|
48
|
+
bump(version, commits) {
|
|
49
|
+
return this.determineReleaseType(version, commits).bump(version);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.JavaAddSnapshot = JavaAddSnapshot;
|
|
53
|
+
//# sourceMappingURL=java-add-snapshot.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { VersioningStrategy, VersionUpdater } from '../versioning-strategy';
|
|
2
|
+
import { Version } from '../version';
|
|
3
|
+
import { ConventionalCommit } from '../commit';
|
|
4
|
+
export declare class JavaSnapshot implements VersioningStrategy {
|
|
5
|
+
strategy: VersioningStrategy;
|
|
6
|
+
constructor(strategy: VersioningStrategy);
|
|
7
|
+
determineReleaseType(version: Version, commits: ConventionalCommit[]): VersionUpdater;
|
|
8
|
+
bump(version: Version, commits: ConventionalCommit[]): Version;
|
|
9
|
+
}
|
|
@@ -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.JavaSnapshot = void 0;
|
|
17
|
+
const version_1 = require("../version");
|
|
18
|
+
const fakeCommit = {
|
|
19
|
+
message: 'fix: fake fix',
|
|
20
|
+
type: 'fix',
|
|
21
|
+
scope: null,
|
|
22
|
+
notes: [],
|
|
23
|
+
references: [],
|
|
24
|
+
bareMessage: 'fake fix',
|
|
25
|
+
breaking: false,
|
|
26
|
+
sha: 'abc123',
|
|
27
|
+
files: [],
|
|
28
|
+
};
|
|
29
|
+
class RemoveSnapshotVersionUpdate {
|
|
30
|
+
constructor(parent) {
|
|
31
|
+
this.name = 'remove-snapshot';
|
|
32
|
+
this.parent = parent;
|
|
33
|
+
}
|
|
34
|
+
bump(version) {
|
|
35
|
+
if (this.parent) {
|
|
36
|
+
version = this.parent.bump(version);
|
|
37
|
+
}
|
|
38
|
+
return new version_1.Version(version.major, version.minor, version.patch, version.preRelease
|
|
39
|
+
? version.preRelease.replace(/-?SNAPSHOT/, '')
|
|
40
|
+
: undefined, version.build);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
class JavaSnapshot {
|
|
44
|
+
constructor(strategy) {
|
|
45
|
+
this.strategy = strategy;
|
|
46
|
+
}
|
|
47
|
+
determineReleaseType(version, commits) {
|
|
48
|
+
var _a;
|
|
49
|
+
const parentBump = this.strategy.determineReleaseType(version, commits);
|
|
50
|
+
if ((_a = version.preRelease) === null || _a === void 0 ? void 0 : _a.match(/-?SNAPSHOT/)) {
|
|
51
|
+
const patchBumpVersion = this.strategy
|
|
52
|
+
.determineReleaseType(version, [fakeCommit])
|
|
53
|
+
.bump(version);
|
|
54
|
+
const parentBumpVersion = parentBump.bump(version);
|
|
55
|
+
if (patchBumpVersion.toString() === parentBumpVersion.toString()) {
|
|
56
|
+
return new RemoveSnapshotVersionUpdate();
|
|
57
|
+
}
|
|
58
|
+
return new RemoveSnapshotVersionUpdate(parentBump);
|
|
59
|
+
}
|
|
60
|
+
return parentBump;
|
|
61
|
+
}
|
|
62
|
+
bump(version, commits) {
|
|
63
|
+
return this.determineReleaseType(version, commits).bump(version);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.JavaSnapshot = JavaSnapshot;
|
|
67
|
+
//# sourceMappingURL=java-snapshot.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Version } from '../version';
|
|
2
|
+
import { DefaultVersioningStrategy } from './default';
|
|
3
|
+
import { ConventionalCommit } from '../commit';
|
|
4
|
+
import { VersionUpdater } from '../versioning-strategy';
|
|
5
|
+
export declare class ServicePackVersioningStrategy extends DefaultVersioningStrategy {
|
|
6
|
+
determineReleaseType(_version: Version, _commits: ConventionalCommit[]): VersionUpdater;
|
|
7
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
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.ServicePackVersioningStrategy = void 0;
|
|
17
|
+
const version_1 = require("../version");
|
|
18
|
+
const default_1 = require("./default");
|
|
19
|
+
const SERVICE_PACK_PATTERN = /sp\.(\d+)/;
|
|
20
|
+
class ServicePackVersionUpdate {
|
|
21
|
+
constructor() {
|
|
22
|
+
this.name = 'service-pack';
|
|
23
|
+
}
|
|
24
|
+
bump(version) {
|
|
25
|
+
var _a;
|
|
26
|
+
const match = (_a = version.preRelease) === null || _a === void 0 ? void 0 : _a.match(SERVICE_PACK_PATTERN);
|
|
27
|
+
if (match) {
|
|
28
|
+
const spNumber = Number(match[1]);
|
|
29
|
+
return new version_1.Version(version.major, version.minor, version.patch, `sp.${spNumber + 1}`, version.build);
|
|
30
|
+
}
|
|
31
|
+
return new version_1.Version(version.major, version.minor, version.patch, 'sp.1', version.build);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
class ServicePackVersioningStrategy extends default_1.DefaultVersioningStrategy {
|
|
35
|
+
determineReleaseType(_version, _commits) {
|
|
36
|
+
return new ServicePackVersionUpdate();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.ServicePackVersioningStrategy = ServicePackVersioningStrategy;
|
|
40
|
+
//# sourceMappingURL=service-pack.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Version } from './version';
|
|
2
|
+
import { ConventionalCommit } from './commit';
|
|
3
|
+
export interface VersionUpdater {
|
|
4
|
+
bump(version: Version): Version;
|
|
5
|
+
name: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class MajorVersionUpdate implements VersionUpdater {
|
|
8
|
+
name: string;
|
|
9
|
+
bump(version: Version): Version;
|
|
10
|
+
}
|
|
11
|
+
export declare class MinorVersionUpdate implements VersionUpdater {
|
|
12
|
+
name: string;
|
|
13
|
+
bump(version: Version): Version;
|
|
14
|
+
}
|
|
15
|
+
export declare class PatchVersionUpdate implements VersionUpdater {
|
|
16
|
+
name: string;
|
|
17
|
+
bump(version: Version): Version;
|
|
18
|
+
}
|
|
19
|
+
export declare class CustomVersionUpdate implements VersionUpdater {
|
|
20
|
+
name: string;
|
|
21
|
+
private versionString;
|
|
22
|
+
constructor(versionString: string);
|
|
23
|
+
bump(_version: Version): Version;
|
|
24
|
+
}
|
|
25
|
+
export interface VersioningStrategy {
|
|
26
|
+
bump(version: Version, commits: ConventionalCommit[]): Version;
|
|
27
|
+
determineReleaseType(version: Version, commits: ConventionalCommit[]): VersionUpdater;
|
|
28
|
+
}
|