@rspress/core 2.0.15 → 2.0.17
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/bin/rspress.js +6 -1
- package/dist/0~execa.js +1 -1
- package/dist/{9882.js → 102.js} +1 -1
- package/dist/{9958.js → 7448.js} +1 -1
- package/dist/{5580.js → 8629.js} +2455 -6
- package/dist/cli/index.d.ts +8 -1
- package/dist/cli/index.js +105 -102
- package/dist/config/loadConfigFile.js +1 -1
- 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/Link/index.tsx +1 -1
- package/dist/eject-theme/components/Link/useLinkNavigate.ts +17 -4
- package/dist/eject-theme/components/Llms/LlmsContainer.tsx +1 -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/logic/providers/LocalProvider.ts +3 -1
- package/dist/eject-theme/components/SidebarMenu/useClickOutside.ts +1 -2
- package/dist/eject-theme/components/SocialLinks/GithubStars.test.tsx +48 -0
- package/dist/eject-theme/components/SocialLinks/GithubStars.tsx +35 -20
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -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 +2 -2
- package/dist/node/auto-nav-sidebar/utils.js +1 -1
- package/dist/node/auto-nav-sidebar/walk.js +1 -1
- package/dist/node/constants.js +1 -1
- package/dist/node/eject.js +2 -2
- package/dist/node/initRsbuild.js +5 -5
- package/dist/node/logger/hint.js +1 -1
- 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/containerSyntax.d.ts +2 -1
- package/dist/node/mdx/remarkPlugins/containerSyntax.js +13 -6
- package/dist/node/mdx/remarkPlugins/fileCodeBlock.js +2 -2
- package/dist/node/mdx/remarkPlugins/image.js +2 -2
- package/dist/node/mdx/remarkPlugins/link.js +2 -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 +1 -1
- package/dist/node/route/RouteService.js +1 -1
- package/dist/node/route/extractPageData.js +1 -1
- package/dist/node/route/normalizeRoutePath.js +1 -1
- 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 +6 -2
- 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/htmlFile.js +1 -1
- package/dist/node/ssg/renderPage.js +2 -2
- package/dist/node/ssg/renderPageWorker.js +2 -2
- package/dist/node/ssg/renderPages.js +3 -3
- package/dist/node/ssg/rsbuildPluginSSG.js +1 -1
- package/dist/node/ssg/ssgEnv.js +1 -1
- package/dist/node/ssg-md/llms/emitLlmsTxt.js +3 -3
- package/dist/node/ssg-md/llms/llmsTxt.d.ts +3 -3
- package/dist/node/ssg-md/llms/llmsTxt.js +8 -8
- package/dist/node/ssg-md/remarkSplitMdx.js +1 -1
- package/dist/node/ssg-md/renderPage.js +2 -2
- package/dist/node/ssg-md/renderPages.js +3 -3
- package/dist/node/ssg-md/rsbuildPluginSSGMD.js +1 -1
- 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 -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 +2 -2
- package/dist/runtime/App.js +1 -1
- package/dist/runtime/ClientApp.js +4 -2
- package/dist/runtime/route.js +2 -0
- package/dist/theme/components/Callout/index.css +29 -0
- package/dist/theme/components/Callout/index.d.ts +1 -1
- package/dist/theme/components/DocContent/docComponents/index.d.ts +25 -18
- package/dist/theme/components/Link/index.d.ts +1 -1
- package/dist/theme/components/Link/useLinkNavigate.d.ts +1 -1
- package/dist/theme/components/Link/useLinkNavigate.js +13 -5
- package/dist/theme/components/Llms/LlmsContainer.d.ts +1 -2
- package/dist/theme/components/Search/SearchPanel.js +8 -8
- package/dist/theme/components/SocialLinks/GithubStars.js +27 -17
- package/dist/theme/logic/getCopyableText.js +1 -0
- package/package.json +12 -12
- package/dist/6010.js +0 -2461
- package/dist/{0~8787.js → 0~8016.js} +0 -0
- package/dist/{7986.js → 4538.js} +0 -0
- package/dist/{3358.js → 5357.js} +0 -0
- package/dist/{8005.js → 7748.js} +2 -2
- /package/dist/{5580.js.LICENSE.txt → 8629.js.LICENSE.txt} +0 -0
- /package/dist/{6646.js → 9857.js} +0 -0
- /package/dist/{9283.js → 9940.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DEFAULT_PAGE_EXTENSIONS, node_path } from "../../
|
|
1
|
+
import { DEFAULT_PAGE_EXTENSIONS, node_path } from "../../8629.js";
|
|
2
2
|
import { processLocales, combineWalkResult } from "./locales.js";
|
|
3
3
|
import { walk } from "./walk.js";
|
|
4
4
|
async function runAutoNavSide(config, metaFileSet, mdFileSet) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __webpack_require__ } from "../../0~rslib-runtime.js";
|
|
2
|
-
import "../../
|
|
3
|
-
import { extname, logger, promises_readdir, external_node_path_relative, isExternalUrl, slash, promises_stat, join } from "../../
|
|
2
|
+
import "../../4538.js";
|
|
3
|
+
import { extname, logger, promises_readdir, external_node_path_relative, isExternalUrl, slash, promises_stat, join } from "../../8629.js";
|
|
4
4
|
import { createError } from "../utils/error.js";
|
|
5
5
|
import { pathExists, extractInfoFromFrontmatterWithAbsolutePath, readJson } from "./utils.js";
|
|
6
6
|
import { absolutePathToRoutePath, addRoutePrefix } from "../route/RoutePage.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { node_path, extractTextAndId, promises, loadFrontMatter } from "../../
|
|
1
|
+
import { node_path, extractTextAndId, promises, loadFrontMatter } from "../../8629.js";
|
|
2
2
|
import { createError } from "../utils/error.js";
|
|
3
3
|
async function pathExists(path) {
|
|
4
4
|
try {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isExternalUrl, node_path, promises } from "../../
|
|
1
|
+
import { isExternalUrl, node_path, promises } from "../../8629.js";
|
|
2
2
|
import { pathExists } from "../utils/fs.js";
|
|
3
3
|
import { readJson } from "./utils.js";
|
|
4
4
|
import { addRoutePrefix } from "../route/RoutePage.js";
|
package/dist/node/constants.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isDarkModeSwitchEnabled, node_path, package_namespaceObject, getDefaultDarkModeValue, createRequire } from "../
|
|
1
|
+
import { isDarkModeSwitchEnabled, node_path, package_namespaceObject, getDefaultDarkModeValue, createRequire } from "../7448.js";
|
|
2
2
|
const constants_require = createRequire(import.meta.url);
|
|
3
3
|
const RSPRESS_VERSION = package_namespaceObject.rE;
|
|
4
4
|
const APPEARANCE_KEY = 'rspress-theme-appearance';
|
package/dist/node/eject.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __webpack_require__ } from "../0~rslib-runtime.js";
|
|
2
|
-
import "../
|
|
3
|
-
import { node_path, logger, promises } from "../
|
|
2
|
+
import "../4538.js";
|
|
3
|
+
import { node_path, logger, promises } from "../8629.js";
|
|
4
4
|
import { EJECTED_THEME } from "./constants.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);
|
package/dist/node/initRsbuild.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { external_node_process_cwd, node_path,
|
|
1
|
+
import { external_node_process_cwd, node_path, fileURLToPath, addTrailingSlash, PLUGIN_REACT_NAME, removeTrailingSlash, normalizeDarkMode, pluginVirtualModule, pluginReact, createRequire, MDX_OR_MD_REGEXP } from "../8629.js";
|
|
2
2
|
import { createError } from "./utils/error.js";
|
|
3
3
|
import { CSR_CLIENT_ENTRY, SSR_CLIENT_ENTRY, OUTPUT_DIR, SSG_MD_SERVER_ENTRY, NODE_SSG_BUNDLE_FOLDER, isProduction, PACKAGE_ROOT, SSR_SERVER_ENTRY, TEMPLATE_PATH, NODE_SSG_MD_BUNDLE_FOLDER, DEFAULT_THEME, NODE_SSG_MD_BUNDLE_NAME, getInlineThemeScript, DEFAULT_TITLE, NODE_SSG_BUNDLE_NAME } from "./constants.js";
|
|
4
4
|
import { hintBuilderPluginsBreakingChange, hintThemeBreakingChange } from "./logger/hint.js";
|
|
@@ -14,11 +14,11 @@ import { siteDataVMPlugin } from "./runtimeModule/siteData/rsbuildPlugin.js";
|
|
|
14
14
|
import { rsbuildPluginSSG } from "./ssg/rsbuildPluginSSG.js";
|
|
15
15
|
import { rsbuildPluginCSR } from "./ssg/rsbuildPluginCSR.js";
|
|
16
16
|
import { rsbuildPluginSSGMD } from "./ssg-md/rsbuildPluginSSGMD.js";
|
|
17
|
-
import { package_namespaceObject } from "../
|
|
17
|
+
import { package_namespaceObject } from "../7448.js";
|
|
18
18
|
function isPluginIncluded(config, pluginName) {
|
|
19
19
|
return Boolean(config.builderConfig?.plugins?.some((plugin)=>plugin && plugin.name === pluginName));
|
|
20
20
|
}
|
|
21
|
-
const initRsbuild_require =
|
|
21
|
+
const initRsbuild_require = createRequire(import.meta.url);
|
|
22
22
|
const RAW_QUERY_REGEXP = /[?&]raw(?:&|=|$)/;
|
|
23
23
|
const NODE_RSPACK_OPTIMIZATION = {
|
|
24
24
|
concatenateModules: false,
|
|
@@ -43,7 +43,7 @@ async function createInternalBuildConfig(userDocRoot, config, enableSSG, routeSe
|
|
|
43
43
|
const normalizeIcon = (icon)=>{
|
|
44
44
|
if (!icon) return;
|
|
45
45
|
icon = icon.toString();
|
|
46
|
-
if (icon.startsWith('file://')) icon =
|
|
46
|
+
if (icon.startsWith('file://')) icon = fileURLToPath(icon);
|
|
47
47
|
else if (node_path.isAbsolute(icon)) return node_path.join(userDocRoot, "public", icon);
|
|
48
48
|
return icon;
|
|
49
49
|
};
|
|
@@ -212,7 +212,7 @@ async function createInternalBuildConfig(userDocRoot, config, enableSSG, routeSe
|
|
|
212
212
|
chain.module.rule('mdx').test(MDX_OR_MD_REGEXP).resolve.merge({
|
|
213
213
|
conditionNames: jsModuleRule.resolve.conditionNames.values(),
|
|
214
214
|
mainFields: jsModuleRule.resolve.mainFields.values()
|
|
215
|
-
}).end().oneOf('mdx-raw').type('asset/source').resourceQuery(RAW_QUERY_REGEXP).end().oneOf('mdx').type("javascript/auto").use('builtin:swc-loader').loader('builtin:swc-loader').options(swcLoaderOptions).end().use('mdx-loader').loader(
|
|
215
|
+
}).end().oneOf('mdx-raw').type('asset/source').resourceQuery(RAW_QUERY_REGEXP).end().oneOf('mdx').type("javascript/auto").use('builtin:swc-loader').loader('builtin:swc-loader').options(swcLoaderOptions).end().use('mdx-loader').loader(fileURLToPath(new URL('./mdx/loader.js', import.meta.url))).options({
|
|
216
216
|
config,
|
|
217
217
|
docDirectory: userDocRoot,
|
|
218
218
|
routeService,
|
package/dist/node/logger/hint.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __webpack_require__ } from "../../0~rslib-runtime.js";
|
|
2
|
-
import { relative, logger, join, readFile } from "../../
|
|
2
|
+
import { relative, logger, join, readFile } from "../../4538.js";
|
|
3
3
|
import { pathExists } from "../utils/fs.js";
|
|
4
4
|
const picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
5
5
|
var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
|
package/dist/node/mdx/options.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { node_path, rehype_external_links, rehype_raw, remark_cjk_friendly, nodeTypes, remark_gfm, rehype, remark_cjk_friendly_gfm_strikethrough } from "../../
|
|
1
|
+
import { node_path, rehype_external_links, rehype_raw, remark_cjk_friendly, nodeTypes, remark_gfm, rehype, remark_cjk_friendly_gfm_strikethrough } from "../../9940.js";
|
|
2
2
|
import { remarkToc } from "./remarkPlugins/toc.js";
|
|
3
3
|
import { remarkContainerSyntax } from "./remarkPlugins/containerSyntax.js";
|
|
4
4
|
import { remarkFileCodeBlock } from "./remarkPlugins/fileCodeBlock.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { node_path, extractTextAndId, createProcessor, loadFrontMatter } from "../../
|
|
1
|
+
import { node_path, extractTextAndId, createProcessor, loadFrontMatter } from "../../9940.js";
|
|
2
2
|
import { createMDXOptions } from "./options.js";
|
|
3
3
|
import { applyReplaceRules } from "../utils/applyReplaceRules.js";
|
|
4
4
|
import { escapeMarkdownHeadingIds } from "../utils/escapeHeadingIds.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { visit, extractTextAndId, github_slugger, headingRank } from "../../../
|
|
1
|
+
import { visit, extractTextAndId, github_slugger, headingRank } from "../../../9940.js";
|
|
2
2
|
const rehypeHeaderAnchor = ()=>{
|
|
3
3
|
const slugger = new github_slugger();
|
|
4
4
|
return (tree)=>{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { transformerAddLang, transformerAddLineNumbers, transformerAddTitle, transformerAddFold, createCssVariablesTheme, transformerAddWrapCode } from "../../../
|
|
1
|
+
import { transformerAddLang, transformerAddLineNumbers, transformerAddTitle, transformerAddFold, createCssVariablesTheme, transformerAddWrapCode } from "../../../9940.js";
|
|
2
2
|
const cssVariablesTheme = createCssVariablesTheme({
|
|
3
3
|
name: 'css-variables',
|
|
4
4
|
variablePrefix: '--shiki-',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { node_path } from "../../../
|
|
1
|
+
import { node_path } from "../../../9940.js";
|
|
2
2
|
import { getDefaultImportAstNode } from "../../utils/getImportAstNode.js";
|
|
3
3
|
const remarkBuiltin = ({ globalComponents })=>(tree)=>{
|
|
4
4
|
const demos = globalComponents.map((componentPath)=>{
|
|
@@ -13,10 +13,11 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import type { Root } from 'mdast';
|
|
15
15
|
import type { Plugin } from 'unified';
|
|
16
|
-
export declare const DIRECTIVE_TYPES: readonly ['tip', 'note', 'warning', 'caution', 'danger', 'info', 'details'];
|
|
16
|
+
export declare const DIRECTIVE_TYPES: readonly ['tip', 'note', 'important', 'warning', 'caution', 'danger', 'info', 'details'];
|
|
17
17
|
export declare const REGEX_BEGIN: RegExp;
|
|
18
18
|
export declare const REGEX_END: RegExp;
|
|
19
19
|
export declare const REGEX_GH_BEGIN: RegExp;
|
|
20
|
+
export declare const REGEX_GH_MARKER: RegExp;
|
|
20
21
|
export declare const TITLE_REGEX_IN_MD: RegExp;
|
|
21
22
|
export declare const TITLE_REGEX_IN_MDX: RegExp;
|
|
22
23
|
export type DirectiveType = (typeof DIRECTIVE_TYPES)[number];
|
|
@@ -2,6 +2,7 @@ import { getNamedImportAstNode } from "../../utils/getImportAstNode.js";
|
|
|
2
2
|
const DIRECTIVE_TYPES = [
|
|
3
3
|
'tip',
|
|
4
4
|
'note',
|
|
5
|
+
'important',
|
|
5
6
|
'warning',
|
|
6
7
|
'caution',
|
|
7
8
|
'danger',
|
|
@@ -10,7 +11,8 @@ const DIRECTIVE_TYPES = [
|
|
|
10
11
|
];
|
|
11
12
|
const REGEX_BEGIN = /^\s*:::\s*(\w+)\s*(.*)?/;
|
|
12
13
|
const REGEX_END = /\s*:::$/;
|
|
13
|
-
const REGEX_GH_BEGIN = /^\s*\
|
|
14
|
+
const REGEX_GH_BEGIN = /^\s*\[!(\w+)\]/;
|
|
15
|
+
const REGEX_GH_MARKER = /^\s*\[!\w+\][^\S\n]*\n?/;
|
|
14
16
|
const TITLE_REGEX_IN_MD = /{\s*title=["']?(.+)}\s*/;
|
|
15
17
|
const TITLE_REGEX_IN_MDX = /\s*title=["']?(.+)\s*/;
|
|
16
18
|
const CALLOUT_COMPONENT = '$$$callout$$$';
|
|
@@ -50,7 +52,9 @@ function transformer(tree, warnUnknownType) {
|
|
|
50
52
|
if (DIRECTIVE_TYPES.includes(type)) tree.children.splice(i, 1, createContainer(type, node.attributes?.title ?? type.toUpperCase(), node.children));
|
|
51
53
|
else warnUnknownType(type);
|
|
52
54
|
} else if ('blockquote' === node.type && node.children[0]?.type === 'paragraph' && node.children[0].children?.[0] && 'value' in node.children[0].children[0]) {
|
|
53
|
-
const
|
|
55
|
+
const firstParagraph = node.children[0];
|
|
56
|
+
const firstTextNode = firstParagraph.children[0];
|
|
57
|
+
const initiatorTag = firstTextNode.value;
|
|
54
58
|
const match = initiatorTag.match(REGEX_GH_BEGIN);
|
|
55
59
|
if (match) {
|
|
56
60
|
const [, type] = match;
|
|
@@ -59,8 +63,10 @@ function transformer(tree, warnUnknownType) {
|
|
|
59
63
|
i++;
|
|
60
64
|
continue;
|
|
61
65
|
}
|
|
62
|
-
|
|
63
|
-
const
|
|
66
|
+
firstTextNode.value = initiatorTag.replace(REGEX_GH_MARKER, '');
|
|
67
|
+
const isFirstParagraphEmpty = firstParagraph.children.every((child)=>'text' === child.type && '' === child.value.trim());
|
|
68
|
+
const children = isFirstParagraphEmpty ? node.children.slice(1) : node.children;
|
|
69
|
+
const newChild = createContainer(type.toLowerCase(), type.toUpperCase(), children);
|
|
64
70
|
tree.children.splice(i, 1, newChild);
|
|
65
71
|
}
|
|
66
72
|
}
|
|
@@ -184,13 +190,14 @@ const remarkContainerSyntax = ()=>{
|
|
|
184
190
|
};
|
|
185
191
|
return (tree)=>{
|
|
186
192
|
transformer(tree, warnUnknownType);
|
|
187
|
-
tree.children.unshift(getNamedImportAstNode('Callout', CALLOUT_COMPONENT, '@theme'));
|
|
193
|
+
tree.children.unshift(getNamedImportAstNode('Callout', CALLOUT_COMPONENT, '@rspress/core/theme'));
|
|
188
194
|
};
|
|
189
195
|
};
|
|
190
196
|
var containerSyntax_DIRECTIVE_TYPES = void 0;
|
|
191
197
|
var containerSyntax_REGEX_BEGIN = void 0;
|
|
192
198
|
var containerSyntax_REGEX_END = void 0;
|
|
193
199
|
var containerSyntax_REGEX_GH_BEGIN = void 0;
|
|
200
|
+
var containerSyntax_REGEX_GH_MARKER = void 0;
|
|
194
201
|
var containerSyntax_TITLE_REGEX_IN_MD = void 0;
|
|
195
202
|
var containerSyntax_TITLE_REGEX_IN_MDX = void 0;
|
|
196
|
-
export { containerSyntax_DIRECTIVE_TYPES as DIRECTIVE_TYPES, containerSyntax_REGEX_BEGIN as REGEX_BEGIN, containerSyntax_REGEX_END as REGEX_END, containerSyntax_REGEX_GH_BEGIN as REGEX_GH_BEGIN, containerSyntax_TITLE_REGEX_IN_MD as TITLE_REGEX_IN_MD, containerSyntax_TITLE_REGEX_IN_MDX as TITLE_REGEX_IN_MDX, remarkContainerSyntax };
|
|
203
|
+
export { containerSyntax_DIRECTIVE_TYPES as DIRECTIVE_TYPES, containerSyntax_REGEX_BEGIN as REGEX_BEGIN, containerSyntax_REGEX_END as REGEX_END, containerSyntax_REGEX_GH_BEGIN as REGEX_GH_BEGIN, containerSyntax_REGEX_GH_MARKER as REGEX_GH_MARKER, containerSyntax_TITLE_REGEX_IN_MD as TITLE_REGEX_IN_MD, containerSyntax_TITLE_REGEX_IN_MDX as TITLE_REGEX_IN_MDX, remarkContainerSyntax };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __webpack_require__ } from "../../../0~rslib-runtime.js";
|
|
2
|
-
import "../../../
|
|
3
|
-
import { visit, node_path, logger, cwd, readFile } from "../../../
|
|
2
|
+
import "../../../4538.js";
|
|
3
|
+
import { visit, node_path, logger, cwd, readFile } from "../../../5357.js";
|
|
4
4
|
import { createError } from "../../utils/error.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,6 +1,6 @@
|
|
|
1
1
|
import { __webpack_require__ } from "../../../0~rslib-runtime.js";
|
|
2
|
-
import "../../../
|
|
3
|
-
import { visit, node_path, logger, isDataUrl, existsSync, getNodeAttribute, isExternalUrl, isProduction, parseUrl } from "../../../
|
|
2
|
+
import "../../../4538.js";
|
|
3
|
+
import { visit, node_path, logger, isDataUrl, existsSync, getNodeAttribute, isExternalUrl, isProduction, parseUrl } from "../../../5357.js";
|
|
4
4
|
import { createError } from "../../utils/error.js";
|
|
5
5
|
import { getDefaultImportAstNode } from "../../utils/getImportAstNode.js";
|
|
6
6
|
const picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __webpack_require__ } from "../../../0~rslib-runtime.js";
|
|
2
|
-
import "../../../
|
|
3
|
-
import { normalizeHref, node_path, addLeadingSlash, logger, visit, isExternalUrl, isProduction, parseUrl, MDX_OR_MD_REGEXP, withBase } from "../../../
|
|
2
|
+
import "../../../4538.js";
|
|
3
|
+
import { normalizeHref, node_path, addLeadingSlash, logger, visit, isExternalUrl, isProduction, parseUrl, MDX_OR_MD_REGEXP, withBase } from "../../../5357.js";
|
|
4
4
|
import { hintRelativeMarkdownLink } from "../../logger/hint.js";
|
|
5
5
|
import { createError } from "../../utils/error.js";
|
|
6
6
|
const picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { visitChildren, extractTextAndId, github_slugger, slug } from "../../../
|
|
1
|
+
import { visitChildren, extractTextAndId, github_slugger, slug } from "../../../7748.js";
|
|
2
2
|
const extractChildText = (child, preserveInlineMarkdown = true)=>{
|
|
3
3
|
if ('link' === child.type) return child.children?.map((child)=>extractChildText(child, preserveInlineMarkdown)).join('') ?? '';
|
|
4
4
|
if ('strong' === child.type) {
|
|
@@ -1,4 +1,4 @@
|
|
|
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 "../../8629.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";
|
|
@@ -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 "../../8629.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 "../../8629.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 [
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { __webpack_require__ } from "../../0~rslib-runtime.js";
|
|
2
|
-
import "../../
|
|
3
|
-
import {
|
|
2
|
+
import "../../4538.js";
|
|
3
|
+
import { createRequire, join, logger } from "../../8629.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";
|
|
7
7
|
const picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
8
8
|
var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
|
|
9
|
-
const i18n_require =
|
|
9
|
+
const i18n_require = createRequire(import.meta.url);
|
|
10
10
|
const DEFAULT_I18N_SOURCE_PATH = join(process.cwd(), 'i18n.json');
|
|
11
11
|
function mergeI18nData(...sources) {
|
|
12
12
|
const result = {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SEARCH_INDEX_NAME, groupBy } from "../../../
|
|
1
|
+
import { SEARCH_INDEX_NAME, groupBy } from "../../../8629.js";
|
|
2
2
|
import { extractPageData } from "../../route/extractPageData.js";
|
|
3
3
|
import { createHash } from "../../utils/createHash.js";
|
|
4
4
|
function deletePrivateField(obj) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { logger, pluginVirtualModule } from "../../../
|
|
1
|
+
import { logger, pluginVirtualModule } from "../../../8629.js";
|
|
2
2
|
import { createPageData } from "./createPageData.js";
|
|
3
3
|
const rsbuildPluginDocVM = async ({ config, userDocRoot, routeService, pluginDriver })=>{
|
|
4
4
|
const ref = {
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import { getIconUrlPath } from "../../../
|
|
1
|
+
import { getIconUrlPath } from "../../../8629.js";
|
|
2
2
|
import { normalizeThemeConfig } from "./normalizeThemeConfig.js";
|
|
3
3
|
async function createSiteData(userConfig) {
|
|
4
4
|
const tempSearchObj = Object.assign({}, userConfig.search);
|
|
5
5
|
if (tempSearchObj) tempSearchObj.searchHooks = void 0;
|
|
6
6
|
const siteData = {
|
|
7
7
|
base: userConfig.base ?? '/',
|
|
8
|
+
siteOrigin: userConfig.siteOrigin ?? '',
|
|
8
9
|
title: userConfig?.title || '',
|
|
9
10
|
description: userConfig?.description || '',
|
|
10
11
|
icon: getIconUrlPath(userConfig?.icon) || '',
|
|
11
|
-
route:
|
|
12
|
+
route: {
|
|
13
|
+
useTransitions: true,
|
|
14
|
+
...userConfig?.route
|
|
15
|
+
},
|
|
12
16
|
themeConfig: await normalizeThemeConfig(userConfig),
|
|
13
17
|
lang: userConfig?.lang || '',
|
|
14
18
|
locales: userConfig?.locales || userConfig.themeConfig?.locales || [],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isExternalUrl, slash, addLeadingSlash, normalizeHref } from "../../../
|
|
1
|
+
import { isExternalUrl, slash, addLeadingSlash, normalizeHref } from "../../../8629.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 { isProduction, logger } from "../../../
|
|
1
|
+
import { isProduction, logger } from "../../../8629.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 "../../7448.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
|
-
import "../../
|
|
3
|
-
import { createHead, logger, transformHtmlTemplate, pathToFileURL } from "../../
|
|
2
|
+
import "../../4538.js";
|
|
3
|
+
import { createHead, logger, transformHtmlTemplate, pathToFileURL } from "../../7448.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
|
-
import { writeFile, mkdir, dirname, workerData } from "../../
|
|
1
|
+
import { writeFile, mkdir, dirname, workerData } from "../../9857.js";
|
|
2
2
|
import { createError } from "../utils/error.js";
|
|
3
3
|
import { resolveHtmlFilePath } from "./htmlFile.js";
|
|
4
|
-
import { pMap } from "../../
|
|
4
|
+
import { pMap } from "../../7448.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
|
-
import "../../
|
|
4
|
-
import { chunk, logger } from "../../
|
|
3
|
+
import "../../4538.js";
|
|
4
|
+
import { chunk, logger } from "../../8629.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 "../../7448.js";
|
|
8
8
|
import { renderPage } from "./renderPage.js";
|
|
9
9
|
import { hintSSGFailed } from "../logger/hint.js";
|
|
10
10
|
import { renderHtmlTemplate } from "./renderHtmlTemplate.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { logger, writeFile, mkdir, rm, join, isDebugMode } from "../../
|
|
1
|
+
import { logger, writeFile, mkdir, rm, join, isDebugMode } from "../../8629.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 })=>({
|
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 "../../8629.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 "../../../8629.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,8 +56,8 @@ 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, config.base, routeService);
|
|
60
|
-
const llmsFullTxtContent = generateLlmsFullTxt(routeGroups, navList, others, base, mdContents);
|
|
59
|
+
const llmsTxtContent = await generateLlmsTxt(routeGroups, others, navList, config.title, config.description, config.base, config.siteOrigin, routeService);
|
|
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}/` : '';
|
|
63
63
|
const prefix = `${versionPrefix}${langPrefix}`;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type NavItemWithLink } from '@rspress/shared';
|
|
2
2
|
import type { RouteService } from '../../route/RouteService.js';
|
|
3
|
-
declare function routePathToMdPath(routePath: string, base: string): string;
|
|
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, routeService: RouteService): Promise<string>;
|
|
6
|
+
}[], title: string | undefined, description: string | undefined, base: string, siteOrigin: string | undefined, routeService: RouteService): Promise<string>;
|
|
7
7
|
declare function generateLlmsFullTxt(routeGroups: string[][], navList: (NavItemWithLink & {
|
|
8
8
|
lang: string;
|
|
9
|
-
})[], others: string[], base: string, mdContents: Map<string, string>): string;
|
|
9
|
+
})[], others: string[], base: string, siteOrigin: string | undefined, mdContents: Map<string, string>): string;
|
|
10
10
|
export { generateLlmsFullTxt, generateLlmsTxt, routePathToMdPath };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { normalizeHref, logger, withBase } from "../../../
|
|
1
|
+
import { normalizeHref, withSiteOrigin, logger, withBase } from "../../../8629.js";
|
|
2
2
|
import { extractInfoFromFrontmatterWithAbsolutePath } from "../../auto-nav-sidebar/utils.js";
|
|
3
|
-
function routePathToMdPath(routePath, base) {
|
|
3
|
+
function routePathToMdPath(routePath, base, siteOrigin) {
|
|
4
4
|
let url = routePath;
|
|
5
5
|
url = normalizeHref(url, false);
|
|
6
6
|
url = url.replace(/\.html$/, '.md');
|
|
7
|
-
return withBase(url, base);
|
|
7
|
+
return withSiteOrigin(withBase(url, base), siteOrigin);
|
|
8
8
|
}
|
|
9
|
-
async function generateLlmsTxt(routeGroups, others, navList, title, description, base, routeService) {
|
|
9
|
+
async function generateLlmsTxt(routeGroups, others, navList, title, description, base, siteOrigin, 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
12
|
const summary = title ? `# ${title}${description ? `\n\n> ${description}` : ''}` : '';
|
|
@@ -29,7 +29,7 @@ async function generateLlmsTxt(routeGroups, others, navList, title, description,
|
|
|
29
29
|
title = info.title;
|
|
30
30
|
description = info.description;
|
|
31
31
|
}
|
|
32
|
-
return `- [${title}](${routePathToMdPath(routePath, base)})${description ? `: ${description}` : ''}`;
|
|
32
|
+
return `- [${title}](${routePathToMdPath(routePath, base, siteOrigin)})${description ? `: ${description}` : ''}`;
|
|
33
33
|
}))).filter((i)=>Boolean(i));
|
|
34
34
|
if (routeLines.length > 0) {
|
|
35
35
|
const title = text;
|
|
@@ -52,13 +52,13 @@ async function generateLlmsTxt(routeGroups, others, navList, title, description,
|
|
|
52
52
|
llmsTxt = summary ? lines.length > 0 ? `${summary}\n${lines.join('\n')}` : summary : lines.join('\n').trimStart();
|
|
53
53
|
return llmsTxt;
|
|
54
54
|
}
|
|
55
|
-
function generateLlmsFullTxt(routeGroups, navList, others, base, mdContents) {
|
|
55
|
+
function generateLlmsFullTxt(routeGroups, navList, others, base, siteOrigin, mdContents) {
|
|
56
56
|
const lines = [];
|
|
57
57
|
for(let i = 0; i < navList.length; i++){
|
|
58
58
|
const routeGroup = routeGroups[i];
|
|
59
59
|
if (0 !== routeGroup.length) for (const routePath of routeGroup){
|
|
60
60
|
lines.push(`---
|
|
61
|
-
url: ${routePathToMdPath(routePath, base)}
|
|
61
|
+
url: ${routePathToMdPath(routePath, base, siteOrigin)}
|
|
62
62
|
---
|
|
63
63
|
`);
|
|
64
64
|
lines.push(mdContents.get(routePath) ?? '');
|
|
@@ -67,7 +67,7 @@ url: ${routePathToMdPath(routePath, base)}
|
|
|
67
67
|
}
|
|
68
68
|
for (const routePath of others){
|
|
69
69
|
lines.push(`---
|
|
70
|
-
url: ${routePathToMdPath(routePath, base)}
|
|
70
|
+
url: ${routePathToMdPath(routePath, base, siteOrigin)}
|
|
71
71
|
---
|
|
72
72
|
`);
|
|
73
73
|
lines.push(mdContents.get(routePath) ?? '');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __webpack_require__ } from "../../0~rslib-runtime.js";
|
|
2
|
-
import "../../
|
|
3
|
-
import { createHead, pathToFileURL, logger } from "../../
|
|
2
|
+
import "../../4538.js";
|
|
3
|
+
import { createHead, pathToFileURL, logger } from "../../8629.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
|
-
import "../../
|
|
3
|
-
import { logger } from "../../
|
|
4
|
-
import { pMap } from "../../
|
|
2
|
+
import "../../4538.js";
|
|
3
|
+
import { logger } from "../../8629.js";
|
|
4
|
+
import { pMap } from "../../7448.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 "../../8629.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,4 +1,4 @@
|
|
|
1
|
-
import { createHash as external_node_crypto_createHash } from "../../
|
|
1
|
+
import { createHash as external_node_crypto_createHash } from "../../8629.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,5 +1,5 @@
|
|
|
1
1
|
import { __webpack_require__ } from "../../0~rslib-runtime.js";
|
|
2
|
-
import "../../
|
|
2
|
+
import "../../4538.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 "../../8629.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