diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4122280..dcab4dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,9 +11,9 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: denoland/setup-deno@v1 + - uses: denoland/setup-deno@v2 with: - deno-version: v1.x + deno-version: v2.x - name: Run tests run: deno test --allow-env --allow-read=. --allow-net=api.github.com,0.0.0.0,localhost - name: Deploy to Deno Deploy diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index d34c001..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "deno.enable": true, - "deno.lint": false, - "deno.unstable": false -} diff --git a/deno.json b/deno.json index 12a7930..94e489e 100644 --- a/deno.json +++ b/deno.json @@ -1,3 +1,8 @@ { - "importMap": "./import_map.json" + "imports": { + "@std/assert": "jsr:@std/assert@^1.0.12", + "preact": "https://esm.sh/preact@10.15.1?pin=v135", + "preact/": "https://esm.sh/preact@10.15.1&pin=v135/", + "preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.1.0?pin=v135" + } } diff --git a/deno.lock b/deno.lock index 41cefd6..0c9387f 100644 --- a/deno.lock +++ b/deno.lock @@ -1,12 +1,29 @@ { - "version": "3", + "version": "4", + "specifiers": { + "jsr:@std/assert@^1.0.12": "1.0.12", + "jsr:@std/internal@^1.0.6": "1.0.6" + }, + "jsr": { + "@std/assert@1.0.12": { + "integrity": "08009f0926dda9cbd8bef3a35d3b6a4b964b0ab5c3e140a4e0351fbf34af5b9a", + "dependencies": [ + "jsr:@std/internal" + ] + }, + "@std/internal@1.0.6": { + "integrity": "9533b128f230f73bd209408bb07a4b12f8d4255ab2a4d22a1fd6d87304aca9a4" + } + }, "remote": { - "https://deno.land/std@0.117.0/fmt/colors.ts": "8368ddf2d48dfe413ffd04cdbb7ae6a1009cf0dccc9c7ff1d76259d9c61a0621", - "https://deno.land/std@0.117.0/testing/_diff.ts": "e6a10d2aca8d6c27a9c5b8a2dbbf64353874730af539707b5b39d4128140642d", - "https://deno.land/std@0.117.0/testing/asserts.ts": "a1fef0239a2c343b0baa49c77dcdd7412613c46f3aba2887c331a2d7ed1f645e", "https://esm.sh/*preact-render-to-string@6.1.0?pin=v135": "ce1c6902880f66372096778d76a4afcb1e7f10a7349939c146d5e33aee5962dd", "https://esm.sh/preact@10.15.1?pin=v135": "796ac5b6d7b4c71b1eba2e60dee47d3a7c639d99b546b35902af6405e845cf5a", "https://esm.sh/stable/preact@10.15.1/denonext/preact.mjs": "30710ac1d5ff3711ae0c04eddbeb706f34f82d97489f61aaf09897bc75d2a628", "https://esm.sh/v135/preact-render-to-string@6.1.0/X-ZS8q/denonext/preact-render-to-string.mjs": "8ce71d44f2a197f8fafa24c8d1ac19e0d7fac5a171efae6154f8d754e1ae0ae4" + }, + "workspace": { + "dependencies": [ + "jsr:@std/assert@^1.0.12" + ] } } diff --git a/deps.test.ts b/deps.test.ts deleted file mode 100644 index 93a83a0..0000000 --- a/deps.test.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "https://deno.land/std@0.117.0/testing/asserts.ts"; diff --git a/handleRequest.test.ts b/handleRequest.test.ts index 9b2cf3f..44faec5 100644 --- a/handleRequest.test.ts +++ b/handleRequest.test.ts @@ -1,8 +1,8 @@ -import { assertEquals } from "./deps.test.ts"; +import { assertEquals } from "@std/assert"; import { createRequestHandler } from "./handleRequest.ts"; import { RealClock } from "./utils/clock.ts"; -const connInfo: Deno.ServeHandlerInfo = { +const connInfo: Deno.ServeHandlerInfo = { remoteAddr: { transport: "tcp", hostname: "127.0.0.1", diff --git a/handleRequest.ts b/handleRequest.ts index 074fa2a..4ed2f23 100644 --- a/handleRequest.ts +++ b/handleRequest.ts @@ -16,7 +16,7 @@ const contentTypes = { export function createRequestHandler(clock: Clock) { const { fetchCached } = createFetchCacher(clock); return { - async handleRequest(request: Request, info: Deno.ServeHandlerInfo) { + async handleRequest(request: Request, info: Deno.ServeHandlerInfo) { const url = new URL(request.url); const newUrl = await resolvePluginOrSchemaUrl(url); if (newUrl != null) { diff --git a/import_map.json b/import_map.json deleted file mode 100644 index 9b02f03..0000000 --- a/import_map.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "imports": { - "preact": "https://esm.sh/preact@10.15.1?pin=v135", - "preact/": "https://esm.sh/preact@10.15.1&pin=v135/", - "preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.1.0?pin=v135" - } -} diff --git a/plugins.test.ts b/plugins.test.ts index fb80aab..8587077 100644 --- a/plugins.test.ts +++ b/plugins.test.ts @@ -1,4 +1,4 @@ -import { assertEquals } from "./deps.test.ts"; +import { assertEquals } from "@std/assert"; import { tryResolveLatestJson } from "./plugins.ts"; import { getLatestReleaseInfo } from "./utils/github.ts"; diff --git a/utils/LazyExpirableValue.test.ts b/utils/LazyExpirableValue.test.ts index b2dd44b..fd04892 100644 --- a/utils/LazyExpirableValue.test.ts +++ b/utils/LazyExpirableValue.test.ts @@ -1,4 +1,4 @@ -import { assertEquals, assertRejects } from "../deps.test.ts"; +import { assertEquals, assertRejects } from "@std/assert"; import { LazyExpirableValue } from "./LazyExpirableValue.ts"; Deno.test("should work", async () => { diff --git a/utils/LruCache.test.ts b/utils/LruCache.test.ts index 3a7e6ef..05ed42c 100644 --- a/utils/LruCache.test.ts +++ b/utils/LruCache.test.ts @@ -1,4 +1,4 @@ -import { assertEquals } from "../deps.test.ts"; +import { assertEquals } from "@std/assert"; import { LruCache, LruCacheWithExpiry } from "./LruCache.ts"; Deno.test("LruCache - keeps only most recent", () => { diff --git a/utils/RateLimiter.test.ts b/utils/RateLimiter.test.ts index 5cdd545..ee97813 100644 --- a/utils/RateLimiter.test.ts +++ b/utils/RateLimiter.test.ts @@ -1,4 +1,4 @@ -import { assert } from "../deps.test.ts"; +import { assert } from "@std/assert"; import { Clock } from "./clock.ts"; import { RateLimiter } from "./RateLimiter.ts"; diff --git a/utils/asyncLazy.test.ts b/utils/asyncLazy.test.ts index a53a905..10c3708 100644 --- a/utils/asyncLazy.test.ts +++ b/utils/asyncLazy.test.ts @@ -1,4 +1,4 @@ -import { assertEquals, assertRejects } from "../deps.test.ts"; +import { assertEquals, assertRejects } from "@std/assert"; import { createAsyncLazy } from "./asyncLazy.ts"; Deno.test("should create", async () => { diff --git a/utils/fetchCached.test.ts b/utils/fetchCached.test.ts index 02e81c7..de22727 100644 --- a/utils/fetchCached.test.ts +++ b/utils/fetchCached.test.ts @@ -1,4 +1,4 @@ -import { assertEquals } from "../deps.test.ts"; +import { assertEquals } from "@std/assert"; import { createFetchCacher } from "./fetchCached.ts"; Deno.test("should error when going above 10mb", { diff --git a/utils/github.test.ts b/utils/github.test.ts index 54c07a3..9ab6019 100644 --- a/utils/github.test.ts +++ b/utils/github.test.ts @@ -1,4 +1,4 @@ -import { assertEquals } from "../deps.test.ts"; +import { assertEquals } from "@std/assert"; import { checkGithubRepoExists } from "./github.ts"; Deno.test("should get when exists", async () => { diff --git a/utils/version.test.ts b/utils/version.test.ts index 7eba1a2..0afe366 100644 --- a/utils/version.test.ts +++ b/utils/version.test.ts @@ -1,4 +1,4 @@ -import { assertEquals } from "../deps.test.ts"; +import { assertEquals } from "@std/assert"; import { parseVersion, Version } from "./version.ts"; Deno.test("should parse version", () => {