Skip to content

Commit 5be111a

Browse files
committed
Remove custom recma plugin, and install recma-mdx-import-react as a devDependency for test it
1 parent 1a81b94 commit 5be111a

10 files changed

+26
-282
lines changed

package-lock.json

+15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
"prettier": "^3.5.3",
103103
"recma-mdx-change-props": "^1.1.2",
104104
"recma-mdx-escape-missing-components": "^1.1.2",
105+
"recma-mdx-import-react": "^1.0.0",
105106
"remark-emoji": "^5.0.1",
106107
"remark-flexible-markers": "^1.2.1",
107108
"remark-flexible-paragraphs": "^1.2.0",

src/lib/compile.ts

-7
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import remarkMdxRemoveEsm, { clsx } from "remark-mdx-remove-esm";
1010

1111
import type { CompileOptions, CompileResult } from "./types.js";
1212
import { createFormattedMDXError } from "./util.js";
13-
import { recmaMdxImportReact } from "../utils/index.js";
1413

1514
/**
1615
* composes an opinionated version of CompileOptions of the "@mdx-js/mdx"
@@ -28,15 +27,9 @@ function composeCompileOptions(options: CompileOptions = {}): CompileMDXOptions
2827
[remarkMdxRemoveEsm, mdxRemoveEsmOptions],
2928
];
3029

31-
const recmaPlugins: PluggableList = [
32-
...(mdxOptions.recmaPlugins || []),
33-
[recmaMdxImportReact],
34-
];
35-
3630
return {
3731
...mdxOptions,
3832
remarkPlugins,
39-
recmaPlugins,
4033
outputFormat: "function-body",
4134
};
4235
}

src/utils/index.ts

-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,3 @@
55

66
// for who needs to parse and get the fronmatter and stripped source
77
export { getFrontmatter } from "./getFrontmatter.js";
8-
9-
import recmaMdxImportReact from "./recma-mdx-import-react.js";
10-
export { recmaMdxImportReact };

src/utils/recma-mdx-import-react.ts

-156
This file was deleted.

tests/context/components.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// the same test file taken from @mdx-js/mdx test files iot be inline with
22

3+
import React from "react";
4+
35
/**
46
* @param {Readonly<React.JSX.IntrinsicElements['span']>} props
57
* Props
@@ -16,7 +18,7 @@ export function Pill({ React, ...props }) {
1618
* @returns
1719
* `div` element.
1820
*/
19-
export function Layout({ React, ...props }) {
21+
export function Layout(props) {
2022
return React.createElement("div", { ...props, style: { color: "red" } });
2123
}
2224

tests/recma-custom-plugin.spec.ts

-99
This file was deleted.

0 commit comments

Comments
 (0)