From 86dde9f812bba31a16f0be0ad955d39833dd402a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=8D=8E=E6=96=8C?= Date: Thu, 8 Jul 2021 16:55:26 +0800 Subject: [PATCH 1/2] fix: resolveNextVersion should provide bumpStrategy instead of releaseStrategy --- lib/updateDeps.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/updateDeps.js b/lib/updateDeps.js index 9f44d0aa..564fd8d8 100644 --- a/lib/updateDeps.js +++ b/lib/updateDeps.js @@ -178,7 +178,7 @@ const getDependentRelease = (pkg, bumpStrategy, releaseStrategy, ignore) => { return false; } - const resolvedVersion = resolveNextVersion(currentVersion, nextVersion, releaseStrategy); + const resolvedVersion = resolveNextVersion(currentVersion, nextVersion, bumpStrategy); if (currentVersion !== resolvedVersion) { scope[name] = resolvedVersion; return true; From 9ed0660ae25b217c445a3de91ec27d67b8245fb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=8D=8E=E6=96=8C?= Date: Fri, 9 Jul 2021 12:03:52 +0800 Subject: [PATCH 2/2] style: rename resolveNextVersion's strategy to bumpStrategy --- lib/updateDeps.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/updateDeps.js b/lib/updateDeps.js index 564fd8d8..7dc2d998 100644 --- a/lib/updateDeps.js +++ b/lib/updateDeps.js @@ -220,22 +220,22 @@ const getDependentRelease = (pkg, bumpStrategy, releaseStrategy, ignore) => { * * @param {string} currentVersion Current dep version * @param {string} nextVersion Next release type: patch, minor, major - * @param {string|undefined} strategy Resolution strategy: inherit, override, satisfy + * @param {string|undefined} bumpStrategy Resolution strategy: inherit, override, satisfy * @returns {string} Next dependency version * @internal */ -const resolveNextVersion = (currentVersion, nextVersion, strategy = "override") => { +const resolveNextVersion = (currentVersion, nextVersion, bumpStrategy = "override") => { // Check the next pkg version against its current references. // If it matches (`*` matches to any, `1.1.0` matches `1.1.x`, `1.5.0` matches to `^1.0.0` and so on) // release will not be triggered, if not `override` strategy will be applied instead. - if ((strategy === "satisfy" || strategy === "inherit") && semver.satisfies(nextVersion, currentVersion)) { + if ((bumpStrategy === "satisfy" || bumpStrategy === "inherit") && semver.satisfies(nextVersion, currentVersion)) { return currentVersion; } // `inherit` will try to follow the current declaration version/range. // `~1.0.0` + `minor` turns into `~1.1.0`, `1.x` + `major` gives `2.x`, // but `1.x` + `minor` gives `1.x` so there will be no release, etc. - if (strategy === "inherit") { + if (bumpStrategy === "inherit") { const sep = "."; const nextChunks = nextVersion.split(sep); const currentChunks = currentVersion.split(sep);