Skip to content

Commit

Permalink
Don't bump major version
Browse files Browse the repository at this point in the history
  • Loading branch information
mbeckem committed Sep 20, 2023
1 parent 69c0fcd commit bd78399
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
"privatePackages": {
"version": false,
"tag": false
},
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true
}
}
17 changes: 13 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,18 @@
},
"pnpm": {
"//": [
"overrides:",
"overrides",
"=========",
"semver: https://github.com/advisories/GHSA-c2qf-rxjj-qqgw",
"tough-cookie: https://github.com/advisories/GHSA-72xf-g2v4-qvf3",
"",
"ignored cves:",
"CVE-2023-26115 (word-wrap): ReDoS does not affect us (running client side or at build time)"
"ignored cves",
"============",
"CVE-2023-26115 (word-wrap): ReDoS does not affect us (running client side or at build time)",
"",
"patches",
"=======",
"@changesets/assemble-release-plan: don't bump major if peerDep has a minor release. see https://github.com/changesets/changesets/pull/1132"
],
"overrides": {
"ol-mapbox-style": "workspace:disabled-package@*",
Expand All @@ -43,6 +49,9 @@
"ignoreCves": [
"CVE-2023-26115"
]
},
"patchedDependencies": {
"@changesets/[email protected]": "patches/@[email protected]"
}
},
"dependencies": {
Expand All @@ -63,8 +72,8 @@
"@open-pioneer/build-package-cli": "^1.0.1",
"@open-pioneer/build-support": "^1.0.0",
"@open-pioneer/runtime": "workspace:^",
"@open-pioneer/vite-plugin-pioneer": "^1.0.2",
"@open-pioneer/tag-current-versions": "^1.0.0",
"@open-pioneer/vite-plugin-pioneer": "^1.0.2",
"@testing-library/dom": "^9.3.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
Expand Down
39 changes: 39 additions & 0 deletions patches/@[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
diff --git a/dist/assemble-release-plan.cjs.dev.js b/dist/assemble-release-plan.cjs.dev.js
index e1376ca756d69816f8c79637ee7b45161f092167..8cb0a24dced96f422afffe4ec21cf3628b4951dd 100644
--- a/dist/assemble-release-plan.cjs.dev.js
+++ b/dist/assemble-release-plan.cjs.dev.js
@@ -257,7 +257,7 @@ function shouldBumpMajor({
// we check if it is a peerDependency because if it is, our dependent bump type might need to be major.
return depType === "peerDependencies" && nextRelease.type !== "none" && nextRelease.type !== "patch" && ( // 1. If onlyUpdatePeerDependentsWhenOutOfRange set to true, bump major if the version is leaving the range.
// 2. If onlyUpdatePeerDependentsWhenOutOfRange set to false, bump major regardless whether or not the version is leaving the range.
- !onlyUpdatePeerDependentsWhenOutOfRange || !semverSatisfies__default['default'](incrementVersion(nextRelease, preInfo), versionRange)) && ( // bump major only if the dependent doesn't already has a major release.
+ !onlyUpdatePeerDependentsWhenOutOfRange) && ( // bump major only if the dependent doesn't already has a major release.
!releases.has(dependent) || releases.has(dependent) && releases.get(dependent).type !== "major");
}

diff --git a/dist/assemble-release-plan.cjs.prod.js b/dist/assemble-release-plan.cjs.prod.js
index 3a83720644a94cdf6e62fa188a72c51c0384d00e..0514456a006b430b7eb3f3701fd40f476e40af0e 100644
--- a/dist/assemble-release-plan.cjs.prod.js
+++ b/dist/assemble-release-plan.cjs.prod.js
@@ -130,7 +130,7 @@ function getDependencyVersionRanges(dependentPkgJSON, dependencyRelease) {
}

function shouldBumpMajor({dependent: dependent, depType: depType, versionRange: versionRange, releases: releases, nextRelease: nextRelease, preInfo: preInfo, onlyUpdatePeerDependentsWhenOutOfRange: onlyUpdatePeerDependentsWhenOutOfRange}) {
- return "peerDependencies" === depType && "none" !== nextRelease.type && "patch" !== nextRelease.type && (!onlyUpdatePeerDependentsWhenOutOfRange || !semverSatisfies__default.default(incrementVersion(nextRelease, preInfo), versionRange)) && (!releases.has(dependent) || releases.has(dependent) && "major" !== releases.get(dependent).type);
+ return "peerDependencies" === depType && "none" !== nextRelease.type && "patch" !== nextRelease.type && (!onlyUpdatePeerDependentsWhenOutOfRange) && (!releases.has(dependent) || releases.has(dependent) && "major" !== releases.get(dependent).type);
}

function flattenReleases(changesets, packagesByName, ignoredPackages) {
diff --git a/dist/assemble-release-plan.esm.js b/dist/assemble-release-plan.esm.js
index 62891eb5dee97a33e6587514267c3cde5b314830..e5c405125129df6a608e10a085b064dfd5393518 100644
--- a/dist/assemble-release-plan.esm.js
+++ b/dist/assemble-release-plan.esm.js
@@ -246,7 +246,7 @@ function shouldBumpMajor({
// we check if it is a peerDependency because if it is, our dependent bump type might need to be major.
return depType === "peerDependencies" && nextRelease.type !== "none" && nextRelease.type !== "patch" && ( // 1. If onlyUpdatePeerDependentsWhenOutOfRange set to true, bump major if the version is leaving the range.
// 2. If onlyUpdatePeerDependentsWhenOutOfRange set to false, bump major regardless whether or not the version is leaving the range.
- !onlyUpdatePeerDependentsWhenOutOfRange || !semverSatisfies(incrementVersion(nextRelease, preInfo), versionRange)) && ( // bump major only if the dependent doesn't already has a major release.
+ !onlyUpdatePeerDependentsWhenOutOfRange) && ( // bump major only if the dependent doesn't already has a major release.
!releases.has(dependent) || releases.has(dependent) && releases.get(dependent).type !== "major");
}

12 changes: 9 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit bd78399

Please sign in to comment.