diff --git a/Cargo.lock b/Cargo.lock index 3612cc23b67d24..623d028ce65fc9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1606,9 +1606,9 @@ dependencies = [ [[package]] name = "deno_graph" -version = "0.83.3" +version = "0.83.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77163c46755676d8f793fc19e365537ba660a8db173cd1e02d21eb010c0b3cef" +checksum = "5bd20bc0780071989c622cbfd5d4fb2e4fd05a247ccd7f791f13c8d2c3792228" dependencies = [ "anyhow", "async-trait", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index db0248d846571c..0065a2cbd0757e 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -73,7 +73,7 @@ deno_cache_dir = { workspace = true } deno_config = { version = "=0.37.2", features = ["workspace", "sync"] } deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] } deno_doc = { version = "0.154.0", default-features = false, features = ["rust", "html", "syntect"] } -deno_graph = { version = "=0.83.3" } +deno_graph = { version = "=0.83.4" } deno_lint = { version = "=0.67.0", features = ["docs"] } deno_lockfile.workspace = true deno_npm.workspace = true diff --git a/cli/tools/registry/pm/cache_deps.rs b/cli/tools/registry/pm/cache_deps.rs index 9883deb1d5f3a9..365622d11f5f03 100644 --- a/cli/tools/registry/pm/cache_deps.rs +++ b/cli/tools/registry/pm/cache_deps.rs @@ -90,13 +90,8 @@ pub async fn cache_top_level_deps( while let Some(info_future) = info_futures.next().await { if let Some((specifier, info)) = info_future { let exports = info.exports(); - for (k, v) in exports { + for (k, _) in exports { if let Ok(spec) = specifier.join(k) { - if v.ends_with(".json") { - // TODO(nathanwhit): this should work, there's a bug with - // json roots in deno_graph. skip it for now - continue; - } roots.push(spec); } } diff --git a/tests/registry/jsr/@denotest/multiple-exports/1.0.0/add.ts b/tests/registry/jsr/@denotest/multiple-exports/1.0.0/add.ts new file mode 100644 index 00000000000000..de02f69024bf76 --- /dev/null +++ b/tests/registry/jsr/@denotest/multiple-exports/1.0.0/add.ts @@ -0,0 +1 @@ +export * from "jsr:@denotest/add@1"; diff --git a/tests/registry/jsr/@denotest/multiple-exports/1.0.0/data.json b/tests/registry/jsr/@denotest/multiple-exports/1.0.0/data.json new file mode 100644 index 00000000000000..885e71c6ccde35 --- /dev/null +++ b/tests/registry/jsr/@denotest/multiple-exports/1.0.0/data.json @@ -0,0 +1,3 @@ +{ + "a": 1 +} \ No newline at end of file diff --git a/tests/registry/jsr/@denotest/multiple-exports/1.0.0/subtract.ts b/tests/registry/jsr/@denotest/multiple-exports/1.0.0/subtract.ts new file mode 100644 index 00000000000000..215c42310d69bb --- /dev/null +++ b/tests/registry/jsr/@denotest/multiple-exports/1.0.0/subtract.ts @@ -0,0 +1 @@ +export * from "jsr:@denotest/subtract@1"; diff --git a/tests/registry/jsr/@denotest/multiple-exports/1.0.0_meta.json b/tests/registry/jsr/@denotest/multiple-exports/1.0.0_meta.json new file mode 100644 index 00000000000000..d9f58b9a61a03f --- /dev/null +++ b/tests/registry/jsr/@denotest/multiple-exports/1.0.0_meta.json @@ -0,0 +1,7 @@ +{ + "exports": { + "./add": "./add.ts", + "./subtract": "./subtract.ts", + "./data-json": "./data.json" + } +} diff --git a/tests/registry/jsr/@denotest/multiple-exports/meta.json b/tests/registry/jsr/@denotest/multiple-exports/meta.json new file mode 100644 index 00000000000000..02601e4d0d5188 --- /dev/null +++ b/tests/registry/jsr/@denotest/multiple-exports/meta.json @@ -0,0 +1,5 @@ +{ + "versions": { + "1.0.0": {} + } +} diff --git a/tests/specs/install/jsr_exports/__test__.jsonc b/tests/specs/install/jsr_exports/__test__.jsonc index 934f3c58859cbd..7ccc5da4d99328 100644 --- a/tests/specs/install/jsr_exports/__test__.jsonc +++ b/tests/specs/install/jsr_exports/__test__.jsonc @@ -1,6 +1,7 @@ { "tempDir": true, "steps": [ - { "args": "install", "output": "install.out" } + { "args": "install", "output": "install.out" }, + { "args": "run --cached-only main.ts", "output": "main.out" } ] } diff --git a/tests/specs/install/jsr_exports/deno.json b/tests/specs/install/jsr_exports/deno.json index 21212f5794d97f..4b281f80ae3055 100644 --- a/tests/specs/install/jsr_exports/deno.json +++ b/tests/specs/install/jsr_exports/deno.json @@ -1,5 +1,5 @@ { "imports": { - "@denotest/different-deps-per-export": "jsr:@denotest/different-deps-per-export@^1.0.0" + "@denotest/multiple-exports": "jsr:@denotest/multiple-exports@^1.0.0" } } diff --git a/tests/specs/install/jsr_exports/install.out b/tests/specs/install/jsr_exports/install.out index 8f640016369da1..bce0d79bb3c03b 100644 --- a/tests/specs/install/jsr_exports/install.out +++ b/tests/specs/install/jsr_exports/install.out @@ -1,8 +1,9 @@ [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/multiple-exports/meta.json +Download http://127.0.0.1:4250/@denotest/multiple-exports/1.0.0_meta.json +Download http://127.0.0.1:4250/@denotest/multiple-exports/1.0.0/add.ts +Download http://127.0.0.1:4250/@denotest/multiple-exports/1.0.0/subtract.ts +Download http://127.0.0.1:4250/@denotest/multiple-exports/1.0.0/data.json 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 diff --git a/tests/specs/install/jsr_exports/main.out b/tests/specs/install/jsr_exports/main.out new file mode 100644 index 00000000000000..6ce184badab6e0 --- /dev/null +++ b/tests/specs/install/jsr_exports/main.out @@ -0,0 +1,3 @@ +3 +-1 +{ a: 1 } diff --git a/tests/specs/install/jsr_exports/main.ts b/tests/specs/install/jsr_exports/main.ts new file mode 100644 index 00000000000000..f7efdb0e9832de --- /dev/null +++ b/tests/specs/install/jsr_exports/main.ts @@ -0,0 +1,7 @@ +import { add } from "@denotest/multiple-exports/add"; +import { subtract } from "@denotest/multiple-exports/subtract"; +import data from "@denotest/multiple-exports/data-json" with { type: "json" }; + +console.log(add(1, 2)); +console.log(subtract(1, 2)); +console.log(data);