@studiocms/mdx 0.1.0-beta.21 → 0.1.0-beta.23
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/LICENSE +1 -1
- package/dist/components/editor.astro +8 -0
- package/dist/index.js +4 -3
- package/dist/lib/render.js +2 -2
- package/dist/lib/shared.js +1 -1
- package/package.json +13 -10
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2025 StudioCMS -
|
|
3
|
+
Copyright (c) 2025-present StudioCMS - withstudiocms (https://github.com/withstudiocms)
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/dist/index.js
CHANGED
|
@@ -5,6 +5,7 @@ function studiocmsMDX(options) {
|
|
|
5
5
|
const { resolve } = createResolver(import.meta.url);
|
|
6
6
|
const packageIdentifier = "@studiocms/mdx";
|
|
7
7
|
const renderer = resolve("./components/MDXRenderer.astro");
|
|
8
|
+
const editor = resolve("./components/editor.astro");
|
|
8
9
|
const internalRenderer = resolve("./lib/render.js");
|
|
9
10
|
const resolvedOptions = {
|
|
10
11
|
remarkPlugins: options?.remarkPlugins || [],
|
|
@@ -15,7 +16,8 @@ function studiocmsMDX(options) {
|
|
|
15
16
|
return definePlugin({
|
|
16
17
|
identifier: packageIdentifier,
|
|
17
18
|
name: "StudioCMS MDX",
|
|
18
|
-
studiocmsMinimumVersion: "0.1.0-beta.
|
|
19
|
+
studiocmsMinimumVersion: "0.1.0-beta.21",
|
|
20
|
+
requires: ["@studiocms/md"],
|
|
19
21
|
hooks: {
|
|
20
22
|
"studiocms:astro:config": ({ addIntegrations }) => {
|
|
21
23
|
addIntegrations({
|
|
@@ -47,8 +49,7 @@ function studiocmsMDX(options) {
|
|
|
47
49
|
{
|
|
48
50
|
identifier: "studiocms/mdx",
|
|
49
51
|
label: "MDX",
|
|
50
|
-
pageContentComponent:
|
|
51
|
-
// Fallback to the default content editor for now, might build a custom MDX editor in the future
|
|
52
|
+
pageContentComponent: editor,
|
|
52
53
|
rendererComponent: renderer
|
|
53
54
|
}
|
|
54
55
|
]
|
package/dist/lib/render.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { evaluate } from "@mdx-js/mdx";
|
|
2
2
|
import { createElement } from "react";
|
|
3
|
-
import { renderToString } from "react-dom/server";
|
|
4
3
|
import * as runtime from "react/jsx-runtime";
|
|
4
|
+
import { renderToString } from "react-dom/server";
|
|
5
5
|
import rehypeHighlight from "rehype-highlight";
|
|
6
6
|
import remarkGfm from "remark-gfm";
|
|
7
7
|
import { shared } from "./shared.js";
|
|
@@ -19,7 +19,7 @@ const makeList = (included, userDefinedPlugins) => {
|
|
|
19
19
|
};
|
|
20
20
|
async function renderMDX(content) {
|
|
21
21
|
const { default: MDXContent } = await evaluate(content, {
|
|
22
|
-
// biome-ignore lint/suspicious/noExplicitAny:
|
|
22
|
+
// biome-ignore lint/suspicious/noExplicitAny: this is a valid use case for explicit any
|
|
23
23
|
...runtime,
|
|
24
24
|
remarkPlugins: makeList(baseRemarkPlugins, remarkPlugins),
|
|
25
25
|
rehypePlugins: makeList(baseRehypePlugins, rehypePlugins),
|
package/dist/lib/shared.js
CHANGED
|
@@ -2,7 +2,7 @@ const symbol = Symbol.for("@studiocms/mdx");
|
|
|
2
2
|
const shared = (
|
|
3
3
|
// @ts-ignore
|
|
4
4
|
globalThis[symbol] || // @ts-ignore
|
|
5
|
-
// biome-ignore lint/suspicious/noAssignInExpressions:
|
|
5
|
+
// biome-ignore lint/suspicious/noAssignInExpressions: this is a valid use case for assignment in expressions.
|
|
6
6
|
(globalThis[symbol] = {
|
|
7
7
|
mdxConfig: {}
|
|
8
8
|
})
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@studiocms/mdx",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.23",
|
|
4
4
|
"description": "Add MDX Support to your StudioCMS project with ease!",
|
|
5
5
|
"author": {
|
|
6
|
-
"name": "
|
|
6
|
+
"name": "withstudiocms",
|
|
7
7
|
"url": "https://studiocms.dev"
|
|
8
8
|
},
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "git+https://github.com/withstudiocms/studiocms.git",
|
|
12
|
-
"directory": "packages/
|
|
12
|
+
"directory": "packages/@studiocms/mdx"
|
|
13
13
|
},
|
|
14
14
|
"contributors": [
|
|
15
15
|
"Adammatthiesen",
|
|
@@ -59,24 +59,27 @@
|
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@mdx-js/mdx": "^3.1.0",
|
|
61
61
|
"astro-integration-kit": "^0.18",
|
|
62
|
-
"react": "^19.
|
|
63
|
-
"react-dom": "^19.
|
|
62
|
+
"react": "^19.1.1",
|
|
63
|
+
"react-dom": "^19.1.1",
|
|
64
64
|
"rehype-highlight": "^7.0.2",
|
|
65
65
|
"remark-gfm": "^4.0.1",
|
|
66
66
|
"unified": "^11.0.5"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@types/node": "^22.0.0",
|
|
70
|
-
"@types/react": "^19.
|
|
71
|
-
"@types/react-dom": "^19.
|
|
70
|
+
"@types/react": "^19.1.9",
|
|
71
|
+
"@types/react-dom": "^19.1.7"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
|
-
"astro": "^5.
|
|
74
|
+
"astro": "^5.12.6",
|
|
75
|
+
"effect": "^3.17.3",
|
|
75
76
|
"vite": "^6.3.4",
|
|
76
|
-
"studiocms": "0.1.0-beta.
|
|
77
|
+
"@studiocms/md": "0.1.0-beta.23",
|
|
78
|
+
"studiocms": "0.1.0-beta.23"
|
|
77
79
|
},
|
|
78
80
|
"scripts": {
|
|
79
81
|
"build": "buildkit build 'src/**/*.{ts,astro,css,json,png}'",
|
|
80
|
-
"dev": "buildkit dev 'src/**/*.{ts,astro,css,json,png}'"
|
|
82
|
+
"dev": "buildkit dev 'src/**/*.{ts,astro,css,json,png}'",
|
|
83
|
+
"typecheck": "tspc -p tsconfig.tspc.json"
|
|
81
84
|
}
|
|
82
85
|
}
|