release-please 13.16.2 → 13.16.3
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 +7 -0
- package/build/src/factories/plugin-factory.d.ts +1 -0
- package/build/src/manifest.js +1 -0
- package/build/src/plugins/cargo-workspace.d.ts +1 -0
- package/build/src/plugins/cargo-workspace.js +3 -0
- package/build/src/plugins/node-workspace.d.ts +1 -0
- package/build/src/plugins/node-workspace.js +3 -0
- package/build/src/plugins/workspace.d.ts +8 -0
- package/build/src/plugins/workspace.js +21 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
[1]: https://www.npmjs.com/package/release-please?activeTab=versions
|
|
6
6
|
|
|
7
|
+
### [13.16.3](https://github.com/googleapis/release-please/compare/v13.16.2...v13.16.3) (2022-05-13)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* workspace plugins should update manifest versions ([#1429](https://github.com/googleapis/release-please/issues/1429)) ([ab802a9](https://github.com/googleapis/release-please/commit/ab802a924704044b26017b40a2da48657022faad))
|
|
13
|
+
|
|
7
14
|
### [13.16.2](https://github.com/googleapis/release-please/compare/v13.16.1...v13.16.2) (2022-05-12)
|
|
8
15
|
|
|
9
16
|
|
package/build/src/manifest.js
CHANGED
|
@@ -47,5 +47,6 @@ export declare class CargoWorkspace extends WorkspacePlugin<CrateInfo> {
|
|
|
47
47
|
protected buildGraph(allPackages: CrateInfo[]): Promise<DependencyGraph<CrateInfo>>;
|
|
48
48
|
protected inScope(candidate: CandidateReleasePullRequest): boolean;
|
|
49
49
|
protected packageNameFromPackage(pkg: CrateInfo): string;
|
|
50
|
+
protected pathFromPackage(pkg: CrateInfo): string;
|
|
50
51
|
}
|
|
51
52
|
export {};
|
|
@@ -213,6 +213,9 @@ class CargoWorkspace extends workspace_1.WorkspacePlugin {
|
|
|
213
213
|
packageNameFromPackage(pkg) {
|
|
214
214
|
return pkg.name;
|
|
215
215
|
}
|
|
216
|
+
pathFromPackage(pkg) {
|
|
217
|
+
return pkg.path;
|
|
218
|
+
}
|
|
216
219
|
}
|
|
217
220
|
exports.CargoWorkspace = CargoWorkspace;
|
|
218
221
|
function getChangelogDepsNotes(originalManifest, updatedManifest) {
|
|
@@ -33,5 +33,6 @@ export declare class NodeWorkspace extends WorkspacePlugin<Package> {
|
|
|
33
33
|
protected buildGraph(allPackages: Package[]): Promise<DependencyGraph<Package>>;
|
|
34
34
|
protected inScope(candidate: CandidateReleasePullRequest): boolean;
|
|
35
35
|
protected packageNameFromPackage(pkg: Package): string;
|
|
36
|
+
protected pathFromPackage(pkg: Package): string;
|
|
36
37
|
}
|
|
37
38
|
export {};
|
|
@@ -235,6 +235,9 @@ class NodeWorkspace extends workspace_1.WorkspacePlugin {
|
|
|
235
235
|
packageNameFromPackage(pkg) {
|
|
236
236
|
return pkg.name;
|
|
237
237
|
}
|
|
238
|
+
pathFromPackage(pkg) {
|
|
239
|
+
return pkg.location;
|
|
240
|
+
}
|
|
238
241
|
}
|
|
239
242
|
exports.NodeWorkspace = NodeWorkspace;
|
|
240
243
|
function getChangelogDepsNotes(original, updated) {
|
|
@@ -8,6 +8,7 @@ export interface DependencyNode<T> {
|
|
|
8
8
|
value: T;
|
|
9
9
|
}
|
|
10
10
|
export interface WorkspacePluginOptions {
|
|
11
|
+
manifestPath?: string;
|
|
11
12
|
updateAllPackages?: boolean;
|
|
12
13
|
}
|
|
13
14
|
interface AllPackages<T> {
|
|
@@ -27,6 +28,7 @@ interface AllPackages<T> {
|
|
|
27
28
|
*/
|
|
28
29
|
export declare abstract class WorkspacePlugin<T> extends ManifestPlugin {
|
|
29
30
|
private updateAllPackages;
|
|
31
|
+
private manifestPath;
|
|
30
32
|
constructor(github: GitHub, targetBranch: string, repositoryConfig: RepositoryConfig, options?: WorkspacePluginOptions);
|
|
31
33
|
run(candidates: CandidateReleasePullRequest[]): Promise<CandidateReleasePullRequest[]>;
|
|
32
34
|
/**
|
|
@@ -83,6 +85,12 @@ export declare abstract class WorkspacePlugin<T> extends ManifestPlugin {
|
|
|
83
85
|
* @returns {string} The package name.
|
|
84
86
|
*/
|
|
85
87
|
protected abstract packageNameFromPackage(pkg: T): string;
|
|
88
|
+
/**
|
|
89
|
+
* Given a package, return the path in the repo to the package.
|
|
90
|
+
* @param {T} pkg The package definition.
|
|
91
|
+
* @returns {string} The package path.
|
|
92
|
+
*/
|
|
93
|
+
protected abstract pathFromPackage(pkg: T): string;
|
|
86
94
|
/**
|
|
87
95
|
* Amend any or all in-scope candidates once all other processing has occured.
|
|
88
96
|
*
|
|
@@ -15,8 +15,10 @@
|
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.WorkspacePlugin = void 0;
|
|
17
17
|
const plugin_1 = require("../plugin");
|
|
18
|
+
const manifest_1 = require("../manifest");
|
|
18
19
|
const logger_1 = require("../util/logger");
|
|
19
20
|
const merge_1 = require("./merge");
|
|
21
|
+
const release_please_manifest_1 = require("../updaters/release-please-manifest");
|
|
20
22
|
/**
|
|
21
23
|
* The plugin generalizes the logic for handling a workspace and
|
|
22
24
|
* will bump dependencies of managed packages if those dependencies
|
|
@@ -30,9 +32,10 @@ const merge_1 = require("./merge");
|
|
|
30
32
|
*/
|
|
31
33
|
class WorkspacePlugin extends plugin_1.ManifestPlugin {
|
|
32
34
|
constructor(github, targetBranch, repositoryConfig, options = {}) {
|
|
33
|
-
var _a;
|
|
35
|
+
var _a, _b;
|
|
34
36
|
super(github, targetBranch, repositoryConfig);
|
|
35
|
-
this.
|
|
37
|
+
this.manifestPath = (_a = options.manifestPath) !== null && _a !== void 0 ? _a : manifest_1.DEFAULT_RELEASE_PLEASE_MANIFEST;
|
|
38
|
+
this.updateAllPackages = (_b = options.updateAllPackages) !== null && _b !== void 0 ? _b : false;
|
|
36
39
|
}
|
|
37
40
|
async run(candidates) {
|
|
38
41
|
logger_1.logger.info('Running workspace plugin');
|
|
@@ -63,6 +66,7 @@ class WorkspacePlugin extends plugin_1.ManifestPlugin {
|
|
|
63
66
|
const orderedPackages = this.buildGraphOrder(graph, packageNamesToUpdate);
|
|
64
67
|
logger_1.logger.info(`Updating ${orderedPackages.length} packages`);
|
|
65
68
|
const updatedVersions = new Map();
|
|
69
|
+
const updatedPathVersions = new Map();
|
|
66
70
|
for (const pkg of orderedPackages) {
|
|
67
71
|
const packageName = this.packageNameFromPackage(pkg);
|
|
68
72
|
logger_1.logger.debug(`package: ${packageName}`);
|
|
@@ -76,6 +80,7 @@ class WorkspacePlugin extends plugin_1.ManifestPlugin {
|
|
|
76
80
|
const version = this.bumpVersion(pkg);
|
|
77
81
|
logger_1.logger.debug(`version: ${version} forced bump`);
|
|
78
82
|
updatedVersions.set(packageName, version);
|
|
83
|
+
updatedPathVersions.set(this.pathFromPackage(pkg), version);
|
|
79
84
|
}
|
|
80
85
|
}
|
|
81
86
|
let newCandidates = [];
|
|
@@ -98,6 +103,20 @@ class WorkspacePlugin extends plugin_1.ManifestPlugin {
|
|
|
98
103
|
logger_1.logger.info(`Merging ${newCandidates.length} in-scope candidates`);
|
|
99
104
|
const mergePlugin = new merge_1.Merge(this.github, this.targetBranch, this.repositoryConfig);
|
|
100
105
|
newCandidates = await mergePlugin.run(newCandidates);
|
|
106
|
+
if (newCandidates.length === 1) {
|
|
107
|
+
const newUpdates = newCandidates[0].pullRequest.updates;
|
|
108
|
+
newUpdates.push({
|
|
109
|
+
path: this.manifestPath,
|
|
110
|
+
createIfMissing: false,
|
|
111
|
+
updater: new release_please_manifest_1.ReleasePleaseManifest({
|
|
112
|
+
version: newCandidates[0].pullRequest.version,
|
|
113
|
+
versionsMap: updatedPathVersions,
|
|
114
|
+
}),
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
logger_1.logger.warn(`Expected 1 merged candidate, got ${newCandidates.length}`);
|
|
119
|
+
}
|
|
101
120
|
logger_1.logger.info(`Post-processing ${newCandidates.length} in-scope candidates`);
|
|
102
121
|
newCandidates = this.postProcessCandidates(newCandidates, updatedVersions);
|
|
103
122
|
return [...outOfScopeCandidates, ...newCandidates];
|
package/package.json
CHANGED