release-please 14.15.3 → 14.16.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
CHANGED
|
@@ -4,6 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
[1]: https://www.npmjs.com/package/release-please?activeTab=versions
|
|
6
6
|
|
|
7
|
+
## [14.16.0](https://github.com/googleapis/release-please/compare/v14.15.3...v14.16.0) (2022-11-03)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* **node-workspace:** Maintain current version range prefix ([#1723](https://github.com/googleapis/release-please/issues/1723)) ([53e2599](https://github.com/googleapis/release-please/commit/53e25997fc9fd06fe83735ab5f9aef0f12639b16))
|
|
13
|
+
|
|
7
14
|
## [14.15.3](https://github.com/googleapis/release-please/compare/v14.15.2...v14.15.3) (2022-11-02)
|
|
8
15
|
|
|
9
16
|
|
|
@@ -34,5 +34,7 @@ export declare class NodeWorkspace extends WorkspacePlugin<Package> {
|
|
|
34
34
|
protected inScope(candidate: CandidateReleasePullRequest): boolean;
|
|
35
35
|
protected packageNameFromPackage(pkg: Package): string;
|
|
36
36
|
protected pathFromPackage(pkg: Package): string;
|
|
37
|
+
private detectRangePrefix;
|
|
38
|
+
private combineDeps;
|
|
37
39
|
}
|
|
38
40
|
export {};
|
|
@@ -94,7 +94,7 @@ class NodeWorkspace extends workspace_1.WorkspacePlugin {
|
|
|
94
94
|
return new versioning_strategy_1.PatchVersionUpdate().bump(version);
|
|
95
95
|
}
|
|
96
96
|
updateCandidate(existingCandidate, pkg, updatedVersions) {
|
|
97
|
-
var _a;
|
|
97
|
+
var _a, _b;
|
|
98
98
|
const graphPackage = (_a = this.packageGraph) === null || _a === void 0 ? void 0 : _a.get(pkg.name);
|
|
99
99
|
if (!graphPackage) {
|
|
100
100
|
throw new Error(`Could not find graph package for ${pkg.name}`);
|
|
@@ -110,8 +110,12 @@ class NodeWorkspace extends workspace_1.WorkspacePlugin {
|
|
|
110
110
|
for (const [depName, resolved] of graphPackage.localDependencies) {
|
|
111
111
|
const depVersion = updatedVersions.get(depName);
|
|
112
112
|
if (depVersion && resolved.type !== 'directory') {
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
const currentVersion = (_b = this.combineDeps(pkg)) === null || _b === void 0 ? void 0 : _b[depName];
|
|
114
|
+
const prefix = currentVersion
|
|
115
|
+
? this.detectRangePrefix(currentVersion)
|
|
116
|
+
: '';
|
|
117
|
+
updatedPackage.updateLocalDependency(resolved, depVersion.toString(), prefix);
|
|
118
|
+
this.logger.info(`${pkg.name}.${depName} updated to ${prefix}${depVersion.toString()}`);
|
|
115
119
|
}
|
|
116
120
|
}
|
|
117
121
|
const dependencyNotes = getChangelogDepsNotes(pkg, updatedPackage);
|
|
@@ -209,15 +213,10 @@ class NodeWorkspace extends workspace_1.WorkspacePlugin {
|
|
|
209
213
|
return candidates;
|
|
210
214
|
}
|
|
211
215
|
async buildGraph(allPackages) {
|
|
212
|
-
var _a, _b, _c;
|
|
213
216
|
const graph = new Map();
|
|
214
217
|
const workspacePackageNames = new Set(allPackages.map(packageJson => packageJson.name));
|
|
215
218
|
for (const packageJson of allPackages) {
|
|
216
|
-
const allDeps = Object.keys(
|
|
217
|
-
...((_a = packageJson.dependencies) !== null && _a !== void 0 ? _a : {}),
|
|
218
|
-
...((_b = packageJson.devDependencies) !== null && _b !== void 0 ? _b : {}),
|
|
219
|
-
...((_c = packageJson.optionalDependencies) !== null && _c !== void 0 ? _c : {}),
|
|
220
|
-
});
|
|
219
|
+
const allDeps = Object.keys(this.combineDeps(packageJson));
|
|
221
220
|
const workspaceDeps = allDeps.filter(dep => workspacePackageNames.has(dep));
|
|
222
221
|
graph.set(packageJson.name, {
|
|
223
222
|
deps: workspaceDeps,
|
|
@@ -235,8 +234,28 @@ class NodeWorkspace extends workspace_1.WorkspacePlugin {
|
|
|
235
234
|
pathFromPackage(pkg) {
|
|
236
235
|
return pkg.location;
|
|
237
236
|
}
|
|
237
|
+
detectRangePrefix(version) {
|
|
238
|
+
return (Object.values(SUPPORTED_RANGE_PREFIXES).find(supportedRangePrefix => version.startsWith(supportedRangePrefix)) || '');
|
|
239
|
+
}
|
|
240
|
+
combineDeps(packageJson) {
|
|
241
|
+
var _a, _b, _c;
|
|
242
|
+
return {
|
|
243
|
+
...((_a = packageJson.dependencies) !== null && _a !== void 0 ? _a : {}),
|
|
244
|
+
...((_b = packageJson.devDependencies) !== null && _b !== void 0 ? _b : {}),
|
|
245
|
+
...((_c = packageJson.optionalDependencies) !== null && _c !== void 0 ? _c : {}),
|
|
246
|
+
};
|
|
247
|
+
}
|
|
238
248
|
}
|
|
239
249
|
exports.NodeWorkspace = NodeWorkspace;
|
|
250
|
+
var SUPPORTED_RANGE_PREFIXES;
|
|
251
|
+
(function (SUPPORTED_RANGE_PREFIXES) {
|
|
252
|
+
SUPPORTED_RANGE_PREFIXES["CARET"] = "^";
|
|
253
|
+
SUPPORTED_RANGE_PREFIXES["TILDE"] = "~";
|
|
254
|
+
SUPPORTED_RANGE_PREFIXES["GREATER_THAN"] = ">";
|
|
255
|
+
SUPPORTED_RANGE_PREFIXES["LESS_THAN"] = "<";
|
|
256
|
+
SUPPORTED_RANGE_PREFIXES["EQUAL_OR_GREATER_THAN"] = ">=";
|
|
257
|
+
SUPPORTED_RANGE_PREFIXES["EQUAL_OR_LESS_THAN"] = "<=";
|
|
258
|
+
})(SUPPORTED_RANGE_PREFIXES || (SUPPORTED_RANGE_PREFIXES = {}));
|
|
240
259
|
function getChangelogDepsNotes(original, updated) {
|
|
241
260
|
var _a;
|
|
242
261
|
let depUpdateNotes = '';
|
package/package.json
CHANGED