diff options
author | Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> | 2024-10-23 20:12:52 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-23 20:12:52 -0700 |
commit | 6d587cbfc800a627efb32d377b260954ccd7a1ed (patch) | |
tree | 0a618ec90097fb36807c5d07adb9696c4d735fee | |
parent | 69e1d7a4edb45c8b4cb15f64ee89cec8a693be5e (diff) |
fix(install): cache all exports of JSR packages listed in `deno.json` (#26501)
Fixes #26498.
This was a sort of intentional decision originally, as I wanted to avoid
caching extra files that may not be needed. It seems like that behavior
is unintuitive, so I propose we cache all of the exports of listed jsr
packages when you run a bare `deno install`.
-rw-r--r-- | cli/tools/registry/pm/cache_deps.rs | 4 | ||||
-rw-r--r-- | tests/specs/install/jsr_exports/__test__.jsonc | 6 | ||||
-rw-r--r-- | tests/specs/install/jsr_exports/deno.json | 5 | ||||
-rw-r--r-- | tests/specs/install/jsr_exports/install.out | 12 |
4 files changed, 23 insertions, 4 deletions
diff --git a/cli/tools/registry/pm/cache_deps.rs b/cli/tools/registry/pm/cache_deps.rs index b4cd1c253..365622d11 100644 --- a/cli/tools/registry/pm/cache_deps.rs +++ b/cli/tools/registry/pm/cache_deps.rs @@ -89,10 +89,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) { diff --git a/tests/specs/install/jsr_exports/__test__.jsonc b/tests/specs/install/jsr_exports/__test__.jsonc new file mode 100644 index 000000000..934f3c588 --- /dev/null +++ b/tests/specs/install/jsr_exports/__test__.jsonc @@ -0,0 +1,6 @@ +{ + "tempDir": true, + "steps": [ + { "args": "install", "output": "install.out" } + ] +} diff --git a/tests/specs/install/jsr_exports/deno.json b/tests/specs/install/jsr_exports/deno.json new file mode 100644 index 000000000..21212f579 --- /dev/null +++ b/tests/specs/install/jsr_exports/deno.json @@ -0,0 +1,5 @@ +{ + "imports": { + "@denotest/different-deps-per-export": "jsr:@denotest/different-deps-per-export@^1.0.0" + } +} diff --git a/tests/specs/install/jsr_exports/install.out b/tests/specs/install/jsr_exports/install.out new file mode 100644 index 000000000..8f6400163 --- /dev/null +++ b/tests/specs/install/jsr_exports/install.out @@ -0,0 +1,12 @@ +[UNORDERED_START] +Download http://127.0.0.1:4250/@denotest/different-deps-per-export/meta.json +Download http://127.0.0.1:4250/@denotest/different-deps-per-export/1.0.0_meta.json +Download http://127.0.0.1:4250/@denotest/different-deps-per-export/1.0.0/add.ts +Download http://127.0.0.1:4250/@denotest/different-deps-per-export/1.0.0/subtract.ts +Download http://127.0.0.1:4250/@denotest/add/meta.json +Download http://127.0.0.1:4250/@denotest/subtract/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] |