@rspress/core 2.0.2 → 2.0.3
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.6e0caa9f.js → 0~7675.872de9ba.js} +2 -2
- package/dist/{5485.5f8db93a.js → 5485.888e77db.js} +1 -1
- package/dist/_private/react/render.js +58 -8
- package/dist/cli/index.js +1 -1
- package/dist/config/loadConfigFile.js +1 -1
- package/dist/eject-theme/components/OverviewGroup/index.scss +5 -11
- package/dist/eject-theme/components/SidebarMenu/index.scss +25 -1
- package/dist/eject-theme/components/SidebarMenu/index.tsx +5 -2
- package/dist/eject-theme/components/Tag/index.tsx +2 -0
- package/dist/index.js +1 -1
- package/dist/node/auto-nav-sidebar/index.js +1 -1
- package/dist/node/constants.js +1 -1
- package/dist/node/initRsbuild.js +2 -2
- package/dist/node/last-updated/index.js +1 -1
- package/dist/node/logger/hint.js +1 -3
- 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 +1 -1
- package/dist/node/runtimeModule/pageData/createPageData.js +1 -1
- package/dist/node/runtimeModule/pageData/rsbuildPlugin.js +1 -1
- package/dist/node/serve.js +1 -1
- package/dist/node/ssg/renderPage.js +1 -1
- package/dist/node/ssg/renderPageWorker.js +1 -1
- package/dist/node/ssg/renderPages.js +2 -2
- package/dist/node/ssg-md/llms/emitLlmsTxt.js +1 -1
- package/dist/node/ssg-md/react/render.d.ts +1 -0
- package/dist/node/ssg-md/renderPage.js +4 -3
- package/dist/node/ssg-md/renderPages.js +1 -1
- package/dist/node/utils/createHash.js +1 -1
- package/dist/node/utils/flattenMdxContent.js +1 -1
- package/dist/node/utils/reactAlias.js +1 -1
- package/dist/theme/components/OverviewGroup/index.css +2 -9
- package/dist/theme/components/SidebarMenu/index.css +25 -1
- package/dist/theme/components/SidebarMenu/index.js +3 -1
- package/dist/theme/components/Tag/index.js +4 -0
- package/dist/theme/layout/Layout/index.js +10 -4
- package/package.json +8 -8
- /package/dist/{2577.421b464f.js → 8995.421b464f.js} +0 -0
|
@@ -9,8 +9,8 @@ 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.
|
|
13
|
-
import { createWriteStream, createReadStream, readFileSync } from "./
|
|
12
|
+
import { node_url } from "./5485.888e77db.js";
|
|
13
|
+
import { createWriteStream, createReadStream, readFileSync } from "./8995.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__) {
|
|
16
16
|
const cp = __webpack_require__("child_process");
|
|
@@ -1,4 +1,49 @@
|
|
|
1
|
+
import react from "react";
|
|
1
2
|
import { MarkdownNode, TextNode, reconciler } from "./reconciler.js";
|
|
3
|
+
const ReactSharedInternals = react.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
4
|
+
function noop() {}
|
|
5
|
+
let interceptorRefCount = 0;
|
|
6
|
+
let originalDescriptor;
|
|
7
|
+
let realH = null;
|
|
8
|
+
let cachedTarget = null;
|
|
9
|
+
let cachedProxy = null;
|
|
10
|
+
function installEffectInterceptor() {
|
|
11
|
+
if (!ReactSharedInternals) return noop;
|
|
12
|
+
interceptorRefCount++;
|
|
13
|
+
if (1 === interceptorRefCount) {
|
|
14
|
+
originalDescriptor = Object.getOwnPropertyDescriptor(ReactSharedInternals, 'H');
|
|
15
|
+
realH = ReactSharedInternals.H;
|
|
16
|
+
cachedTarget = null;
|
|
17
|
+
cachedProxy = null;
|
|
18
|
+
Object.defineProperty(ReactSharedInternals, 'H', {
|
|
19
|
+
get () {
|
|
20
|
+
if (null == realH) return realH;
|
|
21
|
+
if (cachedTarget !== realH) {
|
|
22
|
+
cachedTarget = realH;
|
|
23
|
+
cachedProxy = new Proxy(realH, {
|
|
24
|
+
get (target, prop, receiver) {
|
|
25
|
+
if ('useEffect' === prop || 'useLayoutEffect' === prop || 'useInsertionEffect' === prop) return noop;
|
|
26
|
+
return Reflect.get(target, prop, receiver);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
return cachedProxy;
|
|
31
|
+
},
|
|
32
|
+
set (value) {
|
|
33
|
+
realH = value;
|
|
34
|
+
},
|
|
35
|
+
configurable: true
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return ()=>{
|
|
39
|
+
interceptorRefCount--;
|
|
40
|
+
if (0 === interceptorRefCount) if (originalDescriptor) Object.defineProperty(ReactSharedInternals, 'H', originalDescriptor);
|
|
41
|
+
else {
|
|
42
|
+
delete ReactSharedInternals.H;
|
|
43
|
+
ReactSharedInternals.H = realH;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}
|
|
2
47
|
function toMarkdown(root) {
|
|
3
48
|
const { type, props, children } = root;
|
|
4
49
|
const childrenMd = children.map((child)=>{
|
|
@@ -106,13 +151,18 @@ async function renderToMarkdownString(element) {
|
|
|
106
151
|
}, ()=>{}, (...args)=>{
|
|
107
152
|
if (process.env.DEBUG) console.log('Reconciler onRecoverable Error:', ...args);
|
|
108
153
|
}, ()=>{}, null);
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
resolveCommit =
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
154
|
+
const removeInterceptor = installEffectInterceptor();
|
|
155
|
+
try {
|
|
156
|
+
let resolveCommit = null;
|
|
157
|
+
const commitPromise = new Promise((resolve)=>{
|
|
158
|
+
resolveCommit = resolve;
|
|
159
|
+
});
|
|
160
|
+
reconciler.updateContainer(element, root, null, ()=>{
|
|
161
|
+
if (resolveCommit) resolveCommit(toMarkdown(container));
|
|
162
|
+
});
|
|
163
|
+
return await commitPromise;
|
|
164
|
+
} finally{
|
|
165
|
+
removeInterceptor();
|
|
166
|
+
}
|
|
117
167
|
}
|
|
118
168
|
export { renderToMarkdownString };
|
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.888e77db.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";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { node_fs, DEFAULT_CONFIG_EXTENSIONS, DEFAULT_CONFIG_NAME } from "../
|
|
1
|
+
import { node_fs, DEFAULT_CONFIG_EXTENSIONS, DEFAULT_CONFIG_NAME } from "../8995.421b464f.js";
|
|
2
2
|
import { node_path, logger } from "../6289.29817fb4.js";
|
|
3
3
|
const findConfig = (basePath)=>DEFAULT_CONFIG_EXTENSIONS.map((ext)=>basePath + ext).find(node_fs.existsSync);
|
|
4
4
|
async function loadConfigFile(customConfigFile) {
|
|
@@ -95,16 +95,10 @@
|
|
|
95
95
|
&__item {
|
|
96
96
|
width: 200px;
|
|
97
97
|
flex: 0 0 200px;
|
|
98
|
-
min-width:
|
|
99
|
-
max-width:
|
|
98
|
+
min-width: 33.33%; // 3 columns
|
|
99
|
+
max-width: 33.33%; // 3 columns
|
|
100
100
|
word-break: break-all;
|
|
101
101
|
|
|
102
|
-
@media (min-width: 769px) and (max-width: 1280px) {
|
|
103
|
-
// 3 columns
|
|
104
|
-
min-width: 33%;
|
|
105
|
-
max-width: 33%;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
102
|
@media (max-width: 768px) {
|
|
109
103
|
// 2 columns or 1 columns
|
|
110
104
|
min-width: 50%;
|
|
@@ -135,16 +129,16 @@
|
|
|
135
129
|
// Grid layout for items without content (no headers/items)
|
|
136
130
|
&__grid {
|
|
137
131
|
display: grid;
|
|
138
|
-
grid-template-columns: repeat(4, 1fr);
|
|
132
|
+
grid-template-columns: repeat(4, 1fr); // 4 columns by default
|
|
139
133
|
gap: 20px;
|
|
140
134
|
width: 100%;
|
|
141
135
|
|
|
142
136
|
@media (max-width: 1280px) {
|
|
143
|
-
grid-template-columns: repeat(3, 1fr);
|
|
137
|
+
grid-template-columns: repeat(3, 1fr); // 3 columns for medium screens
|
|
144
138
|
}
|
|
145
139
|
|
|
146
140
|
@media (max-width: 768px) {
|
|
147
|
-
grid-template-columns: repeat(2, 1fr);
|
|
141
|
+
grid-template-columns: repeat(2, 1fr); // 2 columns for small screens
|
|
148
142
|
}
|
|
149
143
|
|
|
150
144
|
@media (max-width: 480px) {
|
|
@@ -15,13 +15,37 @@
|
|
|
15
15
|
font-style: normal;
|
|
16
16
|
font-weight: 600;
|
|
17
17
|
|
|
18
|
-
&__left
|
|
18
|
+
&__left {
|
|
19
|
+
display: flex;
|
|
20
|
+
gap: 8px;
|
|
21
|
+
align-items: center;
|
|
22
|
+
height: 100%;
|
|
23
|
+
background: transparent;
|
|
24
|
+
flex-shrink: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
19
27
|
&__right {
|
|
20
28
|
display: flex;
|
|
21
29
|
gap: 8px;
|
|
22
30
|
align-items: center;
|
|
23
31
|
height: 100%;
|
|
24
32
|
background: transparent;
|
|
33
|
+
min-width: 0;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
|
|
36
|
+
&__text {
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
display: -webkit-box;
|
|
39
|
+
line-clamp: 2;
|
|
40
|
+
-webkit-line-clamp: 2;
|
|
41
|
+
-webkit-box-orient: vertical;
|
|
42
|
+
text-overflow: ellipsis;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&__icon,
|
|
46
|
+
.rp-progress-circle {
|
|
47
|
+
flex-shrink: 0;
|
|
48
|
+
}
|
|
25
49
|
}
|
|
26
50
|
|
|
27
51
|
@media (min-width: 1280px) {
|
|
@@ -104,17 +104,20 @@ export const SidebarMenu = forwardRef(
|
|
|
104
104
|
>
|
|
105
105
|
{scrolledHeader?.text ? (
|
|
106
106
|
<span
|
|
107
|
-
className="rp-doc"
|
|
107
|
+
className="rp-sidebar-menu__right__text rp-doc"
|
|
108
108
|
{...renderInlineMarkdown(scrolledHeader.text)}
|
|
109
109
|
/>
|
|
110
110
|
) : (
|
|
111
|
-
<span>
|
|
111
|
+
<span className="rp-sidebar-menu__right__text">
|
|
112
|
+
{t('outlineTitle')}
|
|
113
|
+
</span>
|
|
112
114
|
)}
|
|
113
115
|
<ReadPercent size={14} strokeWidth={2} />
|
|
114
116
|
{/* TODO: discussion */}
|
|
115
117
|
{headers.length !== 0 && (
|
|
116
118
|
<SvgWrapper
|
|
117
119
|
icon={IconArrowRight}
|
|
120
|
+
className="rp-sidebar-menu__right__icon"
|
|
118
121
|
style={{
|
|
119
122
|
transform: isOutlineOpen ? 'rotate(90deg)' : 'rotate(0deg)',
|
|
120
123
|
transition: 'transform 0.2s ease-out',
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ export { build } from "./node/build.js";
|
|
|
5
5
|
export { defineConfig } from "./config/defineConfig.js";
|
|
6
6
|
export { dev } from "./node/dev.js";
|
|
7
7
|
export { logger } from "./6289.29817fb4.js";
|
|
8
|
-
export { matchPath } from "./
|
|
8
|
+
export { matchPath } from "./8995.421b464f.js";
|
|
9
9
|
export { remarkFileCodeBlock } from "./node/mdx/remarkPlugins/fileCodeBlock.js";
|
|
10
10
|
export { remarkLink } from "./node/mdx/remarkPlugins/link.js";
|
|
11
11
|
export { serve } from "./node/serve.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { node_path } from "../../6289.29817fb4.js";
|
|
2
|
-
import { DEFAULT_PAGE_EXTENSIONS } from "../../
|
|
2
|
+
import { DEFAULT_PAGE_EXTENSIONS } from "../../8995.421b464f.js";
|
|
3
3
|
import { processLocales, combineWalkResult } from "./locales.js";
|
|
4
4
|
import { walk } from "./walk.js";
|
|
5
5
|
async function runAutoNavSide(config, metaFileSet, mdFileSet) {
|
package/dist/node/constants.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createRequire, package_namespaceObject } from "../5485.
|
|
1
|
+
import { createRequire, package_namespaceObject } from "../5485.888e77db.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,7 +1,7 @@
|
|
|
1
|
-
import { createRequire, fileURLToPath, package_namespaceObject } from "../5485.
|
|
1
|
+
import { createRequire, fileURLToPath, package_namespaceObject } from "../5485.888e77db.js";
|
|
2
2
|
import { node_path } from "../6289.29817fb4.js";
|
|
3
3
|
import { removeTrailingSlash, MDX_OR_MD_REGEXP, cwd } from "../9348.1beb3e25.js";
|
|
4
|
-
import { PLUGIN_REACT_NAME, pluginReact, pluginVirtualModule } from "../
|
|
4
|
+
import { PLUGIN_REACT_NAME, pluginReact, pluginVirtualModule } from "../8995.421b464f.js";
|
|
5
5
|
import { createError } from "./utils/error.js";
|
|
6
6
|
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
7
|
import { hintBuilderPluginsBreakingChange, hintThemeBreakingChange } from "./logger/hint.js";
|
package/dist/node/logger/hint.js
CHANGED
|
@@ -57,9 +57,7 @@ ${picocolors.greenBright(` builderConfig: {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
function hintSSGFailed() {
|
|
60
|
-
logger.info(
|
|
61
|
-
1. Fix code to make it SSR-compatible.
|
|
62
|
-
2. Set \`ssg: false\` if the code in node_modules may be difficult to fix, but the SSG feature will be lost.`);
|
|
60
|
+
logger.info("[Rspress v2] `ssg: true` requires the source code to support SSR. If the code is not compatible to SSR, the build process will fail. You can try:\n 1. Fix code to make it SSR-compatible.\n 2. Set `ssg: false` if the code in node_modules may be difficult to fix, but the SSG feature will be lost.");
|
|
63
61
|
}
|
|
64
62
|
function hintSSGFalse() {
|
|
65
63
|
logger.info('`ssg: false` detected, SSG will be disabled.');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { node_path, promises } from "../../6289.29817fb4.js";
|
|
2
2
|
import { RSPRESS_TEMP_DIR, removeTrailingSlash, addTrailingSlash } from "../../9348.1beb3e25.js";
|
|
3
|
-
import { DEFAULT_PAGE_EXTENSIONS, glob } from "../../
|
|
3
|
+
import { DEFAULT_PAGE_EXTENSIONS, glob } from "../../8995.421b464f.js";
|
|
4
4
|
import { PUBLIC_DIR } from "../constants.js";
|
|
5
5
|
import { RoutePage, absolutePathToRoutePath, absolutePathToRelativePath } from "./RoutePage.js";
|
|
6
6
|
import { createError } from "../utils/error.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { node_path, promises } from "../../6289.29817fb4.js";
|
|
2
2
|
import { unified, visit, remark_gfm, loadFrontMatter, remark_stringify, MDX_OR_MD_REGEXP } from "../../9348.1beb3e25.js";
|
|
3
|
-
import { remove, remark_parse } from "../../
|
|
3
|
+
import { remove, remark_parse } from "../../8995.421b464f.js";
|
|
4
4
|
import { applyReplaceRules } from "../utils/applyReplaceRules.js";
|
|
5
5
|
import { flattenMdxContent } from "../utils/flattenMdxContent.js";
|
|
6
6
|
import { importStatementRegex } from "../constants.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { addTrailingSlash, addLeadingSlash } from "../../9348.1beb3e25.js";
|
|
2
|
-
import { DEFAULT_PAGE_EXTENSIONS } from "../../
|
|
2
|
+
import { DEFAULT_PAGE_EXTENSIONS } from "../../8995.421b464f.js";
|
|
3
3
|
const getRoutePathParts = (relativePath, lang, version, langs, versions)=>{
|
|
4
4
|
const [versionPart, langPart, purePath] = splitRoutePathParts(relativePath, lang, version, langs, versions);
|
|
5
5
|
return [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createRequire } from "../../5485.
|
|
1
|
+
import { createRequire } from "../../5485.888e77db.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,5 +1,5 @@
|
|
|
1
1
|
import { SEARCH_INDEX_NAME } from "../../../9348.1beb3e25.js";
|
|
2
|
-
import { groupBy } from "../../../
|
|
2
|
+
import { groupBy } from "../../../8995.421b464f.js";
|
|
3
3
|
import { extractPageData } from "../../route/extractPageData.js";
|
|
4
4
|
import { createHash } from "../../utils/createHash.js";
|
|
5
5
|
function deletePrivateField(obj) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { logger } from "../../../6289.29817fb4.js";
|
|
2
|
-
import { pluginVirtualModule } from "../../../
|
|
2
|
+
import { pluginVirtualModule } from "../../../8995.421b464f.js";
|
|
3
3
|
import { createPageData } from "./createPageData.js";
|
|
4
4
|
const rsbuildPluginDocVM = async ({ config, userDocRoot, routeService, pluginDriver })=>{
|
|
5
5
|
const ref = {
|
package/dist/node/serve.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { mergeRsbuildConfig } from "../
|
|
1
|
+
import { mergeRsbuildConfig } from "../8995.421b464f.js";
|
|
2
2
|
import { PluginDriver } from "./PluginDriver.js";
|
|
3
3
|
import { initRsbuild } from "./initRsbuild.js";
|
|
4
4
|
import { RouteService } from "./route/RouteService.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { transformHtmlTemplate, pathToFileURL, createHead } from "../../5485.
|
|
1
|
+
import { transformHtmlTemplate, pathToFileURL, createHead } from "../../5485.888e77db.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.888e77db.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');
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*! For license information please see renderPages.js.LICENSE.txt */
|
|
2
2
|
import { logger, picocolors } from "../../6289.29817fb4.js";
|
|
3
|
-
import { chunk } from "../../
|
|
3
|
+
import { chunk } from "../../8995.421b464f.js";
|
|
4
4
|
import { SSGWorkerThreadTaskSize, getNumberOfThreads, SSGWorkerThreadRecyclerMaxMemory, SSGConcurrency } from "./ssgEnv.js";
|
|
5
|
-
import { pMap } from "../../5485.
|
|
5
|
+
import { pMap } from "../../5485.888e77db.js";
|
|
6
6
|
import { renderPage } from "./renderPage.js";
|
|
7
7
|
import { hintSSGFailed } from "../logger/hint.js";
|
|
8
8
|
import { renderHtmlTemplate } from "./renderHtmlTemplate.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getSidebarDataGroup } from "../../../9348.1beb3e25.js";
|
|
2
|
-
import { matchPath } from "../../../
|
|
2
|
+
import { matchPath } from "../../../8995.421b464f.js";
|
|
3
3
|
import { generateLlmsTxt, generateLlmsFullTxt } from "./llmsTxt.js";
|
|
4
4
|
async function emitLlmsTxt(config, routeService, emitAsset, mdContents) {
|
|
5
5
|
const base = config.base ?? '/';
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { pathToFileURL, createHead } from "../../5485.
|
|
1
|
+
import { pathToFileURL, createHead } from "../../5485.888e77db.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) {
|
|
5
5
|
let render;
|
|
6
6
|
try {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
let { default: ssrExports } = await import(pathToFileURL(ssrBundlePath).toString());
|
|
8
|
+
if (ssrExports instanceof Promise) ssrExports = await ssrExports;
|
|
9
|
+
render = ssrExports.render;
|
|
9
10
|
} catch (e) {
|
|
10
11
|
if (e instanceof Error) {
|
|
11
12
|
logger.error(`Failed to load SSG bundle: ${picocolors.yellow(ssrBundlePath)}: ${e.message}`);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { logger, picocolors } from "../../6289.29817fb4.js";
|
|
2
|
-
import { pMap } from "../../5485.
|
|
2
|
+
import { pMap } from "../../5485.888e77db.js";
|
|
3
3
|
import { renderPage } from "./renderPage.js";
|
|
4
4
|
import { SSGConcurrency } from "../ssg/ssgEnv.js";
|
|
5
5
|
const routePage2MdFilename = (routePath)=>{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createHash as external_node_crypto_createHash } from "../../
|
|
1
|
+
import { createHash as external_node_crypto_createHash } from "../../8995.421b464f.js";
|
|
2
2
|
function createHash(str) {
|
|
3
3
|
return external_node_crypto_createHash('sha256').update(str).digest('hex').slice(0, 8);
|
|
4
4
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { node_fs, core_rspack } from "../../
|
|
1
|
+
import { node_fs, core_rspack } from "../../8995.421b464f.js";
|
|
2
2
|
import { node_path, logger } from "../../6289.29817fb4.js";
|
|
3
3
|
import { createProcessor, MDX_OR_MD_REGEXP } from "../../9348.1beb3e25.js";
|
|
4
4
|
import { createError } from "./error.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { node_path, logger, picocolors } from "../../6289.29817fb4.js";
|
|
2
|
-
import { core_rspack } from "../../
|
|
2
|
+
import { core_rspack } from "../../8995.421b464f.js";
|
|
3
3
|
import { pathExists, readJson } from "./fs.js";
|
|
4
4
|
import { PACKAGE_ROOT } from "../constants.js";
|
|
5
5
|
import { hintReactVersion } from "../logger/hint.js";
|
|
@@ -91,15 +91,8 @@
|
|
|
91
91
|
word-break: break-all;
|
|
92
92
|
flex: 0 0 200px;
|
|
93
93
|
width: 200px;
|
|
94
|
-
min-width:
|
|
95
|
-
max-width:
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
@media (width >= 769px) and (width <= 1280px) {
|
|
99
|
-
.rp-overview-group__item__content__item {
|
|
100
|
-
min-width: 33%;
|
|
101
|
-
max-width: 33%;
|
|
102
|
-
}
|
|
94
|
+
min-width: 33.33%;
|
|
95
|
+
max-width: 33.33%;
|
|
103
96
|
}
|
|
104
97
|
|
|
105
98
|
@media (width <= 768px) {
|
|
@@ -12,14 +12,38 @@
|
|
|
12
12
|
display: flex;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
.rp-sidebar-menu__left
|
|
15
|
+
.rp-sidebar-menu__left {
|
|
16
16
|
background: none;
|
|
17
|
+
flex-shrink: 0;
|
|
17
18
|
align-items: center;
|
|
18
19
|
gap: 8px;
|
|
19
20
|
height: 100%;
|
|
20
21
|
display: flex;
|
|
21
22
|
}
|
|
22
23
|
|
|
24
|
+
.rp-sidebar-menu__right {
|
|
25
|
+
background: none;
|
|
26
|
+
align-items: center;
|
|
27
|
+
gap: 8px;
|
|
28
|
+
min-width: 0;
|
|
29
|
+
height: 100%;
|
|
30
|
+
display: flex;
|
|
31
|
+
overflow: hidden;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.rp-sidebar-menu__right__text {
|
|
35
|
+
line-clamp: 2;
|
|
36
|
+
-webkit-line-clamp: 2;
|
|
37
|
+
text-overflow: ellipsis;
|
|
38
|
+
-webkit-box-orient: vertical;
|
|
39
|
+
display: -webkit-box;
|
|
40
|
+
overflow: hidden;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.rp-sidebar-menu__right__icon, .rp-sidebar-menu__right .rp-progress-circle {
|
|
44
|
+
flex-shrink: 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
23
47
|
@media (width >= 1280px) {
|
|
24
48
|
.rp-sidebar-menu {
|
|
25
49
|
display: none;
|
|
@@ -69,9 +69,10 @@ const SidebarMenu = /*#__PURE__*/ forwardRef(({ isSidebarOpen, onIsSidebarOpenCh
|
|
|
69
69
|
className: "rp-sidebar-menu__right",
|
|
70
70
|
children: [
|
|
71
71
|
scrolledHeader?.text ? /*#__PURE__*/ jsx("span", {
|
|
72
|
-
className: "rp-doc",
|
|
72
|
+
className: "rp-sidebar-menu__right__text rp-doc",
|
|
73
73
|
...renderInlineMarkdown(scrolledHeader.text)
|
|
74
74
|
}) : /*#__PURE__*/ jsx("span", {
|
|
75
|
+
className: "rp-sidebar-menu__right__text",
|
|
75
76
|
children: t('outlineTitle')
|
|
76
77
|
}),
|
|
77
78
|
/*#__PURE__*/ jsx(ReadPercent, {
|
|
@@ -80,6 +81,7 @@ const SidebarMenu = /*#__PURE__*/ forwardRef(({ isSidebarOpen, onIsSidebarOpenCh
|
|
|
80
81
|
}),
|
|
81
82
|
0 !== headers.length && /*#__PURE__*/ jsx(SvgWrapper, {
|
|
82
83
|
icon: IconArrowRight,
|
|
84
|
+
className: "rp-sidebar-menu__right__icon",
|
|
83
85
|
style: {
|
|
84
86
|
transform: isOutlineOpen ? 'rotate(90deg)' : 'rotate(0deg)',
|
|
85
87
|
transition: 'transform 0.2s ease-out'
|
|
@@ -69,6 +69,10 @@ const Tag_Tag = ({ tag })=>{
|
|
|
69
69
|
})
|
|
70
70
|
]
|
|
71
71
|
});
|
|
72
|
+
if ('new' === normalizedTag) return /*#__PURE__*/ jsx(Badge, {
|
|
73
|
+
text: "new",
|
|
74
|
+
type: "tip"
|
|
75
|
+
});
|
|
72
76
|
if (BADGE_TAGS[normalizedTag]) return /*#__PURE__*/ jsx(Badge, {
|
|
73
77
|
text: normalizedTag,
|
|
74
78
|
type: BADGE_TAGS[normalizedTag]
|
|
@@ -32,10 +32,16 @@ const HeadTags = /*#__PURE__*/ memo((props)=>{
|
|
|
32
32
|
property: 'og:title',
|
|
33
33
|
content: title
|
|
34
34
|
} : void 0,
|
|
35
|
-
description ?
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
...description ? [
|
|
36
|
+
{
|
|
37
|
+
name: "description",
|
|
38
|
+
content: description
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
property: "og:description",
|
|
42
|
+
content: description
|
|
43
|
+
}
|
|
44
|
+
] : []
|
|
39
45
|
]
|
|
40
46
|
});
|
|
41
47
|
return /*#__PURE__*/ jsx(Head, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspress/core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "The Rspress Documentation Framework",
|
|
5
5
|
"bugs": "https://github.com/web-infra-dev/rspress/issues",
|
|
6
6
|
"repository": {
|
|
@@ -63,11 +63,11 @@
|
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@mdx-js/mdx": "^3.1.1",
|
|
65
65
|
"@mdx-js/react": "^3.1.1",
|
|
66
|
-
"@rsbuild/core": "2.0.0-beta.
|
|
66
|
+
"@rsbuild/core": "2.0.0-beta.3",
|
|
67
67
|
"@rsbuild/plugin-react": "~1.4.5",
|
|
68
68
|
"@shikijs/rehype": "^3.21.0",
|
|
69
69
|
"@types/unist": "^3.0.3",
|
|
70
|
-
"@unhead/react": "^2.1.
|
|
70
|
+
"@unhead/react": "^2.1.4",
|
|
71
71
|
"body-scroll-lock": "4.0.0-beta.0",
|
|
72
72
|
"cac": "^6.7.14",
|
|
73
73
|
"chokidar": "^3.6.0",
|
|
@@ -102,23 +102,23 @@
|
|
|
102
102
|
"unist-util-remove": "^4.0.0",
|
|
103
103
|
"unist-util-visit": "^5.0.0",
|
|
104
104
|
"unist-util-visit-children": "^3.0.0",
|
|
105
|
-
"@rspress/shared": "2.0.
|
|
105
|
+
"@rspress/shared": "2.0.3"
|
|
106
106
|
},
|
|
107
107
|
"devDependencies": {
|
|
108
|
-
"@microsoft/api-extractor": "^7.56.
|
|
108
|
+
"@microsoft/api-extractor": "^7.56.3",
|
|
109
109
|
"@rsbuild/plugin-sass": "~1.5.0",
|
|
110
110
|
"@rsbuild/plugin-svgr": "^1.3.0",
|
|
111
|
-
"@rslib/core": "0.19.
|
|
111
|
+
"@rslib/core": "0.19.5",
|
|
112
112
|
"@types/body-scroll-lock": "^3.1.2",
|
|
113
113
|
"@types/hast": "^3.0.4",
|
|
114
114
|
"@types/lodash-es": "^4.17.12",
|
|
115
115
|
"@types/mdast": "^4.0.4",
|
|
116
116
|
"@types/node": "^22.8.1",
|
|
117
117
|
"@types/nprogress": "^0.2.3",
|
|
118
|
-
"@types/react": "^19.2.
|
|
118
|
+
"@types/react": "^19.2.13",
|
|
119
119
|
"@types/react-dom": "^19.2.3",
|
|
120
120
|
"@types/react-reconciler": "^0.32.3",
|
|
121
|
-
"@types/web": "^0.0.
|
|
121
|
+
"@types/web": "^0.0.330",
|
|
122
122
|
"execa": "8.0.1",
|
|
123
123
|
"mdast-util-directive": "^3.1.0",
|
|
124
124
|
"mdast-util-mdx-expression": "^2.0.1",
|
|
File without changes
|