diff --git a/CHANGELOG.md b/CHANGELOG.md index 550e3f5114..e7be24d421 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ Please add one entry in this file for each change in Yarn's behavior. Use the sa ## Master +- Fixes yarn `upgrade --latest` for dependencies using `>` or `>=` range specifier + + [#7080](https://github.com/yarnpkg/yarn/pull/7080) - [**Xukai Wu**](https://github.com/shilcare) + - Fixes `--modules-folder` handling in several places (ex: `yarn check` now respects `--modules-folder`) [#6850](https://github.com/yarnpkg/yarn/pull/6850) - [**Jeff Valore**](https://twitter.com/codingwithspike) diff --git a/src/cli/commands/upgrade.js b/src/cli/commands/upgrade.js index 9a149951c4..53d19f6474 100644 --- a/src/cli/commands/upgrade.js +++ b/src/cli/commands/upgrade.js @@ -12,7 +12,7 @@ import {Install} from './install.js'; // used to detect whether a semver range is simple enough to preserve when doing a --latest upgrade. // when not matched, the upgraded version range will default to `^` the same as the `add` command would. -const basicSemverOperatorRegex = new RegExp('^(\\^|~|>|<=|>=)?[^ |&,]+$'); +const basicSemverOperatorRegex = new RegExp('^(\\^|~|>=|<=)?[^ |&,]+$'); // used to detect if a passed parameter is a scope or a package name. const validScopeRegex = /^@[a-zA-Z0-9-][a-zA-Z0-9_.-]*\/$/; @@ -74,7 +74,7 @@ function setUserRequestedPackageVersions( } // this function attempts to determine the range operator on the semver range. -// this will only handle the simple cases of a semver starting with '^', '~', '>', '>=', '<=', or an exact version. +// this will only handle the simple cases of a semver starting with '^', '~', '>=', '<=', or an exact version. // "exotic" semver ranges will not be handled. function getRangeOperator(version): string { const result = basicSemverOperatorRegex.exec(version);