diff options
Diffstat (limited to 'packages/integrations/mdx')
4 files changed, 23 insertions, 21 deletions
diff --git a/packages/integrations/mdx/package.json b/packages/integrations/mdx/package.json index 41682a6bd..9de289736 100644 --- a/packages/integrations/mdx/package.json +++ b/packages/integrations/mdx/package.json @@ -37,10 +37,10 @@ "@astrojs/markdown-remark": "^2.2.1", "@astrojs/prism": "^2.1.2", "@mdx-js/mdx": "^2.3.0", - "acorn": "^8.8.0", - "es-module-lexer": "^1.1.1", - "estree-util-visit": "^1.2.0", - "github-slugger": "^1.4.0", + "acorn": "^8.9.0", + "es-module-lexer": "^1.3.0", + "estree-util-visit": "^1.2.1", + "github-slugger": "^1.5.0", "gray-matter": "^4.0.3", "hast-util-to-html": "^8.0.4", "kleur": "^4.1.4", @@ -50,32 +50,32 @@ "remark-smartypants": "^2.0.0", "shiki": "^0.14.1", "source-map": "^0.7.4", - "unist-util-visit": "^4.1.0", - "vfile": "^5.3.2" + "unist-util-visit": "^4.1.2", + "vfile": "^5.3.7" }, "devDependencies": { - "@types/chai": "^4.3.1", - "@types/estree": "^1.0.0", + "@types/chai": "^4.3.5", + "@types/estree": "^1.0.1", "@types/github-slugger": "^1.3.0", - "@types/mdast": "^3.0.10", + "@types/mdast": "^3.0.11", "@types/mocha": "^9.1.1", "@types/yargs-parser": "^21.0.0", "astro": "workspace:*", "astro-scripts": "workspace:*", - "chai": "^4.3.6", - "cheerio": "^1.0.0-rc.11", - "linkedom": "^0.14.12", - "mdast-util-mdx": "^2.0.0", - "mdast-util-to-string": "^3.1.0", + "chai": "^4.3.7", + "cheerio": "1.0.0-rc.12", + "linkedom": "^0.14.26", + "mdast-util-mdx": "^2.0.1", + "mdast-util-to-string": "^3.2.0", "mocha": "^9.2.2", "reading-time": "^1.5.0", "rehype-mathjax": "^4.0.2", "rehype-pretty-code": "^0.4.0", "remark-math": "^5.1.1", "remark-rehype": "^10.1.0", - "remark-shiki-twoslash": "^3.1.0", + "remark-shiki-twoslash": "^3.1.3", "remark-toc": "^8.0.1", - "vite": "^4.3.1" + "vite": "^4.3.9" }, "engines": { "node": ">=16.12.0" diff --git a/packages/integrations/mdx/src/rehype-optimize-static.ts b/packages/integrations/mdx/src/rehype-optimize-static.ts index c476f7c83..573af317e 100644 --- a/packages/integrations/mdx/src/rehype-optimize-static.ts +++ b/packages/integrations/mdx/src/rehype-optimize-static.ts @@ -64,6 +64,7 @@ export function rehypeOptimizeStatic(options?: OptimizeOptions) { } // For possible subtree root nodes, record them in `elementStack` and // `allPossibleElements` to be used in the "leave" hook below. + // @ts-expect-error MDX types for `.type` is not enhanced because MDX isn't used directly if (node.type === 'element' || node.type === 'mdxJsxFlowElement') { elementStack.push(node); allPossibleElements.add(node); @@ -72,6 +73,7 @@ export function rehypeOptimizeStatic(options?: OptimizeOptions) { leave(node, _, __, parents) { // Do the reverse of the if condition above, popping the `elementStack`, // and consolidating `allPossibleElements` as a subtree root. + // @ts-expect-error MDX types for `.type` is not enhanced because MDX isn't used directly if (node.type === 'element' || node.type === 'mdxJsxFlowElement') { elementStack.pop(); // Many possible elements could be part of a subtree, in order to find diff --git a/packages/integrations/mdx/test/fixtures/mdx-frontmatter-injection/package.json b/packages/integrations/mdx/test/fixtures/mdx-frontmatter-injection/package.json index 8affcbbf6..d85e995c0 100644 --- a/packages/integrations/mdx/test/fixtures/mdx-frontmatter-injection/package.json +++ b/packages/integrations/mdx/test/fixtures/mdx-frontmatter-injection/package.json @@ -3,10 +3,10 @@ "version": "0.0.0", "private": true, "dependencies": { - "astro": "workspace:*", "@astrojs/mdx": "workspace:*", - "mdast-util-to-string": "^3.1.0", + "astro": "workspace:*", + "mdast-util-to-string": "^3.2.0", "reading-time": "^1.5.0", - "unist-util-visit": "^4.1.0" + "unist-util-visit": "^4.1.2" } } diff --git a/packages/integrations/mdx/test/fixtures/mdx-infinite-loop/package.json b/packages/integrations/mdx/test/fixtures/mdx-infinite-loop/package.json index 80b1b2f0c..130577bcd 100644 --- a/packages/integrations/mdx/test/fixtures/mdx-infinite-loop/package.json +++ b/packages/integrations/mdx/test/fixtures/mdx-infinite-loop/package.json @@ -5,7 +5,7 @@ "dependencies": { "@astrojs/mdx": "workspace:*", "@astrojs/preact": "workspace:*", - "preact": "^10.7.3", - "astro": "workspace:*" + "astro": "workspace:*", + "preact": "^10.15.1" } } |