@rspress/core 2.0.0-rc.2 → 2.0.0-rc.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/{0~7675.989ee664.js → 0~7675.723d12b2.js} +18 -15
- package/dist/{5313.6594aba0.js → 3521.9eb6b114.js} +12 -19
- package/dist/4669.69cb6b18.js +1 -0
- package/dist/{5485.2a0273cf.js → 5485.9fc7f63d.js} +5 -5
- package/dist/6289.29817fb4.js +4 -0
- package/dist/8813.4b28f4bb.js +1 -0
- package/dist/9643.2dff683e.js +4 -0
- package/dist/_private/react/render.js +17 -4
- package/dist/cli/config/loadConfigFile.js +2 -2
- package/dist/cli/index.44f3184c.js +2 -0
- package/dist/cli/index.js +3 -3
- package/dist/eject-theme/components/Badge/index.scss +1 -0
- package/dist/eject-theme/components/Banner/index.tsx +3 -1
- package/dist/eject-theme/components/Callout/index.tsx +8 -2
- package/dist/eject-theme/components/CodeBlock/index.scss +8 -6
- package/dist/eject-theme/components/CodeBlock/index.tsx +4 -0
- package/dist/eject-theme/components/CodeBlockRuntime/index.tsx +50 -11
- package/dist/eject-theme/components/DocContent/doc.scss +1 -1
- package/dist/eject-theme/components/DocContent/docComponents/pre.tsx +2 -1
- package/dist/eject-theme/components/DocContent/index.tsx +21 -4
- package/dist/eject-theme/components/DocFooter/index.tsx +1 -6
- package/dist/eject-theme/components/HoverGroup/index.scss +4 -3
- package/dist/eject-theme/components/HoverGroup/index.tsx +104 -22
- package/dist/eject-theme/components/LastUpdated/index.tsx +8 -1
- package/dist/eject-theme/components/Link/index.tsx +9 -2
- package/dist/eject-theme/components/Nav/NavMenu.scss +1 -1
- package/dist/eject-theme/components/Nav/NavMenu.tsx +50 -28
- package/dist/eject-theme/components/NavScreen/NavScreenLangs.scss +6 -0
- package/dist/eject-theme/components/NavScreen/NavScreenLangs.tsx +23 -9
- package/dist/eject-theme/components/NavScreen/NavScreenMenuItem.tsx +26 -11
- package/dist/eject-theme/components/NavScreen/NavScreenVersions.scss +6 -0
- package/dist/eject-theme/components/NavScreen/NavScreenVersions.tsx +22 -9
- package/dist/eject-theme/components/Overview/index.tsx +66 -6
- package/dist/eject-theme/components/{Overview/OverviewGroup.scss → OverviewGroup/index.scss} +66 -12
- package/dist/eject-theme/components/{Overview/OverviewGroup.tsx → OverviewGroup/index.tsx} +50 -3
- package/dist/eject-theme/components/Search/logic/util.test.ts +1 -1
- package/dist/eject-theme/components/Tabs/index.scss +12 -4
- package/dist/eject-theme/components/Tabs/index.tsx +16 -0
- package/dist/eject-theme/components/Tag/index.tsx +84 -5
- package/dist/index.js +7 -11
- package/dist/node/PluginDriver.js +5 -6
- package/dist/node/auto-nav-sidebar/index.js +3 -3
- package/dist/node/auto-nav-sidebar/locales.js +1 -1
- package/dist/node/auto-nav-sidebar/normalize.js +12 -10
- package/dist/node/auto-nav-sidebar/utils.js +2 -2
- package/dist/node/auto-nav-sidebar/walk.js +13 -9
- package/dist/node/constants.d.ts +1 -0
- package/dist/node/constants.js +4 -3
- package/dist/node/eject.js +7 -10
- package/dist/node/initRsbuild.js +25 -11
- package/dist/node/last-updated/index.js +1 -1
- package/dist/node/logger/hint.js +1 -1
- package/dist/node/mdx/loader.7c249a26.js +12 -0
- package/dist/node/mdx/loader.js +2 -1
- package/dist/node/mdx/options.js +9 -6
- package/dist/node/mdx/processor.js +2 -2
- package/dist/node/mdx/rehypePlugins/codeMeta.js +1 -1
- package/dist/node/mdx/rehypePlugins/headerAnchor.js +4 -4
- package/dist/node/mdx/rehypePlugins/shiki.js +1 -1
- package/dist/node/mdx/rehypePlugins/transformers/index.js +5 -5
- package/dist/node/mdx/remarkPlugins/builtin.js +1 -1
- package/dist/node/mdx/remarkPlugins/containerSyntax.js +1 -1
- package/dist/node/mdx/remarkPlugins/fileCodeBlock.js +3 -3
- package/dist/node/mdx/remarkPlugins/image.js +3 -3
- package/dist/node/mdx/remarkPlugins/link.js +3 -3
- package/dist/node/mdx/remarkPlugins/toc.js +3 -3
- package/dist/node/medium-zoom/index.js +1 -1
- package/dist/node/route/RoutePage.js +1 -1
- package/dist/node/route/RouteService.js +3 -3
- package/dist/node/route/extractPageData.js +5 -5
- package/dist/node/route/normalizeRoutePath.js +2 -2
- package/dist/node/runtimeModule/i18n.js +2 -2
- package/dist/node/runtimeModule/pageData/createPageData.js +2 -2
- package/dist/node/runtimeModule/pageData/rsbuildPlugin.js +1 -1
- package/dist/node/runtimeModule/searchHooks.js +1 -1
- package/dist/node/runtimeModule/siteData/createSiteData.js +1 -1
- package/dist/node/runtimeModule/siteData/normalizeThemeConfig.js +1 -1
- package/dist/node/runtimeModule/siteData/rsbuildPlugin.js +1 -1
- package/dist/node/serve.js +1 -1
- package/dist/node/ssg/renderPage.js +2 -2
- package/dist/node/ssg/renderPageWorker.165b5d46.js +1 -0
- package/dist/node/ssg/renderPageWorker.js +2 -2
- package/dist/node/ssg/renderPages.js +3 -3
- package/dist/node/ssg/rsbuildPluginSSG.js +2 -2
- package/dist/node/ssg/ssgEnv.js +1 -1
- package/dist/node/ssg-md/llms/emitLlmsTxt.js +9 -3
- package/dist/node/ssg-md/llms/llmsTxt.js +2 -2
- package/dist/node/ssg-md/remarkSplitMdx.js +141 -99
- package/dist/node/ssg-md/renderPage.js +2 -2
- package/dist/node/ssg-md/renderPages.js +2 -2
- package/dist/node/ssg-md/rsbuildPluginSSGMD.js +2 -2
- package/dist/node/utils/checkLanguageParity.js +1 -1
- package/dist/node/utils/createHash.js +1 -1
- package/dist/node/utils/error.js +2 -1
- package/dist/node/utils/flattenMdxContent.js +5 -5
- package/dist/node/utils/fs.js +1 -1
- package/dist/node/utils/getPageKey.js +1 -1
- package/dist/node/utils/normalizePath.js +3 -3
- package/dist/node/utils/reactAlias.js +2 -2
- package/dist/runtime/App.js +4 -2
- package/dist/runtime/initPageData.js +1 -1
- package/dist/runtime.js +1 -2
- package/dist/shiki-transformers.js +2 -2
- package/dist/theme/assets/deprecated.js +18 -0
- package/dist/theme/assets/experimental.js +21 -0
- package/dist/theme/components/Badge/index.css +1 -0
- package/dist/theme/components/Banner/index.js +2 -2
- package/dist/theme/components/Callout/index.js +5 -2
- package/dist/theme/components/CodeBlock/index.css +7 -6
- package/dist/theme/components/CodeBlock/index.js +4 -1
- package/dist/theme/components/CodeBlockRuntime/index.d.ts +1 -1
- package/dist/theme/components/CodeBlockRuntime/index.js +38 -8
- package/dist/theme/components/DocContent/doc.css +1 -1
- package/dist/theme/components/DocContent/docComponents/pre.js +3 -1
- package/dist/theme/components/DocContent/index.d.ts +11 -2
- package/dist/theme/components/DocContent/index.js +6 -5
- package/dist/theme/components/DocFooter/index.js +1 -5
- package/dist/theme/components/HoverGroup/index.css +6 -5
- package/dist/theme/components/HoverGroup/index.js +88 -17
- package/dist/theme/components/LastUpdated/index.d.ts +1 -1
- package/dist/theme/components/LastUpdated/index.js +5 -1
- package/dist/theme/components/Link/index.d.ts +1 -1
- package/dist/theme/components/Link/index.js +8 -2
- package/dist/theme/components/Nav/NavMenu.css +1 -1
- package/dist/theme/components/Nav/NavMenu.d.ts +6 -1
- package/dist/theme/components/Nav/NavMenu.js +47 -45
- package/dist/theme/components/NavScreen/NavScreenLangs.css +6 -0
- package/dist/theme/components/NavScreen/NavScreenLangs.js +13 -3
- package/dist/theme/components/NavScreen/NavScreenMenuItem.d.ts +1 -1
- package/dist/theme/components/NavScreen/NavScreenMenuItem.js +21 -11
- package/dist/theme/components/NavScreen/NavScreenVersions.css +6 -0
- package/dist/theme/components/NavScreen/NavScreenVersions.js +12 -3
- package/dist/theme/components/Overview/index.d.ts +0 -1
- package/dist/theme/components/Overview/index.js +46 -3
- package/dist/theme/components/{Overview/OverviewGroup.css → OverviewGroup/index.css} +60 -8
- package/dist/theme/components/{Overview/OverviewGroup.d.ts → OverviewGroup/index.d.ts} +1 -1
- package/dist/theme/components/OverviewGroup/index.js +88 -0
- package/dist/theme/components/Search/logic/util.test.js +1 -1
- package/dist/theme/components/Tabs/index.css +6 -5
- package/dist/theme/components/Tabs/index.js +9 -0
- package/dist/theme/components/Tag/index.d.ts +3 -0
- package/dist/theme/components/Tag/index.js +63 -8
- package/dist/theme/hooks/useActiveAnchor.js +1 -1
- package/dist/theme/icons.d.ts +26 -24
- package/dist/theme/icons.js +5 -1
- package/dist/theme/index.d.ts +3 -1
- package/dist/theme/index.js +4 -2
- package/dist/theme/layout/DocLayout/index.css +0 -2
- package/dist/theme/layout/DocLayout/index.js +10 -0
- package/dist/theme/layout/HomeLayout/index.js +40 -0
- package/dist/theme/layout/Layout/index.js +11 -8
- package/dist/theme/layout/NotFountLayout/index.js +1 -1
- package/dist/theme/logic/useAppearance.js +1 -1
- package/dist/theme/logic/useMediaQuery.js +1 -1
- package/dist/theme/logic/useStorageValue.js +6 -3
- package/dist/theme/styles/base.css +1 -0
- package/dist/theme/styles/shiki.css +9 -3
- package/dist/theme/styles/vars/base-vars.css +4 -4
- package/dist/theme/styles/vars/code-vars.css +2 -0
- package/nav-json-schema.json +2 -2
- package/package.json +15 -15
- package/dist/1218.3869bad6.js +0 -2
- package/dist/4669.12208c6a.js +0 -2
- package/dist/6289.c67fe0d5.js +0 -5
- package/dist/7805.cadab34e.js +0 -4
- package/dist/8813.9da1f210.js +0 -2
- package/dist/cli/index.cb89dbd1.js +0 -3
- package/dist/node/mdx/loader.e1578c62.js +0 -13
- package/dist/node/ssg/renderPageWorker.474f9f73.js +0 -2
- package/dist/theme/components/Overview/OverviewGroup.js +0 -57
- /package/dist/eject-theme/components/{Overview → OverviewGroup}/icons/plugin.svg +0 -0
- /package/dist/theme/components/{Overview → OverviewGroup}/icons/plugin.js +0 -0
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import * as __rspack_external_child_process from "child_process";
|
|
2
2
|
import * as __rspack_external_fs from "fs";
|
|
3
|
+
import * as __rspack_external_path from "path";
|
|
3
4
|
import * as __rspack_external_stream from "stream";
|
|
4
5
|
import { __webpack_require__ } from "./rslib-runtime.99091bf6.js";
|
|
5
6
|
import { Buffer } from "node:buffer";
|
|
6
7
|
import node_child_process, { ChildProcess } from "node:child_process";
|
|
7
8
|
import { setTimeout as promises_setTimeout } from "node:timers/promises";
|
|
8
9
|
import { debuglog } from "node:util";
|
|
9
|
-
import { node_process } from "./
|
|
10
|
-
import { node_path } from "./6289.
|
|
11
|
-
import { node_url } from "./5485.
|
|
12
|
-
import {
|
|
13
|
-
import { createWriteStream, createReadStream, readFileSync } from "./5313.6594aba0.js";
|
|
10
|
+
import { node_process, node_os, constants } from "./9643.2dff683e.js";
|
|
11
|
+
import { node_path } from "./6289.29817fb4.js";
|
|
12
|
+
import { node_url } from "./5485.9fc7f63d.js";
|
|
13
|
+
import { createWriteStream, createReadStream, readFileSync } from "./3521.9eb6b114.js";
|
|
14
14
|
__webpack_require__.add({
|
|
15
|
-
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js" (module,
|
|
15
|
+
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
16
16
|
const cp = __webpack_require__("child_process");
|
|
17
17
|
const parse = __webpack_require__("../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js");
|
|
18
18
|
const enoent = __webpack_require__("../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js");
|
|
@@ -71,7 +71,7 @@ __webpack_require__.add({
|
|
|
71
71
|
notFoundError
|
|
72
72
|
};
|
|
73
73
|
},
|
|
74
|
-
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js" (module,
|
|
74
|
+
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
75
75
|
const path = __webpack_require__("path");
|
|
76
76
|
const resolveCommand = __webpack_require__("../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js");
|
|
77
77
|
const escape = __webpack_require__("../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js");
|
|
@@ -151,7 +151,7 @@ __webpack_require__.add({
|
|
|
151
151
|
module.exports.command = escapeCommand;
|
|
152
152
|
module.exports.argument = escapeArgument;
|
|
153
153
|
},
|
|
154
|
-
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js" (module,
|
|
154
|
+
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
155
155
|
const fs = __webpack_require__("fs");
|
|
156
156
|
const shebangCommand = __webpack_require__("../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js");
|
|
157
157
|
function readShebang(command) {
|
|
@@ -167,7 +167,7 @@ __webpack_require__.add({
|
|
|
167
167
|
}
|
|
168
168
|
module.exports = readShebang;
|
|
169
169
|
},
|
|
170
|
-
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js" (module,
|
|
170
|
+
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
171
171
|
const path = __webpack_require__("path");
|
|
172
172
|
const which = __webpack_require__("../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js");
|
|
173
173
|
const getPathKey = __webpack_require__("../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js");
|
|
@@ -198,7 +198,7 @@ __webpack_require__.add({
|
|
|
198
198
|
}
|
|
199
199
|
module.exports = resolveCommand;
|
|
200
200
|
},
|
|
201
|
-
"../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js" (module,
|
|
201
|
+
"../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
202
202
|
__webpack_require__("fs");
|
|
203
203
|
var core;
|
|
204
204
|
core = 'win32' === process.platform || global.TESTING_WINDOWS ? __webpack_require__("../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js") : __webpack_require__("../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js");
|
|
@@ -237,7 +237,7 @@ __webpack_require__.add({
|
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
},
|
|
240
|
-
"../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js" (module,
|
|
240
|
+
"../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
241
241
|
module.exports = isexe;
|
|
242
242
|
isexe.sync = sync;
|
|
243
243
|
var fs = __webpack_require__("fs");
|
|
@@ -266,7 +266,7 @@ __webpack_require__.add({
|
|
|
266
266
|
return ret;
|
|
267
267
|
}
|
|
268
268
|
},
|
|
269
|
-
"../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js" (module,
|
|
269
|
+
"../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
270
270
|
module.exports = isexe;
|
|
271
271
|
isexe.sync = sync;
|
|
272
272
|
var fs = __webpack_require__("fs");
|
|
@@ -294,7 +294,7 @@ __webpack_require__.add({
|
|
|
294
294
|
return checkStat(fs.statSync(path), path, options);
|
|
295
295
|
}
|
|
296
296
|
},
|
|
297
|
-
"../../node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js" (module,
|
|
297
|
+
"../../node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
298
298
|
const { PassThrough } = __webpack_require__("stream");
|
|
299
299
|
module.exports = function() {
|
|
300
300
|
var sources = [];
|
|
@@ -341,7 +341,7 @@ __webpack_require__.add({
|
|
|
341
341
|
module.exports = pathKey;
|
|
342
342
|
module.exports["default"] = pathKey;
|
|
343
343
|
},
|
|
344
|
-
"../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js" (module,
|
|
344
|
+
"../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
345
345
|
const shebangRegex = __webpack_require__("../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js");
|
|
346
346
|
module.exports = (string = '')=>{
|
|
347
347
|
const match = string.match(shebangRegex);
|
|
@@ -355,7 +355,7 @@ __webpack_require__.add({
|
|
|
355
355
|
"../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js" (module) {
|
|
356
356
|
module.exports = /^#!(.*)/;
|
|
357
357
|
},
|
|
358
|
-
"../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js" (module,
|
|
358
|
+
"../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
359
359
|
const isWindows = 'win32' === process.platform || 'cygwin' === process.env.OSTYPE || 'msys' === process.env.OSTYPE;
|
|
360
360
|
const path = __webpack_require__("path");
|
|
361
361
|
const COLON = isWindows ? ';' : ':';
|
|
@@ -448,6 +448,9 @@ __webpack_require__.add({
|
|
|
448
448
|
fs (module) {
|
|
449
449
|
module.exports = __rspack_external_fs;
|
|
450
450
|
},
|
|
451
|
+
path (module) {
|
|
452
|
+
module.exports = __rspack_external_path;
|
|
453
|
+
},
|
|
451
454
|
stream (module) {
|
|
452
455
|
module.exports = __rspack_external_stream;
|
|
453
456
|
}
|
|
@@ -1,21 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { __webpack_require__ } from "./rslib-runtime.99091bf6.js";
|
|
3
|
-
import { matchPath } from "react-router-dom";
|
|
4
|
-
import { DEFAULT_CONFIG_EXTENSIONS, DEFAULT_CONFIG_NAME, DEFAULT_PAGE_EXTENSIONS } from "@rspress/shared/constants";
|
|
5
|
-
import { glob } from "tinyglobby";
|
|
6
|
-
import { PLUGIN_REACT_NAME, pluginReact } from "@rsbuild/plugin-react";
|
|
7
|
-
import { chunk, groupBy } from "lodash-es";
|
|
8
|
-
import { compile } from "@rspress/mdx-rs";
|
|
9
|
-
import { htmlToText } from "html-to-text";
|
|
10
|
-
import node_fs, { createReadStream, createWriteStream, readFileSync } from "node:fs";
|
|
11
|
-
import { mergeRsbuildConfig, rspack as core_rspack } from "@rsbuild/core";
|
|
12
|
-
import { createHash } from "node:crypto";
|
|
13
|
-
import { extname, join } from "./6289.c67fe0d5.js";
|
|
14
|
-
__webpack_require__.add({
|
|
15
|
-
path (module) {
|
|
16
|
-
module.exports = __rspack_external_path;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
1
|
+
import { extname, join } from "./6289.29817fb4.js";
|
|
19
2
|
const PLUGIN_VIRTUAL_MODULE_NAME = 'rsbuild:virtual-module';
|
|
20
3
|
const pluginVirtualModule = (pluginOptions = {})=>({
|
|
21
4
|
name: PLUGIN_VIRTUAL_MODULE_NAME,
|
|
@@ -60,4 +43,14 @@ const pluginVirtualModule = (pluginOptions = {})=>({
|
|
|
60
43
|
}
|
|
61
44
|
}
|
|
62
45
|
});
|
|
63
|
-
export {
|
|
46
|
+
export { matchPath } from "react-router-dom";
|
|
47
|
+
export { DEFAULT_CONFIG_EXTENSIONS, DEFAULT_CONFIG_NAME, DEFAULT_PAGE_EXTENSIONS } from "@rspress/shared/constants";
|
|
48
|
+
export { glob } from "tinyglobby";
|
|
49
|
+
export { PLUGIN_REACT_NAME, pluginReact } from "@rsbuild/plugin-react";
|
|
50
|
+
export { chunk, groupBy } from "lodash-es";
|
|
51
|
+
export { compile } from "@rspress/mdx-rs";
|
|
52
|
+
export { htmlToText } from "html-to-text";
|
|
53
|
+
export { createReadStream, createWriteStream, default as node_fs, readFileSync } from "node:fs";
|
|
54
|
+
export { mergeRsbuildConfig, rspack as core_rspack } from "@rsbuild/core";
|
|
55
|
+
export { createHash } from "node:crypto";
|
|
56
|
+
export { pluginVirtualModule };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { MDX_OR_MD_REGEXP, RSPRESS_TEMP_DIR, SEARCH_INDEX_NAME, addLeadingSlash, addTrailingSlash, getSidebarDataGroup, isDataUrl, isDebugMode, isExternalUrl, isProduction, matchNavbar, matchSidebar, normalizeHref, normalizePosixPath, parseUrl, removeLeadingSlash, removeTrailingSlash, slash, withBase } from "@rspress/shared";
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { createRequire } from "node:module";
|
|
2
|
-
import node_url, { fileURLToPath, pathToFileURL } from "node:url";
|
|
3
|
-
import { createHead, transformHtmlTemplate } from "@unhead/react/server";
|
|
4
1
|
var package_namespaceObject = {
|
|
5
|
-
rE: "2.0.0-rc.
|
|
2
|
+
rE: "2.0.0-rc.4"
|
|
6
3
|
};
|
|
7
4
|
async function pMap(iterable, mapper, { concurrency = 1 / 0, stopOnError = true, signal } = {}) {
|
|
8
5
|
return new Promise((resolve_, reject_)=>{
|
|
@@ -95,4 +92,7 @@ async function pMap(iterable, mapper, { concurrency = 1 / 0, stopOnError = true,
|
|
|
95
92
|
});
|
|
96
93
|
}
|
|
97
94
|
const pMapSkip = Symbol('skip');
|
|
98
|
-
export {
|
|
95
|
+
export { createRequire } from "node:module";
|
|
96
|
+
export { default as node_url, fileURLToPath, pathToFileURL } from "node:url";
|
|
97
|
+
export { createHead, transformHtmlTemplate } from "@unhead/react/server";
|
|
98
|
+
export { pMap, package_namespaceObject };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { logger } from "@rspress/shared/logger";
|
|
2
|
+
export { default as node_path, extname, join, relative } from "node:path";
|
|
3
|
+
export { default as promises, mkdir, readFile, readdir, rm, stat, writeFile } from "node:fs/promises";
|
|
4
|
+
export { default as picocolors } from "picocolors";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { visit } from "unist-util-visit";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { extractTextAndId, getIconUrlPath, getNodeAttribute, loadFrontMatter, mergeDocConfig } from "@rspress/shared/node-utils";
|
|
2
|
+
export { constants, default as node_os } from "node:os";
|
|
3
|
+
export { cwd, default as node_process } from "node:process";
|
|
4
|
+
export { createProcessor, nodeTypes } from "@mdx-js/mdx";
|
|
@@ -29,11 +29,20 @@ function toMarkdown(root) {
|
|
|
29
29
|
case 'i':
|
|
30
30
|
return `*${childrenMd}*`;
|
|
31
31
|
case 'code':
|
|
32
|
+
if (root.parent?.type === 'pre') return childrenMd;
|
|
32
33
|
return `\`${childrenMd}\``;
|
|
33
34
|
case 'pre':
|
|
34
35
|
{
|
|
35
|
-
const
|
|
36
|
-
|
|
36
|
+
const _language = props['data-lang'] || props.language || props.lang || '';
|
|
37
|
+
const language = 'string' == typeof _language ? _language : '';
|
|
38
|
+
const title = props['data-title'] || '';
|
|
39
|
+
const block = [
|
|
40
|
+
'markdown',
|
|
41
|
+
'mdx',
|
|
42
|
+
'md',
|
|
43
|
+
''
|
|
44
|
+
].includes(language) ? '````' : '```';
|
|
45
|
+
return `\n${block}${language}${title ? ` title=${title}` : ''}\n${childrenMd}\n${block}\n`;
|
|
37
46
|
}
|
|
38
47
|
case 'a':
|
|
39
48
|
return `[${childrenMd}](${props.href || '#'})`;
|
|
@@ -88,8 +97,12 @@ function toMarkdown(root) {
|
|
|
88
97
|
}
|
|
89
98
|
async function renderToMarkdownString(element) {
|
|
90
99
|
const container = new MarkdownNode('root');
|
|
91
|
-
const root = reconciler.createContainer(container, 1, null, false, false, '', (
|
|
92
|
-
if (process.env.DEBUG)
|
|
100
|
+
const root = reconciler.createContainer(container, 1, null, false, false, '', (error, info)=>{
|
|
101
|
+
if (process.env.DEBUG) {
|
|
102
|
+
console.error('Reconciler Error:', error, info);
|
|
103
|
+
const message = 'Reconciler Error:' + error.message;
|
|
104
|
+
throw new Error(message);
|
|
105
|
+
}
|
|
93
106
|
}, ()=>{}, (...args)=>{
|
|
94
107
|
if (process.env.DEBUG) console.log('Reconciler onRecoverable Error:', ...args);
|
|
95
108
|
}, ()=>{}, null);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { node_fs, DEFAULT_CONFIG_EXTENSIONS, DEFAULT_CONFIG_NAME } from "../../
|
|
2
|
-
import { node_path, logger } from "../../6289.
|
|
1
|
+
import { node_fs, DEFAULT_CONFIG_EXTENSIONS, DEFAULT_CONFIG_NAME } from "../../3521.9eb6b114.js";
|
|
2
|
+
import { node_path, logger } from "../../6289.29817fb4.js";
|
|
3
3
|
const findConfig = (basePath)=>DEFAULT_CONFIG_EXTENSIONS.map((ext)=>basePath + ext).find(node_fs.existsSync);
|
|
4
4
|
async function loadConfigFile(customConfigFile) {
|
|
5
5
|
const baseDir = process.cwd();
|
package/dist/cli/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { node_path, logger, join, picocolors } from "../6289.
|
|
2
|
-
import { chokidar, cac } from "./index.
|
|
3
|
-
import { package_namespaceObject } from "../5485.
|
|
1
|
+
import { node_path, logger, join, picocolors } from "../6289.29817fb4.js";
|
|
2
|
+
import { chokidar, cac } from "./index.44f3184c.js";
|
|
3
|
+
import { package_namespaceObject } from "../5485.9fc7f63d.js";
|
|
4
4
|
import { loadConfigFile, resolveDocRoot } from "./config/loadConfigFile.js";
|
|
5
5
|
import { dev } from "../node/dev.js";
|
|
6
6
|
import { PUBLIC_DIR } from "../node/constants.js";
|
|
@@ -74,7 +74,9 @@ export const Banner = forwardRef<HTMLDivElement, BannerProps>(
|
|
|
74
74
|
|
|
75
75
|
const [height, setHeight] = useState(36);
|
|
76
76
|
const ref = mergeRefs(forwardedRef, element => {
|
|
77
|
-
|
|
77
|
+
if (element?.offsetHeight) {
|
|
78
|
+
setHeight(element?.offsetHeight);
|
|
79
|
+
}
|
|
78
80
|
});
|
|
79
81
|
const [disable, setDisable] = useState(false);
|
|
80
82
|
|
|
@@ -7,6 +7,10 @@ export interface CalloutProps {
|
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
function capitalize(type: string) {
|
|
11
|
+
return type.charAt(0).toUpperCase() + type.slice(1);
|
|
12
|
+
}
|
|
13
|
+
|
|
10
14
|
/**
|
|
11
15
|
* Construct the DOM structure of the container directive.
|
|
12
16
|
* For example:
|
|
@@ -30,7 +34,9 @@ export function Callout({ type, title, children }: CalloutProps): ReactNode {
|
|
|
30
34
|
if (isDetails) {
|
|
31
35
|
return (
|
|
32
36
|
<details className={`rp-callout rp-callout--${type}`}>
|
|
33
|
-
<summary className="rp-callout__title">
|
|
37
|
+
<summary className="rp-callout__title">
|
|
38
|
+
{title ?? capitalize(type)}
|
|
39
|
+
</summary>
|
|
34
40
|
<div className="rp-callout__content">{children}</div>
|
|
35
41
|
</details>
|
|
36
42
|
);
|
|
@@ -38,7 +44,7 @@ export function Callout({ type, title, children }: CalloutProps): ReactNode {
|
|
|
38
44
|
|
|
39
45
|
return (
|
|
40
46
|
<div className={`rp-callout rp-callout--${type}`}>
|
|
41
|
-
<div className="rp-callout__title">{title}</div>
|
|
47
|
+
<div className="rp-callout__title">{title ?? capitalize(type)}</div>
|
|
42
48
|
<div className="rp-callout__content">{children}</div>
|
|
43
49
|
</div>
|
|
44
50
|
);
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
.rp-codeblock {
|
|
2
2
|
position: relative;
|
|
3
|
-
margin:
|
|
3
|
+
margin: 1rem 0;
|
|
4
4
|
border: var(--rp-code-block-border);
|
|
5
|
+
box-shadow: var(--rp-code-block-shadow);
|
|
6
|
+
|
|
5
7
|
overflow-x: auto;
|
|
6
8
|
transition: none;
|
|
7
9
|
border-radius: var(--rp-radius);
|
|
8
10
|
|
|
9
11
|
@media (max-width: 640px) {
|
|
10
|
-
margin:
|
|
12
|
+
margin: 1.5rem 0;
|
|
11
13
|
contain: content;
|
|
12
14
|
}
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
.rp-codeblock__title {
|
|
16
18
|
font-family: var(--rp-font-family-mono);
|
|
17
|
-
padding:
|
|
19
|
+
padding: 0.75rem 1rem;
|
|
18
20
|
font-size: var(--rp-code-font-size);
|
|
19
21
|
background-color: var(--rp-code-title-bg);
|
|
20
22
|
border-bottom: var(--rp-code-block-border);
|
|
@@ -57,7 +59,7 @@
|
|
|
57
59
|
font-size: var(--rp-code-font-size);
|
|
58
60
|
font-family: var(--rp-font-family-mono);
|
|
59
61
|
display: inline-block;
|
|
60
|
-
padding:
|
|
62
|
+
padding: 1rem 0;
|
|
61
63
|
width: fit-content;
|
|
62
64
|
min-width: 100%;
|
|
63
65
|
line-height: 1.7;
|
|
@@ -74,8 +76,8 @@
|
|
|
74
76
|
& .line::before {
|
|
75
77
|
content: counter(step);
|
|
76
78
|
counter-increment: step;
|
|
77
|
-
width:
|
|
78
|
-
margin-right:
|
|
79
|
+
width: 1rem;
|
|
80
|
+
margin-right: 1rem;
|
|
79
81
|
display: inline-block;
|
|
80
82
|
text-align: right;
|
|
81
83
|
color: rgba(115, 138, 148, 0.4);
|
|
@@ -69,6 +69,10 @@ export function CodeBlock({
|
|
|
69
69
|
codeButtonGroupProps,
|
|
70
70
|
children,
|
|
71
71
|
}: CodeBlockProps) {
|
|
72
|
+
if (process.env.__SSR_MD__) {
|
|
73
|
+
return <>{children}</>;
|
|
74
|
+
}
|
|
75
|
+
|
|
72
76
|
const { codeWrap, toggleCodeWrap, copyElementRef } =
|
|
73
77
|
useCodeButtonGroup(wrapCodeProp);
|
|
74
78
|
return (
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import type { CodeBlockProps } from '@theme';
|
|
2
2
|
import { getCustomMDXComponent } from '@theme';
|
|
3
3
|
import { toJsxRuntime } from 'hast-util-to-jsx-runtime';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
Fragment,
|
|
6
|
+
type ReactNode,
|
|
7
|
+
useEffect,
|
|
8
|
+
useMemo,
|
|
9
|
+
useRef,
|
|
10
|
+
useState,
|
|
11
|
+
} from 'react';
|
|
5
12
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
6
13
|
import {
|
|
7
14
|
type BundledLanguage,
|
|
@@ -47,9 +54,37 @@ export function CodeBlockRuntime({
|
|
|
47
54
|
children: _,
|
|
48
55
|
containerElementClassName,
|
|
49
56
|
onRendered,
|
|
50
|
-
|
|
57
|
+
wrapCode,
|
|
58
|
+
lineNumbers,
|
|
51
59
|
}: CodeBlockRuntimeProps) {
|
|
52
|
-
|
|
60
|
+
// getCustomMDXComponent is stable for theme rendering
|
|
61
|
+
const mdxComponents = useMemo(() => getCustomMDXComponent(), []);
|
|
62
|
+
const { pre: ShikiPre, code: Code, ...otherMdxComponents } = mdxComponents;
|
|
63
|
+
const fallback = useMemo(
|
|
64
|
+
() => (
|
|
65
|
+
<ShikiPre
|
|
66
|
+
title={title}
|
|
67
|
+
lang={lang}
|
|
68
|
+
wrapCode={wrapCode}
|
|
69
|
+
lineNumbers={lineNumbers}
|
|
70
|
+
containerElementClassName={containerElementClassName}
|
|
71
|
+
codeButtonGroupProps={codeButtonGroupProps}
|
|
72
|
+
className="shiki css-variables"
|
|
73
|
+
>
|
|
74
|
+
<Code style={{ padding: '1rem 1.25rem' }}>{code}</Code>
|
|
75
|
+
</ShikiPre>
|
|
76
|
+
),
|
|
77
|
+
[
|
|
78
|
+
title,
|
|
79
|
+
lang,
|
|
80
|
+
wrapCode,
|
|
81
|
+
lineNumbers,
|
|
82
|
+
containerElementClassName,
|
|
83
|
+
codeButtonGroupProps,
|
|
84
|
+
code,
|
|
85
|
+
],
|
|
86
|
+
);
|
|
87
|
+
const [child, setChild] = useState<ReactNode | null>(fallback);
|
|
53
88
|
const codeRef = useLatest(code);
|
|
54
89
|
|
|
55
90
|
useEffect(() => {
|
|
@@ -66,12 +101,6 @@ export function CodeBlockRuntime({
|
|
|
66
101
|
return;
|
|
67
102
|
}
|
|
68
103
|
|
|
69
|
-
const {
|
|
70
|
-
pre: ShikiPre,
|
|
71
|
-
code: Code,
|
|
72
|
-
...otherMdxComponents
|
|
73
|
-
} = getCustomMDXComponent();
|
|
74
|
-
|
|
75
104
|
const reactNode = toJsxRuntime(hast, {
|
|
76
105
|
jsx,
|
|
77
106
|
jsxs,
|
|
@@ -84,8 +113,9 @@ export function CodeBlockRuntime({
|
|
|
84
113
|
lang={lang}
|
|
85
114
|
containerElementClassName={containerElementClassName}
|
|
86
115
|
codeButtonGroupProps={codeButtonGroupProps}
|
|
116
|
+
wrapCode={wrapCode}
|
|
117
|
+
lineNumbers={lineNumbers}
|
|
87
118
|
{...props}
|
|
88
|
-
{...otherProps}
|
|
89
119
|
/>
|
|
90
120
|
),
|
|
91
121
|
code: props => <Code {...props} />,
|
|
@@ -96,7 +126,16 @@ export function CodeBlockRuntime({
|
|
|
96
126
|
setChild(reactNode);
|
|
97
127
|
};
|
|
98
128
|
void highlightCode();
|
|
99
|
-
}, [
|
|
129
|
+
}, [
|
|
130
|
+
code,
|
|
131
|
+
codeButtonGroupProps,
|
|
132
|
+
containerElementClassName,
|
|
133
|
+
lang,
|
|
134
|
+
lineNumbers,
|
|
135
|
+
shikiOptions,
|
|
136
|
+
title,
|
|
137
|
+
wrapCode,
|
|
138
|
+
]);
|
|
100
139
|
|
|
101
140
|
useEffect(() => {
|
|
102
141
|
if (child) {
|
|
@@ -21,7 +21,8 @@ export function ShikiPre({
|
|
|
21
21
|
containerElementClassName={containerElementClassName}
|
|
22
22
|
codeButtonGroupProps={codeButtonGroupProps}
|
|
23
23
|
>
|
|
24
|
-
|
|
24
|
+
{/* data-lang is a meta for SSG-MD */}
|
|
25
|
+
<pre {...otherProps} data-lang={lang} data-title={title} />
|
|
25
26
|
</CodeBlock>
|
|
26
27
|
);
|
|
27
28
|
}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { MDXProvider } from '@mdx-js/react';
|
|
2
2
|
import { Content, usePage, useSite } from '@rspress/core/runtime';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import {
|
|
4
|
+
Callout,
|
|
5
|
+
FallbackHeading,
|
|
6
|
+
getCustomMDXComponent,
|
|
7
|
+
useScrollAfterNav,
|
|
8
|
+
} from '@theme';
|
|
6
9
|
import './doc.scss';
|
|
7
10
|
|
|
8
|
-
|
|
11
|
+
function FallbackTitle() {
|
|
9
12
|
const { site } = useSite();
|
|
10
13
|
const { page } = usePage();
|
|
11
14
|
const { headingTitle, title } = page;
|
|
@@ -19,9 +22,21 @@ export function FallbackTitle() {
|
|
|
19
22
|
export function DocContent({
|
|
20
23
|
components,
|
|
21
24
|
isOverviewPage = false,
|
|
25
|
+
afterDocContent,
|
|
26
|
+
beforeDocContent,
|
|
22
27
|
}: {
|
|
23
28
|
components: Record<string, React.FC<any>> | undefined;
|
|
24
29
|
isOverviewPage?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Optional React node rendered before the main document content.
|
|
32
|
+
* Can be used for banners, notices, or custom elements at the top of the page.
|
|
33
|
+
*/
|
|
34
|
+
beforeDocContent?: React.ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* Optional React node rendered after the main document content.
|
|
37
|
+
* Can be used for footers, navigation, or other content at the bottom of the page.
|
|
38
|
+
*/
|
|
39
|
+
afterDocContent?: React.ReactNode;
|
|
25
40
|
}) {
|
|
26
41
|
useScrollAfterNav();
|
|
27
42
|
|
|
@@ -35,8 +50,10 @@ export function DocContent({
|
|
|
35
50
|
|
|
36
51
|
return (
|
|
37
52
|
<MDXProvider components={mdxComponents}>
|
|
53
|
+
{beforeDocContent}
|
|
38
54
|
{!isOverviewPage && <FallbackTitle />}
|
|
39
55
|
<Content />
|
|
56
|
+
{afterDocContent}
|
|
40
57
|
</MDXProvider>
|
|
41
58
|
);
|
|
42
59
|
}
|
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
import { useSite } from '@rspress/core/runtime';
|
|
2
1
|
import { EditLink, LastUpdated, PrevNextPage } from '@theme';
|
|
3
2
|
import './index.scss';
|
|
4
3
|
|
|
5
4
|
export function DocFooter() {
|
|
6
|
-
const { site } = useSite();
|
|
7
|
-
const { themeConfig } = site;
|
|
8
|
-
const showLastUpdated = themeConfig.lastUpdated;
|
|
9
|
-
|
|
10
5
|
return (
|
|
11
6
|
<footer className="rp-doc-footer">
|
|
12
7
|
<div className="rp-doc-footer__edit">
|
|
13
8
|
<EditLink />
|
|
14
|
-
|
|
9
|
+
<LastUpdated />
|
|
15
10
|
</div>
|
|
16
11
|
<div className="rp-doc-footer__divider" />
|
|
17
12
|
<PrevNextPage />
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
border-radius: 8px;
|
|
15
15
|
border: var(--rp-code-block-border);
|
|
16
16
|
background: var(--rp-c-bg);
|
|
17
|
-
box-shadow:
|
|
17
|
+
box-shadow: var(--rp-shadow-2);
|
|
18
18
|
transition: opacity 0.3s ease-in-out;
|
|
19
19
|
|
|
20
20
|
position: absolute;
|
|
@@ -49,7 +49,6 @@
|
|
|
49
49
|
display: block;
|
|
50
50
|
white-space: nowrap;
|
|
51
51
|
|
|
52
|
-
padding-left: 8px;
|
|
53
52
|
padding-right: 8px;
|
|
54
53
|
|
|
55
54
|
// style
|
|
@@ -64,8 +63,10 @@
|
|
|
64
63
|
line-height: 32px;
|
|
65
64
|
|
|
66
65
|
&__link {
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
gap: 2px;
|
|
67
69
|
// For click area
|
|
68
|
-
display: block;
|
|
69
70
|
height: 100%;
|
|
70
71
|
}
|
|
71
72
|
|