@rspress/core 2.0.0-alpha.2 → 2.0.0-alpha.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.
package/dist/index.js CHANGED
@@ -955,7 +955,7 @@ async function siteDataVMPlugin(context) {
955
955
  const replaceRules = (null == userConfig ? void 0 : userConfig.replaceRules) || [];
956
956
  const searchConfig = (null == userConfig ? void 0 : userConfig.search) || {};
957
957
  const domain = (null == searchConfig ? void 0 : searchConfig.mode) === 'remote' ? searchConfig.domain ?? '' : '';
958
- const searchCodeBlocks = 'codeBlocks' in searchConfig ? Boolean(searchConfig.codeBlocks) : false;
958
+ const searchCodeBlocks = 'codeBlocks' in searchConfig ? Boolean(searchConfig.codeBlocks) : true;
959
959
  const pages = await extractPageData(replaceRules, alias, domain, userDocRoot, routeService, highlightLanguages, searchCodeBlocks);
960
960
  await pluginDriver.modifySearchIndexData(pages);
961
961
  const versioned = userConfig.search && 'remote' !== userConfig.search.mode && userConfig.search.versioned;
@@ -1553,7 +1553,7 @@ async function dev(options) {
1553
1553
  await checkLanguageParity(modifiedConfig);
1554
1554
  }
1555
1555
  }
1556
- var package_namespaceObject = JSON.parse('{"i8":"2.0.0-alpha.2"}');
1556
+ var package_namespaceObject = JSON.parse('{"i8":"2.0.0-alpha.4"}');
1557
1557
  async function renderFrontmatterHead(route) {
1558
1558
  if (!isRouteMeta(route)) return '';
1559
1559
  const content = await __WEBPACK_EXTERNAL_MODULE_node_fs_promises_153e37e0__["default"].readFile(route.absolutePath, {
@@ -1636,7 +1636,7 @@ async function renderPages(appDirectory, config, pluginDriver, ssgConfig) {
1636
1636
  routePath: '/404'
1637
1637
  });
1638
1638
  await Promise.all(allRoutes.filter((route)=>!route.routePath.includes(':')).map(async (route)=>{
1639
- const helmetContext = new __WEBPACK_EXTERNAL_MODULE_react_helmet_async_048d06c6__.HelmetData({});
1639
+ const helmetContext = new __WEBPACK_EXTERNAL_MODULE_react_helmet_async_048d06c6__["default"].HelmetData({});
1640
1640
  const { routePath } = route;
1641
1641
  let appHtml = '';
1642
1642
  if (render) try {
package/dist/loader.js CHANGED
@@ -338,12 +338,12 @@ const remarkPluginNormalizeLink = ({ root, cleanUrls })=>(tree, file)=>{
338
338
  });
339
339
  (0, __WEBPACK_EXTERNAL_MODULE_unist_util_visit_555e002a__.visit)(tree, (node)=>{
340
340
  if ('mdxJsxFlowElement' !== node.type && 'mdxJsxTextElement' !== node.type || 'img' !== node.name) return;
341
- const src = (0, __WEBPACK_EXTERNAL_MODULE__rspress_shared_node_utils_78947ce6__.getNodeAttribute)(node, 'src');
342
- if ('string' != typeof src) return;
343
- const imagePath = normalizeImageUrl(src);
341
+ const srcAttr = (0, __WEBPACK_EXTERNAL_MODULE__rspress_shared_node_utils_78947ce6__.getNodeAttribute)(node, 'src', true);
342
+ if ('string' != typeof (null == srcAttr ? void 0 : srcAttr.value)) return;
343
+ const imagePath = normalizeImageUrl(srcAttr.value);
344
344
  if (!imagePath) return;
345
345
  const tempVariableName = `image${images.length}`;
346
- Object.assign(src, getMdxSrcAttribute(tempVariableName));
346
+ Object.assign(srcAttr, getMdxSrcAttribute(tempVariableName));
347
347
  images.push(getASTNodeImport(tempVariableName, imagePath));
348
348
  });
349
349
  tree.children.unshift(...images);
@@ -427,7 +427,6 @@ async function createMDXOptions(docDirectory, config, checkDeadLinks, routeServi
427
427
  }),
428
428
  ...globalComponentsFromConfig
429
429
  ];
430
- const defaultLang = (null == config ? void 0 : config.lang) || '';
431
430
  return {
432
431
  providerImportSource: '@mdx-js/react',
433
432
  format: __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].extname(filepath).slice(1),
@@ -438,7 +437,6 @@ async function createMDXOptions(docDirectory, config, checkDeadLinks, routeServi
438
437
  remarkPluginNormalizeLink,
439
438
  {
440
439
  cleanUrls,
441
- defaultLang,
442
440
  root: docDirectory
443
441
  }
444
442
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/core",
3
- "version": "2.0.0-alpha.2",
3
+ "version": "2.0.0-alpha.4",
4
4
  "description": "The Rspress Documentation Framework",
5
5
  "bugs": "https://github.com/web-infra-dev/rspress/issues",
6
6
  "repository": {
@@ -45,7 +45,7 @@
45
45
  "@mdx-js/loader": "2.3.0",
46
46
  "@mdx-js/mdx": "2.3.0",
47
47
  "@mdx-js/react": "2.3.0",
48
- "@rsbuild/core": "1.2.16",
48
+ "@rsbuild/core": "1.2.19",
49
49
  "@rsbuild/plugin-react": "~1.1.1",
50
50
  "@rspress/mdx-rs": "0.6.6",
51
51
  "enhanced-resolve": "5.18.1",
@@ -59,7 +59,7 @@
59
59
  "picocolors": "^1.1.1",
60
60
  "react": "^18.3.1",
61
61
  "react-dom": "^18.3.1",
62
- "react-helmet-async": "^1.3.0",
62
+ "react-helmet-async": "^2.0.5",
63
63
  "react-lazy-with-preload": "^2.2.1",
64
64
  "react-syntax-highlighter": "^15.6.1",
65
65
  "rehype-external-links": "^3.0.0",
@@ -70,17 +70,17 @@
70
70
  "unified": "^10.1.2",
71
71
  "unist-util-visit": "^4.1.2",
72
72
  "unist-util-visit-children": "^2.0.2",
73
- "@rspress/plugin-auto-nav-sidebar": "2.0.0-alpha.2",
74
- "@rspress/plugin-container-syntax": "2.0.0-alpha.2",
75
- "@rspress/plugin-last-updated": "2.0.0-alpha.2",
76
- "@rspress/plugin-medium-zoom": "2.0.0-alpha.2",
77
- "@rspress/runtime": "2.0.0-alpha.2",
78
- "@rspress/theme-default": "2.0.0-alpha.2",
79
- "@rspress/shared": "2.0.0-alpha.2"
73
+ "@rspress/plugin-auto-nav-sidebar": "2.0.0-alpha.4",
74
+ "@rspress/plugin-container-syntax": "2.0.0-alpha.4",
75
+ "@rspress/plugin-last-updated": "2.0.0-alpha.4",
76
+ "@rspress/plugin-medium-zoom": "2.0.0-alpha.4",
77
+ "@rspress/runtime": "2.0.0-alpha.4",
78
+ "@rspress/theme-default": "2.0.0-alpha.4",
79
+ "@rspress/shared": "2.0.0-alpha.4"
80
80
  },
81
81
  "devDependencies": {
82
- "@microsoft/api-extractor": "^7.51.1",
83
- "@rslib/core": "0.5.3",
82
+ "@microsoft/api-extractor": "^7.52.1",
83
+ "@rslib/core": "0.5.4",
84
84
  "@rspress-dev/plugin-preview": "link:../plugin-preview",
85
85
  "@types/hast": "^2.3.10",
86
86
  "@types/html-to-text": "^9.0.4",
@@ -93,11 +93,14 @@
93
93
  "memfs": "^4.17.0",
94
94
  "postcss": "8.5.3",
95
95
  "rehype-stringify": "^9.0.4",
96
+ "remark-mdx": "2.3.0",
96
97
  "remark-parse": "^10.0.2",
97
98
  "remark-rehype": "^10.1.0",
99
+ "remark-stringify": "^10.0.3",
98
100
  "rimraf": "^6.0.1",
99
101
  "tailwindcss": "^3.4.17",
100
- "typescript": "^5.5.3",
102
+ "typescript": "^5.8.2",
103
+ "vfile": "^5.3.7",
101
104
  "@rspress/config": "1.0.0"
102
105
  },
103
106
  "engines": {