From 9376ea79f182079c4f808c922acb273fee885659 Mon Sep 17 00:00:00 2001 From: Jo Franchetti Date: Tue, 5 Nov 2024 14:40:16 +0000 Subject: [PATCH] remove deps and esm imports, swap over to npm --- deno.json | 8 ++++---- deno.lock | 25 ++++++++++++++++++++++++- deps.ts | 42 ------------------------------------------ src/blog.tsx | 6 +++--- 4 files changed, 31 insertions(+), 50 deletions(-) delete mode 100644 deps.ts diff --git a/deno.json b/deno.json index 28fae66..af83c68 100644 --- a/deno.json +++ b/deno.json @@ -18,9 +18,9 @@ "@denoland/htm/plugins/unocss": "https://deno.land/x/htm@0.1.3/plugins/unocss.ts", "@denoland/g_a": "https://deno.land/x/g_a@0.1.2/mod.ts", "@githubcontent/kt3k/callsites": "https://raw.githubusercontent.com/kt3k/callsites/v1.0.0/mod.ts", - "@esm/feed": "https://esm.sh/feed@4.2.2", - "@esm/remove-markdown": "https://esm.sh/remove-markdown@0.5.0", - "@esm/prism-c": "https://esm.sh/prismjs@1.29.0/components/prism-c?no-check", - "@outdated/std-http": "https://deno.land/std@0.193.0/http/mod.ts" + "@outdated/std-http": "https://deno.land/std@0.193.0/http/mod.ts", + "feed": "npm:feed@^4.2.2", + "prismjs": "npm:prismjs@^1.29.0", + "remove-markdown": "npm:remove-markdown@^0.5.5" } } diff --git a/deno.lock b/deno.lock index 8fc28b9..b6b3e2c 100644 --- a/deno.lock +++ b/deno.lock @@ -23,6 +23,7 @@ "jsr:@std/toml@^1.0.1": "1.0.1", "jsr:@std/yaml@^1.0.5": "1.0.5", "npm:@types/node@*": "22.5.4", + "npm:feed@^4.2.2": "4.2.2", "npm:github-slugger@2": "2.0.0", "npm:he@^1.2.0": "1.2.0", "npm:katex@0.16": "0.16.11", @@ -31,6 +32,7 @@ "npm:marked-gfm-heading-id@^3.1.0": "3.2.0_marked@12.0.2", "npm:marked@12": "12.0.2", "npm:prismjs@^1.29.0": "1.29.0", + "npm:remove-markdown@~0.5.5": "0.5.5", "npm:sanitize-html@^2.13.0": "2.13.1" }, "jsr": { @@ -181,6 +183,12 @@ "escape-string-regexp@4.0.0": { "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" }, + "feed@4.2.2": { + "integrity": "sha512-u5/sxGfiMfZNtJ3OvQpXcvotFpYkL0n9u9mM2vkui2nGo8b4wvDkJ8gAkYqbA8QpGyFCv3RK0Z+Iv+9veCS9bQ==", + "dependencies": [ + "xml-js" + ] + }, "github-slugger@2.0.0": { "integrity": "sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==" }, @@ -247,6 +255,9 @@ "prismjs@1.29.0": { "integrity": "sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==" }, + "remove-markdown@0.5.5": { + "integrity": "sha512-lMR8tOtDqazFT6W2bZidoXwkptMdF3pCxpri0AEokHg0sZlC2GdoLqnoaxsEj1o7/BtXV1MKtT3YviA1t7rW7g==" + }, "sanitize-html@2.13.1": { "integrity": "sha512-ZXtKq89oue4RP7abL9wp/9URJcqQNABB5GGJ2acW1sdO8JTVl92f4ygD7Yc9Ze09VAZhnt2zegeU0tbNsdcLYg==", "dependencies": [ @@ -258,11 +269,20 @@ "postcss" ] }, + "sax@1.4.1": { + "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==" + }, "source-map-js@1.2.1": { "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==" }, "undici-types@6.19.8": { "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==" + }, + "xml-js@1.6.11": { + "integrity": "sha512-7rVi2KMfwfWFl+GpPg6m80IVMWXLRjO+PxTq7V2CDhoGak0wzYzFgUY2m4XJ47OGdXd8eLE8EmwfAmdjw7lC1g==", + "dependencies": [ + "sax" + ] } }, "redirects": { @@ -396,7 +416,10 @@ "jsr:@std/fs@^1.0.5", "jsr:@std/http@^1.0.9", "jsr:@std/path@^1.0.8", - "jsr:@std/testing@^1.0.4" + "jsr:@std/testing@^1.0.4", + "npm:feed@^4.2.2", + "npm:prismjs@^1.29.0", + "npm:remove-markdown@~0.5.5" ] } } diff --git a/deps.ts b/deps.ts deleted file mode 100644 index d10e46c..0000000 --- a/deps.ts +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2022 the Deno authors. All rights reserved. MIT license. - -export { serveDir } from "https://deno.land/std@0.193.0/http/file_server.ts"; -export { walk } from "https://deno.land/std@0.193.0/fs/walk.ts"; -export { - dirname, - fromFileUrl, - join, - relative, -} from "https://deno.land/std@0.193.0/path/mod.ts"; -export { - type ConnInfo, - serve, -} from "https://deno.land/std@0.193.0/http/mod.ts"; -export { extract as frontMatter } from "https://deno.land/std@0.193.0/front_matter/any.ts"; - -export * as gfm from "jsr:@deno/gfm@0.10.0"; -export { Fragment, h } from "https://deno.land/x/htm@0.1.3/mod.ts"; -export { - default as html, - type HtmlOptions, - type VNode, -} from "https://deno.land/x/htm@0.1.3/html.tsx"; -import UnoCSS from "https://deno.land/x/htm@0.1.3/plugins/unocss.ts"; -import ColorScheme from "https://deno.land/x/htm@0.1.3/plugins/color-scheme.ts"; - -export { - createReporter, - type Reporter as GaReporter, -} from "https://deno.land/x/g_a@0.1.2/mod.ts"; -export { default as callsites } from "https://raw.githubusercontent.com/kt3k/callsites/v1.0.0/mod.ts"; -export { Feed, type Item as FeedItem } from "https://esm.sh/feed@4.2.2"; -export { default as removeMarkdown } from "https://esm.sh/remove-markdown@0.5.0"; - -// Add syntax highlighting support for C by default -import "https://esm.sh/prismjs@1.29.0/components/prism-c?no-check"; - -export { ColorScheme, UnoCSS }; -export type UnoConfig = typeof UnoCSS extends ( - arg: infer P | undefined, -) => unknown ? P - : never; diff --git a/src/blog.tsx b/src/blog.tsx index c14055a..332bf1c 100644 --- a/src/blog.tsx +++ b/src/blog.tsx @@ -18,8 +18,8 @@ import { default as html, type HtmlOptions } from "@denoland/htm"; import { createReporter } from "@denoland/g_a"; import { default as callsites } from "@githubcontent/kt3k/callsites"; -import { Feed, type Item as FeedItem } from "@esm/feed"; -import { default as removeMarkdown } from "@esm/remove-markdown"; +import { Feed, type Item as FeedItem } from "feed"; +import { default as removeMarkdown } from "remove-markdown"; import UnoCSS from "@denoland/htm/plugins/unocss"; import ColorScheme from "@denoland/htm/plugins/color-scheme"; @@ -36,7 +36,7 @@ import type { import { WalkEntry } from "@std/fs"; // Add syntax highlighting support for C by default -import "@esm/prism-c"; +import "prismjs"; export { Fragment, h };