-
-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
90 changed files
with
42 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
.DS_Store | ||
.idea/ | ||
.vscode/ | ||
*.log | ||
config.json | ||
esmd | ||
.esmd/ | ||
node_modules/ | ||
dist/ | ||
*.log | ||
config.json | ||
!test/config.json | ||
esmd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
test/build-args/package-css.test.ts → test/build-args/css.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { assert, assertEquals } from "jsr:@std/assert"; | ||
|
||
Deno.test("package css", async () => { | ||
Deno.test("?css", async () => { | ||
const res = await fetch("http://localhost:8080/[email protected]?css&target=es2022", { redirect: "manual" }); | ||
assertEquals(res.status, 301); | ||
assertEquals(res.headers.get("location"), "http://localhost:8080/[email protected]/es2022/monaco-editor.css"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,39 @@ | ||
import { assertEquals, assertStringIncludes } from "jsr:@std/assert"; | ||
|
||
function fetchModule(path: string) { | ||
return fetch(`http://localhost:8080/${path}`); | ||
} | ||
|
||
Deno.test("`?external` query", async () => { | ||
const res1 = await fetch("http://localhost:8080/[email protected]?external=react"); | ||
const res1 = await fetchModule("[email protected]?external=react"); | ||
const code1 = await res1.text(); | ||
assertStringIncludes(code1, '"/[email protected]/X-ZXJlYWN0/denonext/react-dom.mjs"'); | ||
|
||
const res2 = await fetch("http://localhost:8080/*[email protected]/jsx-runtime"); | ||
const res2 = await fetchModule("*[email protected]/jsx-runtime"); | ||
const code2 = await res2.text(); | ||
assertStringIncludes(code2, '"/[email protected]/X-Kg/denonext/jsx-runtime.js"'); | ||
|
||
const res3 = await fetch("http://localhost:8080/[email protected]/hooks?external=preact"); | ||
const res3 = await fetchModule("[email protected]/hooks?external=preact"); | ||
const code3 = await res3.text(); | ||
assertStringIncludes(code3, '"/[email protected]/X-ZXByZWFjdA/denonext/hooks.js"'); | ||
}); | ||
|
||
Deno.test("drop invalid `?external`", async () => { | ||
const res1 = await fetch("http://localhost:8080/[email protected]?target=es2022&external=foo,bar,react"); | ||
const res1 = await fetchModule("[email protected]?target=es2022&external=foo,bar,react"); | ||
const code1 = await res1.text(); | ||
assertStringIncludes(code1, '"/[email protected]/X-ZXJlYWN0/es2022/react-dom.mjs"'); | ||
|
||
const res2 = await fetch("http://localhost:8080/[email protected]?target=es2022&external=foo,bar,preact"); | ||
const res2 = await fetchModule("[email protected]?target=es2022&external=foo,bar,preact"); | ||
const code2 = await res2.text(); | ||
assertStringIncludes(code2, '"/[email protected]/es2022/react-dom.mjs"'); | ||
|
||
const res3 = await fetch("http://localhost:8080/[email protected]?external=react-dom"); | ||
const res3 = await fetchModule("[email protected]?external=react-dom"); | ||
const code3 = await res3.text(); | ||
assertStringIncludes(code3, '"/[email protected]/denonext/react-dom.mjs"'); | ||
}); | ||
|
||
Deno.test("types with `?external`", async () => { | ||
const res = await fetch("http://localhost:8080/[email protected]/X-ZXJlYWN0/dist/use-swr.d.ts"); | ||
const res = await fetchModule("[email protected]/X-ZXJlYWN0/dist/use-swr.d.ts"); | ||
assertEquals(res.status, 200); | ||
assertEquals(res.headers.get("Content-type"), "application/typescript; charset=utf-8"); | ||
const ts = await res.text(); | ||
|
@@ -38,21 +42,21 @@ Deno.test("types with `?external`", async () => { | |
}); | ||
|
||
Deno.test("external nodejs internal modules", async () => { | ||
const res = await fetch("http://localhost:8080/[email protected]/es2022/cheerio.mjs"); | ||
const res = await fetchModule("[email protected]/es2022/cheerio.mjs"); | ||
assertEquals(res.status, 200); | ||
assertStringIncludes(await res.text(), ` from "/node/buffer.js"`); | ||
|
||
const res2 = await fetch("http://localhost:8080/[email protected]?target=es2022&external=node:buffer"); | ||
const res2 = await fetchModule("[email protected]?target=es2022&external=node:buffer"); | ||
res2.body?.cancel(); | ||
assertEquals(res2.status, 200); | ||
const res3 = await fetch("http://localhost:8080/" + res2.headers.get("x-esm-path")); | ||
const res3 = await fetchModule("" + res2.headers.get("x-esm-path")); | ||
assertEquals(res3.status, 200); | ||
assertStringIncludes(await res3.text(), ` from "node:buffer"`); | ||
|
||
const res4 = await fetch("http://localhost:8080/*[email protected]?target=es2022"); | ||
const res4 = await fetchModule("*[email protected]?target=es2022"); | ||
res4.body?.cancel(); | ||
assertEquals(res4.status, 200); | ||
const res5 = await fetch("http://localhost:8080/" + res4.headers.get("x-esm-path")); | ||
const res5 = await fetchModule("" + res4.headers.get("x-esm-path")); | ||
assertEquals(res5.status, 200); | ||
assertStringIncludes(await res5.text(), ` from "node:buffer"`); | ||
}); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"buildTimeout": 600, | ||
"workDir": ".esmd" | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,8 @@ | ||
{ | ||
"compilerOptions": { | ||
"lib": [ | ||
"dom", | ||
"deno.ns" | ||
] | ||
}, | ||
"imports": { | ||
"esm.sh/": "http://localhost:8080/", | ||
"react": "http://localhost:8080/[email protected]", | ||
"react/": "http://localhost:8080/[email protected]/", | ||
"react/jsx-runtime": "http://localhost:8080/[email protected]/jsx-runtime", | ||
"react-dom": "http://localhost:8080/[email protected]" | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { assertStringIncludes } from "jsr:@std/assert"; | ||
|
||
Deno.test("issue #765", async () => { | ||
const dts = await fetch("http://localhost:8080/[email protected]/index.d.mts").then((res) => res.text()); | ||
assertStringIncludes(dts, "http://localhost:8080/[email protected]/resources/index.d.ts"); | ||
|
||
const dts2 = await fetch("http://localhost:8080/[email protected]/resources/index.d.ts").then((res) => res.text()); | ||
assertStringIncludes(dts2, "ImagesResponse"); | ||
}); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { assertEquals, assertStringIncludes } from "assert"; | ||
import { assertEquals, assertStringIncludes } from "jsr:@std/assert"; | ||
|
||
Deno.test("typesVersions", async () => { | ||
const res = await fetch("http://localhost:8080/[email protected]/index.d.ts"); | ||
|
File renamed without changes.
File renamed without changes.