@rspress/core 2.0.0-rc.3 → 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 (168) hide show
  1. package/dist/{0~7675.723d12b2.js → 0~7675.4468968d.js} +4 -4
  2. package/dist/1820.985588a0.js +5 -0
  3. package/dist/{3521.56e42d70.js → 5341.9eb6b114.js} +12 -12
  4. package/dist/{5485.077f14ff.js → 5485.b9ce9bdf.js} +5 -5
  5. package/dist/6289.29817fb4.js +4 -0
  6. package/dist/8813.4b28f4bb.js +1 -0
  7. package/dist/_private/react/render.js +1 -1
  8. package/dist/cli/config/loadConfigFile.js +2 -2
  9. package/dist/cli/index.44f3184c.js +2 -0
  10. package/dist/cli/index.js +3 -3
  11. package/dist/eject-theme/components/CodeBlock/index.tsx +1 -1
  12. package/dist/eject-theme/components/FallbackHeading/index.tsx +4 -0
  13. package/dist/eject-theme/components/HomeBackground/useNavTransparent.tsx +2 -1
  14. package/dist/eject-theme/components/HomeHero/index.scss +8 -0
  15. package/dist/eject-theme/components/HomeHero/index.tsx +11 -2
  16. package/dist/eject-theme/components/HoverGroup/index.scss +3 -2
  17. package/dist/eject-theme/components/HoverGroup/index.tsx +104 -22
  18. package/dist/eject-theme/components/Nav/NavMenu.scss +1 -1
  19. package/dist/eject-theme/components/Nav/NavMenu.tsx +50 -28
  20. package/dist/eject-theme/components/NavScreen/NavScreenMenuItem.tsx +26 -11
  21. package/dist/eject-theme/components/Overview/index.tsx +11 -0
  22. package/dist/eject-theme/components/OverviewGroup/index.tsx +46 -0
  23. package/dist/eject-theme/components/Steps/index.scss +1 -0
  24. package/dist/index.js +6 -11
  25. package/dist/node/PluginDriver.js +3 -3
  26. package/dist/node/auto-nav-sidebar/index.js +3 -3
  27. package/dist/node/auto-nav-sidebar/locales.js +1 -1
  28. package/dist/node/auto-nav-sidebar/normalize.js +2 -2
  29. package/dist/node/auto-nav-sidebar/utils.js +2 -2
  30. package/dist/node/auto-nav-sidebar/walk.js +13 -9
  31. package/dist/node/constants.js +2 -2
  32. package/dist/node/eject.js +2 -5
  33. package/dist/node/initRsbuild.js +14 -9
  34. package/dist/node/last-updated/index.js +1 -1
  35. package/dist/node/logger/hint.js +1 -1
  36. package/dist/node/mdx/loader.7c249a26.js +12 -0
  37. package/dist/node/mdx/options.js +3 -3
  38. package/dist/node/mdx/processor.js +2 -2
  39. package/dist/node/mdx/rehypePlugins/codeMeta.js +1 -1
  40. package/dist/node/mdx/rehypePlugins/headerAnchor.js +4 -4
  41. package/dist/node/mdx/rehypePlugins/shiki.js +1 -1
  42. package/dist/node/mdx/rehypePlugins/transformers/index.js +5 -5
  43. package/dist/node/mdx/remarkPlugins/builtin.js +1 -1
  44. package/dist/node/mdx/remarkPlugins/containerSyntax.js +1 -1
  45. package/dist/node/mdx/remarkPlugins/fileCodeBlock.js +3 -3
  46. package/dist/node/mdx/remarkPlugins/image.js +2 -3
  47. package/dist/node/mdx/remarkPlugins/link.js +3 -3
  48. package/dist/node/mdx/remarkPlugins/toc.js +3 -3
  49. package/dist/node/medium-zoom/index.js +1 -1
  50. package/dist/node/route/RoutePage.js +1 -1
  51. package/dist/node/route/RouteService.js +3 -3
  52. package/dist/node/route/extractPageData.js +4 -5
  53. package/dist/node/route/normalizeRoutePath.js +2 -2
  54. package/dist/node/runtimeModule/i18n.js +2 -2
  55. package/dist/node/runtimeModule/pageData/createPageData.js +2 -2
  56. package/dist/node/runtimeModule/pageData/rsbuildPlugin.js +1 -1
  57. package/dist/node/runtimeModule/searchHooks.js +1 -1
  58. package/dist/node/runtimeModule/siteData/createSiteData.js +1 -1
  59. package/dist/node/runtimeModule/siteData/normalizeThemeConfig.js +1 -1
  60. package/dist/node/runtimeModule/siteData/rsbuildPlugin.js +1 -1
  61. package/dist/node/serve.js +1 -1
  62. package/dist/node/ssg/renderPage.js +2 -2
  63. package/dist/node/ssg/renderPageWorker.165b5d46.js +1 -0
  64. package/dist/node/ssg/renderPageWorker.js +2 -2
  65. package/dist/node/ssg/renderPages.js +3 -3
  66. package/dist/node/ssg/rsbuildPluginSSG.js +2 -2
  67. package/dist/node/ssg/ssgEnv.js +1 -1
  68. package/dist/node/ssg-md/llms/emitLlmsTxt.js +9 -7
  69. package/dist/node/ssg-md/llms/llmsTxt.js +2 -2
  70. package/dist/node/ssg-md/remarkSplitMdx.js +2 -2
  71. package/dist/node/ssg-md/renderPage.js +2 -2
  72. package/dist/node/ssg-md/renderPages.js +2 -2
  73. package/dist/node/ssg-md/rsbuildPluginSSGMD.js +2 -2
  74. package/dist/node/utils/checkLanguageParity.js +1 -1
  75. package/dist/node/utils/createHash.js +1 -1
  76. package/dist/node/utils/error.js +1 -1
  77. package/dist/node/utils/flattenMdxContent.js +4 -5
  78. package/dist/node/utils/fs.js +1 -1
  79. package/dist/node/utils/getPageKey.js +1 -1
  80. package/dist/node/utils/normalizePath.js +3 -3
  81. package/dist/node/utils/reactAlias.js +2 -2
  82. package/dist/runtime/App.js +4 -2
  83. package/dist/runtime/Content.d.ts +4 -0
  84. package/dist/runtime/Content.js +18 -0
  85. package/dist/runtime/NoSSR.d.ts +3 -0
  86. package/dist/runtime/NoSSR.js +14 -0
  87. package/dist/runtime/getSidebarDataGroup.test.js +68 -0
  88. package/dist/runtime/hooks/useActiveMatcher.d.ts +1 -0
  89. package/dist/runtime/hooks/useActiveMatcher.js +14 -0
  90. package/dist/runtime/hooks/useDark.d.ts +7 -0
  91. package/dist/runtime/hooks/useDark.js +7 -0
  92. package/dist/runtime/hooks/useFrontmatter.d.ts +4 -0
  93. package/dist/runtime/hooks/useFrontmatter.js +9 -0
  94. package/dist/runtime/hooks/useI18n.d.ts +2 -0
  95. package/dist/runtime/hooks/useI18n.js +14 -0
  96. package/dist/runtime/hooks/useLang.d.ts +1 -0
  97. package/dist/runtime/hooks/useLang.js +6 -0
  98. package/dist/runtime/hooks/useLocaleSiteData.d.ts +18 -0
  99. package/dist/runtime/hooks/useLocaleSiteData.js +20 -0
  100. package/dist/runtime/hooks/useNav.d.ts +1 -0
  101. package/dist/runtime/hooks/useNav.js +12 -0
  102. package/dist/runtime/hooks/usePage.d.ts +10 -0
  103. package/dist/runtime/hooks/usePage.js +9 -0
  104. package/dist/runtime/hooks/usePageData.d.ts +5 -0
  105. package/dist/runtime/hooks/usePageData.js +16 -0
  106. package/dist/runtime/hooks/usePages.d.ts +4 -0
  107. package/dist/runtime/hooks/usePages.js +7 -0
  108. package/dist/runtime/hooks/useSidebar.d.ts +16 -0
  109. package/dist/runtime/hooks/useSidebar.js +67 -0
  110. package/dist/runtime/hooks/useSite.d.ts +4 -0
  111. package/dist/runtime/hooks/useSite.js +7 -0
  112. package/dist/runtime/hooks/useVersion.d.ts +1 -0
  113. package/dist/runtime/hooks/useVersion.js +6 -0
  114. package/dist/runtime/hooks/useWindowSize.d.ts +9 -0
  115. package/dist/runtime/hooks/useWindowSize.js +31 -0
  116. package/dist/runtime/hooks/useWindowSize.test.js +36 -0
  117. package/dist/runtime/index.d.ts +21 -0
  118. package/dist/runtime/index.js +22 -0
  119. package/dist/runtime/route.d.ts +36 -0
  120. package/dist/runtime/route.js +53 -0
  121. package/dist/runtime/route.test.js +154 -0
  122. package/dist/runtime/ssrMdServerEntry.js +1 -1
  123. package/dist/runtime/utils.d.ts +12 -0
  124. package/dist/runtime/utils.js +34 -0
  125. package/dist/runtime/utils.test.js +34 -0
  126. package/dist/shiki-transformers.js +2 -2
  127. package/dist/theme/components/CodeBlock/index.js +1 -1
  128. package/dist/theme/components/FallbackHeading/index.js +4 -1
  129. package/dist/theme/components/HomeBackground/useNavTransparent.js +1 -1
  130. package/dist/theme/components/HomeHero/index.css +6 -0
  131. package/dist/theme/components/HomeHero/index.js +10 -3
  132. package/dist/theme/components/HoverGroup/index.css +3 -2
  133. package/dist/theme/components/HoverGroup/index.js +88 -17
  134. package/dist/theme/components/Nav/NavMenu.css +1 -1
  135. package/dist/theme/components/Nav/NavMenu.d.ts +6 -1
  136. package/dist/theme/components/Nav/NavMenu.js +47 -45
  137. package/dist/theme/components/NavScreen/NavScreenMenuItem.d.ts +1 -1
  138. package/dist/theme/components/NavScreen/NavScreenMenuItem.js +21 -11
  139. package/dist/theme/components/Overview/index.js +12 -1
  140. package/dist/theme/components/OverviewGroup/index.js +33 -0
  141. package/dist/theme/components/Steps/index.css +1 -0
  142. package/dist/theme/index.d.ts +1 -1
  143. package/dist/theme/index.js +1 -1
  144. package/dist/theme/layout/DocLayout/index.js +10 -0
  145. package/dist/theme/layout/HomeLayout/index.js +40 -0
  146. package/dist/theme/layout/Layout/index.js +10 -6
  147. package/dist/theme/logic/useScrollAfterNav.js +2 -2
  148. package/dist/theme/logic/useScrollReset.js +2 -2
  149. package/dist/theme/logic/useStorageValue.js +6 -3
  150. package/dist/theme/logic/{useAppearance.d.ts → useThemeState.d.ts} +4 -1
  151. package/dist/theme/logic/useThemeState.js +50 -0
  152. package/dist/theme/styles/scrollbar.css +14 -2
  153. package/dist/theme/styles/vars/base-vars.css +2 -2
  154. package/dist/theme/styles/vars/code-vars.css +2 -2
  155. package/nav-json-schema.json +2 -2
  156. package/package.json +10 -11
  157. package/static/MediumZoom.tsx +1 -1
  158. package/dist/4669.12208c6a.js +0 -2
  159. package/dist/6289.c67fe0d5.js +0 -5
  160. package/dist/8813.9da1f210.js +0 -2
  161. package/dist/9643.f109822d.js +0 -5
  162. package/dist/cli/index.cb89dbd1.js +0 -3
  163. package/dist/node/mdx/loader.e1578c62.js +0 -13
  164. package/dist/node/ssg/renderPageWorker.474f9f73.js +0 -2
  165. package/dist/runtime.72d450ac.js +0 -1
  166. package/dist/runtime.d.ts +0 -2
  167. package/dist/runtime.js +0 -4
  168. package/dist/theme/logic/useAppearance.js +0 -64
package/dist/index.js CHANGED
@@ -1,16 +1,11 @@
1
- import "./4669.12208c6a.js";
2
- import "./6289.c67fe0d5.js";
3
- import "./9643.f109822d.js";
4
- import "./3521.56e42d70.js";
5
- export { RSPRESS_TEMP_DIR, getSidebarDataGroup, normalizeHref, normalizePosixPath, removeTrailingSlash, withBase } from "@rspress/shared";
6
- export { logger } from "@rspress/shared/logger";
7
- export { getIconUrlPath, getNodeAttribute, mergeDocConfig } from "@rspress/shared/node-utils";
8
- export { matchPath } from "react-router-dom";
9
- export { defineConfig } from "./cli/config/index.js";
1
+ export { PluginDriver } from "./node/PluginDriver.js";
2
+ export { RSPRESS_TEMP_DIR, getIconUrlPath, getNodeAttribute, getSidebarDataGroup, mergeDocConfig, normalizeHref, normalizePosixPath, removeTrailingSlash, withBase } from "./1820.985588a0.js";
3
+ export { RouteService } from "./node/route/RouteService.js";
10
4
  export { build } from "./node/build.js";
5
+ export { defineConfig } from "./cli/config/index.js";
11
6
  export { dev } from "./node/dev.js";
7
+ export { logger } from "./6289.29817fb4.js";
8
+ export { matchPath } from "./5341.9eb6b114.js";
12
9
  export { remarkFileCodeBlock } from "./node/mdx/remarkPlugins/fileCodeBlock.js";
13
10
  export { remarkLink } from "./node/mdx/remarkPlugins/link.js";
14
11
  export { serve } from "./node/serve.js";
15
- export { PluginDriver } from "./node/PluginDriver.js";
16
- export { RouteService } from "./node/route/RouteService.js";
@@ -1,7 +1,7 @@
1
- import { node_path } from "../6289.c67fe0d5.js";
2
- import { addTrailingSlash, addLeadingSlash } from "../4669.12208c6a.js";
1
+ import { node_path } from "../6289.29817fb4.js";
2
+ import { addTrailingSlash, addLeadingSlash } from "../1820.985588a0.js";
3
3
  import { createError } from "./utils/error.js";
4
- import { haveNavSidebarConfig as auto_nav_sidebar_haveNavSidebarConfig } from "./auto-nav-sidebar/index.js";
4
+ import { auto_nav_sidebar_haveNavSidebarConfig } from "./auto-nav-sidebar/index.js";
5
5
  class PluginDriver {
6
6
  #config;
7
7
  #configFilePath;
@@ -1,5 +1,5 @@
1
- import { node_path } from "../../6289.c67fe0d5.js";
2
- import { DEFAULT_PAGE_EXTENSIONS } from "../../3521.56e42d70.js";
1
+ import { node_path } from "../../6289.29817fb4.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) {
@@ -41,4 +41,4 @@ async function modifyConfigWithAutoNavSide(config, metaFileSet = new Set(), mdFi
41
41
  config.themeConfig.nav = autoNavSide.nav;
42
42
  config.themeConfig.sidebar = autoNavSide.sidebar;
43
43
  }
44
- export { auto_nav_sidebar_haveNavSidebarConfig as haveNavSidebarConfig, modifyConfigWithAutoNavSide };
44
+ export { auto_nav_sidebar_haveNavSidebarConfig, modifyConfigWithAutoNavSide };
@@ -1,4 +1,4 @@
1
- import { node_path } from "../../6289.c67fe0d5.js";
1
+ import { node_path } from "../../6289.29817fb4.js";
2
2
  import { walk } from "./walk.js";
3
3
  function combineWalkResult(walks, versions) {
4
4
  return walks.reduce((acc, cur, curIndex)=>({
@@ -1,5 +1,5 @@
1
- import { readdir, extname, stat as promises_stat, relative, logger, join, picocolors } from "../../6289.c67fe0d5.js";
2
- import { isExternalUrl, slash } from "../../4669.12208c6a.js";
1
+ import { readdir, extname, stat as promises_stat, relative, logger, join, picocolors } from "../../6289.29817fb4.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
- import { node_path, promises } from "../../6289.c67fe0d5.js";
2
- import { loadFrontMatter, extractTextAndId } from "../../9643.f109822d.js";
1
+ import { node_path, promises } from "../../6289.29817fb4.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,20 +1,24 @@
1
- import { node_path, logger, promises } from "../../6289.c67fe0d5.js";
2
- import { isExternalUrl } from "../../4669.12208c6a.js";
1
+ import { node_path, promises } from "../../6289.29817fb4.js";
2
+ import { isExternalUrl } from "../../1820.985588a0.js";
3
+ import { pathExists } from "../utils/fs.js";
3
4
  import { readJson } from "./utils.js";
5
+ import { createError } from "../utils/error.js";
4
6
  import { addRoutePrefix } from "../route/RoutePage.js";
5
- import { pathExists } from "../utils/fs.js";
6
7
  import { hintNavJsonChangeThenPanic } from "../logger/hint.js";
7
8
  import { scanSideMeta } from "./normalize.js";
8
9
  async function scanNav(workDir, docsDir, metaFileSet) {
9
10
  let navConfig;
10
11
  const rootNavJson = node_path.resolve(workDir, '_nav.json');
11
- try {
12
- navConfig = await readJson(rootNavJson);
12
+ const isRootNavJsonExist = await pathExists(rootNavJson);
13
+ if (isRootNavJsonExist) {
13
14
  metaFileSet.add(rootNavJson);
14
- } catch (_e) {
15
- logger.error('[auto-nav-sidebar]', `Generate nav meta error: ${rootNavJson} failed`);
16
- navConfig = [];
17
- }
15
+ try {
16
+ navConfig = await readJson(rootNavJson);
17
+ } catch (e) {
18
+ if (e instanceof Error) throw createError(`[auto-nav-sidebar] Generate nav meta error: ${rootNavJson} failed, original error is (${e.message})`);
19
+ throw e;
20
+ }
21
+ } else navConfig = [];
18
22
  navConfig.forEach((navItem)=>{
19
23
  if ('items' in navItem) navItem.items.forEach((item)=>{
20
24
  if ('link' in item && !isExternalUrl(item.link)) item.link = addRoutePrefix(workDir, docsDir, item.link);
@@ -1,5 +1,5 @@
1
- import { createRequire, package_namespaceObject } from "../5485.077f14ff.js";
2
- import { node_path } from "../6289.c67fe0d5.js";
1
+ import { createRequire, package_namespaceObject } from "../5485.b9ce9bdf.js";
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;
5
5
  const APPEARANCE_KEY = 'rspress-theme-appearance';
@@ -1,9 +1,6 @@
1
- import { node_path, logger, promises, picocolors } from "../6289.c67fe0d5.js";
1
+ import { node_path, logger, promises, picocolors } from "../6289.29817fb4.js";
2
2
  import { EJECTED_THEME } from "./constants.js";
3
3
  let _themeComponentsPathOverride;
4
- function __setThemeComponentsPathForTesting(themePath) {
5
- _themeComponentsPathOverride = themePath;
6
- }
7
4
  function getThemeComponentsPath() {
8
5
  if (_themeComponentsPathOverride) return _themeComponentsPathOverride;
9
6
  return node_path.join(EJECTED_THEME, 'components');
@@ -108,4 +105,4 @@ async function listComponents() {
108
105
  });
109
106
  logger.info(`💡 Usage: ${picocolors.dim('rspress eject <ComponentName>')}\n`);
110
107
  }
111
- export { __setThemeComponentsPathForTesting, ejectComponent, getAvailableComponents, listComponents };
108
+ export { ejectComponent, listComponents };
@@ -1,8 +1,7 @@
1
- import { createRequire, fileURLToPath, package_namespaceObject } from "../5485.077f14ff.js";
2
- import { node_path } from "../6289.c67fe0d5.js";
3
- import { cwd } from "../9643.f109822d.js";
4
- import { PLUGIN_REACT_NAME, pluginReact, pluginVirtualModule } from "../3521.56e42d70.js";
5
- import { removeTrailingSlash, MDX_OR_MD_REGEXP } from "../4669.12208c6a.js";
1
+ import { createRequire, fileURLToPath, package_namespaceObject } from "../5485.b9ce9bdf.js";
2
+ import { node_path } from "../6289.29817fb4.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
  },
@@ -245,7 +244,9 @@ async function createInternalBuildConfig(userDocRoot, config, enableSSG, routeSe
245
244
  },
246
245
  define: {
247
246
  'process.env.__SSR__': JSON.stringify(false),
248
- 'process.env.__SSR_MD__': JSON.stringify(false)
247
+ 'process.env.__SSR_MD__': JSON.stringify(false),
248
+ 'import.meta.env.SSR': JSON.stringify(false),
249
+ 'import.meta.env.SSG_MD': JSON.stringify(false)
249
250
  }
250
251
  },
251
252
  output: {
@@ -277,7 +278,9 @@ async function createInternalBuildConfig(userDocRoot, config, enableSSG, routeSe
277
278
  },
278
279
  define: {
279
280
  'process.env.__SSR__': JSON.stringify(true),
280
- 'process.env.__SSR_MD__': JSON.stringify(false)
281
+ 'process.env.__SSR_MD__': JSON.stringify(false),
282
+ 'import.meta.env.SSR': JSON.stringify(true),
283
+ 'import.meta.env.SSG_MD': JSON.stringify(false)
281
284
  }
282
285
  },
283
286
  performance: {
@@ -314,7 +317,9 @@ async function createInternalBuildConfig(userDocRoot, config, enableSSG, routeSe
314
317
  },
315
318
  define: {
316
319
  'process.env.__SSR__': JSON.stringify(true),
317
- 'process.env.__SSR_MD__': JSON.stringify(true)
320
+ 'process.env.__SSR_MD__': JSON.stringify(true),
321
+ 'import.meta.env.SSR': JSON.stringify(true),
322
+ 'import.meta.env.SSG_MD': JSON.stringify(true)
318
323
  }
319
324
  },
320
325
  performance: {
@@ -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,4 +1,4 @@
1
- import { picocolors, relative, logger, join, readFile } from "../../6289.c67fe0d5.js";
1
+ import { picocolors, relative, logger, join, readFile } from "../../6289.29817fb4.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['"]/;
@@ -0,0 +1,12 @@
1
+ export { default as rehype } from "@shikijs/rehype";
2
+ export { default as rehype_external_links } from "rehype-external-links";
3
+ export { default as rehype_raw } from "rehype-raw";
4
+ export { default as remark_gfm } from "remark-gfm";
5
+ export { default as remark_mdx } from "remark-mdx";
6
+ export { default as remark_stringify } from "remark-stringify";
7
+ export { unified } from "unified";
8
+ export { default as github_slugger } from "github-slugger";
9
+ export { headingRank } from "hast-util-heading-rank";
10
+ export { transformerAddLang, transformerAddLineNumbers, transformerAddTitle, transformerAddWrapCode } from "@rspress/core/shiki-transformers";
11
+ export { createCssVariablesTheme } from "shiki";
12
+ export { visitChildren } from "unist-util-visit-children";
@@ -1,6 +1,6 @@
1
- import { node_path } from "../../6289.c67fe0d5.js";
2
- import { nodeTypes } from "../../9643.f109822d.js";
3
- import { rehype_external_links, rehype_raw, remark_gfm, rehype } from "./loader.e1578c62.js";
1
+ import { node_path } from "../../6289.29817fb4.js";
2
+ import { nodeTypes } from "../../1820.985588a0.js";
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";
6
6
  import { remarkFileCodeBlock } from "./remarkPlugins/fileCodeBlock.js";
@@ -1,5 +1,5 @@
1
- import { node_path } from "../../6289.c67fe0d5.js";
2
- import { createProcessor, loadFrontMatter, extractTextAndId } from "../../9643.f109822d.js";
1
+ import { node_path } from "../../6289.29817fb4.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 { visit } from "../../../8813.9da1f210.js";
1
+ import { visit } from "../../../8813.4b28f4bb.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,6 +1,6 @@
1
- import { extractTextAndId } from "../../../9643.f109822d.js";
2
- import { github_slugger, headingRank } from "../loader.e1578c62.js";
3
- import { visit } from "../../../8813.9da1f210.js";
1
+ import { extractTextAndId } from "../../../1820.985588a0.js";
2
+ import { github_slugger, headingRank } from "../loader.7c249a26.js";
3
+ import { visit } from "../../../8813.4b28f4bb.js";
4
4
  const rehypeHeaderAnchor = ()=>{
5
5
  const slugger = new github_slugger();
6
6
  return (tree)=>{
@@ -50,4 +50,4 @@ function create(node) {
50
50
  ]
51
51
  };
52
52
  }
53
- export { collectHeaderText, rehypeHeaderAnchor };
53
+ export { rehypeHeaderAnchor };
@@ -1,4 +1,4 @@
1
- import { transformerAddLang, transformerAddLineNumbers, transformerAddTitle, createCssVariablesTheme, transformerAddWrapCode } from "../loader.e1578c62.js";
1
+ import { transformerAddLang, transformerAddLineNumbers, transformerAddTitle, createCssVariablesTheme, transformerAddWrapCode } from "../loader.7c249a26.js";
2
2
  const cssVariablesTheme = createCssVariablesTheme({
3
3
  name: 'css-variables',
4
4
  variablePrefix: '--shiki-',
@@ -1,5 +1,5 @@
1
- export { SHIKI_TRANSFORMER_ADD_LANG, transformerAddLang } from "./add-lang.js";
2
- export { SHIKI_TRANSFORMER_ADD_LINE_NUMBERS, transformerAddLineNumbers } from "./add-line-numbers.js";
3
- export { SHIKI_TRANSFORMER_ADD_TITLE, transformerAddTitle } from "./add-title.js";
4
- export { SHIKI_TRANSFORMER_ADD_WRAP_CODE, transformerAddWrapCode } from "./add-wrap-code.js";
5
- export { SHIKI_TRANSFORMER_META_HIGHLIGHT, transformerCompatibleMetaHighlight } from "./meta-highlight.js";
1
+ import "./add-lang.js";
2
+ import "./add-line-numbers.js";
3
+ import "./add-title.js";
4
+ import "./add-wrap-code.js";
5
+ import "./meta-highlight.js";
@@ -1,4 +1,4 @@
1
- import { node_path } from "../../../6289.c67fe0d5.js";
1
+ import { node_path } from "../../../6289.29817fb4.js";
2
2
  import { getDefaultImportAstNode } from "../../utils/getImportAstNode.js";
3
3
  const remarkBuiltin = ({ globalComponents })=>(tree)=>{
4
4
  const demos = globalComponents.map((componentPath)=>{
@@ -187,4 +187,4 @@ const remarkContainerSyntax = ()=>{
187
187
  tree.children.unshift(getNamedImportAstNode('Callout', CALLOUT_COMPONENT, '@theme'));
188
188
  };
189
189
  };
190
- export { DIRECTIVE_TYPES, REGEX_BEGIN, REGEX_END, REGEX_GH_BEGIN, TITLE_REGEX_IN_MD, TITLE_REGEX_IN_MDX, remarkContainerSyntax };
190
+ export { remarkContainerSyntax };
@@ -1,6 +1,6 @@
1
- import { node_path, logger, picocolors, readFile } from "../../../6289.c67fe0d5.js";
2
- import { cwd } from "../../../9643.f109822d.js";
3
- import { visit } from "../../../8813.9da1f210.js";
1
+ import { node_path, logger, picocolors, readFile } from "../../../6289.29817fb4.js";
2
+ import { cwd } from "../../../1820.985588a0.js";
3
+ import { visit } from "../../../8813.4b28f4bb.js";
4
4
  import { createError } from "../../utils/error.js";
5
5
  const ERROR_PREFIX = '[remarkFileCodeBlock]';
6
6
  function parseFileFromMeta(meta) {
@@ -1,6 +1,5 @@
1
- import { isExternalUrl } from "../../../4669.12208c6a.js";
2
- import { getNodeAttribute } from "../../../9643.f109822d.js";
3
- import { visit } from "../../../8813.9da1f210.js";
1
+ import { isExternalUrl, getNodeAttribute } from "../../../1820.985588a0.js";
2
+ import { visit } from "../../../8813.4b28f4bb.js";
4
3
  import { getDefaultImportAstNode } from "../../utils/getImportAstNode.js";
5
4
  const normalizeImageUrl = (imageUrl)=>{
6
5
  if (isExternalUrl(imageUrl) || imageUrl.startsWith('/')) return '';
@@ -1,6 +1,6 @@
1
- import { node_path, logger, picocolors } from "../../../6289.c67fe0d5.js";
2
- import { isExternalUrl, isProduction, addLeadingSlash, parseUrl, normalizeHref, withBase } from "../../../4669.12208c6a.js";
3
- import { visit } from "../../../8813.9da1f210.js";
1
+ import { node_path, logger, picocolors } from "../../../6289.29817fb4.js";
2
+ import { isExternalUrl, isProduction, addLeadingSlash, parseUrl, normalizeHref, withBase } from "../../../1820.985588a0.js";
3
+ import { visit } from "../../../8813.4b28f4bb.js";
4
4
  import { hintRelativeMarkdownLink } from "../../logger/hint.js";
5
5
  import { createError } from "../../utils/error.js";
6
6
  function link_checkDeadLinks(checkDeadLinks, internalLinks, file, lint) {
@@ -1,5 +1,5 @@
1
- import { extractTextAndId } from "../../../9643.f109822d.js";
2
- import { github_slugger, visitChildren } from "../loader.e1578c62.js";
1
+ import { extractTextAndId } from "../../../1820.985588a0.js";
2
+ import { github_slugger, visitChildren } from "../loader.7c249a26.js";
3
3
  const parseToc = (tree)=>{
4
4
  let title = '';
5
5
  const toc = [];
@@ -47,4 +47,4 @@ const remarkToc = function() {
47
47
  if (title) data.pageMeta.title = title;
48
48
  };
49
49
  };
50
- export { parseToc, remarkToc };
50
+ export { remarkToc };
@@ -1,4 +1,4 @@
1
- import { node_path } from "../../6289.c67fe0d5.js";
1
+ import { node_path } from "../../6289.29817fb4.js";
2
2
  import { PACKAGE_ROOT } from "../constants.js";
3
3
  function pluginMediumZoom(options = {}) {
4
4
  return {
@@ -1,4 +1,4 @@
1
- import { node_path } from "../../6289.c67fe0d5.js";
1
+ import { node_path } from "../../6289.29817fb4.js";
2
2
  import { RouteService } from "./RouteService.js";
3
3
  import { normalizePath, slash } from "../utils/normalizePath.js";
4
4
  import { getPageKey } from "../utils/getPageKey.js";
@@ -1,6 +1,6 @@
1
- import { node_path, promises } from "../../6289.c67fe0d5.js";
2
- import { RSPRESS_TEMP_DIR, removeTrailingSlash, addTrailingSlash } from "../../4669.12208c6a.js";
3
- import { DEFAULT_PAGE_EXTENSIONS, glob } from "../../3521.56e42d70.js";
1
+ import { node_path, promises } from "../../6289.29817fb4.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
- import { node_path, promises } from "../../6289.c67fe0d5.js";
2
- import { htmlToText, compile } from "../../3521.56e42d70.js";
3
- import { MDX_OR_MD_REGEXP } from "../../4669.12208c6a.js";
4
- import { loadFrontMatter } from "../../9643.f109822d.js";
1
+ import { node_path, promises } from "../../6289.29817fb4.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";
@@ -109,4 +108,4 @@ async function extractPageData(routeService, options) {
109
108
  const pageData = await Promise.all(routeService.getRoutes().map((routeMeta)=>getPageIndexInfoByRoute(routeMeta, options)));
110
109
  return pageData;
111
110
  }
112
- export { extractPageData, getPageIndexInfoByRoute };
111
+ export { extractPageData };
@@ -1,5 +1,5 @@
1
- import { addTrailingSlash, addLeadingSlash } from "../../4669.12208c6a.js";
2
- import { DEFAULT_PAGE_EXTENSIONS } from "../../3521.56e42d70.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,5 +1,5 @@
1
- import { createRequire } from "../../5485.077f14ff.js";
2
- import { picocolors, join, logger } from "../../6289.c67fe0d5.js";
1
+ import { createRequire } from "../../5485.b9ce9bdf.js";
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";
5
5
  import { pathExists } from "../utils/fs.js";
@@ -1,5 +1,5 @@
1
- import { SEARCH_INDEX_NAME } from "../../../4669.12208c6a.js";
2
- import { groupBy } from "../../../3521.56e42d70.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.56e42d70.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 { node_path } from "../../6289.c67fe0d5.js";
1
+ import { node_path } from "../../6289.29817fb4.js";
2
2
  const searchHookVMPlugin = (context)=>({
3
3
  ["virtual-search-hooks"]: ()=>{
4
4
  const { config } = context;
@@ -1,4 +1,4 @@
1
- import { getIconUrlPath } from "../../../9643.f109822d.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.12208c6a.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 { logger } from "../../../6289.c67fe0d5.js";
1
+ import { logger } from "../../../6289.29817fb4.js";
2
2
  import { modifyConfigWithAutoNavSide } from "../../auto-nav-sidebar/index.js";
3
3
  import { createSiteData } from "./createSiteData.js";
4
4
  const siteDataVMPlugin = (context)=>{
@@ -1,4 +1,4 @@
1
- import { mergeRsbuildConfig } from "../3521.56e42d70.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,5 +1,5 @@
1
- import { transformHtmlTemplate, pathToFileURL, createHead } from "../../5485.077f14ff.js";
2
- import { logger, picocolors } from "../../6289.c67fe0d5.js";
1
+ import { transformHtmlTemplate, pathToFileURL, createHead } from "../../5485.b9ce9bdf.js";
2
+ import { logger, picocolors } from "../../6289.29817fb4.js";
3
3
  import { hintSSGFailed } from "../logger/hint.js";
4
4
  import { renderHtmlTemplate } from "./renderHtmlTemplate.js";
5
5
  async function renderPage(route, htmlTemplate, configHead, ssrBundlePath) {
@@ -0,0 +1 @@
1
+ export { workerData } from "node:worker_threads";
@@ -1,6 +1,6 @@
1
- import { workerData } from "./renderPageWorker.474f9f73.js";
1
+ import { workerData } from "./renderPageWorker.165b5d46.js";
2
2
  import { createError } from "../utils/error.js";
3
- import { pMap } from "../../5485.077f14ff.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
- import { logger, picocolors } from "../../6289.c67fe0d5.js";
3
- import { chunk } from "../../3521.56e42d70.js";
2
+ import { logger, picocolors } from "../../6289.29817fb4.js";
3
+ import { chunk } from "../../5341.9eb6b114.js";
4
4
  import { SSGWorkerThreadTaskSize, getNumberOfThreads, SSGWorkerThreadRecyclerMaxMemory, SSGConcurrency } from "./ssgEnv.js";
5
- import { pMap } from "../../5485.077f14ff.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
- import { logger, writeFile, mkdir, rm, join } from "../../6289.c67fe0d5.js";
2
- import { isDebugMode } from "../../4669.12208c6a.js";
1
+ import { logger, writeFile, mkdir, rm, join } from "../../6289.29817fb4.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.f109822d.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.12208c6a.js";
2
- import { matchPath } from "../../../3521.56e42d70.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 ?? '/';
@@ -30,11 +30,13 @@ async function emitLlmsTxt(config, routeService, emitAsset, mdContents) {
30
30
  }));
31
31
  }).flat().filter((i)=>i.activeMatch || i.link) : [];
32
32
  const defaultLang = routeService.getDefaultLang();
33
- const langs = new Set([
34
- defaultLang,
35
- ...routeService.getLangs()
36
- ]);
37
- await Promise.all(langs.values().map(async (lang)=>{
33
+ const langs = [
34
+ ...new Set([
35
+ defaultLang,
36
+ ...routeService.getLangs()
37
+ ])
38
+ ];
39
+ await Promise.all(langs.map(async (lang)=>{
38
40
  const navList = noVersionNav.filter((i)=>i.lang === lang);
39
41
  const routeGroups = new Array(navList.length).fill(0).map(()=>[]);
40
42
  const others = [];
@@ -1,4 +1,4 @@
1
- import { normalizeHref, withBase } from "../../../4669.12208c6a.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;
@@ -63,4 +63,4 @@ url: ${routePathToMdPath(routePath, base)}
63
63
  }
64
64
  return lines.join('\n');
65
65
  }
66
- export { generateLlmsFullTxt, generateLlmsTxt, routePathToMdPath };
66
+ export { generateLlmsFullTxt, generateLlmsTxt };
@@ -1,5 +1,5 @@
1
- import { unified, remark_gfm, remark_mdx, remark_stringify } from "../mdx/loader.e1578c62.js";
2
- import { visit } from "../../8813.9da1f210.js";
1
+ import { unified, remark_gfm, remark_mdx, remark_stringify } from "../mdx/loader.7c249a26.js";
2
+ import { visit } from "../../8813.4b28f4bb.js";
3
3
  function remarkSplitMdx(options = {}) {
4
4
  return (tree)=>{
5
5
  const newChildren = [];
@@ -1,5 +1,5 @@
1
- import { pathToFileURL, createHead } from "../../5485.077f14ff.js";
2
- import { logger, picocolors } from "../../6289.c67fe0d5.js";
1
+ import { pathToFileURL, createHead } from "../../5485.b9ce9bdf.js";
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;
@@ -1,5 +1,5 @@
1
- import { logger, picocolors } from "../../6289.c67fe0d5.js";
2
- import { pMap } from "../../5485.077f14ff.js";
1
+ import { logger, picocolors } from "../../6289.29817fb4.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
- import { writeFile, mkdir, rm, join } from "../../6289.c67fe0d5.js";
2
- import { isDebugMode } from "../../4669.12208c6a.js";
1
+ import { writeFile, mkdir, rm, join } from "../../6289.29817fb4.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";