mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
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`.
This commit is contained in:
parent
69e1d7a4ed
commit
6d587cbfc8
4 changed files with 23 additions and 4 deletions
|
@ -89,10 +89,6 @@ pub async fn cache_top_level_deps(
|
||||||
|
|
||||||
while let Some(info_future) = info_futures.next().await {
|
while let Some(info_future) = info_futures.next().await {
|
||||||
if let Some((specifier, info)) = info_future {
|
if let Some((specifier, info)) = info_future {
|
||||||
if info.export(".").is_some() {
|
|
||||||
roots.push(specifier.clone());
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
let exports = info.exports();
|
let exports = info.exports();
|
||||||
for (k, _) in exports {
|
for (k, _) in exports {
|
||||||
if let Ok(spec) = specifier.join(k) {
|
if let Ok(spec) = specifier.join(k) {
|
||||||
|
|
6
tests/specs/install/jsr_exports/__test__.jsonc
Normal file
6
tests/specs/install/jsr_exports/__test__.jsonc
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"tempDir": true,
|
||||||
|
"steps": [
|
||||||
|
{ "args": "install", "output": "install.out" }
|
||||||
|
]
|
||||||
|
}
|
5
tests/specs/install/jsr_exports/deno.json
Normal file
5
tests/specs/install/jsr_exports/deno.json
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"imports": {
|
||||||
|
"@denotest/different-deps-per-export": "jsr:@denotest/different-deps-per-export@^1.0.0"
|
||||||
|
}
|
||||||
|
}
|
12
tests/specs/install/jsr_exports/install.out
Normal file
12
tests/specs/install/jsr_exports/install.out
Normal file
|
@ -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]
|
Loading…
Reference in a new issue