diff --git a/components/layouts/main.tsx b/components/layouts/main.tsx index 7e843f5..fe017cb 100644 --- a/components/layouts/main.tsx +++ b/components/layouts/main.tsx @@ -1,6 +1,6 @@ import { ComponentChildren } from "preact"; import { resources } from "@lib/resources.ts"; -import { CSS, KATEX_CSS } from "https://deno.land/x/gfm@0.2.5/mod.ts"; +import { CSS, KATEX_CSS } from "gfm"; import { Head } from "$fresh/runtime.ts"; import Search, { RedirectSearchHandler } from "@islands/Search.tsx"; import { KMenu } from "@islands/KMenu.tsx"; diff --git a/deno.json b/deno.json index b689706..ddaba23 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,6 @@ { "lock": false, - "nodeModulesDir": true, + "nodeModulesDir": "auto", "tasks": { "check": "deno fmt --check && deno lint && deno check **/*.ts && deno check **/*.tsx", "start": "deno run -A --watch=static/,routes/ dev.ts", @@ -8,30 +8,50 @@ "preview": "deno run -A main.ts", "update": "deno run -A -r https://fresh.deno.dev/update ." }, - "lint": { "rules": { "tags": ["fresh", "recommended"] } }, + "lint": { + "rules": { + "tags": [ + "fresh", + "recommended" + ] + } + }, "imports": { - "$fresh/": "https://deno.land/x/fresh@1.6.8/", + "$fresh/": "https://deno.land/x/fresh@1.7.3/", "@components": "./components", "@components/": "./components/", + "@denosaurs/emoji": "jsr:@denosaurs/emoji@^0.3.1", "@islands": "./islands", "@islands/": "./islands/", "@lib": "./lib", "@lib/": "./lib/", "@preact/signals": "https://esm.sh/*@preact/signals@1.2.2", "@preact/signals-core": "https://esm.sh/*@preact/signals-core@1.5.1", - "@std/dotenv": "jsr:@std/dotenv@^0.224.0", - "@std/http": "jsr:@std/http@^0.224.5", - "@std/yaml": "jsr:@std/yaml@^0.224.1", - "preact": "https://esm.sh/preact@10.19.6", + "@std/dotenv": "jsr:@std/dotenv@^0.225.3", + "@std/http": "jsr:@std/http@^1.0.12", + "@std/yaml": "jsr:@std/yaml@^1.0.5", + "preact": "https://esm.sh/preact@10.22.0", "preact-render-to-string": "https://esm.sh/*preact-render-to-string@6.2.2", - "preact/": "https://esm.sh/preact@10.19.6/", - "tailwindcss": "npm:tailwindcss@3.3.5", - "tailwindcss/": "npm:/tailwindcss@3.3.5/", - "tailwindcss/plugin": "npm:/tailwindcss@3.3.5/plugin.js", + "preact/": "https://esm.sh/preact@10.22.0/", + "gfm": "jsr:@deno/gfm", + "tailwindcss": "npm:tailwindcss@^3.4.17", + "tailwindcss/": "npm:/tailwindcss@^3.4.17/", + "tailwindcss/plugin": "npm:/tailwindcss@^3.4.17/plugin.js", + "camelcase-css": "npm:camelcase-css", "typesense": "https://raw.githubusercontent.com/bradenmacdonald/typesense-deno/main/mod.ts", "yaml": "https://deno.land/std@0.197.0/yaml/mod.ts", "zod": "https://deno.land/x/zod@v3.21.4/mod.ts" }, - "compilerOptions": { "jsx": "react-jsx", "jsxImportSource": "preact" }, - "exclude": ["**/_fresh/*"] + "scopes": { + "https://deno.land/x/emoji/": { + "https://deno.land/x/my-library@1.0.0/mod.ts": "./patched/mod.ts" + } + }, + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "preact" + }, + "exclude": [ + "**/_fresh/*" + ] } diff --git a/fresh.gen.ts b/fresh.gen.ts index d306caf..b19ac10 100644 --- a/fresh.gen.ts +++ b/fresh.gen.ts @@ -58,7 +58,7 @@ import * as $KMenu_commands_create_series from "./islands/KMenu/commands/create_ import * as $KMenu_types from "./islands/KMenu/types.ts"; import * as $Recommendations from "./islands/Recommendations.tsx"; import * as $Search from "./islands/Search.tsx"; -import { type Manifest } from "$fresh/server.ts"; +import type { Manifest } from "$fresh/server.ts"; const manifest = { routes: { diff --git a/lib/documents.ts b/lib/documents.ts index 43dd7fd..cc63e4f 100644 --- a/lib/documents.ts +++ b/lib/documents.ts @@ -1,5 +1,5 @@ import { unified } from "https://esm.sh/unified@10.1.2"; -import { render } from "https://deno.land/x/gfm@0.2.5/mod.ts"; +import { render } from "gfm"; import "https://esm.sh/prismjs@1.29.0/components/prism-typescript?no-check"; import "https://esm.sh/prismjs@1.29.0/components/prism-bash?no-check"; import "https://esm.sh/prismjs@1.29.0/components/prism-rust?no-check"; diff --git a/lib/hooks/useEventListener.ts b/lib/hooks/useEventListener.ts index 445df3f..2799729 100644 --- a/lib/hooks/useEventListener.ts +++ b/lib/hooks/useEventListener.ts @@ -3,7 +3,7 @@ import { useEffect, useRef } from "preact/hooks"; export function useEventListener( eventName: string, handler: (event: T) => void, - element: Window | HTMLElement = window, + element: Window | HTMLElement = globalThis, ) { // Create a ref that stores handler const savedHandler = useRef<(event: Event) => void>(); diff --git a/routes/_layout.tsx b/routes/_layout.tsx index b60ee99..851ce7c 100644 --- a/routes/_layout.tsx +++ b/routes/_layout.tsx @@ -1,6 +1,6 @@ import { PageProps } from "$fresh/server.ts"; import { resources } from "@lib/resources.ts"; -import { CSS, KATEX_CSS } from "https://deno.land/x/gfm@0.2.5/mod.ts"; +import { CSS, KATEX_CSS } from "gfm"; import { Head } from "$fresh/runtime.ts"; import { Emoji } from "@components/Emoji.tsx"; diff --git a/routes/api/articles/create/index.ts b/routes/api/articles/create/index.ts index 3354ab0..d88393e 100644 --- a/routes/api/articles/create/index.ts +++ b/routes/api/articles/create/index.ts @@ -5,7 +5,7 @@ import { AccessDeniedError, BadRequestError } from "@lib/errors.ts"; import { createStreamResponse, isValidUrl } from "@lib/helpers.ts"; import * as openai from "@lib/openai.ts"; -import tds from "https://cdn.skypack.dev/turndown@7.1.1"; +import tds from "https://cdn.skypack.dev/turndown@7.2.0"; import { Article, createArticle } from "@lib/resource/articles.ts"; import { getYoutubeVideoDetails } from "@lib/youtube.ts"; import { extractYoutubeId, isYoutubeLink } from "@lib/string.ts"; @@ -21,8 +21,6 @@ async function processCreateArticle( streamResponse: ReturnType; }, ) { - - log.info("create article from url", { url: fetchUrl }); streamResponse.enqueue("downloading article"); diff --git a/routes/api/images/index.ts b/routes/api/images/index.ts index 4e0f631..5a28917 100644 --- a/routes/api/images/index.ts +++ b/routes/api/images/index.ts @@ -4,7 +4,7 @@ import { initialize, MagickFormat, MagickGeometry, -} from "https://deno.land/x/imagemagick_deno@0.0.25/mod.ts"; +} from "https://deno.land/x/imagemagick_deno@0.0.31/mod.ts"; import { parseMediaType } from "https://deno.land/std@0.224.0/media_types/parse_media_type.ts"; import * as cache from "@lib/cache/image.ts";