Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolveNextVersion should provide bumpStrategy instead of releaseStrategy #69

Merged
merged 2 commits into from
Jul 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/updateDeps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down