From 7ffd74988abcde0d70d9a166d86cb28c1f2cd271 Mon Sep 17 00:00:00 2001 From: Daniel Lehr Date: Mon, 11 Nov 2024 15:54:32 +0100 Subject: [PATCH] Allow static content generation in MDX files --- packages/zudoku/package.json | 5 + packages/zudoku/src/vite/plugin-mdx.ts | 8 +- .../zudoku/src/vite/remarkStaticGeneration.ts | 145 ++++++++++++++ pnpm-lock.yaml | 184 +++++++++--------- 4 files changed, 251 insertions(+), 91 deletions(-) create mode 100644 packages/zudoku/src/vite/remarkStaticGeneration.ts diff --git a/packages/zudoku/package.json b/packages/zudoku/package.json index 58cddbbe..fc10477a 100644 --- a/packages/zudoku/package.json +++ b/packages/zudoku/package.json @@ -183,6 +183,7 @@ "cmdk": "1.0.4", "dotenv": "16.4.5", "embla-carousel-react": "8.3.1", + "estree-util-value-to-estree": "3.2.1", "express": "4.21.1", "glob": "11.0.0", "graphql": "16.9.0", @@ -224,6 +225,7 @@ "unist-util-visit": "5.0.0", "urql": "4.1.0", "vaul": "1.1.0", + "vfile": "6.0.3", "vite": "5.4.9", "yaml": "2.6.0", "yargs": "17.7.2", @@ -232,15 +234,18 @@ "zustand": "5.0.0" }, "devDependencies": { + "@types/estree": "1.0.6", "@types/express": "5.0.0", "@types/har-format": "1.2.15", "@types/json-schema": "7.0.15", + "@types/mdast": "4.0.4", "@types/mdx": "2.0.13", "@types/node": "20.16.11", "@types/object-hash": "3.0.6", "@types/react-is": "18.3.0", "@types/semver": "7.5.8", "@types/yargs": "17.0.33", + "mdast-util-mdx": "3.0.0", "react": "18.3.1", "react-dom": "18.3.1", "rollup-plugin-visualizer": "5.12.0", diff --git a/packages/zudoku/src/vite/plugin-mdx.ts b/packages/zudoku/src/vite/plugin-mdx.ts index 3345c979..39dab16b 100644 --- a/packages/zudoku/src/vite/plugin-mdx.ts +++ b/packages/zudoku/src/vite/plugin-mdx.ts @@ -2,6 +2,7 @@ import rehypeMetaAsAttributes from "@lekoarts/rehype-meta-as-attributes"; import mdx, { type Options } from "@mdx-js/rollup"; import withToc from "@stefanprobst/rehype-extract-toc"; import withTocExport from "@stefanprobst/rehype-extract-toc/mdx"; +import type { Root } from "mdast"; import path from "node:path"; import rehypeSlug from "rehype-slug"; import remarkComment from "remark-comment"; @@ -13,18 +14,18 @@ import remarkMdxFrontmatter from "remark-mdx-frontmatter"; import { visit } from "unist-util-visit"; import { type Plugin } from "vite"; import { type ZudokuPluginOptions } from "../config/config.js"; +import { remarkStaticGeneration } from "./remarkStaticGeneration.js"; // eslint-disable-next-line @typescript-eslint/no-explicit-any const rehypeCodeBlockPlugin = () => (tree: any) => { visit(tree, "element", (node, index, parent) => { - if (node.tagName === "code") { + if (node.type === "element" && node.tagName === "code") { node.properties.inline = parent?.tagName !== "pre"; } }); }; -// eslint-disable-next-line @typescript-eslint/no-explicit-any -const remarkLinkRewritePlugin = () => (tree: any) => { +const remarkLinkRewritePlugin = () => (tree: Root) => { visit(tree, "link", (node) => { if (!node.url) return; @@ -70,6 +71,7 @@ const viteMdxPlugin = (getConfig: () => ZudokuPluginOptions): Plugin => { mdxExtensions: [".md", ".mdx"], format: "mdx", remarkPlugins: [ + remarkStaticGeneration, remarkComment, remarkGfm, remarkFrontmatter, diff --git a/packages/zudoku/src/vite/remarkStaticGeneration.ts b/packages/zudoku/src/vite/remarkStaticGeneration.ts new file mode 100644 index 00000000..19b2eb0b --- /dev/null +++ b/packages/zudoku/src/vite/remarkStaticGeneration.ts @@ -0,0 +1,145 @@ +import { type ImportDeclaration, Program } from "estree"; +import { valueToEstree } from "estree-util-value-to-estree"; +import { Root } from "mdast"; +import type { MdxjsEsm } from "mdast-util-mdx"; +import vm, { type Context as VmContext } from "node:vm"; +import { SKIP, visit } from "unist-util-visit"; +import { VFile } from "vfile"; + +const FUNCTION_NAME = "_static"; +const VARIABLE_NAME = "STATIC_CONTENT"; + +const isStaticExport = (program: Program) => { + for (const node of program.body) { + if (node.type === "ExportNamedDeclaration" && node.declaration) { + const decl = node.declaration; + if (decl.type === "VariableDeclaration") { + // Check variable declarations like: export const _static = () => { ... } + for (const declarator of decl.declarations) { + if ( + declarator.id.type === "Identifier" && + declarator.id.name === FUNCTION_NAME && + declarator.init?.type === "ArrowFunctionExpression" + ) { + return true; + } + } + } else if ( + decl.type === "FunctionDeclaration" && + decl.id.name === FUNCTION_NAME + ) { + // Check function declarations like: export function _static() { ... } + return true; + } + } + } + return false; +}; + +const executeFunction = async ( + file: VFile, + code: string, + importNodes: ImportDeclaration[], +) => { + const context: VmContext = { + result: "", + process, + console, + }; + + code = code.replace(/^\s*export/, ""); + + for (const { source, specifiers } of importNodes) { + const modulePath = source.value; + if (typeof modulePath !== "string") continue; + + const module = await import(modulePath); + + for (const specifier of specifiers) { + const localName = specifier.local.name; + switch (specifier.type) { + case "ImportSpecifier": { + if (specifier.imported.type !== "Identifier") continue; + const importedName = specifier.imported.name; + context[localName] = module[importedName]; + break; + } + case "ImportDefaultSpecifier": + context[localName] = module.default ?? module; + break; + case "ImportNamespaceSpecifier": + context[localName] = module; + break; + } + } + } + + const script = new vm.Script(` + (async () => { + result = await (async () => { ${code}; return ${FUNCTION_NAME}(); })(); + })(); + `); + + const prevCwd = process.cwd(); + // Run VM relative to the file's directory + process.chdir(file.dirname ?? file.cwd); + await script.runInNewContext(context); + process.chdir(prevCwd); + + return context.result; +}; + +export const remarkStaticGeneration = () => async (tree: Root, file: VFile) => { + const collectedImports = new Set(); + + const imports: ImportDeclaration[] = []; + const nodesToProcess: MdxjsEsm[] = []; + + visit(tree, "mdxjsEsm", (node, index) => { + const innerTree = node.data?.estree; + if (!innerTree) return; + + if (innerTree.body[0]?.type === "ImportDeclaration") { + imports.push(innerTree.body[0]); + collectedImports.add(node.value); + } + + if (isStaticExport(innerTree)) { + nodesToProcess.push(node); + return SKIP; + } + }); + + for (const node of nodesToProcess) { + const executed = await executeFunction(file, node.value, imports); + if (!executed) continue; + + const estreeValue = valueToEstree(executed, { + preserveReferences: true, + instanceAsObject: true, + }); + tree.children.unshift({ + type: "mdxjsEsm", + value: "", + data: { + estree: { + type: "Program", + body: [ + { + type: "VariableDeclaration", + declarations: [ + { + type: "VariableDeclarator", + id: { type: "Identifier", name: VARIABLE_NAME }, + init: estreeValue, + }, + ], + kind: "const", + }, + ], + sourceType: "module", + }, + }, + }); + } +}; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 68e39f44..75fecf77 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -437,6 +437,9 @@ importers: embla-carousel-react: specifier: 8.3.1 version: 8.3.1(react@18.3.1) + estree-util-value-to-estree: + specifier: 3.2.1 + version: 3.2.1 express: specifier: 4.21.1 version: 4.21.1 @@ -560,6 +563,9 @@ importers: vaul: specifier: 1.1.0 version: 1.1.0(@types/react-dom@18.3.1)(@types/react@18.3.11)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + vfile: + specifier: 6.0.3 + version: 6.0.3 vite: specifier: 5.4.9 version: 5.4.9(@types/node@20.16.11) @@ -586,6 +592,9 @@ importers: specifier: ^0.2.289 version: 0.2.289(@internationalized/date@3.5.5)(@types/react@18.3.11)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(typescript@5.6.3) devDependencies: + '@types/estree': + specifier: 1.0.6 + version: 1.0.6 '@types/express': specifier: 5.0.0 version: 5.0.0 @@ -595,6 +604,9 @@ importers: '@types/json-schema': specifier: 7.0.15 version: 7.0.15 + '@types/mdast': + specifier: 4.0.4 + version: 4.0.4 '@types/mdx': specifier: 2.0.13 version: 2.0.13 @@ -613,6 +625,9 @@ importers: '@types/yargs': specifier: 17.0.33 version: 17.0.33 + mdast-util-mdx: + specifier: 3.0.0 + version: 3.0.0 react: specifier: 18.3.1 version: 18.3.1 @@ -3642,9 +3657,6 @@ packages: '@types/estree-jsx@1.0.5': resolution: {integrity: sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==} - '@types/estree@1.0.5': - resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} - '@types/estree@1.0.6': resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} @@ -3684,8 +3696,8 @@ packages: '@types/mdast@3.0.15': resolution: {integrity: sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==} - '@types/mdast@4.0.3': - resolution: {integrity: sha512-LsjtqsyF+d2/yFOYaN22dHZI1Cpwkrj+g06G8+qtUKlhovPW89YhqSnfKtMbkgmEtYpH2gydRNULd6y8mciAFg==} + '@types/mdast@4.0.4': + resolution: {integrity: sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==} '@types/mdx@2.0.13': resolution: {integrity: sha512-+OWZQfAYyio6YkJb3HLxDrvnx6SWWDbC0zVPfBRzUk0/nqoDyf6dNxQi3eArPe8rJ473nobTMQ/8Zk+LxJ+Yuw==} @@ -5513,8 +5525,8 @@ packages: resolution: {integrity: sha512-Y+ughcF9jSUJvncXwqRageavjrNPAI+1M/L3BI3PyLp1nmgYTGUXU6t5z1Y7OWuThoDdhPME07bQU+d5LxdJqw==} engines: {node: '>=12.0.0'} - estree-util-value-to-estree@3.1.1: - resolution: {integrity: sha512-5mvUrF2suuv5f5cGDnDphIy4/gW86z82kl5qG6mM9z04SEQI4FB5Apmaw/TGEf3l55nLtMs5s51dmhUzvAHQCA==} + estree-util-value-to-estree@3.2.1: + resolution: {integrity: sha512-Vt2UOjyPbNQQgT5eJh+K5aATti0OjCIAGc9SgMdOFYbohuifsWclR74l0iZTJwePMgWYdX1hlVS+dedH9XV8kw==} estree-util-visit@2.0.0: resolution: {integrity: sha512-m5KgiH85xAhhW8Wta0vShLcUvOsh3LLPI2YVwcbio1l7E09NTLL1EyMZFM1OyWowoH0skScNbhOPl4kcBgzTww==} @@ -8906,8 +8918,8 @@ packages: vfile@5.3.7: resolution: {integrity: sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==} - vfile@6.0.1: - resolution: {integrity: sha512-1bYqc7pt6NIADBJ98UiG0Bn/CHIVOoZ/IyEkqIruLg0mE1BKzkOXY2D6CSqQIcKqgadppE5lrxgWXJmXd7zZJw==} + vfile@6.0.3: + resolution: {integrity: sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==} vite-node@1.6.0: resolution: {integrity: sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==} @@ -11245,7 +11257,7 @@ snapshots: '@mdx-js/mdx@3.0.1': dependencies: - '@types/estree': 1.0.5 + '@types/estree': 1.0.6 '@types/estree-jsx': 1.0.5 '@types/hast': 3.0.4 '@types/mdx': 2.0.13 @@ -11267,7 +11279,7 @@ snapshots: unist-util-position-from-estree: 2.0.0 unist-util-stringify-position: 4.0.0 unist-util-visit: 5.0.0 - vfile: 6.0.1 + vfile: 6.0.3 transitivePeerDependencies: - supports-color @@ -11283,7 +11295,7 @@ snapshots: '@rollup/pluginutils': 5.1.0(rollup@4.24.0) rollup: 4.24.0 source-map: 0.7.4 - vfile: 6.0.1 + vfile: 6.0.3 transitivePeerDependencies: - supports-color @@ -12692,7 +12704,7 @@ snapshots: '@rollup/pluginutils@5.1.0(rollup@4.24.0)': dependencies: - '@types/estree': 1.0.5 + '@types/estree': 1.0.6 estree-walker: 2.0.2 picomatch: 2.3.1 optionalDependencies: @@ -12892,7 +12904,7 @@ snapshots: '@types/acorn@4.0.6': dependencies: - '@types/estree': 1.0.5 + '@types/estree': 1.0.6 '@types/async-retry@1.4.2': dependencies: @@ -12942,9 +12954,7 @@ snapshots: '@types/estree-jsx@1.0.5': dependencies: - '@types/estree': 1.0.5 - - '@types/estree@1.0.5': {} + '@types/estree': 1.0.6 '@types/estree@1.0.6': {} @@ -12970,7 +12980,7 @@ snapshots: '@types/hast@3.0.4': dependencies: - '@types/unist': 3.0.2 + '@types/unist': 3.0.3 '@types/http-errors@2.0.4': {} @@ -12993,9 +13003,9 @@ snapshots: '@types/unist': 2.0.10 optional: true - '@types/mdast@4.0.3': + '@types/mdast@4.0.4': dependencies: - '@types/unist': 3.0.2 + '@types/unist': 3.0.3 '@types/mdx@2.0.13': {} @@ -15604,7 +15614,7 @@ snapshots: debug: 4.3.7 enhanced-resolve: 5.17.1 eslint: 8.57.0 - eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.13.0(eslint@8.57.0)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@8.13.0(eslint@8.57.0)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.13.0(eslint@8.57.0)(typescript@5.6.3))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) + eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.13.0(eslint@8.57.0)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.13.0(eslint@8.57.0)(typescript@5.6.3))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) fast-glob: 3.3.1 get-tsconfig: 4.8.1 @@ -15616,7 +15626,7 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-module-utils@2.12.0(@typescript-eslint/parser@8.13.0(eslint@8.57.0)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@8.13.0(eslint@8.57.0)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.13.0(eslint@8.57.0)(typescript@5.6.3))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0): + eslint-module-utils@2.12.0(@typescript-eslint/parser@8.13.0(eslint@8.57.0)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): dependencies: debug: 3.2.7 optionalDependencies: @@ -15638,7 +15648,7 @@ snapshots: doctrine: 2.1.0 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.13.0(eslint@8.57.0)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@8.13.0(eslint@8.57.0)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.13.0(eslint@8.57.0)(typescript@5.6.3))(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) + eslint-module-utils: 2.12.0(@typescript-eslint/parser@8.13.0(eslint@8.57.0)(typescript@5.6.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) hasown: 2.0.2 is-core-module: 2.15.1 is-glob: 4.0.3 @@ -15775,7 +15785,7 @@ snapshots: estree-util-attach-comments@3.0.0: dependencies: - '@types/estree': 1.0.5 + '@types/estree': 1.0.6 estree-util-build-jsx@3.0.1: dependencies: @@ -15798,10 +15808,9 @@ snapshots: dependencies: is-plain-obj: 3.0.0 - estree-util-value-to-estree@3.1.1: + estree-util-value-to-estree@3.2.1: dependencies: - '@types/estree': 1.0.5 - is-plain-obj: 4.1.0 + '@types/estree': 1.0.6 estree-util-visit@2.0.0: dependencies: @@ -15812,7 +15821,7 @@ snapshots: estree-walker@3.0.3: dependencies: - '@types/estree': 1.0.5 + '@types/estree': 1.0.6 esutils@2.0.3: {} @@ -16337,11 +16346,11 @@ snapshots: hast-util-from-parse5@8.0.1: dependencies: '@types/hast': 3.0.4 - '@types/unist': 3.0.2 + '@types/unist': 3.0.3 devlop: 1.1.0 hastscript: 8.0.0 property-information: 6.5.0 - vfile: 6.0.1 + vfile: 6.0.3 vfile-location: 5.0.3 web-namespaces: 2.0.1 @@ -16379,7 +16388,7 @@ snapshots: hast-util-raw@9.0.4: dependencies: '@types/hast': 3.0.4 - '@types/unist': 3.0.2 + '@types/unist': 3.0.3 '@ungap/structured-clone': 1.2.0 hast-util-from-parse5: 8.0.1 hast-util-to-parse5: 8.0.0 @@ -16388,13 +16397,13 @@ snapshots: parse5: 7.1.2 unist-util-position: 5.0.0 unist-util-visit: 5.0.0 - vfile: 6.0.1 + vfile: 6.0.3 web-namespaces: 2.0.1 zwitch: 2.0.4 hast-util-to-estree@3.1.0: dependencies: - '@types/estree': 1.0.5 + '@types/estree': 1.0.6 '@types/estree-jsx': 1.0.5 '@types/hast': 3.0.4 comma-separated-tokens: 2.0.3 @@ -16415,9 +16424,9 @@ snapshots: hast-util-to-jsx-runtime@2.3.0: dependencies: - '@types/estree': 1.0.5 + '@types/estree': 1.0.6 '@types/hast': 3.0.4 - '@types/unist': 3.0.2 + '@types/unist': 3.0.3 comma-separated-tokens: 2.0.3 devlop: 1.1.0 estree-util-is-identifier-name: 3.0.0 @@ -16791,7 +16800,7 @@ snapshots: is-reference@3.0.2: dependencies: - '@types/estree': 1.0.5 + '@types/estree': 1.0.6 is-regex@1.1.4: dependencies: @@ -17170,8 +17179,8 @@ snapshots: mdast-util-directive@3.0.0: dependencies: - '@types/mdast': 4.0.3 - '@types/unist': 3.0.2 + '@types/mdast': 4.0.4 + '@types/unist': 3.0.3 devlop: 1.1.0 mdast-util-from-markdown: 2.0.0 mdast-util-to-markdown: 2.1.0 @@ -17183,7 +17192,7 @@ snapshots: mdast-util-find-and-replace@3.0.1: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 escape-string-regexp: 5.0.0 unist-util-is: 6.0.0 unist-util-visit-parents: 6.0.1 @@ -17208,8 +17217,8 @@ snapshots: mdast-util-from-markdown@2.0.0: dependencies: - '@types/mdast': 4.0.3 - '@types/unist': 3.0.2 + '@types/mdast': 4.0.4 + '@types/unist': 3.0.3 decode-named-character-reference: 1.0.2(patch_hash=djcvjv2zk32xfqoxzwsbvomeg4) devlop: 1.1.0 mdast-util-to-string: 4.0.0 @@ -17225,7 +17234,7 @@ snapshots: mdast-util-frontmatter@2.0.1: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 devlop: 1.1.0 escape-string-regexp: 5.0.0 mdast-util-from-markdown: 2.0.0 @@ -17236,7 +17245,7 @@ snapshots: mdast-util-gfm-autolink-literal@2.0.0: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 ccount: 2.0.1 devlop: 1.1.0 mdast-util-find-and-replace: 3.0.1 @@ -17244,7 +17253,7 @@ snapshots: mdast-util-gfm-footnote@2.0.0: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 devlop: 1.1.0 mdast-util-from-markdown: 2.0.0 mdast-util-to-markdown: 2.1.0 @@ -17254,7 +17263,7 @@ snapshots: mdast-util-gfm-strikethrough@2.0.0: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 mdast-util-from-markdown: 2.0.0 mdast-util-to-markdown: 2.1.0 transitivePeerDependencies: @@ -17262,7 +17271,7 @@ snapshots: mdast-util-gfm-table@2.0.0: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 devlop: 1.1.0 markdown-table: 3.0.3 mdast-util-from-markdown: 2.0.0 @@ -17272,7 +17281,7 @@ snapshots: mdast-util-gfm-task-list-item@2.0.0: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 devlop: 1.1.0 mdast-util-from-markdown: 2.0.0 mdast-util-to-markdown: 2.1.0 @@ -17295,7 +17304,7 @@ snapshots: dependencies: '@types/estree-jsx': 1.0.5 '@types/hast': 3.0.4 - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 devlop: 1.1.0 mdast-util-from-markdown: 2.0.0 mdast-util-to-markdown: 2.1.0 @@ -17306,8 +17315,8 @@ snapshots: dependencies: '@types/estree-jsx': 1.0.5 '@types/hast': 3.0.4 - '@types/mdast': 4.0.3 - '@types/unist': 3.0.2 + '@types/mdast': 4.0.4 + '@types/unist': 3.0.3 ccount: 2.0.1 devlop: 1.1.0 mdast-util-from-markdown: 2.0.0 @@ -17334,7 +17343,7 @@ snapshots: dependencies: '@types/estree-jsx': 1.0.5 '@types/hast': 3.0.4 - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 devlop: 1.1.0 mdast-util-from-markdown: 2.0.0 mdast-util-to-markdown: 2.1.0 @@ -17343,7 +17352,7 @@ snapshots: mdast-util-phrasing@4.1.0: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 unist-util-is: 6.0.0 mdast-util-to-hast@12.3.0: @@ -17361,19 +17370,19 @@ snapshots: mdast-util-to-hast@13.1.0: dependencies: '@types/hast': 3.0.4 - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 '@ungap/structured-clone': 1.2.0 devlop: 1.1.0 micromark-util-sanitize-uri: 2.0.0 trim-lines: 3.0.1 unist-util-position: 5.0.0 unist-util-visit: 5.0.0 - vfile: 6.0.1 + vfile: 6.0.3 mdast-util-to-markdown@2.1.0: dependencies: - '@types/mdast': 4.0.3 - '@types/unist': 3.0.2 + '@types/mdast': 4.0.4 + '@types/unist': 3.0.3 longest-streak: 3.1.0 mdast-util-phrasing: 4.1.0 mdast-util-to-string: 4.0.0 @@ -17388,7 +17397,7 @@ snapshots: mdast-util-to-string@4.0.0: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 media-typer@0.3.0: {} @@ -17528,7 +17537,7 @@ snapshots: micromark-extension-mdx-expression@3.0.0: dependencies: - '@types/estree': 1.0.5 + '@types/estree': 1.0.6 devlop: 1.1.0 micromark-factory-mdx-expression: 2.0.1 micromark-factory-space: 2.0.0 @@ -17540,7 +17549,7 @@ snapshots: micromark-extension-mdx-jsx@3.0.0: dependencies: '@types/acorn': 4.0.6 - '@types/estree': 1.0.5 + '@types/estree': 1.0.6 devlop: 1.1.0 estree-util-is-identifier-name: 3.0.0 micromark-factory-mdx-expression: 2.0.1 @@ -17556,7 +17565,7 @@ snapshots: micromark-extension-mdxjs-esm@3.0.0: dependencies: - '@types/estree': 1.0.5 + '@types/estree': 1.0.6 devlop: 1.1.0 micromark-core-commonmark: 2.0.0 micromark-util-character: 2.1.0 @@ -17607,7 +17616,7 @@ snapshots: micromark-factory-mdx-expression@2.0.1: dependencies: - '@types/estree': 1.0.5 + '@types/estree': 1.0.6 devlop: 1.1.0 micromark-util-character: 2.1.0 micromark-util-events-to-acorn: 2.0.2 @@ -17731,7 +17740,7 @@ snapshots: micromark-util-events-to-acorn@2.0.2: dependencies: '@types/acorn': 4.0.6 - '@types/estree': 1.0.5 + '@types/estree': 1.0.6 '@types/unist': 3.0.3 devlop: 1.1.0 estree-util-visit: 2.0.0 @@ -18365,7 +18374,7 @@ snapshots: periscopic@3.1.0: dependencies: - '@types/estree': 1.0.5 + '@types/estree': 1.0.6 estree-walker: 3.0.3 is-reference: 3.0.2 @@ -18703,7 +18712,7 @@ snapshots: remark-rehype: 11.1.0 unified: 11.0.4 unist-util-visit: 5.0.0 - vfile: 6.0.1 + vfile: 6.0.3 transitivePeerDependencies: - supports-color @@ -18872,7 +18881,7 @@ snapshots: dependencies: '@types/hast': 3.0.4 hast-util-raw: 9.0.4 - vfile: 6.0.1 + vfile: 6.0.3 rehype-slug@6.0.0: dependencies: @@ -18903,7 +18912,7 @@ snapshots: remark-directive@3.0.0: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 mdast-util-directive: 3.0.0 micromark-extension-directive: 3.0.0 unified: 11.0.4 @@ -18912,7 +18921,7 @@ snapshots: remark-frontmatter@5.0.0: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 mdast-util-frontmatter: 2.0.1 micromark-extension-frontmatter: 2.0.0 unified: 11.0.4 @@ -18921,7 +18930,7 @@ snapshots: remark-gfm@4.0.0: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 mdast-util-gfm: 3.0.0 micromark-extension-gfm: 3.0.0 remark-parse: 11.0.0 @@ -18932,9 +18941,9 @@ snapshots: remark-mdx-frontmatter@5.0.0: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 estree-util-is-identifier-name: 3.0.0 - estree-util-value-to-estree: 3.1.1 + estree-util-value-to-estree: 3.2.1 toml: 3.0.0 unified: 11.0.4 yaml: 2.6.0 @@ -18957,7 +18966,7 @@ snapshots: remark-parse@11.0.0: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 mdast-util-from-markdown: 2.0.0 micromark-util-types: 2.0.0 unified: 11.0.4 @@ -18975,14 +18984,14 @@ snapshots: remark-rehype@11.1.0: dependencies: '@types/hast': 3.0.4 - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 mdast-util-to-hast: 13.1.0 unified: 11.0.4 - vfile: 6.0.1 + vfile: 6.0.3 remark-stringify@11.0.0: dependencies: - '@types/mdast': 4.0.3 + '@types/mdast': 4.0.4 mdast-util-to-markdown: 2.1.0 unified: 11.0.4 @@ -19896,13 +19905,13 @@ snapshots: unified@11.0.4: dependencies: - '@types/unist': 3.0.2 + '@types/unist': 3.0.3 bail: 2.0.2 devlop: 1.1.0 extend: 3.0.2 is-plain-obj: 4.1.0 trough: 2.2.0 - vfile: 6.0.1 + vfile: 6.0.3 union@0.5.0: dependencies: @@ -19917,7 +19926,7 @@ snapshots: unist-util-is@6.0.0: dependencies: - '@types/unist': 3.0.2 + '@types/unist': 3.0.3 unist-util-map@3.1.3: dependencies: @@ -19925,7 +19934,7 @@ snapshots: unist-util-position-from-estree@2.0.0: dependencies: - '@types/unist': 3.0.2 + '@types/unist': 3.0.3 unist-util-position@4.0.4: dependencies: @@ -19934,11 +19943,11 @@ snapshots: unist-util-position@5.0.0: dependencies: - '@types/unist': 3.0.2 + '@types/unist': 3.0.3 unist-util-remove-position@5.0.0: dependencies: - '@types/unist': 3.0.2 + '@types/unist': 3.0.3 unist-util-visit: 5.0.0 unist-util-stringify-position@3.0.3: @@ -19948,7 +19957,7 @@ snapshots: unist-util-stringify-position@4.0.0: dependencies: - '@types/unist': 3.0.2 + '@types/unist': 3.0.3 unist-util-visit-parents@5.1.3: dependencies: @@ -19957,7 +19966,7 @@ snapshots: unist-util-visit-parents@6.0.1: dependencies: - '@types/unist': 3.0.2 + '@types/unist': 3.0.3 unist-util-is: 6.0.0 unist-util-visit@4.1.2: @@ -20095,8 +20104,8 @@ snapshots: vfile-location@5.0.3: dependencies: - '@types/unist': 3.0.2 - vfile: 6.0.1 + '@types/unist': 3.0.3 + vfile: 6.0.3 vfile-message@3.1.4: dependencies: @@ -20106,7 +20115,7 @@ snapshots: vfile-message@4.0.2: dependencies: - '@types/unist': 3.0.2 + '@types/unist': 3.0.3 unist-util-stringify-position: 4.0.0 vfile@5.3.7: @@ -20117,10 +20126,9 @@ snapshots: vfile-message: 3.1.4 optional: true - vfile@6.0.1: + vfile@6.0.3: dependencies: - '@types/unist': 3.0.2 - unist-util-stringify-position: 4.0.0 + '@types/unist': 3.0.3 vfile-message: 4.0.2 vite-node@1.6.0(@types/node@22.7.5):