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

fix(npm): better node version and version requirement compatibility #15714

Merged
merged 5 commits into from Sep 1, 2022

Conversation

dsherret
Copy link
Member

We initially used the semver crate as a first pass solution, but this PR adds way better node semver support.

Wrote an in-house solution so we can move fast fixing bugs and re-use some of the code for our npm specifiers. The npm specifiers use a stricter parser than the version requirements allowed in package.json files.

Closes #15600

@@ -78,7 +78,8 @@ indexmap = "1.8.1"
jsonc-parser = { version = "=0.21.0", features = ["serde"] }
libc = "=0.2.126"
log = { version = "=0.4.17", features = ["serde"] }
mitata = '=0.0.7'
mitata = "=0.0.7"
monch = "=0.2.0"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already a dependency of deno_task_shell.

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

cli/npm/semver/mod.rs Outdated Show resolved Hide resolved
assert!(!tester.matches("0.1.0"));
assert!(!tester.matches("1.0.0"));
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice tests!

@dsherret dsherret merged commit e1d7d7b into denoland:main Sep 1, 2022
@dsherret dsherret deleted the fix_real_npm_semver_support branch September 1, 2022 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

npm: error parsing version requirement for dependency
2 participants