release-please 13.16.3 → 13.16.6
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 +40 -0
- package/build/src/bin/release-please.js +14 -13
- package/build/src/commit.js +1 -1
- package/build/src/factory.js +8 -4
- package/build/src/github.js +7 -6
- package/build/src/index.js +1 -0
- package/build/src/manifest.js +47 -26
- package/build/src/plugins/cargo-workspace.js +6 -6
- package/build/src/plugins/linked-versions.js +1 -1
- package/build/src/plugins/merge.js +1 -1
- package/build/src/plugins/node-workspace.js +2 -2
- package/build/src/strategies/base.d.ts +1 -1
- package/build/src/strategies/base.js +2 -2
- package/build/src/strategies/dotnet-yoshi.js +2 -1
- package/build/src/strategies/go-yoshi.js +1 -1
- package/build/src/strategies/java.js +1 -1
- package/build/src/strategies/php-yoshi.js +1 -1
- package/build/src/strategies/python.js +1 -1
- package/build/src/strategies/ruby-yoshi.js +4 -4
- package/build/src/strategies/ruby.js +1 -1
- package/build/src/strategies/rust.js +2 -2
- package/build/src/strategy.d.ts +6 -0
- package/build/src/updaters/dotnet/apis.js +1 -1
- package/build/src/updaters/generic-json.js +1 -1
- package/build/src/updaters/node/package-json.js +1 -1
- package/build/src/updaters/node/package-lock-json.js +1 -1
- package/build/src/updaters/node/samples-package-json.js +1 -1
- package/build/src/updaters/ocaml/esy-json.js +1 -1
- package/build/src/updaters/php/php-manifest.js +1 -1
- package/build/src/updaters/php/root-composer-update-packages.js +1 -1
- package/build/src/updaters/python/pyproject-toml.js +1 -1
- package/build/src/updaters/release-please-config.js +1 -1
- package/build/src/updaters/release-please-manifest.js +1 -1
- package/build/src/updaters/rust/cargo-lock.js +2 -2
- package/build/src/updaters/rust/cargo-toml.js +4 -4
- package/build/src/util/coerce-option.js +2 -2
- package/build/src/util/commit-split.d.ts +15 -0
- package/build/src/util/commit-split.js +25 -3
- package/build/src/util/pull-request-body.js +1 -1
- package/build/src/util/pull-request-title.js +5 -3
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,46 @@
|
|
|
4
4
|
|
|
5
5
|
[1]: https://www.npmjs.com/package/release-please?activeTab=versions
|
|
6
6
|
|
|
7
|
+
### [13.16.6](https://github.com/googleapis/release-please/compare/v13.16.5...v13.16.6) (2022-05-24)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* allow brackets in custom pull request title ([#1445](https://github.com/googleapis/release-please/issues/1445)) ([5cdbc5b](https://github.com/googleapis/release-please/commit/5cdbc5b6735392a64ae93d578e287b27c0b34d05)), closes [#1444](https://github.com/googleapis/release-please/issues/1444)
|
|
13
|
+
* **deps:** update dependency code-suggester to v3 ([#1441](https://github.com/googleapis/release-please/issues/1441)) ([8473c99](https://github.com/googleapis/release-please/commit/8473c99e12311b9a65441ff11d46990a1a494c6a))
|
|
14
|
+
|
|
15
|
+
### [13.16.5](https://github.com/googleapis/release-please/compare/v13.16.4...v13.16.5) (2022-05-18)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* all release tag matching if includeComponentInTag is false ([#1442](https://github.com/googleapis/release-please/issues/1442)) ([82a7c71](https://github.com/googleapis/release-please/commit/82a7c7186cf7c30530ce179b42b439400c539b52))
|
|
21
|
+
|
|
22
|
+
### [13.16.4](https://github.com/googleapis/release-please/compare/v13.16.3...v13.16.4) (2022-05-17)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* add release labels if release PR was completed ([#1433](https://github.com/googleapis/release-please/issues/1433)) ([072498c](https://github.com/googleapis/release-please/commit/072498c8ce2f89bc86eb33445d87491e3ab31fbd))
|
|
28
|
+
* CommitSplit with includeEmpty should add commit to all packages ([#1432](https://github.com/googleapis/release-please/issues/1432)) ([19629cb](https://github.com/googleapis/release-please/commit/19629cb42da625d6c62e67f1e9edf7f3cf14d6ee)), closes [#1360](https://github.com/googleapis/release-please/issues/1360)
|
|
29
|
+
* Manifest.fromConfig should find branch component ([#1436](https://github.com/googleapis/release-please/issues/1436)) ([628a562](https://github.com/googleapis/release-please/commit/628a562a21245ed02546aa0c40c97a0e3d50a0c7))
|
|
30
|
+
|
|
31
|
+
### [13.16.3](https://github.com/googleapis/release-please/compare/v13.16.2...v13.16.3) (2022-05-17)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Bug Fixes
|
|
35
|
+
|
|
36
|
+
* add release labels if release PR was completed ([#1433](https://github.com/googleapis/release-please/issues/1433)) ([072498c](https://github.com/googleapis/release-please/commit/072498c8ce2f89bc86eb33445d87491e3ab31fbd))
|
|
37
|
+
* CommitSplit with includeEmpty should add commit to all packages ([#1432](https://github.com/googleapis/release-please/issues/1432)) ([19629cb](https://github.com/googleapis/release-please/commit/19629cb42da625d6c62e67f1e9edf7f3cf14d6ee)), closes [#1360](https://github.com/googleapis/release-please/issues/1360)
|
|
38
|
+
* workspace plugins should update manifest versions ([#1429](https://github.com/googleapis/release-please/issues/1429)) ([ab802a9](https://github.com/googleapis/release-please/commit/ab802a924704044b26017b40a2da48657022faad))
|
|
39
|
+
|
|
40
|
+
### [13.16.3](https://github.com/googleapis/release-please/compare/v13.16.2...v13.16.3) (2022-05-13)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
### Bug Fixes
|
|
44
|
+
|
|
45
|
+
* workspace plugins should update manifest versions ([#1429](https://github.com/googleapis/release-please/issues/1429)) ([ab802a9](https://github.com/googleapis/release-please/commit/ab802a924704044b26017b40a2da48657022faad))
|
|
46
|
+
|
|
7
47
|
### [13.16.3](https://github.com/googleapis/release-please/compare/v13.16.2...v13.16.3) (2022-05-13)
|
|
8
48
|
|
|
9
49
|
|
|
@@ -62,11 +62,11 @@ function gitHubOptions(yargs) {
|
|
|
62
62
|
// allow secrets to be loaded from file path
|
|
63
63
|
// rather than being passed directly to the bin.
|
|
64
64
|
if (argv.token)
|
|
65
|
-
argv.token = coerce_option_1.coerceOption(argv.token);
|
|
65
|
+
argv.token = (0, coerce_option_1.coerceOption)(argv.token);
|
|
66
66
|
if (argv.apiUrl)
|
|
67
|
-
argv.apiUrl = coerce_option_1.coerceOption(argv.apiUrl);
|
|
67
|
+
argv.apiUrl = (0, coerce_option_1.coerceOption)(argv.apiUrl);
|
|
68
68
|
if (argv.graphqlUrl)
|
|
69
|
-
argv.graphqlUrl = coerce_option_1.coerceOption(argv.graphqlUrl);
|
|
69
|
+
argv.graphqlUrl = (0, coerce_option_1.coerceOption)(argv.graphqlUrl);
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
function releaseOptions(yargs) {
|
|
@@ -164,7 +164,7 @@ function pullRequestStrategyOptions(yargs) {
|
|
|
164
164
|
})
|
|
165
165
|
.option('versioning-strategy', {
|
|
166
166
|
describe: 'strategy used for bumping versions',
|
|
167
|
-
choices: factory_1.getVersioningStrategyTypes(),
|
|
167
|
+
choices: (0, factory_1.getVersioningStrategyTypes)(),
|
|
168
168
|
default: 'default',
|
|
169
169
|
})
|
|
170
170
|
.option('changelog-path', {
|
|
@@ -174,14 +174,14 @@ function pullRequestStrategyOptions(yargs) {
|
|
|
174
174
|
})
|
|
175
175
|
.option('changelog-type', {
|
|
176
176
|
describe: 'type of changelog to build',
|
|
177
|
-
choices: factory_1.getChangelogTypes(),
|
|
177
|
+
choices: (0, factory_1.getChangelogTypes)(),
|
|
178
178
|
})
|
|
179
179
|
.option('changelog-sections', {
|
|
180
180
|
describe: 'comma-separated list of scopes to include in the changelog',
|
|
181
181
|
type: 'string',
|
|
182
182
|
coerce: (arg) => {
|
|
183
183
|
if (arg) {
|
|
184
|
-
return changelog_notes_1.buildChangelogSections(arg.split(','));
|
|
184
|
+
return (0, changelog_notes_1.buildChangelogSections)(arg.split(','));
|
|
185
185
|
}
|
|
186
186
|
return arg;
|
|
187
187
|
},
|
|
@@ -236,7 +236,7 @@ function manifestConfigOptions(yargs, defaultType) {
|
|
|
236
236
|
})
|
|
237
237
|
.option('release-type', {
|
|
238
238
|
describe: 'what type of repo is a release being created for?',
|
|
239
|
-
choices: factory_1.getReleaserTypes(),
|
|
239
|
+
choices: (0, factory_1.getReleaserTypes)(),
|
|
240
240
|
default: defaultType,
|
|
241
241
|
});
|
|
242
242
|
}
|
|
@@ -321,7 +321,7 @@ const createReleasePullRequestCommand = {
|
|
|
321
321
|
if (argv.trace) {
|
|
322
322
|
const change = changes.get(update.path);
|
|
323
323
|
if (change) {
|
|
324
|
-
const patch = diff_1.createPatch(update.path, change.originalContent || '', change.content || '');
|
|
324
|
+
const patch = (0, diff_1.createPatch)(update.path, change.originalContent || '', change.content || '');
|
|
325
325
|
console.log(patch);
|
|
326
326
|
}
|
|
327
327
|
else {
|
|
@@ -513,10 +513,10 @@ exports.parser = yargs
|
|
|
513
513
|
})
|
|
514
514
|
.middleware(argv => {
|
|
515
515
|
if (argv.trace) {
|
|
516
|
-
logger_1.setLogger(new logger_1.CheckpointLogger(true, true));
|
|
516
|
+
(0, logger_1.setLogger)(new logger_1.CheckpointLogger(true, true));
|
|
517
517
|
}
|
|
518
518
|
else if (argv.debug) {
|
|
519
|
-
logger_1.setLogger(new logger_1.CheckpointLogger(true));
|
|
519
|
+
(0, logger_1.setLogger)(new logger_1.CheckpointLogger(true));
|
|
520
520
|
}
|
|
521
521
|
})
|
|
522
522
|
.demandCommand(1)
|
|
@@ -558,7 +558,7 @@ function extractManifestOptions(argv) {
|
|
|
558
558
|
// leak. For this reason, we capture exceptions and print
|
|
559
559
|
// a less verbose error message (run with --debug to output
|
|
560
560
|
// the request object, don't do this in CI/CD).
|
|
561
|
-
|
|
561
|
+
const handleError = (err) => {
|
|
562
562
|
var _a, _b;
|
|
563
563
|
let status = '';
|
|
564
564
|
if (exports.handleError.yargsArgs === undefined) {
|
|
@@ -577,6 +577,7 @@ exports.handleError = (err) => {
|
|
|
577
577
|
}
|
|
578
578
|
process.exitCode = 1;
|
|
579
579
|
};
|
|
580
|
+
exports.handleError = handleError;
|
|
580
581
|
// Only run parser if executed with node bin, this allows
|
|
581
582
|
// for the parser to be easily tested:
|
|
582
583
|
let argv;
|
|
@@ -585,10 +586,10 @@ if (require.main === module) {
|
|
|
585
586
|
argv = await exports.parser.parseAsync();
|
|
586
587
|
exports.handleError.yargsArgs = argv;
|
|
587
588
|
process.on('unhandledRejection', err => {
|
|
588
|
-
exports.handleError(err);
|
|
589
|
+
(0, exports.handleError)(err);
|
|
589
590
|
});
|
|
590
591
|
process.on('uncaughtException', err => {
|
|
591
|
-
exports.handleError(err);
|
|
592
|
+
(0, exports.handleError)(err);
|
|
592
593
|
});
|
|
593
594
|
})();
|
|
594
595
|
}
|
package/build/src/commit.js
CHANGED
|
@@ -89,7 +89,7 @@ function toConventionalChangelogFormat(ast) {
|
|
|
89
89
|
// summary, body, or footer:
|
|
90
90
|
const breaking = {
|
|
91
91
|
title: 'BREAKING CHANGE',
|
|
92
|
-
text: '',
|
|
92
|
+
text: '', // "text" will be populated if a BREAKING CHANGE token is parsed.
|
|
93
93
|
};
|
|
94
94
|
visitWithAncestors(ast, ['breaking-change'], (node, ancestors) => {
|
|
95
95
|
let parent = ancestors.pop();
|
package/build/src/factory.js
CHANGED
|
@@ -14,13 +14,17 @@
|
|
|
14
14
|
// limitations under the License.
|
|
15
15
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
16
16
|
if (k2 === undefined) k2 = k;
|
|
17
|
-
Object.
|
|
17
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
18
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
19
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
20
|
+
}
|
|
21
|
+
Object.defineProperty(o, k2, desc);
|
|
18
22
|
}) : (function(o, m, k, k2) {
|
|
19
23
|
if (k2 === undefined) k2 = k;
|
|
20
24
|
o[k2] = m[k];
|
|
21
25
|
}));
|
|
22
26
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
23
|
-
for (var p in m) if (p !== "default" && !
|
|
27
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
24
28
|
};
|
|
25
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
30
|
exports.getReleaserTypes = exports.unregisterReleaseType = exports.registerReleaseType = exports.buildStrategy = void 0;
|
|
@@ -92,12 +96,12 @@ const releasers = {
|
|
|
92
96
|
async function buildStrategy(options) {
|
|
93
97
|
var _a;
|
|
94
98
|
const targetBranch = (_a = options.targetBranch) !== null && _a !== void 0 ? _a : options.github.repository.defaultBranch;
|
|
95
|
-
const versioningStrategy = versioning_strategy_factory_1.buildVersioningStrategy({
|
|
99
|
+
const versioningStrategy = (0, versioning_strategy_factory_1.buildVersioningStrategy)({
|
|
96
100
|
type: options.versioning,
|
|
97
101
|
bumpMinorPreMajor: options.bumpMinorPreMajor,
|
|
98
102
|
bumpPatchForMinorPreMajor: options.bumpPatchForMinorPreMajor,
|
|
99
103
|
});
|
|
100
|
-
const changelogNotes = changelog_notes_factory_1.buildChangelogNotes({
|
|
104
|
+
const changelogNotes = (0, changelog_notes_factory_1.buildChangelogNotes)({
|
|
101
105
|
type: options.changelogType || 'default',
|
|
102
106
|
github: options.github,
|
|
103
107
|
changelogSections: options.changelogSections,
|
package/build/src/github.js
CHANGED
|
@@ -128,7 +128,7 @@ class GitHub {
|
|
|
128
128
|
this.createPullRequest = wrapAsync(async (pullRequest, targetBranch, message, updates, options) => {
|
|
129
129
|
// Update the files for the release if not already supplied
|
|
130
130
|
const changes = await this.buildChangeSet(updates, targetBranch);
|
|
131
|
-
const prNumber = await code_suggester_1.createPullRequest(this.octokit, changes, {
|
|
131
|
+
const prNumber = await (0, code_suggester_1.createPullRequest)(this.octokit, changes, {
|
|
132
132
|
upstreamOwner: this.repository.owner,
|
|
133
133
|
upstreamRepo: this.repository.repo,
|
|
134
134
|
title: pullRequest.title,
|
|
@@ -178,13 +178,13 @@ class GitHub {
|
|
|
178
178
|
const changes = await this.buildChangeSet(releasePullRequest.updates, targetBranch);
|
|
179
179
|
let message = releasePullRequest.title.toString();
|
|
180
180
|
if (options === null || options === void 0 ? void 0 : options.signoffUser) {
|
|
181
|
-
message = signoff_commit_message_1.signoffCommitMessage(message, options.signoffUser);
|
|
181
|
+
message = (0, signoff_commit_message_1.signoffCommitMessage)(message, options.signoffUser);
|
|
182
182
|
}
|
|
183
183
|
const title = releasePullRequest.title.toString();
|
|
184
184
|
const body = releasePullRequest.body
|
|
185
185
|
.toString()
|
|
186
186
|
.slice(0, MAX_ISSUE_BODY_SIZE);
|
|
187
|
-
const prNumber = await code_suggester_1.createPullRequest(this.octokit, changes, {
|
|
187
|
+
const prNumber = await (0, code_suggester_1.createPullRequest)(this.octokit, changes, {
|
|
188
188
|
upstreamOwner: this.repository.owner,
|
|
189
189
|
upstreamRepo: this.repository.repo,
|
|
190
190
|
title,
|
|
@@ -542,7 +542,7 @@ class GitHub {
|
|
|
542
542
|
repo: this.repository.repo,
|
|
543
543
|
num: 25,
|
|
544
544
|
targetBranch,
|
|
545
|
-
maxFilesChanged: 100,
|
|
545
|
+
maxFilesChanged: 100, // max is 100
|
|
546
546
|
});
|
|
547
547
|
// if the branch does exist, return null
|
|
548
548
|
if (!response.repository.ref) {
|
|
@@ -868,9 +868,10 @@ class GitHub {
|
|
|
868
868
|
async createReleasePullRequest(releasePullRequest, targetBranch, options) {
|
|
869
869
|
let message = releasePullRequest.title.toString();
|
|
870
870
|
if (options === null || options === void 0 ? void 0 : options.signoffUser) {
|
|
871
|
-
message = signoff_commit_message_1.signoffCommitMessage(message, options.signoffUser);
|
|
871
|
+
message = (0, signoff_commit_message_1.signoffCommitMessage)(message, options.signoffUser);
|
|
872
872
|
}
|
|
873
|
-
const pullRequestLabels = (options === null || options === void 0 ? void 0 : options.skipLabeling)
|
|
873
|
+
const pullRequestLabels = (options === null || options === void 0 ? void 0 : options.skipLabeling)
|
|
874
|
+
? []
|
|
874
875
|
: releasePullRequest.labels;
|
|
875
876
|
return await this.createPullRequest({
|
|
876
877
|
headBranchName: releasePullRequest.headRefName,
|
package/build/src/index.js
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
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.GitHub = exports.setLogger = exports.registerVersioningStrategy = exports.getVersioningStrategyTypes = exports.registerPlugin = exports.getPluginTypes = exports.registerChangelogNotes = exports.getChangelogTypes = exports.registerReleaseType = exports.getReleaserTypes = exports.Manifest = exports.Errors = void 0;
|
|
16
17
|
exports.Errors = require("./errors");
|
|
17
18
|
var manifest_1 = require("./manifest");
|
|
18
19
|
Object.defineProperty(exports, "Manifest", { enumerable: true, get: function () { return manifest_1.Manifest; } });
|
package/build/src/manifest.js
CHANGED
|
@@ -71,7 +71,8 @@ class Manifest {
|
|
|
71
71
|
this.releasedVersions = releasedVersions;
|
|
72
72
|
this.manifestPath =
|
|
73
73
|
(manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.manifestPath) || exports.DEFAULT_RELEASE_PLEASE_MANIFEST;
|
|
74
|
-
this.separatePullRequests =
|
|
74
|
+
this.separatePullRequests =
|
|
75
|
+
(_a = manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.separatePullRequests) !== null && _a !== void 0 ? _a : Object.keys(repositoryConfig).length === 1;
|
|
75
76
|
this.plugins = (manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.plugins) || [];
|
|
76
77
|
this.fork = (manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.fork) || false;
|
|
77
78
|
this.signoffUser = manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.signoff;
|
|
@@ -86,7 +87,8 @@ class Manifest {
|
|
|
86
87
|
this.lastReleaseSha = manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.lastReleaseSha;
|
|
87
88
|
this.draft = manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.draft;
|
|
88
89
|
this.draftPullRequest = manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.draftPullRequest;
|
|
89
|
-
this.groupPullRequestTitlePattern =
|
|
90
|
+
this.groupPullRequestTitlePattern =
|
|
91
|
+
manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.groupPullRequestTitlePattern;
|
|
90
92
|
this.releaseSearchDepth =
|
|
91
93
|
(manifestOptions === null || manifestOptions === void 0 ? void 0 : manifestOptions.releaseSearchDepth) || DEFAULT_RELEASE_SEARCH_DEPTH;
|
|
92
94
|
this.commitSearchDepth =
|
|
@@ -141,13 +143,13 @@ class Manifest {
|
|
|
141
143
|
static async fromConfig(github, targetBranch, config, manifestOptions, path = exports.ROOT_PROJECT_PATH) {
|
|
142
144
|
const repositoryConfig = {};
|
|
143
145
|
repositoryConfig[path] = config;
|
|
144
|
-
const strategy = await factory_1.buildStrategy({
|
|
146
|
+
const strategy = await (0, factory_1.buildStrategy)({
|
|
145
147
|
github,
|
|
146
148
|
...config,
|
|
147
149
|
});
|
|
148
|
-
const component = await strategy.
|
|
150
|
+
const component = await strategy.getBranchComponent();
|
|
149
151
|
const releasedVersions = {};
|
|
150
|
-
const latestVersion = await latestReleaseVersion(github, targetBranch, version => isPublishedVersion(strategy, version), config
|
|
152
|
+
const latestVersion = await latestReleaseVersion(github, targetBranch, version => isPublishedVersion(strategy, version), config, component);
|
|
151
153
|
if (latestVersion) {
|
|
152
154
|
releasedVersions[path] = latestVersion;
|
|
153
155
|
}
|
|
@@ -309,7 +311,7 @@ class Manifest {
|
|
|
309
311
|
}
|
|
310
312
|
}
|
|
311
313
|
// Build plugins
|
|
312
|
-
const plugins = this.plugins.map(pluginType => factory_1.buildPlugin({
|
|
314
|
+
const plugins = this.plugins.map(pluginType => (0, factory_1.buildPlugin)({
|
|
313
315
|
type: pluginType,
|
|
314
316
|
github: this.github,
|
|
315
317
|
targetBranch: this.targetBranch,
|
|
@@ -604,20 +606,16 @@ class Manifest {
|
|
|
604
606
|
}
|
|
605
607
|
}
|
|
606
608
|
async createReleasesForPullRequest(releases, pullRequest) {
|
|
607
|
-
|
|
608
|
-
const promises = [];
|
|
609
|
-
for (const release of releases) {
|
|
610
|
-
promises.push(this.createRelease(release));
|
|
611
|
-
}
|
|
609
|
+
logger_1.logger.info(`Creating ${releases.length} releases for pull #${pullRequest.number}`);
|
|
612
610
|
const duplicateReleases = [];
|
|
613
611
|
const githubReleases = [];
|
|
614
|
-
for (const
|
|
612
|
+
for (const release of releases) {
|
|
615
613
|
try {
|
|
616
|
-
githubReleases.push(await
|
|
614
|
+
githubReleases.push(await this.createRelease(release));
|
|
617
615
|
}
|
|
618
616
|
catch (err) {
|
|
619
617
|
if (err instanceof errors_1.DuplicateReleaseError) {
|
|
620
|
-
logger_1.logger.warn(`Duplicate release tag: ${
|
|
618
|
+
logger_1.logger.warn(`Duplicate release tag: ${release.tag.toString()}`);
|
|
621
619
|
duplicateReleases.push(err);
|
|
622
620
|
}
|
|
623
621
|
else {
|
|
@@ -625,14 +623,28 @@ class Manifest {
|
|
|
625
623
|
}
|
|
626
624
|
}
|
|
627
625
|
}
|
|
628
|
-
if (duplicateReleases.length > 0
|
|
629
|
-
|
|
626
|
+
if (duplicateReleases.length > 0) {
|
|
627
|
+
if (duplicateReleases.length + githubReleases.length ===
|
|
628
|
+
releases.length) {
|
|
629
|
+
// we've either tagged all releases or they were duplicates:
|
|
630
|
+
// adjust tags on pullRequest
|
|
631
|
+
await Promise.all([
|
|
632
|
+
this.github.removeIssueLabels(this.labels, pullRequest.number),
|
|
633
|
+
this.github.addIssueLabels(this.releaseLabels, pullRequest.number),
|
|
634
|
+
]);
|
|
635
|
+
}
|
|
636
|
+
if (githubReleases.length === 0) {
|
|
637
|
+
// If all releases were duplicate, throw a duplicate error
|
|
638
|
+
throw duplicateReleases[0];
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
else {
|
|
642
|
+
// adjust tags on pullRequest
|
|
643
|
+
await Promise.all([
|
|
644
|
+
this.github.removeIssueLabels(this.labels, pullRequest.number),
|
|
645
|
+
this.github.addIssueLabels(this.releaseLabels, pullRequest.number),
|
|
646
|
+
]);
|
|
630
647
|
}
|
|
631
|
-
// adjust tags on pullRequest
|
|
632
|
-
await Promise.all([
|
|
633
|
-
this.github.removeIssueLabels(this.labels, pullRequest.number),
|
|
634
|
-
this.github.addIssueLabels(this.releaseLabels, pullRequest.number),
|
|
635
|
-
]);
|
|
636
648
|
return githubReleases;
|
|
637
649
|
}
|
|
638
650
|
async createRelease(release) {
|
|
@@ -659,7 +671,7 @@ class Manifest {
|
|
|
659
671
|
for (const path in this.repositoryConfig) {
|
|
660
672
|
const config = this.repositoryConfig[path];
|
|
661
673
|
logger_1.logger.debug(`${path}: ${config.releaseType}`);
|
|
662
|
-
const strategy = await factory_1.buildStrategy({
|
|
674
|
+
const strategy = await (0, factory_1.buildStrategy)({
|
|
663
675
|
...config,
|
|
664
676
|
github: this.github,
|
|
665
677
|
path,
|
|
@@ -830,7 +842,7 @@ function isPublishedVersion(strategy, version) {
|
|
|
830
842
|
* @param {string} prefix Limit the release to a specific component.
|
|
831
843
|
* @param pullRequestTitlePattern Configured PR title pattern.
|
|
832
844
|
*/
|
|
833
|
-
async function latestReleaseVersion(github, targetBranch, releaseFilter,
|
|
845
|
+
async function latestReleaseVersion(github, targetBranch, releaseFilter, config, prefix) {
|
|
834
846
|
const branchPrefix = prefix
|
|
835
847
|
? prefix.endsWith('-')
|
|
836
848
|
? prefix.replace(/-$/, '')
|
|
@@ -860,7 +872,7 @@ async function latestReleaseVersion(github, targetBranch, releaseFilter, prefix,
|
|
|
860
872
|
if (branchName.getComponent() !== branchPrefix) {
|
|
861
873
|
continue;
|
|
862
874
|
}
|
|
863
|
-
const pullRequestTitle = pull_request_title_1.PullRequestTitle.parse(mergedPullRequest.title, pullRequestTitlePattern);
|
|
875
|
+
const pullRequestTitle = pull_request_title_1.PullRequestTitle.parse(mergedPullRequest.title, config.pullRequestTitlePattern);
|
|
864
876
|
if (!pullRequestTitle) {
|
|
865
877
|
continue;
|
|
866
878
|
}
|
|
@@ -879,7 +891,7 @@ async function latestReleaseVersion(github, targetBranch, releaseFilter, prefix,
|
|
|
879
891
|
if (!tagName) {
|
|
880
892
|
continue;
|
|
881
893
|
}
|
|
882
|
-
if (tagName
|
|
894
|
+
if (tagMatchesConfig(tagName, branchPrefix, config.includeComponentInTag)) {
|
|
883
895
|
logger_1.logger.debug(`found release for ${prefix}`, tagName.version);
|
|
884
896
|
if (!commitShas.has(release.sha)) {
|
|
885
897
|
logger_1.logger.debug(`SHA not found in recent commits to branch ${targetBranch}, skipping`);
|
|
@@ -902,7 +914,7 @@ async function latestReleaseVersion(github, targetBranch, releaseFilter, prefix,
|
|
|
902
914
|
if (!tagName) {
|
|
903
915
|
continue;
|
|
904
916
|
}
|
|
905
|
-
if (tagName
|
|
917
|
+
if (tagMatchesConfig(tagName, branchPrefix, config.includeComponentInTag)) {
|
|
906
918
|
if (!commitShas.has(tag.sha)) {
|
|
907
919
|
logger_1.logger.debug(`SHA not found in recent commits to branch ${targetBranch}, skipping`);
|
|
908
920
|
continue;
|
|
@@ -962,4 +974,13 @@ function commitsAfterSha(commits, lastReleaseSha) {
|
|
|
962
974
|
}
|
|
963
975
|
return commits.slice(0, index);
|
|
964
976
|
}
|
|
977
|
+
/**
|
|
978
|
+
* Returns true if the release tag matches the configured component. Returns
|
|
979
|
+
* true if `includeComponentInTag` is false and there is no component in the
|
|
980
|
+
* tag, OR if the tag's component matches the release component.
|
|
981
|
+
*/
|
|
982
|
+
function tagMatchesConfig(tag, branchComponent, includeComponentInTag) {
|
|
983
|
+
return ((includeComponentInTag && tag.component === branchComponent) ||
|
|
984
|
+
(!includeComponentInTag && !tag.component));
|
|
985
|
+
}
|
|
965
986
|
//# sourceMappingURL=manifest.js.map
|
|
@@ -38,7 +38,7 @@ class CargoWorkspace extends workspace_1.WorkspacePlugin {
|
|
|
38
38
|
async buildAllPackages(candidates) {
|
|
39
39
|
var _a, _b, _c, _d;
|
|
40
40
|
const cargoManifestContent = await this.github.getFileContentsOnBranch('Cargo.toml', this.targetBranch);
|
|
41
|
-
const cargoManifest = common_1.parseCargoManifest(cargoManifestContent.parsedContent);
|
|
41
|
+
const cargoManifest = (0, common_1.parseCargoManifest)(cargoManifestContent.parsedContent);
|
|
42
42
|
if (!((_a = cargoManifest.workspace) === null || _a === void 0 ? void 0 : _a.members)) {
|
|
43
43
|
logger_1.logger.warn("cargo-workspace plugin used, but top-level Cargo.toml isn't a cargo workspace");
|
|
44
44
|
return { allPackages: [], candidatesByPackage: {} };
|
|
@@ -54,7 +54,7 @@ class CargoWorkspace extends workspace_1.WorkspacePlugin {
|
|
|
54
54
|
// get original content of the crate
|
|
55
55
|
const manifestContent = ((_b = candidate === null || candidate === void 0 ? void 0 : candidate.pullRequest.updates.find(update => update.path === manifestPath)) === null || _b === void 0 ? void 0 : _b.cachedFileContents) ||
|
|
56
56
|
(await this.github.getFileContentsOnBranch(manifestPath, this.targetBranch));
|
|
57
|
-
const manifest = common_1.parseCargoManifest(manifestContent.parsedContent);
|
|
57
|
+
const manifest = (0, common_1.parseCargoManifest)(manifestContent.parsedContent);
|
|
58
58
|
const packageName = (_c = manifest.package) === null || _c === void 0 ? void 0 : _c.name;
|
|
59
59
|
if (!packageName) {
|
|
60
60
|
logger_1.logger.warn(`package manifest at ${manifestPath} is missing [package.name]`);
|
|
@@ -95,8 +95,8 @@ class CargoWorkspace extends workspace_1.WorkspacePlugin {
|
|
|
95
95
|
versionsMap: updatedVersions,
|
|
96
96
|
});
|
|
97
97
|
const updatedContent = updater.updateContent(pkg.manifestContent);
|
|
98
|
-
const originalManifest = common_1.parseCargoManifest(pkg.manifestContent);
|
|
99
|
-
const updatedManifest = common_1.parseCargoManifest(updatedContent);
|
|
98
|
+
const originalManifest = (0, common_1.parseCargoManifest)(pkg.manifestContent);
|
|
99
|
+
const updatedManifest = (0, common_1.parseCargoManifest)(updatedContent);
|
|
100
100
|
const dependencyNotes = getChangelogDepsNotes(originalManifest, updatedManifest);
|
|
101
101
|
existingCandidate.pullRequest.updates =
|
|
102
102
|
existingCandidate.pullRequest.updates.map(update => {
|
|
@@ -137,8 +137,8 @@ class CargoWorkspace extends workspace_1.WorkspacePlugin {
|
|
|
137
137
|
versionsMap: updatedVersions,
|
|
138
138
|
});
|
|
139
139
|
const updatedContent = updater.updateContent(pkg.manifestContent);
|
|
140
|
-
const originalManifest = common_1.parseCargoManifest(pkg.manifestContent);
|
|
141
|
-
const updatedManifest = common_1.parseCargoManifest(updatedContent);
|
|
140
|
+
const originalManifest = (0, common_1.parseCargoManifest)(pkg.manifestContent);
|
|
141
|
+
const updatedManifest = (0, common_1.parseCargoManifest)(updatedContent);
|
|
142
142
|
const dependencyNotes = getChangelogDepsNotes(originalManifest, updatedManifest);
|
|
143
143
|
const pullRequest = {
|
|
144
144
|
title: pull_request_title_1.PullRequestTitle.ofTargetBranch(this.targetBranch),
|
|
@@ -72,7 +72,7 @@ class LinkedVersions extends plugin_1.ManifestPlugin {
|
|
|
72
72
|
if (path in groupStrategies) {
|
|
73
73
|
const component = await strategiesByPath[path].getComponent();
|
|
74
74
|
logger_1.logger.info(`Replacing strategy for path ${path} with forced version: ${primaryVersion}`);
|
|
75
|
-
newStrategies[path] = await factory_1.buildStrategy({
|
|
75
|
+
newStrategies[path] = await (0, factory_1.buildStrategy)({
|
|
76
76
|
...this.repositoryConfig[path],
|
|
77
77
|
github: this.github,
|
|
78
78
|
path,
|
|
@@ -62,7 +62,7 @@ class Merge extends plugin_1.ManifestPlugin {
|
|
|
62
62
|
rootRelease = candidate;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
const updates = composite_1.mergeUpdates(rawUpdates);
|
|
65
|
+
const updates = (0, composite_1.mergeUpdates)(rawUpdates);
|
|
66
66
|
const pullRequest = {
|
|
67
67
|
title: pull_request_title_1.PullRequestTitle.ofComponentTargetBranchVersion(rootRelease === null || rootRelease === void 0 ? void 0 : rootRelease.pullRequest.title.component, this.targetBranch, rootRelease === null || rootRelease === void 0 ? void 0 : rootRelease.pullRequest.title.version, this.pullRequestTitlePattern),
|
|
68
68
|
body: new pull_request_body_1.PullRequestBody(releaseData, { useComponents: true }),
|
|
@@ -120,7 +120,7 @@ class NodeWorkspace extends workspace_1.WorkspacePlugin {
|
|
|
120
120
|
existingCandidate.pullRequest.updates =
|
|
121
121
|
existingCandidate.pullRequest.updates.map(update => {
|
|
122
122
|
if (update.path === addPath(existingCandidate.path, 'package.json')) {
|
|
123
|
-
update.updater = new raw_content_1.RawContent(json_stringify_1.jsonStringify(updatedPackage.toJSON(), updatedPackage.rawContent));
|
|
123
|
+
update.updater = new raw_content_1.RawContent((0, json_stringify_1.jsonStringify)(updatedPackage.toJSON(), updatedPackage.rawContent));
|
|
124
124
|
}
|
|
125
125
|
else if (update.updater instanceof changelog_1.Changelog) {
|
|
126
126
|
if (dependencyNotes) {
|
|
@@ -182,7 +182,7 @@ class NodeWorkspace extends workspace_1.WorkspacePlugin {
|
|
|
182
182
|
{
|
|
183
183
|
path: addPath(updatedPackage.location, 'package.json'),
|
|
184
184
|
createIfMissing: false,
|
|
185
|
-
updater: new raw_content_1.RawContent(json_stringify_1.jsonStringify(packageJson, updatedPackage.rawContent)),
|
|
185
|
+
updater: new raw_content_1.RawContent((0, json_stringify_1.jsonStringify)(packageJson, updatedPackage.rawContent)),
|
|
186
186
|
},
|
|
187
187
|
{
|
|
188
188
|
path: addPath(updatedPackage.location, 'CHANGELOG.md'),
|
|
@@ -79,7 +79,7 @@ export declare abstract class BaseStrategy implements Strategy {
|
|
|
79
79
|
*/
|
|
80
80
|
getComponent(): Promise<string | undefined>;
|
|
81
81
|
getDefaultComponent(): Promise<string | undefined>;
|
|
82
|
-
|
|
82
|
+
getBranchComponent(): Promise<string | undefined>;
|
|
83
83
|
getPackageName(): Promise<string | undefined>;
|
|
84
84
|
getDefaultPackageName(): Promise<string | undefined>;
|
|
85
85
|
protected normalizeComponent(component: string | undefined): string;
|
|
@@ -133,7 +133,7 @@ class BaseStrategy {
|
|
|
133
133
|
* open a pull request.
|
|
134
134
|
*/
|
|
135
135
|
async buildReleasePullRequest(commits, latestRelease, draft, labels = []) {
|
|
136
|
-
const conventionalCommits = await this.postProcessCommits(commit_1.parseConventionalCommits(commits));
|
|
136
|
+
const conventionalCommits = await this.postProcessCommits((0, commit_1.parseConventionalCommits)(commits));
|
|
137
137
|
logger_1.logger.info(`Considering: ${conventionalCommits.length} commits`);
|
|
138
138
|
if (conventionalCommits.length === 0) {
|
|
139
139
|
logger_1.logger.info(`No commits for path: ${this.path}, skipping`);
|
|
@@ -161,7 +161,7 @@ class BaseStrategy {
|
|
|
161
161
|
versionsMap,
|
|
162
162
|
latestVersion: latestRelease === null || latestRelease === void 0 ? void 0 : latestRelease.tag.version,
|
|
163
163
|
});
|
|
164
|
-
const updatesWithExtras = composite_1.mergeUpdates(updates.concat(...this.extraFileUpdates(newVersion, versionsMap)));
|
|
164
|
+
const updatesWithExtras = (0, composite_1.mergeUpdates)(updates.concat(...this.extraFileUpdates(newVersion, versionsMap)));
|
|
165
165
|
const pullRequestBody = await this.buildPullRequestBody(component, newVersion, releaseNotesBody, conventionalCommits, latestRelease);
|
|
166
166
|
return {
|
|
167
167
|
title: pullRequestTitle,
|
|
@@ -40,7 +40,8 @@ class DotnetYoshi extends base_1.BaseStrategy {
|
|
|
40
40
|
var _a, _b, _c, _d;
|
|
41
41
|
options.changelogSections = (_a = options.changelogSections) !== null && _a !== void 0 ? _a : CHANGELOG_SECTIONS;
|
|
42
42
|
options.changelogPath = (_b = options.changelogPath) !== null && _b !== void 0 ? _b : DEFAULT_CHANGELOG_PATH;
|
|
43
|
-
options.pullRequestTitlePattern =
|
|
43
|
+
options.pullRequestTitlePattern =
|
|
44
|
+
(_c = options.pullRequestTitlePattern) !== null && _c !== void 0 ? _c : DEFAULT_PULL_REQUEST_TITLE_PATTERN;
|
|
44
45
|
options.includeVInTag = (_d = options.includeVInTag) !== null && _d !== void 0 ? _d : false;
|
|
45
46
|
super(options);
|
|
46
47
|
}
|
|
@@ -130,7 +130,7 @@ class GoYoshi extends base_1.BaseStrategy {
|
|
|
130
130
|
logger_1.logger.info('Looking for go.mod files');
|
|
131
131
|
const paths = (await this.github.findFilesByFilenameAndRef('go.mod', this.targetBranch))
|
|
132
132
|
.filter(path => !path.includes('internal') && path !== 'go.mod')
|
|
133
|
-
.map(path => path_1.dirname(path));
|
|
133
|
+
.map(path => (0, path_1.dirname)(path));
|
|
134
134
|
logger_1.logger.info(`Found ${paths.length} submodules`);
|
|
135
135
|
logger_1.logger.debug(JSON.stringify(paths));
|
|
136
136
|
return new Set(paths);
|
|
@@ -91,7 +91,7 @@ class Java extends base_1.BaseStrategy {
|
|
|
91
91
|
changelogEntry: notes,
|
|
92
92
|
isSnapshot: true,
|
|
93
93
|
});
|
|
94
|
-
const updatesWithExtras = composite_1.mergeUpdates(updates.concat(...this.extraFileUpdates(newVersion, versionsMap)));
|
|
94
|
+
const updatesWithExtras = (0, composite_1.mergeUpdates)(updates.concat(...this.extraFileUpdates(newVersion, versionsMap)));
|
|
95
95
|
return {
|
|
96
96
|
title: pullRequestTitle,
|
|
97
97
|
body: pullRequestBody,
|
|
@@ -51,7 +51,7 @@ class PHPYoshi extends base_1.BaseStrategy {
|
|
|
51
51
|
}
|
|
52
52
|
async buildReleasePullRequest(commits, latestRelease, draft, labels = []) {
|
|
53
53
|
var _a, _b, _c;
|
|
54
|
-
const conventionalCommits = await this.postProcessCommits(commit_1.parseConventionalCommits(commits));
|
|
54
|
+
const conventionalCommits = await this.postProcessCommits((0, commit_1.parseConventionalCommits)(commits));
|
|
55
55
|
if (conventionalCommits.length === 0) {
|
|
56
56
|
logger_1.logger.info(`No commits for path: ${this.path}, skipping`);
|
|
57
57
|
return undefined;
|
|
@@ -122,7 +122,7 @@ class Python extends base_1.BaseStrategy {
|
|
|
122
122
|
async getPyProject(path) {
|
|
123
123
|
try {
|
|
124
124
|
const content = await this.github.getFileContentsOnBranch(path, this.targetBranch);
|
|
125
|
-
return pyproject_toml_1.parsePyProject(content.parsedContent);
|
|
125
|
+
return (0, pyproject_toml_1.parsePyProject)(content.parsedContent);
|
|
126
126
|
}
|
|
127
127
|
catch (e) {
|
|
128
128
|
return null;
|
|
@@ -41,9 +41,9 @@ class RubyYoshi extends base_1.BaseStrategy {
|
|
|
41
41
|
super({
|
|
42
42
|
...options,
|
|
43
43
|
changelogSections: CHANGELOG_SECTIONS,
|
|
44
|
-
commitPartial: fs_1.readFileSync(path_1.resolve(__dirname, '../../../templates/commit.hbs'), 'utf8'),
|
|
45
|
-
headerPartial: fs_1.readFileSync(path_1.resolve(__dirname, '../../../templates/header.hbs'), 'utf8'),
|
|
46
|
-
mainTemplate: fs_1.readFileSync(path_1.resolve(__dirname, '../../../templates/template.hbs'), 'utf8'),
|
|
44
|
+
commitPartial: (0, fs_1.readFileSync)((0, path_1.resolve)(__dirname, '../../../templates/commit.hbs'), 'utf8'),
|
|
45
|
+
headerPartial: (0, fs_1.readFileSync)((0, path_1.resolve)(__dirname, '../../../templates/header.hbs'), 'utf8'),
|
|
46
|
+
mainTemplate: (0, fs_1.readFileSync)((0, path_1.resolve)(__dirname, '../../../templates/template.hbs'), 'utf8'),
|
|
47
47
|
tagSeparator: '/',
|
|
48
48
|
});
|
|
49
49
|
this.versionFile = (_a = options.versionFile) !== null && _a !== void 0 ? _a : '';
|
|
@@ -73,7 +73,7 @@ class RubyYoshi extends base_1.BaseStrategy {
|
|
|
73
73
|
}
|
|
74
74
|
async postProcessCommits(commits) {
|
|
75
75
|
commits.forEach(commit => {
|
|
76
|
-
commit.message = indent_commit_1.indentCommit(commit);
|
|
76
|
+
commit.message = (0, indent_commit_1.indentCommit)(commit);
|
|
77
77
|
});
|
|
78
78
|
return commits;
|
|
79
79
|
}
|
|
@@ -52,7 +52,7 @@ class Ruby extends base_1.BaseStrategy {
|
|
|
52
52
|
}
|
|
53
53
|
async postProcessCommits(commits) {
|
|
54
54
|
commits.forEach(commit => {
|
|
55
|
-
commit.message = indent_commit_1.indentCommit(commit);
|
|
55
|
+
commit.message = (0, indent_commit_1.indentCommit)(commit);
|
|
56
56
|
});
|
|
57
57
|
return commits;
|
|
58
58
|
}
|
|
@@ -56,7 +56,7 @@ class Rust extends base_1.BaseStrategy {
|
|
|
56
56
|
logger_1.logger.warn(`member ${member} declared but did not find Cargo.toml`);
|
|
57
57
|
continue;
|
|
58
58
|
}
|
|
59
|
-
const manifest = common_1.parseCargoManifest(manifestContent.parsedContent);
|
|
59
|
+
const manifest = (0, common_1.parseCargoManifest)(manifestContent.parsedContent);
|
|
60
60
|
manifestsByPath.set(manifestPath, manifestContent);
|
|
61
61
|
if (!((_c = manifest.package) === null || _c === void 0 ? void 0 : _c.name)) {
|
|
62
62
|
logger_1.logger.warn(`member ${member} has no package name`);
|
|
@@ -142,7 +142,7 @@ class Rust extends base_1.BaseStrategy {
|
|
|
142
142
|
}
|
|
143
143
|
async getManifest(path) {
|
|
144
144
|
const content = await this.getContent(path);
|
|
145
|
-
return content ? common_1.parseCargoManifest(content.parsedContent) : null;
|
|
145
|
+
return content ? (0, common_1.parseCargoManifest)(content.parsedContent) : null;
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
exports.Rust = Rust;
|
package/build/src/strategy.d.ts
CHANGED
|
@@ -36,6 +36,12 @@ export interface Strategy {
|
|
|
36
36
|
* @returns {string}
|
|
37
37
|
*/
|
|
38
38
|
getComponent(): Promise<string | undefined>;
|
|
39
|
+
/**
|
|
40
|
+
* Return the component for this strategy used in the branch name.
|
|
41
|
+
* This may be a computed field.
|
|
42
|
+
* @returns {string}
|
|
43
|
+
*/
|
|
44
|
+
getBranchComponent(): Promise<string | undefined>;
|
|
39
45
|
/**
|
|
40
46
|
* Validate whether version is a valid release.
|
|
41
47
|
* @param version Released version.
|
|
@@ -36,7 +36,7 @@ class GenericJson {
|
|
|
36
36
|
logger_1.logger.warn(`No entries modified in ${this.jsonpath}`);
|
|
37
37
|
return content;
|
|
38
38
|
}
|
|
39
|
-
return json_stringify_1.jsonStringify(data, content);
|
|
39
|
+
return (0, json_stringify_1.jsonStringify)(data, content);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
exports.GenericJson = GenericJson;
|
|
@@ -30,7 +30,7 @@ class PackageJson extends default_1.DefaultUpdater {
|
|
|
30
30
|
const parsed = JSON.parse(content);
|
|
31
31
|
logger_1.logger.info(`updating from ${parsed.version} to ${this.version}`);
|
|
32
32
|
parsed.version = this.version.toString();
|
|
33
|
-
return json_stringify_1.jsonStringify(parsed, content);
|
|
33
|
+
return (0, json_stringify_1.jsonStringify)(parsed, content);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
exports.PackageJson = PackageJson;
|
|
@@ -29,7 +29,7 @@ class PackageLockJson extends default_1.DefaultUpdater {
|
|
|
29
29
|
if (parsed.lockfileVersion === 2) {
|
|
30
30
|
parsed.packages[''].version = this.version.toString();
|
|
31
31
|
}
|
|
32
|
-
return json_stringify_1.jsonStringify(parsed, content);
|
|
32
|
+
return (0, json_stringify_1.jsonStringify)(parsed, content);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
exports.PackageLockJson = PackageLockJson;
|
|
@@ -42,7 +42,7 @@ class SamplesPackageJson extends default_1.DefaultUpdater {
|
|
|
42
42
|
}
|
|
43
43
|
logger_1.logger.info(`updating ${this.packageName} dependency from ${parsed.dependencies[this.packageName]} to ^${this.version}`);
|
|
44
44
|
parsed.dependencies[this.packageName] = `^${this.version}`;
|
|
45
|
-
return json_stringify_1.jsonStringify(parsed, content);
|
|
45
|
+
return (0, json_stringify_1.jsonStringify)(parsed, content);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
exports.SamplesPackageJson = SamplesPackageJson;
|
|
@@ -30,7 +30,7 @@ class EsyJson extends default_1.DefaultUpdater {
|
|
|
30
30
|
const parsed = JSON.parse(content);
|
|
31
31
|
logger_1.logger.info(`updating from ${parsed.version} to ${this.version}`);
|
|
32
32
|
parsed.version = this.version.toString();
|
|
33
|
-
return json_stringify_1.jsonStringify(parsed, content);
|
|
33
|
+
return (0, json_stringify_1.jsonStringify)(parsed, content);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
exports.EsyJson = EsyJson;
|
|
@@ -48,7 +48,7 @@ class PHPManifest extends default_1.DefaultUpdater {
|
|
|
48
48
|
module.versions.unshift(`v${this.version}`);
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
|
-
return json_stringify_1.jsonStringify(parsed, content);
|
|
51
|
+
return (0, json_stringify_1.jsonStringify)(parsed, content);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
exports.PHPManifest = PHPManifest;
|
|
@@ -40,7 +40,7 @@ class RootComposerUpdatePackages extends default_1.DefaultUpdater {
|
|
|
40
40
|
parsed.replace[key] = version.toString();
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
-
return json_stringify_1.jsonStringify(parsed, content);
|
|
43
|
+
return (0, json_stringify_1.jsonStringify)(parsed, content);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
exports.RootComposerUpdatePackages = RootComposerUpdatePackages;
|
|
@@ -40,7 +40,7 @@ class PyProjectToml extends default_1.DefaultUpdater {
|
|
|
40
40
|
logger_1.logger.error(msg);
|
|
41
41
|
throw new Error(msg);
|
|
42
42
|
}
|
|
43
|
-
return toml_edit_1.replaceTomlValue(content, (parsed.project ? ['project'] : ['tool', 'poetry']).concat('version'), this.version.toString());
|
|
43
|
+
return (0, toml_edit_1.replaceTomlValue)(content, (parsed.project ? ['project'] : ['tool', 'poetry']).concat('version'), this.version.toString());
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
exports.PyProjectToml = PyProjectToml;
|
|
@@ -30,7 +30,7 @@ class ReleasePleaseConfig {
|
|
|
30
30
|
}
|
|
31
31
|
parsed.packages[this.path] = this.config;
|
|
32
32
|
if (content) {
|
|
33
|
-
return json_stringify_1.jsonStringify(parsed, content);
|
|
33
|
+
return (0, json_stringify_1.jsonStringify)(parsed, content);
|
|
34
34
|
}
|
|
35
35
|
else {
|
|
36
36
|
return JSON.stringify(parsed, null, 2);
|
|
@@ -23,7 +23,7 @@ class ReleasePleaseManifest extends default_1.DefaultUpdater {
|
|
|
23
23
|
parsed[path] = version.toString();
|
|
24
24
|
}
|
|
25
25
|
if (content) {
|
|
26
|
-
return json_stringify_1.jsonStringify(parsed, content);
|
|
26
|
+
return (0, json_stringify_1.jsonStringify)(parsed, content);
|
|
27
27
|
}
|
|
28
28
|
else {
|
|
29
29
|
return JSON.stringify(parsed, null, 2);
|
|
@@ -31,7 +31,7 @@ class CargoLock {
|
|
|
31
31
|
*/
|
|
32
32
|
updateContent(content) {
|
|
33
33
|
let payload = content;
|
|
34
|
-
const parsed = common_1.parseCargoLockfile(payload);
|
|
34
|
+
const parsed = (0, common_1.parseCargoLockfile)(payload);
|
|
35
35
|
if (!parsed.package) {
|
|
36
36
|
logger_1.logger.error('is not a Cargo lockfile');
|
|
37
37
|
throw new Error('is not a Cargo lockfile');
|
|
@@ -55,7 +55,7 @@ class CargoLock {
|
|
|
55
55
|
// `path` argument.
|
|
56
56
|
const packageIndex = i.toString();
|
|
57
57
|
logger_1.logger.info(`updating ${pkg.name} in`);
|
|
58
|
-
payload = toml_edit_1.replaceTomlValue(payload, ['package', packageIndex, 'version'], nextVersion.toString());
|
|
58
|
+
payload = (0, toml_edit_1.replaceTomlValue)(payload, ['package', packageIndex, 'version'], nextVersion.toString());
|
|
59
59
|
}
|
|
60
60
|
return payload;
|
|
61
61
|
}
|
|
@@ -32,13 +32,13 @@ class CargoToml extends default_1.DefaultUpdater {
|
|
|
32
32
|
if (!this.versionsMap) {
|
|
33
33
|
throw new Error('updateContent called with no versions');
|
|
34
34
|
}
|
|
35
|
-
const parsed = common_1.parseCargoManifest(payload);
|
|
35
|
+
const parsed = (0, common_1.parseCargoManifest)(payload);
|
|
36
36
|
if (!parsed.package) {
|
|
37
37
|
const msg = 'is not a package manifest (might be a cargo workspace)';
|
|
38
38
|
logger_1.logger.error(msg);
|
|
39
39
|
throw new Error(msg);
|
|
40
40
|
}
|
|
41
|
-
payload = toml_edit_1.replaceTomlValue(payload, ['package', 'version'], this.version.toString());
|
|
41
|
+
payload = (0, toml_edit_1.replaceTomlValue)(payload, ['package', 'version'], this.version.toString());
|
|
42
42
|
for (const [pkgName, pkgVersion] of this.versionsMap) {
|
|
43
43
|
for (const depKind of common_1.DEP_KINDS) {
|
|
44
44
|
const deps = parsed[depKind];
|
|
@@ -58,7 +58,7 @@ class CargoToml extends default_1.DefaultUpdater {
|
|
|
58
58
|
continue; // to next depKind
|
|
59
59
|
}
|
|
60
60
|
logger_1.logger.info(`updating ${depKind}.${pkgName} from ${dep.version} to ${pkgVersion}`);
|
|
61
|
-
payload = toml_edit_1.replaceTomlValue(payload, [depKind, pkgName, 'version'], pkgVersion.toString());
|
|
61
|
+
payload = (0, toml_edit_1.replaceTomlValue)(payload, [depKind, pkgName, 'version'], pkgVersion.toString());
|
|
62
62
|
}
|
|
63
63
|
// Update platform-specific dependencies
|
|
64
64
|
if (parsed.target) {
|
|
@@ -77,7 +77,7 @@ class CargoToml extends default_1.DefaultUpdater {
|
|
|
77
77
|
continue; // to next depKind
|
|
78
78
|
}
|
|
79
79
|
logger_1.logger.info(`updating target.${targetName}.${depKind}.${pkgName} from ${dep.version} to ${pkgVersion}`);
|
|
80
|
-
payload = toml_edit_1.replaceTomlValue(payload, ['target', targetName, depKind, pkgName, 'version'], pkgVersion.toString());
|
|
80
|
+
payload = (0, toml_edit_1.replaceTomlValue)(payload, ['target', targetName, depKind, pkgName, 'version'], pkgVersion.toString());
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
}
|
|
@@ -20,11 +20,11 @@ const fs_1 = require("fs");
|
|
|
20
20
|
function coerceOption(option) {
|
|
21
21
|
if (option.match(/[\\/]/)) {
|
|
22
22
|
try {
|
|
23
|
-
const stat = fs_1.statSync(option);
|
|
23
|
+
const stat = (0, fs_1.statSync)(option);
|
|
24
24
|
if (stat.isDirectory())
|
|
25
25
|
return option;
|
|
26
26
|
else
|
|
27
|
-
return fs_1.readFileSync(option, 'utf8').trim();
|
|
27
|
+
return (0, fs_1.readFileSync)(option, 'utf8').trim();
|
|
28
28
|
}
|
|
29
29
|
catch (err) {
|
|
30
30
|
// simply fallback to returning the original option.
|
|
@@ -3,9 +3,24 @@ export interface CommitSplitOptions {
|
|
|
3
3
|
includeEmpty?: boolean;
|
|
4
4
|
packagePaths?: string[];
|
|
5
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* Helper class for splitting commits by component path. If `packagePaths`
|
|
8
|
+
* is configured, then only consider the provided paths. If `includeEmpty`
|
|
9
|
+
* is configured, then commits without any touched files apply to all
|
|
10
|
+
* configured component paths.
|
|
11
|
+
*/
|
|
6
12
|
export declare class CommitSplit {
|
|
7
13
|
includeEmpty: boolean;
|
|
8
14
|
packagePaths?: string[];
|
|
9
15
|
constructor(opts?: CommitSplitOptions);
|
|
16
|
+
/**
|
|
17
|
+
* Split commits by component path. If the commit splitter is configured
|
|
18
|
+
* with a set of tracked package paths, then only consider paths for
|
|
19
|
+
* configured components. If `includeEmpty` is configured, then a commit
|
|
20
|
+
* that does not touch any files will be applied to all components'
|
|
21
|
+
* commits.
|
|
22
|
+
* @param {Commit[]} commits The commits to split
|
|
23
|
+
* @returns {Record<string, Commit[]>} Commits indexed by component path
|
|
24
|
+
*/
|
|
10
25
|
split<T extends Commit>(commits: T[]): Record<string, T[]>;
|
|
11
26
|
}
|
|
@@ -15,6 +15,12 @@
|
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.CommitSplit = void 0;
|
|
17
17
|
const manifest_1 = require("../manifest");
|
|
18
|
+
/**
|
|
19
|
+
* Helper class for splitting commits by component path. If `packagePaths`
|
|
20
|
+
* is configured, then only consider the provided paths. If `includeEmpty`
|
|
21
|
+
* is configured, then commits without any touched files apply to all
|
|
22
|
+
* configured component paths.
|
|
23
|
+
*/
|
|
18
24
|
class CommitSplit {
|
|
19
25
|
constructor(opts) {
|
|
20
26
|
opts = opts || {};
|
|
@@ -50,7 +56,15 @@ class CommitSplit {
|
|
|
50
56
|
this.packagePaths = paths;
|
|
51
57
|
}
|
|
52
58
|
}
|
|
53
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Split commits by component path. If the commit splitter is configured
|
|
61
|
+
* with a set of tracked package paths, then only consider paths for
|
|
62
|
+
* configured components. If `includeEmpty` is configured, then a commit
|
|
63
|
+
* that does not touch any files will be applied to all components'
|
|
64
|
+
* commits.
|
|
65
|
+
* @param {Commit[]} commits The commits to split
|
|
66
|
+
* @returns {Record<string, Commit[]>} Commits indexed by component path
|
|
67
|
+
*/
|
|
54
68
|
split(commits) {
|
|
55
69
|
const splitCommits = {};
|
|
56
70
|
commits.forEach(commit => {
|
|
@@ -85,8 +99,16 @@ class CommitSplit {
|
|
|
85
99
|
splitCommits[pkgName].push(commit);
|
|
86
100
|
}
|
|
87
101
|
if (commit.files.length === 0 && this.includeEmpty) {
|
|
88
|
-
|
|
89
|
-
|
|
102
|
+
if (this.packagePaths) {
|
|
103
|
+
for (const pkgName of this.packagePaths) {
|
|
104
|
+
splitCommits[pkgName] = splitCommits[pkgName] || [];
|
|
105
|
+
splitCommits[pkgName].push(commit);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
for (const pkgName in splitCommits) {
|
|
110
|
+
splitCommits[pkgName].push(commit);
|
|
111
|
+
}
|
|
90
112
|
}
|
|
91
113
|
}
|
|
92
114
|
});
|
|
@@ -94,7 +94,7 @@ const SUMMARY_PATTERN = /^(?<component>.*[^:]):? (?<version>\d+\.\d+\.\d+.*)$/;
|
|
|
94
94
|
const COMPONENTLESS_SUMMARY_PATTERN = /^(?<version>\d+\.\d+\.\d+.*)$/;
|
|
95
95
|
function extractMultipleReleases(notes) {
|
|
96
96
|
const data = [];
|
|
97
|
-
const root = node_html_parser_1.parse(notes);
|
|
97
|
+
const root = (0, node_html_parser_1.parse)(notes);
|
|
98
98
|
for (const detail of root.getElementsByTagName('details')) {
|
|
99
99
|
const summaryNode = detail.getElementsByTagName('summary')[0];
|
|
100
100
|
const summary = summaryNode === null || summaryNode === void 0 ? void 0 : summaryNode.textContent;
|
|
@@ -31,10 +31,12 @@ function generateMatchPattern(pullRequestTitlePattern) {
|
|
|
31
31
|
pullRequestTitlePattern.search(/\$\{version\}/) === -1)
|
|
32
32
|
logger_1.logger.warn("pullRequestTitlePattern miss the part of '${version}'");
|
|
33
33
|
return new RegExp(`^${(pullRequestTitlePattern || DEFAULT_PR_TITLE_PATTERN)
|
|
34
|
-
.replace('
|
|
34
|
+
.replace('[', '\\[') // TODO: handle all regex escaping
|
|
35
|
+
.replace(']', '\\]')
|
|
36
|
+
.replace('${scope}', '(\\((?<branch>[\\w-./]+)\\))?')
|
|
35
37
|
.replace('${component}', ' ?(?<component>[\\w-.]*)?')
|
|
36
38
|
.replace('${version}', 'v?(?<version>[0-9].*)')
|
|
37
|
-
.replace('${branch}', '(?<branch>[\\w
|
|
39
|
+
.replace('${branch}', '(?<branch>[\\w-./]+)?')}$`);
|
|
38
40
|
}
|
|
39
41
|
exports.generateMatchPattern = generateMatchPattern;
|
|
40
42
|
class PullRequestTitle {
|
|
@@ -56,7 +58,7 @@ class PullRequestTitle {
|
|
|
56
58
|
: undefined,
|
|
57
59
|
component: match.groups['component'],
|
|
58
60
|
targetBranch: match.groups['branch'],
|
|
59
|
-
pullRequestTitlePattern
|
|
61
|
+
pullRequestTitlePattern,
|
|
60
62
|
});
|
|
61
63
|
}
|
|
62
64
|
return undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "release-please",
|
|
3
|
-
"version": "13.16.
|
|
3
|
+
"version": "13.16.6",
|
|
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",
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"c8": "^7.0.0",
|
|
58
58
|
"chai": "^4.2.0",
|
|
59
59
|
"cross-env": "^7.0.0",
|
|
60
|
-
"gts": "^3.
|
|
61
|
-
"mocha": "^9.
|
|
60
|
+
"gts": "^3.1.0",
|
|
61
|
+
"mocha": "^9.2.2",
|
|
62
62
|
"nock": "^13.0.0",
|
|
63
63
|
"sinon": "14.0.0",
|
|
64
64
|
"snap-shot-it": "^7.0.0"
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"@types/npm-package-arg": "^6.1.0",
|
|
78
78
|
"@xmldom/xmldom": "^0.8.2",
|
|
79
79
|
"chalk": "^4.0.0",
|
|
80
|
-
"code-suggester": "^
|
|
80
|
+
"code-suggester": "^3.0.0",
|
|
81
81
|
"conventional-changelog-conventionalcommits": "^4.6.0",
|
|
82
82
|
"conventional-changelog-writer": "^5.0.0",
|
|
83
83
|
"conventional-commits-filter": "^2.0.2",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"parse-github-repo-url": "^1.4.1",
|
|
91
91
|
"semver": "^7.0.0",
|
|
92
92
|
"type-fest": "^2.0.0",
|
|
93
|
-
"typescript": "^
|
|
93
|
+
"typescript": "^4.6.4",
|
|
94
94
|
"unist-util-visit": "^2.0.3",
|
|
95
95
|
"unist-util-visit-parents": "^3.1.1",
|
|
96
96
|
"xpath": "^0.0.32",
|