chore: Patch changesets to avoid major bumps (#12151)
This commit is contained in:
47
.yarn/patches/changesets.patch
Normal file
47
.yarn/patches/changesets.patch
Normal file
@@ -0,0 +1,47 @@
|
||||
diff --git a/dist/changesets-assemble-release-plan.cjs.js b/dist/changesets-assemble-release-plan.cjs.js
|
||||
index ee5c0f67fabadeb112e9f238d8b144a4d125830f..c475255224dc1ebde360c1bd31e8fdd285dd8336 100644
|
||||
--- a/dist/changesets-assemble-release-plan.cjs.js
|
||||
+++ b/dist/changesets-assemble-release-plan.cjs.js
|
||||
@@ -206,6 +206,10 @@ function shouldBumpMajor({
|
||||
preInfo,
|
||||
onlyUpdatePeerDependentsWhenOutOfRange
|
||||
}) {
|
||||
+ // Disable major bumps for peerDependencies
|
||||
+ if (depType === "peerDependencies") {
|
||||
+ return false;
|
||||
+ }
|
||||
// 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.
|
||||
diff --git a/src/determine-dependents.ts b/src/determine-dependents.ts
|
||||
index 08c08127ccfb5974d81b3ace592fced5b68aeaf7..4f7a86c34bd944aa0e8225190e0f4f5b6207c961 100644
|
||||
--- a/src/determine-dependents.ts
|
||||
+++ b/src/determine-dependents.ts
|
||||
@@ -1,13 +1,13 @@
|
||||
-import semverSatisfies from "semver/functions/satisfies";
|
||||
import {
|
||||
+ Config,
|
||||
DependencyType,
|
||||
PackageJSON,
|
||||
VersionType,
|
||||
- Config,
|
||||
} from "@changesets/types";
|
||||
import { Package } from "@manypkg/get-packages";
|
||||
-import { InternalRelease, PreInfo } from "./types";
|
||||
+import semverSatisfies from "semver/functions/satisfies";
|
||||
import { incrementVersion } from "./increment";
|
||||
+import { InternalRelease, PreInfo } from "./types";
|
||||
|
||||
/*
|
||||
WARNING:
|
||||
@@ -223,6 +223,10 @@ function shouldBumpMajor({
|
||||
preInfo: PreInfo | undefined;
|
||||
onlyUpdatePeerDependentsWhenOutOfRange: boolean;
|
||||
}) {
|
||||
+ // Disable major bumps for peerDependencies
|
||||
+ if (depType === "peerDependencies") {
|
||||
+ return false;
|
||||
+ }
|
||||
// we check if it is a peerDependency because if it is, our dependent bump type might need to be major.
|
||||
return (
|
||||
depType === "peerDependencies" &&
|
||||
Reference in New Issue
Block a user