@astrojs/mdx 4.3.9 → 5.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -2
- package/dist/plugins.d.ts +0 -1
- package/dist/plugins.js +3 -6
- package/dist/vite-plugin-mdx.d.ts +0 -1
- package/dist/vite-plugin-mdx.js +1 -2
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { markdownConfigDefaults } from '@astrojs/markdown-remark';
|
|
2
|
-
import type { AstroIntegration,
|
|
2
|
+
import type { AstroIntegration, AstroRenderer } from 'astro';
|
|
3
3
|
import type { Options as RemarkRehypeOptions } from 'remark-rehype';
|
|
4
4
|
import type { PluggableList } from 'unified';
|
|
5
5
|
import type { OptimizeOptions } from './rehype-optimize-static.js';
|
|
@@ -11,5 +11,5 @@ export type MdxOptions = Omit<typeof markdownConfigDefaults, 'remarkPlugins' | '
|
|
|
11
11
|
remarkRehype: RemarkRehypeOptions;
|
|
12
12
|
optimize: boolean | OptimizeOptions;
|
|
13
13
|
};
|
|
14
|
-
export declare function getContainerRenderer():
|
|
14
|
+
export declare function getContainerRenderer(): AstroRenderer;
|
|
15
15
|
export default function mdx(partialMdxOptions?: Partial<MdxOptions>): AstroIntegration;
|
package/dist/index.js
CHANGED
|
@@ -58,8 +58,7 @@ function mdx(partialMdxOptions = {}) {
|
|
|
58
58
|
});
|
|
59
59
|
Object.assign(vitePluginMdxOptions, {
|
|
60
60
|
mdxOptions: resolvedMdxOptions,
|
|
61
|
-
srcDir: config.srcDir
|
|
62
|
-
experimentalHeadingIdCompat: config.experimental.headingIdCompat
|
|
61
|
+
srcDir: config.srcDir
|
|
63
62
|
});
|
|
64
63
|
vitePluginMdxOptions = {};
|
|
65
64
|
}
|
package/dist/plugins.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { MdxOptions } from './index.js';
|
|
2
2
|
interface MdxProcessorExtraOptions {
|
|
3
3
|
sourcemap: boolean;
|
|
4
|
-
experimentalHeadingIdCompat: boolean;
|
|
5
4
|
}
|
|
6
5
|
export declare function createMdxProcessor(mdxOptions: MdxOptions, extraOptions: MdxProcessorExtraOptions): import("unified").Processor<import("mdast").Root, import("estree").Program, import("estree").Program, import("estree").Program, string>;
|
|
7
6
|
export {};
|
package/dist/plugins.js
CHANGED
|
@@ -19,7 +19,7 @@ const isPerformanceBenchmark = Boolean(process.env.ASTRO_PERFORMANCE_BENCHMARK);
|
|
|
19
19
|
function createMdxProcessor(mdxOptions, extraOptions) {
|
|
20
20
|
return createProcessor({
|
|
21
21
|
remarkPlugins: getRemarkPlugins(mdxOptions),
|
|
22
|
-
rehypePlugins: getRehypePlugins(mdxOptions
|
|
22
|
+
rehypePlugins: getRehypePlugins(mdxOptions),
|
|
23
23
|
recmaPlugins: mdxOptions.recmaPlugins,
|
|
24
24
|
remarkRehypeOptions: mdxOptions.remarkRehype,
|
|
25
25
|
jsxImportSource: "astro",
|
|
@@ -43,7 +43,7 @@ function getRemarkPlugins(mdxOptions) {
|
|
|
43
43
|
remarkPlugins.push(...mdxOptions.remarkPlugins, remarkCollectImages);
|
|
44
44
|
return remarkPlugins;
|
|
45
45
|
}
|
|
46
|
-
function getRehypePlugins(mdxOptions
|
|
46
|
+
function getRehypePlugins(mdxOptions) {
|
|
47
47
|
let rehypePlugins = [
|
|
48
48
|
// ensure `data.meta` is preserved in `properties.metastring` for rehype syntax highlighters
|
|
49
49
|
rehypeMetaString,
|
|
@@ -62,10 +62,7 @@ function getRehypePlugins(mdxOptions, { experimentalHeadingIdCompat }) {
|
|
|
62
62
|
}
|
|
63
63
|
rehypePlugins.push(...mdxOptions.rehypePlugins, rehypeImageToComponent);
|
|
64
64
|
if (!isPerformanceBenchmark) {
|
|
65
|
-
rehypePlugins.push(
|
|
66
|
-
[rehypeHeadingIds, { experimentalHeadingIdCompat }],
|
|
67
|
-
rehypeInjectHeadingsExport
|
|
68
|
-
);
|
|
65
|
+
rehypePlugins.push([rehypeHeadingIds], rehypeInjectHeadingsExport);
|
|
69
66
|
}
|
|
70
67
|
rehypePlugins.push(
|
|
71
68
|
// Render info from `vfile.data.astro.frontmatter` as JS
|
package/dist/vite-plugin-mdx.js
CHANGED
|
@@ -44,8 +44,7 @@ function vitePluginMdx(opts) {
|
|
|
44
44
|
});
|
|
45
45
|
if (!processor) {
|
|
46
46
|
processor = createMdxProcessor(opts.mdxOptions, {
|
|
47
|
-
sourcemap: sourcemapEnabled
|
|
48
|
-
experimentalHeadingIdCompat: opts.experimentalHeadingIdCompat
|
|
47
|
+
sourcemap: sourcemapEnabled
|
|
49
48
|
});
|
|
50
49
|
}
|
|
51
50
|
try {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astrojs/mdx",
|
|
3
3
|
"description": "Add support for MDX pages in your Astro site",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "5.0.0-alpha.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"author": "withastro",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"source-map": "^0.7.6",
|
|
41
41
|
"unist-util-visit": "^5.0.0",
|
|
42
42
|
"vfile": "^6.0.3",
|
|
43
|
-
"@astrojs/markdown-remark": "
|
|
43
|
+
"@astrojs/markdown-remark": "7.0.0-alpha.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"astro": "^
|
|
46
|
+
"astro": "^6.0.0-alpha.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/estree": "^1.0.8",
|
|
@@ -61,12 +61,12 @@
|
|
|
61
61
|
"remark-toc": "^9.0.0",
|
|
62
62
|
"shiki": "^3.12.0",
|
|
63
63
|
"unified": "^11.0.5",
|
|
64
|
-
"vite": "^
|
|
65
|
-
"astro": "
|
|
64
|
+
"vite": "^7.1.7",
|
|
65
|
+
"astro": "6.0.0-alpha.0",
|
|
66
66
|
"astro-scripts": "0.0.14"
|
|
67
67
|
},
|
|
68
68
|
"engines": {
|
|
69
|
-
"node": "
|
|
69
|
+
"node": "^20.19.5 || >=22.12.0"
|
|
70
70
|
},
|
|
71
71
|
"publishConfig": {
|
|
72
72
|
"provenance": true
|