release-please 13.0.0-candidate.5 → 13.0.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 +52 -0
- package/README.md +33 -131
- package/build/src/bin/release-please.js +12 -1
- package/build/src/changelog-notes.d.ts +1 -0
- package/build/src/changelog-notes.js +24 -0
- package/build/src/commit.d.ts +1 -1
- package/build/src/commit.js +14 -1
- package/build/src/github.d.ts +41 -7
- package/build/src/github.js +51 -14
- package/build/src/manifest.js +76 -20
- package/build/src/plugins/cargo-workspace.js +2 -2
- package/build/src/plugins/merge.js +4 -1
- package/build/src/plugins/node-workspace.js +2 -2
- package/build/src/pull-request.d.ts +8 -8
- package/build/src/release-pull-request.d.ts +6 -6
- package/build/src/strategies/base.d.ts +108 -0
- package/build/src/strategies/base.js +253 -0
- package/build/src/strategies/dart.d.ts +2 -2
- package/build/src/strategies/dart.js +2 -2
- package/build/src/strategies/elixir.d.ts +2 -2
- package/build/src/strategies/elixir.js +2 -2
- package/build/src/strategies/go-yoshi.d.ts +3 -3
- package/build/src/strategies/go-yoshi.js +2 -2
- package/build/src/strategies/go.d.ts +2 -2
- package/build/src/strategies/go.js +2 -2
- package/build/src/strategies/helm.d.ts +2 -2
- package/build/src/strategies/helm.js +2 -2
- package/build/src/strategies/java-yoshi.d.ts +3 -3
- package/build/src/strategies/java-yoshi.js +2 -2
- package/build/src/strategies/krm-blueprint.d.ts +2 -2
- package/build/src/strategies/krm-blueprint.js +3 -3
- package/build/src/strategies/node.d.ts +2 -2
- package/build/src/strategies/node.js +2 -2
- package/build/src/strategies/ocaml.d.ts +2 -2
- package/build/src/strategies/ocaml.js +2 -2
- package/build/src/strategies/php-yoshi.d.ts +3 -3
- package/build/src/strategies/php-yoshi.js +2 -2
- package/build/src/strategies/php.d.ts +3 -3
- package/build/src/strategies/php.js +2 -2
- package/build/src/strategies/python.d.ts +2 -2
- package/build/src/strategies/python.js +2 -2
- package/build/src/strategies/ruby-yoshi.d.ts +3 -3
- package/build/src/strategies/ruby-yoshi.js +7 -2
- package/build/src/strategies/ruby.d.ts +3 -3
- package/build/src/strategies/ruby.js +2 -2
- package/build/src/strategies/rust.d.ts +2 -2
- package/build/src/strategies/rust.js +2 -2
- package/build/src/strategies/simple.d.ts +2 -2
- package/build/src/strategies/simple.js +2 -2
- package/build/src/strategies/terraform-module.d.ts +2 -2
- package/build/src/strategies/terraform-module.js +2 -2
- package/build/src/strategy.d.ts +8 -73
- package/build/src/strategy.js +0 -233
- package/build/src/updaters/rust/cargo-toml.js +5 -1
- package/build/src/util/commit-split.js +3 -0
- package/build/src/util/pull-request-title.js +1 -0
- package/build/src/version.d.ts +28 -5
- package/build/src/version.js +26 -0
- package/build/src/versioning-strategies/always-bump-patch.d.ts +4 -0
- package/build/src/versioning-strategies/always-bump-patch.js +4 -0
- package/build/src/versioning-strategies/default.d.ts +31 -0
- package/build/src/versioning-strategies/default.js +31 -0
- package/build/src/versioning-strategies/dependency-manifest.d.ts +8 -0
- package/build/src/versioning-strategies/dependency-manifest.js +8 -0
- package/build/src/versioning-strategies/java-add-snapshot.d.ts +4 -0
- package/build/src/versioning-strategies/java-add-snapshot.js +6 -5
- package/build/src/versioning-strategies/java-snapshot.d.ts +4 -0
- package/build/src/versioning-strategies/java-snapshot.js +4 -1
- package/build/src/versioning-strategies/service-pack.d.ts +5 -0
- package/build/src/versioning-strategies/service-pack.js +10 -3
- package/build/src/versioning-strategy.d.ts +67 -5
- package/build/src/versioning-strategy.js +37 -10
- package/package.json +3 -3
- package/build/src/release-notes.d.ts +0 -29
- package/build/src/release-notes.js +0 -71
|
@@ -1,28 +1,90 @@
|
|
|
1
1
|
import { Version } from './version';
|
|
2
2
|
import { ConventionalCommit } from './commit';
|
|
3
|
+
/**
|
|
4
|
+
* An interface for updating a version.
|
|
5
|
+
*/
|
|
3
6
|
export interface VersionUpdater {
|
|
7
|
+
/**
|
|
8
|
+
* Returns the new bumped version
|
|
9
|
+
*
|
|
10
|
+
* @param {Version} version The current version
|
|
11
|
+
* @returns {Version} The bumped version
|
|
12
|
+
*/
|
|
4
13
|
bump(version: Version): Version;
|
|
5
|
-
name: string;
|
|
6
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* This VersionUpdater performs a SemVer major version bump.
|
|
17
|
+
*/
|
|
7
18
|
export declare class MajorVersionUpdate implements VersionUpdater {
|
|
8
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Returns the new bumped version
|
|
21
|
+
*
|
|
22
|
+
* @param {Version} version The current version
|
|
23
|
+
* @returns {Version} The bumped version
|
|
24
|
+
*/
|
|
9
25
|
bump(version: Version): Version;
|
|
10
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* This VersionUpdater performs a SemVer minor version bump.
|
|
29
|
+
*/
|
|
11
30
|
export declare class MinorVersionUpdate implements VersionUpdater {
|
|
12
|
-
|
|
31
|
+
/**
|
|
32
|
+
* Returns the new bumped version
|
|
33
|
+
*
|
|
34
|
+
* @param {Version} version The current version
|
|
35
|
+
* @returns {Version} The bumped version
|
|
36
|
+
*/
|
|
13
37
|
bump(version: Version): Version;
|
|
14
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* This VersionUpdater performs a SemVer patch version bump.
|
|
41
|
+
*/
|
|
15
42
|
export declare class PatchVersionUpdate implements VersionUpdater {
|
|
16
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Returns the new bumped version
|
|
45
|
+
*
|
|
46
|
+
* @param {Version} version The current version
|
|
47
|
+
* @returns {Version} The bumped version
|
|
48
|
+
*/
|
|
17
49
|
bump(version: Version): Version;
|
|
18
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* This VersionUpdater sets the version to a specific version.
|
|
53
|
+
*/
|
|
19
54
|
export declare class CustomVersionUpdate implements VersionUpdater {
|
|
20
|
-
name: string;
|
|
21
55
|
private versionString;
|
|
22
56
|
constructor(versionString: string);
|
|
57
|
+
/**
|
|
58
|
+
* Returns the new bumped version. This version is specified
|
|
59
|
+
* at initialization.
|
|
60
|
+
*
|
|
61
|
+
* @param {Version} version The current version
|
|
62
|
+
* @returns {Version} The bumped version
|
|
63
|
+
*/
|
|
23
64
|
bump(_version: Version): Version;
|
|
24
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Implement this interface to create a new versioning scheme.
|
|
68
|
+
*/
|
|
25
69
|
export interface VersioningStrategy {
|
|
70
|
+
/**
|
|
71
|
+
* Given the current version of an artifact and a list of commits,
|
|
72
|
+
* return the next version.
|
|
73
|
+
*
|
|
74
|
+
* @param {Version} version The current version
|
|
75
|
+
* @param {ConventionalCommit[]} commits The list of commits to consider
|
|
76
|
+
* @returns {Version} The next version
|
|
77
|
+
*/
|
|
26
78
|
bump(version: Version, commits: ConventionalCommit[]): Version;
|
|
79
|
+
/**
|
|
80
|
+
* Given the current version of an artifact and a list of commits,
|
|
81
|
+
* return a VersionUpdater that knows how to bump the version.
|
|
82
|
+
*
|
|
83
|
+
* This is useful for chaining together versioning strategies.
|
|
84
|
+
*
|
|
85
|
+
* @param {Version} version The current version
|
|
86
|
+
* @param {ConventionalCommit[]} commits The list of commits to consider
|
|
87
|
+
* @returns {VersionUpdater} Updater for bumping the next version.
|
|
88
|
+
*/
|
|
27
89
|
determineReleaseType(version: Version, commits: ConventionalCommit[]): VersionUpdater;
|
|
28
90
|
}
|
|
@@ -15,38 +15,65 @@
|
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.CustomVersionUpdate = exports.PatchVersionUpdate = exports.MinorVersionUpdate = exports.MajorVersionUpdate = void 0;
|
|
17
17
|
const version_1 = require("./version");
|
|
18
|
+
/**
|
|
19
|
+
* This VersionUpdater performs a SemVer major version bump.
|
|
20
|
+
*/
|
|
18
21
|
class MajorVersionUpdate {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Returns the new bumped version
|
|
24
|
+
*
|
|
25
|
+
* @param {Version} version The current version
|
|
26
|
+
* @returns {Version} The bumped version
|
|
27
|
+
*/
|
|
22
28
|
bump(version) {
|
|
23
29
|
return new version_1.Version(version.major + 1, 0, 0, version.preRelease, version.build);
|
|
24
30
|
}
|
|
25
31
|
}
|
|
26
32
|
exports.MajorVersionUpdate = MajorVersionUpdate;
|
|
33
|
+
/**
|
|
34
|
+
* This VersionUpdater performs a SemVer minor version bump.
|
|
35
|
+
*/
|
|
27
36
|
class MinorVersionUpdate {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Returns the new bumped version
|
|
39
|
+
*
|
|
40
|
+
* @param {Version} version The current version
|
|
41
|
+
* @returns {Version} The bumped version
|
|
42
|
+
*/
|
|
31
43
|
bump(version) {
|
|
32
44
|
return new version_1.Version(version.major, version.minor + 1, 0, version.preRelease, version.build);
|
|
33
45
|
}
|
|
34
46
|
}
|
|
35
47
|
exports.MinorVersionUpdate = MinorVersionUpdate;
|
|
48
|
+
/**
|
|
49
|
+
* This VersionUpdater performs a SemVer patch version bump.
|
|
50
|
+
*/
|
|
36
51
|
class PatchVersionUpdate {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Returns the new bumped version
|
|
54
|
+
*
|
|
55
|
+
* @param {Version} version The current version
|
|
56
|
+
* @returns {Version} The bumped version
|
|
57
|
+
*/
|
|
40
58
|
bump(version) {
|
|
41
59
|
return new version_1.Version(version.major, version.minor, version.patch + 1, version.preRelease, version.build);
|
|
42
60
|
}
|
|
43
61
|
}
|
|
44
62
|
exports.PatchVersionUpdate = PatchVersionUpdate;
|
|
63
|
+
/**
|
|
64
|
+
* This VersionUpdater sets the version to a specific version.
|
|
65
|
+
*/
|
|
45
66
|
class CustomVersionUpdate {
|
|
46
67
|
constructor(versionString) {
|
|
47
|
-
this.name = 'custom';
|
|
48
68
|
this.versionString = versionString;
|
|
49
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Returns the new bumped version. This version is specified
|
|
72
|
+
* at initialization.
|
|
73
|
+
*
|
|
74
|
+
* @param {Version} version The current version
|
|
75
|
+
* @returns {Version} The bumped version
|
|
76
|
+
*/
|
|
50
77
|
bump(_version) {
|
|
51
78
|
return version_1.Version.parse(this.versionString);
|
|
52
79
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "release-please",
|
|
3
|
-
"version": "13.0.0
|
|
3
|
+
"version": "13.0.0",
|
|
4
4
|
"description": "generate release PRs based on the conventionalcommits.org spec",
|
|
5
5
|
"main": "./build/src/index.js",
|
|
6
6
|
"bin": "./build/src/bin/release-please.js",
|
|
@@ -73,6 +73,7 @@
|
|
|
73
73
|
"conventional-changelog-conventionalcommits": "^4.6.0",
|
|
74
74
|
"conventional-changelog-writer": "^5.0.0",
|
|
75
75
|
"conventional-commits-filter": "^2.0.2",
|
|
76
|
+
"detect-indent": "^6.1.0",
|
|
76
77
|
"figures": "^3.0.0",
|
|
77
78
|
"js-yaml": "^4.0.0",
|
|
78
79
|
"node-html-parser": "^5.0.0",
|
|
@@ -82,8 +83,7 @@
|
|
|
82
83
|
"typescript": "^3.8.3",
|
|
83
84
|
"unist-util-visit": "^2.0.3",
|
|
84
85
|
"unist-util-visit-parents": "^3.1.1",
|
|
85
|
-
"yargs": "^17.0.0"
|
|
86
|
-
"detect-indent": "^6.1.0"
|
|
86
|
+
"yargs": "^17.0.0"
|
|
87
87
|
},
|
|
88
88
|
"engines": {
|
|
89
89
|
"node": ">=12.18.0"
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { ConventionalCommit } from './commit';
|
|
2
|
-
export interface ChangelogSection {
|
|
3
|
-
type: string;
|
|
4
|
-
section: string;
|
|
5
|
-
hidden?: boolean;
|
|
6
|
-
}
|
|
7
|
-
interface ReleaseNotesOptions {
|
|
8
|
-
changelogSections?: ChangelogSection[];
|
|
9
|
-
commitPartial?: string;
|
|
10
|
-
headerPartial?: string;
|
|
11
|
-
mainTemplate?: string;
|
|
12
|
-
}
|
|
13
|
-
interface BuildNotesOptions {
|
|
14
|
-
host?: string;
|
|
15
|
-
owner: string;
|
|
16
|
-
repository: string;
|
|
17
|
-
version: string;
|
|
18
|
-
previousTag?: string;
|
|
19
|
-
currentTag: string;
|
|
20
|
-
}
|
|
21
|
-
export declare class ReleaseNotes {
|
|
22
|
-
private changelogSections?;
|
|
23
|
-
private commitPartial?;
|
|
24
|
-
private headerPartial?;
|
|
25
|
-
private mainTemplate?;
|
|
26
|
-
constructor(options?: ReleaseNotesOptions);
|
|
27
|
-
buildNotes(commits: ConventionalCommit[], options: BuildNotesOptions): Promise<string>;
|
|
28
|
-
}
|
|
29
|
-
export {};
|
|
@@ -1,71 +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.ReleaseNotes = void 0;
|
|
17
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
18
|
-
const conventionalChangelogWriter = require('conventional-changelog-writer');
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
20
|
-
const presetFactory = require('conventional-changelog-conventionalcommits');
|
|
21
|
-
class ReleaseNotes {
|
|
22
|
-
constructor(options = {}) {
|
|
23
|
-
this.changelogSections = options.changelogSections;
|
|
24
|
-
this.commitPartial = options.commitPartial;
|
|
25
|
-
this.headerPartial = options.headerPartial;
|
|
26
|
-
this.mainTemplate = options.mainTemplate;
|
|
27
|
-
}
|
|
28
|
-
async buildNotes(commits, options) {
|
|
29
|
-
const context = {
|
|
30
|
-
host: options.host || 'https://github.com',
|
|
31
|
-
owner: options.owner,
|
|
32
|
-
repository: options.repository,
|
|
33
|
-
version: options.version,
|
|
34
|
-
previousTag: options.previousTag,
|
|
35
|
-
currentTag: options.currentTag,
|
|
36
|
-
linkCompare: !!options.previousTag,
|
|
37
|
-
};
|
|
38
|
-
const config = {};
|
|
39
|
-
if (this.changelogSections) {
|
|
40
|
-
config.types = this.changelogSections;
|
|
41
|
-
}
|
|
42
|
-
const preset = await presetFactory(config);
|
|
43
|
-
preset.writerOpts.commitPartial =
|
|
44
|
-
this.commitPartial || preset.writerOpts.commitPartial;
|
|
45
|
-
preset.writerOpts.headerPartial =
|
|
46
|
-
this.headerPartial || preset.writerOpts.headerPartial;
|
|
47
|
-
preset.writerOpts.mainTemplate =
|
|
48
|
-
this.mainTemplate || preset.writerOpts.mainTemplate;
|
|
49
|
-
const changelogCommits = commits.map(commit => {
|
|
50
|
-
return {
|
|
51
|
-
body: '',
|
|
52
|
-
subject: commit.bareMessage,
|
|
53
|
-
type: commit.type,
|
|
54
|
-
scope: commit.scope,
|
|
55
|
-
notes: commit.notes,
|
|
56
|
-
references: commit.references,
|
|
57
|
-
mentions: [],
|
|
58
|
-
merge: null,
|
|
59
|
-
revert: null,
|
|
60
|
-
header: commit.message,
|
|
61
|
-
footer: null,
|
|
62
|
-
hash: commit.sha,
|
|
63
|
-
};
|
|
64
|
-
});
|
|
65
|
-
return conventionalChangelogWriter
|
|
66
|
-
.parseArray(changelogCommits, context, preset.writerOpts)
|
|
67
|
-
.trim();
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
exports.ReleaseNotes = ReleaseNotes;
|
|
71
|
-
//# sourceMappingURL=release-notes.js.map
|