@rspress/core 2.0.4 → 2.0.6
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~1402.js +1 -0
- package/dist/{0~7675.423f6a06.js → 0~execa.js} +6 -5
- package/dist/1361.js +5 -0
- package/dist/1965.js +7 -0
- package/dist/4454.js +8 -0
- package/dist/{7744.421b464f.js → 675.js} +20 -5
- package/dist/7397.js +18 -0
- package/dist/{5485.7e481fde.js → 8311.js} +5 -2
- package/dist/8474.js +4 -0
- package/dist/8885.js +4 -0
- package/dist/cli/index.js +2 -3
- package/dist/config/loadConfigFile.js +1 -2
- package/dist/eject-theme/components/HomeHero/index.tsx +1 -1
- package/dist/eject-theme/components/HoverGroup/index.tsx +1 -1
- package/dist/eject-theme/components/Llms/LlmsCopyButton.tsx +2 -1
- package/dist/eject-theme/components/Llms/LlmsCopyRow.tsx +2 -1
- package/dist/eject-theme/components/Llms/LlmsViewOptions.tsx +2 -1
- package/dist/eject-theme/components/Llms/copy.ts +12 -0
- package/dist/eject-theme/components/Search/SearchPanel.tsx +2 -0
- package/dist/eject-theme/components/Sidebar/SidebarItem.scss +0 -4
- package/dist/eject-theme/components/Tabs/index.scss +13 -15
- package/dist/index.js +1 -3
- package/dist/node/PluginDriver.js +3 -8
- package/dist/node/auto-nav-sidebar/index.js +1 -2
- package/dist/node/auto-nav-sidebar/locales.js +1 -1
- package/dist/node/auto-nav-sidebar/normalize.js +3 -2
- package/dist/node/auto-nav-sidebar/utils.js +1 -2
- package/dist/node/auto-nav-sidebar/walk.js +1 -2
- package/dist/node/constants.js +1 -2
- package/dist/node/eject.js +1 -1
- package/dist/node/initRsbuild.js +2 -4
- package/dist/node/last-updated/index.js +1 -1
- package/dist/node/logger/hint.js +4 -1
- package/dist/node/mdx/options.js +4 -4
- package/dist/node/mdx/processor.js +1 -2
- package/dist/node/mdx/rehypePlugins/codeMeta.js +1 -1
- package/dist/node/mdx/rehypePlugins/headerAnchor.js +1 -2
- package/dist/node/mdx/rehypePlugins/shiki.d.ts +1 -1
- package/dist/node/mdx/rehypePlugins/shiki.js +1 -1
- package/dist/node/mdx/rehypePlugins/transformers/meta-highlight.js +1 -1
- package/dist/node/mdx/remarkPlugins/builtin.js +1 -1
- package/dist/node/mdx/remarkPlugins/fileCodeBlock.js +1 -2
- package/dist/node/mdx/remarkPlugins/image.js +1 -1
- package/dist/node/mdx/remarkPlugins/link.js +1 -2
- package/dist/node/mdx/remarkPlugins/toc.js +1 -1
- package/dist/node/medium-zoom/index.js +1 -1
- package/dist/node/route/RoutePage.js +2 -2
- package/dist/node/route/RouteService.js +1 -3
- package/dist/node/route/extractPageData.js +1 -3
- package/dist/node/route/normalizeRoutePath.js +1 -2
- package/dist/node/runtimeModule/i18n.js +1 -2
- package/dist/node/runtimeModule/pageData/createPageData.js +1 -2
- package/dist/node/runtimeModule/pageData/rsbuildPlugin.js +1 -2
- 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 +1 -2
- package/dist/node/ssg/renderPageWorker.js +2 -2
- package/dist/node/ssg/renderPages.js +3 -4
- package/dist/node/ssg/rsbuildPluginSSG.js +1 -2
- package/dist/node/ssg/ssgEnv.d.ts +1 -1
- package/dist/node/ssg/ssgEnv.js +2 -2
- package/dist/node/ssg-md/llms/emitLlmsTxt.js +5 -7
- package/dist/node/ssg-md/llms/llmsTxt.js +5 -3
- package/dist/node/ssg-md/remarkSplitMdx.js +1 -2
- package/dist/node/ssg-md/renderPage.js +1 -2
- package/dist/node/ssg-md/renderPages.js +2 -2
- package/dist/node/ssg-md/rsbuildPluginSSGMD.js +1 -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 +1 -3
- package/dist/node/utils/fs.js +1 -1
- package/dist/node/utils/getPageKey.js +1 -1
- package/dist/node/utils/normalizePath.js +1 -2
- package/dist/node/utils/reactAlias.js +15 -10
- package/dist/runtime/index.js +20 -21
- package/dist/runtime/ssrMdServerEntry.js +2 -2
- package/dist/runtime/ssrServerEntry.js +2 -2
- package/dist/runtime/utils.d.ts +1 -1
- package/dist/runtime/utils.js +1 -1
- package/dist/theme/assets/arrow-down.js +1 -1
- package/dist/theme/assets/arrow-right.js +1 -1
- package/dist/theme/assets/close.js +1 -1
- package/dist/theme/assets/copy.js +1 -1
- package/dist/theme/assets/deprecated.js +1 -1
- package/dist/theme/assets/down.js +1 -1
- package/dist/theme/assets/edit.js +1 -1
- package/dist/theme/assets/empty.js +1 -1
- package/dist/theme/assets/experimental.js +1 -1
- package/dist/theme/assets/external-link.js +1 -1
- package/dist/theme/assets/file.js +1 -1
- package/dist/theme/assets/github.js +1 -1
- package/dist/theme/assets/gitlab.js +1 -1
- package/dist/theme/assets/header.js +1 -1
- package/dist/theme/assets/jump.js +1 -1
- package/dist/theme/assets/link.js +1 -1
- package/dist/theme/assets/loading.js +1 -1
- package/dist/theme/assets/menu.js +1 -1
- package/dist/theme/assets/moon.js +1 -1
- package/dist/theme/assets/scroll-to-top.js +1 -1
- package/dist/theme/assets/search.js +1 -1
- package/dist/theme/assets/small-menu.js +1 -1
- package/dist/theme/assets/success.js +1 -1
- package/dist/theme/assets/sun.js +1 -1
- package/dist/theme/assets/title.js +1 -1
- package/dist/theme/assets/wrap.js +1 -1
- package/dist/theme/assets/wrapped.js +1 -1
- package/dist/theme/components/Callout/index.js +2 -1
- package/dist/theme/components/HomeBackground/index.css +1 -0
- package/dist/theme/components/HomeFeature/index.css +3 -3
- package/dist/theme/components/HomeHero/index.d.ts +1 -1
- package/dist/theme/components/HoverGroup/index.d.ts +1 -1
- package/dist/theme/components/Llms/LlmsCopyButton.js +3 -2
- package/dist/theme/components/Llms/LlmsCopyRow.js +2 -1
- package/dist/theme/components/Llms/LlmsViewOptions.js +3 -2
- package/dist/theme/components/Llms/copy.d.ts +1 -0
- package/dist/theme/components/Llms/copy.js +9 -0
- package/dist/theme/components/Llms/index.css +1 -0
- package/dist/theme/components/Llms/index.js +4 -5
- package/dist/theme/components/Nav/index.css +1 -1
- package/dist/theme/components/NavScreen/index.css +1 -1
- package/dist/theme/components/OverviewGroup/icons/plugin.js +1 -1
- package/dist/theme/components/OverviewGroup/index.css +1 -0
- package/dist/theme/components/Search/SearchPanel.js +2 -1
- package/dist/theme/components/Search/logic/providers/LocalProvider.js +1 -1
- package/dist/theme/components/Sidebar/SidebarItem.css +0 -4
- package/dist/theme/components/Tabs/index.css +14 -8
- package/dist/theme/components/Toc/TocItem.css +1 -1
- package/dist/theme/index.js +66 -67
- package/dist/theme/layout/DocLayout/index.css +11 -11
- package/dist/theme/layout/Layout/index.js +14 -4
- package/dist/theme/styles/base.css +6 -3
- package/dist/theme/styles/preflight.css +2 -0
- package/dist/theme/styles/vars/home-vars.css +28 -4
- package/package.json +9 -7
- package/dist/6289.29817fb4.js +0 -4
- package/dist/9348.1beb3e25.js +0 -11
- package/dist/cli/index.44f3184c.js +0 -2
- package/dist/node/mdx/loader.15e0b2d2.js +0 -7
- /package/dist/{node/ssg/renderPageWorker.165b5d46.js → 9224.js} +0 -0
- /package/dist/{rslib-runtime.99091bf6.js → rslib-runtime.js} +0 -0
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { addTrailingSlash, addLeadingSlash } from "../../
|
|
2
|
-
import { DEFAULT_PAGE_EXTENSIONS } from "../../7744.421b464f.js";
|
|
1
|
+
import { addTrailingSlash, DEFAULT_PAGE_EXTENSIONS, addLeadingSlash } from "../../675.js";
|
|
3
2
|
const getRoutePathParts = (relativePath, lang, version, langs, versions)=>{
|
|
4
3
|
const [versionPart, langPart, purePath] = splitRoutePathParts(relativePath, lang, version, langs, versions);
|
|
5
4
|
return [
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { createRequire } from "../../
|
|
2
|
-
import { picocolors, join, logger } from "../../6289.29817fb4.js";
|
|
1
|
+
import { logger, createRequire, join, picocolors } from "../../675.js";
|
|
3
2
|
import { DEFAULT_I18N_TEXT } from "./DEFAULT_I18N_TEXT.js";
|
|
4
3
|
import { createError } from "../utils/error.js";
|
|
5
4
|
import { pathExists } from "../utils/fs.js";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { SEARCH_INDEX_NAME } from "../../../
|
|
2
|
-
import { groupBy } from "../../../7744.421b464f.js";
|
|
1
|
+
import { SEARCH_INDEX_NAME, groupBy } from "../../../675.js";
|
|
3
2
|
import { extractPageData } from "../../route/extractPageData.js";
|
|
4
3
|
import { createHash } from "../../utils/createHash.js";
|
|
5
4
|
function deletePrivateField(obj) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { logger } from "../../../
|
|
2
|
-
import { pluginVirtualModule } from "../../../7744.421b464f.js";
|
|
1
|
+
import { logger, pluginVirtualModule } from "../../../675.js";
|
|
3
2
|
import { createPageData } from "./createPageData.js";
|
|
4
3
|
const rsbuildPluginDocVM = async ({ config, userDocRoot, routeService, pluginDriver })=>{
|
|
5
4
|
const ref = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getIconUrlPath } from "../../../
|
|
1
|
+
import { getIconUrlPath } from "../../../675.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 "../../../
|
|
1
|
+
import { isExternalUrl, slash, addLeadingSlash, normalizeHref } from "../../../675.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 "../../../
|
|
1
|
+
import { logger } from "../../../675.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,5 +1,4 @@
|
|
|
1
|
-
import { transformHtmlTemplate, pathToFileURL,
|
|
2
|
-
import { logger, picocolors } from "../../6289.29817fb4.js";
|
|
1
|
+
import { createHead, logger, transformHtmlTemplate, pathToFileURL, picocolors } from "../../8311.js";
|
|
3
2
|
import { hintSSGFailed } from "../logger/hint.js";
|
|
4
3
|
import { renderHtmlTemplate } from "./renderHtmlTemplate.js";
|
|
5
4
|
async function renderPage(route, htmlTemplate, configHead, ssrBundlePath) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { workerData } from "
|
|
1
|
+
import { workerData } from "../../9224.js";
|
|
2
2
|
import { createError } from "../utils/error.js";
|
|
3
|
-
import { pMap } from "../../
|
|
3
|
+
import { pMap } from "../../8311.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,7 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
import { logger, picocolors } from "../../
|
|
3
|
-
import { chunk } from "../../7744.421b464f.js";
|
|
1
|
+
/*! LICENSE: renderPages.js.LICENSE.txt */
|
|
2
|
+
import { chunk, logger, picocolors } from "../../675.js";
|
|
4
3
|
import { SSGWorkerThreadTaskSize, getNumberOfThreads, SSGWorkerThreadRecyclerMaxMemory, SSGConcurrency } from "./ssgEnv.js";
|
|
5
|
-
import { pMap } from "../../
|
|
4
|
+
import { pMap } from "../../8311.js";
|
|
6
5
|
import { renderPage } from "./renderPage.js";
|
|
7
6
|
import { hintSSGFailed } from "../logger/hint.js";
|
|
8
7
|
import { renderHtmlTemplate } from "./renderHtmlTemplate.js";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { logger, writeFile, mkdir, rm, join } from "../../
|
|
2
|
-
import { isDebugMode } from "../../9348.1beb3e25.js";
|
|
1
|
+
import { logger, writeFile, mkdir, rm, join, isDebugMode } from "../../675.js";
|
|
3
2
|
import { NODE_SSG_BUNDLE_FOLDER, NODE_SSG_BUNDLE_NAME } from "../constants.js";
|
|
4
3
|
import { renderPages } from "./renderPages.js";
|
|
5
4
|
const rsbuildPluginSSG = ({ routeService, config })=>({
|
|
@@ -7,4 +7,4 @@ declare function SSGWorkerThreadTaskSize(): number;
|
|
|
7
7
|
declare function SSGWorkerThreadRecyclerMaxMemory(): number | undefined;
|
|
8
8
|
declare function getNumberOfThreads(pathnamesLength: number): number;
|
|
9
9
|
declare function SSGConcurrency(): number;
|
|
10
|
-
export {
|
|
10
|
+
export { getNumberOfThreads, SSGConcurrency, SSGWorkerThreadRecyclerMaxMemory, SSGWorkerThreadTaskSize, };
|
package/dist/node/ssg/ssgEnv.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
import { node_os } from "../../
|
|
1
|
+
/*! LICENSE: ssgEnv.js.LICENSE.txt */
|
|
2
|
+
import { node_os } from "../../675.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,4 @@
|
|
|
1
|
-
import { getSidebarDataGroup } from "../../../
|
|
2
|
-
import { matchPath } from "../../../7744.421b464f.js";
|
|
1
|
+
import { matchPath, getSidebarDataGroup } from "../../../675.js";
|
|
3
2
|
import { generateLlmsTxt, generateLlmsFullTxt } from "./llmsTxt.js";
|
|
4
3
|
async function emitLlmsTxt(config, routeService, emitAsset, mdContents) {
|
|
5
4
|
const base = config.base ?? '/';
|
|
@@ -87,12 +86,11 @@ function organizeBySidebar(sidebar, routes) {
|
|
|
87
86
|
const currSidebar = getSidebarDataGroup(sidebar, route);
|
|
88
87
|
if (0 === currSidebar.length) return;
|
|
89
88
|
const orderList = flatSidebar(currSidebar);
|
|
89
|
+
const normalizeLink = (p)=>p.replace(/\.html$/, '').replace(/\/index$/, '/');
|
|
90
90
|
routes.sort((a, b)=>{
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
if (-1 === bIndex) bIndex = Number.MAX_SAFE_INTEGER;
|
|
95
|
-
return aIndex - bIndex;
|
|
91
|
+
const aIndex = orderList.findIndex((order)=>matchPath(normalizeLink(order), a));
|
|
92
|
+
const bIndex = orderList.findIndex((order)=>matchPath(normalizeLink(order), b));
|
|
93
|
+
return (-1 === aIndex ? Number.MAX_SAFE_INTEGER : aIndex) - (-1 === bIndex ? Number.MAX_SAFE_INTEGER : bIndex);
|
|
96
94
|
});
|
|
97
95
|
}
|
|
98
96
|
export { emitLlmsTxt };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { normalizeHref, withBase } from "../../../
|
|
1
|
+
import { normalizeHref, logger, withBase } from "../../../675.js";
|
|
2
2
|
import { extractInfoFromFrontmatterWithAbsolutePath } from "../../auto-nav-sidebar/utils.js";
|
|
3
3
|
function routePathToMdPath(routePath, base) {
|
|
4
4
|
let url = routePath;
|
|
@@ -8,7 +8,8 @@ function routePathToMdPath(routePath, base) {
|
|
|
8
8
|
}
|
|
9
9
|
async function generateLlmsTxt(routeGroups, others, navList, title, description, base, routeService) {
|
|
10
10
|
const lines = [];
|
|
11
|
-
|
|
11
|
+
if (!title) logger.warn('No `title` is configured in your Rspress setup. Please set `title` in rspress.config.ts so llms.txt can include an appropriate heading.');
|
|
12
|
+
const summary = title ? `# ${title}${description ? `\n\n> ${description}` : ''}` : '';
|
|
12
13
|
async function genH2Part(nav, routes) {
|
|
13
14
|
const lines = [];
|
|
14
15
|
const { text } = nav;
|
|
@@ -47,7 +48,8 @@ async function generateLlmsTxt(routeGroups, others, navList, title, description,
|
|
|
47
48
|
text: 'Others'
|
|
48
49
|
}, others);
|
|
49
50
|
lines.push(...otherLines);
|
|
50
|
-
|
|
51
|
+
let llmsTxt;
|
|
52
|
+
llmsTxt = summary ? lines.length > 0 ? `${summary}\n${lines.join('\n')}` : summary : lines.join('\n').trimStart();
|
|
51
53
|
return llmsTxt;
|
|
52
54
|
}
|
|
53
55
|
function generateLlmsFullTxt(routeGroups, navList, others, base, mdContents) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { unified, visit, remark_gfm, remark_stringify } from "../../
|
|
2
|
-
import { remark_mdx } from "../mdx/loader.15e0b2d2.js";
|
|
1
|
+
import { unified, visit, remark_gfm, remark_mdx, remark_stringify } from "../../7397.js";
|
|
3
2
|
function remarkSplitMdx(options = {}) {
|
|
4
3
|
return (tree)=>{
|
|
5
4
|
const newChildren = [];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { pathToFileURL,
|
|
2
|
-
import { logger, picocolors } from "../../6289.29817fb4.js";
|
|
1
|
+
import { createHead, logger, pathToFileURL, picocolors } from "../../675.js";
|
|
3
2
|
import { hintSSGFailed } from "../logger/hint.js";
|
|
4
3
|
async function renderPage(route, ssrBundlePath) {
|
|
5
4
|
let render;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { logger, picocolors } from "../../
|
|
2
|
-
import { pMap } from "../../
|
|
1
|
+
import { logger, picocolors } from "../../675.js";
|
|
2
|
+
import { pMap } from "../../8311.js";
|
|
3
3
|
import { renderPage } from "./renderPage.js";
|
|
4
4
|
import { SSGConcurrency } from "../ssg/ssgEnv.js";
|
|
5
5
|
const routePage2MdFilename = (routePath)=>{
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { writeFile, mkdir, rm, join } from "../../
|
|
2
|
-
import { isDebugMode } from "../../9348.1beb3e25.js";
|
|
1
|
+
import { writeFile, mkdir, rm, join, isDebugMode } from "../../675.js";
|
|
3
2
|
import { NODE_SSG_MD_BUNDLE_FOLDER, NODE_SSG_MD_BUNDLE_NAME } from "../constants.js";
|
|
4
3
|
import { renderPages } from "./renderPages.js";
|
|
5
4
|
import { emitLlmsTxt } from "./llms/emitLlmsTxt.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createHash as external_node_crypto_createHash } from "../../
|
|
1
|
+
import { createHash as external_node_crypto_createHash } from "../../675.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,6 +1,4 @@
|
|
|
1
|
-
import { node_fs, core_rspack } from "../../
|
|
2
|
-
import { node_path, logger } from "../../6289.29817fb4.js";
|
|
3
|
-
import { createProcessor, MDX_OR_MD_REGEXP } from "../../9348.1beb3e25.js";
|
|
1
|
+
import { node_fs, node_path, core_rspack, logger, createProcessor, MDX_OR_MD_REGEXP } from "../../675.js";
|
|
4
2
|
import { createError } from "./error.js";
|
|
5
3
|
import { importStatementRegex } from "../constants.js";
|
|
6
4
|
const RspackResolveFactory = core_rspack.experiments.resolver.ResolverFactory;
|
package/dist/node/utils/fs.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { node_path, logger, picocolors } from "../../
|
|
2
|
-
import { core_rspack } from "../../7744.421b464f.js";
|
|
1
|
+
import { node_path, core_rspack, logger, picocolors } from "../../675.js";
|
|
3
2
|
import { pathExists, readJson } from "./fs.js";
|
|
4
3
|
import { PACKAGE_ROOT } from "../constants.js";
|
|
5
4
|
import { hintReactVersion } from "../logger/hint.js";
|
|
@@ -26,7 +25,8 @@ async function resolveReactRouterDomAlias() {
|
|
|
26
25
|
extensions: [
|
|
27
26
|
'.js'
|
|
28
27
|
],
|
|
29
|
-
alias
|
|
28
|
+
alias,
|
|
29
|
+
enablePnp: !!process.versions.pnp
|
|
30
30
|
});
|
|
31
31
|
try {
|
|
32
32
|
const resolved = await resolver.async(basedir, 'react-router-dom/package.json');
|
|
@@ -59,12 +59,16 @@ async function resolveReactAlias(isSSR) {
|
|
|
59
59
|
'.js'
|
|
60
60
|
],
|
|
61
61
|
alias,
|
|
62
|
-
conditionNames:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
conditionNames: [
|
|
63
|
+
...isSSR ? [
|
|
64
|
+
'node'
|
|
65
|
+
] : [
|
|
66
|
+
'browser'
|
|
67
|
+
],
|
|
68
|
+
'import',
|
|
69
|
+
'module'
|
|
70
|
+
],
|
|
71
|
+
enablePnp: !!process.versions.pnp
|
|
68
72
|
});
|
|
69
73
|
await Promise.all(libPaths.map(async (lib)=>{
|
|
70
74
|
try {
|
|
@@ -98,7 +102,8 @@ async function resolveReactRenderToMarkdownAlias() {
|
|
|
98
102
|
'require',
|
|
99
103
|
'node',
|
|
100
104
|
'default'
|
|
101
|
-
]
|
|
105
|
+
],
|
|
106
|
+
enablePnp: !!process.versions.pnp
|
|
102
107
|
});
|
|
103
108
|
try {
|
|
104
109
|
const resolved = await resolver.async(process.cwd(), 'react-render-to-markdown');
|
package/dist/runtime/index.js
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import { isDataUrl, isExternalUrl, matchNavbar, matchSidebar, normalizeHref } from "@rspress/shared";
|
|
2
|
-
import { Head } from "@unhead/react";
|
|
3
|
-
import { Content } from "./Content.js";
|
|
4
|
-
import { useActiveMatcher } from "./hooks/useActiveMatcher.js";
|
|
5
|
-
import { ThemeContext, useDark } from "./hooks/useDark.js";
|
|
6
|
-
import { useFrontmatter } from "./hooks/useFrontmatter.js";
|
|
7
|
-
import { useI18n } from "./hooks/useI18n.js";
|
|
8
|
-
import { useLang } from "./hooks/useLang.js";
|
|
9
|
-
import { useLocaleSiteData } from "./hooks/useLocaleSiteData.js";
|
|
10
|
-
import { useNav } from "./hooks/useNav.js";
|
|
11
|
-
import { PageContext, usePage } from "./hooks/usePage.js";
|
|
12
|
-
import { usePageData } from "./hooks/usePageData.js";
|
|
13
|
-
import { usePages } from "./hooks/usePages.js";
|
|
14
|
-
import { getSidebarDataGroup, useSidebar, useSidebarDynamic } from "./hooks/useSidebar.js";
|
|
15
|
-
import { useSite } from "./hooks/useSite.js";
|
|
16
|
-
import { useVersion } from "./hooks/useVersion.js";
|
|
17
|
-
import { useWindowSize } from "./hooks/useWindowSize.js";
|
|
18
|
-
import { NoSSR } from "./NoSSR.js";
|
|
19
|
-
import { isActive, pathnameToRouteService, preloadLink } from "./route.js";
|
|
20
|
-
import { addLeadingSlash, addTrailingSlash, cleanUrlByConfig, isEqualPath, isProduction, normalizeHrefInRuntime, normalizeImagePath, removeBase, removeTrailingSlash, routePathToMdPath, withBase } from "./utils.js";
|
|
21
1
|
export * from "react-router-dom";
|
|
22
|
-
export {
|
|
2
|
+
export { isDataUrl, isExternalUrl, matchNavbar, matchSidebar, normalizeHref } from "@rspress/shared";
|
|
3
|
+
export { Head } from "@unhead/react";
|
|
4
|
+
export { Content } from "./Content.js";
|
|
5
|
+
export { useActiveMatcher } from "./hooks/useActiveMatcher.js";
|
|
6
|
+
export { ThemeContext, useDark } from "./hooks/useDark.js";
|
|
7
|
+
export { useFrontmatter } from "./hooks/useFrontmatter.js";
|
|
8
|
+
export { useI18n } from "./hooks/useI18n.js";
|
|
9
|
+
export { useLang } from "./hooks/useLang.js";
|
|
10
|
+
export { useLocaleSiteData } from "./hooks/useLocaleSiteData.js";
|
|
11
|
+
export { useNav } from "./hooks/useNav.js";
|
|
12
|
+
export { PageContext, usePage } from "./hooks/usePage.js";
|
|
13
|
+
export { usePageData } from "./hooks/usePageData.js";
|
|
14
|
+
export { usePages } from "./hooks/usePages.js";
|
|
15
|
+
export { getSidebarDataGroup, useSidebar, useSidebarDynamic } from "./hooks/useSidebar.js";
|
|
16
|
+
export { useSite } from "./hooks/useSite.js";
|
|
17
|
+
export { useVersion } from "./hooks/useVersion.js";
|
|
18
|
+
export { useWindowSize } from "./hooks/useWindowSize.js";
|
|
19
|
+
export { NoSSR } from "./NoSSR.js";
|
|
20
|
+
export { isActive, pathnameToRouteService, preloadLink } from "./route.js";
|
|
21
|
+
export { addLeadingSlash, addTrailingSlash, cleanUrlByConfig, isEqualPath, isProduction, normalizeHrefInRuntime, normalizeImagePath, removeBase, removeTrailingSlash, routePathToMdPath, withBase } from "./utils.js";
|
|
@@ -5,7 +5,6 @@ import { renderToMarkdownString } from "react-render-to-markdown";
|
|
|
5
5
|
import { StaticRouter } from "react-router-dom";
|
|
6
6
|
import { App } from "./App.js";
|
|
7
7
|
import { initPageData } from "./initPageData.js";
|
|
8
|
-
import { routes } from "virtual-routes";
|
|
9
8
|
const DEFAULT_THEME = 'light';
|
|
10
9
|
async function preloadRoute(pathname) {
|
|
11
10
|
const route = pathnameToRouteService(pathname);
|
|
@@ -36,4 +35,5 @@ async function render(routePath, head) {
|
|
|
36
35
|
appMd
|
|
37
36
|
};
|
|
38
37
|
}
|
|
39
|
-
export {
|
|
38
|
+
export { routes } from "virtual-routes";
|
|
39
|
+
export { render };
|
|
@@ -7,7 +7,6 @@ import { renderToPipeableStream } from "react-dom/server";
|
|
|
7
7
|
import { StaticRouter } from "react-router-dom";
|
|
8
8
|
import { App } from "./App.js";
|
|
9
9
|
import { initPageData } from "./initPageData.js";
|
|
10
|
-
import { routes } from "virtual-routes";
|
|
11
10
|
const DEFAULT_THEME = 'light';
|
|
12
11
|
async function preloadRoute(pathname) {
|
|
13
12
|
const route = pathnameToRouteService(pathname);
|
|
@@ -53,4 +52,5 @@ async function render(routePath, head) {
|
|
|
53
52
|
appHtml
|
|
54
53
|
};
|
|
55
54
|
}
|
|
56
|
-
export {
|
|
55
|
+
export { routes } from "virtual-routes";
|
|
56
|
+
export { render };
|
package/dist/runtime/utils.d.ts
CHANGED
|
@@ -9,4 +9,4 @@ declare function normalizeHrefInRuntime(link: string): string;
|
|
|
9
9
|
declare function cleanUrlByConfig(link: string): string;
|
|
10
10
|
declare function normalizeImagePath(imagePath: string): string;
|
|
11
11
|
declare function routePathToMdPath(routePath: string): string;
|
|
12
|
-
export { addLeadingSlash, addTrailingSlash,
|
|
12
|
+
export { addLeadingSlash, addTrailingSlash, cleanUrlByConfig, isEqualPath, isProduction, normalizeHrefInRuntime, normalizeImagePath, removeBase, removeTrailingSlash, routePathToMdPath, withBase, };
|
package/dist/runtime/utils.js
CHANGED
|
@@ -31,4 +31,4 @@ function routePathToMdPath(routePath) {
|
|
|
31
31
|
function isAbsoluteUrl(path) {
|
|
32
32
|
return isExternalUrl(path) || isDataUrl(path) || path.startsWith('//');
|
|
33
33
|
}
|
|
34
|
-
export { addLeadingSlash, addTrailingSlash, cleanUrlByConfig, isEqualPath, isProduction, normalizeHrefInRuntime, normalizeImagePath, utils_removeBase as removeBase,
|
|
34
|
+
export { addLeadingSlash, addTrailingSlash, cleanUrlByConfig, isEqualPath, isProduction, normalizeHrefInRuntime, normalizeImagePath, removeTrailingSlash, routePathToMdPath, utils_removeBase as removeBase, utils_withBase as withBase };
|
package/dist/theme/assets/sun.js
CHANGED