@rspress/core 2.0.0-rc.4 → 2.0.0-rc.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.
Files changed (120) hide show
  1. package/dist/{0~7675.723d12b2.js → 0~7675.4468968d.js} +3 -3
  2. package/dist/{9643.2dff683e.js → 1820.985588a0.js} +1 -0
  3. package/dist/{5485.9fc7f63d.js → 5485.b9ce9bdf.js} +1 -1
  4. package/dist/_private/react/render.js +1 -1
  5. package/dist/cli/config/loadConfigFile.js +1 -1
  6. package/dist/cli/index.js +1 -1
  7. package/dist/eject-theme/components/CodeBlock/index.tsx +1 -1
  8. package/dist/eject-theme/components/FallbackHeading/index.tsx +4 -0
  9. package/dist/eject-theme/components/HomeBackground/useNavTransparent.tsx +2 -1
  10. package/dist/eject-theme/components/HomeHero/index.scss +8 -0
  11. package/dist/eject-theme/components/HomeHero/index.tsx +11 -2
  12. package/dist/eject-theme/components/Overview/index.tsx +8 -62
  13. package/dist/eject-theme/components/OverviewGroup/index.tsx +46 -0
  14. package/dist/eject-theme/components/Steps/index.scss +1 -0
  15. package/dist/index.js +2 -3
  16. package/dist/node/PluginDriver.js +1 -1
  17. package/dist/node/auto-nav-sidebar/index.js +1 -1
  18. package/dist/node/auto-nav-sidebar/normalize.js +1 -1
  19. package/dist/node/auto-nav-sidebar/utils.js +1 -1
  20. package/dist/node/auto-nav-sidebar/walk.js +1 -1
  21. package/dist/node/constants.js +1 -1
  22. package/dist/node/initRsbuild.js +4 -5
  23. package/dist/node/last-updated/index.js +1 -1
  24. package/dist/node/mdx/options.js +1 -1
  25. package/dist/node/mdx/processor.js +1 -1
  26. package/dist/node/mdx/rehypePlugins/headerAnchor.js +1 -1
  27. package/dist/node/mdx/remarkPlugins/fileCodeBlock.js +1 -1
  28. package/dist/node/mdx/remarkPlugins/image.js +1 -2
  29. package/dist/node/mdx/remarkPlugins/link.js +1 -1
  30. package/dist/node/mdx/remarkPlugins/toc.js +1 -1
  31. package/dist/node/route/RouteService.js +2 -2
  32. package/dist/node/route/extractPageData.js +2 -3
  33. package/dist/node/route/normalizeRoutePath.js +2 -2
  34. package/dist/node/runtimeModule/i18n.js +1 -1
  35. package/dist/node/runtimeModule/pageData/createPageData.js +2 -2
  36. package/dist/node/runtimeModule/pageData/rsbuildPlugin.js +1 -1
  37. package/dist/node/runtimeModule/siteData/createSiteData.js +1 -1
  38. package/dist/node/runtimeModule/siteData/normalizeThemeConfig.js +1 -1
  39. package/dist/node/serve.js +1 -1
  40. package/dist/node/ssg/renderPage.js +1 -1
  41. package/dist/node/ssg/renderPageWorker.js +1 -1
  42. package/dist/node/ssg/renderPages.js +2 -2
  43. package/dist/node/ssg/rsbuildPluginSSG.js +1 -1
  44. package/dist/node/ssg/ssgEnv.js +1 -1
  45. package/dist/node/ssg-md/llms/emitLlmsTxt.js +2 -2
  46. package/dist/node/ssg-md/llms/llmsTxt.js +1 -1
  47. package/dist/node/ssg-md/renderPage.js +1 -1
  48. package/dist/node/ssg-md/renderPages.js +1 -1
  49. package/dist/node/ssg-md/rsbuildPluginSSGMD.js +1 -1
  50. package/dist/node/utils/createHash.js +1 -1
  51. package/dist/node/utils/flattenMdxContent.js +2 -3
  52. package/dist/node/utils/getPageKey.js +1 -1
  53. package/dist/node/utils/normalizePath.js +1 -1
  54. package/dist/node/utils/reactAlias.js +1 -1
  55. package/dist/runtime/Content.d.ts +4 -0
  56. package/dist/runtime/Content.js +18 -0
  57. package/dist/runtime/NoSSR.d.ts +3 -0
  58. package/dist/runtime/NoSSR.js +14 -0
  59. package/dist/runtime/getSidebarDataGroup.test.js +68 -0
  60. package/dist/runtime/hooks/useActiveMatcher.d.ts +1 -0
  61. package/dist/runtime/hooks/useActiveMatcher.js +14 -0
  62. package/dist/runtime/hooks/useDark.d.ts +7 -0
  63. package/dist/runtime/hooks/useDark.js +7 -0
  64. package/dist/runtime/hooks/useFrontmatter.d.ts +4 -0
  65. package/dist/runtime/hooks/useFrontmatter.js +9 -0
  66. package/dist/runtime/hooks/useI18n.d.ts +2 -0
  67. package/dist/runtime/hooks/useI18n.js +14 -0
  68. package/dist/runtime/hooks/useLang.d.ts +1 -0
  69. package/dist/runtime/hooks/useLang.js +6 -0
  70. package/dist/runtime/hooks/useLocaleSiteData.d.ts +18 -0
  71. package/dist/runtime/hooks/useLocaleSiteData.js +20 -0
  72. package/dist/runtime/hooks/useNav.d.ts +1 -0
  73. package/dist/runtime/hooks/useNav.js +12 -0
  74. package/dist/runtime/hooks/usePage.d.ts +10 -0
  75. package/dist/runtime/hooks/usePage.js +9 -0
  76. package/dist/runtime/hooks/usePageData.d.ts +5 -0
  77. package/dist/runtime/hooks/usePageData.js +16 -0
  78. package/dist/runtime/hooks/usePages.d.ts +4 -0
  79. package/dist/runtime/hooks/usePages.js +7 -0
  80. package/dist/runtime/hooks/useSidebar.d.ts +16 -0
  81. package/dist/runtime/hooks/useSidebar.js +67 -0
  82. package/dist/runtime/hooks/useSite.d.ts +4 -0
  83. package/dist/runtime/hooks/useSite.js +7 -0
  84. package/dist/runtime/hooks/useVersion.d.ts +1 -0
  85. package/dist/runtime/hooks/useVersion.js +6 -0
  86. package/dist/runtime/hooks/useWindowSize.d.ts +9 -0
  87. package/dist/runtime/hooks/useWindowSize.js +31 -0
  88. package/dist/runtime/hooks/useWindowSize.test.js +36 -0
  89. package/dist/runtime/index.d.ts +21 -0
  90. package/dist/runtime/index.js +22 -0
  91. package/dist/runtime/route.d.ts +36 -0
  92. package/dist/runtime/route.js +53 -0
  93. package/dist/runtime/route.test.js +154 -0
  94. package/dist/runtime/ssrMdServerEntry.js +1 -1
  95. package/dist/runtime/utils.d.ts +12 -0
  96. package/dist/runtime/utils.js +34 -0
  97. package/dist/runtime/utils.test.js +34 -0
  98. package/dist/theme/components/CodeBlock/index.js +1 -1
  99. package/dist/theme/components/FallbackHeading/index.js +4 -1
  100. package/dist/theme/components/HomeBackground/useNavTransparent.js +1 -1
  101. package/dist/theme/components/HomeHero/index.css +6 -0
  102. package/dist/theme/components/HomeHero/index.js +10 -3
  103. package/dist/theme/components/Overview/index.js +11 -43
  104. package/dist/theme/components/OverviewGroup/index.js +33 -0
  105. package/dist/theme/components/Steps/index.css +1 -0
  106. package/dist/theme/index.d.ts +1 -1
  107. package/dist/theme/index.js +1 -1
  108. package/dist/theme/logic/useScrollAfterNav.js +2 -2
  109. package/dist/theme/logic/useScrollReset.js +2 -2
  110. package/dist/theme/logic/{useAppearance.d.ts → useThemeState.d.ts} +4 -1
  111. package/dist/theme/logic/useThemeState.js +50 -0
  112. package/dist/theme/styles/scrollbar.css +14 -2
  113. package/package.json +9 -10
  114. package/static/MediumZoom.tsx +1 -1
  115. package/dist/4669.69cb6b18.js +0 -1
  116. package/dist/runtime.72d450ac.js +0 -1
  117. package/dist/runtime.d.ts +0 -2
  118. package/dist/runtime.js +0 -3
  119. package/dist/theme/logic/useAppearance.js +0 -64
  120. /package/dist/{3521.9eb6b114.js → 5341.9eb6b114.js} +0 -0
@@ -7,10 +7,10 @@ import { Buffer } from "node:buffer";
7
7
  import node_child_process, { ChildProcess } from "node:child_process";
8
8
  import { setTimeout as promises_setTimeout } from "node:timers/promises";
9
9
  import { debuglog } from "node:util";
10
- import { node_process, node_os, constants } from "./9643.2dff683e.js";
10
+ import { node_process, node_os, constants } from "./1820.985588a0.js";
11
11
  import { node_path } from "./6289.29817fb4.js";
12
- import { node_url } from "./5485.9fc7f63d.js";
13
- import { createWriteStream, createReadStream, readFileSync } from "./3521.9eb6b114.js";
12
+ import { node_url } from "./5485.b9ce9bdf.js";
13
+ import { createWriteStream, createReadStream, readFileSync } from "./5341.9eb6b114.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,3 +1,4 @@
1
+ export { MDX_OR_MD_REGEXP, RSPRESS_TEMP_DIR, SEARCH_INDEX_NAME, addLeadingSlash, addTrailingSlash, getSidebarDataGroup, isDebugMode, isExternalUrl, isProduction, normalizeHref, normalizePosixPath, parseUrl, removeLeadingSlash, removeTrailingSlash, slash, withBase } from "@rspress/shared";
1
2
  export { extractTextAndId, getIconUrlPath, getNodeAttribute, loadFrontMatter, mergeDocConfig } from "@rspress/shared/node-utils";
2
3
  export { constants, default as node_os } from "node:os";
3
4
  export { cwd, default as node_process } from "node:process";
@@ -1,5 +1,5 @@
1
1
  var package_namespaceObject = {
2
- rE: "2.0.0-rc.4"
2
+ rE: "2.0.0-rc.5"
3
3
  };
4
4
  async function pMap(iterable, mapper, { concurrency = 1 / 0, stopOnError = true, signal } = {}) {
5
5
  return new Promise((resolve_, reject_)=>{
@@ -100,7 +100,7 @@ async function renderToMarkdownString(element) {
100
100
  const root = reconciler.createContainer(container, 1, null, false, false, '', (error, info)=>{
101
101
  if (process.env.DEBUG) {
102
102
  console.error('Reconciler Error:', error, info);
103
- const message = 'Reconciler Error:' + error.message;
103
+ const message = `Reconciler Error:${error.message}`;
104
104
  throw new Error(message);
105
105
  }
106
106
  }, ()=>{}, (...args)=>{
@@ -1,4 +1,4 @@
1
- import { node_fs, DEFAULT_CONFIG_EXTENSIONS, DEFAULT_CONFIG_NAME } from "../../3521.9eb6b114.js";
1
+ import { node_fs, DEFAULT_CONFIG_EXTENSIONS, DEFAULT_CONFIG_NAME } from "../../5341.9eb6b114.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) {
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.9fc7f63d.js";
3
+ import { package_namespaceObject } from "../5485.b9ce9bdf.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";
@@ -92,7 +92,7 @@ export function CodeBlock({
92
92
  )}
93
93
  >
94
94
  <div
95
- className="rp-codeblock__content__scroll-container rp-scrollbar"
95
+ className="rp-codeblock__content__scroll-container rp-scrollbar rp-scrollbar--always"
96
96
  ref={copyElementRef}
97
97
  >
98
98
  {children}
@@ -28,6 +28,10 @@ export function FallbackHeading({
28
28
  level: 1 | 2 | 3 | 4 | 5 | 6;
29
29
  title: string;
30
30
  }) {
31
+ if (process.env.__SSR_MD__) {
32
+ return <>{`${'#'.repeat(level)} ${title}\n\n`}</>;
33
+ }
34
+
31
35
  const titleSlug = title && slug(title.trim());
32
36
 
33
37
  const Element = useMemo(() => {
@@ -36,7 +36,8 @@ export const useNavTransparent = () => {
36
36
 
37
37
  return (
38
38
  <style>
39
- {'body:not(.notTopArrived) .rp-nav {background: transparent !important; border-bottom: none !important;}' +
39
+ {'body:not(.notTopArrived) ' +
40
+ '.rp-nav {background: transparent !important; border-bottom: 1px solid transparent !important;}' +
40
41
  // TODO: discussion
41
42
  '.rp-nav {background: color-mix(in srgb,var(--rp-c-bg) 60%,transparent);backdrop-filter: blur(25px);}'}
42
43
  </style>
@@ -78,11 +78,19 @@
78
78
  font-size: 0.875rem;
79
79
  font-weight: 500;
80
80
  color: var(--rp-c-text-0);
81
+ text-decoration: none;
82
+ transition:
83
+ background 0.2s,
84
+ border-color 0.2s;
81
85
 
82
86
  &:hover {
83
87
  background: var(--rp-c-bg-mute);
84
88
  cursor: pointer;
85
89
  }
90
+
91
+ &:is(a):hover {
92
+ border-color: var(--rp-c-brand);
93
+ }
86
94
  }
87
95
 
88
96
  &__title {
@@ -1,6 +1,6 @@
1
1
  import type { FrontMatterMeta } from '@rspress/core';
2
2
  import { normalizeImagePath, useFrontmatter } from '@rspress/core/runtime';
3
- import { Button, renderHtmlOrText } from '@theme';
3
+ import { Button, Link, renderHtmlOrText } from '@theme';
4
4
 
5
5
  import './index.scss';
6
6
  import clsx from 'clsx';
@@ -39,7 +39,16 @@ function HomeHero({ beforeHeroActions, afterHeroActions }: HomeHeroProps) {
39
39
  className={clsx('rp-home-hero', { 'rp-home-hero--no-image': !hasImage })}
40
40
  >
41
41
  <div className="rp-home-hero__container">
42
- {hero.badge && <div className="rp-home-hero__badge">{hero.badge}</div>}
42
+ {hero.badge &&
43
+ (typeof hero.badge === 'string' ? (
44
+ <div className="rp-home-hero__badge">{hero.badge}</div>
45
+ ) : hero.badge.link ? (
46
+ <Link href={hero.badge.link} className="rp-home-hero__badge">
47
+ {hero.badge.text}
48
+ </Link>
49
+ ) : (
50
+ <div className="rp-home-hero__badge">{hero.badge.text}</div>
51
+ ))}
43
52
  <div className="rp-home-hero__content">
44
53
  <div className="rp-home-hero__title">
45
54
  <span
@@ -6,11 +6,9 @@ import type {
6
6
  } from '@rspress/core';
7
7
  import {
8
8
  isEqualPath,
9
- normalizeHref,
10
9
  useI18n,
11
10
  usePageData,
12
11
  useSidebar,
13
- withBase,
14
12
  } from '@rspress/core/runtime';
15
13
  import {
16
14
  FallbackHeading,
@@ -27,65 +25,6 @@ import {
27
25
  import './index.scss';
28
26
  import { findItemByRoutePath } from './utils';
29
27
 
30
- function routePathToMdPath(routePath: string): string {
31
- let url: string = routePath;
32
- url = normalizeHref(url, false);
33
- url = url.replace(/\.html$/, '.md');
34
- return withBase(url);
35
- }
36
-
37
- function OverviewMarkdown({
38
- title,
39
- groups,
40
- }: {
41
- title: string;
42
- groups: Group[];
43
- }) {
44
- const lines: string[] = [];
45
-
46
- lines.push(`# ${title}`);
47
- lines.push('');
48
-
49
- for (const group of groups) {
50
- if (group.name) {
51
- lines.push(`## ${group.name}`);
52
- lines.push('');
53
- }
54
-
55
- for (const item of group.items) {
56
- const itemTitle = item.link
57
- ? `[${item.text}](${routePathToMdPath(item.link)})`
58
- : `**${item.text}**`;
59
- lines.push(`### ${itemTitle}`);
60
- lines.push('');
61
-
62
- // Render headers as a list
63
- if (item.headers && item.headers.length > 0) {
64
- for (const header of item.headers) {
65
- const headerLink = item.link
66
- ? `[${header.text}](${routePathToMdPath(item.link)}#${header.id})`
67
- : header.text;
68
- lines.push(`- ${headerLink}`);
69
- }
70
- lines.push('');
71
- }
72
-
73
- // Render custom items as a list
74
- if (item.items && item.items.length > 0) {
75
- for (const subItem of item.items) {
76
- const subItemLink = subItem.link
77
- ? `[${subItem.text}](${routePathToMdPath(subItem.link)})`
78
- : subItem.text;
79
- lines.push(`- ${subItemLink}`);
80
- }
81
- lines.push('');
82
- }
83
- }
84
- }
85
-
86
- return <>{lines.join('\n')}</>;
87
- }
88
-
89
28
  // Utility function to normalize text for search
90
29
  const normalizeText = (s: string) => s.toLowerCase().replace(/-/g, ' ');
91
30
 
@@ -302,7 +241,14 @@ export function Overview(props: {
302
241
  const overviewTitle = title || 'Overview';
303
242
 
304
243
  if (process.env.__SSR_MD__) {
305
- return <OverviewMarkdown title={overviewTitle} groups={groups} />;
244
+ return (
245
+ <>
246
+ <FallbackHeading level={1} title={overviewTitle} />
247
+ {groups.map(group => (
248
+ <OverviewGroup key={group?.name} group={group} />
249
+ ))}
250
+ </>
251
+ );
306
252
  }
307
253
 
308
254
  return (
@@ -1,10 +1,52 @@
1
1
  import { Link, renderInlineMarkdown } from '@theme';
2
2
  import './index.scss';
3
3
  import type { Header } from '@rspress/core';
4
+ import { routePathToMdPath } from '@rspress/core/runtime';
4
5
  import { FallbackHeading, SvgWrapper } from '@theme';
5
6
  import { useMemo } from 'react';
6
7
  import IconPlugin from './icons/plugin.svg';
7
8
 
9
+ function OverviewGroupMarkdown({ group }: { group: Group }) {
10
+ const lines: string[] = [];
11
+
12
+ if (group.name) {
13
+ lines.push(`## ${group.name}`);
14
+ lines.push('');
15
+ }
16
+
17
+ for (const item of group.items) {
18
+ const itemTitle = item.link
19
+ ? `[${item.text}](${routePathToMdPath(item.link)})`
20
+ : `**${item.text}**`;
21
+ lines.push(`### ${itemTitle}`);
22
+ lines.push('');
23
+
24
+ // Render headers as a list
25
+ if (item.headers && item.headers.length > 0) {
26
+ for (const header of item.headers) {
27
+ const headerLink = item.link
28
+ ? `[${header.text}](${routePathToMdPath(item.link)}#${header.id})`
29
+ : header.text;
30
+ lines.push(`- ${headerLink}`);
31
+ }
32
+ lines.push('');
33
+ }
34
+
35
+ // Render custom items as a list
36
+ if (item.items && item.items.length > 0) {
37
+ for (const subItem of item.items) {
38
+ const subItemLink = subItem.link
39
+ ? `[${subItem.text}](${routePathToMdPath(subItem.link)})`
40
+ : subItem.text;
41
+ lines.push(`- ${subItemLink}`);
42
+ }
43
+ lines.push('');
44
+ }
45
+ }
46
+
47
+ return <>{lines.join('\n')}</>;
48
+ }
49
+
8
50
  export interface GroupItem {
9
51
  text: string;
10
52
  link: string;
@@ -20,6 +62,10 @@ export interface Group {
20
62
  }
21
63
 
22
64
  export const OverviewGroup = ({ group }: { group: Group }) => {
65
+ if (process.env.__SSR_MD__) {
66
+ return <OverviewGroupMarkdown group={group} />;
67
+ }
68
+
23
69
  const { itemsWithContent, itemsWithoutContent } = useMemo(() => {
24
70
  // Separate items into those with content and those without
25
71
  const itemsWithContent = group.items.filter(
@@ -21,6 +21,7 @@
21
21
  justify-content: center;
22
22
  font-size: 1.1rem;
23
23
  font-weight: 400;
24
+ line-height: 30px;
24
25
  color: var(--rp-c-text-1);
25
26
  background-color: var(--rp-code-block-bg);
26
27
  border: 1.5px solid var(--rp-c-text-3);
package/dist/index.js CHANGED
@@ -1,12 +1,11 @@
1
1
  export { PluginDriver } from "./node/PluginDriver.js";
2
- export { RSPRESS_TEMP_DIR, getSidebarDataGroup, normalizeHref, normalizePosixPath, removeTrailingSlash, withBase } from "./4669.69cb6b18.js";
2
+ export { RSPRESS_TEMP_DIR, getIconUrlPath, getNodeAttribute, getSidebarDataGroup, mergeDocConfig, normalizeHref, normalizePosixPath, removeTrailingSlash, withBase } from "./1820.985588a0.js";
3
3
  export { RouteService } from "./node/route/RouteService.js";
4
4
  export { build } from "./node/build.js";
5
5
  export { defineConfig } from "./cli/config/index.js";
6
6
  export { dev } from "./node/dev.js";
7
- export { getIconUrlPath, getNodeAttribute, mergeDocConfig } from "./9643.2dff683e.js";
8
7
  export { logger } from "./6289.29817fb4.js";
9
- export { matchPath } from "./3521.9eb6b114.js";
8
+ export { matchPath } from "./5341.9eb6b114.js";
10
9
  export { remarkFileCodeBlock } from "./node/mdx/remarkPlugins/fileCodeBlock.js";
11
10
  export { remarkLink } from "./node/mdx/remarkPlugins/link.js";
12
11
  export { serve } from "./node/serve.js";
@@ -1,5 +1,5 @@
1
1
  import { node_path } from "../6289.29817fb4.js";
2
- import { addTrailingSlash, addLeadingSlash } from "../4669.69cb6b18.js";
2
+ import { addTrailingSlash, addLeadingSlash } from "../1820.985588a0.js";
3
3
  import { createError } from "./utils/error.js";
4
4
  import { auto_nav_sidebar_haveNavSidebarConfig } from "./auto-nav-sidebar/index.js";
5
5
  class PluginDriver {
@@ -1,5 +1,5 @@
1
1
  import { node_path } from "../../6289.29817fb4.js";
2
- import { DEFAULT_PAGE_EXTENSIONS } from "../../3521.9eb6b114.js";
2
+ import { DEFAULT_PAGE_EXTENSIONS } from "../../5341.9eb6b114.js";
3
3
  import { processLocales, combineWalkResult } from "./locales.js";
4
4
  import { walk } from "./walk.js";
5
5
  async function runAutoNavSide(config, metaFileSet, mdFileSet) {
@@ -1,5 +1,5 @@
1
1
  import { readdir, extname, stat as promises_stat, relative, logger, join, picocolors } from "../../6289.29817fb4.js";
2
- import { isExternalUrl, slash } from "../../4669.69cb6b18.js";
2
+ import { isExternalUrl, slash } from "../../1820.985588a0.js";
3
3
  import { createError } from "../utils/error.js";
4
4
  import { PUBLIC_DIR } from "../constants.js";
5
5
  import { pathExists, extractInfoFromFrontmatterWithAbsolutePath, readJson } from "./utils.js";
@@ -1,5 +1,5 @@
1
1
  import { node_path, promises } from "../../6289.29817fb4.js";
2
- import { loadFrontMatter, extractTextAndId } from "../../9643.2dff683e.js";
2
+ import { loadFrontMatter, extractTextAndId } from "../../1820.985588a0.js";
3
3
  async function pathExists(path) {
4
4
  try {
5
5
  await promises.access(path);
@@ -1,5 +1,5 @@
1
1
  import { node_path, promises } from "../../6289.29817fb4.js";
2
- import { isExternalUrl } from "../../4669.69cb6b18.js";
2
+ import { isExternalUrl } from "../../1820.985588a0.js";
3
3
  import { pathExists } from "../utils/fs.js";
4
4
  import { readJson } from "./utils.js";
5
5
  import { createError } from "../utils/error.js";
@@ -1,4 +1,4 @@
1
- import { createRequire, package_namespaceObject } from "../5485.9fc7f63d.js";
1
+ import { createRequire, package_namespaceObject } from "../5485.b9ce9bdf.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;
@@ -1,8 +1,7 @@
1
- import { createRequire, fileURLToPath, package_namespaceObject } from "../5485.9fc7f63d.js";
1
+ import { createRequire, fileURLToPath, package_namespaceObject } from "../5485.b9ce9bdf.js";
2
2
  import { node_path } from "../6289.29817fb4.js";
3
- import { cwd } from "../9643.2dff683e.js";
4
- import { PLUGIN_REACT_NAME, pluginReact, pluginVirtualModule } from "../3521.9eb6b114.js";
5
- import { removeTrailingSlash, MDX_OR_MD_REGEXP } from "../4669.69cb6b18.js";
3
+ import { removeTrailingSlash, MDX_OR_MD_REGEXP, cwd } from "../1820.985588a0.js";
4
+ import { PLUGIN_REACT_NAME, pluginReact, pluginVirtualModule } from "../5341.9eb6b114.js";
6
5
  import { createError } from "./utils/error.js";
7
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";
8
7
  import { hintBuilderPluginsBreakingChange, hintThemeBreakingChange } from "./logger/hint.js";
@@ -138,7 +137,7 @@ async function createInternalBuildConfig(userDocRoot, config, enableSSG, routeSe
138
137
  ],
139
138
  '@theme-original': DEFAULT_THEME,
140
139
  '@rspress/core/theme-original': DEFAULT_THEME,
141
- '@rspress/core/runtime': node_path.join(PACKAGE_ROOT, 'dist/runtime.js'),
140
+ '@rspress/core/runtime': node_path.join(PACKAGE_ROOT, 'dist/runtime/index.js'),
142
141
  '@rspress/core/shiki-transformers': node_path.join(PACKAGE_ROOT, 'dist/shiki-transformers.js')
143
142
  }
144
143
  },
@@ -1,4 +1,4 @@
1
- import { execa } from "../../0~7675.723d12b2.js";
1
+ import { execa } from "../../0~7675.4468968d.js";
2
2
  function transform(timestamp, lang) {
3
3
  return new Date(timestamp).toLocaleString(lang || 'zh');
4
4
  }
@@ -1,5 +1,5 @@
1
1
  import { node_path } from "../../6289.29817fb4.js";
2
- import { nodeTypes } from "../../9643.2dff683e.js";
2
+ import { nodeTypes } from "../../1820.985588a0.js";
3
3
  import { rehype_external_links, rehype_raw, remark_gfm, rehype } from "./loader.7c249a26.js";
4
4
  import { remarkToc } from "./remarkPlugins/toc.js";
5
5
  import { remarkContainerSyntax } from "./remarkPlugins/containerSyntax.js";
@@ -1,5 +1,5 @@
1
1
  import { node_path } from "../../6289.29817fb4.js";
2
- import { createProcessor, loadFrontMatter, extractTextAndId } from "../../9643.2dff683e.js";
2
+ import { createProcessor, loadFrontMatter, extractTextAndId } from "../../1820.985588a0.js";
3
3
  import { createMDXOptions } from "./options.js";
4
4
  import { applyReplaceRules } from "../utils/applyReplaceRules.js";
5
5
  import { escapeMarkdownHeadingIds } from "../utils/escapeHeadingIds.js";
@@ -1,4 +1,4 @@
1
- import { extractTextAndId } from "../../../9643.2dff683e.js";
1
+ import { extractTextAndId } from "../../../1820.985588a0.js";
2
2
  import { github_slugger, headingRank } from "../loader.7c249a26.js";
3
3
  import { visit } from "../../../8813.4b28f4bb.js";
4
4
  const rehypeHeaderAnchor = ()=>{
@@ -1,5 +1,5 @@
1
1
  import { node_path, logger, picocolors, readFile } from "../../../6289.29817fb4.js";
2
- import { cwd } from "../../../9643.2dff683e.js";
2
+ import { cwd } from "../../../1820.985588a0.js";
3
3
  import { visit } from "../../../8813.4b28f4bb.js";
4
4
  import { createError } from "../../utils/error.js";
5
5
  const ERROR_PREFIX = '[remarkFileCodeBlock]';
@@ -1,5 +1,4 @@
1
- import { isExternalUrl } from "../../../4669.69cb6b18.js";
2
- import { getNodeAttribute } from "../../../9643.2dff683e.js";
1
+ import { isExternalUrl, getNodeAttribute } from "../../../1820.985588a0.js";
3
2
  import { visit } from "../../../8813.4b28f4bb.js";
4
3
  import { getDefaultImportAstNode } from "../../utils/getImportAstNode.js";
5
4
  const normalizeImageUrl = (imageUrl)=>{
@@ -1,5 +1,5 @@
1
1
  import { node_path, logger, picocolors } from "../../../6289.29817fb4.js";
2
- import { isExternalUrl, isProduction, addLeadingSlash, parseUrl, normalizeHref, withBase } from "../../../4669.69cb6b18.js";
2
+ import { isExternalUrl, isProduction, addLeadingSlash, parseUrl, normalizeHref, withBase } from "../../../1820.985588a0.js";
3
3
  import { visit } from "../../../8813.4b28f4bb.js";
4
4
  import { hintRelativeMarkdownLink } from "../../logger/hint.js";
5
5
  import { createError } from "../../utils/error.js";
@@ -1,4 +1,4 @@
1
- import { extractTextAndId } from "../../../9643.2dff683e.js";
1
+ import { extractTextAndId } from "../../../1820.985588a0.js";
2
2
  import { github_slugger, visitChildren } from "../loader.7c249a26.js";
3
3
  const parseToc = (tree)=>{
4
4
  let title = '';
@@ -1,6 +1,6 @@
1
1
  import { node_path, promises } from "../../6289.29817fb4.js";
2
- import { RSPRESS_TEMP_DIR, removeTrailingSlash, addTrailingSlash } from "../../4669.69cb6b18.js";
3
- import { DEFAULT_PAGE_EXTENSIONS, glob } from "../../3521.9eb6b114.js";
2
+ import { RSPRESS_TEMP_DIR, removeTrailingSlash, addTrailingSlash } from "../../1820.985588a0.js";
3
+ import { DEFAULT_PAGE_EXTENSIONS, glob } from "../../5341.9eb6b114.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,7 +1,6 @@
1
1
  import { node_path, promises } from "../../6289.29817fb4.js";
2
- import { htmlToText, compile } from "../../3521.9eb6b114.js";
3
- import { MDX_OR_MD_REGEXP } from "../../4669.69cb6b18.js";
4
- import { loadFrontMatter } from "../../9643.2dff683e.js";
2
+ import { htmlToText, compile } from "../../5341.9eb6b114.js";
3
+ import { MDX_OR_MD_REGEXP, loadFrontMatter } from "../../1820.985588a0.js";
5
4
  import { applyReplaceRules } from "../utils/applyReplaceRules.js";
6
5
  import { flattenMdxContent } from "../utils/flattenMdxContent.js";
7
6
  import { importStatementRegex } from "../constants.js";
@@ -1,5 +1,5 @@
1
- import { addTrailingSlash, addLeadingSlash } from "../../4669.69cb6b18.js";
2
- import { DEFAULT_PAGE_EXTENSIONS } from "../../3521.9eb6b114.js";
1
+ import { addTrailingSlash, addLeadingSlash } from "../../1820.985588a0.js";
2
+ import { DEFAULT_PAGE_EXTENSIONS } from "../../5341.9eb6b114.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.9fc7f63d.js";
1
+ import { createRequire } from "../../5485.b9ce9bdf.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
- import { SEARCH_INDEX_NAME } from "../../../4669.69cb6b18.js";
2
- import { groupBy } from "../../../3521.9eb6b114.js";
1
+ import { SEARCH_INDEX_NAME } from "../../../1820.985588a0.js";
2
+ import { groupBy } from "../../../5341.9eb6b114.js";
3
3
  import { extractPageData } from "../../route/extractPageData.js";
4
4
  import { createHash } from "../../utils/createHash.js";
5
5
  function deletePrivateField(obj) {
@@ -1,4 +1,4 @@
1
- import { pluginVirtualModule } from "../../../3521.9eb6b114.js";
1
+ import { pluginVirtualModule } from "../../../5341.9eb6b114.js";
2
2
  import { createPageData } from "./createPageData.js";
3
3
  const rsbuildPluginDocVM = async ({ config, userDocRoot, routeService, pluginDriver })=>{
4
4
  const ref = {
@@ -1,4 +1,4 @@
1
- import { getIconUrlPath } from "../../../9643.2dff683e.js";
1
+ import { getIconUrlPath } from "../../../1820.985588a0.js";
2
2
  import { normalizeThemeConfig } from "./normalizeThemeConfig.js";
3
3
  async function createSiteData(userConfig) {
4
4
  const tempSearchObj = Object.assign({}, userConfig.search);
@@ -1,4 +1,4 @@
1
- import { isExternalUrl, slash, addLeadingSlash, normalizeHref } from "../../../4669.69cb6b18.js";
1
+ import { isExternalUrl, slash, addLeadingSlash, normalizeHref } from "../../../1820.985588a0.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 { mergeRsbuildConfig } from "../3521.9eb6b114.js";
1
+ import { mergeRsbuildConfig } from "../5341.9eb6b114.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.9fc7f63d.js";
1
+ import { transformHtmlTemplate, pathToFileURL, createHead } from "../../5485.b9ce9bdf.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.9fc7f63d.js";
3
+ import { pMap } from "../../5485.b9ce9bdf.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 "../../3521.9eb6b114.js";
3
+ import { chunk } from "../../5341.9eb6b114.js";
4
4
  import { SSGWorkerThreadTaskSize, getNumberOfThreads, SSGWorkerThreadRecyclerMaxMemory, SSGConcurrency } from "./ssgEnv.js";
5
- import { pMap } from "../../5485.9fc7f63d.js";
5
+ import { pMap } from "../../5485.b9ce9bdf.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 { logger, writeFile, mkdir, rm, join } from "../../6289.29817fb4.js";
2
- import { isDebugMode } from "../../4669.69cb6b18.js";
2
+ import { isDebugMode } from "../../1820.985588a0.js";
3
3
  import { NODE_SSG_BUNDLE_FOLDER, NODE_SSG_BUNDLE_NAME } from "../constants.js";
4
4
  import { renderPages } from "./renderPages.js";
5
5
  const rsbuildPluginSSG = ({ routeService, config })=>({
@@ -1,5 +1,5 @@
1
1
  /*! For license information please see ssgEnv.js.LICENSE.txt */
2
- import { node_os } from "../../9643.2dff683e.js";
2
+ import { node_os } from "../../1820.985588a0.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,5 +1,5 @@
1
- import { getSidebarDataGroup } from "../../../4669.69cb6b18.js";
2
- import { matchPath } from "../../../3521.9eb6b114.js";
1
+ import { getSidebarDataGroup } from "../../../1820.985588a0.js";
2
+ import { matchPath } from "../../../5341.9eb6b114.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,4 +1,4 @@
1
- import { normalizeHref, withBase } from "../../../4669.69cb6b18.js";
1
+ import { normalizeHref, withBase } from "../../../1820.985588a0.js";
2
2
  import { extractInfoFromFrontmatterWithAbsolutePath } from "../../auto-nav-sidebar/utils.js";
3
3
  function routePathToMdPath(routePath, base) {
4
4
  let url = routePath;
@@ -1,4 +1,4 @@
1
- import { pathToFileURL, createHead } from "../../5485.9fc7f63d.js";
1
+ import { pathToFileURL, createHead } from "../../5485.b9ce9bdf.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.9fc7f63d.js";
2
+ import { pMap } from "../../5485.b9ce9bdf.js";
3
3
  import { renderPage } from "./renderPage.js";
4
4
  import { SSGConcurrency } from "../ssg/ssgEnv.js";
5
5
  const routePage2MdFilename = (routePath)=>{
@@ -1,5 +1,5 @@
1
1
  import { writeFile, mkdir, rm, join } from "../../6289.29817fb4.js";
2
- import { isDebugMode } from "../../4669.69cb6b18.js";
2
+ import { isDebugMode } from "../../1820.985588a0.js";
3
3
  import { NODE_SSG_MD_BUNDLE_FOLDER, NODE_SSG_MD_BUNDLE_NAME } from "../constants.js";
4
4
  import { renderPages } from "./renderPages.js";
5
5
  import { emitLlmsTxt } from "./llms/emitLlmsTxt.js";
@@ -1,4 +1,4 @@
1
- import { createHash as external_node_crypto_createHash } from "../../3521.9eb6b114.js";
1
+ import { createHash as external_node_crypto_createHash } from "../../5341.9eb6b114.js";
2
2
  function createHash(str) {
3
3
  return external_node_crypto_createHash('sha256').update(str).digest('hex').slice(0, 8);
4
4
  }