-
Notifications
You must be signed in to change notification settings - Fork 781
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(sys): tweak NodeLazyRequire logic around too-high-versions errors (…
…#3347) this changes the logic that we use in the `NodeLazyRequire` class to error out in fewer situations. the changes are: - the data structure for specifying our version ranges is changed from `[string, string]` (`[minVersion, recommendedVersion]`) to an object with `minVersion` `recommendedVersion` required properties and an optional `maxVersion` property. - in the `ensure` method on `NodeLazyRequire` we check if `maxVersion` is defined on a given version range requirement. - If so, we check that the installed version is greater than or equal to `minVersion` and less than the major version of `maxVersion`. - If not, we just check that `minVersion <= installedVersion` this should give us the flexibility to mark certain versions of packages as incompatible (for instance jest@28) without having to do that for all packages that we lazy require. this is helpful because for most of them we just want to set a minimum version and don't have a need for an enforced maximum version.
- Loading branch information
1 parent
b7adc33
commit 9bfef1a
Showing
3 changed files
with
75 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters