@rspress/core 2.0.0-beta.33 → 2.0.0-beta.35
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/dist/_private/react/index.js +2 -0
- package/dist/_private/react/reconciler.js +169 -0
- package/dist/_private/react/render.js +105 -0
- package/dist/cli.js +3 -4
- package/dist/index.d.ts +1701 -5
- package/dist/index.js +551 -205
- package/dist/loader.d.ts +10 -2
- package/dist/loader.js +4 -3
- package/dist/processor.d.ts +10 -2
- package/dist/processor.js +3736 -40
- package/dist/renderPageWorker.js +2 -1
- package/dist/runtime/ssrMdServerEntry.d.ts +5 -0
- package/dist/runtime/ssrMdServerEntry.js +38 -0
- package/meta-json-schema.json +45 -3
- package/package.json +20 -14
- /package/dist/{101.js → 5~101.js} +0 -0
- /package/dist/{335.js → 5~335.js} +0 -0
- /package/dist/{395.js → 5~395.js} +0 -0
package/dist/renderPageWorker.js
CHANGED
|
@@ -102,7 +102,7 @@ function hintSSGFailed() {
|
|
|
102
102
|
1. Fix code to make it SSR-compatible.
|
|
103
103
|
2. Set \`ssg: false\` if the code in node_modules may be difficult to fix, but the SSG feature will be lost.`);
|
|
104
104
|
}
|
|
105
|
-
var package_namespaceObject = JSON.parse('{"rE":"2.0.0-beta.
|
|
105
|
+
var package_namespaceObject = JSON.parse('{"rE":"2.0.0-beta.35"}');
|
|
106
106
|
const RSPRESS_VERSION = package_namespaceObject.rE;
|
|
107
107
|
`{
|
|
108
108
|
const saved = localStorage.getItem('${APPEARANCE_KEY}')
|
|
@@ -118,6 +118,7 @@ node_path.join(PACKAGE_ROOT, 'index.html');
|
|
|
118
118
|
node_path.join(PACKAGE_ROOT, 'dist', 'runtime', 'csrClientEntry.js');
|
|
119
119
|
node_path.join(PACKAGE_ROOT, 'dist', 'runtime', 'ssrClientEntry.js');
|
|
120
120
|
node_path.join(PACKAGE_ROOT, 'dist', 'runtime', 'ssrServerEntry.js');
|
|
121
|
+
node_path.join(PACKAGE_ROOT, 'dist', 'runtime', 'ssrMdServerEntry.js');
|
|
121
122
|
const APP_HTML_MARKER = '<!--<?- DOC_CONTENT ?>-->';
|
|
122
123
|
const HEAD_MARKER = '<!--<?- HEAD ?>-->';
|
|
123
124
|
const META_GENERATOR = '<!--<?- GENERATOR ?>-->';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { renderToMarkdownString } from "@rspress/core/_private/react";
|
|
3
|
+
import { Content, PageContext, ThemeContext, pathnameToRouteService, removeTrailingSlash, withBase } from "@rspress/runtime";
|
|
4
|
+
import { StaticRouter } from "@rspress/runtime/server";
|
|
5
|
+
import { UnheadProvider } from "@unhead/react/server";
|
|
6
|
+
import { initPageData } from "./initPageData.js";
|
|
7
|
+
import { routes } from "virtual-routes";
|
|
8
|
+
const DEFAULT_THEME = 'light';
|
|
9
|
+
async function preloadRoute(pathname) {
|
|
10
|
+
const route = pathnameToRouteService(pathname);
|
|
11
|
+
await route?.preload();
|
|
12
|
+
}
|
|
13
|
+
async function render(routePath, head) {
|
|
14
|
+
const initialPageData = await initPageData(routePath);
|
|
15
|
+
await preloadRoute(routePath);
|
|
16
|
+
const appMd = await renderToMarkdownString(/*#__PURE__*/ jsx(ThemeContext.Provider, {
|
|
17
|
+
value: {
|
|
18
|
+
theme: DEFAULT_THEME
|
|
19
|
+
},
|
|
20
|
+
children: /*#__PURE__*/ jsx(PageContext.Provider, {
|
|
21
|
+
value: {
|
|
22
|
+
data: initialPageData
|
|
23
|
+
},
|
|
24
|
+
children: /*#__PURE__*/ jsx(StaticRouter, {
|
|
25
|
+
location: withBase(routePath),
|
|
26
|
+
basename: removeTrailingSlash(withBase('/')),
|
|
27
|
+
children: /*#__PURE__*/ jsx(UnheadProvider, {
|
|
28
|
+
value: head,
|
|
29
|
+
children: /*#__PURE__*/ jsx(Content, {})
|
|
30
|
+
})
|
|
31
|
+
})
|
|
32
|
+
})
|
|
33
|
+
}));
|
|
34
|
+
return {
|
|
35
|
+
appMd
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export { render, routes };
|
package/meta-json-schema.json
CHANGED
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
{
|
|
20
20
|
"$ref": "#/definitions/DirSideMeta"
|
|
21
21
|
},
|
|
22
|
+
{
|
|
23
|
+
"$ref": "#/definitions/DirSectionHeaderSideMeta"
|
|
24
|
+
},
|
|
22
25
|
{
|
|
23
26
|
"$ref": "#/definitions/DividerSideMeta"
|
|
24
27
|
},
|
|
@@ -103,6 +106,45 @@
|
|
|
103
106
|
],
|
|
104
107
|
"additionalProperties": false
|
|
105
108
|
},
|
|
109
|
+
"DirSectionHeaderSideMeta": {
|
|
110
|
+
"type": "object",
|
|
111
|
+
"additionalProperties": false,
|
|
112
|
+
"properties": {
|
|
113
|
+
"type": {
|
|
114
|
+
"type": "string",
|
|
115
|
+
"const": "dir-section-header"
|
|
116
|
+
},
|
|
117
|
+
"label": {
|
|
118
|
+
"type": "string"
|
|
119
|
+
},
|
|
120
|
+
"tag": {
|
|
121
|
+
"type": "string"
|
|
122
|
+
},
|
|
123
|
+
"name": {
|
|
124
|
+
"type": "string"
|
|
125
|
+
},
|
|
126
|
+
"overviewHeaders": {
|
|
127
|
+
"type": "array",
|
|
128
|
+
"items": {
|
|
129
|
+
"type": "number"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"context": {
|
|
133
|
+
"type": "string"
|
|
134
|
+
},
|
|
135
|
+
"collapsible": {
|
|
136
|
+
"type": "boolean"
|
|
137
|
+
},
|
|
138
|
+
"collapsed": {
|
|
139
|
+
"type": "boolean"
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
"required": [
|
|
143
|
+
"label",
|
|
144
|
+
"name",
|
|
145
|
+
"type"
|
|
146
|
+
]
|
|
147
|
+
},
|
|
106
148
|
"DividerSideMeta": {
|
|
107
149
|
"type": "object",
|
|
108
150
|
"properties": {
|
|
@@ -275,7 +317,7 @@
|
|
|
275
317
|
"items": {
|
|
276
318
|
"type": "array",
|
|
277
319
|
"items": {
|
|
278
|
-
"$ref": "#/definitions/alias-926151818-
|
|
320
|
+
"$ref": "#/definitions/alias-926151818-700-1288-926151818-0-2151"
|
|
279
321
|
}
|
|
280
322
|
}
|
|
281
323
|
},
|
|
@@ -298,7 +340,7 @@
|
|
|
298
340
|
}
|
|
299
341
|
]
|
|
300
342
|
},
|
|
301
|
-
"alias-926151818-
|
|
343
|
+
"alias-926151818-700-1288-926151818-0-2151": {
|
|
302
344
|
"anyOf": [
|
|
303
345
|
{
|
|
304
346
|
"type": "object",
|
|
@@ -366,7 +408,7 @@
|
|
|
366
408
|
"items": {
|
|
367
409
|
"type": "array",
|
|
368
410
|
"items": {
|
|
369
|
-
"$ref": "#/definitions/alias-926151818-
|
|
411
|
+
"$ref": "#/definitions/alias-926151818-700-1288-926151818-0-2151"
|
|
370
412
|
}
|
|
371
413
|
}
|
|
372
414
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspress/core",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.35",
|
|
4
4
|
"description": "The Rspress Documentation Framework",
|
|
5
5
|
"bugs": "https://github.com/web-infra-dev/rspress/issues",
|
|
6
6
|
"repository": {
|
|
@@ -34,6 +34,9 @@
|
|
|
34
34
|
"./shiki-transformers": {
|
|
35
35
|
"types": "./dist/shiki-transformers.d.ts",
|
|
36
36
|
"default": "./dist/shiki-transformers.js"
|
|
37
|
+
},
|
|
38
|
+
"./_private/react": {
|
|
39
|
+
"default": "./dist/_private/react/index.js"
|
|
37
40
|
}
|
|
38
41
|
},
|
|
39
42
|
"main": "./dist/index.js",
|
|
@@ -53,53 +56,56 @@
|
|
|
53
56
|
"dependencies": {
|
|
54
57
|
"@mdx-js/mdx": "^3.1.1",
|
|
55
58
|
"@mdx-js/react": "^3.1.1",
|
|
56
|
-
"@rsbuild/core": "~1.5.
|
|
57
|
-
"@rsbuild/plugin-react": "~1.4.
|
|
59
|
+
"@rsbuild/core": "~1.5.17",
|
|
60
|
+
"@rsbuild/plugin-react": "~1.4.1",
|
|
58
61
|
"@rspress/mdx-rs": "0.6.6",
|
|
59
62
|
"@shikijs/rehype": "^3.12.2",
|
|
60
63
|
"@types/unist": "^3.0.3",
|
|
61
|
-
"@unhead/react": "^2.0.
|
|
64
|
+
"@unhead/react": "^2.0.19",
|
|
62
65
|
"cac": "^6.7.14",
|
|
63
66
|
"chokidar": "^3.6.0",
|
|
64
|
-
"enhanced-resolve": "5.18.3",
|
|
65
67
|
"github-slugger": "^2.0.0",
|
|
66
68
|
"hast-util-heading-rank": "^3.0.0",
|
|
67
69
|
"html-to-text": "^9.0.5",
|
|
68
70
|
"lodash-es": "^4.17.21",
|
|
71
|
+
"mdast-util-mdx": "^3.0.0",
|
|
69
72
|
"mdast-util-mdxjs-esm": "^2.0.1",
|
|
70
73
|
"medium-zoom": "1.1.0",
|
|
71
74
|
"picocolors": "^1.1.1",
|
|
72
75
|
"react": "^19.1.1",
|
|
73
76
|
"react-dom": "^19.1.1",
|
|
74
77
|
"react-lazy-with-preload": "^2.2.1",
|
|
78
|
+
"react-reconciler": "0.33.0",
|
|
75
79
|
"react-router-dom": "^6.30.1",
|
|
76
80
|
"rehype-external-links": "^3.0.0",
|
|
77
81
|
"rehype-raw": "^7.0.0",
|
|
78
82
|
"remark-gfm": "^4.0.1",
|
|
83
|
+
"remark-mdx": "^3.1.1",
|
|
79
84
|
"shiki": "^3.12.2",
|
|
80
85
|
"tinyglobby": "^0.2.15",
|
|
81
86
|
"tinypool": "^1.1.1",
|
|
82
87
|
"unified": "^11.0.5",
|
|
83
88
|
"unist-util-visit": "^5.0.0",
|
|
84
89
|
"unist-util-visit-children": "^3.0.0",
|
|
85
|
-
"@rspress/
|
|
86
|
-
"@rspress/theme-default": "2.0.0-beta.
|
|
87
|
-
"@rspress/
|
|
90
|
+
"@rspress/runtime": "2.0.0-beta.35",
|
|
91
|
+
"@rspress/theme-default": "2.0.0-beta.35",
|
|
92
|
+
"@rspress/shared": "2.0.0-beta.35"
|
|
88
93
|
},
|
|
89
94
|
"devDependencies": {
|
|
90
|
-
"@microsoft/api-extractor": "^7.
|
|
91
|
-
"@rslib/core": "0.
|
|
95
|
+
"@microsoft/api-extractor": "^7.53.1",
|
|
96
|
+
"@rslib/core": "0.15.0",
|
|
92
97
|
"@types/hast": "^3.0.4",
|
|
93
98
|
"@types/html-to-text": "^9.0.4",
|
|
94
99
|
"@types/lodash-es": "^4.17.12",
|
|
95
100
|
"@types/mdast": "^4.0.4",
|
|
96
101
|
"@types/node": "^22.8.1",
|
|
97
|
-
"@types/react": "^19.1.
|
|
102
|
+
"@types/react": "^19.1.15",
|
|
98
103
|
"@types/react-dom": "^19.1.9",
|
|
104
|
+
"@types/react-reconciler": "^0.32.1",
|
|
99
105
|
"execa": "8.0.1",
|
|
100
106
|
"mdast-util-directive": "^3.1.0",
|
|
101
107
|
"mdast-util-mdx-expression": "^2.0.1",
|
|
102
|
-
"memfs": "^4.
|
|
108
|
+
"memfs": "^4.48.1",
|
|
103
109
|
"p-map": "^7.0.3",
|
|
104
110
|
"postcss": "8.5.6",
|
|
105
111
|
"rehype-stringify": "^10.0.1",
|
|
@@ -110,8 +116,8 @@
|
|
|
110
116
|
"remark-stringify": "^11.0.0",
|
|
111
117
|
"rimraf": "^6.0.1",
|
|
112
118
|
"rsbuild-plugin-publint": "^0.3.3",
|
|
113
|
-
"rsbuild-plugin-virtual-module": "0.
|
|
114
|
-
"tailwindcss": "^3.4.
|
|
119
|
+
"rsbuild-plugin-virtual-module": "0.4.1",
|
|
120
|
+
"tailwindcss": "^3.4.18",
|
|
115
121
|
"ts-json-schema-generator": "^2.4.0",
|
|
116
122
|
"typescript": "^5.8.2",
|
|
117
123
|
"vfile": "^6.0.3",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|