diff options
author | Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> | 2024-10-25 13:19:03 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-25 20:19:03 +0000 |
commit | ec968aa5aec068e92fb554fc7192d912bcddb82c (patch) | |
tree | 48e158f24bef5f4ca85cbc5eb5e3a32acccdad7a /tests | |
parent | a01edb394d2785b7d37da6435bb37381efc376ea (diff) |
fix(install): cache json exports of JSR packages (#26552)
Fixes https://github.com/denoland/deno/issues/26509.
Ended up being a `deno_graph` bug causing the error to surface. This PR
updates `deno_graph` to pick up the fix and reverts the temporary
workaround that skipped JSON exports.
Diffstat (limited to 'tests')
10 files changed, 35 insertions, 6 deletions
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 000000000..de02f6902 --- /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 000000000..885e71c6c --- /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 000000000..215c42310 --- /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 000000000..d9f58b9a6 --- /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 000000000..02601e4d0 --- /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 934f3c588..7ccc5da4d 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 21212f579..4b281f80a 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 8f6400163..bce0d79bb 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 000000000..6ce184bad --- /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 000000000..f7efdb0e9 --- /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); |