Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/astro-asciidoc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@
"@asciidoctor/core": "3.0.4"
},
"devDependencies": {
"astro": "4.16.19",
"astro": "5.16.3",
"typescript": "5.9.3",
"unbuild": "3.6.1"
},
"peerDependencies": {
"astro": "^2.8.0 || ^3.0.0 || ^4.0.0",
"@astrojs/mdx": "^4.0.0",
"astro": "^5.0.0",
"vite": "^4.3.9 || ^5.0.0 || ^6.0.0 || ^7.0.0"
}
}
4 changes: 1 addition & 3 deletions packages/astro-asciidoc/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { ProcessorOptions } from "@asciidoctor/core";
import type { AstroIntegration } from "astro";
import astroJsx from "astro/jsx/renderer.js";
import type { ViteDevServer } from "vite";
import AsciidocConverter from "./asciidoctor.js";
import type { InitOptions } from "./worker.js";
Expand Down Expand Up @@ -45,7 +44,7 @@ export default function asciidoc(opts?: Options): AstroIntegration {
const { addPageExtension, addRenderer, updateConfig, addWatchFile } =
params as InternalHookParams;

addRenderer(astroJsx);
addRenderer({ name: "astro:mdx", serverEntrypoint: "@astrojs/mdx/server.js" });
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow! Is that really it?! I've tested it briefly and it seems to work. Let me just dig into mdx renderer internals to see if my hacky code below still makes sense with it.

addPageExtension(asciidocFileExt);

updateConfig({
Expand All @@ -54,7 +53,6 @@ export default function asciidoc(opts?: Options): AstroIntegration {
{
name: "vite-plugin-astro-asciidoc",
configureServer(s) {
// @ts-expect-error type conflict in dependencies
server = s as ViteDevServer;
},
async transform(_code, id) {
Expand Down
3 changes: 2 additions & 1 deletion packages/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"typescript": "5.9.3"
},
"dependencies": {
"astro": "4.16.19",
"@astrojs/mdx": "^4.3.12",
"astro": "5.16.3",
"astro-asciidoc": "workspace:*"
}
}
Loading