@rspress/core 2.0.0-rc.3 → 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.723d12b2.js +4 -4
- package/dist/{3521.56e42d70.js → 3521.9eb6b114.js} +12 -12
- package/dist/4669.69cb6b18.js +1 -0
- package/dist/{5485.077f14ff.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/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/HoverGroup/index.scss +3 -2
- package/dist/eject-theme/components/HoverGroup/index.tsx +104 -22
- 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/NavScreenMenuItem.tsx +26 -11
- package/dist/eject-theme/components/Overview/index.tsx +65 -0
- package/dist/index.js +7 -11
- package/dist/node/PluginDriver.js +3 -3
- 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 +2 -2
- package/dist/node/auto-nav-sidebar/utils.js +2 -2
- package/dist/node/auto-nav-sidebar/walk.js +13 -9
- package/dist/node/constants.js +2 -2
- package/dist/node/eject.js +2 -5
- package/dist/node/initRsbuild.js +14 -8
- package/dist/node/logger/hint.js +1 -1
- package/dist/node/mdx/loader.7c249a26.js +12 -0
- package/dist/node/mdx/options.js +3 -3
- 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 -7
- package/dist/node/ssg-md/llms/llmsTxt.js +2 -2
- package/dist/node/ssg-md/remarkSplitMdx.js +2 -2
- 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 +1 -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.js +1 -2
- package/dist/shiki-transformers.js +2 -2
- package/dist/theme/components/HoverGroup/index.css +3 -2
- package/dist/theme/components/HoverGroup/index.js +88 -17
- 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/NavScreenMenuItem.d.ts +1 -1
- package/dist/theme/components/NavScreen/NavScreenMenuItem.js +21 -11
- package/dist/theme/components/Overview/index.js +45 -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 +10 -6
- package/dist/theme/logic/useStorageValue.js +6 -3
- package/dist/theme/styles/vars/base-vars.css +2 -2
- package/dist/theme/styles/vars/code-vars.css +2 -2
- package/nav-json-schema.json +2 -2
- package/package.json +6 -6
- package/dist/4669.12208c6a.js +0 -2
- package/dist/6289.c67fe0d5.js +0 -5
- package/dist/8813.9da1f210.js +0 -2
- package/dist/9643.f109822d.js +0 -5
- 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
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
import { node_path,
|
|
2
|
-
import { isExternalUrl } from "../../4669.
|
|
1
|
+
import { node_path, promises } from "../../6289.29817fb4.js";
|
|
2
|
+
import { isExternalUrl } from "../../4669.69cb6b18.js";
|
|
3
|
+
import { pathExists } from "../utils/fs.js";
|
|
3
4
|
import { readJson } from "./utils.js";
|
|
5
|
+
import { createError } from "../utils/error.js";
|
|
4
6
|
import { addRoutePrefix } from "../route/RoutePage.js";
|
|
5
|
-
import { pathExists } from "../utils/fs.js";
|
|
6
7
|
import { hintNavJsonChangeThenPanic } from "../logger/hint.js";
|
|
7
8
|
import { scanSideMeta } from "./normalize.js";
|
|
8
9
|
async function scanNav(workDir, docsDir, metaFileSet) {
|
|
9
10
|
let navConfig;
|
|
10
11
|
const rootNavJson = node_path.resolve(workDir, '_nav.json');
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
const isRootNavJsonExist = await pathExists(rootNavJson);
|
|
13
|
+
if (isRootNavJsonExist) {
|
|
13
14
|
metaFileSet.add(rootNavJson);
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
try {
|
|
16
|
+
navConfig = await readJson(rootNavJson);
|
|
17
|
+
} catch (e) {
|
|
18
|
+
if (e instanceof Error) throw createError(`[auto-nav-sidebar] Generate nav meta error: ${rootNavJson} failed, original error is (${e.message})`);
|
|
19
|
+
throw e;
|
|
20
|
+
}
|
|
21
|
+
} else navConfig = [];
|
|
18
22
|
navConfig.forEach((navItem)=>{
|
|
19
23
|
if ('items' in navItem) navItem.items.forEach((item)=>{
|
|
20
24
|
if ('link' in item && !isExternalUrl(item.link)) item.link = addRoutePrefix(workDir, docsDir, item.link);
|
package/dist/node/constants.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createRequire, package_namespaceObject } from "../5485.
|
|
2
|
-
import { node_path } from "../6289.
|
|
1
|
+
import { createRequire, package_namespaceObject } from "../5485.9fc7f63d.js";
|
|
2
|
+
import { node_path } from "../6289.29817fb4.js";
|
|
3
3
|
const constants_require = createRequire(import.meta.url);
|
|
4
4
|
const RSPRESS_VERSION = package_namespaceObject.rE;
|
|
5
5
|
const APPEARANCE_KEY = 'rspress-theme-appearance';
|
package/dist/node/eject.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { node_path, logger, promises, picocolors } from "../6289.
|
|
1
|
+
import { node_path, logger, promises, picocolors } from "../6289.29817fb4.js";
|
|
2
2
|
import { EJECTED_THEME } from "./constants.js";
|
|
3
3
|
let _themeComponentsPathOverride;
|
|
4
|
-
function __setThemeComponentsPathForTesting(themePath) {
|
|
5
|
-
_themeComponentsPathOverride = themePath;
|
|
6
|
-
}
|
|
7
4
|
function getThemeComponentsPath() {
|
|
8
5
|
if (_themeComponentsPathOverride) return _themeComponentsPathOverride;
|
|
9
6
|
return node_path.join(EJECTED_THEME, 'components');
|
|
@@ -108,4 +105,4 @@ async function listComponents() {
|
|
|
108
105
|
});
|
|
109
106
|
logger.info(`💡 Usage: ${picocolors.dim('rspress eject <ComponentName>')}\n`);
|
|
110
107
|
}
|
|
111
|
-
export {
|
|
108
|
+
export { ejectComponent, listComponents };
|
package/dist/node/initRsbuild.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { createRequire, fileURLToPath, package_namespaceObject } from "../5485.
|
|
2
|
-
import { node_path } from "../6289.
|
|
3
|
-
import { cwd } from "../9643.
|
|
4
|
-
import { PLUGIN_REACT_NAME, pluginReact, pluginVirtualModule } from "../3521.
|
|
5
|
-
import { removeTrailingSlash, MDX_OR_MD_REGEXP } from "../4669.
|
|
1
|
+
import { createRequire, fileURLToPath, package_namespaceObject } from "../5485.9fc7f63d.js";
|
|
2
|
+
import { node_path } from "../6289.29817fb4.js";
|
|
3
|
+
import { cwd } from "../9643.2dff683e.js";
|
|
4
|
+
import { PLUGIN_REACT_NAME, pluginReact, pluginVirtualModule } from "../3521.9eb6b114.js";
|
|
5
|
+
import { removeTrailingSlash, MDX_OR_MD_REGEXP } from "../4669.69cb6b18.js";
|
|
6
6
|
import { createError } from "./utils/error.js";
|
|
7
7
|
import { PUBLIC_DIR, CSR_CLIENT_ENTRY, SSR_CLIENT_ENTRY, OUTPUT_DIR, SSG_MD_SERVER_ENTRY, inlineThemeScript, NODE_SSG_BUNDLE_FOLDER, isProduction, PACKAGE_ROOT, SSR_SERVER_ENTRY, TEMPLATE_PATH, NODE_SSG_MD_BUNDLE_FOLDER, DEFAULT_THEME, NODE_SSG_MD_BUNDLE_NAME, DEFAULT_TITLE, NODE_SSG_BUNDLE_NAME } from "./constants.js";
|
|
8
8
|
import { hintBuilderPluginsBreakingChange, hintThemeBreakingChange } from "./logger/hint.js";
|
|
@@ -245,7 +245,9 @@ async function createInternalBuildConfig(userDocRoot, config, enableSSG, routeSe
|
|
|
245
245
|
},
|
|
246
246
|
define: {
|
|
247
247
|
'process.env.__SSR__': JSON.stringify(false),
|
|
248
|
-
'process.env.__SSR_MD__': JSON.stringify(false)
|
|
248
|
+
'process.env.__SSR_MD__': JSON.stringify(false),
|
|
249
|
+
'import.meta.env.SSR': JSON.stringify(false),
|
|
250
|
+
'import.meta.env.SSG_MD': JSON.stringify(false)
|
|
249
251
|
}
|
|
250
252
|
},
|
|
251
253
|
output: {
|
|
@@ -277,7 +279,9 @@ async function createInternalBuildConfig(userDocRoot, config, enableSSG, routeSe
|
|
|
277
279
|
},
|
|
278
280
|
define: {
|
|
279
281
|
'process.env.__SSR__': JSON.stringify(true),
|
|
280
|
-
'process.env.__SSR_MD__': JSON.stringify(false)
|
|
282
|
+
'process.env.__SSR_MD__': JSON.stringify(false),
|
|
283
|
+
'import.meta.env.SSR': JSON.stringify(true),
|
|
284
|
+
'import.meta.env.SSG_MD': JSON.stringify(false)
|
|
281
285
|
}
|
|
282
286
|
},
|
|
283
287
|
performance: {
|
|
@@ -314,7 +318,9 @@ async function createInternalBuildConfig(userDocRoot, config, enableSSG, routeSe
|
|
|
314
318
|
},
|
|
315
319
|
define: {
|
|
316
320
|
'process.env.__SSR__': JSON.stringify(true),
|
|
317
|
-
'process.env.__SSR_MD__': JSON.stringify(true)
|
|
321
|
+
'process.env.__SSR_MD__': JSON.stringify(true),
|
|
322
|
+
'import.meta.env.SSR': JSON.stringify(true),
|
|
323
|
+
'import.meta.env.SSG_MD': JSON.stringify(true)
|
|
318
324
|
}
|
|
319
325
|
},
|
|
320
326
|
performance: {
|
package/dist/node/logger/hint.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { picocolors, relative, logger, join, readFile } from "../../6289.
|
|
1
|
+
import { picocolors, relative, logger, join, readFile } from "../../6289.29817fb4.js";
|
|
2
2
|
import { pathExists } from "../utils/fs.js";
|
|
3
3
|
const THEME_DEFAULT_EXPORT_PATTERN = /export\s+default\s+\{/;
|
|
4
4
|
const THEME_OLD_IMPORT_0 = /from\s+['"]rspress\/theme['"]/;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { default as rehype } from "@shikijs/rehype";
|
|
2
|
+
export { default as rehype_external_links } from "rehype-external-links";
|
|
3
|
+
export { default as rehype_raw } from "rehype-raw";
|
|
4
|
+
export { default as remark_gfm } from "remark-gfm";
|
|
5
|
+
export { default as remark_mdx } from "remark-mdx";
|
|
6
|
+
export { default as remark_stringify } from "remark-stringify";
|
|
7
|
+
export { unified } from "unified";
|
|
8
|
+
export { default as github_slugger } from "github-slugger";
|
|
9
|
+
export { headingRank } from "hast-util-heading-rank";
|
|
10
|
+
export { transformerAddLang, transformerAddLineNumbers, transformerAddTitle, transformerAddWrapCode } from "@rspress/core/shiki-transformers";
|
|
11
|
+
export { createCssVariablesTheme } from "shiki";
|
|
12
|
+
export { visitChildren } from "unist-util-visit-children";
|
package/dist/node/mdx/options.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { node_path } from "../../6289.
|
|
2
|
-
import { nodeTypes } from "../../9643.
|
|
3
|
-
import { rehype_external_links, rehype_raw, remark_gfm, rehype } from "./loader.
|
|
1
|
+
import { node_path } from "../../6289.29817fb4.js";
|
|
2
|
+
import { nodeTypes } from "../../9643.2dff683e.js";
|
|
3
|
+
import { rehype_external_links, rehype_raw, remark_gfm, rehype } from "./loader.7c249a26.js";
|
|
4
4
|
import { remarkToc } from "./remarkPlugins/toc.js";
|
|
5
5
|
import { remarkContainerSyntax } from "./remarkPlugins/containerSyntax.js";
|
|
6
6
|
import { remarkFileCodeBlock } from "./remarkPlugins/fileCodeBlock.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { node_path } from "../../6289.
|
|
2
|
-
import { createProcessor, loadFrontMatter, extractTextAndId } from "../../9643.
|
|
1
|
+
import { node_path } from "../../6289.29817fb4.js";
|
|
2
|
+
import { createProcessor, loadFrontMatter, extractTextAndId } from "../../9643.2dff683e.js";
|
|
3
3
|
import { createMDXOptions } from "./options.js";
|
|
4
4
|
import { applyReplaceRules } from "../utils/applyReplaceRules.js";
|
|
5
5
|
import { escapeMarkdownHeadingIds } from "../utils/escapeHeadingIds.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { visit } from "../../../8813.
|
|
1
|
+
import { visit } from "../../../8813.4b28f4bb.js";
|
|
2
2
|
const rehypeCodeMeta = ()=>(tree)=>{
|
|
3
3
|
visit(tree, 'element', (node)=>{
|
|
4
4
|
if ('pre' === node.tagName && node.children[0]?.type === 'element' && 'code' === node.children[0].tagName) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { extractTextAndId } from "../../../9643.
|
|
2
|
-
import { github_slugger, headingRank } from "../loader.
|
|
3
|
-
import { visit } from "../../../8813.
|
|
1
|
+
import { extractTextAndId } from "../../../9643.2dff683e.js";
|
|
2
|
+
import { github_slugger, headingRank } from "../loader.7c249a26.js";
|
|
3
|
+
import { visit } from "../../../8813.4b28f4bb.js";
|
|
4
4
|
const rehypeHeaderAnchor = ()=>{
|
|
5
5
|
const slugger = new github_slugger();
|
|
6
6
|
return (tree)=>{
|
|
@@ -50,4 +50,4 @@ function create(node) {
|
|
|
50
50
|
]
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
-
export {
|
|
53
|
+
export { rehypeHeaderAnchor };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { transformerAddLang, transformerAddLineNumbers, transformerAddTitle, createCssVariablesTheme, transformerAddWrapCode } from "../loader.
|
|
1
|
+
import { transformerAddLang, transformerAddLineNumbers, transformerAddTitle, createCssVariablesTheme, transformerAddWrapCode } from "../loader.7c249a26.js";
|
|
2
2
|
const cssVariablesTheme = createCssVariablesTheme({
|
|
3
3
|
name: 'css-variables',
|
|
4
4
|
variablePrefix: '--shiki-',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import "./add-lang.js";
|
|
2
|
+
import "./add-line-numbers.js";
|
|
3
|
+
import "./add-title.js";
|
|
4
|
+
import "./add-wrap-code.js";
|
|
5
|
+
import "./meta-highlight.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { node_path } from "../../../6289.
|
|
1
|
+
import { node_path } from "../../../6289.29817fb4.js";
|
|
2
2
|
import { getDefaultImportAstNode } from "../../utils/getImportAstNode.js";
|
|
3
3
|
const remarkBuiltin = ({ globalComponents })=>(tree)=>{
|
|
4
4
|
const demos = globalComponents.map((componentPath)=>{
|
|
@@ -187,4 +187,4 @@ const remarkContainerSyntax = ()=>{
|
|
|
187
187
|
tree.children.unshift(getNamedImportAstNode('Callout', CALLOUT_COMPONENT, '@theme'));
|
|
188
188
|
};
|
|
189
189
|
};
|
|
190
|
-
export {
|
|
190
|
+
export { remarkContainerSyntax };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { node_path, logger, picocolors, readFile } from "../../../6289.
|
|
2
|
-
import { cwd } from "../../../9643.
|
|
3
|
-
import { visit } from "../../../8813.
|
|
1
|
+
import { node_path, logger, picocolors, readFile } from "../../../6289.29817fb4.js";
|
|
2
|
+
import { cwd } from "../../../9643.2dff683e.js";
|
|
3
|
+
import { visit } from "../../../8813.4b28f4bb.js";
|
|
4
4
|
import { createError } from "../../utils/error.js";
|
|
5
5
|
const ERROR_PREFIX = '[remarkFileCodeBlock]';
|
|
6
6
|
function parseFileFromMeta(meta) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { isExternalUrl } from "../../../4669.
|
|
2
|
-
import { getNodeAttribute } from "../../../9643.
|
|
3
|
-
import { visit } from "../../../8813.
|
|
1
|
+
import { isExternalUrl } from "../../../4669.69cb6b18.js";
|
|
2
|
+
import { getNodeAttribute } from "../../../9643.2dff683e.js";
|
|
3
|
+
import { visit } from "../../../8813.4b28f4bb.js";
|
|
4
4
|
import { getDefaultImportAstNode } from "../../utils/getImportAstNode.js";
|
|
5
5
|
const normalizeImageUrl = (imageUrl)=>{
|
|
6
6
|
if (isExternalUrl(imageUrl) || imageUrl.startsWith('/')) return '';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { node_path, logger, picocolors } from "../../../6289.
|
|
2
|
-
import { isExternalUrl, isProduction, addLeadingSlash, parseUrl, normalizeHref, withBase } from "../../../4669.
|
|
3
|
-
import { visit } from "../../../8813.
|
|
1
|
+
import { node_path, logger, picocolors } from "../../../6289.29817fb4.js";
|
|
2
|
+
import { isExternalUrl, isProduction, addLeadingSlash, parseUrl, normalizeHref, withBase } from "../../../4669.69cb6b18.js";
|
|
3
|
+
import { visit } from "../../../8813.4b28f4bb.js";
|
|
4
4
|
import { hintRelativeMarkdownLink } from "../../logger/hint.js";
|
|
5
5
|
import { createError } from "../../utils/error.js";
|
|
6
6
|
function link_checkDeadLinks(checkDeadLinks, internalLinks, file, lint) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { extractTextAndId } from "../../../9643.
|
|
2
|
-
import { github_slugger, visitChildren } from "../loader.
|
|
1
|
+
import { extractTextAndId } from "../../../9643.2dff683e.js";
|
|
2
|
+
import { github_slugger, visitChildren } from "../loader.7c249a26.js";
|
|
3
3
|
const parseToc = (tree)=>{
|
|
4
4
|
let title = '';
|
|
5
5
|
const toc = [];
|
|
@@ -47,4 +47,4 @@ const remarkToc = function() {
|
|
|
47
47
|
if (title) data.pageMeta.title = title;
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
|
-
export {
|
|
50
|
+
export { remarkToc };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { node_path } from "../../6289.
|
|
1
|
+
import { node_path } from "../../6289.29817fb4.js";
|
|
2
2
|
import { RouteService } from "./RouteService.js";
|
|
3
3
|
import { normalizePath, slash } from "../utils/normalizePath.js";
|
|
4
4
|
import { getPageKey } from "../utils/getPageKey.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { node_path, promises } from "../../6289.
|
|
2
|
-
import { RSPRESS_TEMP_DIR, removeTrailingSlash, addTrailingSlash } from "../../4669.
|
|
3
|
-
import { DEFAULT_PAGE_EXTENSIONS, glob } from "../../3521.
|
|
1
|
+
import { node_path, promises } from "../../6289.29817fb4.js";
|
|
2
|
+
import { RSPRESS_TEMP_DIR, removeTrailingSlash, addTrailingSlash } from "../../4669.69cb6b18.js";
|
|
3
|
+
import { DEFAULT_PAGE_EXTENSIONS, glob } from "../../3521.9eb6b114.js";
|
|
4
4
|
import { PUBLIC_DIR } from "../constants.js";
|
|
5
5
|
import { RoutePage, absolutePathToRoutePath, absolutePathToRelativePath } from "./RoutePage.js";
|
|
6
6
|
import { createError } from "../utils/error.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { node_path, promises } from "../../6289.
|
|
2
|
-
import { htmlToText, compile } from "../../3521.
|
|
3
|
-
import { MDX_OR_MD_REGEXP } from "../../4669.
|
|
4
|
-
import { loadFrontMatter } from "../../9643.
|
|
1
|
+
import { node_path, promises } from "../../6289.29817fb4.js";
|
|
2
|
+
import { htmlToText, compile } from "../../3521.9eb6b114.js";
|
|
3
|
+
import { MDX_OR_MD_REGEXP } from "../../4669.69cb6b18.js";
|
|
4
|
+
import { loadFrontMatter } from "../../9643.2dff683e.js";
|
|
5
5
|
import { applyReplaceRules } from "../utils/applyReplaceRules.js";
|
|
6
6
|
import { flattenMdxContent } from "../utils/flattenMdxContent.js";
|
|
7
7
|
import { importStatementRegex } from "../constants.js";
|
|
@@ -109,4 +109,4 @@ async function extractPageData(routeService, options) {
|
|
|
109
109
|
const pageData = await Promise.all(routeService.getRoutes().map((routeMeta)=>getPageIndexInfoByRoute(routeMeta, options)));
|
|
110
110
|
return pageData;
|
|
111
111
|
}
|
|
112
|
-
export { extractPageData
|
|
112
|
+
export { extractPageData };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { addTrailingSlash, addLeadingSlash } from "../../4669.
|
|
2
|
-
import { DEFAULT_PAGE_EXTENSIONS } from "../../3521.
|
|
1
|
+
import { addTrailingSlash, addLeadingSlash } from "../../4669.69cb6b18.js";
|
|
2
|
+
import { DEFAULT_PAGE_EXTENSIONS } from "../../3521.9eb6b114.js";
|
|
3
3
|
const getRoutePathParts = (relativePath, lang, version, langs, versions)=>{
|
|
4
4
|
const [versionPart, langPart, purePath] = splitRoutePathParts(relativePath, lang, version, langs, versions);
|
|
5
5
|
return [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createRequire } from "../../5485.
|
|
2
|
-
import { picocolors, join, logger } from "../../6289.
|
|
1
|
+
import { createRequire } from "../../5485.9fc7f63d.js";
|
|
2
|
+
import { picocolors, join, logger } from "../../6289.29817fb4.js";
|
|
3
3
|
import { DEFAULT_I18N_TEXT } from "./DEFAULT_I18N_TEXT.js";
|
|
4
4
|
import { createError } from "../utils/error.js";
|
|
5
5
|
import { pathExists } from "../utils/fs.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SEARCH_INDEX_NAME } from "../../../4669.
|
|
2
|
-
import { groupBy } from "../../../3521.
|
|
1
|
+
import { SEARCH_INDEX_NAME } from "../../../4669.69cb6b18.js";
|
|
2
|
+
import { groupBy } from "../../../3521.9eb6b114.js";
|
|
3
3
|
import { extractPageData } from "../../route/extractPageData.js";
|
|
4
4
|
import { createHash } from "../../utils/createHash.js";
|
|
5
5
|
function deletePrivateField(obj) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { pluginVirtualModule } from "../../../3521.
|
|
1
|
+
import { pluginVirtualModule } from "../../../3521.9eb6b114.js";
|
|
2
2
|
import { createPageData } from "./createPageData.js";
|
|
3
3
|
const rsbuildPluginDocVM = async ({ config, userDocRoot, routeService, pluginDriver })=>{
|
|
4
4
|
const ref = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getIconUrlPath } from "../../../9643.
|
|
1
|
+
import { getIconUrlPath } from "../../../9643.2dff683e.js";
|
|
2
2
|
import { normalizeThemeConfig } from "./normalizeThemeConfig.js";
|
|
3
3
|
async function createSiteData(userConfig) {
|
|
4
4
|
const tempSearchObj = Object.assign({}, userConfig.search);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isExternalUrl, slash, addLeadingSlash, normalizeHref } from "../../../4669.
|
|
1
|
+
import { isExternalUrl, slash, addLeadingSlash, normalizeHref } from "../../../4669.69cb6b18.js";
|
|
2
2
|
import { getI18nData } from "../i18n.js";
|
|
3
3
|
import { applyReplaceRules } from "../../utils/applyReplaceRules.js";
|
|
4
4
|
async function normalizeThemeConfig(docConfig) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { logger } from "../../../6289.
|
|
1
|
+
import { logger } from "../../../6289.29817fb4.js";
|
|
2
2
|
import { modifyConfigWithAutoNavSide } from "../../auto-nav-sidebar/index.js";
|
|
3
3
|
import { createSiteData } from "./createSiteData.js";
|
|
4
4
|
const siteDataVMPlugin = (context)=>{
|
package/dist/node/serve.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { mergeRsbuildConfig } from "../3521.
|
|
1
|
+
import { mergeRsbuildConfig } from "../3521.9eb6b114.js";
|
|
2
2
|
import { PluginDriver } from "./PluginDriver.js";
|
|
3
3
|
import { initRsbuild } from "./initRsbuild.js";
|
|
4
4
|
import { RouteService } from "./route/RouteService.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { transformHtmlTemplate, pathToFileURL, createHead } from "../../5485.
|
|
2
|
-
import { logger, picocolors } from "../../6289.
|
|
1
|
+
import { transformHtmlTemplate, pathToFileURL, createHead } from "../../5485.9fc7f63d.js";
|
|
2
|
+
import { logger, picocolors } from "../../6289.29817fb4.js";
|
|
3
3
|
import { hintSSGFailed } from "../logger/hint.js";
|
|
4
4
|
import { renderHtmlTemplate } from "./renderHtmlTemplate.js";
|
|
5
5
|
async function renderPage(route, htmlTemplate, configHead, ssrBundlePath) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { workerData } from "node:worker_threads";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { workerData } from "./renderPageWorker.
|
|
1
|
+
import { workerData } from "./renderPageWorker.165b5d46.js";
|
|
2
2
|
import { createError } from "../utils/error.js";
|
|
3
|
-
import { pMap } from "../../5485.
|
|
3
|
+
import { pMap } from "../../5485.9fc7f63d.js";
|
|
4
4
|
import { renderPage } from "./renderPage.js";
|
|
5
5
|
const params = workerData?.[1]?.params;
|
|
6
6
|
if (!params) throw createError('SSG Worker Thread workerData params missing');
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*! For license information please see renderPages.js.LICENSE.txt */
|
|
2
|
-
import { logger, picocolors } from "../../6289.
|
|
3
|
-
import { chunk } from "../../3521.
|
|
2
|
+
import { logger, picocolors } from "../../6289.29817fb4.js";
|
|
3
|
+
import { chunk } from "../../3521.9eb6b114.js";
|
|
4
4
|
import { SSGWorkerThreadTaskSize, getNumberOfThreads, SSGWorkerThreadRecyclerMaxMemory, SSGConcurrency } from "./ssgEnv.js";
|
|
5
|
-
import { pMap } from "../../5485.
|
|
5
|
+
import { pMap } from "../../5485.9fc7f63d.js";
|
|
6
6
|
import { renderPage } from "./renderPage.js";
|
|
7
7
|
import { hintSSGFailed } from "../logger/hint.js";
|
|
8
8
|
import { renderHtmlTemplate } from "./renderHtmlTemplate.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { logger, writeFile, mkdir, rm, join } from "../../6289.
|
|
2
|
-
import { isDebugMode } from "../../4669.
|
|
1
|
+
import { logger, writeFile, mkdir, rm, join } from "../../6289.29817fb4.js";
|
|
2
|
+
import { isDebugMode } from "../../4669.69cb6b18.js";
|
|
3
3
|
import { NODE_SSG_BUNDLE_FOLDER, NODE_SSG_BUNDLE_NAME } from "../constants.js";
|
|
4
4
|
import { renderPages } from "./renderPages.js";
|
|
5
5
|
const rsbuildPluginSSG = ({ routeService, config })=>({
|
package/dist/node/ssg/ssgEnv.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! For license information please see ssgEnv.js.LICENSE.txt */
|
|
2
|
-
import { node_os } from "../../9643.
|
|
2
|
+
import { node_os } from "../../9643.2dff683e.js";
|
|
3
3
|
/**
|
|
4
4
|
* these codes are copied from
|
|
5
5
|
* @link https://github.com/facebook/docusaurus/blob/45065e8d2b5831117b8d69fec1be28f5520cf105/packages/docusaurus/src/ssg/ssgEnv.ts#L11
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getSidebarDataGroup } from "../../../4669.
|
|
2
|
-
import { matchPath } from "../../../3521.
|
|
1
|
+
import { getSidebarDataGroup } from "../../../4669.69cb6b18.js";
|
|
2
|
+
import { matchPath } from "../../../3521.9eb6b114.js";
|
|
3
3
|
import { generateLlmsTxt, generateLlmsFullTxt } from "./llmsTxt.js";
|
|
4
4
|
async function emitLlmsTxt(config, routeService, emitAsset, mdContents) {
|
|
5
5
|
const base = config.base ?? '/';
|
|
@@ -30,11 +30,13 @@ async function emitLlmsTxt(config, routeService, emitAsset, mdContents) {
|
|
|
30
30
|
}));
|
|
31
31
|
}).flat().filter((i)=>i.activeMatch || i.link) : [];
|
|
32
32
|
const defaultLang = routeService.getDefaultLang();
|
|
33
|
-
const langs =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
const langs = [
|
|
34
|
+
...new Set([
|
|
35
|
+
defaultLang,
|
|
36
|
+
...routeService.getLangs()
|
|
37
|
+
])
|
|
38
|
+
];
|
|
39
|
+
await Promise.all(langs.map(async (lang)=>{
|
|
38
40
|
const navList = noVersionNav.filter((i)=>i.lang === lang);
|
|
39
41
|
const routeGroups = new Array(navList.length).fill(0).map(()=>[]);
|
|
40
42
|
const others = [];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { normalizeHref, withBase } from "../../../4669.
|
|
1
|
+
import { normalizeHref, withBase } from "../../../4669.69cb6b18.js";
|
|
2
2
|
import { extractInfoFromFrontmatterWithAbsolutePath } from "../../auto-nav-sidebar/utils.js";
|
|
3
3
|
function routePathToMdPath(routePath, base) {
|
|
4
4
|
let url = routePath;
|
|
@@ -63,4 +63,4 @@ url: ${routePathToMdPath(routePath, base)}
|
|
|
63
63
|
}
|
|
64
64
|
return lines.join('\n');
|
|
65
65
|
}
|
|
66
|
-
export { generateLlmsFullTxt, generateLlmsTxt
|
|
66
|
+
export { generateLlmsFullTxt, generateLlmsTxt };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { unified, remark_gfm, remark_mdx, remark_stringify } from "../mdx/loader.
|
|
2
|
-
import { visit } from "../../8813.
|
|
1
|
+
import { unified, remark_gfm, remark_mdx, remark_stringify } from "../mdx/loader.7c249a26.js";
|
|
2
|
+
import { visit } from "../../8813.4b28f4bb.js";
|
|
3
3
|
function remarkSplitMdx(options = {}) {
|
|
4
4
|
return (tree)=>{
|
|
5
5
|
const newChildren = [];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { pathToFileURL, createHead } from "../../5485.
|
|
2
|
-
import { logger, picocolors } from "../../6289.
|
|
1
|
+
import { pathToFileURL, createHead } from "../../5485.9fc7f63d.js";
|
|
2
|
+
import { logger, picocolors } from "../../6289.29817fb4.js";
|
|
3
3
|
import { hintSSGFailed } from "../logger/hint.js";
|
|
4
4
|
async function renderPage(route, ssrBundlePath) {
|
|
5
5
|
let render;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { logger, picocolors } from "../../6289.
|
|
2
|
-
import { pMap } from "../../5485.
|
|
1
|
+
import { logger, picocolors } from "../../6289.29817fb4.js";
|
|
2
|
+
import { pMap } from "../../5485.9fc7f63d.js";
|
|
3
3
|
import { renderPage } from "./renderPage.js";
|
|
4
4
|
import { SSGConcurrency } from "../ssg/ssgEnv.js";
|
|
5
5
|
const routePage2MdFilename = (routePath)=>{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { writeFile, mkdir, rm, join } from "../../6289.
|
|
2
|
-
import { isDebugMode } from "../../4669.
|
|
1
|
+
import { writeFile, mkdir, rm, join } from "../../6289.29817fb4.js";
|
|
2
|
+
import { isDebugMode } from "../../4669.69cb6b18.js";
|
|
3
3
|
import { NODE_SSG_MD_BUNDLE_FOLDER, NODE_SSG_MD_BUNDLE_NAME } from "../constants.js";
|
|
4
4
|
import { renderPages } from "./renderPages.js";
|
|
5
5
|
import { emitLlmsTxt } from "./llms/emitLlmsTxt.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { node_path, logger, promises } from "../../6289.
|
|
1
|
+
import { node_path, logger, promises } from "../../6289.29817fb4.js";
|
|
2
2
|
import { createError } from "./error.js";
|
|
3
3
|
function normalizePath(filePath) {
|
|
4
4
|
return filePath.split(node_path.sep).join('/');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createHash as external_node_crypto_createHash } from "../../3521.
|
|
1
|
+
import { createHash as external_node_crypto_createHash } from "../../3521.9eb6b114.js";
|
|
2
2
|
function createHash(str) {
|
|
3
3
|
return external_node_crypto_createHash('sha256').update(str).digest('hex').slice(0, 8);
|
|
4
4
|
}
|
package/dist/node/utils/error.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { node_fs, core_rspack } from "../../3521.
|
|
2
|
-
import { node_path, logger } from "../../6289.
|
|
3
|
-
import { createProcessor } from "../../9643.
|
|
4
|
-
import { MDX_OR_MD_REGEXP } from "../../4669.
|
|
1
|
+
import { node_fs, core_rspack } from "../../3521.9eb6b114.js";
|
|
2
|
+
import { node_path, logger } from "../../6289.29817fb4.js";
|
|
3
|
+
import { createProcessor } from "../../9643.2dff683e.js";
|
|
4
|
+
import { MDX_OR_MD_REGEXP } from "../../4669.69cb6b18.js";
|
|
5
5
|
import { createError } from "./error.js";
|
|
6
6
|
import { importStatementRegex } from "../constants.js";
|
|
7
7
|
const RspackResolveFactory = core_rspack.experiments.resolver.ResolverFactory;
|
|
@@ -71,4 +71,4 @@ async function flattenMdxContent(content, basePath, alias) {
|
|
|
71
71
|
deps
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
|
-
export { flattenMdxContent
|
|
74
|
+
export { flattenMdxContent };
|
package/dist/node/utils/fs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { removeLeadingSlash } from "../../4669.
|
|
1
|
+
import { removeLeadingSlash } from "../../4669.69cb6b18.js";
|
|
2
2
|
function getPageKey(route) {
|
|
3
3
|
const cleanRoute = removeLeadingSlash(route);
|
|
4
4
|
return cleanRoute.replace(/\//g, '_').replace(/\.[^.]+$/, '') || 'index';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { node_os } from "../../9643.
|
|
2
|
-
import { node_path } from "../../6289.
|
|
1
|
+
import { node_os } from "../../9643.2dff683e.js";
|
|
2
|
+
import { node_path } from "../../6289.29817fb4.js";
|
|
3
3
|
const isWindows = 'win32' === node_os.platform();
|
|
4
4
|
function slash(p) {
|
|
5
5
|
return p.replace(/\\/g, '/');
|
|
@@ -7,4 +7,4 @@ function slash(p) {
|
|
|
7
7
|
function normalizePath(id) {
|
|
8
8
|
return node_path.posix.normalize(isWindows ? slash(id) : id);
|
|
9
9
|
}
|
|
10
|
-
export {
|
|
10
|
+
export { normalizePath, slash };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { node_path, logger, picocolors } from "../../6289.
|
|
2
|
-
import { core_rspack } from "../../3521.
|
|
1
|
+
import { node_path, logger, picocolors } from "../../6289.29817fb4.js";
|
|
2
|
+
import { core_rspack } from "../../3521.9eb6b114.js";
|
|
3
3
|
import { pathExists, readJson } from "./fs.js";
|
|
4
4
|
import { PACKAGE_ROOT } from "../constants.js";
|
|
5
5
|
import { hintReactVersion } from "../logger/hint.js";
|
package/dist/runtime/App.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { PageContext, useLocation } from "@rspress/core/runtime";
|
|
3
3
|
import { Layout, Root } from "@theme";
|
|
4
4
|
import react, { useContext, useLayoutEffect } from "react";
|
|
5
5
|
import virtual_global_components from "virtual-global-components";
|
|
@@ -26,7 +26,9 @@ function App() {
|
|
|
26
26
|
const GLOBAL_COMPONENTS_KEY = 'globalUIComponents';
|
|
27
27
|
const query = new URLSearchParams(search);
|
|
28
28
|
const hideGlobalUIComponents = false === frontmatter[GLOBAL_COMPONENTS_KEY] || "0" === query.get(GLOBAL_COMPONENTS_KEY);
|
|
29
|
-
if (process.env.__SSR_MD__) return /*#__PURE__*/ jsx(
|
|
29
|
+
if (process.env.__SSR_MD__) return /*#__PURE__*/ jsx(Root, {
|
|
30
|
+
children: /*#__PURE__*/ jsx(Layout, {})
|
|
31
|
+
});
|
|
30
32
|
return /*#__PURE__*/ jsxs(Root, {
|
|
31
33
|
children: [
|
|
32
34
|
/*#__PURE__*/ jsx(Layout, {}),
|