-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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: support workspace:^
and workspace:~
version constraints
#27096
fix: support workspace:^
and workspace:~
version constraints
#27096
Conversation
/// Resolve the package.json's dependencies. | ||
// TODO(nathanwhit): Remove once we update deno_package_json with dev deps split out | ||
fn resolve_local_package_json_deps( | ||
package_json: &PackageJsonRc, | ||
) -> PackageJsonDeps { |
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.
Replaced with code from deno_config
{ | ||
"tempDir": true, | ||
"steps": [{ | ||
"args": "install", | ||
"output": "[WILDCARD]" | ||
}, { | ||
"args": "run e/main.ts", | ||
"output": "main.out" | ||
}] | ||
} |
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.
Test for the actual fix
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.
Still looking. Just blocking merge.
cli/args/package_json.rs
Outdated
PackageJsonDepWorkspaceReq::Tilde => { | ||
VersionReq::from_raw_text_and_inner( | ||
"workspace:~".to_string(), | ||
RangeSetOrTag::Tag("workspace".to_string()), |
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 think these should go to a version requirement that's *
?
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.
Are you saying that this should be "unbounded version range"?
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.
Yeah, I believe they match any workspace package with the same name.
cli/tools/registry/unfurl.rs
Outdated
version_req | ||
} | ||
// TODO(bartlomieju): this is not correct, but doesn't really matter until we | ||
// start supporting publishing of npm packages |
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 think it matters here because this is for publishing. I think also JSR might error because of the *
version requirement? Not sure. We should look into fixing this in this PR.
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 thought JSR can't publish based on package.json
and these version constraints can only be specified in package.json
.
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.
In this case, it's currently saying that it can depend on any version of the workspace package, but the original workspace dependency is constrained to either ~
or ^
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
) This commit adds support for understanding "workpace:^" and "workspace:~" version constraints in npm/pnpm workspaces. This is done by upgrading various crates to their latest versions. Closes #26726 --------- Co-authored-by: David Sherret <dsherret@gmail.com>
This commit adds support for understanding "workpace:^"
and "workspace:~" version constraints in npm/pnpm workspaces.
This is done by upgrading various crates to their latest versions.
Closes #26726