From fa371513a4374edc49803b6d60c41aff902041e7 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 29 Apr 2024 13:27:12 +0900 Subject: chore(blog/nuldoc): update deps --- vhosts/blog/nuldoc-src/commands/serve.ts | 11 +++++------ vhosts/blog/nuldoc-src/components/utils.ts | 6 +++--- vhosts/blog/nuldoc-src/ndoc/parse.ts | 2 +- vhosts/blog/nuldoc-src/slide/parse.ts | 2 +- 4 files changed, 10 insertions(+), 11 deletions(-) (limited to 'vhosts/blog/nuldoc-src') diff --git a/vhosts/blog/nuldoc-src/commands/serve.ts b/vhosts/blog/nuldoc-src/commands/serve.ts index aa5221df..5fe8a6f9 100644 --- a/vhosts/blog/nuldoc-src/commands/serve.ts +++ b/vhosts/blog/nuldoc-src/commands/serve.ts @@ -1,12 +1,11 @@ import { serveDir } from "std/http/file_server.ts"; -import { Status, STATUS_TEXT } from "std/http/http_status.ts"; -import { serve } from "std/http/server.ts"; +import { STATUS_CODE, STATUS_TEXT } from "std/http/mod.ts"; import { join } from "std/path/mod.ts"; import { Config } from "../config.ts"; export function runServeCommand(config: Config) { const rootDir = join(Deno.cwd(), config.locations.destDir); - serve(async (req) => { + Deno.serve(async (req) => { const pathname = new URL(req.url).pathname; if (!pathname.endsWith("css") && !pathname.endsWith("svg")) { const command = new Deno.Command( @@ -22,14 +21,14 @@ export function runServeCommand(config: Config) { fsRoot: rootDir, showIndex: true, }); - if (res.status !== Status.NotFound) { + if (res.status !== STATUS_CODE.NotFound) { return res; } const notFoundHtml = await Deno.readTextFile(join(rootDir, "404.html")); return new Response(notFoundHtml, { - status: Status.NotFound, - statusText: STATUS_TEXT[Status.NotFound], + status: STATUS_CODE.NotFound, + statusText: STATUS_TEXT[STATUS_CODE.NotFound], headers: { "content-type": "text/html", }, diff --git a/vhosts/blog/nuldoc-src/components/utils.ts b/vhosts/blog/nuldoc-src/components/utils.ts index f0de71f1..5d57d033 100644 --- a/vhosts/blog/nuldoc-src/components/utils.ts +++ b/vhosts/blog/nuldoc-src/components/utils.ts @@ -1,4 +1,4 @@ -import { crypto, toHashString } from "std/crypto/mod.ts"; +import { Hash } from "checksum/mod.ts"; import { join } from "std/path/mod.ts"; import { Config } from "../config.ts"; import { el, Element } from "../dom.ts"; @@ -25,6 +25,6 @@ export async function staticScriptElement( async function calculateFileHash( filePath: string, ): Promise { - const content = (await Deno.readFile(filePath)).buffer; - return toHashString(await crypto.subtle.digest("MD5", content), "hex"); + const content = await Deno.readFile(filePath); + return new Hash("md5").digest(content).hex(); } diff --git a/vhosts/blog/nuldoc-src/ndoc/parse.ts b/vhosts/blog/nuldoc-src/ndoc/parse.ts index f6f77dbb..136bc53e 100644 --- a/vhosts/blog/nuldoc-src/ndoc/parse.ts +++ b/vhosts/blog/nuldoc-src/ndoc/parse.ts @@ -1,4 +1,4 @@ -import { parse as parseToml } from "std/encoding/toml.ts"; +import { parse as parseToml } from "std/toml/mod.ts"; import { Config } from "../config.ts"; import { parseXmlString } from "../xml.ts"; import { createNewDocumentFromRootElement, Document } from "./document.ts"; diff --git a/vhosts/blog/nuldoc-src/slide/parse.ts b/vhosts/blog/nuldoc-src/slide/parse.ts index b880ef0a..5daa6ed0 100644 --- a/vhosts/blog/nuldoc-src/slide/parse.ts +++ b/vhosts/blog/nuldoc-src/slide/parse.ts @@ -1,4 +1,4 @@ -import { parse as parseToml } from "std/encoding/toml.ts"; +import { parse as parseToml } from "std/toml/mod.ts"; import { Config } from "../config.ts"; import { createNewSlideFromTomlRootObject, Slide } from "./slide.ts"; -- cgit v1.2.3-70-g09d2