Skip to content

Commit

Permalink
Merge pull request #8243 from Agoric/8242-patch-lerna
Browse files Browse the repository at this point in the history
chore: patch @lerna/conventional-commits to avoid version bump for prereleases
  • Loading branch information
warner authored Aug 24, 2023
2 parents ac9f916 + b1917d6 commit 46a7b2e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions patches/@lerna+conventional-commits+5.6.2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/node_modules/@lerna/conventional-commits/lib/recommend-version.js b/node_modules/@lerna/conventional-commits/lib/recommend-version.js
index a982adf..453ef14 100644
--- a/node_modules/@lerna/conventional-commits/lib/recommend-version.js
+++ b/node_modules/@lerna/conventional-commits/lib/recommend-version.js
@@ -58,6 +58,15 @@ function recommendVersion(pkg, type, { changelogPreset, rootPath, tagPrefix, pre
// we still need to bump _something_ because lerna saw a change here
let releaseType = data.releaseType || "patch";

+ // Don't gratuitously break compatibility with clients using `^0.x.y`.
+ if (semver.major(pkg.version) === 0) {
+ if (releaseType === "major") {
+ releaseType = "minor";
+ } else if (releaseType === "minor") {
+ releaseType = "patch";
+ }
+ }
+
if (prereleaseId) {
const shouldBump = shouldBumpPrerelease(releaseType, pkg.version);
const prereleaseType = shouldBump ? `pre${releaseType}` : "prerelease";

0 comments on commit 46a7b2e

Please sign in to comment.