@rspress/core 2.0.5 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/0~1402.js +1 -0
- package/dist/{0~7675.423f6a06.js → 0~execa.js} +6 -5
- package/dist/1361.js +5 -0
- package/dist/1965.js +7 -0
- package/dist/4454.js +8 -0
- package/dist/{7744.421b464f.js → 675.js} +20 -5
- package/dist/{node/mdx/loader.15134034.js → 7397.js} +9 -0
- package/dist/{5485.0bb24594.js → 8311.js} +5 -2
- package/dist/8474.js +4 -0
- package/dist/8885.js +4 -0
- package/dist/cli/index.js +2 -3
- package/dist/config/loadConfigFile.js +1 -2
- package/dist/eject-theme/components/HomeHero/index.tsx +1 -1
- package/dist/eject-theme/components/HoverGroup/index.tsx +1 -1
- package/dist/eject-theme/components/Llms/LlmsCopyButton.tsx +2 -1
- package/dist/eject-theme/components/Llms/LlmsCopyRow.tsx +2 -1
- package/dist/eject-theme/components/Llms/LlmsViewOptions.tsx +2 -1
- package/dist/eject-theme/components/Llms/copy.ts +12 -0
- package/dist/eject-theme/components/Search/SearchPanel.tsx +2 -0
- package/dist/eject-theme/components/Sidebar/SidebarItem.scss +0 -4
- package/dist/eject-theme/components/Tabs/index.scss +13 -15
- package/dist/index.js +1 -3
- package/dist/node/PluginDriver.js +3 -8
- package/dist/node/auto-nav-sidebar/index.js +1 -2
- package/dist/node/auto-nav-sidebar/locales.js +1 -1
- package/dist/node/auto-nav-sidebar/normalize.js +3 -2
- package/dist/node/auto-nav-sidebar/utils.js +1 -2
- package/dist/node/auto-nav-sidebar/walk.js +1 -2
- package/dist/node/constants.js +1 -2
- package/dist/node/eject.js +1 -1
- package/dist/node/initRsbuild.js +2 -4
- package/dist/node/last-updated/index.js +1 -1
- package/dist/node/logger/hint.js +4 -1
- package/dist/node/mdx/options.js +1 -3
- package/dist/node/mdx/processor.js +1 -2
- package/dist/node/mdx/rehypePlugins/codeMeta.js +1 -1
- package/dist/node/mdx/rehypePlugins/headerAnchor.js +1 -2
- package/dist/node/mdx/rehypePlugins/shiki.d.ts +1 -1
- package/dist/node/mdx/rehypePlugins/shiki.js +1 -1
- package/dist/node/mdx/rehypePlugins/transformers/meta-highlight.js +1 -1
- package/dist/node/mdx/remarkPlugins/builtin.js +1 -1
- package/dist/node/mdx/remarkPlugins/fileCodeBlock.js +1 -2
- package/dist/node/mdx/remarkPlugins/image.js +1 -1
- package/dist/node/mdx/remarkPlugins/link.js +1 -2
- package/dist/node/mdx/remarkPlugins/toc.js +1 -1
- package/dist/node/medium-zoom/index.js +1 -1
- package/dist/node/route/RoutePage.js +1 -1
- package/dist/node/route/RouteService.js +1 -3
- package/dist/node/route/extractPageData.js +1 -3
- package/dist/node/route/normalizeRoutePath.js +1 -2
- package/dist/node/runtimeModule/i18n.js +1 -2
- package/dist/node/runtimeModule/pageData/createPageData.js +1 -2
- package/dist/node/runtimeModule/pageData/rsbuildPlugin.js +1 -2
- package/dist/node/runtimeModule/searchHooks.js +1 -1
- package/dist/node/runtimeModule/siteData/createSiteData.js +1 -1
- package/dist/node/runtimeModule/siteData/normalizeThemeConfig.js +1 -1
- package/dist/node/runtimeModule/siteData/rsbuildPlugin.js +1 -1
- package/dist/node/serve.js +1 -1
- package/dist/node/ssg/renderPage.js +1 -2
- package/dist/node/ssg/renderPageWorker.js +2 -2
- package/dist/node/ssg/renderPages.js +3 -4
- package/dist/node/ssg/rsbuildPluginSSG.js +1 -2
- package/dist/node/ssg/ssgEnv.d.ts +1 -1
- package/dist/node/ssg/ssgEnv.js +2 -2
- package/dist/node/ssg-md/llms/emitLlmsTxt.js +5 -7
- package/dist/node/ssg-md/llms/llmsTxt.js +1 -2
- package/dist/node/ssg-md/remarkSplitMdx.js +1 -2
- package/dist/node/ssg-md/renderPage.js +1 -2
- package/dist/node/ssg-md/renderPages.js +2 -2
- package/dist/node/ssg-md/rsbuildPluginSSGMD.js +1 -2
- package/dist/node/utils/checkLanguageParity.js +1 -1
- package/dist/node/utils/createHash.js +1 -1
- package/dist/node/utils/error.js +1 -1
- package/dist/node/utils/flattenMdxContent.js +1 -3
- package/dist/node/utils/fs.js +1 -1
- package/dist/node/utils/getPageKey.js +1 -1
- package/dist/node/utils/normalizePath.js +1 -2
- package/dist/node/utils/reactAlias.js +15 -10
- package/dist/runtime/index.js +20 -21
- package/dist/runtime/ssrMdServerEntry.js +2 -2
- package/dist/runtime/ssrServerEntry.js +2 -2
- package/dist/runtime/utils.d.ts +1 -1
- package/dist/runtime/utils.js +1 -1
- package/dist/theme/assets/arrow-down.js +1 -1
- package/dist/theme/assets/arrow-right.js +1 -1
- package/dist/theme/assets/close.js +1 -1
- package/dist/theme/assets/copy.js +1 -1
- package/dist/theme/assets/deprecated.js +1 -1
- package/dist/theme/assets/down.js +1 -1
- package/dist/theme/assets/edit.js +1 -1
- package/dist/theme/assets/empty.js +1 -1
- package/dist/theme/assets/experimental.js +1 -1
- package/dist/theme/assets/external-link.js +1 -1
- package/dist/theme/assets/file.js +1 -1
- package/dist/theme/assets/github.js +1 -1
- package/dist/theme/assets/gitlab.js +1 -1
- package/dist/theme/assets/header.js +1 -1
- package/dist/theme/assets/jump.js +1 -1
- package/dist/theme/assets/link.js +1 -1
- package/dist/theme/assets/loading.js +1 -1
- package/dist/theme/assets/menu.js +1 -1
- package/dist/theme/assets/moon.js +1 -1
- package/dist/theme/assets/scroll-to-top.js +1 -1
- package/dist/theme/assets/search.js +1 -1
- package/dist/theme/assets/small-menu.js +1 -1
- package/dist/theme/assets/success.js +1 -1
- package/dist/theme/assets/sun.js +1 -1
- package/dist/theme/assets/title.js +1 -1
- package/dist/theme/assets/wrap.js +1 -1
- package/dist/theme/assets/wrapped.js +1 -1
- package/dist/theme/components/Callout/index.js +2 -1
- package/dist/theme/components/HomeBackground/index.css +1 -0
- package/dist/theme/components/HomeFeature/index.css +3 -3
- package/dist/theme/components/HomeHero/index.d.ts +1 -1
- package/dist/theme/components/HoverGroup/index.d.ts +1 -1
- package/dist/theme/components/Llms/LlmsCopyButton.js +3 -2
- package/dist/theme/components/Llms/LlmsCopyRow.js +2 -1
- package/dist/theme/components/Llms/LlmsViewOptions.js +3 -2
- package/dist/theme/components/Llms/copy.d.ts +1 -0
- package/dist/theme/components/Llms/copy.js +9 -0
- package/dist/theme/components/Llms/index.css +1 -0
- package/dist/theme/components/Llms/index.js +4 -5
- package/dist/theme/components/Nav/index.css +1 -1
- package/dist/theme/components/NavScreen/index.css +1 -1
- package/dist/theme/components/OverviewGroup/icons/plugin.js +1 -1
- package/dist/theme/components/OverviewGroup/index.css +1 -0
- package/dist/theme/components/Search/SearchPanel.js +2 -1
- package/dist/theme/components/Search/logic/providers/LocalProvider.js +1 -1
- package/dist/theme/components/Sidebar/SidebarItem.css +0 -4
- package/dist/theme/components/Tabs/index.css +14 -8
- package/dist/theme/components/Toc/TocItem.css +1 -1
- package/dist/theme/index.js +66 -67
- package/dist/theme/layout/DocLayout/index.css +11 -11
- package/dist/theme/layout/Layout/index.js +14 -4
- package/dist/theme/styles/base.css +6 -3
- package/dist/theme/styles/preflight.css +2 -0
- package/dist/theme/styles/vars/home-vars.css +28 -4
- package/package.json +7 -7
- package/dist/6289.29817fb4.js +0 -4
- package/dist/9348.1beb3e25.js +0 -11
- package/dist/cli/index.44f3184c.js +0 -2
- /package/dist/{node/ssg/renderPageWorker.165b5d46.js → 9224.js} +0 -0
- /package/dist/{rslib-runtime.99091bf6.js → rslib-runtime.js} +0 -0
package/dist/0~1402.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as node_path } from "node:path";
|
|
@@ -2,15 +2,16 @@ import * as __rspack_external_child_process from "child_process";
|
|
|
2
2
|
import * as __rspack_external_fs from "fs";
|
|
3
3
|
import * as __rspack_external_path from "path";
|
|
4
4
|
import * as __rspack_external_stream from "stream";
|
|
5
|
-
import { __webpack_require__ } from "./rslib-runtime.
|
|
5
|
+
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
6
6
|
import { Buffer } from "node:buffer";
|
|
7
|
+
import node_path from "node:path";
|
|
7
8
|
import node_child_process, { ChildProcess } from "node:child_process";
|
|
9
|
+
import node_process from "node:process";
|
|
10
|
+
import node_url from "node:url";
|
|
11
|
+
import node_os, { constants } from "node:os";
|
|
12
|
+
import { createReadStream, createWriteStream, readFileSync } from "node:fs";
|
|
8
13
|
import { setTimeout as promises_setTimeout } from "node:timers/promises";
|
|
9
14
|
import { debuglog } from "node:util";
|
|
10
|
-
import { node_process, node_os, constants } from "./9348.1beb3e25.js";
|
|
11
|
-
import { node_path } from "./6289.29817fb4.js";
|
|
12
|
-
import { node_url } from "./5485.0bb24594.js";
|
|
13
|
-
import { createWriteStream, createReadStream, readFileSync } from "./7744.421b464f.js";
|
|
14
15
|
__webpack_require__.add({
|
|
15
16
|
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
16
17
|
const cp = __webpack_require__("child_process");
|
package/dist/1361.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as node_os } from "node:os";
|
|
2
|
+
export { default as node_path } from "node:path";
|
|
3
|
+
export { extractTextAndId } from "@rspress/shared/node-utils";
|
|
4
|
+
export { default as github_slugger } from "github-slugger";
|
|
5
|
+
export { visitChildren } from "unist-util-visit-children";
|
package/dist/1965.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { readFile } from "node:fs/promises";
|
|
2
|
+
export { default as node_path } from "node:path";
|
|
3
|
+
export { cwd } from "node:process";
|
|
4
|
+
export { logger } from "@rspress/shared/logger";
|
|
5
|
+
export { default as picocolors } from "picocolors";
|
|
6
|
+
export { visit } from "unist-util-visit";
|
|
7
|
+
export { addLeadingSlash, isExternalUrl, isProduction, normalizeHref, parseUrl, withBase } from "@rspress/shared";
|
package/dist/4454.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { default as node_path, join } from "node:path";
|
|
2
|
+
export { logger } from "@rspress/shared/logger";
|
|
3
|
+
export { cac } from "cac";
|
|
4
|
+
export { default as chokidar } from "chokidar";
|
|
5
|
+
export { default as picocolors } from "picocolors";
|
|
6
|
+
export { default as node_fs } from "node:fs";
|
|
7
|
+
export { DEFAULT_CONFIG_EXTENSIONS, DEFAULT_CONFIG_NAME } from "@rspress/shared/constants";
|
|
8
|
+
export { default as promises } from "node:fs/promises";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { extname, join } from "
|
|
1
|
+
import node_path, { extname, join, relative } from "node:path";
|
|
2
2
|
const PLUGIN_VIRTUAL_MODULE_NAME = 'rsbuild:virtual-module';
|
|
3
3
|
const pluginVirtualModule = (pluginOptions = {})=>({
|
|
4
4
|
name: PLUGIN_VIRTUAL_MODULE_NAME,
|
|
@@ -43,14 +43,29 @@ const pluginVirtualModule = (pluginOptions = {})=>({
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
});
|
|
46
|
-
export {
|
|
47
|
-
export {
|
|
46
|
+
export { DEFAULT_PAGE_EXTENSIONS } from "@rspress/shared/constants";
|
|
47
|
+
export { default as promises, mkdir, readdir, rm, stat, writeFile } from "node:fs/promises";
|
|
48
|
+
export { MDX_OR_MD_REGEXP, RSPRESS_TEMP_DIR, SEARCH_INDEX_NAME, addLeadingSlash, addTrailingSlash, getSidebarDataGroup, isDebugMode, isExternalUrl, normalizeHref, removeLeadingSlash, removeTrailingSlash, slash, withBase } from "@rspress/shared";
|
|
48
49
|
export { glob } from "tinyglobby";
|
|
50
|
+
export { logger } from "@rspress/shared/logger";
|
|
51
|
+
export { default as picocolors } from "picocolors";
|
|
52
|
+
export { extractTextAndId, getIconUrlPath, loadFrontMatter } from "@rspress/shared/node-utils";
|
|
53
|
+
export { createRequire } from "node:module";
|
|
54
|
+
export { cwd } from "node:process";
|
|
55
|
+
export { fileURLToPath, pathToFileURL } from "node:url";
|
|
49
56
|
export { PLUGIN_REACT_NAME, pluginReact } from "@rsbuild/plugin-react";
|
|
50
57
|
export { chunk, groupBy } from "lodash-es";
|
|
58
|
+
export { default as remark_gfm } from "remark-gfm";
|
|
51
59
|
export { default as remark_parse } from "remark-parse";
|
|
60
|
+
export { default as remark_stringify } from "remark-stringify";
|
|
61
|
+
export { unified } from "unified";
|
|
52
62
|
export { remove } from "unist-util-remove";
|
|
53
|
-
export {
|
|
63
|
+
export { visit } from "unist-util-visit";
|
|
64
|
+
export { default as node_fs } from "node:fs";
|
|
65
|
+
export { createProcessor } from "@mdx-js/mdx";
|
|
54
66
|
export { mergeRsbuildConfig, rspack as core_rspack } from "@rsbuild/core";
|
|
55
67
|
export { createHash } from "node:crypto";
|
|
56
|
-
export {
|
|
68
|
+
export { default as node_os } from "node:os";
|
|
69
|
+
export { matchPath } from "react-router-dom";
|
|
70
|
+
export { createHead } from "@unhead/react/server";
|
|
71
|
+
export { extname, join, node_path, pluginVirtualModule, relative };
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
+
export { default as node_path } from "node:path";
|
|
2
|
+
export { createProcessor, nodeTypes } from "@mdx-js/mdx";
|
|
3
|
+
export { extractTextAndId, getNodeAttribute, loadFrontMatter } from "@rspress/shared/node-utils";
|
|
1
4
|
export { default as rehype } from "@shikijs/rehype";
|
|
2
5
|
export { default as rehype_external_links } from "rehype-external-links";
|
|
3
6
|
export { default as rehype_raw } from "rehype-raw";
|
|
4
7
|
export { default as remark_cjk_friendly } from "remark-cjk-friendly";
|
|
5
8
|
export { default as remark_cjk_friendly_gfm_strikethrough } from "remark-cjk-friendly-gfm-strikethrough";
|
|
9
|
+
export { default as remark_gfm } from "remark-gfm";
|
|
6
10
|
export { default as remark_mdx } from "remark-mdx";
|
|
11
|
+
export { default as remark_stringify } from "remark-stringify";
|
|
12
|
+
export { unified } from "unified";
|
|
13
|
+
export { visit } from "unist-util-visit";
|
|
14
|
+
export { default as github_slugger } from "github-slugger";
|
|
7
15
|
export { headingRank } from "hast-util-heading-rank";
|
|
8
16
|
export { transformerAddLang, transformerAddLineNumbers, transformerAddTitle, transformerAddWrapCode } from "@rspress/core/shiki-transformers";
|
|
9
17
|
export { createCssVariablesTheme } from "shiki";
|
|
18
|
+
export { isExternalUrl } from "@rspress/shared";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var package_namespaceObject = {
|
|
2
|
-
rE: "2.0.
|
|
2
|
+
rE: "2.0.6"
|
|
3
3
|
};
|
|
4
4
|
async function pMap(iterable, mapper, { concurrency = 1 / 0, stopOnError = true, signal } = {}) {
|
|
5
5
|
return new Promise((resolve_, reject_)=>{
|
|
@@ -93,6 +93,9 @@ async function pMap(iterable, mapper, { concurrency = 1 / 0, stopOnError = true,
|
|
|
93
93
|
}
|
|
94
94
|
const pMapSkip = Symbol('skip');
|
|
95
95
|
export { createRequire } from "node:module";
|
|
96
|
-
export { default as
|
|
96
|
+
export { default as node_path } from "node:path";
|
|
97
|
+
export { pathToFileURL } from "node:url";
|
|
98
|
+
export { logger } from "@rspress/shared/logger";
|
|
97
99
|
export { createHead, transformHtmlTemplate } from "@unhead/react/server";
|
|
100
|
+
export { default as picocolors } from "picocolors";
|
|
98
101
|
export { pMap, package_namespaceObject };
|
package/dist/8474.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { RSPRESS_TEMP_DIR, getSidebarDataGroup, normalizeHref, normalizePosixPath, removeTrailingSlash, withBase } from "@rspress/shared";
|
|
2
|
+
export { logger } from "@rspress/shared/logger";
|
|
3
|
+
export { getIconUrlPath, getNodeAttribute, mergeDocConfig } from "@rspress/shared/node-utils";
|
|
4
|
+
export { matchPath } from "react-router-dom";
|
package/dist/8885.js
ADDED
package/dist/cli/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { node_path, logger, join,
|
|
2
|
-
import {
|
|
3
|
-
import { package_namespaceObject } from "../5485.0bb24594.js";
|
|
1
|
+
import { chokidar, node_path, logger, picocolors, join, cac } from "../4454.js";
|
|
2
|
+
import { package_namespaceObject } from "../8311.js";
|
|
4
3
|
import { loadConfigFile, resolveDocRoot } from "../config/loadConfigFile.js";
|
|
5
4
|
import { dev } from "../node/dev.js";
|
|
6
5
|
import { PUBLIC_DIR } from "../node/constants.js";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { node_fs,
|
|
2
|
-
import { node_path, logger } from "../6289.29817fb4.js";
|
|
1
|
+
import { node_fs, node_path, logger, DEFAULT_CONFIG_NAME, DEFAULT_CONFIG_EXTENSIONS } from "../4454.js";
|
|
3
2
|
const findConfig = (basePath)=>DEFAULT_CONFIG_EXTENSIONS.map((ext)=>basePath + ext).find(node_fs.existsSync);
|
|
4
3
|
async function loadConfigFile(customConfigFile) {
|
|
5
4
|
const baseDir = process.cwd();
|
|
@@ -9,6 +9,7 @@ import { useCallback, useRef, useState } from 'react';
|
|
|
9
9
|
import { SvgWrapper } from '../SvgWrapper';
|
|
10
10
|
import './index.scss';
|
|
11
11
|
import './LlmsCopyButton.scss';
|
|
12
|
+
import { copyToClipboard } from './copy';
|
|
12
13
|
import { useMdUrl } from './useMdUrl';
|
|
13
14
|
|
|
14
15
|
export interface LlmsCopyButtonProps
|
|
@@ -51,7 +52,7 @@ export function LlmsCopyButton(props: LlmsCopyButtonProps) {
|
|
|
51
52
|
cache.get(url) ?? (await fetch(url).then(res => res.text()));
|
|
52
53
|
|
|
53
54
|
cache.set(url, content);
|
|
54
|
-
await
|
|
55
|
+
await copyToClipboard(content);
|
|
55
56
|
} finally {
|
|
56
57
|
setLoading(false);
|
|
57
58
|
setFinished(true);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useI18n } from '@rspress/core/runtime';
|
|
2
2
|
import { IconCopy, IconSuccess, SvgWrapper } from '@theme';
|
|
3
3
|
import { useCallback, useRef, useState } from 'react';
|
|
4
|
+
import { copyToClipboard } from './copy';
|
|
4
5
|
import { useMdUrl } from './useMdUrl';
|
|
5
6
|
|
|
6
7
|
const cache = new Map<string, string>();
|
|
@@ -19,7 +20,7 @@ export function LlmsCopyRow() {
|
|
|
19
20
|
const content: string =
|
|
20
21
|
cache.get(pathname) ?? (await fetch(pathname).then(res => res.text()));
|
|
21
22
|
cache.set(pathname, content);
|
|
22
|
-
await
|
|
23
|
+
await copyToClipboard(content);
|
|
23
24
|
} finally {
|
|
24
25
|
setLoading(false);
|
|
25
26
|
setFinished(true);
|
|
@@ -10,6 +10,7 @@ import { useEffect, useMemo, useRef, useState } from 'react';
|
|
|
10
10
|
import { SvgWrapper } from '../SvgWrapper';
|
|
11
11
|
import './index.scss';
|
|
12
12
|
import './LlmsViewOptions.scss';
|
|
13
|
+
import { copyToClipboard } from './copy';
|
|
13
14
|
import { useMdUrl } from './useMdUrl';
|
|
14
15
|
|
|
15
16
|
type Option =
|
|
@@ -98,7 +99,7 @@ export function LlmsViewOptions({
|
|
|
98
99
|
title: t('copyMarkdownLinkText'),
|
|
99
100
|
icon: <SvgWrapper icon={IconLink} />,
|
|
100
101
|
onClick: () => {
|
|
101
|
-
|
|
102
|
+
void copyToClipboard(fullMarkdownUrl);
|
|
102
103
|
},
|
|
103
104
|
},
|
|
104
105
|
chatgpt: {
|
|
@@ -348,6 +348,8 @@ export function SearchPanel({ focused, setFocused }: SearchPanelProps) {
|
|
|
348
348
|
// only setSearchResult when query is current query value
|
|
349
349
|
const currQuery = searchInputRef.current?.value;
|
|
350
350
|
if (currQuery === newQuery) {
|
|
351
|
+
// Reset current suggestion index to 0 when search query changes
|
|
352
|
+
setCurrentSuggestionIndex(0);
|
|
351
353
|
setSearchResult(searchResult || DEFAULT_RESULT);
|
|
352
354
|
setIsSearching(false);
|
|
353
355
|
}
|
|
@@ -5,21 +5,8 @@
|
|
|
5
5
|
border: var(--rp-code-block-border);
|
|
6
6
|
box-shadow: var(--rp-code-block-shadow);
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
border-radius: 0;
|
|
11
|
-
margin: 0;
|
|
12
|
-
border: none;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.rp-codeblock {
|
|
16
|
-
margin: 0;
|
|
17
|
-
border-radius: 0;
|
|
18
|
-
border: none;
|
|
19
|
-
|
|
20
|
-
.rp-codeblock__title {
|
|
21
|
-
padding: 8px 12px;
|
|
22
|
-
}
|
|
8
|
+
.rp-codeblock__title {
|
|
9
|
+
padding: 8px 12px;
|
|
23
10
|
}
|
|
24
11
|
|
|
25
12
|
&__label {
|
|
@@ -76,6 +63,17 @@
|
|
|
76
63
|
|
|
77
64
|
&__content {
|
|
78
65
|
&__item {
|
|
66
|
+
padding: 0 1rem;
|
|
67
|
+
|
|
68
|
+
// nested rp-tabs and codeblock
|
|
69
|
+
& > .rp-codeblock:only-child,
|
|
70
|
+
& > .rp-tabs:only-child {
|
|
71
|
+
margin: 0 -1rem;
|
|
72
|
+
border-radius: 0;
|
|
73
|
+
border: none;
|
|
74
|
+
box-shadow: none;
|
|
75
|
+
}
|
|
76
|
+
|
|
79
77
|
&--active {
|
|
80
78
|
display: block;
|
|
81
79
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
export { PluginDriver } from "./node/PluginDriver.js";
|
|
2
|
-
export { RSPRESS_TEMP_DIR, getIconUrlPath, getNodeAttribute, getSidebarDataGroup, mergeDocConfig, normalizeHref, normalizePosixPath, removeTrailingSlash, withBase } from "./
|
|
2
|
+
export { RSPRESS_TEMP_DIR, getIconUrlPath, getNodeAttribute, getSidebarDataGroup, logger, matchPath, mergeDocConfig, normalizeHref, normalizePosixPath, removeTrailingSlash, withBase } from "./8474.js";
|
|
3
3
|
export { RouteService } from "./node/route/RouteService.js";
|
|
4
4
|
export { build } from "./node/build.js";
|
|
5
5
|
export { defineConfig } from "./config/defineConfig.js";
|
|
6
6
|
export { dev } from "./node/dev.js";
|
|
7
|
-
export { logger } from "./6289.29817fb4.js";
|
|
8
|
-
export { matchPath } from "./7744.421b464f.js";
|
|
9
7
|
export { remarkFileCodeBlock } from "./node/mdx/remarkPlugins/fileCodeBlock.js";
|
|
10
8
|
export { remarkLink } from "./node/mdx/remarkPlugins/link.js";
|
|
11
9
|
export { serve } from "./node/serve.js";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { node_path } from "../
|
|
2
|
-
import { addTrailingSlash, addLeadingSlash } from "../9348.1beb3e25.js";
|
|
1
|
+
import { addTrailingSlash, node_path, addLeadingSlash } from "../675.js";
|
|
3
2
|
import { createError } from "./utils/error.js";
|
|
4
3
|
import { auto_nav_sidebar_haveNavSidebarConfig } from "./auto-nav-sidebar/index.js";
|
|
5
4
|
class PluginDriver {
|
|
@@ -29,15 +28,11 @@ class PluginDriver {
|
|
|
29
28
|
const enableLastUpdated = themeConfig?.lastUpdated;
|
|
30
29
|
const mediumZoomConfig = config?.mediumZoom ?? true;
|
|
31
30
|
if (enableLastUpdated) {
|
|
32
|
-
const { pluginLastUpdated } = await import("./last-updated/index.js")
|
|
33
|
-
pluginLastUpdated: mod.pluginLastUpdated
|
|
34
|
-
}));
|
|
31
|
+
const { pluginLastUpdated } = await import("./last-updated/index.js");
|
|
35
32
|
this.addPlugin(pluginLastUpdated());
|
|
36
33
|
}
|
|
37
34
|
if (mediumZoomConfig) {
|
|
38
|
-
const { pluginMediumZoom } = await import("./medium-zoom/index.js")
|
|
39
|
-
pluginMediumZoom: mod.pluginMediumZoom
|
|
40
|
-
}));
|
|
35
|
+
const { pluginMediumZoom } = await import("./medium-zoom/index.js");
|
|
41
36
|
this.addPlugin(pluginMediumZoom('object' == typeof mediumZoomConfig ? mediumZoomConfig : void 0));
|
|
42
37
|
}
|
|
43
38
|
(config.plugins || []).forEach((plugin)=>{
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { node_path } from "../../
|
|
2
|
-
import { DEFAULT_PAGE_EXTENSIONS } from "../../7744.421b464f.js";
|
|
1
|
+
import { DEFAULT_PAGE_EXTENSIONS, node_path } from "../../675.js";
|
|
3
2
|
import { processLocales, combineWalkResult } from "./locales.js";
|
|
4
3
|
import { walk } from "./walk.js";
|
|
5
4
|
async function runAutoNavSide(config, metaFileSet, mdFileSet) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { isExternalUrl, slash } from "../../9348.1beb3e25.js";
|
|
1
|
+
import { extname, stat as promises_stat, logger, picocolors, readdir, isExternalUrl, relative, slash, join } from "../../675.js";
|
|
3
2
|
import { createError } from "../utils/error.js";
|
|
4
3
|
import { PUBLIC_DIR } from "../constants.js";
|
|
5
4
|
import { pathExists, extractInfoFromFrontmatterWithAbsolutePath, readJson } from "./utils.js";
|
|
@@ -152,6 +151,7 @@ async function metaDirItemToSidebarItem(metaItem, workDir, docsDir, extensions,
|
|
|
152
151
|
collapsible,
|
|
153
152
|
collapsed,
|
|
154
153
|
items: await getItems(),
|
|
154
|
+
tag: metaJsonTag,
|
|
155
155
|
overviewHeaders: metaJsonOverviewHeaders,
|
|
156
156
|
context: metaJsonContext,
|
|
157
157
|
_fileKey: getFileKey(dirAbsolutePath, docsDir)
|
|
@@ -163,6 +163,7 @@ async function metaDirItemToSidebarItem(metaItem, workDir, docsDir, extensions,
|
|
|
163
163
|
collapsible,
|
|
164
164
|
collapsed,
|
|
165
165
|
items: await getItems(),
|
|
166
|
+
tag: metaJsonTag,
|
|
166
167
|
overviewHeaders: metaJsonOverviewHeaders,
|
|
167
168
|
context: metaJsonContext,
|
|
168
169
|
_fileKey: getFileKey(dirAbsolutePath, docsDir)
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { node_path, promises } from "../../
|
|
2
|
-
import { loadFrontMatter, extractTextAndId } from "../../9348.1beb3e25.js";
|
|
1
|
+
import { node_path, extractTextAndId, promises, loadFrontMatter } from "../../675.js";
|
|
3
2
|
async function pathExists(path) {
|
|
4
3
|
try {
|
|
5
4
|
await promises.access(path);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { node_path, promises } from "../../
|
|
2
|
-
import { isExternalUrl } from "../../9348.1beb3e25.js";
|
|
1
|
+
import { isExternalUrl, node_path, promises } from "../../675.js";
|
|
3
2
|
import { pathExists } from "../utils/fs.js";
|
|
4
3
|
import { readJson } from "./utils.js";
|
|
5
4
|
import { createError } from "../utils/error.js";
|
package/dist/node/constants.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { createRequire, package_namespaceObject } from "../
|
|
2
|
-
import { node_path } from "../6289.29817fb4.js";
|
|
1
|
+
import { createRequire, node_path, package_namespaceObject } from "../8311.js";
|
|
3
2
|
const constants_require = createRequire(import.meta.url);
|
|
4
3
|
const RSPRESS_VERSION = package_namespaceObject.rE;
|
|
5
4
|
const APPEARANCE_KEY = 'rspress-theme-appearance';
|
package/dist/node/eject.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { node_path, logger, promises, picocolors } from "../
|
|
1
|
+
import { node_path, logger, promises, picocolors } from "../4454.js";
|
|
2
2
|
import { EJECTED_THEME } from "./constants.js";
|
|
3
3
|
let _themeComponentsPathOverride;
|
|
4
4
|
function getThemeComponentsPath() {
|
package/dist/node/initRsbuild.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { node_path } from "../6289.29817fb4.js";
|
|
3
|
-
import { addTrailingSlash, removeTrailingSlash, cwd, MDX_OR_MD_REGEXP } from "../9348.1beb3e25.js";
|
|
4
|
-
import { PLUGIN_REACT_NAME, pluginReact, pluginVirtualModule } from "../7744.421b464f.js";
|
|
1
|
+
import { addTrailingSlash, node_path, fileURLToPath, cwd, PLUGIN_REACT_NAME, removeTrailingSlash, pluginVirtualModule, pluginReact, createRequire, MDX_OR_MD_REGEXP } from "../675.js";
|
|
5
2
|
import { createError } from "./utils/error.js";
|
|
6
3
|
import { PUBLIC_DIR, CSR_CLIENT_ENTRY, SSR_CLIENT_ENTRY, OUTPUT_DIR, SSG_MD_SERVER_ENTRY, inlineThemeScript, NODE_SSG_BUNDLE_FOLDER, isProduction, PACKAGE_ROOT, SSR_SERVER_ENTRY, TEMPLATE_PATH, NODE_SSG_MD_BUNDLE_FOLDER, DEFAULT_THEME, NODE_SSG_MD_BUNDLE_NAME, DEFAULT_TITLE, NODE_SSG_BUNDLE_NAME } from "./constants.js";
|
|
7
4
|
import { hintBuilderPluginsBreakingChange, hintThemeBreakingChange } from "./logger/hint.js";
|
|
@@ -17,6 +14,7 @@ import { siteDataVMPlugin } from "./runtimeModule/siteData/rsbuildPlugin.js";
|
|
|
17
14
|
import { rsbuildPluginSSG } from "./ssg/rsbuildPluginSSG.js";
|
|
18
15
|
import { rsbuildPluginCSR } from "./ssg/rsbuildPluginCSR.js";
|
|
19
16
|
import { rsbuildPluginSSGMD } from "./ssg-md/rsbuildPluginSSGMD.js";
|
|
17
|
+
import { package_namespaceObject } from "../8311.js";
|
|
20
18
|
function isPluginIncluded(config, pluginName) {
|
|
21
19
|
return Boolean(config.builderConfig?.plugins?.some((plugin)=>plugin && plugin.name === pluginName));
|
|
22
20
|
}
|
package/dist/node/logger/hint.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { picocolors, relative, logger, join, readFile } from "../../
|
|
1
|
+
import { picocolors, relative, logger, join, readFile } from "../../8885.js";
|
|
2
2
|
import { pathExists } from "../utils/fs.js";
|
|
3
3
|
const THEME_DEFAULT_EXPORT_PATTERN = /export\s+default\s+\{/;
|
|
4
4
|
const THEME_OLD_IMPORT_0 = /from\s+['"]rspress\/theme['"]/;
|
|
@@ -65,7 +65,10 @@ function hintSSGFailed() {
|
|
|
65
65
|
function hintSSGFalse() {
|
|
66
66
|
logger.info('`ssg: false` detected, SSG will be disabled.');
|
|
67
67
|
}
|
|
68
|
+
let reactVersionLogged = false;
|
|
68
69
|
function hintReactVersion() {
|
|
70
|
+
if (reactVersionLogged) return;
|
|
71
|
+
reactVersionLogged = true;
|
|
69
72
|
logger.info('[Rspress v2] Rspress support React 18 and 19, please confirm that both react and react-dom are installed in package.json with the same version. ');
|
|
70
73
|
}
|
|
71
74
|
function hintNavJsonChangeThenPanic(metaJson, metaJsonDir, docsDir) {
|
package/dist/node/mdx/options.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { node_path } from "../../
|
|
2
|
-
import { remark_gfm, nodeTypes } from "../../9348.1beb3e25.js";
|
|
3
|
-
import { rehype_external_links, rehype_raw, remark_cjk_friendly, rehype, remark_cjk_friendly_gfm_strikethrough } from "./loader.15134034.js";
|
|
1
|
+
import { node_path, rehype_external_links, rehype_raw, remark_cjk_friendly, nodeTypes, remark_gfm, rehype, remark_cjk_friendly_gfm_strikethrough } from "../../7397.js";
|
|
4
2
|
import { remarkToc } from "./remarkPlugins/toc.js";
|
|
5
3
|
import { remarkContainerSyntax } from "./remarkPlugins/containerSyntax.js";
|
|
6
4
|
import { remarkFileCodeBlock } from "./remarkPlugins/fileCodeBlock.js";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { node_path } from "../../
|
|
2
|
-
import { createProcessor, loadFrontMatter, extractTextAndId } from "../../9348.1beb3e25.js";
|
|
1
|
+
import { node_path, extractTextAndId, createProcessor, loadFrontMatter } from "../../7397.js";
|
|
3
2
|
import { createMDXOptions } from "./options.js";
|
|
4
3
|
import { applyReplaceRules } from "../utils/applyReplaceRules.js";
|
|
5
4
|
import { escapeMarkdownHeadingIds } from "../utils/escapeHeadingIds.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { visit } from "../../../
|
|
1
|
+
import { visit } from "../../../7397.js";
|
|
2
2
|
const rehypeCodeMeta = ()=>(tree)=>{
|
|
3
3
|
visit(tree, 'element', (node)=>{
|
|
4
4
|
if ('pre' === node.tagName && node.children[0]?.type === 'element' && 'code' === node.children[0].tagName) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { visit, github_slugger,
|
|
2
|
-
import { headingRank } from "../loader.15134034.js";
|
|
1
|
+
import { visit, extractTextAndId, github_slugger, headingRank } from "../../../7397.js";
|
|
3
2
|
const rehypeHeaderAnchor = ()=>{
|
|
4
3
|
const slugger = new github_slugger();
|
|
5
4
|
return (tree)=>{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { RehypeShikiOptions } from '@shikijs/rehype';
|
|
2
2
|
import rehypeShiki from '@shikijs/rehype';
|
|
3
3
|
declare function createRehypeShikiOptions(showLineNumbers: boolean, defaultWrapCode: boolean, options?: Partial<RehypeShikiOptions>): RehypeShikiOptions;
|
|
4
|
-
export {
|
|
4
|
+
export { createRehypeShikiOptions, rehypeShiki };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { transformerAddLang, transformerAddLineNumbers, transformerAddTitle, createCssVariablesTheme, transformerAddWrapCode } from "
|
|
1
|
+
import { transformerAddLang, transformerAddLineNumbers, transformerAddTitle, createCssVariablesTheme, transformerAddWrapCode } from "../../../7397.js";
|
|
2
2
|
const cssVariablesTheme = createCssVariablesTheme({
|
|
3
3
|
name: 'css-variables',
|
|
4
4
|
variablePrefix: '--shiki-',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*!
|
|
1
|
+
/*! LICENSE: meta-highlight.js.LICENSE.txt */
|
|
2
2
|
/**
|
|
3
3
|
* these codes are copied from @shiki/transformers, transformerMetaHighlight
|
|
4
4
|
* @source https://github.com/shikijs/shiki/blob/f5cf06f55a0b4643d7b02f15ee2c5033be6f1245/packages/transformers/src/transformers/meta-highlight.ts#L56
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { node_path } from "../../../
|
|
1
|
+
import { node_path } from "../../../7397.js";
|
|
2
2
|
import { getDefaultImportAstNode } from "../../utils/getImportAstNode.js";
|
|
3
3
|
const remarkBuiltin = ({ globalComponents })=>(tree)=>{
|
|
4
4
|
const demos = globalComponents.map((componentPath)=>{
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { node_path, logger, picocolors, readFile } from "../../../
|
|
2
|
-
import { visit, cwd } from "../../../9348.1beb3e25.js";
|
|
1
|
+
import { visit, node_path, logger, cwd, picocolors, readFile } from "../../../1965.js";
|
|
3
2
|
import { createError } from "../../utils/error.js";
|
|
4
3
|
const ERROR_PREFIX = '[remarkFileCodeBlock]';
|
|
5
4
|
function parseFileFromMeta(meta) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isExternalUrl, getNodeAttribute, visit } from "../../../
|
|
1
|
+
import { isExternalUrl, getNodeAttribute, visit } from "../../../7397.js";
|
|
2
2
|
import { getDefaultImportAstNode } from "../../utils/getImportAstNode.js";
|
|
3
3
|
const normalizeImageUrl = (imageUrl)=>{
|
|
4
4
|
if (isExternalUrl(imageUrl) || imageUrl.startsWith('/')) return '';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { node_path, logger, picocolors } from "../../../
|
|
2
|
-
import { isExternalUrl, isProduction, addLeadingSlash, parseUrl, normalizeHref, visit, withBase } from "../../../9348.1beb3e25.js";
|
|
1
|
+
import { normalizeHref, node_path, addLeadingSlash, logger, visit, picocolors, isExternalUrl, isProduction, parseUrl, withBase } from "../../../1965.js";
|
|
3
2
|
import { hintRelativeMarkdownLink } from "../../logger/hint.js";
|
|
4
3
|
import { createError } from "../../utils/error.js";
|
|
5
4
|
function link_checkDeadLinks(checkDeadLinks, internalLinks, file, lint) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { github_slugger, visitChildren, extractTextAndId } from "../../../
|
|
1
|
+
import { github_slugger, visitChildren, extractTextAndId } from "../../../1361.js";
|
|
2
2
|
const extractChildText = (child)=>{
|
|
3
3
|
if ('link' === child.type) return child.children?.map(extractChildText).join('') ?? '';
|
|
4
4
|
if ('strong' === child.type) return `**${child.children?.map(extractChildText).join('') ?? ''}**`;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { node_path, promises } from "../../
|
|
2
|
-
import { RSPRESS_TEMP_DIR, removeTrailingSlash, addTrailingSlash } from "../../9348.1beb3e25.js";
|
|
3
|
-
import { DEFAULT_PAGE_EXTENSIONS, glob } from "../../7744.421b464f.js";
|
|
1
|
+
import { RSPRESS_TEMP_DIR, node_path, removeTrailingSlash, promises, addTrailingSlash, DEFAULT_PAGE_EXTENSIONS, glob } from "../../675.js";
|
|
4
2
|
import { PUBLIC_DIR } from "../constants.js";
|
|
5
3
|
import { RoutePage, absolutePathToRoutePath, absolutePathToRelativePath } from "./RoutePage.js";
|
|
6
4
|
import { createError } from "../utils/error.js";
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { node_path, promises } from "../../
|
|
2
|
-
import { unified, visit, remark_gfm, loadFrontMatter, remark_stringify, MDX_OR_MD_REGEXP } from "../../9348.1beb3e25.js";
|
|
3
|
-
import { remove, remark_parse } from "../../7744.421b464f.js";
|
|
1
|
+
import { unified, node_path, visit, promises, loadFrontMatter, remark_stringify, remove, remark_gfm, MDX_OR_MD_REGEXP, remark_parse } from "../../675.js";
|
|
4
2
|
import { applyReplaceRules } from "../utils/applyReplaceRules.js";
|
|
5
3
|
import { flattenMdxContent } from "../utils/flattenMdxContent.js";
|
|
6
4
|
import { importStatementRegex } from "../constants.js";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { addTrailingSlash, addLeadingSlash } from "../../
|
|
2
|
-
import { DEFAULT_PAGE_EXTENSIONS } from "../../7744.421b464f.js";
|
|
1
|
+
import { addTrailingSlash, DEFAULT_PAGE_EXTENSIONS, addLeadingSlash } from "../../675.js";
|
|
3
2
|
const getRoutePathParts = (relativePath, lang, version, langs, versions)=>{
|
|
4
3
|
const [versionPart, langPart, purePath] = splitRoutePathParts(relativePath, lang, version, langs, versions);
|
|
5
4
|
return [
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { createRequire } from "../../
|
|
2
|
-
import { picocolors, join, logger } from "../../6289.29817fb4.js";
|
|
1
|
+
import { logger, createRequire, join, picocolors } from "../../675.js";
|
|
3
2
|
import { DEFAULT_I18N_TEXT } from "./DEFAULT_I18N_TEXT.js";
|
|
4
3
|
import { createError } from "../utils/error.js";
|
|
5
4
|
import { pathExists } from "../utils/fs.js";
|