@rspress/core 2.0.0-beta.24 → 2.0.0-beta.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -6,7 +6,7 @@ import picocolors from "picocolors";
6
6
  import { build, dev, serve } from "./index.js";
7
7
  import node_fs from "node:fs";
8
8
  import { DEFAULT_CONFIG_EXTENSIONS, DEFAULT_CONFIG_NAME } from "@rspress/shared/constants";
9
- var package_namespaceObject = JSON.parse('{"i8":"2.0.0-beta.24"}');
9
+ var package_namespaceObject = JSON.parse('{"i8":"2.0.0-beta.26"}');
10
10
  const findConfig = (basePath)=>DEFAULT_CONFIG_EXTENSIONS.map((ext)=>basePath + ext).find(node_fs.existsSync);
11
11
  async function loadConfigFile(customConfigFile) {
12
12
  const baseDir = process.cwd();
package/dist/index.js CHANGED
@@ -151,7 +151,7 @@ function defineConfig(config) {
151
151
  }
152
152
  var external_node_path_ = __webpack_require__("node:path");
153
153
  var external_node_url_ = __webpack_require__("node:url");
154
- var package_namespaceObject = JSON.parse('{"i8":"2.0.0-beta.24"}');
154
+ var package_namespaceObject = JSON.parse('{"i8":"2.0.0-beta.26"}');
155
155
  const RSPRESS_VERSION = package_namespaceObject.i8;
156
156
  const isProduction = ()=>'production' === process.env.NODE_ENV;
157
157
  const importStatementRegex = /import\s+(.*?)\s+from\s+(['"])(.*?)(?:"|');?/gm;
@@ -821,6 +821,15 @@ async function walk(workDir, docsDir, extensions) {
821
821
  const metaConfig = await utils_readJson(rootMetaJson);
822
822
  hintNavJsonChangeThenPanic(metaConfig, workDir, docsDir);
823
823
  }
824
+ if (isRootMetaJsonExist && isRootNavJsonExist) {
825
+ const navConfig = await scanNav(workDir, docsDir);
826
+ return {
827
+ nav: navConfig,
828
+ sidebar: {
829
+ '/': await scanSideMeta(workDir, docsDir, extensions)
830
+ }
831
+ };
832
+ }
824
833
  if (isRootNavJsonExist) {
825
834
  const navConfig = await scanNav(workDir, docsDir);
826
835
  const subDirs = (await Promise.all((await node_fs_promises.readdir(workDir)).map((v)=>node_fs_promises.stat(external_node_path_["default"].join(workDir, v)).then((s)=>{
@@ -832,10 +841,6 @@ async function walk(workDir, docsDir, extensions) {
832
841
  const sidebarGroupKey = addRoutePrefix(workDir, docsDir, subDir);
833
842
  sidebarConfig[sidebarGroupKey] = await scanSideMeta(external_node_path_["default"].join(workDir, subDir), docsDir, extensions);
834
843
  }));
835
- if (isRootMetaJsonExist) {
836
- const rootMetaConfig = await scanSideMeta(workDir, docsDir, extensions);
837
- sidebarConfig['/'] = rootMetaConfig;
838
- }
839
844
  return {
840
845
  nav: navConfig,
841
846
  sidebar: sidebarConfig
@@ -1910,7 +1915,8 @@ const presetIcons = {
1910
1915
  lark: `<path d="M8.813 5.477c1.038.836 2.286 2.045 3.3 3.495.171.23.377.576.457.71l.034.056a8.803 8.803 0 0 0-.922 1.3l-.271-.494C9.655 7.53 6.3 5.477 6.137 5.377a.447.447 0 0 1-.006-.004l-.666-.393-.107-.086a.499.499 0 0 1 .306-.885L6.084 4h7.997c.159.006.318.037.47.092.174.064.317.174.458.308.134.143.272.296.403.448.622.675 1.324 1.688 1.324 1.688-.573.193-1.349.736-1.349.736a5.095 5.095 0 0 0-.348-.54 20.665 20.665 0 0 0-1.037-1.255H8.813Z" fill="currentColor"/>
1911
1916
  <path d="M18.482 7.507a5.42 5.42 0 0 1 4.04.717c.248.168.788.635.242 1.233-1.7 1.67-2.194 3.225-2.63 4.599-.278.873-.541 1.697-1.066 2.424-1.813 2.508-4.114 4-6.837 4.434-.561.089-1.132.131-1.7.131-3.958 0-7.498-2.035-8.75-2.844h.003l-.161-.107c-.534-.378-.61-.723-.623-.989V7.055a.486.486 0 0 1 .827-.317l.482.589c5.082 6.201 9.126 8.063 11.626 8.53 2.246.424 3.631-.165 4.022-.37.333-.51.534-1.143.764-1.865l.006-.021c.406-1.276.898-2.821 2.322-4.477a3.93 3.93 0 0 0-2.28-.168c-1.761.394-3.403 1.96-4.89 4.643a8.27 8.27 0 0 0-.341.671c-.724-.107-1.334-.65-1.334-.65.128-.269.22-.455.345-.672 1.718-3.125 3.714-4.962 5.933-5.441ZM2.477 16.889c1.145.744 5.341 3.232 9.532 2.563 1.56-.247 2.963-.915 4.196-1.99-2.771.254-7.557-.753-13.728-7.666v7.093Z" fill="currentColor"/>`,
1912
1917
  x: '<path fill="currentColor" d="M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584l-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z"/>',
1913
- bluesky: '<path fill="currentColor" d="M12 10.8c-1.087-2.114-4.046-6.053-6.798-7.995C2.566.944 1.561 1.266.902 1.565C.139 1.908 0 3.08 0 3.768c0 .69.378 5.65.624 6.479c.815 2.736 3.713 3.66 6.383 3.364q.204-.03.415-.056q-.207.033-.415.056c-3.912.58-7.387 2.005-2.83 7.078c5.013 5.19 6.87-1.113 7.823-4.308c.953 3.195 2.05 9.271 7.733 4.308c4.267-4.308 1.172-6.498-2.74-7.078a9 9 0 0 1-.415-.056q.21.026.415.056c2.67.297 5.568-.628 6.383-3.364c.246-.828.624-5.79.624-6.478c0-.69-.139-1.861-.902-2.206c-.659-.298-1.664-.62-4.3 1.24C16.046 4.748 13.087 8.687 12 10.8"/>'
1918
+ bluesky: '<path fill="currentColor" d="M12 10.8c-1.087-2.114-4.046-6.053-6.798-7.995C2.566.944 1.561 1.266.902 1.565C.139 1.908 0 3.08 0 3.768c0 .69.378 5.65.624 6.479c.815 2.736 3.713 3.66 6.383 3.364q.204-.03.415-.056q-.207.033-.415.056c-3.912.58-7.387 2.005-2.83 7.078c5.013 5.19 6.87-1.113 7.823-4.308c.953 3.195 2.05 9.271 7.733 4.308c4.267-4.308 1.172-6.498-2.74-7.078a9 9 0 0 1-.415-.056q.21.026.415.056c2.67.297 5.568-.628 6.383-3.364c.246-.828.624-5.79.624-6.478c0-.69-.139-1.861-.902-2.206c-.659-.298-1.664-.62-4.3 1.24C16.046 4.748 13.087 8.687 12 10.8"/>',
1919
+ npm: '<path fill="currentColor" d="M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0zM5.13 5.323l13.837.019l-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113z"/>'
1914
1920
  };
1915
1921
  const formatIconName = (icon)=>icon.toLowerCase();
1916
1922
  function getSocialIcons(socialLinks = []) {
package/dist/processor.js CHANGED
@@ -754,10 +754,9 @@ async function compile(options) {
754
754
  headingTitle,
755
755
  frontmatter
756
756
  };
757
- const result = `const frontmatter = ${JSON.stringify(frontmatter)};
758
- ${compileResult}
759
- MDXContent.__RSPRESS_PAGE_META = {};
757
+ const result = `${compileResult}
760
758
 
759
+ MDXContent.__RSPRESS_PAGE_META = {};
761
760
  MDXContent.__RSPRESS_PAGE_META["${encodeURIComponent(normalizePath(node_path.relative(docDirectory, filepath)))}"] = ${JSON.stringify(pageMeta)};
762
761
  `;
763
762
  return result;
@@ -102,7 +102,7 @@ function hintSSGFailed() {
102
102
  1. Fix code to make it SSR-compatible.
103
103
  2. Set \`ssg: false\` if the code in node_modules may be difficult to fix, but the SSG feature will be lost.`);
104
104
  }
105
- var package_namespaceObject = JSON.parse('{"i8":"2.0.0-beta.24"}');
105
+ var package_namespaceObject = JSON.parse('{"i8":"2.0.0-beta.26"}');
106
106
  const RSPRESS_VERSION = package_namespaceObject.i8;
107
107
  `{
108
108
  const saved = localStorage.getItem('${APPEARANCE_KEY}')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/core",
3
- "version": "2.0.0-beta.24",
3
+ "version": "2.0.0-beta.26",
4
4
  "description": "The Rspress Documentation Framework",
5
5
  "bugs": "https://github.com/web-infra-dev/rspress/issues",
6
6
  "repository": {
@@ -54,15 +54,15 @@
54
54
  "@mdx-js/loader": "^3.1.0",
55
55
  "@mdx-js/mdx": "^3.1.0",
56
56
  "@mdx-js/react": "^3.1.0",
57
- "@rsbuild/core": "~1.4.12",
58
- "@rsbuild/plugin-react": "~1.3.4",
57
+ "@rsbuild/core": "~1.4.15",
58
+ "@rsbuild/plugin-react": "~1.3.5",
59
59
  "@rspress/mdx-rs": "0.6.6",
60
- "@shikijs/rehype": "^3.8.1",
60
+ "@shikijs/rehype": "^3.9.2",
61
61
  "@types/unist": "^3.0.3",
62
- "@unhead/react": "^2.0.12",
62
+ "@unhead/react": "^2.0.14",
63
63
  "cac": "^6.7.14",
64
64
  "chokidar": "^3.6.0",
65
- "enhanced-resolve": "5.18.2",
65
+ "enhanced-resolve": "5.18.3",
66
66
  "github-slugger": "^2.0.0",
67
67
  "hast-util-from-html": "^2.0.3",
68
68
  "hast-util-heading-rank": "^3.0.0",
@@ -71,40 +71,40 @@
71
71
  "mdast-util-mdxjs-esm": "^2.0.1",
72
72
  "medium-zoom": "1.1.0",
73
73
  "picocolors": "^1.1.1",
74
- "react": "^19.1.0",
75
- "react-dom": "^19.1.0",
74
+ "react": "^19.1.1",
75
+ "react-dom": "^19.1.1",
76
76
  "react-lazy-with-preload": "^2.2.1",
77
- "react-router-dom": "^6.29.0",
77
+ "react-router-dom": "^6.30.1",
78
78
  "rehype-external-links": "^3.0.0",
79
79
  "rehype-raw": "^7.0.0",
80
80
  "remark": "^15.0.1",
81
81
  "remark-gfm": "^4.0.1",
82
82
  "rspack-plugin-virtual-module": "1.0.1",
83
- "shiki": "^3.8.1",
83
+ "shiki": "^3.9.2",
84
84
  "tinyglobby": "^0.2.14",
85
85
  "tinypool": "^1.1.1",
86
86
  "unified": "^11.0.5",
87
87
  "unist-util-visit": "^5.0.0",
88
88
  "unist-util-visit-children": "^3.0.0",
89
- "@rspress/shared": "2.0.0-beta.24",
90
- "@rspress/runtime": "2.0.0-beta.24",
91
- "@rspress/theme-default": "2.0.0-beta.24"
89
+ "@rspress/runtime": "2.0.0-beta.26",
90
+ "@rspress/shared": "2.0.0-beta.26",
91
+ "@rspress/theme-default": "2.0.0-beta.26"
92
92
  },
93
93
  "devDependencies": {
94
- "@microsoft/api-extractor": "^7.52.9",
95
- "@rslib/core": "0.11.0",
94
+ "@microsoft/api-extractor": "^7.52.10",
95
+ "@rslib/core": "0.11.2",
96
96
  "@types/hast": "^3.0.4",
97
97
  "@types/html-to-text": "^9.0.4",
98
98
  "@types/jest": "~29.5.14",
99
99
  "@types/lodash-es": "^4.17.12",
100
100
  "@types/mdast": "^4.0.4",
101
101
  "@types/node": "^22.8.1",
102
- "@types/react": "^19.1.8",
103
- "@types/react-dom": "^19.1.6",
102
+ "@types/react": "^19.1.9",
103
+ "@types/react-dom": "^19.1.7",
104
104
  "execa": "8.0.1",
105
105
  "mdast-util-directive": "^3.1.0",
106
106
  "mdast-util-mdx-expression": "^2.0.1",
107
- "memfs": "^4.17.2",
107
+ "memfs": "^4.36.0",
108
108
  "p-map": "^7.0.3",
109
109
  "postcss": "8.5.6",
110
110
  "rehype-stringify": "^10.0.1",
@@ -114,8 +114,8 @@
114
114
  "remark-rehype": "^11.1.2",
115
115
  "remark-stringify": "^11.0.0",
116
116
  "rimraf": "^6.0.1",
117
- "rsbuild-plugin-publint": "^0.3.2",
118
- "rsbuild-plugin-virtual-module": "0.3.0",
117
+ "rsbuild-plugin-publint": "^0.3.3",
118
+ "rsbuild-plugin-virtual-module": "0.3.1",
119
119
  "tailwindcss": "^3.4.17",
120
120
  "ts-json-schema-generator": "^2.4.0",
121
121
  "typescript": "^5.8.2",
@@ -127,7 +127,6 @@
127
127
  },
128
128
  "publishConfig": {
129
129
  "access": "public",
130
- "provenance": true,
131
130
  "registry": "https://registry.npmjs.org/"
132
131
  },
133
132
  "scripts": {