release-please 16.14.0 → 16.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/src/commit.js +1 -1
- package/build/src/factories/plugin-factory.d.ts +1 -0
- package/build/src/factories/plugin-factory.js +31 -13
- package/build/src/index.d.ts +1 -1
- package/build/src/index.js +1 -1
- package/build/src/manifest.js +1 -0
- package/build/src/updaters/generic-json.js +17 -15
- package/build/src/updaters/generic-toml.js +7 -2
- package/build/src/updaters/generic-yaml.js +14 -6
- package/build/src/updaters/java/versions-manifest.js +2 -2
- package/package.json +2 -2
package/build/src/commit.js
CHANGED
|
@@ -328,7 +328,7 @@ function splitMessages(message) {
|
|
|
328
328
|
messages[0] = messages[0] + rest.join('END_NESTED_COMMIT');
|
|
329
329
|
}
|
|
330
330
|
const conventionalCommits = messages[0]
|
|
331
|
-
.split(/\n(?=(?:feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.*?\))?: )/)
|
|
331
|
+
.split(/\r?\n\r?\n(?=(?:feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.*?\))?: )/)
|
|
332
332
|
.filter(Boolean);
|
|
333
333
|
return [...conventionalCommits, ...messages.slice(1)];
|
|
334
334
|
}
|
|
@@ -22,26 +22,44 @@ const errors_1 = require("../errors");
|
|
|
22
22
|
const sentence_case_1 = require("../plugins/sentence-case");
|
|
23
23
|
const group_priority_1 = require("../plugins/group-priority");
|
|
24
24
|
const pluginFactories = {
|
|
25
|
-
'linked-versions': options =>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
'cargo-workspace': options => new cargo_workspace_1.CargoWorkspace(options.github, options.targetBranch, options.repositoryConfig, {
|
|
30
|
-
...options,
|
|
31
|
-
...options.type,
|
|
32
|
-
}),
|
|
33
|
-
'node-workspace': options => new node_workspace_1.NodeWorkspace(options.github, options.targetBranch, options.repositoryConfig, {
|
|
34
|
-
...options,
|
|
35
|
-
...options.type,
|
|
36
|
-
}),
|
|
37
|
-
'maven-workspace': options => new maven_workspace_1.MavenWorkspace(options.github, options.targetBranch, options.repositoryConfig, {
|
|
25
|
+
'linked-versions': options =>
|
|
26
|
+
// NOTE: linked-versions had already have a different behavior about merging
|
|
27
|
+
// see test/plugins/compatibility/linked-versions-workspace.ts
|
|
28
|
+
new linked_versions_1.LinkedVersions(options.github, options.targetBranch, options.repositoryConfig, options.type.groupName, options.type.components, {
|
|
38
29
|
...options,
|
|
39
30
|
...options.type,
|
|
40
31
|
}),
|
|
32
|
+
'cargo-workspace': options => {
|
|
33
|
+
var _a;
|
|
34
|
+
return new cargo_workspace_1.CargoWorkspace(options.github, options.targetBranch, options.repositoryConfig, {
|
|
35
|
+
...options,
|
|
36
|
+
...options.type,
|
|
37
|
+
merge: (_a = options.type.merge) !== null && _a !== void 0 ? _a : !options.separatePullRequests,
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
'node-workspace': options => {
|
|
41
|
+
var _a;
|
|
42
|
+
return new node_workspace_1.NodeWorkspace(options.github, options.targetBranch, options.repositoryConfig, {
|
|
43
|
+
...options,
|
|
44
|
+
...options.type,
|
|
45
|
+
merge: (_a = options.type.merge) !== null && _a !== void 0 ? _a : !options.separatePullRequests,
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
'maven-workspace': options => {
|
|
49
|
+
var _a;
|
|
50
|
+
return new maven_workspace_1.MavenWorkspace(options.github, options.targetBranch, options.repositoryConfig, {
|
|
51
|
+
...options,
|
|
52
|
+
...options.type,
|
|
53
|
+
merge: (_a = options.type.merge) !== null && _a !== void 0 ? _a : !options.separatePullRequests,
|
|
54
|
+
});
|
|
55
|
+
},
|
|
41
56
|
'sentence-case': options => new sentence_case_1.SentenceCase(options.github, options.targetBranch, options.repositoryConfig, options.type.specialWords),
|
|
42
57
|
'group-priority': options => new group_priority_1.GroupPriority(options.github, options.targetBranch, options.repositoryConfig, options.type.groups),
|
|
43
58
|
};
|
|
44
59
|
function buildPlugin(options) {
|
|
60
|
+
if (!options.separatePullRequests) {
|
|
61
|
+
options.separatePullRequests = false;
|
|
62
|
+
}
|
|
45
63
|
if (typeof options.type === 'object') {
|
|
46
64
|
const builder = pluginFactories[options.type.type];
|
|
47
65
|
if (builder) {
|
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 = '16.14.
|
|
39
|
+
exports.VERSION = '16.14.2';
|
|
40
40
|
// x-release-please-end
|
|
41
41
|
//# sourceMappingURL=index.js.map
|
package/build/src/manifest.js
CHANGED
|
@@ -104,6 +104,7 @@ class Manifest {
|
|
|
104
104
|
targetBranch: this.targetBranch,
|
|
105
105
|
repositoryConfig: this.repositoryConfig,
|
|
106
106
|
manifestPath: this.manifestPath,
|
|
107
|
+
separatePullRequests: this.separatePullRequests,
|
|
107
108
|
}));
|
|
108
109
|
this.pullRequestOverflowHandler = new pull_request_overflow_handler_1.FilePullRequestOverflowHandler(this.github, this.logger);
|
|
109
110
|
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// limitations under the License.
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.GenericJson = void 0;
|
|
17
|
-
const
|
|
17
|
+
const jsonpath_plus_1 = require("jsonpath-plus");
|
|
18
18
|
const json_stringify_1 = require("../util/json-stringify");
|
|
19
19
|
const logger_1 = require("../util/logger");
|
|
20
20
|
const VERSION_REGEX = /(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)(-(?<preRelease>[\w.]+))?(\+(?<build>[-\w.]+))?/;
|
|
@@ -30,21 +30,23 @@ class GenericJson {
|
|
|
30
30
|
*/
|
|
31
31
|
updateContent(content, logger = logger_1.logger) {
|
|
32
32
|
const data = JSON.parse(content);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
33
|
+
(0, jsonpath_plus_1.JSONPath)({
|
|
34
|
+
resultType: 'all',
|
|
35
|
+
path: this.jsonpath,
|
|
36
|
+
json: data,
|
|
37
|
+
callback: (payload, _payloadType, _fullPayload) => {
|
|
38
|
+
if (typeof payload.value !== 'string') {
|
|
39
|
+
logger.warn(`No string in ${this.jsonpath}. Skipping.`);
|
|
40
|
+
return payload;
|
|
41
|
+
}
|
|
42
|
+
if (!payload.value.match(VERSION_REGEX)) {
|
|
43
|
+
logger.warn(`No version found in ${this.jsonpath}. Skipping.`);
|
|
44
|
+
return payload;
|
|
45
|
+
}
|
|
46
|
+
payload.parent[payload.parentProperty] = payload.parent[payload.parentProperty].replace(VERSION_REGEX, this.version.toString());
|
|
47
|
+
return payload;
|
|
48
|
+
},
|
|
43
49
|
});
|
|
44
|
-
if (!nodes) {
|
|
45
|
-
logger.warn(`No entries modified in ${this.jsonpath}`);
|
|
46
|
-
return content;
|
|
47
|
-
}
|
|
48
50
|
return (0, json_stringify_1.jsonStringify)(data, content);
|
|
49
51
|
}
|
|
50
52
|
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// limitations under the License.
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.GenericToml = void 0;
|
|
17
|
-
const
|
|
17
|
+
const jsonpath_plus_1 = require("jsonpath-plus");
|
|
18
18
|
const toml_edit_1 = require("../util/toml-edit");
|
|
19
19
|
const logger_1 = require("../util/logger");
|
|
20
20
|
/**
|
|
@@ -43,7 +43,12 @@ class GenericToml {
|
|
|
43
43
|
logger.warn('Invalid toml, cannot be parsed', e);
|
|
44
44
|
return content;
|
|
45
45
|
}
|
|
46
|
-
const
|
|
46
|
+
const pointers = (0, jsonpath_plus_1.JSONPath)({
|
|
47
|
+
path: this.jsonpath,
|
|
48
|
+
json: data,
|
|
49
|
+
resultType: 'pointer',
|
|
50
|
+
});
|
|
51
|
+
const paths = pointers.map(pointer => pointer.split('/').filter(Boolean));
|
|
47
52
|
if (!paths || paths.length === 0) {
|
|
48
53
|
logger.warn(`No entries modified in ${this.jsonpath}`);
|
|
49
54
|
return content;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// limitations under the License.
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.GenericYaml = void 0;
|
|
17
|
-
const
|
|
17
|
+
const jsonpath_plus_1 = require("jsonpath-plus");
|
|
18
18
|
const yaml = require("js-yaml");
|
|
19
19
|
const logger_1 = require("../util/logger");
|
|
20
20
|
const DOCUMENT_SEPARATOR = '---\n';
|
|
@@ -50,12 +50,20 @@ class GenericYaml {
|
|
|
50
50
|
// Update each document
|
|
51
51
|
let modified = false;
|
|
52
52
|
docs.forEach(data => {
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
(0, jsonpath_plus_1.JSONPath)({
|
|
54
|
+
resultType: 'all',
|
|
55
|
+
path: this.jsonpath,
|
|
56
|
+
json: data,
|
|
57
|
+
callback: (payload, _payloadType, _fullPayload) => {
|
|
58
|
+
if (typeof payload.value !== 'string') {
|
|
59
|
+
logger.warn(`No string in ${this.jsonpath}. Skipping.`);
|
|
60
|
+
return payload;
|
|
61
|
+
}
|
|
62
|
+
modified = true;
|
|
63
|
+
payload.parent[payload.parentProperty] = this.version.toString();
|
|
64
|
+
return payload;
|
|
65
|
+
},
|
|
55
66
|
});
|
|
56
|
-
if (nodes && nodes.length) {
|
|
57
|
-
modified = true;
|
|
58
|
-
}
|
|
59
67
|
});
|
|
60
68
|
// If nothing was modified, return original content
|
|
61
69
|
if (!modified) {
|
|
@@ -43,10 +43,10 @@ class VersionsManifest extends java_update_1.JavaUpdate {
|
|
|
43
43
|
const newLines = [];
|
|
44
44
|
content.split(/\r?\n/).forEach(line => {
|
|
45
45
|
if (version.includes('SNAPSHOT')) {
|
|
46
|
-
newLines.push(line.replace(new RegExp(
|
|
46
|
+
newLines.push(line.replace(new RegExp(`^${packageName}:(.*):(.*)`, 'g'), `${packageName}:$1:${version}`));
|
|
47
47
|
}
|
|
48
48
|
else {
|
|
49
|
-
newLines.push(line.replace(new RegExp(
|
|
49
|
+
newLines.push(line.replace(new RegExp(`^${packageName}:(.*):(.*)`, 'g'), `${packageName}:${version}:${version}`));
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
52
|
return newLines.join('\n');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "release-please",
|
|
3
|
-
"version": "16.14.
|
|
3
|
+
"version": "16.14.2",
|
|
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",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"http-proxy-agent": "^7.0.0",
|
|
87
87
|
"https-proxy-agent": "^7.0.0",
|
|
88
88
|
"js-yaml": "^4.0.0",
|
|
89
|
-
"jsonpath": "^
|
|
89
|
+
"jsonpath-plus": "^9.0.0",
|
|
90
90
|
"node-html-parser": "^6.0.0",
|
|
91
91
|
"parse-github-repo-url": "^1.4.1",
|
|
92
92
|
"semver": "^7.5.3",
|