From f1a691274e59d3f6a1aad19d1aec02a0ffaa51d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Tue, 27 Feb 2024 08:27:21 +0000 Subject: feat(publish): discover jsr.json and jsr.jsonc files (#22587) Closes https://github.com/denoland/deno/issues/22491 --- tests/testdata/publish/jsr_jsonc/jsr.jsonc | 11 +++++++++++ tests/testdata/publish/jsr_jsonc/mod.out | 6 ++++++ tests/testdata/publish/jsr_jsonc/mod.ts | 7 +++++++ tests/testdata/publish/jsr_jsonc/std_http.ts | 6 ++++++ 4 files changed, 30 insertions(+) create mode 100644 tests/testdata/publish/jsr_jsonc/jsr.jsonc create mode 100644 tests/testdata/publish/jsr_jsonc/mod.out create mode 100644 tests/testdata/publish/jsr_jsonc/mod.ts create mode 100644 tests/testdata/publish/jsr_jsonc/std_http.ts (limited to 'tests/testdata/publish/jsr_jsonc') diff --git a/tests/testdata/publish/jsr_jsonc/jsr.jsonc b/tests/testdata/publish/jsr_jsonc/jsr.jsonc new file mode 100644 index 000000000..4c9dfb08c --- /dev/null +++ b/tests/testdata/publish/jsr_jsonc/jsr.jsonc @@ -0,0 +1,11 @@ +{ + // It's .jsonc file so it can have comments + "name": "@foo/bar", + "version": "1.0.0", + "exports": { + ".": "./mod.ts" + }, + "imports": { + "@std/http": "./std_http.ts" + } +} diff --git a/tests/testdata/publish/jsr_jsonc/mod.out b/tests/testdata/publish/jsr_jsonc/mod.out new file mode 100644 index 000000000..38b61d568 --- /dev/null +++ b/tests/testdata/publish/jsr_jsonc/mod.out @@ -0,0 +1,6 @@ +Check file:///[WILDCARD]/publish/jsr_jsonc/mod.ts +Checking for slow types in the public API... +Check file:///[WILDCARD]/publish/jsr_jsonc/mod.ts +Publishing @foo/bar@1.0.0 ... +Successfully published @foo/bar@1.0.0 +Visit http://127.0.0.1:4250/@foo/bar@1.0.0 for details diff --git a/tests/testdata/publish/jsr_jsonc/mod.ts b/tests/testdata/publish/jsr_jsonc/mod.ts new file mode 100644 index 000000000..6e8a61bae --- /dev/null +++ b/tests/testdata/publish/jsr_jsonc/mod.ts @@ -0,0 +1,7 @@ +import http from "@std/http"; + +export function foobar(): { fileServer(): void } { + return { + fileServer: http.fileServer, + }; +} diff --git a/tests/testdata/publish/jsr_jsonc/std_http.ts b/tests/testdata/publish/jsr_jsonc/std_http.ts new file mode 100644 index 000000000..9d57b36f3 --- /dev/null +++ b/tests/testdata/publish/jsr_jsonc/std_http.ts @@ -0,0 +1,6 @@ +// temp until we get jsr:@std/http in the test server +export default { + fileServer() { + console.log("Hi"); + }, +}; -- cgit v1.2.3