@rspress/core 2.0.17 → 2.0.19
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/{4538.js → 4538~0.js} +1 -1
- package/dist/6305~0.js +3007 -0
- package/dist/{7448.js → 8472~0.js} +3 -3
- package/dist/{0~execa.js → 864~0.js} +11 -11
- package/dist/cli/index.js +13 -40
- package/dist/config/defineConfig.d.ts +15 -15
- package/dist/config/loadConfigFile.js +1 -1
- package/dist/eject-theme/components/DocContent/docComponents/title.tsx +1 -1
- package/dist/eject-theme/components/HomeFeature/index.scss +1 -0
- package/dist/eject-theme/components/HomeFeature/index.tsx +1 -1
- package/dist/eject-theme/components/HoverGroup/index.scss +25 -0
- package/dist/eject-theme/components/HoverGroup/index.tsx +22 -1
- package/dist/eject-theme/components/Llms/LlmsCopyButton.tsx +2 -6
- package/dist/eject-theme/components/Llms/LlmsCopyRow.tsx +2 -5
- package/dist/eject-theme/components/Llms/LlmsHint.test.tsx +104 -0
- package/dist/eject-theme/components/Llms/LlmsHint.tsx +70 -0
- package/dist/eject-theme/components/Llms/LlmsOpenRow.tsx +51 -64
- package/dist/eject-theme/components/Llms/LlmsViewOptions.tsx +65 -51
- package/dist/eject-theme/components/Llms/getLlmsCopyContent.test.ts +21 -0
- package/dist/eject-theme/components/Llms/getLlmsCopyContent.ts +20 -0
- package/dist/eject-theme/components/Llms/index.tsx +6 -1
- package/dist/eject-theme/components/Nav/NavMenu.scss +16 -0
- package/dist/eject-theme/components/Nav/NavMenu.tsx +12 -0
- package/dist/eject-theme/components/NavScreen/NavScreenMenuItem.scss +18 -2
- package/dist/eject-theme/components/NavScreen/NavScreenMenuItem.tsx +27 -19
- package/dist/eject-theme/components/NavScreen/index.scss +4 -0
- package/dist/eject-theme/components/Outline/index.scss +4 -0
- package/dist/eject-theme/components/Outline/index.tsx +1 -1
- package/dist/eject-theme/components/Sidebar/SidebarGroup.tsx +3 -0
- package/dist/eject-theme/components/Sidebar/SidebarItem.scss +16 -0
- package/dist/eject-theme/components/Sidebar/SidebarItem.test.tsx +51 -0
- package/dist/eject-theme/components/Sidebar/SidebarItem.tsx +10 -1
- package/dist/eject-theme/components/Sidebar/SidebarSectionHeader.scss +15 -0
- package/dist/eject-theme/components/Sidebar/SidebarSectionHeader.tsx +6 -1
- package/dist/eject-theme/components/Sidebar/index.tsx +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/node/PluginDriver.js +1 -1
- 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 +39 -10
- package/dist/node/auto-nav-sidebar/type.d.ts +7 -0
- package/dist/node/auto-nav-sidebar/utils.d.ts +1 -0
- package/dist/node/auto-nav-sidebar/utils.js +2 -1
- package/dist/node/auto-nav-sidebar/walk.js +1 -1
- package/dist/node/constants.d.ts +2 -1
- package/dist/node/constants.js +50 -2
- package/dist/node/dev.d.ts +2 -1
- package/dist/node/dev.js +7 -2
- package/dist/node/eject.js +3 -3
- package/dist/node/initRsbuild.d.ts +6 -2
- package/dist/node/initRsbuild.js +49 -14
- package/dist/node/last-updated/index.js +112 -15
- package/dist/node/llms.d.ts +3 -0
- package/dist/node/llms.js +8 -0
- package/dist/node/logger/hint.js +2 -2
- package/dist/node/mdx/options.js +1 -1
- package/dist/node/mdx/processor.js +1 -1
- package/dist/node/mdx/rehypePlugins/codeMeta.js +1 -1
- package/dist/node/mdx/rehypePlugins/headerAnchor.js +1 -1
- package/dist/node/mdx/rehypePlugins/shiki.js +1 -1
- package/dist/node/mdx/remarkPlugins/builtin.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 +1 -1
- package/dist/node/medium-zoom/index.js +1 -1
- package/dist/node/route/RoutePage.js +5 -3
- package/dist/node/route/RouteService.js +8 -3
- package/dist/node/route/extractPageData.js +3 -15
- package/dist/node/route/normalizeRoutePath.js +1 -1
- package/dist/node/route/routeChunkAssets.d.ts +15 -0
- package/dist/node/route/routeChunkAssets.js +56 -0
- package/dist/node/runtimeModule/i18n.js +3 -3
- package/dist/node/runtimeModule/pageData/createPageData.js +1 -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 +1 -1
- package/dist/node/runtimeModule/siteData/rsbuildPlugin.js +1 -1
- package/dist/node/serve.js +1 -1
- package/dist/node/ssg/alternateLinks.d.ts +7 -0
- package/dist/node/ssg/alternateLinks.js +40 -0
- package/dist/node/ssg/htmlFile.js +1 -1
- package/dist/node/ssg/renderHtmlTemplate.d.ts +3 -1
- package/dist/node/ssg/renderHtmlTemplate.js +25 -3
- package/dist/node/ssg/renderPage.d.ts +3 -1
- package/dist/node/ssg/renderPage.js +5 -5
- package/dist/node/ssg/renderPageWorker.js +5 -5
- package/dist/node/ssg/renderPages.d.ts +3 -2
- package/dist/node/ssg/renderPages.js +18 -13
- package/dist/node/ssg/rsbuildPluginCSR.d.ts +3 -1
- package/dist/node/ssg/rsbuildPluginCSR.js +2 -2
- package/dist/node/ssg/rsbuildPluginSSG.d.ts +3 -1
- package/dist/node/ssg/rsbuildPluginSSG.js +3 -3
- package/dist/node/ssg/ssgEnv.js +1 -1
- package/dist/node/ssg-md/llms/emitLlmsTxt.js +2 -2
- package/dist/node/ssg-md/llms/llmsTxt.d.ts +2 -2
- package/dist/node/ssg-md/llms/llmsTxt.js +49 -35
- package/dist/node/ssg-md/remarkSplitMdx.js +8 -10
- package/dist/node/ssg-md/renderPage.js +3 -3
- package/dist/node/ssg-md/renderPages.js +4 -4
- package/dist/node/ssg-md/rsbuildPluginSSGMD.js +1 -1
- package/dist/node/utils/checkLanguageParity.js +1 -1
- package/dist/node/utils/createHash.d.ts +1 -1
- package/dist/node/utils/createHash.js +3 -3
- package/dist/node/utils/error.js +2 -2
- package/dist/node/utils/flattenMdxContent.js +1 -1
- package/dist/node/utils/fs.js +1 -1
- package/dist/node/utils/getPageKey.js +1 -1
- package/dist/node/utils/normalizePath.js +1 -1
- package/dist/node/utils/reactAlias.js +3 -3
- package/dist/runtime/App.js +7 -2
- package/dist/runtime/index.d.ts +2 -1
- package/dist/runtime/index.js +2 -1
- package/dist/runtime/reactDom.d.ts +19 -0
- package/dist/runtime/reactDom.js +5 -0
- package/dist/runtime/utils.d.ts +2 -1
- package/dist/runtime/utils.js +5 -2
- package/dist/theme/assets/anthropic.js +15 -0
- package/dist/theme/assets/open-in-chat.js +19 -0
- package/dist/theme/assets/openai.js +15 -0
- package/dist/theme/components/DocContent/docComponents/title.js +1 -1
- package/dist/theme/components/HomeFeature/index.css +1 -0
- package/dist/theme/components/HomeFeature/index.js +32 -34
- package/dist/theme/components/HoverGroup/index.css +22 -0
- package/dist/theme/components/HoverGroup/index.js +17 -1
- package/dist/theme/components/Llms/LlmsCopyButton.js +3 -4
- package/dist/theme/components/Llms/LlmsCopyRow.js +2 -3
- package/dist/theme/components/Llms/LlmsHint.d.ts +2 -0
- package/dist/theme/components/Llms/LlmsHint.js +40 -0
- package/dist/theme/components/Llms/LlmsOpenRow.js +31 -57
- package/dist/theme/components/Llms/LlmsViewOptions.d.ts +6 -4
- package/dist/theme/components/Llms/LlmsViewOptions.js +28 -45
- package/dist/theme/components/Llms/getLlmsCopyContent.d.ts +1 -0
- package/dist/theme/components/Llms/getLlmsCopyContent.js +14 -0
- package/dist/theme/components/Llms/index.d.ts +2 -1
- package/dist/theme/components/Llms/index.js +1 -0
- package/dist/theme/components/Nav/NavMenu.css +15 -0
- package/dist/theme/components/Nav/NavMenu.js +8 -0
- package/dist/theme/components/NavScreen/NavScreenMenuItem.css +17 -2
- package/dist/theme/components/NavScreen/NavScreenMenuItem.js +21 -22
- package/dist/theme/components/NavScreen/index.css +4 -0
- package/dist/theme/components/Outline/index.css +4 -0
- package/dist/theme/components/Outline/index.js +1 -1
- package/dist/theme/components/Sidebar/SidebarGroup.js +4 -1
- package/dist/theme/components/Sidebar/SidebarItem.css +15 -0
- package/dist/theme/components/Sidebar/SidebarItem.d.ts +2 -1
- package/dist/theme/components/Sidebar/SidebarItem.js +7 -2
- package/dist/theme/components/Sidebar/SidebarSectionHeader.css +14 -0
- package/dist/theme/components/Sidebar/SidebarSectionHeader.d.ts +2 -1
- package/dist/theme/components/Sidebar/SidebarSectionHeader.js +12 -6
- package/dist/theme/components/Sidebar/index.js +1 -0
- package/dist/theme/icons.d.ts +4 -1
- package/dist/theme/icons.js +8 -2
- package/dist/theme/index.d.ts +1 -2
- package/dist/theme/index.js +1 -2
- package/dist/theme/layout/Layout/index.js +1 -2
- package/meta-json-schema.json +33 -3
- package/nav-json-schema.json +9 -0
- package/package.json +16 -21
- package/dist/8629.js +0 -7275
- package/dist/8629.js.LICENSE.txt +0 -41
- package/dist/theme/logic/useRedirect4FirstVisit.d.ts +0 -5
- package/dist/theme/logic/useRedirect4FirstVisit.js +0 -31
- /package/dist/{102.js → 102~0.js} +0 -0
- /package/dist/{5357.js → 5357~0.js} +0 -0
- /package/dist/{7748.js → 7748~0.js} +0 -0
- /package/dist/{0~8016.js → 8016~0.js} +0 -0
- /package/dist/{9857.js → 9857~0.js} +0 -0
- /package/dist/{9940.js → 9940~0.js} +0 -0
- /package/dist/{0~rslib-runtime.js → rslib-runtime~0.js} +0 -0
- /package/dist/{0~tinypool.js → tinypool~0.js} +0 -0
package/dist/node/serve.js
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type RouteMeta, type UserConfig } from '@rspress/shared';
|
|
2
|
+
export interface AlternateLink {
|
|
3
|
+
href: string;
|
|
4
|
+
hrefLang: string;
|
|
5
|
+
}
|
|
6
|
+
export type AlternateLinksByRoute = Partial<Record<string, AlternateLink[]>>;
|
|
7
|
+
export declare function createAlternateLinksByRoute(routes: RouteMeta[], config: UserConfig): AlternateLinksByRoute;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { normalizeHref, removeTrailingSlash, addLeadingSlash, normalizePosixPath, withSiteOrigin } from "../../6305~0.js";
|
|
2
|
+
function createAlternateLinksByRoute(routes, config) {
|
|
3
|
+
const routeGroups = new Map();
|
|
4
|
+
for (const route of routes){
|
|
5
|
+
if (!route.lang) continue;
|
|
6
|
+
const groupKey = JSON.stringify([
|
|
7
|
+
route.version,
|
|
8
|
+
route.pureRoutePath
|
|
9
|
+
]);
|
|
10
|
+
const routeGroup = routeGroups.get(groupKey) ?? [];
|
|
11
|
+
routeGroup.push(route);
|
|
12
|
+
routeGroups.set(groupKey, routeGroup);
|
|
13
|
+
}
|
|
14
|
+
const locales = config.locales ?? config.themeConfig?.locales ?? [];
|
|
15
|
+
const localeOrder = new Map(locales.map(({ lang }, index)=>[
|
|
16
|
+
lang,
|
|
17
|
+
index
|
|
18
|
+
]));
|
|
19
|
+
const alternateLinksByRoute = {};
|
|
20
|
+
for (const routeGroup of routeGroups.values()){
|
|
21
|
+
const routesByLang = new Map(routeGroup.map((route)=>[
|
|
22
|
+
route.lang,
|
|
23
|
+
route
|
|
24
|
+
]));
|
|
25
|
+
if (routesByLang.size < 2) continue;
|
|
26
|
+
const alternateRoutes = Array.from(routesByLang.values()).sort((a, b)=>(localeOrder.get(a.lang) ?? Number.MAX_SAFE_INTEGER) - (localeOrder.get(b.lang) ?? Number.MAX_SAFE_INTEGER) || a.lang.localeCompare(b.lang));
|
|
27
|
+
const alternateLinks = alternateRoutes.map((route)=>({
|
|
28
|
+
href: getRouteHref(route.routePath, config),
|
|
29
|
+
hrefLang: route.lang.replaceAll('_', '-')
|
|
30
|
+
}));
|
|
31
|
+
for (const route of alternateRoutes)alternateLinksByRoute[route.routePath] = alternateLinks;
|
|
32
|
+
}
|
|
33
|
+
return alternateLinksByRoute;
|
|
34
|
+
}
|
|
35
|
+
function getRouteHref(routePath, config) {
|
|
36
|
+
const normalizedHref = normalizeHref(routePath, config.route?.cleanUrls ?? false);
|
|
37
|
+
const normalizedBase = removeTrailingSlash(addLeadingSlash(normalizePosixPath(config.base ?? '/')));
|
|
38
|
+
return withSiteOrigin(`${normalizedBase}${normalizedHref}`, config.siteOrigin);
|
|
39
|
+
}
|
|
40
|
+
export { createAlternateLinksByRoute };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { external_node_path_resolve, relative, isAbsolute } from "../../
|
|
1
|
+
import { external_node_path_resolve, relative, isAbsolute } from "../../8472~0.js";
|
|
2
2
|
const routePath2HtmlFileName = (routePath)=>{
|
|
3
3
|
let fileName = routePath;
|
|
4
4
|
fileName = fileName.endsWith('/') ? `${routePath}index.html` : `${routePath}.html`;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import type { RouteMeta, UserConfig } from '@rspress/shared';
|
|
2
|
-
|
|
2
|
+
import type { RouteChunkAssetsManifest } from '../route/routeChunkAssets.js';
|
|
3
|
+
import type { AlternateLink } from './alternateLinks.js';
|
|
4
|
+
export declare function renderHtmlTemplate(htmlTemplate: string, head: UserConfig['head'], route: RouteMeta, appHtml?: string, alternateLinks?: AlternateLink[], routeChunkAssets?: RouteChunkAssetsManifest): Promise<string>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { posix } from "../../8472~0.js";
|
|
1
2
|
import { META_GENERATOR, RSPRESS_VERSION, APP_HTML_MARKER, HEAD_MARKER } from "../constants.js";
|
|
3
|
+
import { routePath2HtmlFileName } from "./htmlFile.js";
|
|
2
4
|
import { createError } from "../utils/error.js";
|
|
3
5
|
async function renderConfigHead(head, route) {
|
|
4
6
|
if (!isRouteMeta(route)) return '';
|
|
@@ -14,18 +16,38 @@ async function renderConfigHead(head, route) {
|
|
|
14
16
|
return `<${head[0]} ${renderAttrs(head[1])}>`;
|
|
15
17
|
}).join('');
|
|
16
18
|
}
|
|
17
|
-
async function renderHtmlTemplate(htmlTemplate, head, route, appHtml = '') {
|
|
19
|
+
async function renderHtmlTemplate(htmlTemplate, head, route, appHtml = '', alternateLinks = [], routeChunkAssets) {
|
|
20
|
+
const alternateLinkTags = alternateLinks.map(({ href, hrefLang })=>`<link ${renderAttrs({
|
|
21
|
+
rel: 'alternate',
|
|
22
|
+
hreflang: hrefLang,
|
|
23
|
+
href
|
|
24
|
+
})}>`).join('');
|
|
25
|
+
const routePreloadLinks = renderRoutePreloadLinks(route, routeChunkAssets);
|
|
18
26
|
const replacedHtmlTemplate = htmlTemplate.replace(APP_HTML_MARKER, ()=>appHtml).replace(META_GENERATOR, ()=>`<meta name="generator" content="Rspress v${RSPRESS_VERSION}">`).replace(HEAD_MARKER, [
|
|
19
|
-
|
|
27
|
+
routePreloadLinks,
|
|
28
|
+
await renderConfigHead(head, route),
|
|
29
|
+
alternateLinkTags
|
|
20
30
|
].join(''));
|
|
21
31
|
return replacedHtmlTemplate;
|
|
22
32
|
}
|
|
33
|
+
function renderRoutePreloadLinks(route, manifest) {
|
|
34
|
+
if (!manifest) return '';
|
|
35
|
+
const assets = manifest.assets[route.routePath];
|
|
36
|
+
if (!assets) return '';
|
|
37
|
+
return assets.map((asset)=>{
|
|
38
|
+
const href = 'auto' === manifest.assetPrefix ? posix.relative(posix.dirname(routePath2HtmlFileName(route.routePath)), asset) : `${manifest.assetPrefix}${asset}`;
|
|
39
|
+
return `<link rel="preload" href="${escapeHtmlAttribute(href)}" as="script">`;
|
|
40
|
+
}).join('');
|
|
41
|
+
}
|
|
42
|
+
function escapeHtmlAttribute(value) {
|
|
43
|
+
return value.replace(/&/g, '&').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>');
|
|
44
|
+
}
|
|
23
45
|
function renderAttrs(attrs) {
|
|
24
46
|
return Object.entries(attrs).map(([key, value])=>{
|
|
25
47
|
if ('boolean' == typeof value) return key;
|
|
26
48
|
if ('string' == typeof value || 'number' == typeof value) return `${key}="${value}"`;
|
|
27
49
|
throw createError(`Invalid value for attribute ${key}:${JSON.stringify(value)}`);
|
|
28
|
-
}).join('');
|
|
50
|
+
}).join(' ');
|
|
29
51
|
}
|
|
30
52
|
function isRouteMeta(route) {
|
|
31
53
|
return !!route && 'object' == typeof route && 'routePath' in route && 'absolutePath' in route;
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import type { RouteMeta, UserConfig } from '@rspress/shared';
|
|
2
|
-
|
|
2
|
+
import type { RouteChunkAssetsManifest } from '../route/routeChunkAssets.js';
|
|
3
|
+
import type { AlternateLink } from './alternateLinks.js';
|
|
4
|
+
export declare function renderPage(route: RouteMeta, htmlTemplate: string, configHead: UserConfig['head'], ssrBundlePath: string, alternateLinks?: AlternateLink[], routeChunkAssets?: RouteChunkAssetsManifest): Promise<string>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { __webpack_require__ } from "../../
|
|
2
|
-
import "../../4538.js";
|
|
3
|
-
import { createHead, logger, transformHtmlTemplate, pathToFileURL } from "../../
|
|
1
|
+
import { __webpack_require__ } from "../../rslib-runtime~0.js";
|
|
2
|
+
import "../../4538~0.js";
|
|
3
|
+
import { createHead, logger, transformHtmlTemplate, pathToFileURL } from "../../8472~0.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");
|
|
7
7
|
var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
|
|
8
|
-
async function renderPage(route, htmlTemplate, configHead, ssrBundlePath) {
|
|
8
|
+
async function renderPage(route, htmlTemplate, configHead, ssrBundlePath, alternateLinks = [], routeChunkAssets) {
|
|
9
9
|
let render;
|
|
10
10
|
try {
|
|
11
11
|
let { default: ssrExports } = await import(pathToFileURL(ssrBundlePath).toString());
|
|
@@ -31,7 +31,7 @@ ${absolutePath ? picocolors_default().gray(` File: ${absolutePath}\n`) : ''}
|
|
|
31
31
|
throw e;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
const replacedHtmlTemplate = await renderHtmlTemplate(htmlTemplate, configHead, route, appHtml);
|
|
34
|
+
const replacedHtmlTemplate = await renderHtmlTemplate(htmlTemplate, configHead, route, appHtml, alternateLinks, routeChunkAssets);
|
|
35
35
|
const html = await transformHtmlTemplate(head, replacedHtmlTemplate);
|
|
36
36
|
return html;
|
|
37
37
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { writeFile, mkdir, dirname, workerData } from "../../9857.js";
|
|
1
|
+
import { writeFile, mkdir, dirname, workerData } from "../../9857~0.js";
|
|
2
2
|
import { createError } from "../utils/error.js";
|
|
3
3
|
import { resolveHtmlFilePath } from "./htmlFile.js";
|
|
4
|
-
import { pMap } from "../../
|
|
4
|
+
import { pMap } from "../../8472~0.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');
|
|
8
|
-
const { htmlTemplate: htmlTemplate, head: head, ssrBundlePath: ssrBundlePath, distPath: distPath } = params;
|
|
8
|
+
const { htmlTemplate: htmlTemplate, head: head, ssrBundlePath: ssrBundlePath, alternateLinksByRoute: alternateLinksByRoute, distPath: distPath, routeChunkAssets: routeChunkAssets } = params;
|
|
9
9
|
async function writeHtmlFile(routePath, html) {
|
|
10
10
|
if (!distPath) return;
|
|
11
11
|
const fileAbsolutePath = resolveHtmlFilePath(distPath, routePath);
|
|
@@ -17,7 +17,7 @@ async function writeHtmlFile(routePath, html) {
|
|
|
17
17
|
const exportWorkerGlueFn = async ({ routes })=>{
|
|
18
18
|
if (distPath) {
|
|
19
19
|
await pMap(routes, async (route)=>{
|
|
20
|
-
const html = await renderPage(route, htmlTemplate, head, ssrBundlePath);
|
|
20
|
+
const html = await renderPage(route, htmlTemplate, head, ssrBundlePath, alternateLinksByRoute[route.routePath] ?? [], routeChunkAssets);
|
|
21
21
|
await writeHtmlFile(route.routePath, html);
|
|
22
22
|
}, {
|
|
23
23
|
concurrency: 10
|
|
@@ -25,7 +25,7 @@ const exportWorkerGlueFn = async ({ routes })=>{
|
|
|
25
25
|
return [];
|
|
26
26
|
}
|
|
27
27
|
return pMap(routes, async (route)=>{
|
|
28
|
-
const html = await renderPage(route, htmlTemplate, head, ssrBundlePath);
|
|
28
|
+
const html = await renderPage(route, htmlTemplate, head, ssrBundlePath, alternateLinksByRoute[route.routePath] ?? [], routeChunkAssets);
|
|
29
29
|
return html;
|
|
30
30
|
}, {
|
|
31
31
|
concurrency: 10
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { UserConfig } from '@rspress/shared';
|
|
2
2
|
import type { RouteService } from '../route/RouteService.js';
|
|
3
|
-
|
|
4
|
-
export declare function
|
|
3
|
+
import type { RouteChunkAssetsManifest } from '../route/routeChunkAssets.js';
|
|
4
|
+
export declare function renderPages(routeService: RouteService, config: UserConfig, ssrBundlePath: string, htmlTemplate: string, emitAsset: (assetName: string, content: string | Buffer) => void, workerOutputDistPath?: string, routeChunkAssets?: RouteChunkAssetsManifest): Promise<void>;
|
|
5
|
+
export declare function renderCSRPages(routeService: RouteService, config: UserConfig, htmlTemplate: string, emitAsset: (assetName: string, content: string | Buffer) => void, routeChunkAssets?: RouteChunkAssetsManifest): Promise<void>;
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
/*! LICENSE: renderPages.js.LICENSE.txt */
|
|
2
|
-
import { __webpack_require__ } from "../../
|
|
3
|
-
import "../../4538.js";
|
|
4
|
-
import { chunk, logger } from "../../
|
|
2
|
+
import { __webpack_require__ } from "../../rslib-runtime~0.js";
|
|
3
|
+
import "../../4538~0.js";
|
|
4
|
+
import { chunk, logger } from "../../6305~0.js";
|
|
5
|
+
import { createAlternateLinksByRoute } from "./alternateLinks.js";
|
|
5
6
|
import { SSGWorkerThreadTaskSize, getNumberOfThreads, SSGWorkerThreadRecyclerMaxMemory, SSGConcurrency } from "./ssgEnv.js";
|
|
6
7
|
import { routePath2HtmlFileName } from "./htmlFile.js";
|
|
7
|
-
import { pMap } from "../../
|
|
8
|
+
import { pMap } from "../../8472~0.js";
|
|
8
9
|
import { renderPage } from "./renderPage.js";
|
|
9
10
|
import { hintSSGFailed } from "../logger/hint.js";
|
|
10
11
|
import { renderHtmlTemplate } from "./renderHtmlTemplate.js";
|
|
11
12
|
const picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
12
13
|
var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
|
|
13
|
-
async function renderPages(routeService, config, ssrBundlePath, htmlTemplate, emitAsset, workerOutputDistPath) {
|
|
14
|
+
async function renderPages(routeService, config, ssrBundlePath, htmlTemplate, emitAsset, workerOutputDistPath, routeChunkAssets) {
|
|
14
15
|
const startTime = Date.now();
|
|
15
16
|
const ssg = config.ssg ?? true;
|
|
16
17
|
try {
|
|
17
18
|
const routes = routeService.getRoutes();
|
|
19
|
+
const alternateLinksByRoute = createAlternateLinksByRoute(routes, config);
|
|
18
20
|
if (!routeService.isExistRoute('/404')) routes.push({
|
|
19
21
|
routePath: '/404'
|
|
20
22
|
});
|
|
@@ -28,7 +30,7 @@ async function renderPages(routeService, config, ssrBundlePath, htmlTemplate, em
|
|
|
28
30
|
const ssgRoutes = [];
|
|
29
31
|
for (const route of routes)if (shouldIgnoreRoutePaths.has(route.routePath) || shouldIgnoreRoutePathsRegExp.some((reg)=>reg.test(route.routePath))) {
|
|
30
32
|
csrRoutes.push(route);
|
|
31
|
-
promiseList.push(renderCSRPage(config.head, route, htmlTemplate, emitAsset));
|
|
33
|
+
promiseList.push(renderCSRPage(config.head, route, htmlTemplate, alternateLinksByRoute, emitAsset, routeChunkAssets));
|
|
32
34
|
} else ssgRoutes.push(route);
|
|
33
35
|
if (csrRoutes.length > 0) {
|
|
34
36
|
const csrRoutePaths = csrRoutes.map((r)=>r.routePath);
|
|
@@ -44,7 +46,7 @@ async function renderPages(routeService, config, ssrBundlePath, htmlTemplate, em
|
|
|
44
46
|
if ('object' == typeof ssg && ssg?.experimentalWorker) {
|
|
45
47
|
const numberOfThreads = getNumberOfThreads(routes.length);
|
|
46
48
|
logger.info(`Rendering pages with experimental SSG worker (${picocolors_default().yellow(numberOfThreads)} threads)...`);
|
|
47
|
-
const Tinypool = await import("../../0
|
|
49
|
+
const Tinypool = await import("../../tinypool~0.js").then((m)=>m.default);
|
|
48
50
|
const pool = new Tinypool({
|
|
49
51
|
filename: new URL('./renderPageWorker.js', import.meta.url).href,
|
|
50
52
|
concurrentTasksPerWorker: 1,
|
|
@@ -60,7 +62,9 @@ async function renderPages(routeService, config, ssrBundlePath, htmlTemplate, em
|
|
|
60
62
|
htmlTemplate,
|
|
61
63
|
head: config.head,
|
|
62
64
|
ssrBundlePath,
|
|
63
|
-
|
|
65
|
+
alternateLinksByRoute,
|
|
66
|
+
distPath: workerOutputDistPath,
|
|
67
|
+
routeChunkAssets
|
|
64
68
|
}
|
|
65
69
|
}
|
|
66
70
|
});
|
|
@@ -80,7 +84,7 @@ async function renderPages(routeService, config, ssrBundlePath, htmlTemplate, em
|
|
|
80
84
|
} else {
|
|
81
85
|
logger.info('Rendering pages...');
|
|
82
86
|
await pMap(routes, async (route)=>{
|
|
83
|
-
const html = await renderPage(route, htmlTemplate, config.head, ssrBundlePath);
|
|
87
|
+
const html = await renderPage(route, htmlTemplate, config.head, ssrBundlePath, alternateLinksByRoute[route.routePath] ?? [], routeChunkAssets);
|
|
84
88
|
const fileName = routePath2HtmlFileName(route.routePath);
|
|
85
89
|
emitAsset(fileName, html);
|
|
86
90
|
}, {
|
|
@@ -98,16 +102,17 @@ async function renderPages(routeService, config, ssrBundlePath, htmlTemplate, em
|
|
|
98
102
|
throw e;
|
|
99
103
|
}
|
|
100
104
|
}
|
|
101
|
-
async function renderCSRPage(head, route, htmlTemplate, emitAsset) {
|
|
102
|
-
const html = await renderHtmlTemplate(htmlTemplate, head, route, '');
|
|
105
|
+
async function renderCSRPage(head, route, htmlTemplate, alternateLinksByRoute, emitAsset, routeChunkAssets) {
|
|
106
|
+
const html = await renderHtmlTemplate(htmlTemplate, head, route, '', alternateLinksByRoute[route.routePath] ?? [], routeChunkAssets);
|
|
103
107
|
const fileName = routePath2HtmlFileName(route.routePath);
|
|
104
108
|
emitAsset(fileName, html);
|
|
105
109
|
}
|
|
106
|
-
async function renderCSRPages(routeService, config, htmlTemplate, emitAsset) {
|
|
110
|
+
async function renderCSRPages(routeService, config, htmlTemplate, emitAsset, routeChunkAssets) {
|
|
107
111
|
const routes = routeService.getRoutes();
|
|
112
|
+
const alternateLinksByRoute = createAlternateLinksByRoute(routes, config);
|
|
108
113
|
if (!routeService.isExistRoute('/404')) routes.push({
|
|
109
114
|
routePath: '/404'
|
|
110
115
|
});
|
|
111
|
-
await Promise.all(routes.map((route)=>renderCSRPage(config.head, route, htmlTemplate, emitAsset)));
|
|
116
|
+
await Promise.all(routes.map((route)=>renderCSRPage(config.head, route, htmlTemplate, alternateLinksByRoute, emitAsset, routeChunkAssets)));
|
|
112
117
|
}
|
|
113
118
|
export { renderCSRPages, renderPages };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { RsbuildPlugin } from '@rsbuild/core';
|
|
2
2
|
import type { UserConfig } from '@rspress/shared';
|
|
3
3
|
import type { RouteService } from '../route/RouteService.js';
|
|
4
|
-
|
|
4
|
+
import type { RouteChunkAssetsPlugin } from '../route/routeChunkAssets.js';
|
|
5
|
+
export declare const rsbuildPluginCSR: ({ routeService, config, routeChunkAssets, }: {
|
|
5
6
|
routeService: RouteService;
|
|
6
7
|
config: UserConfig;
|
|
8
|
+
routeChunkAssets: RouteChunkAssetsPlugin;
|
|
7
9
|
}) => RsbuildPlugin;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { renderCSRPages } from "./renderPages.js";
|
|
2
|
-
const rsbuildPluginCSR = ({ routeService, config })=>({
|
|
2
|
+
const rsbuildPluginCSR = ({ routeService, config, routeChunkAssets })=>({
|
|
3
3
|
name: 'rspress-inner-rsbuild-plugin-csr',
|
|
4
4
|
async setup (api) {
|
|
5
5
|
api.onBeforeBuild(()=>{
|
|
@@ -20,7 +20,7 @@ const rsbuildPluginCSR = ({ routeService, config })=>({
|
|
|
20
20
|
compilation.deleteAsset(assetName);
|
|
21
21
|
break;
|
|
22
22
|
}
|
|
23
|
-
await renderCSRPages(routeService, config, htmlTemplate, emitAsset);
|
|
23
|
+
await renderCSRPages(routeService, config, htmlTemplate, emitAsset, routeChunkAssets.getManifest());
|
|
24
24
|
});
|
|
25
25
|
});
|
|
26
26
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { RsbuildPlugin } from '@rsbuild/core';
|
|
2
2
|
import { type UserConfig } from '@rspress/shared';
|
|
3
3
|
import type { RouteService } from '../route/RouteService.js';
|
|
4
|
-
|
|
4
|
+
import type { RouteChunkAssetsPlugin } from '../route/routeChunkAssets.js';
|
|
5
|
+
export declare const rsbuildPluginSSG: ({ routeService, config, routeChunkAssets, }: {
|
|
5
6
|
routeService: RouteService;
|
|
6
7
|
config: UserConfig;
|
|
8
|
+
routeChunkAssets: RouteChunkAssetsPlugin;
|
|
7
9
|
}) => RsbuildPlugin;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { logger, writeFile, mkdir, rm, join, isDebugMode } from "../../
|
|
1
|
+
import { logger, writeFile, mkdir, rm, join, isDebugMode } from "../../6305~0.js";
|
|
2
2
|
import { NODE_SSG_BUNDLE_FOLDER, NODE_SSG_BUNDLE_NAME } from "../constants.js";
|
|
3
3
|
import { renderPages } from "./renderPages.js";
|
|
4
|
-
const rsbuildPluginSSG = ({ routeService, config })=>({
|
|
4
|
+
const rsbuildPluginSSG = ({ routeService, config, routeChunkAssets })=>({
|
|
5
5
|
name: 'rspress-inner-rsbuild-plugin-ssg',
|
|
6
6
|
async setup (api) {
|
|
7
7
|
api.onBeforeBuild(()=>{
|
|
@@ -75,7 +75,7 @@ const rsbuildPluginSSG = ({ routeService, config })=>({
|
|
|
75
75
|
}));
|
|
76
76
|
await indexHtmlEmittedInWeb;
|
|
77
77
|
if (hasError) return;
|
|
78
|
-
await renderPages(routeService, config, mainCjsAbsolutePath, htmlTemplate, emitAsset, distPath);
|
|
78
|
+
await renderPages(routeService, config, mainCjsAbsolutePath, htmlTemplate, emitAsset, distPath, routeChunkAssets.getManifest());
|
|
79
79
|
if (!isDebugMode()) await rm(ssgFolderPath, {
|
|
80
80
|
recursive: true
|
|
81
81
|
});
|
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 "../../6305~0.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 "../../../6305~0.js";
|
|
2
2
|
import { generateLlmsTxt, generateLlmsFullTxt } from "./llmsTxt.js";
|
|
3
3
|
async function emitLlmsTxt(config, routeService, emitAsset, mdContents) {
|
|
4
4
|
const base = config.base ?? '/';
|
|
@@ -56,7 +56,7 @@ async function emitLlmsTxt(config, routeService, emitAsset, mdContents) {
|
|
|
56
56
|
others.push(routePath);
|
|
57
57
|
});
|
|
58
58
|
for (const routeGroup of routeGroups)organizeBySidebar(sidebar, routeGroup);
|
|
59
|
-
const llmsTxtContent = await generateLlmsTxt(routeGroups, others, navList, config.title, config.description,
|
|
59
|
+
const llmsTxtContent = await generateLlmsTxt(routeGroups, others, navList, config.title, config.description, base, config.siteOrigin, routeService, lang, version, 'object' == typeof config.llms ? config.llms.llmsTxt : void 0);
|
|
60
60
|
const llmsFullTxtContent = generateLlmsFullTxt(routeGroups, navList, others, base, config.siteOrigin, mdContents);
|
|
61
61
|
const langPrefix = defaultLang === lang ? '' : `${lang}/`;
|
|
62
62
|
const versionPrefix = isMultiVersion && version !== defaultVersion ? `${version}/` : '';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type NavItemWithLink } from '@rspress/shared';
|
|
1
|
+
import { type LlmsTxtRenderer, type NavItemWithLink } from '@rspress/shared';
|
|
2
2
|
import type { RouteService } from '../../route/RouteService.js';
|
|
3
3
|
declare function routePathToMdPath(routePath: string, base: string, siteOrigin?: string): string;
|
|
4
4
|
declare function generateLlmsTxt(routeGroups: string[][], others: string[], navList: {
|
|
5
5
|
text: string;
|
|
6
|
-
}[], title: string | undefined, description: string | undefined, base: string, siteOrigin: string | undefined, routeService: RouteService): Promise<string>;
|
|
6
|
+
}[], title: string | undefined, description: string | undefined, base: string, siteOrigin: string | undefined, routeService: RouteService, lang: string, version: string, renderLlmsTxt?: LlmsTxtRenderer): Promise<string>;
|
|
7
7
|
declare function generateLlmsFullTxt(routeGroups: string[][], navList: (NavItemWithLink & {
|
|
8
8
|
lang: string;
|
|
9
9
|
})[], others: string[], base: string, siteOrigin: string | undefined, mdContents: Map<string, string>): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { normalizeHref, withSiteOrigin, logger, withBase } from "../../../
|
|
1
|
+
import { normalizeHref, withSiteOrigin, logger, withBase } from "../../../6305~0.js";
|
|
2
2
|
import { extractInfoFromFrontmatterWithAbsolutePath } from "../../auto-nav-sidebar/utils.js";
|
|
3
3
|
function routePathToMdPath(routePath, base, siteOrigin) {
|
|
4
4
|
let url = routePath;
|
|
@@ -6,48 +6,62 @@ function routePathToMdPath(routePath, base, siteOrigin) {
|
|
|
6
6
|
url = url.replace(/\.html$/, '.md');
|
|
7
7
|
return withSiteOrigin(withBase(url, base), siteOrigin);
|
|
8
8
|
}
|
|
9
|
-
async function generateLlmsTxt(routeGroups, others, navList, title, description, base, siteOrigin, routeService) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
async function genH2Part(nav, routes) {
|
|
14
|
-
const lines = [];
|
|
15
|
-
const { text } = nav;
|
|
16
|
-
if (0 === routes.length) return lines;
|
|
17
|
-
const routeLines = (await Promise.all(routes.map(async (route)=>{
|
|
9
|
+
async function generateLlmsTxt(routeGroups, others, navList, title, description, base, siteOrigin, routeService, lang, version, renderLlmsTxt) {
|
|
10
|
+
async function generateSection(sectionTitle, routes) {
|
|
11
|
+
if (0 === routes.length) return;
|
|
12
|
+
const pages = (await Promise.all(routes.map(async (route)=>{
|
|
18
13
|
const routePage = routeService.getRoutePageByRoutePath(route);
|
|
19
|
-
const { lang, routePath, absolutePath } = routePage.routeMeta;
|
|
20
|
-
if ('/' ===
|
|
14
|
+
const { lang: pageLang, routePath, pureRoutePath, absolutePath, version: pageVersion } = routePage.routeMeta;
|
|
15
|
+
if ('/' === pureRoutePath) return;
|
|
21
16
|
const pageInfo = routePage.pageIndexInfo;
|
|
22
|
-
let title;
|
|
23
|
-
let description;
|
|
24
|
-
if (
|
|
25
|
-
title = pageInfo.title;
|
|
26
|
-
description = pageInfo.description;
|
|
27
|
-
} else {
|
|
17
|
+
let title = pageInfo?.title;
|
|
18
|
+
let description = pageInfo?.description;
|
|
19
|
+
if (!title) {
|
|
28
20
|
const info = await extractInfoFromFrontmatterWithAbsolutePath(absolutePath, routeService.getDocsDir());
|
|
29
21
|
title = info.title;
|
|
30
|
-
description
|
|
22
|
+
description ??= info.description;
|
|
31
23
|
}
|
|
32
|
-
return
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
24
|
+
return {
|
|
25
|
+
routePath,
|
|
26
|
+
link: routePathToMdPath(routePath, base, siteOrigin),
|
|
27
|
+
title,
|
|
28
|
+
description,
|
|
29
|
+
frontmatter: pageInfo?.frontmatter ?? {},
|
|
30
|
+
lang: pageLang,
|
|
31
|
+
version: pageVersion
|
|
32
|
+
};
|
|
33
|
+
}))).filter((page)=>Boolean(page));
|
|
34
|
+
if (0 === pages.length) return;
|
|
35
|
+
return {
|
|
36
|
+
title: sectionTitle,
|
|
37
|
+
pages
|
|
38
|
+
};
|
|
40
39
|
}
|
|
41
|
-
const
|
|
40
|
+
const navSections = await Promise.all(navList.map(async (nav, i)=>{
|
|
42
41
|
const routes = routeGroups[i];
|
|
43
|
-
|
|
44
|
-
return h2Part;
|
|
42
|
+
return generateSection(nav.text, routes);
|
|
45
43
|
}));
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
const otherSection = await generateSection('Others', others);
|
|
45
|
+
const sections = [
|
|
46
|
+
...navSections,
|
|
47
|
+
otherSection
|
|
48
|
+
].filter((section)=>Boolean(section));
|
|
49
|
+
if (renderLlmsTxt) return renderLlmsTxt({
|
|
50
|
+
title,
|
|
51
|
+
description,
|
|
52
|
+
lang,
|
|
53
|
+
version,
|
|
54
|
+
base,
|
|
55
|
+
siteOrigin,
|
|
56
|
+
sections
|
|
57
|
+
});
|
|
58
|
+
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.');
|
|
59
|
+
const summary = title ? `# ${title}${description ? `\n\n> ${description}` : ''}` : '';
|
|
60
|
+
const lines = [];
|
|
61
|
+
for (const section of sections){
|
|
62
|
+
lines.push(`\n## ${section.title}\n`);
|
|
63
|
+
lines.push(...section.pages.map((page)=>`- [${page.title}](${page.link})${page.description ? `: ${page.description}` : ''}`));
|
|
64
|
+
}
|
|
51
65
|
let llmsTxt;
|
|
52
66
|
llmsTxt = summary ? lines.length > 0 ? `${summary}\n${lines.join('\n')}` : summary : lines.join('\n').trimStart();
|
|
53
67
|
return llmsTxt;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { unified, visit, remark_gfm, remark_mdx, remark_stringify } from "../../9940.js";
|
|
1
|
+
import { unified, visit, remark_gfm, remark_mdx, remark_stringify } from "../../9940~0.js";
|
|
2
2
|
function remarkSplitMdx(options = {}) {
|
|
3
3
|
return (tree)=>{
|
|
4
4
|
const newChildren = [];
|
|
5
|
-
const { importMap,
|
|
6
|
-
newChildren.push(...
|
|
5
|
+
const { importMap, esmNodes } = collectEsmMetadata(tree);
|
|
6
|
+
newChildren.push(...esmNodes);
|
|
7
7
|
for (const node of tree.children){
|
|
8
8
|
if ('mdxjsEsm' === node.type) continue;
|
|
9
9
|
if ('mdxFlowExpression' === node.type || 'mdxTextExpression' === node.type) {
|
|
@@ -212,10 +212,11 @@ function serializeNodeToMarkdown(node) {
|
|
|
212
212
|
const result = processor.stringify(tempRoot);
|
|
213
213
|
return result;
|
|
214
214
|
}
|
|
215
|
-
function
|
|
215
|
+
function collectEsmMetadata(tree) {
|
|
216
216
|
const importMap = new Map();
|
|
217
|
-
const
|
|
217
|
+
const esmNodes = new Set();
|
|
218
218
|
visit(tree, 'mdxjsEsm', (node)=>{
|
|
219
|
+
esmNodes.add(node);
|
|
219
220
|
const estree = node.data?.estree;
|
|
220
221
|
if (!estree) return;
|
|
221
222
|
for (const statement of estree.body){
|
|
@@ -223,16 +224,13 @@ function buildImportMap(tree) {
|
|
|
223
224
|
const source = statement.source.value;
|
|
224
225
|
for (const specifier of statement.specifiers){
|
|
225
226
|
const localName = specifier.local?.name;
|
|
226
|
-
if (localName)
|
|
227
|
-
importMap.set(localName, source);
|
|
228
|
-
importNodes.add(node);
|
|
229
|
-
}
|
|
227
|
+
if (localName) importMap.set(localName, source);
|
|
230
228
|
}
|
|
231
229
|
}
|
|
232
230
|
});
|
|
233
231
|
return {
|
|
234
232
|
importMap,
|
|
235
|
-
|
|
233
|
+
esmNodes
|
|
236
234
|
};
|
|
237
235
|
}
|
|
238
236
|
function shouldKeepJsxElement(nameField, importMap, options) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { __webpack_require__ } from "../../
|
|
2
|
-
import "../../4538.js";
|
|
3
|
-
import { createHead, pathToFileURL, logger } from "../../
|
|
1
|
+
import { __webpack_require__ } from "../../rslib-runtime~0.js";
|
|
2
|
+
import "../../4538~0.js";
|
|
3
|
+
import { createHead, pathToFileURL, logger } from "../../6305~0.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
|
-
import { __webpack_require__ } from "../../
|
|
2
|
-
import "../../4538.js";
|
|
3
|
-
import { logger } from "../../
|
|
4
|
-
import { pMap } from "../../
|
|
1
|
+
import { __webpack_require__ } from "../../rslib-runtime~0.js";
|
|
2
|
+
import "../../4538~0.js";
|
|
3
|
+
import { logger } from "../../6305~0.js";
|
|
4
|
+
import { pMap } from "../../8472~0.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 "../../6305~0.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";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function createHash(str: string): string;
|
|
1
|
+
export declare function createHash(str: string, length?: number): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createHash as external_node_crypto_createHash } from "../../
|
|
2
|
-
function createHash(str) {
|
|
3
|
-
return external_node_crypto_createHash('sha256').update(str).digest('hex').slice(0,
|
|
1
|
+
import { createHash as external_node_crypto_createHash } from "../../6305~0.js";
|
|
2
|
+
function createHash(str, length = 8) {
|
|
3
|
+
return external_node_crypto_createHash('sha256').update(str).digest('hex').slice(0, length);
|
|
4
4
|
}
|
|
5
5
|
export { createHash };
|
package/dist/node/utils/error.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { __webpack_require__ } from "../../
|
|
2
|
-
import "../../4538.js";
|
|
1
|
+
import { __webpack_require__ } from "../../rslib-runtime~0.js";
|
|
2
|
+
import "../../4538~0.js";
|
|
3
3
|
const picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
4
4
|
var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
|
|
5
5
|
function createError(message, maxStackLines = 5) {
|
|
@@ -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 "../../6305~0.js";
|
|
2
2
|
import { createError } from "./error.js";
|
|
3
3
|
import { importStatementRegex } from "../constants.js";
|
|
4
4
|
const RspackResolveFactory = core_rspack.experiments.resolver.ResolverFactory;
|
package/dist/node/utils/fs.js
CHANGED