From bd7839928fac23d7fbfbefbf8235e33142ead07d Mon Sep 17 00:00:00 2001 From: Michael Beckemeyer Date: Wed, 20 Sep 2023 11:23:51 +0200 Subject: [PATCH] Don't bump major version --- .changeset/config.json | 3 ++ package.json | 17 ++++++-- ...ngesets__assemble-release-plan@5.2.4.patch | 39 +++++++++++++++++++ pnpm-lock.yaml | 12 ++++-- 4 files changed, 64 insertions(+), 7 deletions(-) create mode 100644 patches/@changesets__assemble-release-plan@5.2.4.patch diff --git a/.changeset/config.json b/.changeset/config.json index 832db9fb..33beeea1 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -11,5 +11,8 @@ "privatePackages": { "version": false, "tag": false + }, + "___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": { + "onlyUpdatePeerDependentsWhenOutOfRange": true } } diff --git a/package.json b/package.json index 3ecc190c..cbbd9243 100644 --- a/package.json +++ b/package.json @@ -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@*", @@ -43,6 +49,9 @@ "ignoreCves": [ "CVE-2023-26115" ] + }, + "patchedDependencies": { + "@changesets/assemble-release-plan@5.2.4": "patches/@changesets__assemble-release-plan@5.2.4.patch" } }, "dependencies": { @@ -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", diff --git a/patches/@changesets__assemble-release-plan@5.2.4.patch b/patches/@changesets__assemble-release-plan@5.2.4.patch new file mode 100644 index 00000000..0f7e7ee9 --- /dev/null +++ b/patches/@changesets__assemble-release-plan@5.2.4.patch @@ -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"); + } + diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 03eab3b2..7a920a27 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,6 +9,11 @@ overrides: semver@<7.5.2: '>=7.5.2' tough-cookie@<4.1.3: '>=4.1.3' +patchedDependencies: + '@changesets/assemble-release-plan@5.2.4': + hash: smkftofkkdykjhm55vkxah56wq + path: patches/@changesets__assemble-release-plan@5.2.4.patch + importers: .: @@ -1604,7 +1609,7 @@ packages: semver: 7.5.4 dev: true - /@changesets/assemble-release-plan@5.2.4: + /@changesets/assemble-release-plan@5.2.4(patch_hash=smkftofkkdykjhm55vkxah56wq): resolution: {integrity: sha512-xJkWX+1/CUaOUWTguXEbCDTyWJFECEhmdtbkjhn5GVBGxdP/JwaHBIU9sW3FR6gD07UwZ7ovpiPclQZs+j+mvg==} dependencies: '@babel/runtime': 7.22.6 @@ -1614,6 +1619,7 @@ packages: '@manypkg/get-packages': 1.1.3 semver: 7.5.4 dev: true + patched: true /@changesets/changelog-git@0.1.14: resolution: {integrity: sha512-+vRfnKtXVWsDDxGctOfzJsPhaCdXRYoe+KyWYoq5X/GqoISREiat0l3L8B0a453B2B4dfHGcZaGyowHbp9BSaA==} @@ -1627,7 +1633,7 @@ packages: dependencies: '@babel/runtime': 7.22.6 '@changesets/apply-release-plan': 6.1.4 - '@changesets/assemble-release-plan': 5.2.4 + '@changesets/assemble-release-plan': 5.2.4(patch_hash=smkftofkkdykjhm55vkxah56wq) '@changesets/changelog-git': 0.1.14 '@changesets/config': 2.3.1 '@changesets/errors': 0.1.4 @@ -1692,7 +1698,7 @@ packages: resolution: {integrity: sha512-6IwKTubNEgoOZwDontYc2x2cWXfr6IKxP3IhKeK+WjyD6y3M4Gl/jdQvBw+m/5zWILSOCAaGLu2ZF6Q+WiPniw==} dependencies: '@babel/runtime': 7.22.6 - '@changesets/assemble-release-plan': 5.2.4 + '@changesets/assemble-release-plan': 5.2.4(patch_hash=smkftofkkdykjhm55vkxah56wq) '@changesets/config': 2.3.1 '@changesets/pre': 1.0.14 '@changesets/read': 0.5.9