Skip to content

Commit 3f4b7f1

Browse files
committed
Add recma debugger
1 parent 8c118b1 commit 3f4b7f1

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

apps/web/content/blog/from-remark-to-rsc.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ authors: [pomber]
66
draft: true
77
---
88

9+
Content usually needs some kind of transformation before being rendered.
10+
911
A remark plugin is a function that transforms pieces of a markdown file.

apps/web/next.config.mjs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
import createNextDocsMDX from "next-docs-mdx/config"
22
import { remarkCodeHike, recmaCodeHike } from "codehike/mdx"
3+
// import fs from "node:fs"
4+
// import { jsx, toJs } from "estree-util-to-js"
5+
// function recmaPlugin() {
6+
// return (tree) => {
7+
// const result = toJs(tree, { handlers: jsx })
8+
// // console.log("```js")
9+
// // console.log(result.value)
10+
// // console.log("```")
11+
// fs.writeFileSync("recma.js", result.value)
12+
// }
13+
// }
314

415
/** @type {import('codehike/mdx').CodeHikeConfig} */
516
const chConfig = {
@@ -17,7 +28,7 @@ const withMDX = createNextDocsMDX({
1728
mdxOptions: {
1829
remarkPlugins: [[remarkCodeHike, chConfig]],
1930
recmaPlugins: [[recmaCodeHike, chConfig]],
20-
jsx: true,
31+
// jsx: true,
2132
},
2233
})
2334

apps/web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"codehike": "workspace:*",
2525
"diff": "^5.1.0",
2626
"dotenv": "^16.4.1",
27+
"estree-util-to-js": "^2.0.0",
2728
"lucide-react": "^0.303.0",
2829
"next": "14.1.0",
2930
"next-docs-mdx": "7.1.2",

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)