@ecopages/mdx 0.2.0-alpha.10 → 0.2.0-alpha.12
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/CHANGELOG.md +3 -6
- package/package.json +2 -2
- package/src/mdx-renderer.d.ts +1 -5
- package/src/mdx-renderer.js +4 -6
package/CHANGELOG.md
CHANGED
|
@@ -8,18 +8,15 @@ All notable changes to `@ecopages/mdx` are documented here.
|
|
|
8
8
|
|
|
9
9
|
### Features
|
|
10
10
|
|
|
11
|
-
-
|
|
12
|
-
- Switched MDX compilation to the async pipeline for async remark and rehype plugin support.
|
|
11
|
+
- Added standalone MDX server rendering and async compilation support.
|
|
13
12
|
|
|
14
13
|
### Bug Fixes
|
|
15
14
|
|
|
16
|
-
- Fixed
|
|
17
|
-
- Fixed loader registration to respect configured extensions so standalone MDX no longer hijacks React `.mdx` pages during shared development and build flows.
|
|
18
|
-
- Fixed native Node startup compatibility by using Node-safe `source-map` interop.
|
|
15
|
+
- Fixed `.md` opt-in handling, loader registration, and Node `source-map` interop.
|
|
19
16
|
|
|
20
17
|
### Refactoring
|
|
21
18
|
|
|
22
|
-
- Removed the React-specific renderer and HMR
|
|
19
|
+
- Removed the React-specific renderer and HMR path from the package.
|
|
23
20
|
|
|
24
21
|
### Documentation
|
|
25
22
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecopages/mdx",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.12",
|
|
4
4
|
"description": "MDX plugin for Ecopages",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ecopages",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"directory": "packages/integrations/mdx"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@ecopages/core": "0.2.0-alpha.
|
|
40
|
+
"@ecopages/core": "0.2.0-alpha.12",
|
|
41
41
|
"@kitajs/html": "^4.1.0",
|
|
42
42
|
"@mdx-js/mdx": "^3.1.0"
|
|
43
43
|
},
|
package/src/mdx-renderer.d.ts
CHANGED
|
@@ -33,11 +33,7 @@ export declare class MDXRenderer extends IntegrationRenderer<EcoPagesElement> {
|
|
|
33
33
|
compilerOptions?: CompileOptions;
|
|
34
34
|
});
|
|
35
35
|
buildRouteRenderAssets(pagePath: string): Promise<ProcessedAsset[]>;
|
|
36
|
-
protected
|
|
37
|
-
layout?: EcoComponent<any> | {
|
|
38
|
-
config: EcoComponentConfig | undefined;
|
|
39
|
-
};
|
|
40
|
-
}>>;
|
|
36
|
+
protected normalizeImportedPageFile<TPageModule extends EcoPageFile>(_file: string, pageModule: TPageModule): TPageModule;
|
|
41
37
|
render({ params, query, props, locals, pageLocals, metadata, Page, HtmlTemplate, Layout, pageProps, }: MDXIntegrationRendererOpions): Promise<RouteRendererBody>;
|
|
42
38
|
renderToResponse<P = Record<string, unknown>>(view: EcoComponent<P>, props: P, ctx: RenderToResponseContext): Promise<Response>;
|
|
43
39
|
}
|
package/src/mdx-renderer.js
CHANGED
|
@@ -34,19 +34,17 @@ class MDXRenderer extends IntegrationRenderer {
|
|
|
34
34
|
}
|
|
35
35
|
return await this.resolveDependencies(components);
|
|
36
36
|
}
|
|
37
|
-
|
|
37
|
+
normalizeImportedPageFile(_file, pageModule) {
|
|
38
38
|
try {
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
config,
|
|
42
|
-
getMetadata
|
|
43
|
-
} = await super.importPageFile(file);
|
|
39
|
+
const mdxModule = pageModule;
|
|
40
|
+
const { default: Page, config, getMetadata } = mdxModule;
|
|
44
41
|
if (typeof Page !== "function") {
|
|
45
42
|
throw new Error("MDX file must export a default function");
|
|
46
43
|
}
|
|
47
44
|
const resolvedLayout = config?.layout;
|
|
48
45
|
if (config) Page.config = config;
|
|
49
46
|
return {
|
|
47
|
+
...pageModule,
|
|
50
48
|
default: Page,
|
|
51
49
|
layout: resolvedLayout,
|
|
52
50
|
getMetadata
|