-
Notifications
You must be signed in to change notification settings - Fork 42
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: jsr specifier does not support tags #390
Conversation
It would be good to create an integration test that shows the error attached to the graph. Any pointers? |
src/graph.rs
Outdated
@@ -2770,6 +2773,14 @@ struct Builder<'a, 'graph> { | |||
diagnostics: Vec<BuildDiagnostic>, | |||
} | |||
|
|||
#[derive(Error, Debug, Clone)] | |||
pub enum JsrPackageFormatError { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if this is the best way to propagate errors. Suggestions welcome.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good thanks! Minor nitpick: would you be able to move it down to above validate_jsr_specifier
so it's not between Builder
and its implementation though?
Probably easiest would be to make a copy of one of these files: Then modify and run with |
src/graph.rs
Outdated
.map_err(|err| JsrPackageFormatError::JsrPackageParseError(err))?; | ||
match package_ref.req().version_req.inner() { | ||
RangeSetOrTag::Tag(_) => { | ||
Err(JsrPackageFormatError::JsrPackageVersionTagNotSupportedError) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To reduce verbosity we could strip JsrPackage
and Error
from the variant's name (ex. JsrPackageFormatError::VersionTagNotSupported
).
When a jsr specifier is used, an error is returned if the version segment contains a tag. Fixes: denoland/deno#22420
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks @irbull!
When a jsr specifier is used, an error is returned if the version segment contains a tag.
Fixes: denoland/deno#22420