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

remove workspace special bare resolution #121

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions src/workspace/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -543,30 +543,6 @@ impl WorkspaceResolver {
};

// 2. Try to resolve the bare specifier to a workspace member
if resolve_error.is_unmapped_bare_specifier() {
for member in &self.jsr_pkgs {
if let Some(path) = specifier.strip_prefix(&member.name) {
if path.is_empty() || path.starts_with('/') {
let path = path.strip_prefix('/').unwrap_or(path);
return self.resolve_workspace_jsr_pkg(
member,
JsrPackageReqReference::from_str(&format!(
"jsr:{}{}/{}",
member.name,
member
.version
.as_ref()
.map(|v| format!("@^{}", v))
.unwrap_or_else(String::new),
path
))
.unwrap(),
);
}
}
}
}
Copy link
Member

Choose a reason for hiding this comment

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

One scenario that bare specifiers are nice in is when you don't publish the workspace members to jsr. It feels weird referring to them with the jsr: prefix in that case.


if self.pkg_json_dep_resolution == PackageJsonDepResolution::Enabled {
// 2. Attempt to resolve from the package.json dependencies.
let mut previously_found_dir = false;
Expand Down
Loading