@rspress/core 2.0.14 → 2.0.16
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~execa.js +1 -1
- package/dist/3358.js +1 -1
- package/dist/5580.js +1 -1
- package/dist/{4942.js → 6010.js} +1 -1
- package/dist/8005.js +1 -1
- package/dist/{7261.js → 9958.js} +2 -1
- package/dist/cli/index.js +6 -6
- package/dist/eject-theme/components/Callout/index.scss +32 -0
- package/dist/eject-theme/components/Callout/index.tsx +9 -1
- package/dist/eject-theme/components/DocContent/doc.scss +2 -2
- package/dist/eject-theme/components/HomeBackground/useNavTransparent.tsx +2 -2
- package/dist/eject-theme/components/HoverGroup/index.scss +1 -1
- package/dist/eject-theme/components/LastUpdated/index.tsx +8 -2
- package/dist/eject-theme/components/Link/useLinkNavigate.ts +1 -1
- package/dist/eject-theme/components/Llms/LlmsContainer.tsx +1 -1
- package/dist/eject-theme/components/Nav/NavMenu.scss +1 -1
- package/dist/eject-theme/components/Nav/hooks.tsx +18 -14
- package/dist/eject-theme/components/Nav/index.tsx +4 -1
- package/dist/eject-theme/components/NavScreen/NavScreenAppearance.tsx +4 -1
- package/dist/eject-theme/components/NavScreen/NavScreenMenuItem.scss +3 -0
- package/dist/eject-theme/components/NavScreen/NavScreenMenuOthers.tsx +4 -1
- package/dist/eject-theme/components/Overview/index.tsx +1 -2
- package/dist/eject-theme/components/Overview/utils.ts +4 -10
- package/dist/eject-theme/components/Search/SearchPanel.tsx +23 -17
- package/dist/eject-theme/components/Search/logic/providers/LocalProvider.ts +3 -1
- package/dist/eject-theme/components/SidebarMenu/useClickOutside.ts +1 -2
- package/dist/index.d.ts +1 -1
- package/dist/node/PluginDriver.js +4 -4
- package/dist/node/auto-nav-sidebar/index.js +1 -1
- package/dist/node/auto-nav-sidebar/locales.js +1 -1
- package/dist/node/auto-nav-sidebar/normalize.js +1 -1
- package/dist/node/auto-nav-sidebar/utils.js +1 -1
- package/dist/node/auto-nav-sidebar/walk.d.ts +4 -2
- package/dist/node/auto-nav-sidebar/walk.js +3 -3
- package/dist/node/constants.d.ts +2 -1
- package/dist/node/constants.js +12 -6
- package/dist/node/initRsbuild.js +8 -15
- package/dist/node/last-updated/index.d.ts +3 -3
- package/dist/node/last-updated/index.js +24 -9
- package/dist/node/mdx/options.js +8 -1
- package/dist/node/mdx/processor.js +3 -1
- package/dist/node/mdx/rehypePlugins/headerAnchor.d.ts +1 -1
- package/dist/node/mdx/rehypePlugins/headerAnchor.js +10 -6
- package/dist/node/mdx/remarkPlugins/containerSyntax.d.ts +2 -1
- package/dist/node/mdx/remarkPlugins/containerSyntax.js +13 -6
- package/dist/node/mdx/remarkPlugins/link.js +91 -16
- package/dist/node/mdx/remarkPlugins/toc.d.ts +8 -1
- package/dist/node/mdx/remarkPlugins/toc.js +44 -15
- package/dist/node/route/RoutePage.js +1 -1
- package/dist/node/route/RouteService.d.ts +6 -0
- package/dist/node/route/RouteService.js +41 -7
- package/dist/node/route/extractPageData.js +1 -1
- package/dist/node/route/normalizeRoutePath.js +1 -1
- package/dist/node/runtimeModule/DEFAULT_I18N_TEXT.d.ts +7 -0
- package/dist/node/runtimeModule/DEFAULT_I18N_TEXT.js +7 -0
- package/dist/node/runtimeModule/i18n.js +1 -1
- package/dist/node/runtimeModule/pageData/createPageData.js +2 -1
- 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 +12 -2
- package/dist/node/runtimeModule/siteData/rsbuildPlugin.js +1 -1
- package/dist/node/serve.js +1 -1
- package/dist/node/ssg/htmlFile.js +1 -1
- package/dist/node/ssg/renderPage.js +1 -1
- package/dist/node/ssg/renderPageWorker.js +1 -1
- package/dist/node/ssg/renderPages.js +2 -2
- package/dist/node/ssg/rsbuildPluginCSR.js +2 -1
- package/dist/node/ssg/rsbuildPluginSSG.js +5 -3
- package/dist/node/ssg/ssgEnv.js +1 -1
- package/dist/node/ssg-md/llms/emitLlmsTxt.js +1 -1
- package/dist/node/ssg-md/llms/llmsTxt.js +1 -1
- package/dist/node/ssg-md/renderPage.js +1 -1
- package/dist/node/ssg-md/renderPages.js +2 -2
- package/dist/node/ssg-md/rsbuildPluginSSGMD.js +3 -2
- package/dist/node/utils/checkLanguageParity.js +1 -1
- package/dist/node/utils/createHash.js +1 -1
- package/dist/node/utils/flattenMdxContent.js +1 -1
- package/dist/node/utils/getPageKey.js +1 -1
- package/dist/node/utils/reactAlias.js +1 -1
- package/dist/runtime/App.d.ts +2 -1
- package/dist/runtime/App.js +1 -1
- package/dist/runtime/ClientApp.d.ts +1 -1
- package/dist/runtime/ClientApp.js +2 -1
- package/dist/runtime/Content.d.ts +1 -1
- package/dist/runtime/NoSSR.d.ts +1 -1
- package/dist/theme/components/Badge/index.d.ts +1 -1
- package/dist/theme/components/Callout/index.css +29 -0
- package/dist/theme/components/Callout/index.d.ts +1 -1
- package/dist/theme/components/CodeBlock/index.d.ts +1 -1
- package/dist/theme/components/CodeButtonGroup/CopyCodeButton.d.ts +1 -1
- package/dist/theme/components/CodeButtonGroup/index.d.ts +1 -1
- package/dist/theme/components/DocContent/doc.css +2 -2
- package/dist/theme/components/DocContent/docComponents/a.d.ts +1 -1
- package/dist/theme/components/DocContent/docComponents/code.d.ts +1 -1
- package/dist/theme/components/DocContent/docComponents/hr.d.ts +1 -1
- package/dist/theme/components/DocContent/docComponents/img.d.ts +1 -1
- package/dist/theme/components/DocContent/docComponents/index.d.ts +18 -18
- package/dist/theme/components/DocContent/docComponents/list.d.ts +3 -3
- package/dist/theme/components/DocContent/docComponents/paragraph.d.ts +3 -3
- package/dist/theme/components/DocContent/docComponents/pre.d.ts +1 -1
- package/dist/theme/components/DocContent/docComponents/table.d.ts +3 -3
- package/dist/theme/components/DocContent/docComponents/title.d.ts +6 -6
- package/dist/theme/components/DocContent/index.d.ts +1 -1
- package/dist/theme/components/DocFooter/index.d.ts +1 -1
- package/dist/theme/components/EditLink/index.d.ts +1 -1
- package/dist/theme/components/FallbackHeading/index.d.ts +1 -1
- package/dist/theme/components/HomeBackground/index.d.ts +1 -1
- package/dist/theme/components/HomeBackground/useNavTransparent.d.ts +1 -1
- package/dist/theme/components/HomeBackground/useNavTransparent.js +2 -2
- package/dist/theme/components/HomeFeature/useCardAnimation.d.ts +1 -1
- package/dist/theme/components/HomeFooter/index.d.ts +1 -1
- package/dist/theme/components/HomeHero/index.d.ts +1 -1
- package/dist/theme/components/HoverGroup/index.css +1 -1
- package/dist/theme/components/HoverGroup/index.d.ts +1 -1
- package/dist/theme/components/HoverGroup/useHoverGroup.d.ts +1 -1
- package/dist/theme/components/LastUpdated/index.d.ts +1 -1
- package/dist/theme/components/LastUpdated/index.js +13 -3
- package/dist/theme/components/Link/useLinkNavigate.js +1 -1
- package/dist/theme/components/Llms/LlmsContainer.d.ts +2 -3
- package/dist/theme/components/Llms/LlmsCopyButton.d.ts +1 -1
- package/dist/theme/components/Llms/LlmsCopyRow.d.ts +1 -1
- package/dist/theme/components/Llms/LlmsOpenRow.d.ts +1 -1
- package/dist/theme/components/Llms/LlmsViewOptions.d.ts +1 -1
- package/dist/theme/components/Nav/NavMenu.css +1 -1
- package/dist/theme/components/Nav/NavMenu.d.ts +9 -9
- package/dist/theme/components/Nav/hooks.js +6 -3
- package/dist/theme/components/Nav/index.d.ts +1 -1
- package/dist/theme/components/Nav/index.js +2 -1
- package/dist/theme/components/NavHamburger/index.d.ts +1 -1
- package/dist/theme/components/NavScreen/NavScreenAppearance.d.ts +1 -1
- package/dist/theme/components/NavScreen/NavScreenAppearance.js +2 -1
- package/dist/theme/components/NavScreen/NavScreenLangs.d.ts +1 -1
- package/dist/theme/components/NavScreen/NavScreenMenu.d.ts +1 -1
- package/dist/theme/components/NavScreen/NavScreenMenuItem.css +10 -1
- package/dist/theme/components/NavScreen/NavScreenMenuItem.d.ts +5 -5
- package/dist/theme/components/NavScreen/NavScreenMenuOthers.d.ts +1 -1
- package/dist/theme/components/NavScreen/NavScreenMenuOthers.js +2 -1
- package/dist/theme/components/NavScreen/NavScreenVersions.d.ts +1 -1
- package/dist/theme/components/NavScreen/index.d.ts +2 -2
- package/dist/theme/components/NavTitle/index.d.ts +1 -1
- package/dist/theme/components/Outline/ScrollToTop.d.ts +1 -1
- package/dist/theme/components/Outline/index.d.ts +1 -1
- package/dist/theme/components/Overview/index.d.ts +1 -1
- package/dist/theme/components/OverviewGroup/index.d.ts +1 -1
- package/dist/theme/components/PackageManagerTabs/icons/Bun.d.ts +1 -1
- package/dist/theme/components/PackageManagerTabs/icons/Deno.d.ts +1 -1
- package/dist/theme/components/PackageManagerTabs/icons/Npm.d.ts +1 -1
- package/dist/theme/components/PackageManagerTabs/icons/Pnpm.d.ts +1 -1
- package/dist/theme/components/PackageManagerTabs/icons/Yarn.d.ts +1 -1
- package/dist/theme/components/PackageManagerTabs/index.d.ts +1 -1
- package/dist/theme/components/PrevNextPage/index.d.ts +1 -1
- package/dist/theme/components/Prompt/index.d.ts +1 -1
- package/dist/theme/components/ReadPercent/index.d.ts +1 -1
- package/dist/theme/components/Root/index.d.ts +1 -1
- package/dist/theme/components/Search/NoSearchResult.d.ts +1 -1
- package/dist/theme/components/Search/SearchButton.d.ts +1 -1
- package/dist/theme/components/Search/SearchPanel.d.ts +1 -1
- package/dist/theme/components/Search/SearchPanel.js +11 -7
- package/dist/theme/components/Search/SuggestItem.d.ts +1 -1
- package/dist/theme/components/Search/index.d.ts +1 -1
- package/dist/theme/components/Sidebar/SidebarDivider.d.ts +1 -1
- package/dist/theme/components/Sidebar/SidebarGroup.d.ts +1 -1
- package/dist/theme/components/Sidebar/SidebarItem.d.ts +2 -2
- package/dist/theme/components/Sidebar/SidebarSectionHeader.d.ts +1 -1
- package/dist/theme/components/Sidebar/index.d.ts +2 -2
- package/dist/theme/components/SidebarMenu/useSidebarMenu.d.ts +1 -1
- package/dist/theme/components/SocialLinks/GithubStars.d.ts +1 -1
- package/dist/theme/components/SocialLinks/SocialLink.d.ts +1 -1
- package/dist/theme/components/SocialLinks/index.d.ts +1 -1
- package/dist/theme/components/SourceCode/index.d.ts +1 -1
- package/dist/theme/components/Steps/index.d.ts +1 -1
- package/dist/theme/components/SvgWrapper/index.d.ts +1 -1
- package/dist/theme/components/SwitchAppearance/index.d.ts +1 -1
- package/dist/theme/components/Tag/index.d.ts +1 -1
- package/dist/theme/components/Toc/TocItem.d.ts +1 -1
- package/dist/theme/components/Toc/index.d.ts +1 -1
- package/dist/theme/layout/DocLayout/index.d.ts +1 -1
- package/dist/theme/layout/HomeLayout/index.d.ts +1 -1
- package/dist/theme/layout/Layout/index.d.ts +1 -1
- package/dist/theme/layout/NotFountLayout/index.d.ts +1 -1
- package/dist/theme/logic/useThemeState.d.ts +6 -7
- package/dist/theme/logic/useThemeState.js +19 -15
- package/package.json +19 -19
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { RSPRESS_TEMP_DIR, node_path, removeTrailingSlash, promises, addTrailingSlash, DEFAULT_PAGE_EXTENSIONS, glob } from "../../
|
|
1
|
+
import { RSPRESS_TEMP_DIR, node_path, removeTrailingSlash, promises, addTrailingSlash, DEFAULT_PAGE_EXTENSIONS, glob } from "../../6010.js";
|
|
2
2
|
import { RoutePage, absolutePathToRoutePath, absolutePathToRelativePath } from "./RoutePage.js";
|
|
3
3
|
import { createError } from "../utils/error.js";
|
|
4
4
|
import { getRoutePathParts, normalizeRoutePath, splitRoutePathParts } from "./normalizeRoutePath.js";
|
|
5
5
|
class RouteService {
|
|
6
6
|
routeData = new Map();
|
|
7
|
+
#routeDataByFilePath = new Map();
|
|
8
|
+
#routeAnchorIds = new Map();
|
|
9
|
+
#routeAnchorIdsConsumers = new Map();
|
|
7
10
|
#scanDir;
|
|
8
11
|
#defaultLang;
|
|
9
12
|
#defaultVersion;
|
|
@@ -99,6 +102,7 @@ class RouteService {
|
|
|
99
102
|
const { routeMeta: { routePath } } = routePage;
|
|
100
103
|
if (this.routeData.has(routePath)) throw createError(`routePath ${routePath} has already been added`);
|
|
101
104
|
this.routeData.set(routePath, routePage);
|
|
105
|
+
this.#routeDataByFilePath.set(node_path.normalize(routePage.routeMeta.absolutePath), routePage);
|
|
102
106
|
}
|
|
103
107
|
getRoutes() {
|
|
104
108
|
return Array.from(this.routeData.values()).map((i)=>i.routeMeta);
|
|
@@ -107,12 +111,39 @@ class RouteService {
|
|
|
107
111
|
return Array.from(this.routeData.values());
|
|
108
112
|
}
|
|
109
113
|
isExistRoute(link) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
const cleanLinkPath = linkToRoutePath(link);
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
return Boolean(this.getRoutePageByRouteLink(link));
|
|
115
|
+
}
|
|
116
|
+
getRoutePageByRouteLink(link) {
|
|
117
|
+
const cleanLinkPath = this.#linkToRoutePath(link);
|
|
118
|
+
return this.routeData.get(removeTrailingSlash(cleanLinkPath)) ?? this.routeData.get(addTrailingSlash(cleanLinkPath));
|
|
119
|
+
}
|
|
120
|
+
getRoutePageByFilePath(filePath) {
|
|
121
|
+
return this.#routeDataByFilePath.get(node_path.normalize(filePath));
|
|
122
|
+
}
|
|
123
|
+
setRouteAnchorIds(filePath, anchorIds) {
|
|
124
|
+
const routePage = this.getRoutePageByFilePath(filePath);
|
|
125
|
+
if (!routePage) return;
|
|
126
|
+
const { routePath } = routePage.routeMeta;
|
|
127
|
+
this.#routeAnchorIds.set(routePath, anchorIds);
|
|
128
|
+
const consumers = this.#routeAnchorIdsConsumers.get(routePath);
|
|
129
|
+
if (!consumers) return;
|
|
130
|
+
this.#routeAnchorIdsConsumers.delete(routePath);
|
|
131
|
+
for (const consumer of consumers)consumer(anchorIds);
|
|
132
|
+
}
|
|
133
|
+
getRouteAnchorIds(routeLink) {
|
|
134
|
+
const routePage = this.getRoutePageByRouteLink(routeLink);
|
|
135
|
+
if (!routePage) return;
|
|
136
|
+
return this.#routeAnchorIds.get(routePage.routeMeta.routePath);
|
|
137
|
+
}
|
|
138
|
+
onRouteAnchorIds(routeLink, consumer) {
|
|
139
|
+
const routePage = this.getRoutePageByRouteLink(routeLink);
|
|
140
|
+
if (!routePage) return;
|
|
141
|
+
const { routePath } = routePage.routeMeta;
|
|
142
|
+
const anchorIds = this.#routeAnchorIds.get(routePath);
|
|
143
|
+
if (anchorIds) return void consumer(anchorIds);
|
|
144
|
+
const consumers = this.#routeAnchorIdsConsumers.get(routePath) ?? [];
|
|
145
|
+
consumers.push(consumer);
|
|
146
|
+
this.#routeAnchorIdsConsumers.set(routePath, consumers);
|
|
116
147
|
}
|
|
117
148
|
generateRoutesCode() {
|
|
118
149
|
return this.generateRoutesCodeByRouteMeta(this.getRoutes());
|
|
@@ -158,6 +189,9 @@ ${routeMeta.map((route, index)=>{
|
|
|
158
189
|
await promises.writeFile(tempFilePath, content);
|
|
159
190
|
return tempFilePath;
|
|
160
191
|
}
|
|
192
|
+
#linkToRoutePath(routePath) {
|
|
193
|
+
return decodeURIComponent(routePath.split('#')[0]).replace(/\.html$/, '').replace(/\/index$/, '/');
|
|
194
|
+
}
|
|
161
195
|
getRoutePageByRoutePath(routePath) {
|
|
162
196
|
return this.routeData.get(routePath);
|
|
163
197
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { unified, node_path, promises, loadFrontMatter, remove, remark_gfm, MDX_OR_MD_REGEXP, remark_parse } from "../../
|
|
1
|
+
import { unified, node_path, promises, loadFrontMatter, remove, remark_gfm, MDX_OR_MD_REGEXP, remark_parse } from "../../6010.js";
|
|
2
2
|
import { applyReplaceRules } from "../utils/applyReplaceRules.js";
|
|
3
3
|
import { flattenMdxContent } from "../utils/flattenMdxContent.js";
|
|
4
4
|
import { importStatementRegex } from "../constants.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { addTrailingSlash, DEFAULT_PAGE_EXTENSIONS, addLeadingSlash } from "../../
|
|
1
|
+
import { addTrailingSlash, DEFAULT_PAGE_EXTENSIONS, addLeadingSlash } from "../../6010.js";
|
|
2
2
|
const getRoutePathParts = (relativePath, lang, version, langs, versions)=>{
|
|
3
3
|
const [versionPart, langPart, purePath] = splitRoutePathParts(relativePath, lang, version, langs, versions);
|
|
4
4
|
return [
|
|
@@ -48,6 +48,13 @@ export declare const DEFAULT_I18N_TEXT: {
|
|
|
48
48
|
readonly ko: '업데이트 날짜';
|
|
49
49
|
readonly ru: 'Последнее обновление';
|
|
50
50
|
};
|
|
51
|
+
readonly lastUpdatedAuthorText: {
|
|
52
|
+
readonly en: 'by';
|
|
53
|
+
readonly zh: '作者';
|
|
54
|
+
readonly ja: '更新者';
|
|
55
|
+
readonly ko: '작성자';
|
|
56
|
+
readonly ru: 'автор';
|
|
57
|
+
};
|
|
51
58
|
readonly prevPageText: {
|
|
52
59
|
readonly en: 'Previous page';
|
|
53
60
|
readonly zh: '上一页';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __webpack_require__ } from "../../0~rslib-runtime.js";
|
|
2
2
|
import "../../7986.js";
|
|
3
|
-
import { external_node_module_createRequire, join, logger } from "../../
|
|
3
|
+
import { external_node_module_createRequire, join, logger } from "../../6010.js";
|
|
4
4
|
import { DEFAULT_I18N_TEXT } from "./DEFAULT_I18N_TEXT.js";
|
|
5
5
|
import { createError } from "../utils/error.js";
|
|
6
6
|
import { pathExists } from "../utils/fs.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SEARCH_INDEX_NAME, groupBy } from "../../../
|
|
1
|
+
import { SEARCH_INDEX_NAME, groupBy } from "../../../6010.js";
|
|
2
2
|
import { extractPageData } from "../../route/extractPageData.js";
|
|
3
3
|
import { createHash } from "../../utils/createHash.js";
|
|
4
4
|
function deletePrivateField(obj) {
|
|
@@ -30,6 +30,7 @@ async function createPageData(context) {
|
|
|
30
30
|
const versioned = 'boolean' != typeof userConfig.search && (userConfig.search?.versioned ?? true);
|
|
31
31
|
const groupedPages = groupBy(pages, (page)=>{
|
|
32
32
|
if (page.frontmatter?.pageType === 'home') return 'noindex';
|
|
33
|
+
if (page.frontmatter?.search === false) return 'noindex';
|
|
33
34
|
const version = versioned ? page.version : '';
|
|
34
35
|
const lang = page.lang || '';
|
|
35
36
|
return `${version}###${lang}`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { logger, pluginVirtualModule } from "../../../
|
|
1
|
+
import { logger, pluginVirtualModule } from "../../../6010.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 "../../../
|
|
1
|
+
import { getIconUrlPath } from "../../../6010.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 "../../../6010.js";
|
|
2
2
|
import { getI18nData } from "../i18n.js";
|
|
3
3
|
import { applyReplaceRules } from "../../utils/applyReplaceRules.js";
|
|
4
4
|
async function normalizeThemeConfig(docConfig) {
|
|
@@ -21,6 +21,13 @@ async function normalizeThemeConfig(docConfig) {
|
|
|
21
21
|
const cleanUrls = false;
|
|
22
22
|
const transformLink = (link, currentLang)=>normalizeHref(normalizeLinkPrefix(link, currentLang), cleanUrls);
|
|
23
23
|
const textReplace = (text, currentLang)=>applyReplaceRules(getI18nText(text, currentLang), replaceRules);
|
|
24
|
+
const normalizeLastUpdated = (lastUpdated)=>{
|
|
25
|
+
if ('object' != typeof lastUpdated || null === lastUpdated) return lastUpdated;
|
|
26
|
+
return {
|
|
27
|
+
...lastUpdated,
|
|
28
|
+
author: 'function' == typeof lastUpdated.author ? true : lastUpdated.author
|
|
29
|
+
};
|
|
30
|
+
};
|
|
24
31
|
const normalizeSidebar = (sidebar, currentLang)=>{
|
|
25
32
|
const normalizedSidebar = {};
|
|
26
33
|
if (!sidebar) return {};
|
|
@@ -89,6 +96,9 @@ async function normalizeThemeConfig(docConfig) {
|
|
|
89
96
|
themeConfig.sidebar = normalizeSidebar(themeConfig?.sidebar, '');
|
|
90
97
|
themeConfig.nav = normalizeNav(themeConfig?.nav, '');
|
|
91
98
|
}
|
|
92
|
-
return
|
|
99
|
+
return {
|
|
100
|
+
...themeConfig,
|
|
101
|
+
lastUpdated: normalizeLastUpdated(themeConfig.lastUpdated)
|
|
102
|
+
};
|
|
93
103
|
}
|
|
94
104
|
export { normalizeThemeConfig };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isProduction, logger } from "../../../
|
|
1
|
+
import { isProduction, logger } from "../../../6010.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 { external_node_path_resolve, relative, isAbsolute } from "../../
|
|
1
|
+
import { external_node_path_resolve, relative, isAbsolute } from "../../9958.js";
|
|
2
2
|
const routePath2HtmlFileName = (routePath)=>{
|
|
3
3
|
let fileName = routePath;
|
|
4
4
|
fileName = fileName.endsWith('/') ? `${routePath}index.html` : `${routePath}.html`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __webpack_require__ } from "../../0~rslib-runtime.js";
|
|
2
2
|
import "../../7986.js";
|
|
3
|
-
import { createHead, logger, transformHtmlTemplate, pathToFileURL } from "../../
|
|
3
|
+
import { createHead, logger, transformHtmlTemplate, pathToFileURL } from "../../9958.js";
|
|
4
4
|
import { hintSSGFailed } from "../logger/hint.js";
|
|
5
5
|
import { renderHtmlTemplate } from "./renderHtmlTemplate.js";
|
|
6
6
|
const picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { writeFile, mkdir, dirname, workerData } from "../../6646.js";
|
|
2
2
|
import { createError } from "../utils/error.js";
|
|
3
3
|
import { resolveHtmlFilePath } from "./htmlFile.js";
|
|
4
|
-
import { pMap } from "../../
|
|
4
|
+
import { pMap } from "../../9958.js";
|
|
5
5
|
import { renderPage } from "./renderPage.js";
|
|
6
6
|
const params = workerData?.[1]?.params;
|
|
7
7
|
if (!params) throw createError('SSG Worker Thread workerData params missing');
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*! LICENSE: renderPages.js.LICENSE.txt */
|
|
2
2
|
import { __webpack_require__ } from "../../0~rslib-runtime.js";
|
|
3
3
|
import "../../7986.js";
|
|
4
|
-
import { chunk, logger } from "../../
|
|
4
|
+
import { chunk, logger } from "../../6010.js";
|
|
5
5
|
import { SSGWorkerThreadTaskSize, getNumberOfThreads, SSGWorkerThreadRecyclerMaxMemory, SSGConcurrency } from "./ssgEnv.js";
|
|
6
6
|
import { routePath2HtmlFileName } from "./htmlFile.js";
|
|
7
|
-
import { pMap } from "../../
|
|
7
|
+
import { pMap } from "../../9958.js";
|
|
8
8
|
import { renderPage } from "./renderPage.js";
|
|
9
9
|
import { hintSSGFailed } from "../logger/hint.js";
|
|
10
10
|
import { renderHtmlTemplate } from "./renderHtmlTemplate.js";
|
|
@@ -14,7 +14,8 @@ const rsbuildPluginCSR = ({ routeService, config })=>({
|
|
|
14
14
|
compilation.emitAsset(assetName, new compiler.webpack.sources.RawSource(content));
|
|
15
15
|
};
|
|
16
16
|
let htmlTemplate = '';
|
|
17
|
-
for (const
|
|
17
|
+
for (const assetName of Object.keys(assets))if ('index.html' === assetName) {
|
|
18
|
+
const assetSource = assets[assetName];
|
|
18
19
|
htmlTemplate = assetSource.source().toString();
|
|
19
20
|
compilation.deleteAsset(assetName);
|
|
20
21
|
break;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { logger, writeFile, mkdir, rm, join, isDebugMode } from "../../
|
|
1
|
+
import { logger, writeFile, mkdir, rm, join, isDebugMode } from "../../6010.js";
|
|
2
2
|
import { NODE_SSG_BUNDLE_FOLDER, NODE_SSG_BUNDLE_NAME } from "../constants.js";
|
|
3
3
|
import { renderPages } from "./renderPages.js";
|
|
4
4
|
const rsbuildPluginSSG = ({ routeService, config })=>({
|
|
@@ -31,7 +31,8 @@ const rsbuildPluginSSG = ({ routeService, config })=>({
|
|
|
31
31
|
resolveOnce();
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
|
-
for (const
|
|
34
|
+
for (const assetName of Object.keys(assets))if ('index.html' === assetName) {
|
|
35
|
+
const assetSource = assets[assetName];
|
|
35
36
|
htmlTemplate = assetSource.source().toString();
|
|
36
37
|
compilation.deleteAsset(assetName);
|
|
37
38
|
resolveOnce();
|
|
@@ -64,8 +65,9 @@ const rsbuildPluginSSG = ({ routeService, config })=>({
|
|
|
64
65
|
await mkdir(ssgFolderPath, {
|
|
65
66
|
recursive: true
|
|
66
67
|
});
|
|
67
|
-
await Promise.all(Object.
|
|
68
|
+
await Promise.all(Object.keys(assets).map(async (assetName)=>{
|
|
68
69
|
if (assetName.startsWith(`${NODE_SSG_BUNDLE_FOLDER}/`)) {
|
|
70
|
+
const assetSource = assets[assetName];
|
|
69
71
|
const fileAbsolutePath = join(distPath, assetName);
|
|
70
72
|
await writeFile(fileAbsolutePath, assetSource.source().toString());
|
|
71
73
|
compilation.deleteAsset(assetName);
|
package/dist/node/ssg/ssgEnv.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! LICENSE: ssgEnv.js.LICENSE.txt */
|
|
2
|
-
import { node_os } from "../../
|
|
2
|
+
import { node_os } from "../../6010.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,4 +1,4 @@
|
|
|
1
|
-
import { matchPath, getSidebarDataGroup } from "../../../
|
|
1
|
+
import { matchPath, getSidebarDataGroup } from "../../../6010.js";
|
|
2
2
|
import { generateLlmsTxt, generateLlmsFullTxt } from "./llmsTxt.js";
|
|
3
3
|
async function emitLlmsTxt(config, routeService, emitAsset, mdContents) {
|
|
4
4
|
const base = config.base ?? '/';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { normalizeHref, logger, withBase } from "../../../
|
|
1
|
+
import { normalizeHref, logger, withBase } from "../../../6010.js";
|
|
2
2
|
import { extractInfoFromFrontmatterWithAbsolutePath } from "../../auto-nav-sidebar/utils.js";
|
|
3
3
|
function routePathToMdPath(routePath, base) {
|
|
4
4
|
let url = routePath;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __webpack_require__ } from "../../0~rslib-runtime.js";
|
|
2
2
|
import "../../7986.js";
|
|
3
|
-
import { createHead, pathToFileURL, logger } from "../../
|
|
3
|
+
import { createHead, pathToFileURL, logger } from "../../6010.js";
|
|
4
4
|
import { hintSSGFailed } from "../logger/hint.js";
|
|
5
5
|
const picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
6
6
|
var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __webpack_require__ } from "../../0~rslib-runtime.js";
|
|
2
2
|
import "../../7986.js";
|
|
3
|
-
import { logger } from "../../
|
|
4
|
-
import { pMap } from "../../
|
|
3
|
+
import { logger } from "../../6010.js";
|
|
4
|
+
import { pMap } from "../../9958.js";
|
|
5
5
|
import { renderPage } from "./renderPage.js";
|
|
6
6
|
import { SSGConcurrency } from "../ssg/ssgEnv.js";
|
|
7
7
|
const picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { writeFile, mkdir, rm, join, isDebugMode } from "../../
|
|
1
|
+
import { writeFile, mkdir, rm, join, isDebugMode } from "../../6010.js";
|
|
2
2
|
import { NODE_SSG_MD_BUNDLE_FOLDER, NODE_SSG_MD_BUNDLE_NAME } from "../constants.js";
|
|
3
3
|
import { renderPages } from "./renderPages.js";
|
|
4
4
|
import { emitLlmsTxt } from "./llms/emitLlmsTxt.js";
|
|
@@ -27,8 +27,9 @@ const rsbuildPluginSSGMD = ({ routeService, config })=>({
|
|
|
27
27
|
await mkdir(ssgFolderPath, {
|
|
28
28
|
recursive: true
|
|
29
29
|
});
|
|
30
|
-
await Promise.all(Object.
|
|
30
|
+
await Promise.all(Object.keys(assets).map(async (assetName)=>{
|
|
31
31
|
if (assetName.startsWith(`${NODE_SSG_MD_BUNDLE_FOLDER}/`)) {
|
|
32
|
+
const assetSource = assets[assetName];
|
|
32
33
|
const fileAbsolutePath = join(distPath, assetName);
|
|
33
34
|
await writeFile(fileAbsolutePath, assetSource.source().toString());
|
|
34
35
|
compilation.deleteAsset(assetName);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createHash as external_node_crypto_createHash } from "../../
|
|
1
|
+
import { createHash as external_node_crypto_createHash } from "../../6010.js";
|
|
2
2
|
function createHash(str) {
|
|
3
3
|
return external_node_crypto_createHash('sha256').update(str).digest('hex').slice(0, 8);
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { node_fs, node_path, core_rspack, logger, createProcessor, MDX_OR_MD_REGEXP } from "../../
|
|
1
|
+
import { node_fs, node_path, core_rspack, logger, createProcessor, MDX_OR_MD_REGEXP } from "../../6010.js";
|
|
2
2
|
import { createError } from "./error.js";
|
|
3
3
|
import { importStatementRegex } from "../constants.js";
|
|
4
4
|
const RspackResolveFactory = core_rspack.experiments.resolver.ResolverFactory;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __webpack_require__ } from "../../0~rslib-runtime.js";
|
|
2
2
|
import "../../7986.js";
|
|
3
|
-
import { node_path, core_rspack, logger } from "../../
|
|
3
|
+
import { node_path, core_rspack, logger } from "../../6010.js";
|
|
4
4
|
import { pathExists, readJson } from "./fs.js";
|
|
5
5
|
import { PACKAGE_ROOT } from "../constants.js";
|
|
6
6
|
import { hintReactVersion } from "../logger/hint.js";
|
package/dist/runtime/App.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare function App(): React.JSX.Element;
|
package/dist/runtime/App.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { PageContext, useLocation } from "@rspress/core/runtime";
|
|
3
|
-
import { Layout, Root } from "@theme";
|
|
3
|
+
import { Layout, Root } from "@rspress/core/theme";
|
|
4
4
|
import react, { useContext, useLayoutEffect } from "react";
|
|
5
5
|
import virtual_global_components from "virtual-global-components";
|
|
6
6
|
import { consumeCachedPageData, initPageData, setCurrentPageData } from "./initPageData.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { BrowserRouter, PageContext, ThemeContext, removeTrailingSlash, withBase } from "@rspress/core/runtime";
|
|
3
|
-
import { useThemeState } from "@theme";
|
|
3
|
+
import { useThemeState } from "@rspress/core/theme";
|
|
4
4
|
import { UnheadProvider, createHead } from "@unhead/react/client";
|
|
5
5
|
import { useMemo, useState } from "react";
|
|
6
6
|
import { App } from "./App.js";
|
|
@@ -26,6 +26,7 @@ function ClientApp({ initialPageData = null }) {
|
|
|
26
26
|
]),
|
|
27
27
|
children: /*#__PURE__*/ jsx(BrowserRouter, {
|
|
28
28
|
basename: removeTrailingSlash(withBase('/')),
|
|
29
|
+
useTransitions: true,
|
|
29
30
|
children: /*#__PURE__*/ jsx(UnheadProvider, {
|
|
30
31
|
head: head,
|
|
31
32
|
children: /*#__PURE__*/ jsx(App, {})
|
package/dist/runtime/NoSSR.d.ts
CHANGED
|
@@ -40,4 +40,4 @@ export interface BadgeProps {
|
|
|
40
40
|
* <Badge text="Experimental" type="warning" outline />
|
|
41
41
|
* <Badge text="Deprecated" type="danger" />
|
|
42
42
|
*/
|
|
43
|
-
export declare function Badge({ children, type, text, outline, }: BadgeProps): import("react
|
|
43
|
+
export declare function Badge({ children, type, text, outline, }: BadgeProps): import("react").JSX.Element;
|
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
--rp-container-info-text: #07f;
|
|
13
13
|
--rp-container-info-bg: #0095ff0f;
|
|
14
14
|
--rp-container-info-code-bg: #0095ff1a;
|
|
15
|
+
--rp-container-important-border: #8957e54d;
|
|
16
|
+
--rp-container-important-text: #8250df;
|
|
17
|
+
--rp-container-important-bg: #8957e514;
|
|
18
|
+
--rp-container-important-code-bg: #8957e51a;
|
|
15
19
|
--rp-container-warning-border: #ffc51766;
|
|
16
20
|
--rp-container-warning-text: #887233;
|
|
17
21
|
--rp-container-warning-bg: #ffc5171a;
|
|
@@ -33,6 +37,9 @@
|
|
|
33
37
|
--rp-container-tip-bg: #079c701a;
|
|
34
38
|
--rp-container-info-text: #66c2ff;
|
|
35
39
|
--rp-container-info-bg: #0095ff1a;
|
|
40
|
+
--rp-container-important-text: #b083f0;
|
|
41
|
+
--rp-container-important-border: #8957e559;
|
|
42
|
+
--rp-container-important-bg: #8957e51f;
|
|
36
43
|
--rp-container-warning-text: #fbb451;
|
|
37
44
|
--rp-container-warning-border: #ffc51740;
|
|
38
45
|
--rp-container-warning-bg: #ffc5171f;
|
|
@@ -152,6 +159,28 @@
|
|
|
152
159
|
color: var(--rp-container-info-text);
|
|
153
160
|
}
|
|
154
161
|
|
|
162
|
+
.rp-callout--important {
|
|
163
|
+
border-color: var(--rp-container-important-border);
|
|
164
|
+
background-color: var(--rp-container-important-bg);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.rp-callout--important .rp-callout__title {
|
|
168
|
+
color: var(--rp-container-important-text);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.rp-callout--important .rp-callout__title:before {
|
|
172
|
+
background-color: var(--rp-container-important-text);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.rp-callout--important :not(pre) > code {
|
|
176
|
+
color: var(--rp-container-important-text);
|
|
177
|
+
background-color: var(--rp-container-important-code-bg);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.rp-callout--important a {
|
|
181
|
+
color: var(--rp-container-important-text);
|
|
182
|
+
}
|
|
183
|
+
|
|
155
184
|
.rp-callout--warning {
|
|
156
185
|
border-color: var(--rp-container-warning-border);
|
|
157
186
|
background-color: var(--rp-container-warning-bg);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import './index.scss';
|
|
3
3
|
export interface CalloutProps {
|
|
4
|
-
type: 'tip' | 'note' | 'warning' | 'caution' | 'danger' | 'info' | 'details';
|
|
4
|
+
type: 'tip' | 'note' | 'important' | 'warning' | 'caution' | 'danger' | 'info' | 'details';
|
|
5
5
|
title?: string;
|
|
6
6
|
children: ReactNode;
|
|
7
7
|
}
|
|
@@ -56,4 +56,4 @@ export type CodeBlockProps = {
|
|
|
56
56
|
*</div>
|
|
57
57
|
*```
|
|
58
58
|
*/
|
|
59
|
-
export declare function CodeBlock({ containerElementClassName, title, lang, wrapCode: wrapCodeProp, lineNumbers: lineNumbersProp, fold, height, codeButtonGroupProps, children, }: CodeBlockProps): import("react
|
|
59
|
+
export declare function CodeBlock({ containerElementClassName, title, lang, wrapCode: wrapCodeProp, lineNumbers: lineNumbersProp, fold, height, codeButtonGroupProps, children, }: CodeBlockProps): import("react").JSX.Element;
|
|
@@ -17,4 +17,4 @@ export declare const useCodeButtonGroup: (initialWrapCode?: boolean) => {
|
|
|
17
17
|
wrapCode: boolean;
|
|
18
18
|
toggleWrapCode: () => void;
|
|
19
19
|
};
|
|
20
|
-
export declare function CodeButtonGroup({ wrapCode, toggleWrapCode, copyElementRef, showWrapCodeButton, showCopyButton, }: CodeButtonGroupProps): import("react
|
|
20
|
+
export declare function CodeButtonGroup({ wrapCode, toggleWrapCode, copyElementRef, showWrapCodeButton, showCopyButton, }: CodeButtonGroupProps): import("react").JSX.Element;
|
|
@@ -225,12 +225,12 @@
|
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
.rp-doc :not(:where(.rp-not-doc, .rp-not-doc *)):where(a > code) {
|
|
228
|
-
color: var(--rp-c-
|
|
228
|
+
color: var(--rp-c-link);
|
|
229
229
|
transition: color .25s;
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
.rp-doc :not(:where(.rp-not-doc, .rp-not-doc *)):where(a:hover > code) {
|
|
233
|
-
color: var(--rp-c-
|
|
233
|
+
color: var(--rp-c-link);
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
.rp-doc :not(:where(.rp-not-doc, .rp-not-doc *)):where(details) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ComponentProps } from 'react';
|
|
2
|
-
export declare const A: (props: ComponentProps<'a'>) => import("react
|
|
2
|
+
export declare const A: (props: ComponentProps<'a'>) => import("react").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
export declare function Code(props: React.HTMLProps<HTMLElement>):
|
|
2
|
+
export declare function Code(props: React.HTMLProps<HTMLElement>): React.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ComponentProps } from 'react';
|
|
2
|
-
export declare const Hr: (props: ComponentProps<'hr'>) => import("react
|
|
2
|
+
export declare const Hr: (props: ComponentProps<'hr'>) => import("react").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ComponentProps } from 'react';
|
|
2
|
-
export declare const Img: (props: ComponentProps<'img'>) => import("react
|
|
2
|
+
export declare const Img: (props: ComponentProps<'img'>) => import("react").JSX.Element;
|