@astrojs/mdx 5.0.3 → 6.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/README.md +1 -1
- package/dist/rehype-optimize-static.d.ts +1 -1
- package/dist/server.d.ts +1 -0
- package/dist/server.js +2 -1
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +1 -0
- package/dist/vite-plugin-mdx-postprocess.d.ts +23 -0
- package/dist/vite-plugin-mdx-postprocess.js +5 -0
- package/dist/vite-plugin-mdx.js +1 -1
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -35,4 +35,4 @@ Copyright (c) 2023–present [Astro][astro]
|
|
|
35
35
|
[community]: https://github.com/withastro/.github/blob/main/COMMUNITY_GUIDE.md
|
|
36
36
|
[discord]: https://astro.build/chat/
|
|
37
37
|
[issues]: https://github.com/withastro/astro/issues
|
|
38
|
-
[astro-integration]: https://docs.astro.build/en/guides/integrations
|
|
38
|
+
[astro-integration]: https://docs.astro.build/en/guides/integrations/
|
|
@@ -7,6 +7,6 @@ export interface OptimizeOptions {
|
|
|
7
7
|
* do not include any MDX elements.
|
|
8
8
|
*
|
|
9
9
|
* This optimization reduces the JS output as more content are represented as a
|
|
10
|
-
* string instead, which also reduces the AST size that
|
|
10
|
+
* string instead, which also reduces the AST size that Rolldown holds in memory.
|
|
11
11
|
*/
|
|
12
12
|
export declare const rehypeOptimizeStatic: RehypePlugin<[OptimizeOptions?]>;
|
package/dist/server.d.ts
CHANGED
package/dist/server.js
CHANGED
package/dist/utils.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { Options as AcornOpts } from 'acorn';
|
|
|
2
2
|
import type { AstroConfig, AstroIntegrationLogger } from 'astro';
|
|
3
3
|
import type { MdxjsEsm } from 'mdast-util-mdx';
|
|
4
4
|
import type { PluggableList } from 'unified';
|
|
5
|
+
export declare function appendForwardSlash(path: string): string;
|
|
5
6
|
export interface FileInfo {
|
|
6
7
|
fileId: string;
|
|
7
8
|
fileUrl: string;
|
package/dist/utils.js
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
1
|
import type { AstroConfig } from 'astro';
|
|
2
|
+
import { type ExportSpecifier, type ImportSpecifier } from 'es-module-lexer';
|
|
2
3
|
import type { Plugin } from 'vite';
|
|
4
|
+
import { type FileInfo } from './utils.js';
|
|
3
5
|
export declare function vitePluginMdxPostprocess(astroConfig: AstroConfig): Plugin;
|
|
6
|
+
/**
|
|
7
|
+
* Inject `Fragment` identifier import if not already present.
|
|
8
|
+
*/
|
|
9
|
+
export declare function injectUnderscoreFragmentImport(code: string, imports: readonly ImportSpecifier[]): string;
|
|
10
|
+
/**
|
|
11
|
+
* Inject MDX metadata as exports of the module.
|
|
12
|
+
*/
|
|
13
|
+
export declare function injectMetadataExports(code: string, exports: readonly ExportSpecifier[], fileInfo: FileInfo): string;
|
|
14
|
+
/**
|
|
15
|
+
* Transforms the `MDXContent` default export as `Content`, which wraps `MDXContent` and
|
|
16
|
+
* passes additional `components` props.
|
|
17
|
+
*/
|
|
18
|
+
export declare function transformContentExport(code: string, exports: readonly ExportSpecifier[]): string;
|
|
19
|
+
/**
|
|
20
|
+
* Add properties to the `Content` export.
|
|
21
|
+
*/
|
|
22
|
+
export declare function annotateContentExport(code: string, id: string, ssr: boolean, imports: readonly ImportSpecifier[]): string;
|
|
23
|
+
/**
|
|
24
|
+
* Check whether the `specifierRegex` matches for an import of `source` in the `code`.
|
|
25
|
+
*/
|
|
26
|
+
export declare function isSpecifierImported(code: string, imports: readonly ImportSpecifier[], specifierRegex: RegExp, source: string): boolean;
|
|
@@ -98,5 +98,10 @@ function isSpecifierImported(code, imports, specifierRegex, source) {
|
|
|
98
98
|
return false;
|
|
99
99
|
}
|
|
100
100
|
export {
|
|
101
|
+
annotateContentExport,
|
|
102
|
+
injectMetadataExports,
|
|
103
|
+
injectUnderscoreFragmentImport,
|
|
104
|
+
isSpecifierImported,
|
|
105
|
+
transformContentExport,
|
|
101
106
|
vitePluginMdxPostprocess
|
|
102
107
|
};
|
package/dist/vite-plugin-mdx.js
CHANGED
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": "6.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.1.0",
|
|
42
42
|
"vfile": "^6.0.3",
|
|
43
|
-
"@astrojs/markdown-remark": "7.1.
|
|
43
|
+
"@astrojs/markdown-remark": "7.1.1"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"astro": "^
|
|
46
|
+
"astro": "^7.0.0-alpha.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@shikijs/rehype": "^4.0.2",
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"remark-toc": "^9.0.0",
|
|
63
63
|
"shiki": "^4.0.2",
|
|
64
64
|
"unified": "^11.0.5",
|
|
65
|
-
"vite": "^
|
|
66
|
-
"astro": "
|
|
65
|
+
"vite": "^8.0.8",
|
|
66
|
+
"astro": "7.0.0-alpha.0",
|
|
67
67
|
"astro-scripts": "0.0.14"
|
|
68
68
|
},
|
|
69
69
|
"engines": {
|
|
@@ -76,6 +76,7 @@
|
|
|
76
76
|
"build": "astro-scripts build \"src/**/*.ts\" && tsc",
|
|
77
77
|
"build:ci": "astro-scripts build \"src/**/*.ts\"",
|
|
78
78
|
"dev": "astro-scripts dev \"src/**/*.ts\"",
|
|
79
|
-
"test": "astro-scripts test --timeout 70000 \"test/**/*.test.
|
|
79
|
+
"test": "astro-scripts test --timeout 70000 \"test/**/*.test.ts\"",
|
|
80
|
+
"typecheck:tests": "tsc --build tsconfig.test.json"
|
|
80
81
|
}
|
|
81
82
|
}
|