@rspress/core 2.0.4 → 2.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/0~7675.423f6a06.js +1 -1
- package/dist/{5485.7e481fde.js → 5485.0bb24594.js} +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/node/constants.js +1 -1
- package/dist/node/initRsbuild.js +1 -1
- package/dist/node/mdx/{loader.15e0b2d2.js → loader.15134034.js} +2 -0
- package/dist/node/mdx/options.js +4 -2
- package/dist/node/mdx/rehypePlugins/headerAnchor.js +1 -1
- package/dist/node/mdx/rehypePlugins/shiki.js +1 -1
- package/dist/node/route/RoutePage.js +1 -1
- package/dist/node/runtimeModule/i18n.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 +1 -1
- package/dist/node/ssg-md/llms/llmsTxt.js +5 -2
- package/dist/node/ssg-md/remarkSplitMdx.js +1 -1
- package/dist/node/ssg-md/renderPage.js +1 -1
- package/dist/node/ssg-md/renderPages.js +1 -1
- package/package.json +4 -2
package/dist/0~7675.423f6a06.js
CHANGED
|
@@ -9,7 +9,7 @@ import { setTimeout as promises_setTimeout } from "node:timers/promises";
|
|
|
9
9
|
import { debuglog } from "node:util";
|
|
10
10
|
import { node_process, node_os, constants } from "./9348.1beb3e25.js";
|
|
11
11
|
import { node_path } from "./6289.29817fb4.js";
|
|
12
|
-
import { node_url } from "./5485.
|
|
12
|
+
import { node_url } from "./5485.0bb24594.js";
|
|
13
13
|
import { createWriteStream, createReadStream, readFileSync } from "./7744.421b464f.js";
|
|
14
14
|
__webpack_require__.add({
|
|
15
15
|
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
package/dist/cli/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { node_path, logger, join, picocolors } from "../6289.29817fb4.js";
|
|
2
2
|
import { chokidar, cac } from "./index.44f3184c.js";
|
|
3
|
-
import { package_namespaceObject } from "../5485.
|
|
3
|
+
import { package_namespaceObject } from "../5485.0bb24594.js";
|
|
4
4
|
import { loadConfigFile, resolveDocRoot } from "../config/loadConfigFile.js";
|
|
5
5
|
import { dev } from "../node/dev.js";
|
|
6
6
|
import { PUBLIC_DIR } from "../node/constants.js";
|
package/dist/node/constants.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createRequire, package_namespaceObject } from "../5485.
|
|
1
|
+
import { createRequire, package_namespaceObject } from "../5485.0bb24594.js";
|
|
2
2
|
import { node_path } from "../6289.29817fb4.js";
|
|
3
3
|
const constants_require = createRequire(import.meta.url);
|
|
4
4
|
const RSPRESS_VERSION = package_namespaceObject.rE;
|
package/dist/node/initRsbuild.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createRequire, fileURLToPath, package_namespaceObject } from "../5485.
|
|
1
|
+
import { createRequire, fileURLToPath, package_namespaceObject } from "../5485.0bb24594.js";
|
|
2
2
|
import { node_path } from "../6289.29817fb4.js";
|
|
3
3
|
import { addTrailingSlash, removeTrailingSlash, cwd, MDX_OR_MD_REGEXP } from "../9348.1beb3e25.js";
|
|
4
4
|
import { PLUGIN_REACT_NAME, pluginReact, pluginVirtualModule } from "../7744.421b464f.js";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { default as rehype } from "@shikijs/rehype";
|
|
2
2
|
export { default as rehype_external_links } from "rehype-external-links";
|
|
3
3
|
export { default as rehype_raw } from "rehype-raw";
|
|
4
|
+
export { default as remark_cjk_friendly } from "remark-cjk-friendly";
|
|
5
|
+
export { default as remark_cjk_friendly_gfm_strikethrough } from "remark-cjk-friendly-gfm-strikethrough";
|
|
4
6
|
export { default as remark_mdx } from "remark-mdx";
|
|
5
7
|
export { headingRank } from "hast-util-heading-rank";
|
|
6
8
|
export { transformerAddLang, transformerAddLineNumbers, transformerAddTitle, transformerAddWrapCode } from "@rspress/core/shiki-transformers";
|
package/dist/node/mdx/options.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { node_path } from "../../6289.29817fb4.js";
|
|
2
2
|
import { remark_gfm, nodeTypes } from "../../9348.1beb3e25.js";
|
|
3
|
-
import {
|
|
3
|
+
import { rehype_external_links, rehype_raw, remark_cjk_friendly, rehype, remark_cjk_friendly_gfm_strikethrough } from "./loader.15134034.js";
|
|
4
4
|
import { remarkToc } from "./remarkPlugins/toc.js";
|
|
5
5
|
import { remarkContainerSyntax } from "./remarkPlugins/containerSyntax.js";
|
|
6
6
|
import { remarkFileCodeBlock } from "./remarkPlugins/fileCodeBlock.js";
|
|
@@ -15,7 +15,7 @@ async function createMDXOptions(options) {
|
|
|
15
15
|
const { docDirectory, config, routeService, filepath, pluginDriver, addDependency, isSsgMd = false } = options;
|
|
16
16
|
const remarkLinkOptions = config?.markdown?.link;
|
|
17
17
|
const format = node_path.extname(filepath).slice(1);
|
|
18
|
-
const { remarkPlugins: remarkPluginsFromConfig = [], rehypePlugins: rehypePluginsFromConfig = [], globalComponents: globalComponentsFromConfig = [], showLineNumbers = false, defaultWrapCode = false, shiki } = config?.markdown || {};
|
|
18
|
+
const { remarkPlugins: remarkPluginsFromConfig = [], rehypePlugins: rehypePluginsFromConfig = [], globalComponents: globalComponentsFromConfig = [], showLineNumbers = false, defaultWrapCode = false, shiki, cjkFriendlyEmphasis = true } = config?.markdown || {};
|
|
19
19
|
const rspressPlugins = pluginDriver?.getPlugins() ?? [];
|
|
20
20
|
const remarkPluginsFromPlugins = rspressPlugins.flatMap((plugin)=>plugin.markdown?.remarkPlugins || []);
|
|
21
21
|
const rehypePluginsFromPlugins = rspressPlugins.flatMap((plugin)=>plugin.markdown?.rehypePlugins || []);
|
|
@@ -28,6 +28,8 @@ async function createMDXOptions(options) {
|
|
|
28
28
|
format,
|
|
29
29
|
remarkPlugins: [
|
|
30
30
|
remark_gfm,
|
|
31
|
+
cjkFriendlyEmphasis && remark_cjk_friendly,
|
|
32
|
+
cjkFriendlyEmphasis && remark_cjk_friendly_gfm_strikethrough,
|
|
31
33
|
remarkToc,
|
|
32
34
|
!isSsgMd && remarkContainerSyntax,
|
|
33
35
|
[
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { visit, github_slugger, extractTextAndId } from "../../../9348.1beb3e25.js";
|
|
2
|
-
import { headingRank } from "../loader.
|
|
2
|
+
import { headingRank } from "../loader.15134034.js";
|
|
3
3
|
const rehypeHeaderAnchor = ()=>{
|
|
4
4
|
const slugger = new github_slugger();
|
|
5
5
|
return (tree)=>{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { transformerAddLang, transformerAddLineNumbers, transformerAddTitle, createCssVariablesTheme, transformerAddWrapCode } from "../loader.
|
|
1
|
+
import { transformerAddLang, transformerAddLineNumbers, transformerAddTitle, createCssVariablesTheme, transformerAddWrapCode } from "../loader.15134034.js";
|
|
2
2
|
const cssVariablesTheme = createCssVariablesTheme({
|
|
3
3
|
name: 'css-variables',
|
|
4
4
|
variablePrefix: '--shiki-',
|
|
@@ -53,7 +53,7 @@ function absolutePathToRoutePath(absolutePath, docsDir, routeService = RouteServ
|
|
|
53
53
|
return absolutePathToRouteMeta(absolutePath, docsDir, routeService).routePath;
|
|
54
54
|
}
|
|
55
55
|
function absolutePathToRoutePrefix(absolutePath, docsDir) {
|
|
56
|
-
const relativePath = slash(node_path.relative(docsDir, absolutePath
|
|
56
|
+
const relativePath = slash(node_path.relative(docsDir, absolutePath));
|
|
57
57
|
const routeService = RouteService.getInstance();
|
|
58
58
|
const [versionPrefix, langPrefix] = routeService.getRoutePathParts(relativePath);
|
|
59
59
|
return `${versionPrefix ? `/${versionPrefix}` : ''}${langPrefix ? `/${langPrefix}` : ''}`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createRequire } from "../../5485.
|
|
1
|
+
import { createRequire } from "../../5485.0bb24594.js";
|
|
2
2
|
import { picocolors, join, logger } from "../../6289.29817fb4.js";
|
|
3
3
|
import { DEFAULT_I18N_TEXT } from "./DEFAULT_I18N_TEXT.js";
|
|
4
4
|
import { createError } from "../utils/error.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { transformHtmlTemplate, pathToFileURL, createHead } from "../../5485.
|
|
1
|
+
import { transformHtmlTemplate, pathToFileURL, createHead } from "../../5485.0bb24594.js";
|
|
2
2
|
import { logger, picocolors } from "../../6289.29817fb4.js";
|
|
3
3
|
import { hintSSGFailed } from "../logger/hint.js";
|
|
4
4
|
import { renderHtmlTemplate } from "./renderHtmlTemplate.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { workerData } from "./renderPageWorker.165b5d46.js";
|
|
2
2
|
import { createError } from "../utils/error.js";
|
|
3
|
-
import { pMap } from "../../5485.
|
|
3
|
+
import { pMap } from "../../5485.0bb24594.js";
|
|
4
4
|
import { renderPage } from "./renderPage.js";
|
|
5
5
|
const params = workerData?.[1]?.params;
|
|
6
6
|
if (!params) throw createError('SSG Worker Thread workerData params missing');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { logger, picocolors } from "../../6289.29817fb4.js";
|
|
3
3
|
import { chunk } from "../../7744.421b464f.js";
|
|
4
4
|
import { SSGWorkerThreadTaskSize, getNumberOfThreads, SSGWorkerThreadRecyclerMaxMemory, SSGConcurrency } from "./ssgEnv.js";
|
|
5
|
-
import { pMap } from "../../5485.
|
|
5
|
+
import { pMap } from "../../5485.0bb24594.js";
|
|
6
6
|
import { renderPage } from "./renderPage.js";
|
|
7
7
|
import { hintSSGFailed } from "../logger/hint.js";
|
|
8
8
|
import { renderHtmlTemplate } from "./renderHtmlTemplate.js";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { normalizeHref, withBase } from "../../../9348.1beb3e25.js";
|
|
2
|
+
import { logger } from "../../../6289.29817fb4.js";
|
|
2
3
|
import { extractInfoFromFrontmatterWithAbsolutePath } from "../../auto-nav-sidebar/utils.js";
|
|
3
4
|
function routePathToMdPath(routePath, base) {
|
|
4
5
|
let url = routePath;
|
|
@@ -8,7 +9,8 @@ function routePathToMdPath(routePath, base) {
|
|
|
8
9
|
}
|
|
9
10
|
async function generateLlmsTxt(routeGroups, others, navList, title, description, base, routeService) {
|
|
10
11
|
const lines = [];
|
|
11
|
-
|
|
12
|
+
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.');
|
|
13
|
+
const summary = title ? `# ${title}${description ? `\n\n> ${description}` : ''}` : '';
|
|
12
14
|
async function genH2Part(nav, routes) {
|
|
13
15
|
const lines = [];
|
|
14
16
|
const { text } = nav;
|
|
@@ -47,7 +49,8 @@ async function generateLlmsTxt(routeGroups, others, navList, title, description,
|
|
|
47
49
|
text: 'Others'
|
|
48
50
|
}, others);
|
|
49
51
|
lines.push(...otherLines);
|
|
50
|
-
|
|
52
|
+
let llmsTxt;
|
|
53
|
+
llmsTxt = summary ? lines.length > 0 ? `${summary}\n${lines.join('\n')}` : summary : lines.join('\n').trimStart();
|
|
51
54
|
return llmsTxt;
|
|
52
55
|
}
|
|
53
56
|
function generateLlmsFullTxt(routeGroups, navList, others, base, mdContents) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { unified, visit, remark_gfm, remark_stringify } from "../../9348.1beb3e25.js";
|
|
2
|
-
import { remark_mdx } from "../mdx/loader.
|
|
2
|
+
import { remark_mdx } from "../mdx/loader.15134034.js";
|
|
3
3
|
function remarkSplitMdx(options = {}) {
|
|
4
4
|
return (tree)=>{
|
|
5
5
|
const newChildren = [];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { pathToFileURL, createHead } from "../../5485.
|
|
1
|
+
import { pathToFileURL, createHead } from "../../5485.0bb24594.js";
|
|
2
2
|
import { logger, picocolors } from "../../6289.29817fb4.js";
|
|
3
3
|
import { hintSSGFailed } from "../logger/hint.js";
|
|
4
4
|
async function renderPage(route, ssrBundlePath) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { logger, picocolors } from "../../6289.29817fb4.js";
|
|
2
|
-
import { pMap } from "../../5485.
|
|
2
|
+
import { pMap } from "../../5485.0bb24594.js";
|
|
3
3
|
import { renderPage } from "./renderPage.js";
|
|
4
4
|
import { SSGConcurrency } from "../ssg/ssgEnv.js";
|
|
5
5
|
const routePage2MdFilename = (routePath)=>{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspress/core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"description": "The Rspress Documentation Framework",
|
|
5
5
|
"bugs": "https://github.com/web-infra-dev/rspress/issues",
|
|
6
6
|
"repository": {
|
|
@@ -88,6 +88,8 @@
|
|
|
88
88
|
"react-router-dom": "^7.13.1",
|
|
89
89
|
"rehype-external-links": "^3.0.0",
|
|
90
90
|
"rehype-raw": "^7.0.0",
|
|
91
|
+
"remark-cjk-friendly": "^2.0.1",
|
|
92
|
+
"remark-cjk-friendly-gfm-strikethrough": "^2.0.1",
|
|
91
93
|
"remark-gfm": "^4.0.1",
|
|
92
94
|
"remark-mdx": "^3.1.1",
|
|
93
95
|
"remark-parse": "^11.0.0",
|
|
@@ -100,7 +102,7 @@
|
|
|
100
102
|
"unist-util-remove": "^4.0.0",
|
|
101
103
|
"unist-util-visit": "^5.0.0",
|
|
102
104
|
"unist-util-visit-children": "^3.0.0",
|
|
103
|
-
"@rspress/shared": "2.0.
|
|
105
|
+
"@rspress/shared": "2.0.5"
|
|
104
106
|
},
|
|
105
107
|
"devDependencies": {
|
|
106
108
|
"@microsoft/api-extractor": "^7.57.6",
|