From 0dc99eaeffa0cf1c10725f4a706ec3af3fb22af5 Mon Sep 17 00:00:00 2001 From: Reed von Redwitz Date: Tue, 30 Jan 2024 12:49:19 +0100 Subject: [PATCH] chore: bump deps --- _showcase/import_map.json | 8 ++++---- deno.json | 2 ++ deps.ts | 8 ++++---- deps_test.ts | 2 +- doc/markdown.tsx | 14 +++++++++++++- 5 files changed, 24 insertions(+), 10 deletions(-) diff --git a/_showcase/import_map.json b/_showcase/import_map.json index 9728c6f..ef42db4 100644 --- a/_showcase/import_map.json +++ b/_showcase/import_map.json @@ -1,14 +1,14 @@ { "imports": { - "$fresh/": "https://deno.land/x/fresh@1.6.1/", - "preact": "https://esm.sh/preact@10.19.2", - "preact/": "https://esm.sh/preact@10.19.2/", + "$fresh/": "https://deno.land/x/fresh@1.6.3/", + "preact": "https://esm.sh/preact@10.19.3", + "preact/": "https://esm.sh/preact@10.19.3/", "preact-render-to-string": "https://esm.sh/*preact-render-to-string@5.2.4", "@preact/signals": "https://esm.sh/*@preact/signals@1.2.1", "@preact/signals-core": "https://esm.sh/*@preact/signals-core@1.5.0", "twind": "https://esm.sh/twind@0.16.19", "twind/": "https://esm.sh/twind@0.16.19/", - "apiland/types": "https://deno.land/x/apiland@1.0.0/types.d.ts", + "apiland/types": "https://deno.land/x/apiland@1.7.2/types.d.ts", "deno_doc/types": "https://deno.land/x/deno_doc@0.46.0/lib/types.d.ts", "@doc_components/": "../" } diff --git a/deno.json b/deno.json index 85860f7..44aeec5 100644 --- a/deno.json +++ b/deno.json @@ -7,6 +7,8 @@ "importMap": "./_showcase/import_map.json", "tasks": { "check": "deno check _showcase/main.ts", + "check:types": "deno check **/*.ts && deno check **/*.tsx", + "ok": "deno fmt --check && deno lint && deno task check:types && deno task test", "showcase": "cd _showcase && deno task start", "test": "deno test" } diff --git a/deps.ts b/deps.ts index 5b7c9a4..a9823c3 100644 --- a/deps.ts +++ b/deps.ts @@ -47,11 +47,11 @@ export type { TsTypeParamDef, TsTypeTupleDef, TsTypeUnionDef, -} from "https://deno.land/x/deno_doc@0.56.0/lib/types.d.ts"; +} from "https://deno.land/x/deno_doc@0.99.0/types.d.ts"; -export { toHtml } from "https://esm.sh/hast-util-to-html@8.0.3"; -export * as htmlEntities from "https://esm.sh/html-entities@2.3.3"; -export { lowlight } from "https://esm.sh/lowlight@2.7.0"; +export { toHtml } from "https://esm.sh/hast-util-to-html@9.0.0"; +export * as htmlEntities from "https://esm.sh/html-entities@2.4.0"; +export { all, createLowlight } from "https://esm.sh/lowlight@3.1.0"; export { apply, type Configuration, diff --git a/deps_test.ts b/deps_test.ts index d85b26e..7dc3cb2 100644 --- a/deps_test.ts +++ b/deps_test.ts @@ -6,4 +6,4 @@ /// /// -export { assertEquals } from "https://deno.land/std@0.167.0/testing/asserts.ts"; +export { assertEquals } from "https://deno.land/std@0.213.0/assert/assert_equals.ts"; diff --git a/doc/markdown.tsx b/doc/markdown.tsx index 2cbae6a..a6121cb 100644 --- a/doc/markdown.tsx +++ b/doc/markdown.tsx @@ -1,6 +1,13 @@ // Copyright 2021-2023 the Deno authors. All rights reserved. MIT license. -import { comrak, htmlEntities, lowlight, toHtml, tw } from "../deps.ts"; +import { + all, + comrak, + createLowlight, + htmlEntities, + toHtml, + tw, +} from "../deps.ts"; import { services } from "../services.ts"; import { style, type StyleKey } from "../styles.ts"; import { assert, type Child, splitMarkdownTitle, take } from "./utils.ts"; @@ -23,6 +30,8 @@ const MARKDOWN_OPTIONS: comrak.ComrakOptions = { }, }; +let lowlight: ReturnType; + function syntaxHighlight(html: string): string { let match; while ((match = CODE_BLOCK_RE.exec(html))) { @@ -101,6 +110,9 @@ function parseLinks(markdown: string, url: URL, namespace?: string): string { } export function mdToHtml(markdown: string): string { + if (!lowlight) { + lowlight = createLowlight(all); + } return syntaxHighlight(comrak.markdownToHTML(markdown, MARKDOWN_OPTIONS)); }