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): use more relaxed package.json version constraint parsing #24202

Merged

Conversation

dsherret
Copy link
Member

@@ -75,13 +75,13 @@ pub fn get_local_package_json_version_reqs(
});
}
let (name, version_req) = parse_dep_entry_name_and_raw_version(key, value);
let result = VersionReq::parse_from_specifier(version_req);
let result = VersionReq::parse_from_npm(version_req);
Copy link
Member Author

Choose a reason for hiding this comment

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

Fix is here. I think this was just a mistake initially.

@@ -2,7 +2,7 @@
"name": "npmrc_test",
"version": "0.0.1",
"dependencies": {
"@denotest/basic": "1.0.0",
"@denotest/basic": "^=1.0.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.

I piggy-backed on a random test. It causes the more relaxed parsing to be hit.

@@ -227,6 +227,26 @@ mod test {
);
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, it looks like this was previously purposefully done, but we should try to be as npm compatible as possible.

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

@dsherret dsherret merged commit 4ec9250 into denoland:main Jun 13, 2024
17 checks passed
@dsherret dsherret deleted the fix_relax_npm_version_req_parsing_package_json branch June 13, 2024 22:29
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.

None yet

2 participants