summaryrefslogtreecommitdiff
path: root/cli/tools/registry/pm/cache_deps.rs
diff options
context:
space:
mode:
authorhaturau <135221985+haturatu@users.noreply.github.com>2024-11-20 01:20:47 +0900
committerGitHub <noreply@github.com>2024-11-20 01:20:47 +0900
commit85719a67e59c7aa45bead26e4942d7df8b1b42d4 (patch)
treeface0aecaac53e93ce2f23b53c48859bcf1a36ec /cli/tools/registry/pm/cache_deps.rs
parent67697bc2e4a62a9670699fd18ad0dd8efc5bd955 (diff)
parent186b52731c6bb326c4d32905c5e732d082e83465 (diff)
Merge branch 'denoland:main' into main
Diffstat (limited to 'cli/tools/registry/pm/cache_deps.rs')
-rw-r--r--cli/tools/registry/pm/cache_deps.rs17
1 files changed, 12 insertions, 5 deletions
diff --git a/cli/tools/registry/pm/cache_deps.rs b/cli/tools/registry/pm/cache_deps.rs
index c8258e600..d3c8da868 100644
--- a/cli/tools/registry/pm/cache_deps.rs
+++ b/cli/tools/registry/pm/cache_deps.rs
@@ -44,7 +44,11 @@ pub async fn cache_top_level_deps(
let mut seen_reqs = std::collections::HashSet::new();
- for entry in import_map.imports().entries() {
+ for entry in import_map.imports().entries().chain(
+ import_map
+ .scopes()
+ .flat_map(|scope| scope.imports.entries()),
+ ) {
let Some(specifier) = entry.value else {
continue;
};
@@ -75,6 +79,13 @@ pub async fn cache_top_level_deps(
if entry.key.ends_with('/') && specifier.as_str().ends_with('/') {
continue;
}
+ if specifier.scheme() == "file" {
+ if let Ok(path) = specifier.to_file_path() {
+ if !path.is_file() {
+ continue;
+ }
+ }
+ }
roots.push(specifier.clone());
}
}
@@ -82,10 +93,6 @@ pub async fn cache_top_level_deps(
while let Some(info_future) = info_futures.next().await {
if let Some((specifier, info)) = info_future {
- if info.export(".").is_some() {
- roots.push(specifier.clone());
- continue;
- }
let exports = info.exports();
for (k, _) in exports {
if let Ok(spec) = specifier.join(k) {