diff --git a/cli/tools/registry/pm/cache_deps.rs b/cli/tools/registry/pm/cache_deps.rs index 365622d11f..d3c8da868c 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; }; diff --git a/tests/specs/install/installs_all_workspace_imports/__test__.jsonc b/tests/specs/install/installs_all_workspace_imports/__test__.jsonc new file mode 100644 index 0000000000..254fe8b989 --- /dev/null +++ b/tests/specs/install/installs_all_workspace_imports/__test__.jsonc @@ -0,0 +1,9 @@ +{ + "tempDir": true, + "steps": [ + { + "args": "install", + "output": "install.out" + } + ] +} diff --git a/tests/specs/install/installs_all_workspace_imports/deno.json b/tests/specs/install/installs_all_workspace_imports/deno.json new file mode 100644 index 0000000000..ac77e26d9b --- /dev/null +++ b/tests/specs/install/installs_all_workspace_imports/deno.json @@ -0,0 +1,6 @@ +{ + "workspace": ["packages/foo", "packages/bar"], + "imports": { + "@denotest/subtract": "jsr:@denotest/subtract@^1.0.0" + } +} diff --git a/tests/specs/install/installs_all_workspace_imports/install.out b/tests/specs/install/installs_all_workspace_imports/install.out new file mode 100644 index 0000000000..b02e6cc033 --- /dev/null +++ b/tests/specs/install/installs_all_workspace_imports/install.out @@ -0,0 +1,10 @@ +[UNORDERED_START] +Download http://localhost:4260/@denotest%2fesm-basic +Download http://localhost:4260/@denotest/esm-basic/1.0.0.tgz +Download http://127.0.0.1:4250/@denotest/subtract/meta.json +Download http://127.0.0.1:4250/@denotest/add/meta.json +Download http://127.0.0.1:4250/@denotest/add/1.0.0_meta.json +Download http://127.0.0.1:4250/@denotest/subtract/1.0.0_meta.json +Download http://127.0.0.1:4250/@denotest/add/1.0.0/mod.ts +Download http://127.0.0.1:4250/@denotest/subtract/1.0.0/mod.ts +[UNORDERED_END] diff --git a/tests/specs/install/installs_all_workspace_imports/packages/bar/deno.json b/tests/specs/install/installs_all_workspace_imports/packages/bar/deno.json new file mode 100644 index 0000000000..0172071c39 --- /dev/null +++ b/tests/specs/install/installs_all_workspace_imports/packages/bar/deno.json @@ -0,0 +1,5 @@ +{ + "imports": { + "@denotest/esm-basic": "npm:@denotest/esm-basic@^1.0.0" + } +} diff --git a/tests/specs/install/installs_all_workspace_imports/packages/foo/deno.json b/tests/specs/install/installs_all_workspace_imports/packages/foo/deno.json new file mode 100644 index 0000000000..38ca2d4b85 --- /dev/null +++ b/tests/specs/install/installs_all_workspace_imports/packages/foo/deno.json @@ -0,0 +1,5 @@ +{ + "imports": { + "@denotest/add": "jsr:@denotest/add@^1.0.0" + } +}