release-please 14.15.3 → 14.17.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,21 @@
4
4
 
5
5
  [1]: https://www.npmjs.com/package/release-please?activeTab=versions
6
6
 
7
+ ## [14.17.0](https://github.com/googleapis/release-please/compare/v14.16.0...v14.17.0) (2022-11-11)
8
+
9
+
10
+ ### Features
11
+
12
+ * add always-bump-major versioning strategy ([7526ca8](https://github.com/googleapis/release-please/commit/7526ca8be4fec4d785b44bfb8c8c70078ad7fc73))
13
+ * Add always-bump-minor versioning strategy ([#1744](https://github.com/googleapis/release-please/issues/1744)) ([7526ca8](https://github.com/googleapis/release-please/commit/7526ca8be4fec4d785b44bfb8c8c70078ad7fc73))
14
+
15
+ ## [14.16.0](https://github.com/googleapis/release-please/compare/v14.15.3...v14.16.0) (2022-11-03)
16
+
17
+
18
+ ### Features
19
+
20
+ * **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))
21
+
7
22
  ## [14.15.3](https://github.com/googleapis/release-please/compare/v14.15.2...v14.15.3) (2022-11-02)
8
23
 
9
24
 
@@ -16,11 +16,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
16
16
  exports.getVersioningStrategyTypes = exports.unregisterVersioningStrategy = exports.registerVersioningStrategy = exports.buildVersioningStrategy = void 0;
17
17
  const default_1 = require("../versioning-strategies/default");
18
18
  const always_bump_patch_1 = require("../versioning-strategies/always-bump-patch");
19
+ const always_bump_minor_1 = require("../versioning-strategies/always-bump-minor");
20
+ const always_bump_major_1 = require("../versioning-strategies/always-bump-major");
19
21
  const service_pack_1 = require("../versioning-strategies/service-pack");
20
22
  const errors_1 = require("../errors");
21
23
  const versioningTypes = {
22
24
  default: options => new default_1.DefaultVersioningStrategy(options),
23
25
  'always-bump-patch': options => new always_bump_patch_1.AlwaysBumpPatch(options),
26
+ 'always-bump-minor': options => new always_bump_minor_1.AlwaysBumpMinor(options),
27
+ 'always-bump-major': options => new always_bump_major_1.AlwaysBumpMajor(options),
24
28
  'service-pack': options => new service_pack_1.ServicePackVersioningStrategy(options),
25
29
  };
26
30
  function buildVersioningStrategy(options) {
@@ -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
- updatedPackage.updateLocalDependency(resolved, depVersion.toString(), '^');
114
- this.logger.info(`${pkg.name}.${depName} updated to ^${depVersion.toString()}`);
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 = '';
@@ -0,0 +1,10 @@
1
+ import { Version } from '../version';
2
+ import { ConventionalCommit } from '../commit';
3
+ import { DefaultVersioningStrategy } from './default';
4
+ import { VersionUpdater } from '../versioning-strategy';
5
+ /**
6
+ * This VersioningStrategy always bumps the major version.
7
+ */
8
+ export declare class AlwaysBumpMajor extends DefaultVersioningStrategy {
9
+ determineReleaseType(_version: Version, _commits: ConventionalCommit[]): VersionUpdater;
10
+ }
@@ -0,0 +1,28 @@
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.AlwaysBumpMajor = void 0;
17
+ const default_1 = require("./default");
18
+ const versioning_strategy_1 = require("../versioning-strategy");
19
+ /**
20
+ * This VersioningStrategy always bumps the major version.
21
+ */
22
+ class AlwaysBumpMajor extends default_1.DefaultVersioningStrategy {
23
+ determineReleaseType(_version, _commits) {
24
+ return new versioning_strategy_1.MajorVersionUpdate();
25
+ }
26
+ }
27
+ exports.AlwaysBumpMajor = AlwaysBumpMajor;
28
+ //# sourceMappingURL=always-bump-major.js.map
@@ -0,0 +1,10 @@
1
+ import { Version } from '../version';
2
+ import { ConventionalCommit } from '../commit';
3
+ import { DefaultVersioningStrategy } from './default';
4
+ import { VersionUpdater } from '../versioning-strategy';
5
+ /**
6
+ * This VersioningStrategy always bumps the minor version.
7
+ */
8
+ export declare class AlwaysBumpMinor extends DefaultVersioningStrategy {
9
+ determineReleaseType(_version: Version, _commits: ConventionalCommit[]): VersionUpdater;
10
+ }
@@ -0,0 +1,28 @@
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.AlwaysBumpMinor = void 0;
17
+ const default_1 = require("./default");
18
+ const versioning_strategy_1 = require("../versioning-strategy");
19
+ /**
20
+ * This VersioningStrategy always bumps the minor version.
21
+ */
22
+ class AlwaysBumpMinor extends default_1.DefaultVersioningStrategy {
23
+ determineReleaseType(_version, _commits) {
24
+ return new versioning_strategy_1.MinorVersionUpdate();
25
+ }
26
+ }
27
+ exports.AlwaysBumpMinor = AlwaysBumpMinor;
28
+ //# sourceMappingURL=always-bump-minor.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-please",
3
- "version": "14.15.3",
3
+ "version": "14.17.0",
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",
@@ -63,7 +63,7 @@
63
63
  "gts": "^3.1.0",
64
64
  "mocha": "^9.2.2",
65
65
  "nock": "^13.0.0",
66
- "sinon": "14.0.1",
66
+ "sinon": "14.0.2",
67
67
  "snap-shot-it": "^7.0.0"
68
68
  },
69
69
  "dependencies": {