@rspress/core 2.0.0-rc.2 → 2.0.0-rc.4

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 (172) hide show
  1. package/dist/{0~7675.989ee664.js → 0~7675.723d12b2.js} +18 -15
  2. package/dist/{5313.6594aba0.js → 3521.9eb6b114.js} +12 -19
  3. package/dist/4669.69cb6b18.js +1 -0
  4. package/dist/{5485.2a0273cf.js → 5485.9fc7f63d.js} +5 -5
  5. package/dist/6289.29817fb4.js +4 -0
  6. package/dist/8813.4b28f4bb.js +1 -0
  7. package/dist/9643.2dff683e.js +4 -0
  8. package/dist/_private/react/render.js +17 -4
  9. package/dist/cli/config/loadConfigFile.js +2 -2
  10. package/dist/cli/index.44f3184c.js +2 -0
  11. package/dist/cli/index.js +3 -3
  12. package/dist/eject-theme/components/Badge/index.scss +1 -0
  13. package/dist/eject-theme/components/Banner/index.tsx +3 -1
  14. package/dist/eject-theme/components/Callout/index.tsx +8 -2
  15. package/dist/eject-theme/components/CodeBlock/index.scss +8 -6
  16. package/dist/eject-theme/components/CodeBlock/index.tsx +4 -0
  17. package/dist/eject-theme/components/CodeBlockRuntime/index.tsx +50 -11
  18. package/dist/eject-theme/components/DocContent/doc.scss +1 -1
  19. package/dist/eject-theme/components/DocContent/docComponents/pre.tsx +2 -1
  20. package/dist/eject-theme/components/DocContent/index.tsx +21 -4
  21. package/dist/eject-theme/components/DocFooter/index.tsx +1 -6
  22. package/dist/eject-theme/components/HoverGroup/index.scss +4 -3
  23. package/dist/eject-theme/components/HoverGroup/index.tsx +104 -22
  24. package/dist/eject-theme/components/LastUpdated/index.tsx +8 -1
  25. package/dist/eject-theme/components/Link/index.tsx +9 -2
  26. package/dist/eject-theme/components/Nav/NavMenu.scss +1 -1
  27. package/dist/eject-theme/components/Nav/NavMenu.tsx +50 -28
  28. package/dist/eject-theme/components/NavScreen/NavScreenLangs.scss +6 -0
  29. package/dist/eject-theme/components/NavScreen/NavScreenLangs.tsx +23 -9
  30. package/dist/eject-theme/components/NavScreen/NavScreenMenuItem.tsx +26 -11
  31. package/dist/eject-theme/components/NavScreen/NavScreenVersions.scss +6 -0
  32. package/dist/eject-theme/components/NavScreen/NavScreenVersions.tsx +22 -9
  33. package/dist/eject-theme/components/Overview/index.tsx +66 -6
  34. package/dist/eject-theme/components/{Overview/OverviewGroup.scss → OverviewGroup/index.scss} +66 -12
  35. package/dist/eject-theme/components/{Overview/OverviewGroup.tsx → OverviewGroup/index.tsx} +50 -3
  36. package/dist/eject-theme/components/Search/logic/util.test.ts +1 -1
  37. package/dist/eject-theme/components/Tabs/index.scss +12 -4
  38. package/dist/eject-theme/components/Tabs/index.tsx +16 -0
  39. package/dist/eject-theme/components/Tag/index.tsx +84 -5
  40. package/dist/index.js +7 -11
  41. package/dist/node/PluginDriver.js +5 -6
  42. package/dist/node/auto-nav-sidebar/index.js +3 -3
  43. package/dist/node/auto-nav-sidebar/locales.js +1 -1
  44. package/dist/node/auto-nav-sidebar/normalize.js +12 -10
  45. package/dist/node/auto-nav-sidebar/utils.js +2 -2
  46. package/dist/node/auto-nav-sidebar/walk.js +13 -9
  47. package/dist/node/constants.d.ts +1 -0
  48. package/dist/node/constants.js +4 -3
  49. package/dist/node/eject.js +7 -10
  50. package/dist/node/initRsbuild.js +25 -11
  51. package/dist/node/last-updated/index.js +1 -1
  52. package/dist/node/logger/hint.js +1 -1
  53. package/dist/node/mdx/loader.7c249a26.js +12 -0
  54. package/dist/node/mdx/loader.js +2 -1
  55. package/dist/node/mdx/options.js +9 -6
  56. package/dist/node/mdx/processor.js +2 -2
  57. package/dist/node/mdx/rehypePlugins/codeMeta.js +1 -1
  58. package/dist/node/mdx/rehypePlugins/headerAnchor.js +4 -4
  59. package/dist/node/mdx/rehypePlugins/shiki.js +1 -1
  60. package/dist/node/mdx/rehypePlugins/transformers/index.js +5 -5
  61. package/dist/node/mdx/remarkPlugins/builtin.js +1 -1
  62. package/dist/node/mdx/remarkPlugins/containerSyntax.js +1 -1
  63. package/dist/node/mdx/remarkPlugins/fileCodeBlock.js +3 -3
  64. package/dist/node/mdx/remarkPlugins/image.js +3 -3
  65. package/dist/node/mdx/remarkPlugins/link.js +3 -3
  66. package/dist/node/mdx/remarkPlugins/toc.js +3 -3
  67. package/dist/node/medium-zoom/index.js +1 -1
  68. package/dist/node/route/RoutePage.js +1 -1
  69. package/dist/node/route/RouteService.js +3 -3
  70. package/dist/node/route/extractPageData.js +5 -5
  71. package/dist/node/route/normalizeRoutePath.js +2 -2
  72. package/dist/node/runtimeModule/i18n.js +2 -2
  73. package/dist/node/runtimeModule/pageData/createPageData.js +2 -2
  74. package/dist/node/runtimeModule/pageData/rsbuildPlugin.js +1 -1
  75. package/dist/node/runtimeModule/searchHooks.js +1 -1
  76. package/dist/node/runtimeModule/siteData/createSiteData.js +1 -1
  77. package/dist/node/runtimeModule/siteData/normalizeThemeConfig.js +1 -1
  78. package/dist/node/runtimeModule/siteData/rsbuildPlugin.js +1 -1
  79. package/dist/node/serve.js +1 -1
  80. package/dist/node/ssg/renderPage.js +2 -2
  81. package/dist/node/ssg/renderPageWorker.165b5d46.js +1 -0
  82. package/dist/node/ssg/renderPageWorker.js +2 -2
  83. package/dist/node/ssg/renderPages.js +3 -3
  84. package/dist/node/ssg/rsbuildPluginSSG.js +2 -2
  85. package/dist/node/ssg/ssgEnv.js +1 -1
  86. package/dist/node/ssg-md/llms/emitLlmsTxt.js +9 -3
  87. package/dist/node/ssg-md/llms/llmsTxt.js +2 -2
  88. package/dist/node/ssg-md/remarkSplitMdx.js +141 -99
  89. package/dist/node/ssg-md/renderPage.js +2 -2
  90. package/dist/node/ssg-md/renderPages.js +2 -2
  91. package/dist/node/ssg-md/rsbuildPluginSSGMD.js +2 -2
  92. package/dist/node/utils/checkLanguageParity.js +1 -1
  93. package/dist/node/utils/createHash.js +1 -1
  94. package/dist/node/utils/error.js +2 -1
  95. package/dist/node/utils/flattenMdxContent.js +5 -5
  96. package/dist/node/utils/fs.js +1 -1
  97. package/dist/node/utils/getPageKey.js +1 -1
  98. package/dist/node/utils/normalizePath.js +3 -3
  99. package/dist/node/utils/reactAlias.js +2 -2
  100. package/dist/runtime/App.js +4 -2
  101. package/dist/runtime/initPageData.js +1 -1
  102. package/dist/runtime.js +1 -2
  103. package/dist/shiki-transformers.js +2 -2
  104. package/dist/theme/assets/deprecated.js +18 -0
  105. package/dist/theme/assets/experimental.js +21 -0
  106. package/dist/theme/components/Badge/index.css +1 -0
  107. package/dist/theme/components/Banner/index.js +2 -2
  108. package/dist/theme/components/Callout/index.js +5 -2
  109. package/dist/theme/components/CodeBlock/index.css +7 -6
  110. package/dist/theme/components/CodeBlock/index.js +4 -1
  111. package/dist/theme/components/CodeBlockRuntime/index.d.ts +1 -1
  112. package/dist/theme/components/CodeBlockRuntime/index.js +38 -8
  113. package/dist/theme/components/DocContent/doc.css +1 -1
  114. package/dist/theme/components/DocContent/docComponents/pre.js +3 -1
  115. package/dist/theme/components/DocContent/index.d.ts +11 -2
  116. package/dist/theme/components/DocContent/index.js +6 -5
  117. package/dist/theme/components/DocFooter/index.js +1 -5
  118. package/dist/theme/components/HoverGroup/index.css +6 -5
  119. package/dist/theme/components/HoverGroup/index.js +88 -17
  120. package/dist/theme/components/LastUpdated/index.d.ts +1 -1
  121. package/dist/theme/components/LastUpdated/index.js +5 -1
  122. package/dist/theme/components/Link/index.d.ts +1 -1
  123. package/dist/theme/components/Link/index.js +8 -2
  124. package/dist/theme/components/Nav/NavMenu.css +1 -1
  125. package/dist/theme/components/Nav/NavMenu.d.ts +6 -1
  126. package/dist/theme/components/Nav/NavMenu.js +47 -45
  127. package/dist/theme/components/NavScreen/NavScreenLangs.css +6 -0
  128. package/dist/theme/components/NavScreen/NavScreenLangs.js +13 -3
  129. package/dist/theme/components/NavScreen/NavScreenMenuItem.d.ts +1 -1
  130. package/dist/theme/components/NavScreen/NavScreenMenuItem.js +21 -11
  131. package/dist/theme/components/NavScreen/NavScreenVersions.css +6 -0
  132. package/dist/theme/components/NavScreen/NavScreenVersions.js +12 -3
  133. package/dist/theme/components/Overview/index.d.ts +0 -1
  134. package/dist/theme/components/Overview/index.js +46 -3
  135. package/dist/theme/components/{Overview/OverviewGroup.css → OverviewGroup/index.css} +60 -8
  136. package/dist/theme/components/{Overview/OverviewGroup.d.ts → OverviewGroup/index.d.ts} +1 -1
  137. package/dist/theme/components/OverviewGroup/index.js +88 -0
  138. package/dist/theme/components/Search/logic/util.test.js +1 -1
  139. package/dist/theme/components/Tabs/index.css +6 -5
  140. package/dist/theme/components/Tabs/index.js +9 -0
  141. package/dist/theme/components/Tag/index.d.ts +3 -0
  142. package/dist/theme/components/Tag/index.js +63 -8
  143. package/dist/theme/hooks/useActiveAnchor.js +1 -1
  144. package/dist/theme/icons.d.ts +26 -24
  145. package/dist/theme/icons.js +5 -1
  146. package/dist/theme/index.d.ts +3 -1
  147. package/dist/theme/index.js +4 -2
  148. package/dist/theme/layout/DocLayout/index.css +0 -2
  149. package/dist/theme/layout/DocLayout/index.js +10 -0
  150. package/dist/theme/layout/HomeLayout/index.js +40 -0
  151. package/dist/theme/layout/Layout/index.js +11 -8
  152. package/dist/theme/layout/NotFountLayout/index.js +1 -1
  153. package/dist/theme/logic/useAppearance.js +1 -1
  154. package/dist/theme/logic/useMediaQuery.js +1 -1
  155. package/dist/theme/logic/useStorageValue.js +6 -3
  156. package/dist/theme/styles/base.css +1 -0
  157. package/dist/theme/styles/shiki.css +9 -3
  158. package/dist/theme/styles/vars/base-vars.css +4 -4
  159. package/dist/theme/styles/vars/code-vars.css +2 -0
  160. package/nav-json-schema.json +2 -2
  161. package/package.json +15 -15
  162. package/dist/1218.3869bad6.js +0 -2
  163. package/dist/4669.12208c6a.js +0 -2
  164. package/dist/6289.c67fe0d5.js +0 -5
  165. package/dist/7805.cadab34e.js +0 -4
  166. package/dist/8813.9da1f210.js +0 -2
  167. package/dist/cli/index.cb89dbd1.js +0 -3
  168. package/dist/node/mdx/loader.e1578c62.js +0 -13
  169. package/dist/node/ssg/renderPageWorker.474f9f73.js +0 -2
  170. package/dist/theme/components/Overview/OverviewGroup.js +0 -57
  171. /package/dist/eject-theme/components/{Overview → OverviewGroup}/icons/plugin.svg +0 -0
  172. /package/dist/theme/components/{Overview → OverviewGroup}/icons/plugin.js +0 -0
@@ -1,7 +1,8 @@
1
- import { createRequire, fileURLToPath, package_namespaceObject } from "../5485.2a0273cf.js";
2
- import { node_path } from "../6289.c67fe0d5.js";
3
- import { PLUGIN_REACT_NAME, pluginReact, pluginVirtualModule } from "../5313.6594aba0.js";
4
- import { removeTrailingSlash, MDX_OR_MD_REGEXP } from "../4669.12208c6a.js";
1
+ import { createRequire, fileURLToPath, package_namespaceObject } from "../5485.9fc7f63d.js";
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";
5
6
  import { createError } from "./utils/error.js";
6
7
  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
8
  import { hintBuilderPluginsBreakingChange, hintThemeBreakingChange } from "./logger/hint.js";
@@ -31,7 +32,7 @@ async function getVirtualModulesFromPlugins(pluginDriver) {
31
32
  return runtimeModule;
32
33
  }
33
34
  async function createInternalBuildConfig(userDocRoot, config, enableSSG, routeService, pluginDriver) {
34
- const CUSTOM_THEME_DIR = config.themeDir;
35
+ const CUSTOM_THEME_DIR = node_path.isAbsolute(config.themeDir) ? config.themeDir : node_path.join(cwd(), config.themeDir);
35
36
  const outDir = config?.outDir ?? OUTPUT_DIR;
36
37
  const base = config?.base ?? '';
37
38
  const assetPrefix = isProduction() ? removeTrailingSlash(config?.builderConfig?.output?.assetPrefix ?? base) : '';
@@ -217,7 +218,7 @@ async function createInternalBuildConfig(userDocRoot, config, enableSSG, routeSe
217
218
  return options;
218
219
  });
219
220
  chain.resolve.extensions.prepend('.md').prepend('.mdx').prepend('.mjs');
220
- chain.module.rule('css-virtual-module').test(/\.rspress[\\/]runtime[\\/]virtual-global-styles/).merge({
221
+ chain.module.rule('rspress-css-virtual-module').test(/\.rspress[\\/]runtime[\\/]virtual-global-styles/).merge({
221
222
  sideEffects: true
222
223
  });
223
224
  if (isSsg || isSsgMd) chain.optimization.splitChunks({});
@@ -244,7 +245,9 @@ async function createInternalBuildConfig(userDocRoot, config, enableSSG, routeSe
244
245
  },
245
246
  define: {
246
247
  'process.env.__SSR__': JSON.stringify(false),
247
- 'process.env.__SSR_MD__': JSON.stringify(false)
248
+ 'process.env.__SSR_MD__': JSON.stringify(false),
249
+ 'import.meta.env.SSR': JSON.stringify(false),
250
+ 'import.meta.env.SSG_MD': JSON.stringify(false)
248
251
  }
249
252
  },
250
253
  output: {
@@ -252,6 +255,14 @@ async function createInternalBuildConfig(userDocRoot, config, enableSSG, routeSe
252
255
  distPath: {
253
256
  root: outDir
254
257
  }
258
+ },
259
+ tools: {
260
+ rspack: {
261
+ node: {
262
+ __dirname: 'mock',
263
+ __filename: 'mock'
264
+ }
265
+ }
255
266
  }
256
267
  },
257
268
  ...enableSSG && config.ssg ? {
@@ -268,7 +279,9 @@ async function createInternalBuildConfig(userDocRoot, config, enableSSG, routeSe
268
279
  },
269
280
  define: {
270
281
  'process.env.__SSR__': JSON.stringify(true),
271
- 'process.env.__SSR_MD__': JSON.stringify(false)
282
+ 'process.env.__SSR_MD__': JSON.stringify(false),
283
+ 'import.meta.env.SSR': JSON.stringify(true),
284
+ 'import.meta.env.SSG_MD': JSON.stringify(false)
272
285
  }
273
286
  },
274
287
  performance: {
@@ -305,7 +318,9 @@ async function createInternalBuildConfig(userDocRoot, config, enableSSG, routeSe
305
318
  },
306
319
  define: {
307
320
  'process.env.__SSR__': JSON.stringify(true),
308
- 'process.env.__SSR_MD__': JSON.stringify(true)
321
+ 'process.env.__SSR_MD__': JSON.stringify(true),
322
+ 'import.meta.env.SSR': JSON.stringify(true),
323
+ 'import.meta.env.SSG_MD': JSON.stringify(true)
309
324
  }
310
325
  },
311
326
  performance: {
@@ -324,8 +339,7 @@ async function createInternalBuildConfig(userDocRoot, config, enableSSG, routeSe
324
339
  };
325
340
  }
326
341
  async function initRsbuild(rootDir, config, pluginDriver, routeService, enableSSG, extraRsbuildConfig) {
327
- const cwd = process.cwd();
328
- const userDocRoot = node_path.resolve(rootDir || config?.root || cwd);
342
+ const userDocRoot = node_path.resolve(rootDir || config.root);
329
343
  hintBuilderPluginsBreakingChange(config);
330
344
  const { createRsbuild, mergeRsbuildConfig } = await import("@rsbuild/core");
331
345
  const internalRsbuildConfig = await createInternalBuildConfig(userDocRoot, config, enableSSG, routeService, pluginDriver);
@@ -1,4 +1,4 @@
1
- import { execa } from "../../0~7675.989ee664.js";
1
+ import { execa } from "../../0~7675.723d12b2.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";
@@ -14,7 +14,8 @@ async function mdxLoader(source) {
14
14
  docDirectory,
15
15
  config,
16
16
  pluginDriver,
17
- routeService
17
+ routeService,
18
+ addDependency: this.addDependency
18
19
  });
19
20
  callback(null, compileResult);
20
21
  } else {
@@ -1,6 +1,6 @@
1
- import { node_path } from "../../6289.c67fe0d5.js";
2
- import { nodeTypes } from "../../7805.cadab34e.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 "../../9643.2dff683e.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";
@@ -46,7 +46,8 @@ async function createMDXOptions(options) {
46
46
  remarkLinkOptions: {
47
47
  checkDeadLinks: false,
48
48
  autoPrefix: true
49
- }
49
+ },
50
+ __base: config?.base
50
51
  } : {
51
52
  cleanUrls: false,
52
53
  root: docDirectory,
@@ -65,8 +66,10 @@ async function createMDXOptions(options) {
65
66
  globalComponents
66
67
  }
67
68
  ],
68
- ...remarkPluginsFromConfig,
69
- ...remarkPluginsFromPlugins
69
+ ...isSsgMd ? [] : [
70
+ ...remarkPluginsFromConfig,
71
+ ...remarkPluginsFromPlugins
72
+ ]
70
73
  ].filter(Boolean),
71
74
  ...isSsgMd ? {} : {
72
75
  rehypePlugins: [
@@ -1,5 +1,5 @@
1
- import { node_path } from "../../6289.c67fe0d5.js";
2
- import { createProcessor, loadFrontMatter, extractTextAndId } from "../../7805.cadab34e.js";
1
+ import { node_path } from "../../6289.29817fb4.js";
2
+ import { createProcessor, loadFrontMatter, extractTextAndId } from "../../9643.2dff683e.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 "../../../7805.cadab34e.js";
2
- import { github_slugger, headingRank } from "../loader.e1578c62.js";
3
- import { visit } from "../../../8813.9da1f210.js";
1
+ import { extractTextAndId } from "../../../9643.2dff683e.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 "../../../1218.3869bad6.js";
3
- import { visit } from "../../../8813.9da1f210.js";
1
+ import { node_path, logger, picocolors, readFile } from "../../../6289.29817fb4.js";
2
+ import { cwd } from "../../../9643.2dff683e.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,6 @@
1
- import { isExternalUrl } from "../../../4669.12208c6a.js";
2
- import { getNodeAttribute } from "../../../7805.cadab34e.js";
3
- import { visit } from "../../../8813.9da1f210.js";
1
+ import { isExternalUrl } from "../../../4669.69cb6b18.js";
2
+ import { getNodeAttribute } from "../../../9643.2dff683e.js";
3
+ import { visit } from "../../../8813.4b28f4bb.js";
4
4
  import { getDefaultImportAstNode } from "../../utils/getImportAstNode.js";
5
5
  const normalizeImageUrl = (imageUrl)=>{
6
6
  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 "../../../4669.69cb6b18.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 "../../../7805.cadab34e.js";
2
- import { github_slugger, visitChildren } from "../loader.e1578c62.js";
1
+ import { extractTextAndId } from "../../../9643.2dff683e.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 "../../5313.6594aba0.js";
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";
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,7 @@
1
- import { node_path, promises } from "../../6289.c67fe0d5.js";
2
- import { htmlToText, compile } from "../../5313.6594aba0.js";
3
- import { MDX_OR_MD_REGEXP } from "../../4669.12208c6a.js";
4
- import { loadFrontMatter } from "../../7805.cadab34e.js";
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";
5
5
  import { applyReplaceRules } from "../utils/applyReplaceRules.js";
6
6
  import { flattenMdxContent } from "../utils/flattenMdxContent.js";
7
7
  import { importStatementRegex } from "../constants.js";
@@ -109,4 +109,4 @@ async function extractPageData(routeService, options) {
109
109
  const pageData = await Promise.all(routeService.getRoutes().map((routeMeta)=>getPageIndexInfoByRoute(routeMeta, options)));
110
110
  return pageData;
111
111
  }
112
- export { extractPageData, getPageIndexInfoByRoute };
112
+ export { extractPageData };
@@ -1,5 +1,5 @@
1
- import { addTrailingSlash, addLeadingSlash } from "../../4669.12208c6a.js";
2
- import { DEFAULT_PAGE_EXTENSIONS } from "../../5313.6594aba0.js";
1
+ import { addTrailingSlash, addLeadingSlash } from "../../4669.69cb6b18.js";
2
+ import { DEFAULT_PAGE_EXTENSIONS } from "../../3521.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.2a0273cf.js";
2
- import { picocolors, join, logger } from "../../6289.c67fe0d5.js";
1
+ import { createRequire } from "../../5485.9fc7f63d.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 "../../../5313.6594aba0.js";
1
+ import { SEARCH_INDEX_NAME } from "../../../4669.69cb6b18.js";
2
+ import { groupBy } from "../../../3521.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 "../../../5313.6594aba0.js";
1
+ import { pluginVirtualModule } from "../../../3521.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 "../../../7805.cadab34e.js";
1
+ import { getIconUrlPath } from "../../../9643.2dff683e.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 "../../../4669.69cb6b18.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 "../5313.6594aba0.js";
1
+ import { mergeRsbuildConfig } from "../3521.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.2a0273cf.js";
2
- import { logger, picocolors } from "../../6289.c67fe0d5.js";
1
+ import { transformHtmlTemplate, pathToFileURL, createHead } from "../../5485.9fc7f63d.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.2a0273cf.js";
3
+ import { pMap } from "../../5485.9fc7f63d.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 "../../5313.6594aba0.js";
2
+ import { logger, picocolors } from "../../6289.29817fb4.js";
3
+ import { chunk } from "../../3521.9eb6b114.js";
4
4
  import { SSGWorkerThreadTaskSize, getNumberOfThreads, SSGWorkerThreadRecyclerMaxMemory, SSGConcurrency } from "./ssgEnv.js";
5
- import { pMap } from "../../5485.2a0273cf.js";
5
+ import { pMap } from "../../5485.9fc7f63d.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 "../../4669.69cb6b18.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 "../../7805.cadab34e.js";
2
+ import { node_os } from "../../9643.2dff683e.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 "../../../5313.6594aba0.js";
1
+ import { getSidebarDataGroup } from "../../../4669.69cb6b18.js";
2
+ import { matchPath } from "../../../3521.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,7 +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
- await Promise.all(routeService.getLangs().map(async (lang)=>{
33
+ const langs = [
34
+ ...new Set([
35
+ defaultLang,
36
+ ...routeService.getLangs()
37
+ ])
38
+ ];
39
+ await Promise.all(langs.map(async (lang)=>{
34
40
  const navList = noVersionNav.filter((i)=>i.lang === lang);
35
41
  const routeGroups = new Array(navList.length).fill(0).map(()=>[]);
36
42
  const others = [];
@@ -1,4 +1,4 @@
1
- import { normalizeHref, withBase } from "../../../4669.12208c6a.js";
1
+ import { normalizeHref, withBase } from "../../../4669.69cb6b18.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 };