release-please 17.2.0 → 17.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/src/index.d.ts
CHANGED
package/build/src/index.js
CHANGED
|
@@ -36,6 +36,6 @@ Object.defineProperty(exports, "GitHub", { enumerable: true, get: function () {
|
|
|
36
36
|
exports.configSchema = require('../../schemas/config.json');
|
|
37
37
|
exports.manifestSchema = require('../../schemas/manifest.json');
|
|
38
38
|
// x-release-please-start-version
|
|
39
|
-
exports.VERSION = '17.2.
|
|
39
|
+
exports.VERSION = '17.2.1';
|
|
40
40
|
// x-release-please-end
|
|
41
41
|
//# sourceMappingURL=index.js.map
|
|
@@ -18,7 +18,11 @@ const fs_1 = require("fs");
|
|
|
18
18
|
// if an option looks like a file path, assume it's a
|
|
19
19
|
// path to a key and load it.
|
|
20
20
|
function coerceOption(option) {
|
|
21
|
-
if
|
|
21
|
+
// Only check .match if option is a string, to avoid TypeError.
|
|
22
|
+
// This might happen if the user didn't pass any payload for
|
|
23
|
+
// the option, or if the payload is empty. Example:
|
|
24
|
+
// --token $EMPTY_VAR
|
|
25
|
+
if (typeof option === 'string' && option.match(/[\\/]/)) {
|
|
22
26
|
try {
|
|
23
27
|
const stat = (0, fs_1.statSync)(option);
|
|
24
28
|
if (stat.isDirectory())
|
|
@@ -4,6 +4,7 @@ import { ConventionalCommit } from '..';
|
|
|
4
4
|
import { VersionUpdater } from '../versioning-strategy';
|
|
5
5
|
interface PrereleaseVersioningStrategyOptions extends DefaultVersioningStrategyOptions {
|
|
6
6
|
prereleaseType?: string;
|
|
7
|
+
prerelease?: boolean;
|
|
7
8
|
}
|
|
8
9
|
/**
|
|
9
10
|
* This versioning strategy will increment the pre-release number for patch
|
|
@@ -12,6 +13,7 @@ interface PrereleaseVersioningStrategyOptions extends DefaultVersioningStrategyO
|
|
|
12
13
|
*/
|
|
13
14
|
export declare class PrereleaseVersioningStrategy extends DefaultVersioningStrategy {
|
|
14
15
|
readonly prereleaseType?: string;
|
|
16
|
+
readonly prerelease: boolean;
|
|
15
17
|
constructor(options?: PrereleaseVersioningStrategyOptions);
|
|
16
18
|
determineReleaseType(version: Version, commits: ConventionalCommit[]): VersionUpdater;
|
|
17
19
|
}
|
|
@@ -109,6 +109,7 @@ class PrereleaseVersioningStrategy extends default_1.DefaultVersioningStrategy {
|
|
|
109
109
|
constructor(options = {}) {
|
|
110
110
|
super(options);
|
|
111
111
|
this.prereleaseType = options.prereleaseType;
|
|
112
|
+
this.prerelease = options.prerelease === true;
|
|
112
113
|
}
|
|
113
114
|
determineReleaseType(version, commits) {
|
|
114
115
|
// iterate through list of commits and find biggest commit type
|
|
@@ -128,23 +129,31 @@ class PrereleaseVersioningStrategy extends default_1.DefaultVersioningStrategy {
|
|
|
128
129
|
features++;
|
|
129
130
|
}
|
|
130
131
|
}
|
|
132
|
+
let bumpedVersionUpdater;
|
|
131
133
|
if (breaking > 0) {
|
|
132
134
|
if (version.isPreMajor && this.bumpMinorPreMajor) {
|
|
133
|
-
|
|
135
|
+
bumpedVersionUpdater = new PrereleaseMinorVersionUpdate(this.prereleaseType);
|
|
134
136
|
}
|
|
135
137
|
else {
|
|
136
|
-
|
|
138
|
+
bumpedVersionUpdater = new PrereleaseMajorVersionUpdate(this.prereleaseType);
|
|
137
139
|
}
|
|
138
140
|
}
|
|
139
141
|
else if (features > 0) {
|
|
140
142
|
if (version.isPreMajor && this.bumpPatchForMinorPreMajor) {
|
|
141
|
-
|
|
143
|
+
bumpedVersionUpdater = new PrereleasePatchVersionUpdate(this.prereleaseType);
|
|
142
144
|
}
|
|
143
145
|
else {
|
|
144
|
-
|
|
146
|
+
bumpedVersionUpdater = new PrereleaseMinorVersionUpdate(this.prereleaseType);
|
|
145
147
|
}
|
|
146
148
|
}
|
|
147
|
-
|
|
149
|
+
else {
|
|
150
|
+
bumpedVersionUpdater = new PrereleasePatchVersionUpdate(this.prereleaseType);
|
|
151
|
+
}
|
|
152
|
+
if (!this.prerelease) {
|
|
153
|
+
const bumpedVersion = bumpedVersionUpdater.bump(version);
|
|
154
|
+
return new versioning_strategy_1.CustomVersionUpdate(version_1.Version.parse(`${bumpedVersion.major}.${bumpedVersion.minor}.${bumpedVersion.patch}`).toString());
|
|
155
|
+
}
|
|
156
|
+
return bumpedVersionUpdater;
|
|
148
157
|
}
|
|
149
158
|
}
|
|
150
159
|
exports.PrereleaseVersioningStrategy = PrereleaseVersioningStrategy;
|