release-please 13.17.1 → 13.18.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/CHANGELOG.md +26 -0
- package/build/src/bin/release-please.js +2 -1
- package/build/src/factories/changelog-notes-factory.js +2 -1
- package/build/src/factories/plugin-factory.js +3 -2
- package/build/src/factories/versioning-strategy-factory.d.ts +2 -0
- package/build/src/factories/versioning-strategy-factory.js +2 -1
- package/build/src/factory.js +3 -1
- package/build/src/manifest.d.ts +6 -1
- package/build/src/strategies/base.js +7 -0
- package/build/src/updaters/generic-yaml.d.ts +22 -0
- package/build/src/updaters/generic-yaml.js +77 -0
- package/build/src/util/tag-name.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,32 @@
|
|
|
4
4
|
|
|
5
5
|
[1]: https://www.npmjs.com/package/release-please?activeTab=versions
|
|
6
6
|
|
|
7
|
+
## [13.18.2](https://github.com/googleapis/release-please/compare/v13.18.1...v13.18.2) (2022-06-08)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* factory errors for unknown types throw ConfigurationError instead of Error ([#1467](https://github.com/googleapis/release-please/issues/1467)) ([faa5d25](https://github.com/googleapis/release-please/commit/faa5d25fa2075d27d42238adf34e54f6a1bc39a4))
|
|
13
|
+
|
|
14
|
+
## [13.18.1](https://github.com/googleapis/release-please/compare/v13.18.0...v13.18.1) (2022-06-08)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* set default bootstrap path to . ([#1464](https://github.com/googleapis/release-please/issues/1464)) ([c2bfbe5](https://github.com/googleapis/release-please/commit/c2bfbe5affe504f4a5183f79e338f9e7d48a8386)), closes [#1450](https://github.com/googleapis/release-please/issues/1450)
|
|
20
|
+
|
|
21
|
+
## [13.18.0](https://github.com/googleapis/release-please/compare/v13.17.1...v13.18.0) (2022-06-01)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
* add support for generic yaml updater ([#1452](https://github.com/googleapis/release-please/issues/1452)) ([002231a](https://github.com/googleapis/release-please/commit/002231acfa49b3859a7eaee184a2b520eb6611d3))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Bug Fixes
|
|
30
|
+
|
|
31
|
+
* fix parsing of tags with major versions higher than 9 ([#1451](https://github.com/googleapis/release-please/issues/1451)) ([5fc402a](https://github.com/googleapis/release-please/commit/5fc402ae41cd5aba4be5155f90fbc39f9369817d))
|
|
32
|
+
|
|
7
33
|
### [13.17.1](https://github.com/googleapis/release-please/compare/v13.17.0...v13.17.1) (2022-05-27)
|
|
8
34
|
|
|
9
35
|
|
|
@@ -466,7 +466,8 @@ const bootstrapCommand = {
|
|
|
466
466
|
argv.defaultBranch ||
|
|
467
467
|
github.repository.defaultBranch;
|
|
468
468
|
const bootstrapper = new bootstrapper_1.Bootstrapper(github, targetBranch, argv.manifestFile, argv.configFile, argv.initialVersion);
|
|
469
|
-
const
|
|
469
|
+
const path = argv.path || manifest_1.ROOT_PROJECT_PATH;
|
|
470
|
+
const pullRequest = await bootstrapper.bootstrap(path, {
|
|
470
471
|
releaseType: argv.releaseType,
|
|
471
472
|
component: argv.component,
|
|
472
473
|
packageName: argv.packageName,
|
|
@@ -16,6 +16,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
16
16
|
exports.getChangelogTypes = exports.unregisterChangelogNotes = exports.registerChangelogNotes = exports.buildChangelogNotes = void 0;
|
|
17
17
|
const github_1 = require("../changelog-notes/github");
|
|
18
18
|
const default_1 = require("../changelog-notes/default");
|
|
19
|
+
const errors_1 = require("../errors");
|
|
19
20
|
const changelogNotesFactories = {
|
|
20
21
|
github: options => new github_1.GitHubChangelogNotes(options.github),
|
|
21
22
|
default: options => new default_1.DefaultChangelogNotes(options),
|
|
@@ -25,7 +26,7 @@ function buildChangelogNotes(options) {
|
|
|
25
26
|
if (builder) {
|
|
26
27
|
return builder(options);
|
|
27
28
|
}
|
|
28
|
-
throw new
|
|
29
|
+
throw new errors_1.ConfigurationError(`Unknown changelog type: ${options.type}`, 'core', `${options.github.repository.owner}/${options.github.repository.repo}`);
|
|
29
30
|
}
|
|
30
31
|
exports.buildChangelogNotes = buildChangelogNotes;
|
|
31
32
|
function registerChangelogNotes(name, changelogNotesBuilder) {
|
|
@@ -18,6 +18,7 @@ const linked_versions_1 = require("../plugins/linked-versions");
|
|
|
18
18
|
const cargo_workspace_1 = require("../plugins/cargo-workspace");
|
|
19
19
|
const node_workspace_1 = require("../plugins/node-workspace");
|
|
20
20
|
const maven_workspace_1 = require("../plugins/maven-workspace");
|
|
21
|
+
const errors_1 = require("../errors");
|
|
21
22
|
const pluginFactories = {
|
|
22
23
|
'linked-versions': options => new linked_versions_1.LinkedVersions(options.github, options.targetBranch, options.repositoryConfig, options.type.groupName, options.type.components),
|
|
23
24
|
'cargo-workspace': options => new cargo_workspace_1.CargoWorkspace(options.github, options.targetBranch, options.repositoryConfig, options),
|
|
@@ -30,14 +31,14 @@ function buildPlugin(options) {
|
|
|
30
31
|
if (builder) {
|
|
31
32
|
return builder(options);
|
|
32
33
|
}
|
|
33
|
-
throw new
|
|
34
|
+
throw new errors_1.ConfigurationError(`Unknown plugin type: ${options.type.type}`, 'core', `${options.github.repository.owner}/${options.github.repository.repo}`);
|
|
34
35
|
}
|
|
35
36
|
else {
|
|
36
37
|
const builder = pluginFactories[options.type];
|
|
37
38
|
if (builder) {
|
|
38
39
|
return builder(options);
|
|
39
40
|
}
|
|
40
|
-
throw new
|
|
41
|
+
throw new errors_1.ConfigurationError(`Unknown plugin type: ${options.type}`, 'core', `${options.github.repository.owner}/${options.github.repository.repo}`);
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
exports.buildPlugin = buildPlugin;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { VersioningStrategy } from '../versioning-strategy';
|
|
2
|
+
import { GitHub } from '../github';
|
|
2
3
|
export declare type VersioningStrategyType = string;
|
|
3
4
|
export interface VersioningStrategyFactoryOptions {
|
|
4
5
|
type?: VersioningStrategyType;
|
|
5
6
|
bumpMinorPreMajor?: boolean;
|
|
6
7
|
bumpPatchForMinorPreMajor?: boolean;
|
|
8
|
+
github: GitHub;
|
|
7
9
|
}
|
|
8
10
|
export declare type VersioningStrategyBuilder = (options: VersioningStrategyFactoryOptions) => VersioningStrategy;
|
|
9
11
|
export declare function buildVersioningStrategy(options: VersioningStrategyFactoryOptions): VersioningStrategy;
|
|
@@ -17,6 +17,7 @@ exports.getVersioningStrategyTypes = exports.unregisterVersioningStrategy = expo
|
|
|
17
17
|
const default_1 = require("../versioning-strategies/default");
|
|
18
18
|
const always_bump_patch_1 = require("../versioning-strategies/always-bump-patch");
|
|
19
19
|
const service_pack_1 = require("../versioning-strategies/service-pack");
|
|
20
|
+
const errors_1 = require("../errors");
|
|
20
21
|
const versioningTypes = {
|
|
21
22
|
default: options => new default_1.DefaultVersioningStrategy(options),
|
|
22
23
|
'always-bump-patch': options => new always_bump_patch_1.AlwaysBumpPatch(options),
|
|
@@ -27,7 +28,7 @@ function buildVersioningStrategy(options) {
|
|
|
27
28
|
if (builder) {
|
|
28
29
|
return builder(options);
|
|
29
30
|
}
|
|
30
|
-
throw new
|
|
31
|
+
throw new errors_1.ConfigurationError(`Unknown versioning strategy type: ${options.type}`, 'core', `${options.github.repository.owner}/${options.github.repository.repo}`);
|
|
31
32
|
}
|
|
32
33
|
exports.buildVersioningStrategy = buildVersioningStrategy;
|
|
33
34
|
function registerVersioningStrategy(name, versioningStrategyBuilder) {
|
package/build/src/factory.js
CHANGED
|
@@ -53,6 +53,7 @@ const java_1 = require("./strategies/java");
|
|
|
53
53
|
const maven_1 = require("./strategies/maven");
|
|
54
54
|
const versioning_strategy_factory_1 = require("./factories/versioning-strategy-factory");
|
|
55
55
|
const changelog_notes_factory_1 = require("./factories/changelog-notes-factory");
|
|
56
|
+
const errors_1 = require("./errors");
|
|
56
57
|
__exportStar(require("./factories/changelog-notes-factory"), exports);
|
|
57
58
|
__exportStar(require("./factories/plugin-factory"), exports);
|
|
58
59
|
__exportStar(require("./factories/versioning-strategy-factory"), exports);
|
|
@@ -97,6 +98,7 @@ async function buildStrategy(options) {
|
|
|
97
98
|
var _a;
|
|
98
99
|
const targetBranch = (_a = options.targetBranch) !== null && _a !== void 0 ? _a : options.github.repository.defaultBranch;
|
|
99
100
|
const versioningStrategy = (0, versioning_strategy_factory_1.buildVersioningStrategy)({
|
|
101
|
+
github: options.github,
|
|
100
102
|
type: options.versioning,
|
|
101
103
|
bumpMinorPreMajor: options.bumpMinorPreMajor,
|
|
102
104
|
bumpPatchForMinorPreMajor: options.bumpPatchForMinorPreMajor,
|
|
@@ -117,7 +119,7 @@ async function buildStrategy(options) {
|
|
|
117
119
|
if (builder) {
|
|
118
120
|
return builder(strategyOptions);
|
|
119
121
|
}
|
|
120
|
-
throw new
|
|
122
|
+
throw new errors_1.ConfigurationError(`Unknown release type: ${options.releaseType}`, 'core', `${options.github.repository.owner}/${options.github.repository.repo}`);
|
|
121
123
|
}
|
|
122
124
|
exports.buildStrategy = buildStrategy;
|
|
123
125
|
function registerReleaseType(name, strategyBuilder) {
|
package/build/src/manifest.d.ts
CHANGED
|
@@ -10,6 +10,11 @@ declare type ExtraJsonFile = {
|
|
|
10
10
|
path: string;
|
|
11
11
|
jsonpath: string;
|
|
12
12
|
};
|
|
13
|
+
declare type ExtraYamlFile = {
|
|
14
|
+
type: 'yaml';
|
|
15
|
+
path: string;
|
|
16
|
+
jsonpath: string;
|
|
17
|
+
};
|
|
13
18
|
declare type ExtraXmlFile = {
|
|
14
19
|
type: 'xml';
|
|
15
20
|
path: string;
|
|
@@ -19,7 +24,7 @@ declare type ExtraPomFile = {
|
|
|
19
24
|
type: 'pom';
|
|
20
25
|
path: string;
|
|
21
26
|
};
|
|
22
|
-
export declare type ExtraFile = string | ExtraJsonFile | ExtraXmlFile | ExtraPomFile;
|
|
27
|
+
export declare type ExtraFile = string | ExtraJsonFile | ExtraYamlFile | ExtraXmlFile | ExtraPomFile;
|
|
23
28
|
/**
|
|
24
29
|
* These are configurations provided to each strategy per-path.
|
|
25
30
|
*/
|
|
@@ -29,6 +29,7 @@ const generic_1 = require("../updaters/generic");
|
|
|
29
29
|
const generic_json_1 = require("../updaters/generic-json");
|
|
30
30
|
const generic_xml_1 = require("../updaters/generic-xml");
|
|
31
31
|
const pom_xml_1 = require("../updaters/java/pom-xml");
|
|
32
|
+
const generic_yaml_1 = require("../updaters/generic-yaml");
|
|
32
33
|
const DEFAULT_CHANGELOG_PATH = 'CHANGELOG.md';
|
|
33
34
|
/**
|
|
34
35
|
* A strategy is responsible for determining which files are
|
|
@@ -183,6 +184,12 @@ class BaseStrategy {
|
|
|
183
184
|
createIfMissing: false,
|
|
184
185
|
updater: new generic_json_1.GenericJson(extraFile.jsonpath, version),
|
|
185
186
|
};
|
|
187
|
+
case 'yaml':
|
|
188
|
+
return {
|
|
189
|
+
path: this.addPath(extraFile.path),
|
|
190
|
+
createIfMissing: false,
|
|
191
|
+
updater: new generic_yaml_1.GenericYaml(extraFile.jsonpath, version),
|
|
192
|
+
};
|
|
186
193
|
case 'xml':
|
|
187
194
|
return {
|
|
188
195
|
path: this.addPath(extraFile.path),
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Updater } from '../update';
|
|
2
|
+
import { Version } from '../version';
|
|
3
|
+
/**
|
|
4
|
+
* Updates YAML document according to given JSONPath.
|
|
5
|
+
*
|
|
6
|
+
* Note that used parser does reformat the document and removes all comments,
|
|
7
|
+
* and converts everything to pure YAML (even JSON source).
|
|
8
|
+
* If you want to retain formatting, use generic updater with comment hints.
|
|
9
|
+
*
|
|
10
|
+
* When applied on multi-document file, it updates all documents.
|
|
11
|
+
*/
|
|
12
|
+
export declare class GenericYaml implements Updater {
|
|
13
|
+
readonly jsonpath: string;
|
|
14
|
+
readonly version: Version;
|
|
15
|
+
constructor(jsonpath: string, version: Version);
|
|
16
|
+
/**
|
|
17
|
+
* Given initial file contents, return updated contents.
|
|
18
|
+
* @param {string} content The initial content
|
|
19
|
+
* @returns {string} The updated content
|
|
20
|
+
*/
|
|
21
|
+
updateContent(content: string): string;
|
|
22
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright 2022 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.GenericYaml = void 0;
|
|
17
|
+
const jp = require("jsonpath");
|
|
18
|
+
const yaml = require("js-yaml");
|
|
19
|
+
const logger_1 = require("../util/logger");
|
|
20
|
+
const DOCUMENT_SEPARATOR = '---\n';
|
|
21
|
+
/**
|
|
22
|
+
* Updates YAML document according to given JSONPath.
|
|
23
|
+
*
|
|
24
|
+
* Note that used parser does reformat the document and removes all comments,
|
|
25
|
+
* and converts everything to pure YAML (even JSON source).
|
|
26
|
+
* If you want to retain formatting, use generic updater with comment hints.
|
|
27
|
+
*
|
|
28
|
+
* When applied on multi-document file, it updates all documents.
|
|
29
|
+
*/
|
|
30
|
+
class GenericYaml {
|
|
31
|
+
constructor(jsonpath, version) {
|
|
32
|
+
this.jsonpath = jsonpath;
|
|
33
|
+
this.version = version;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Given initial file contents, return updated contents.
|
|
37
|
+
* @param {string} content The initial content
|
|
38
|
+
* @returns {string} The updated content
|
|
39
|
+
*/
|
|
40
|
+
updateContent(content) {
|
|
41
|
+
// Parse possibly multi-document file
|
|
42
|
+
let docs;
|
|
43
|
+
try {
|
|
44
|
+
docs = yaml.loadAll(content, null, { json: true });
|
|
45
|
+
}
|
|
46
|
+
catch (e) {
|
|
47
|
+
logger_1.logger.warn('Invalid yaml, cannot be parsed', e);
|
|
48
|
+
return content;
|
|
49
|
+
}
|
|
50
|
+
// Update each document
|
|
51
|
+
let modified = false;
|
|
52
|
+
docs.forEach(data => {
|
|
53
|
+
const nodes = jp.apply(data, this.jsonpath, _val => {
|
|
54
|
+
return this.version.toString();
|
|
55
|
+
});
|
|
56
|
+
if (nodes && nodes.length) {
|
|
57
|
+
modified = true;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
// If nothing was modified, return original content
|
|
61
|
+
if (!modified) {
|
|
62
|
+
logger_1.logger.warn(`No entries modified in ${this.jsonpath}`);
|
|
63
|
+
return content;
|
|
64
|
+
}
|
|
65
|
+
// Stringify documents
|
|
66
|
+
if (docs.length === 1) {
|
|
67
|
+
// Single doc
|
|
68
|
+
return yaml.dump(docs[0]);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
// Multi-document, each document starts with separator
|
|
72
|
+
return docs.map(data => DOCUMENT_SEPARATOR + yaml.dump(data)).join('');
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.GenericYaml = GenericYaml;
|
|
77
|
+
//# sourceMappingURL=generic-yaml.js.map
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.TagName = void 0;
|
|
17
17
|
const version_1 = require("../version");
|
|
18
|
-
const TAG_PATTERN = /^((?<component>.*)(?<separator>[^a-zA-
|
|
18
|
+
const TAG_PATTERN = /^((?<component>.*)(?<separator>[^a-zA-Z0-9]))?(?<v>v)?(?<version>\d+\.\d+\.\d+.*)$/;
|
|
19
19
|
const DEFAULT_SEPARATOR = '-';
|
|
20
20
|
class TagName {
|
|
21
21
|
constructor(version, component, separator = DEFAULT_SEPARATOR, includeV = true) {
|
package/package.json
CHANGED