@rspress/core 2.0.0-beta.2 → 2.0.0-beta.4
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/index.js +7 -21
- package/dist/loader.js +1 -84
- package/dist/runtime/App.d.ts +1 -3
- package/dist/runtime/App.js +2 -4
- package/dist/runtime/ClientApp.js +6 -1
- package/dist/runtime/ssrServerEntry.d.ts +2 -1
- package/dist/runtime/ssrServerEntry.js +5 -3
- package/package.json +18 -17
- package/dist/runtime/tsconfig.js +0 -4
package/dist/index.js
CHANGED
|
@@ -21,7 +21,7 @@ import * as __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__ from "node:fs";
|
|
|
21
21
|
import * as __WEBPACK_EXTERNAL_MODULE__mdx_js_mdx_b904bd09__ from "@mdx-js/mdx";
|
|
22
22
|
import * as __WEBPACK_EXTERNAL_MODULE_enhanced_resolve_bf4706da__ from "enhanced-resolve";
|
|
23
23
|
import * as __WEBPACK_EXTERNAL_MODULE_node_module_ab9f2194__ from "node:module";
|
|
24
|
-
import * as
|
|
24
|
+
import * as __WEBPACK_EXTERNAL_MODULE__unhead_react_server_7e85c952__ from "@unhead/react/server";
|
|
25
25
|
import * as __WEBPACK_EXTERNAL_MODULE__rsbuild_core_1b356efc__ from "@rsbuild/core";
|
|
26
26
|
import * as __WEBPACK_EXTERNAL_MODULE_unist_util_visit_555e002a__ from "unist-util-visit";
|
|
27
27
|
export * from "@rspress/shared";
|
|
@@ -177,7 +177,7 @@ const pluginVirtualModule = (pluginOptions = {})=>({
|
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
});
|
|
180
|
-
var package_namespaceObject = JSON.parse('{"i8":"2.0.0-beta.
|
|
180
|
+
var package_namespaceObject = JSON.parse('{"i8":"2.0.0-beta.4"}');
|
|
181
181
|
const RSPRESS_VERSION = package_namespaceObject.i8;
|
|
182
182
|
const isProduction = ()=>'production' === process.env.NODE_ENV;
|
|
183
183
|
const importStatementRegex = /import\s+(.*?)\s+from\s+(['"])(.*?)(?:"|');?/gm;
|
|
@@ -199,8 +199,6 @@ const OUTPUT_DIR = 'doc_build';
|
|
|
199
199
|
const APP_HTML_MARKER = '<!--<?- DOC_CONTENT ?>-->';
|
|
200
200
|
const HEAD_MARKER = '<!--<?- HEAD ?>-->';
|
|
201
201
|
const META_GENERATOR = '<!--<?- GENERATOR ?>-->';
|
|
202
|
-
const HTML_START_TAG = '<html';
|
|
203
|
-
const BODY_START_TAG = '<body';
|
|
204
202
|
const DEFAULT_TITLE = 'Rspress';
|
|
205
203
|
const PUBLIC_DIR = 'public';
|
|
206
204
|
const constants_TEMP_DIR = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(process.cwd(), 'node_modules', __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__.RSPRESS_TEMP_DIR);
|
|
@@ -1114,28 +1112,21 @@ async function renderPages(routeService, config, pluginDriver, ssrBundlePath, ht
|
|
|
1114
1112
|
routePath: '/404'
|
|
1115
1113
|
});
|
|
1116
1114
|
await Promise.all(allRoutes.filter((route)=>!route.routePath.includes(':')).map(async (route)=>{
|
|
1117
|
-
const
|
|
1115
|
+
const head = (0, __WEBPACK_EXTERNAL_MODULE__unhead_react_server_7e85c952__.createHead)();
|
|
1118
1116
|
const { routePath } = route;
|
|
1119
1117
|
let appHtml = '';
|
|
1120
1118
|
if (render) try {
|
|
1121
|
-
({ appHtml } = await render(routePath,
|
|
1119
|
+
({ appHtml } = await render(routePath, head));
|
|
1122
1120
|
} catch (e) {
|
|
1123
1121
|
__WEBPACK_EXTERNAL_MODULE__rspress_shared_logger_4374e44a__.logger.error(`Page "${__WEBPACK_EXTERNAL_MODULE_picocolors__["default"].yellow(routePath)}" SSG rendering failed.`);
|
|
1124
1122
|
__WEBPACK_EXTERNAL_MODULE__rspress_shared_logger_4374e44a__.logger.debug(e);
|
|
1125
1123
|
throw e;
|
|
1126
1124
|
}
|
|
1127
|
-
const
|
|
1128
|
-
let html = htmlTemplate.replace(/<title>(.*?)<\/title>/gi, '').replace(APP_HTML_MARKER, ()=>appHtml).replace(META_GENERATOR, ()=>`<meta name="generator" content="Rspress v${RSPRESS_VERSION}">`).replace(HEAD_MARKER, [
|
|
1125
|
+
const replacedHtmlTemplate = htmlTemplate.replace(/<title>(.*?)<\/title>/gi, '').replace(APP_HTML_MARKER, ()=>appHtml).replace(META_GENERATOR, ()=>`<meta name="generator" content="Rspress v${RSPRESS_VERSION}">`).replace(HEAD_MARKER, [
|
|
1129
1126
|
await renderConfigHead(config, route),
|
|
1130
|
-
helmet.title.toString(),
|
|
1131
|
-
helmet.meta.toString(),
|
|
1132
|
-
helmet.link.toString(),
|
|
1133
|
-
helmet.style.toString(),
|
|
1134
|
-
helmet.script.toString(),
|
|
1135
1127
|
await renderFrontmatterHead(route)
|
|
1136
1128
|
].join(''));
|
|
1137
|
-
|
|
1138
|
-
if (helmet.bodyAttributes) html = html.replace(BODY_START_TAG, `${BODY_START_TAG} ${helmet.bodyAttributes?.toString()}`);
|
|
1129
|
+
const html = await (0, __WEBPACK_EXTERNAL_MODULE__unhead_react_server_7e85c952__.transformHtmlTemplate)(head, replacedHtmlTemplate);
|
|
1139
1130
|
const normalizeHtmlFilePath = (path)=>{
|
|
1140
1131
|
const normalizedBase = `${(0, __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__.normalizeSlash)(config?.base || '/')}/`;
|
|
1141
1132
|
if (path.endsWith('/')) return `${path}index.html`.replace(normalizedBase, '');
|
|
@@ -1396,6 +1387,7 @@ async function createInternalBuildConfig(userDocRoot, config, enableSSG, routeSe
|
|
|
1396
1387
|
}
|
|
1397
1388
|
},
|
|
1398
1389
|
dev: {
|
|
1390
|
+
lazyCompilation: 'false' !== process.env.RSPRESS_LAZY_COMPILATION,
|
|
1399
1391
|
progressBar: false,
|
|
1400
1392
|
setupMiddlewares: [
|
|
1401
1393
|
(middlewares)=>{
|
|
@@ -1493,12 +1485,6 @@ async function createInternalBuildConfig(userDocRoot, config, enableSSG, routeSe
|
|
|
1493
1485
|
sideEffects: true
|
|
1494
1486
|
});
|
|
1495
1487
|
if (isServer) chain.output.filename(NODE_SSR_BUNDLE_NAME);
|
|
1496
|
-
const enableIncremental = !isProduction() && !process.env.DISABLE_RSPACK_INCREMENTAL;
|
|
1497
|
-
if (enableIncremental) chain.merge({
|
|
1498
|
-
experiments: {
|
|
1499
|
-
incremental: true
|
|
1500
|
-
}
|
|
1501
|
-
});
|
|
1502
1488
|
}
|
|
1503
1489
|
},
|
|
1504
1490
|
environments: {
|
package/dist/loader.js
CHANGED
|
@@ -7,8 +7,6 @@ import * as __WEBPACK_EXTERNAL_MODULE__mdx_js_mdx_b904bd09__ from "@mdx-js/mdx";
|
|
|
7
7
|
import * as __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__ from "@rspress/shared";
|
|
8
8
|
import * as __WEBPACK_EXTERNAL_MODULE__rspress_shared_logger_4374e44a__ from "@rspress/shared/logger";
|
|
9
9
|
import * as __WEBPACK_EXTERNAL_MODULE__rspress_shared_node_utils_78947ce6__ from "@rspress/shared/node-utils";
|
|
10
|
-
import * as __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__ from "node:fs";
|
|
11
|
-
import * as __WEBPACK_EXTERNAL_MODULE_enhanced_resolve_bf4706da__ from "enhanced-resolve";
|
|
12
10
|
import * as __WEBPACK_EXTERNAL_MODULE_node_os_74b4b876__ from "node:os";
|
|
13
11
|
import * as __WEBPACK_EXTERNAL_MODULE_rehype_external_links_09bed11a__ from "rehype-external-links";
|
|
14
12
|
import * as __WEBPACK_EXTERNAL_MODULE_remark_gfm_073acf21__ from "remark-gfm";
|
|
@@ -17,7 +15,6 @@ import * as __WEBPACK_EXTERNAL_MODULE_github_slugger_8e9a17cb__ from "github-slu
|
|
|
17
15
|
import * as __WEBPACK_EXTERNAL_MODULE_hast_util_heading_rank_cff646ba__ from "hast-util-heading-rank";
|
|
18
16
|
import * as __WEBPACK_EXTERNAL_MODULE__rspress_shared_constants_70084e62__ from "@rspress/shared/constants";
|
|
19
17
|
import * as __WEBPACK_EXTERNAL_MODULE_unist_util_visit_children_71921007__ from "unist-util-visit-children";
|
|
20
|
-
const importStatementRegex = /import\s+(.*?)\s+from\s+(['"])(.*?)(?:"|');?/gm;
|
|
21
18
|
`{
|
|
22
19
|
const saved = localStorage.getItem('${__WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__.APPEARANCE_KEY}')
|
|
23
20
|
const preferDark = window.matchMedia('(prefers-color-scheme: dark)').matches
|
|
@@ -45,83 +42,6 @@ var types_RuntimeModuleID = /*#__PURE__*/ function(RuntimeModuleID) {
|
|
|
45
42
|
RuntimeModuleID["PrismLanguages"] = "virtual-prism-languages";
|
|
46
43
|
return RuntimeModuleID;
|
|
47
44
|
}({});
|
|
48
|
-
let resolver;
|
|
49
|
-
let startFlatten = false;
|
|
50
|
-
const processor = (0, __WEBPACK_EXTERNAL_MODULE__mdx_js_mdx_b904bd09__.createProcessor)();
|
|
51
|
-
const { CachedInputFileSystem, ResolverFactory } = __WEBPACK_EXTERNAL_MODULE_enhanced_resolve_bf4706da__["default"];
|
|
52
|
-
const fileSystem = __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"];
|
|
53
|
-
async function resolveDepPath(importPath, importer, alias) {
|
|
54
|
-
if (!resolver) resolver = ResolverFactory.createResolver({
|
|
55
|
-
fileSystem: new CachedInputFileSystem(fileSystem, 0),
|
|
56
|
-
extensions: [
|
|
57
|
-
'.mdx',
|
|
58
|
-
'.md'
|
|
59
|
-
],
|
|
60
|
-
alias
|
|
61
|
-
});
|
|
62
|
-
const resolveResult = await new Promise((resolve, reject)=>{
|
|
63
|
-
resolver.resolve({
|
|
64
|
-
importer
|
|
65
|
-
}, importer, importPath, {}, (err, filePath)=>{
|
|
66
|
-
if (err) return reject(err);
|
|
67
|
-
if (!filePath) return reject(new Error(`Empty result when resolving ${importPath} from ${importer}`));
|
|
68
|
-
return resolve(filePath);
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
return resolveResult;
|
|
72
|
-
}
|
|
73
|
-
async function flattenMdxContent(content, basePath, alias) {
|
|
74
|
-
const deps = [];
|
|
75
|
-
const regex = new RegExp(importStatementRegex);
|
|
76
|
-
if (!regex.test(content)) return {
|
|
77
|
-
flattenContent: content,
|
|
78
|
-
deps
|
|
79
|
-
};
|
|
80
|
-
if (!startFlatten) {
|
|
81
|
-
resolver = ResolverFactory.createResolver({
|
|
82
|
-
fileSystem: new CachedInputFileSystem(fileSystem, 0),
|
|
83
|
-
extensions: [
|
|
84
|
-
'.mdx',
|
|
85
|
-
'.md',
|
|
86
|
-
'.js'
|
|
87
|
-
],
|
|
88
|
-
alias
|
|
89
|
-
});
|
|
90
|
-
startFlatten = true;
|
|
91
|
-
}
|
|
92
|
-
let ast;
|
|
93
|
-
let result = content;
|
|
94
|
-
try {
|
|
95
|
-
ast = processor.parse(content);
|
|
96
|
-
} catch (e) {
|
|
97
|
-
__WEBPACK_EXTERNAL_MODULE__rspress_shared_logger_4374e44a__.logger.debug('flattenMdxContent parse failed: \n', e);
|
|
98
|
-
return {
|
|
99
|
-
flattenContent: content,
|
|
100
|
-
deps
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
const importNodes = ast.children.filter((node)=>'mdxjsEsm' === node.type).flatMap((node)=>node.data?.estree?.body || []).filter((node)=>'ImportDeclaration' === node.type);
|
|
104
|
-
for (const importNode of importNodes){
|
|
105
|
-
const id = importNode.specifiers[0].local.name;
|
|
106
|
-
const importPath = importNode.source.value;
|
|
107
|
-
let absoluteImportPath;
|
|
108
|
-
try {
|
|
109
|
-
absoluteImportPath = await resolveDepPath(importPath, __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].dirname(basePath), alias);
|
|
110
|
-
} catch (_e) {
|
|
111
|
-
continue;
|
|
112
|
-
}
|
|
113
|
-
if (__WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__.MDX_OR_MD_REGEXP.test(absoluteImportPath)) {
|
|
114
|
-
const importedContent = __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].readFileSync(absoluteImportPath, 'utf-8');
|
|
115
|
-
const { flattenContent: replacedValue, deps: subDeps } = await flattenMdxContent(importedContent, absoluteImportPath, alias);
|
|
116
|
-
result = result.replace(new RegExp(`import\\s+${id}\\s+from\\s+['"](${importPath})['"];?`), '').replace(new RegExp(`<${id}\\s*/>`, 'g'), ()=>replacedValue);
|
|
117
|
-
deps.push(...subDeps, absoluteImportPath);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
return {
|
|
121
|
-
flattenContent: result,
|
|
122
|
-
deps
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
45
|
function applyReplaceRules(code = '', replaceRules = []) {
|
|
126
46
|
let result = code;
|
|
127
47
|
for (const rule of replaceRules)result = result.replace(rule.search, rule.replace);
|
|
@@ -486,12 +406,9 @@ async function mdxLoader(source) {
|
|
|
486
406
|
const callback = this.async();
|
|
487
407
|
const options = this.getOptions();
|
|
488
408
|
const filepath = this.resourcePath;
|
|
489
|
-
const { alias } = this._compiler.options.resolve;
|
|
490
409
|
const { config, docDirectory, checkDeadLinks, routeService, pluginDriver } = options;
|
|
491
410
|
const { frontmatter, content } = (0, __WEBPACK_EXTERNAL_MODULE__rspress_shared_node_utils_78947ce6__.loadFrontMatter)(source, filepath, docDirectory, true);
|
|
492
|
-
const
|
|
493
|
-
deps.forEach((dep)=>this.addDependency(dep));
|
|
494
|
-
const replacedContent = applyReplaceRules(flattenContent, config.replaceRules);
|
|
411
|
+
const replacedContent = applyReplaceRules(content, config.replaceRules);
|
|
495
412
|
const preprocessedContent = escapeMarkdownHeadingIds(replacedContent);
|
|
496
413
|
try {
|
|
497
414
|
let pageMeta = {
|
package/dist/runtime/App.d.ts
CHANGED
package/dist/runtime/App.js
CHANGED
|
@@ -2,11 +2,10 @@ import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/j
|
|
|
2
2
|
import * as __WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__ from "@rspress/runtime";
|
|
3
3
|
import * as __WEBPACK_EXTERNAL_MODULE__theme_75e53063__ from "@theme";
|
|
4
4
|
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
|
|
5
|
-
import * as __WEBPACK_EXTERNAL_MODULE_react_helmet_async_048d06c6__ from "react-helmet-async";
|
|
6
5
|
import * as __WEBPACK_EXTERNAL_MODULE_virtual_global_components_43dbb356__ from "virtual-global-components";
|
|
7
6
|
import "virtual-global-styles";
|
|
8
7
|
import * as __WEBPACK_EXTERNAL_MODULE__initPageData_js_731596b5__ from "./initPageData.js";
|
|
9
|
-
function App(
|
|
8
|
+
function App() {
|
|
10
9
|
const { setData: setPageData, data } = (0, __WEBPACK_EXTERNAL_MODULE_react__.useContext)(__WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__.DataContext);
|
|
11
10
|
const { pathname, search } = (0, __WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__.useLocation)();
|
|
12
11
|
(0, __WEBPACK_EXTERNAL_MODULE_react__.useLayoutEffect)(()=>{
|
|
@@ -28,8 +27,7 @@ function App({ helmetContext }) {
|
|
|
28
27
|
const GLOBAL_COMPONENTS_KEY = 'globalUIComponents';
|
|
29
28
|
const query = new URLSearchParams(search);
|
|
30
29
|
const hideGlobalUIComponents = false === frontmatter[GLOBAL_COMPONENTS_KEY] || "0" === query.get(GLOBAL_COMPONENTS_KEY);
|
|
31
|
-
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(
|
|
32
|
-
context: helmetContext,
|
|
30
|
+
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.Fragment, {
|
|
33
31
|
children: [
|
|
34
32
|
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__theme_75e53063__.Layout, {}),
|
|
35
33
|
!hideGlobalUIComponents && __WEBPACK_EXTERNAL_MODULE_virtual_global_components_43dbb356__["default"].map((componentInfo, index)=>{
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
|
|
2
2
|
import * as __WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__ from "@rspress/runtime";
|
|
3
3
|
import * as __WEBPACK_EXTERNAL_MODULE__theme_75e53063__ from "@theme";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE__unhead_react_client_2b506c0d__ from "@unhead/react/client";
|
|
4
5
|
import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
|
|
5
6
|
import * as __WEBPACK_EXTERNAL_MODULE__App_js_3638e61b__ from "./App.js";
|
|
7
|
+
const head = (0, __WEBPACK_EXTERNAL_MODULE__unhead_react_client_2b506c0d__.createHead)();
|
|
6
8
|
function ClientApp({ initialPageData = null }) {
|
|
7
9
|
const [data, setData] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(initialPageData);
|
|
8
10
|
const [theme, setTheme] = (0, __WEBPACK_EXTERNAL_MODULE__theme_75e53063__.useThemeState)();
|
|
@@ -23,7 +25,10 @@ function ClientApp({ initialPageData = null }) {
|
|
|
23
25
|
setData
|
|
24
26
|
]),
|
|
25
27
|
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__.BrowserRouter, {
|
|
26
|
-
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
28
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__unhead_react_client_2b506c0d__.UnheadProvider, {
|
|
29
|
+
head: head,
|
|
30
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__App_js_3638e61b__.App, {})
|
|
31
|
+
})
|
|
27
32
|
})
|
|
28
33
|
})
|
|
29
34
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { PageData } from '@rspress/shared';
|
|
2
|
-
|
|
2
|
+
import { type Unhead } from '@unhead/react/server';
|
|
3
|
+
export declare function render(pagePath: string, head: Unhead): Promise<{
|
|
3
4
|
appHtml: string;
|
|
4
5
|
pageData: PageData;
|
|
5
6
|
}>;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__ from "react/jsx-runtime";
|
|
2
2
|
import * as __WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__ from "@rspress/runtime";
|
|
3
3
|
import * as __WEBPACK_EXTERNAL_MODULE__rspress_runtime_server_673c713a__ from "@rspress/runtime/server";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE__unhead_react_server_7e85c952__ from "@unhead/react/server";
|
|
4
5
|
import * as __WEBPACK_EXTERNAL_MODULE_react_dom_server_98c38d5c__ from "react-dom/server";
|
|
5
6
|
import * as __WEBPACK_EXTERNAL_MODULE__App_js_3638e61b__ from "./App.js";
|
|
6
7
|
import * as __WEBPACK_EXTERNAL_MODULE__initPageData_js_731596b5__ from "./initPageData.js";
|
|
7
8
|
import * as __WEBPACK_EXTERNAL_MODULE_virtual_routes_ssr_f802e6e5__ from "virtual-routes-ssr";
|
|
8
9
|
const DEFAULT_THEME = 'light';
|
|
9
|
-
async function render(pagePath,
|
|
10
|
+
async function render(pagePath, head) {
|
|
10
11
|
const initialPageData = await (0, __WEBPACK_EXTERNAL_MODULE__initPageData_js_731596b5__.initPageData)(pagePath);
|
|
11
12
|
const appHtml = (0, __WEBPACK_EXTERNAL_MODULE_react_dom_server_98c38d5c__.renderToString)(/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__.ThemeContext.Provider, {
|
|
12
13
|
value: {
|
|
@@ -18,8 +19,9 @@ async function render(pagePath, helmetContext) {
|
|
|
18
19
|
},
|
|
19
20
|
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__rspress_runtime_server_673c713a__.StaticRouter, {
|
|
20
21
|
location: pagePath,
|
|
21
|
-
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(
|
|
22
|
-
|
|
22
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__unhead_react_server_7e85c952__.UnheadProvider, {
|
|
23
|
+
value: head,
|
|
24
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__App_js_3638e61b__.App, {})
|
|
23
25
|
})
|
|
24
26
|
})
|
|
25
27
|
})
|
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.4",
|
|
4
4
|
"description": "The Rspress Documentation Framework",
|
|
5
5
|
"bugs": "https://github.com/web-infra-dev/rspress/issues",
|
|
6
6
|
"repository": {
|
|
@@ -45,9 +45,11 @@
|
|
|
45
45
|
"@mdx-js/loader": "^3.1.0",
|
|
46
46
|
"@mdx-js/mdx": "^3.1.0",
|
|
47
47
|
"@mdx-js/react": "^3.1.0",
|
|
48
|
-
"@rsbuild/core": "1.3.
|
|
49
|
-
"@rsbuild/plugin-react": "~1.
|
|
48
|
+
"@rsbuild/core": "1.3.16",
|
|
49
|
+
"@rsbuild/plugin-react": "~1.3.0",
|
|
50
50
|
"@rspress/mdx-rs": "0.6.6",
|
|
51
|
+
"@types/unist": "^3.0.0",
|
|
52
|
+
"@unhead/react": "^2.0.0",
|
|
51
53
|
"enhanced-resolve": "5.18.1",
|
|
52
54
|
"github-slugger": "^2.0.0",
|
|
53
55
|
"hast-util-from-html": "^2.0.3",
|
|
@@ -58,7 +60,6 @@
|
|
|
58
60
|
"picocolors": "^1.1.1",
|
|
59
61
|
"react": "^19.1.0",
|
|
60
62
|
"react-dom": "^19.1.0",
|
|
61
|
-
"react-helmet-async": "^2.0.5",
|
|
62
63
|
"react-lazy-with-preload": "^2.2.1",
|
|
63
64
|
"react-router-dom": "^6.29.0",
|
|
64
65
|
"react-syntax-highlighter": "^15.6.1",
|
|
@@ -70,17 +71,17 @@
|
|
|
70
71
|
"unified": "^11.0.5",
|
|
71
72
|
"unist-util-visit": "^5.0.0",
|
|
72
73
|
"unist-util-visit-children": "^3.0.0",
|
|
73
|
-
"@rspress/plugin-
|
|
74
|
-
"@rspress/plugin-
|
|
75
|
-
"@rspress/plugin-
|
|
76
|
-
"@rspress/
|
|
77
|
-
"@rspress/
|
|
78
|
-
"@rspress/
|
|
79
|
-
"@rspress/
|
|
74
|
+
"@rspress/plugin-container-syntax": "2.0.0-beta.4",
|
|
75
|
+
"@rspress/plugin-last-updated": "2.0.0-beta.4",
|
|
76
|
+
"@rspress/plugin-medium-zoom": "2.0.0-beta.4",
|
|
77
|
+
"@rspress/runtime": "2.0.0-beta.4",
|
|
78
|
+
"@rspress/shared": "2.0.0-beta.4",
|
|
79
|
+
"@rspress/theme-default": "2.0.0-beta.4",
|
|
80
|
+
"@rspress/plugin-auto-nav-sidebar": "2.0.0-beta.4"
|
|
80
81
|
},
|
|
81
82
|
"devDependencies": {
|
|
82
|
-
"@microsoft/api-extractor": "^7.52.
|
|
83
|
-
"@rslib/core": "0.6.
|
|
83
|
+
"@microsoft/api-extractor": "^7.52.7",
|
|
84
|
+
"@rslib/core": "0.6.8",
|
|
84
85
|
"@rspress-dev/plugin-preview": "link:../plugin-preview",
|
|
85
86
|
"@types/hast": "^3.0.4",
|
|
86
87
|
"@types/html-to-text": "^9.0.4",
|
|
@@ -88,9 +89,9 @@
|
|
|
88
89
|
"@types/lodash-es": "^4.17.12",
|
|
89
90
|
"@types/mdast": "^4.0.4",
|
|
90
91
|
"@types/node": "^18.11.17",
|
|
91
|
-
"@types/react": "^18.3.
|
|
92
|
-
"@types/react-dom": "^18.3.
|
|
93
|
-
"memfs": "^4.17.
|
|
92
|
+
"@types/react": "^18.3.21",
|
|
93
|
+
"@types/react-dom": "^18.3.7",
|
|
94
|
+
"memfs": "^4.17.1",
|
|
94
95
|
"postcss": "8.5.3",
|
|
95
96
|
"rehype-stringify": "^10.0.1",
|
|
96
97
|
"remark-mdx": "^3.1.0",
|
|
@@ -98,7 +99,7 @@
|
|
|
98
99
|
"remark-rehype": "^11.1.2",
|
|
99
100
|
"remark-stringify": "^11.0.0",
|
|
100
101
|
"rimraf": "^6.0.1",
|
|
101
|
-
"rsbuild-plugin-publint": "^0.3.
|
|
102
|
+
"rsbuild-plugin-publint": "^0.3.1",
|
|
102
103
|
"rsbuild-plugin-virtual-module": "0.1.1",
|
|
103
104
|
"tailwindcss": "^3.4.17",
|
|
104
105
|
"typescript": "^5.8.2",
|
package/dist/runtime/tsconfig.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
var tsconfig_namespaceObject = JSON.parse('{"compilerOptions":{"rootDir":".","baseUrl":".","skipLibCheck":true,"jsx":"react-jsx","esModuleInterop":true},"include":["./**/*"]}');
|
|
2
|
-
var __webpack_exports__compilerOptions = tsconfig_namespaceObject.compilerOptions;
|
|
3
|
-
var __webpack_exports__include = tsconfig_namespaceObject.include;
|
|
4
|
-
export { __webpack_exports__compilerOptions as compilerOptions, __webpack_exports__include as include };
|