Skip to content

Commit

Permalink
chore: patch @changesets/assemble-release-plan
Browse files Browse the repository at this point in the history
  • Loading branch information
chanceaclark committed Nov 12, 2024
1 parent 10f0afa commit 12f3a94
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 10 deletions.
5 changes: 1 addition & 4 deletions .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@
},
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": [],
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true
}
"ignore": []
}
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,18 @@
"typecheck": "turbo typecheck"
},
"devDependencies": {
"@changesets/assemble-release-plan": "^6.0.4",
"@changesets/changelog-git": "^0.2.0",
"@changesets/cli": "^2.27.9",
"@commitlint/cli": "^19.5.0",
"@commitlint/config-conventional": "^19.5.0",
"@types/babel__standalone": "^7.1.4",
"turbo": "^2.2.3",
"typescript": "^5.6.3"
},
"pnpm": {
"patchedDependencies": {
"@changesets/assemble-release-plan": "patches/@changesets__assemble-release-plan.patch"
}
}
}
38 changes: 38 additions & 0 deletions patches/@changesets__assemble-release-plan.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
diff --git a/dist/changesets-assemble-release-plan.cjs.js b/dist/changesets-assemble-release-plan.cjs.js
index 4f7b5e5b37bb05874a5c1d8e583e29d4a9593ecf..9dc53e5c0a612e5adcd97a06571b50a605fd3a83 100644
--- a/dist/changesets-assemble-release-plan.cjs.js
+++ b/dist/changesets-assemble-release-plan.cjs.js
@@ -345,7 +345,7 @@ function shouldBumpMajor({
onlyUpdatePeerDependentsWhenOutOfRange
}) {
// 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.
+ return depType === "peerDependencies" && nextRelease.type !== "none" && nextRelease.type !== "patch" && nextRelease.type !== "minor" && ( // 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.
!releases.has(dependent) || releases.has(dependent) && releases.get(dependent).type !== "major");
diff --git a/dist/changesets-assemble-release-plan.esm.js b/dist/changesets-assemble-release-plan.esm.js
index a327d9e4c709a6698f505d60d8bbf0046d4bde74..773be3b1baf72a6a154347fe78a5a175ce6323b5 100644
--- a/dist/changesets-assemble-release-plan.esm.js
+++ b/dist/changesets-assemble-release-plan.esm.js
@@ -334,7 +334,7 @@ function shouldBumpMajor({
onlyUpdatePeerDependentsWhenOutOfRange
}) {
// 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.
+ return depType === "peerDependencies" && nextRelease.type !== "none" && nextRelease.type !== "patch" && nextRelease.type !== "minor" && ( // 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.
!releases.has(dependent) || releases.has(dependent) && releases.get(dependent).type !== "major");
diff --git a/src/determine-dependents.ts b/src/determine-dependents.ts
index 4fc6508482d1a6e3ac1af875e1ac1c15f7555fbc..71c50d4b4be64316681eb633e5be1afb3aeac8cb 100644
--- a/src/determine-dependents.ts
+++ b/src/determine-dependents.ts
@@ -234,6 +234,7 @@ function shouldBumpMajor({
depType === "peerDependencies" &&
nextRelease.type !== "none" &&
nextRelease.type !== "patch" &&
+ nextRelease.type !== "minor" &&
// 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 ||
20 changes: 14 additions & 6 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 12f3a94

Please sign in to comment.