From b929b4254347129733b1579221158a298ca810b0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 7 Mar 2023 04:18:59 +0900 Subject: [PATCH] Update Deno Dependencies (#35) * chore(deps): update deno dependencies * Update README.md * Update README.md --------- Co-authored-by: GitHub Co-authored-by: ayame113 <40050810+ayame113@users.noreply.github.com> --- README.md | 20 ++++++++++---------- oak_test.ts | 2 +- src/oak.ts | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 1241478..ac725e5 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ TypeScript + ES Modules Transpile TypeScript on the fly and serve it from your server as ES Modules. ```ts -import { serve } from "https://deno.land/std@0.177.0/http/mod.ts"; +import { serve } from "https://deno.land/std@0.178.0/http/mod.ts"; import { serveDirWithTs } from "https://deno.land/x/ts_serve@$MODULE_VERSION/mod.ts"; serve((request) => serveDirWithTs(request)); @@ -34,7 +34,7 @@ console.log(1); As oak middleware: ```ts -import { Application } from "https://deno.land/x/oak@v11.1.0/mod.ts"; +import { Application } from "https://deno.land/x/oak@v12.0.1/mod.ts"; import { tsMiddleware } from "https://deno.land/x/ts_serve@$MODULE_VERSION/mod.ts"; const app = new Application(); @@ -54,22 +54,22 @@ await app.listen({ port: 8000 }); ``` As a replacement for the -[serveDir](https://doc.deno.land/https://deno.land/std@0.177.0/http/file_server.ts/~/serveDir) +[serveDir](https://doc.deno.land/https://deno.land/std@0.178.0/http/file_server.ts/~/serveDir) function in the Deno standard library: ```ts -import { serve } from "https://deno.land/std@0.177.0/http/mod.ts"; +import { serve } from "https://deno.land/std@0.178.0/http/mod.ts"; import { serveDirWithTs } from "https://deno.land/x/ts_serve@$MODULE_VERSION/mod.ts"; serve((request) => serveDirWithTs(request)); ``` As a replacement for the -[serveFile](https://doc.deno.land/https://deno.land/std@0.177.0/http/file_server.ts/~/serveFile) +[serveFile](https://doc.deno.land/https://deno.land/std@0.178.0/http/file_server.ts/~/serveFile) function in the Deno standard library: ```ts -import { serve } from "https://deno.land/std@0.177.0/http/mod.ts"; +import { serve } from "https://deno.land/std@0.178.0/http/mod.ts"; import { serveFileWithTs } from "https://deno.land/x/ts_serve@$MODULE_VERSION/mod.ts"; serve((request) => serveFileWithTs(request, "./mod.ts")); @@ -78,13 +78,13 @@ serve((request) => serveFileWithTs(request, "./mod.ts")); As [Hono](https://honojs.dev/)'s handler: ```ts -import { serve } from "https://deno.land/std@0.177.0/http/server.ts"; -import { Hono } from "https://deno.land/x/hono@v2.2.5/mod.ts"; +import { serve } from "https://deno.land/std@0.178.0/http/server.ts"; +import { Hono } from "https://deno.land/x/hono@v3.0.2/mod.ts"; import { serveDirWithTs } from "https://deno.land/x/ts_serve@$MODULE_VERSION/mod.ts"; const app = new Hono(); app.get("*", (c) => { - return serveDirWithTs(c.req); + return serveDirWithTs(c.req.raw); }); serve(app.fetch); ``` @@ -100,7 +100,7 @@ takes time. In that case, calling this function in advance can speed up later calls to the transpile function. ```ts -import { serve } from "https://deno.land/std@0.177.0/http/mod.ts"; +import { serve } from "https://deno.land/std@0.178.0/http/mod.ts"; import { fourceInstantiateWasm, serveDirWithTs, diff --git a/oak_test.ts b/oak_test.ts index 4a0af7a..0c92e88 100644 --- a/oak_test.ts +++ b/oak_test.ts @@ -3,7 +3,7 @@ import { fail, } from "https://deno.land/std@0.178.0/testing/asserts.ts"; import { deferred } from "https://deno.land/std@0.178.0/async/mod.ts"; -import { Application } from "https://deno.land/x/oak@v11.1.0/mod.ts"; +import { Application } from "https://deno.land/x/oak@v12.0.1/mod.ts"; import { MediaType, transpile, tsMiddleware } from "./mod.ts"; const port = 8888; diff --git a/src/oak.ts b/src/oak.ts index 18f004e..96b8aff 100644 --- a/src/oak.ts +++ b/src/oak.ts @@ -1,5 +1,5 @@ -import type { Context } from "https://deno.land/x/oak@v11.1.0/mod.ts"; -import { convertBodyToBodyInit } from "https://deno.land/x/oak@v11.1.0/response.ts"; +import type { Context } from "https://deno.land/x/oak@v12.0.1/mod.ts"; +import { convertBodyToBodyInit } from "https://deno.land/x/oak@v12.0.1/response.ts"; import { MediaType, transpile } from "../utils/transpile.ts"; @@ -14,7 +14,7 @@ const jsxType = new Set(["jsx", ".jsx", "text/jsx"]); * Oak middleware that rewrites TypeScript response to JavaScript response. * * ```ts - * import { Application } from "https://deno.land/x/oak@v11.1.0/mod.ts"; + * import { Application } from "https://deno.land/x/oak@v12.0.1/mod.ts"; * import { tsMiddleware, fourceInstantiateWasm } from "https://deno.land/x/ts_serve@$MODULE_VERSION/mod.ts"; * * fourceInstantiateWasm();