release-please 14.15.1 → 14.15.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 CHANGED
@@ -4,6 +4,14 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/release-please?activeTab=versions
6
6
 
7
+ ## [14.15.2](https://github.com/googleapis/release-please/compare/v14.15.1...v14.15.2) (2022-11-01)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * Allow overlapping paths when splitting commits ([#1733](https://github.com/googleapis/release-please/issues/1733)) ([adcb99a](https://github.com/googleapis/release-please/commit/adcb99acdbff9ddeea527b673bc8820edff68f2a))
13
+ * **cargo-workspace:** Update target dependencies in Cargo workspace packages ([#1730](https://github.com/googleapis/release-please/issues/1730)) ([3ca3bbc](https://github.com/googleapis/release-please/commit/3ca3bbcef729a359805473fdc798b5af5ab22861))
14
+
7
15
  ## [14.15.1](https://github.com/googleapis/release-please/compare/v14.15.0...v14.15.1) (2022-10-28)
8
16
 
9
17
 
@@ -195,7 +195,7 @@ class CargoWorkspace extends workspace_1.WorkspacePlugin {
195
195
  return candidates;
196
196
  }
197
197
  async buildGraph(allPackages) {
198
- var _a, _b, _c;
198
+ var _a, _b, _c, _d, _e, _f;
199
199
  const workspaceCrateNames = new Set(allPackages.map(crateInfo => crateInfo.name));
200
200
  const graph = new Map();
201
201
  for (const crateInfo of allPackages) {
@@ -204,6 +204,17 @@ class CargoWorkspace extends workspace_1.WorkspacePlugin {
204
204
  ...((_b = crateInfo.manifest['dev-dependencies']) !== null && _b !== void 0 ? _b : {}),
205
205
  ...((_c = crateInfo.manifest['build-dependencies']) !== null && _c !== void 0 ? _c : {}),
206
206
  });
207
+ const targets = crateInfo.manifest.target;
208
+ if (targets) {
209
+ for (const targetName in targets) {
210
+ const target = targets[targetName];
211
+ allDeps.push(...Object.keys({
212
+ ...((_d = target.dependencies) !== null && _d !== void 0 ? _d : {}),
213
+ ...((_e = target['dev-dependencies']) !== null && _e !== void 0 ? _e : {}),
214
+ ...((_f = target['build-dependencies']) !== null && _f !== void 0 ? _f : {}),
215
+ }));
216
+ }
217
+ }
207
218
  const workspaceDeps = allDeps.filter(dep => workspaceCrateNames.has(dep));
208
219
  graph.set(crateInfo.name, {
209
220
  deps: workspaceDeps,
@@ -224,7 +235,6 @@ class CargoWorkspace extends workspace_1.WorkspacePlugin {
224
235
  }
225
236
  exports.CargoWorkspace = CargoWorkspace;
226
237
  function getChangelogDepsNotes(originalManifest, updatedManifest) {
227
- var _a;
228
238
  let depUpdateNotes = '';
229
239
  const depTypes = [
230
240
  'dependencies',
@@ -252,21 +262,32 @@ function getChangelogDepsNotes(originalManifest, updatedManifest) {
252
262
  }
253
263
  return result;
254
264
  };
255
- const updates = new Map();
256
- for (const depType of depTypes) {
257
- const depUpdates = [];
258
- const pkgDepTypes = updatedManifest[depType];
259
- if (pkgDepTypes === undefined) {
260
- continue;
261
- }
262
- for (const [depName, currentDepVer] of Object.entries(getDepMap(pkgDepTypes))) {
263
- const origDepVer = depVer((_a = originalManifest[depType]) === null || _a === void 0 ? void 0 : _a[depName]);
264
- if (currentDepVer !== origDepVer) {
265
- depUpdates.push(`\n * ${depName} bumped from ${origDepVer} to ${currentDepVer}`);
265
+ const populateUpdates = (originalScope, updatedScope, updates) => {
266
+ var _a;
267
+ for (const depType of depTypes) {
268
+ const depUpdates = [];
269
+ const pkgDepTypes = updatedScope[depType];
270
+ if (pkgDepTypes === undefined) {
271
+ continue;
272
+ }
273
+ for (const [depName, currentDepVer] of Object.entries(getDepMap(pkgDepTypes))) {
274
+ const origDepVer = depVer((_a = originalScope[depType]) === null || _a === void 0 ? void 0 : _a[depName]);
275
+ if (currentDepVer !== origDepVer) {
276
+ depUpdates.push(`\n * ${depName} bumped from ${origDepVer} to ${currentDepVer}`);
277
+ }
278
+ }
279
+ if (depUpdates.length > 0) {
280
+ const updatesForType = updates.get(depType) || new Set();
281
+ depUpdates.forEach(update => updatesForType.add(update));
282
+ updates.set(depType, updatesForType);
266
283
  }
267
284
  }
268
- if (depUpdates.length > 0) {
269
- updates.set(depType, depUpdates);
285
+ };
286
+ const updates = new Map();
287
+ populateUpdates(originalManifest, updatedManifest, updates);
288
+ if (updatedManifest.target && originalManifest.target) {
289
+ for (const targetName in updatedManifest.target) {
290
+ populateUpdates(originalManifest.target[targetName], updatedManifest.target[targetName], updates);
270
291
  }
271
292
  }
272
293
  for (const [dt, notes] of updates) {
@@ -41,19 +41,13 @@ class CommitSplit {
41
41
  newPath = newPath.replace(/^\//, '');
42
42
  newPath = newPath.replace(/$/, '/');
43
43
  newPath = newPath.replace(/^/, '/');
44
- for (let exPath of paths) {
45
- exPath = exPath.replace(/$/, '/');
46
- exPath = exPath.replace(/^/, '/');
47
- if (newPath.startsWith(exPath) || exPath.startsWith(newPath)) {
48
- throw new Error(`Path prefixes must be unique: ${newPath}, ${exPath}`);
49
- }
50
- }
51
44
  // store them with leading and trailing slashes removed.
52
45
  newPath = newPath.replace(/\/$/, '');
53
46
  newPath = newPath.replace(/^\//, '');
54
47
  paths.push(newPath);
55
48
  }
56
- this.packagePaths = paths;
49
+ // sort by longest paths first
50
+ this.packagePaths = paths.sort((a, b) => b.length - a.length);
57
51
  }
58
52
  }
59
53
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-please",
3
- "version": "14.15.1",
3
+ "version": "14.15.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",