From 492200a42bd7d2b00f400261e9d3b6404952d875 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Fri, 11 Oct 2024 22:35:32 -0700 Subject: [PATCH] fix vite and solid in dev Inclusion of @astrojs/markdown-remark caused errors that cause solid and vite to fail to load in dev. It's stripped in build. --- src/components/type/TypeDetails.astro | 4 ++-- src/config/io/helpers.ts | 8 -------- src/config/io/markdown.ts | 1 - src/pages/docs/types/[type]/[name].astro | 8 +++----- src/pages/docs/types/[type]/index.astro | 4 ++-- 5 files changed, 7 insertions(+), 18 deletions(-) diff --git a/src/components/type/TypeDetails.astro b/src/components/type/TypeDetails.astro index ff8ef2f..cb7601e 100644 --- a/src/components/type/TypeDetails.astro +++ b/src/components/type/TypeDetails.astro @@ -1,5 +1,5 @@ --- -import { processQsMarkdown } from "@config/io/helpers" +import { processMarkdown } from "@config/io/markdown" export interface Props { markdown?: string, @@ -7,7 +7,7 @@ export interface Props { const { markdown } = Astro.props; -const html = markdown ? await processQsMarkdown(markdown) : null; +const html = markdown ? await processMarkdown(markdown) : null; ---
{html ?
: No details provided} diff --git a/src/config/io/helpers.ts b/src/config/io/helpers.ts index fef5515..d3a5282 100644 --- a/src/config/io/helpers.ts +++ b/src/config/io/helpers.ts @@ -1,5 +1,3 @@ -import * as markdownUtils from "./markdown.ts"; - import { // Flag, PowerCord, @@ -75,12 +73,6 @@ export function groupRoutes(routes: RouteData[]): GroupedRoutes { }, defaultValue); } -export async function processQsMarkdown( - markdown: string -): Promise { - return await markdownUtils.processMarkdown(markdown); -} - export function getQMLTypeLinkObject(unparsed: string) { const isLocal = unparsed.startsWith("MQS_") ? "local" : false; const isQT = unparsed.startsWith("MQT_") ? "qt" : false; diff --git a/src/config/io/markdown.ts b/src/config/io/markdown.ts index 5ba997f..479cb1f 100644 --- a/src/config/io/markdown.ts +++ b/src/config/io/markdown.ts @@ -96,7 +96,6 @@ export const markdownConfig: AstroMarkdownOptions = { remarkPlugins: [[remarkAlert, { legacyTitle: true }]], rehypePlugins: [ // FIXME: incompatible types between unified/Plugin and Astro/RehypePlugin - // @ts-expect-error [sectionize as RehypePlugin, { idPropertyName: "id" }], rehypeRewriteTypelinks, ], diff --git a/src/pages/docs/types/[type]/[name].astro b/src/pages/docs/types/[type]/[name].astro index 5b92998..b827aae 100644 --- a/src/pages/docs/types/[type]/[name].astro +++ b/src/pages/docs/types/[type]/[name].astro @@ -1,8 +1,6 @@ --- -import { - processQsMarkdown, - getQMLTypeLink, -} from "@config/io/helpers"; +import { getQMLTypeLink } from "@config/io/helpers"; +import { processMarkdown } from "@config/io/markdown"; import { generateTypeData } from "@config/io/generateTypeData"; import { Flag } from "@icons"; import DocsLayout from "@layouts/DocsLayout.astro"; @@ -50,7 +48,7 @@ const sidebarData = { const superLink = data.super ? getQMLTypeLink(data.super) : null; const details = data.details - ? await processQsMarkdown(data.details) + ? await processMarkdown(data.details) : null; --- diff --git a/src/pages/docs/types/[type]/index.astro b/src/pages/docs/types/[type]/index.astro index 5c63944..2072ae0 100644 --- a/src/pages/docs/types/[type]/index.astro +++ b/src/pages/docs/types/[type]/index.astro @@ -1,7 +1,7 @@ --- import DocsLayout from "@layouts/DocsLayout.astro"; import { generateTypeData } from "@config/io/generateTypeData"; -import { processQsMarkdown } from "@src/config/io/helpers"; +import { processMarkdown } from "@src/config/io/markdown"; export async function getStaticPaths() { const routes = await generateTypeData(); @@ -26,7 +26,7 @@ export async function getStaticPaths() { } const { route, children } = Astro.props; const details = route.data.details - ? await processQsMarkdown(route.data.details) + ? await processMarkdown(route.data.details) : null; ---