@rspress/shared 1.43.11 → 2.0.0-alpha-canary-202504162001

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/constants.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var __webpack_require__ = {};
3
3
  (()=>{
4
- __webpack_require__.d = function(exports1, definition) {
4
+ __webpack_require__.d = (exports1, definition)=>{
5
5
  for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
6
  enumerable: true,
7
7
  get: definition[key]
@@ -9,12 +9,10 @@ var __webpack_require__ = {};
9
9
  };
10
10
  })();
11
11
  (()=>{
12
- __webpack_require__.o = function(obj, prop) {
13
- return Object.prototype.hasOwnProperty.call(obj, prop);
14
- };
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
15
13
  })();
16
14
  (()=>{
17
- __webpack_require__.r = function(exports1) {
15
+ __webpack_require__.r = (exports1)=>{
18
16
  if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
19
17
  value: 'Module'
20
18
  });
@@ -47,8 +45,14 @@ const DEFAULT_PAGE_EXTENSIONS = [
47
45
  '.md',
48
46
  '.mdx'
49
47
  ];
50
- var __webpack_export_target__ = exports;
51
- for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
52
- if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
48
+ exports.DEFAULT_CONFIG_EXTENSIONS = __webpack_exports__.DEFAULT_CONFIG_EXTENSIONS;
49
+ exports.DEFAULT_CONFIG_NAME = __webpack_exports__.DEFAULT_CONFIG_NAME;
50
+ exports.DEFAULT_PAGE_EXTENSIONS = __webpack_exports__.DEFAULT_PAGE_EXTENSIONS;
51
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
52
+ "DEFAULT_CONFIG_EXTENSIONS",
53
+ "DEFAULT_CONFIG_NAME",
54
+ "DEFAULT_PAGE_EXTENSIONS"
55
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
56
+ Object.defineProperty(exports, '__esModule', {
53
57
  value: true
54
58
  });
package/dist/index.d.ts CHANGED
@@ -361,6 +361,13 @@ export declare interface MarkdownOptions {
361
361
  experimentalMdxRs?: boolean;
362
362
  }
363
363
 
364
+ /**
365
+ * match the sidebar key in user config
366
+ * @param pattern /zh/guide
367
+ * @param currentPathname /base/zh/guide/getting-started
368
+ */
369
+ export declare const matchSidebar: (pattern: string, currentPathname: string, base: string) => boolean;
370
+
364
371
  export declare const MDX_OR_MD_REGEXP: RegExp;
365
372
 
366
373
  export declare interface MdxRsOptions {
@@ -450,6 +457,7 @@ export declare interface PageIndexInfo {
450
457
  routePath: string;
451
458
  toc: Header[];
452
459
  content: string;
460
+ flattenContent?: string;
453
461
  _html: string;
454
462
  frontmatter: FrontMatterMeta;
455
463
  lang: string;
@@ -625,6 +633,10 @@ declare interface RspressPlugin {
625
633
  * Callback after route generated
626
634
  */
627
635
  routeGenerated?: (routes: RouteMeta[], isProd: boolean) => Promise<void> | void;
636
+ /**
637
+ * Callback after routeService generated
638
+ */
639
+ routeServiceGenerated?: (routeService: any, isProd: boolean) => Promise<void> | void;
628
640
  /**
629
641
  * Add addition ssg routes, for dynamic routes.
630
642
  */
@@ -737,10 +749,6 @@ export declare type SocialLinkIcon = 'lark' | 'discord' | 'facebook' | 'github'
737
749
  svg: string;
738
750
  };
739
751
 
740
- export declare type SSGConfig = boolean | {
741
- strict?: boolean;
742
- };
743
-
744
752
  export declare interface UserConfig<ThemeConfig = DefaultThemeConfig> {
745
753
  /**
746
754
  * The root directory of the site.
@@ -841,7 +849,7 @@ export declare interface UserConfig<ThemeConfig = DefaultThemeConfig> {
841
849
  /**
842
850
  * Whether to enable ssg, default is true
843
851
  */
844
- ssg?: SSGConfig;
852
+ ssg?: boolean;
845
853
  /**
846
854
  * Whether to enable medium-zoom, default is true
847
855
  */
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var __webpack_require__ = {};
3
3
  (()=>{
4
- __webpack_require__.d = function(exports1, definition) {
4
+ __webpack_require__.d = (exports1, definition)=>{
5
5
  for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
6
  enumerable: true,
7
7
  get: definition[key]
@@ -9,12 +9,10 @@ var __webpack_require__ = {};
9
9
  };
10
10
  })();
11
11
  (()=>{
12
- __webpack_require__.o = function(obj, prop) {
13
- return Object.prototype.hasOwnProperty.call(obj, prop);
14
- };
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
15
13
  })();
16
14
  (()=>{
17
- __webpack_require__.r = function(exports1) {
15
+ __webpack_require__.r = (exports1)=>{
18
16
  if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
19
17
  value: 'Module'
20
18
  });
@@ -26,37 +24,38 @@ var __webpack_require__ = {};
26
24
  var __webpack_exports__ = {};
27
25
  __webpack_require__.r(__webpack_exports__);
28
26
  __webpack_require__.d(__webpack_exports__, {
29
- SEARCH_INDEX_NAME: ()=>SEARCH_INDEX_NAME,
30
27
  RSPRESS_TEMP_DIR: ()=>RSPRESS_TEMP_DIR,
31
- QUERY_REGEXP: ()=>QUERY_REGEXP,
32
- isDebugMode: ()=>isDebugMode,
33
- addTrailingSlash: ()=>addTrailingSlash,
28
+ parseUrl: ()=>parseUrl,
29
+ withBase: ()=>withBase,
34
30
  slash: ()=>slash,
31
+ removeBase: ()=>removeBase,
32
+ replaceLang: ()=>replaceLang,
35
33
  removeLeadingSlash: ()=>removeLeadingSlash,
36
- withoutBase: ()=>withoutBase,
34
+ addLeadingSlash: ()=>addLeadingSlash,
37
35
  replaceVersion: ()=>replaceVersion,
36
+ isDevDebugMode: ()=>isDevDebugMode,
38
37
  HASH_REGEXP: ()=>HASH_REGEXP,
39
- isSCM: ()=>isSCM,
38
+ withoutLang: ()=>withoutLang,
40
39
  MDX_OR_MD_REGEXP: ()=>MDX_OR_MD_REGEXP,
41
- normalizeHref: ()=>normalizeHref,
40
+ SEARCH_INDEX_NAME: ()=>SEARCH_INDEX_NAME,
41
+ withoutBase: ()=>withoutBase,
42
+ isDebugMode: ()=>isDebugMode,
43
+ isExternalUrl: ()=>isExternalUrl,
44
+ isSCM: ()=>isSCM,
45
+ matchSidebar: ()=>matchSidebar,
46
+ addTrailingSlash: ()=>addTrailingSlash,
42
47
  normalizeSlash: ()=>normalizeSlash,
48
+ APPEARANCE_KEY: ()=>APPEARANCE_KEY,
49
+ normalizeHref: ()=>normalizeHref,
43
50
  normalizePosixPath: ()=>normalizePosixPath,
44
- inBrowser: ()=>inBrowser,
45
- isDataUrl: ()=>isDataUrl,
46
- replaceLang: ()=>replaceLang,
47
51
  removeHash: ()=>removeHash,
48
- cleanUrl: ()=>runtime_utils_cleanUrl,
49
- withBase: ()=>withBase,
50
- isDevDebugMode: ()=>isDevDebugMode,
51
52
  removeTrailingSlash: ()=>removeTrailingSlash,
52
- APPEARANCE_KEY: ()=>APPEARANCE_KEY,
53
- isExternalUrl: ()=>isExternalUrl,
54
- removeBase: ()=>removeBase,
55
- DEFAULT_HIGHLIGHT_LANGUAGES: ()=>DEFAULT_HIGHLIGHT_LANGUAGES,
56
- parseUrl: ()=>parseUrl,
57
- withoutLang: ()=>withoutLang,
53
+ QUERY_REGEXP: ()=>QUERY_REGEXP,
58
54
  isProduction: ()=>isProduction,
59
- addLeadingSlash: ()=>addLeadingSlash
55
+ DEFAULT_HIGHLIGHT_LANGUAGES: ()=>DEFAULT_HIGHLIGHT_LANGUAGES,
56
+ inBrowser: ()=>inBrowser,
57
+ isDataUrl: ()=>isDataUrl,
58
+ cleanUrl: ()=>utils_cleanUrl
60
59
  });
61
60
  const QUERY_REGEXP = /\?.*$/s;
62
61
  const HASH_REGEXP = /#.*$/s;
@@ -102,7 +101,7 @@ const isDebugMode = ()=>{
102
101
  ].some((key)=>values.includes(key));
103
102
  };
104
103
  const isDevDebugMode = ()=>'rspress-dev' === process.env.DEBUG;
105
- const runtime_utils_cleanUrl = (url)=>url.replace(HASH_REGEXP, '').replace(QUERY_REGEXP, '');
104
+ const utils_cleanUrl = (url)=>url.replace(HASH_REGEXP, '').replace(QUERY_REGEXP, '');
106
105
  function slash(str) {
107
106
  return str.replace(/\\/g, '/');
108
107
  }
@@ -192,13 +191,13 @@ const parseUrl = (url)=>{
192
191
  function normalizeHref(url, cleanUrls = false) {
193
192
  if (!url) return '/';
194
193
  if (isExternalUrl(url)) return url;
194
+ if (url.startsWith('#')) return url;
195
195
  let { url: cleanUrl, hash } = parseUrl(decodeURIComponent(url));
196
- if (!cleanUrls && !cleanUrl.endsWith('.html')) {
197
- if (cleanUrl.endsWith('/')) cleanUrl += 'index.html';
198
- else cleanUrl += '.html';
199
- }
200
- if (cleanUrls && cleanUrl.endsWith('/')) cleanUrl += 'index';
201
- if (cleanUrls && cleanUrl.endsWith('.html')) cleanUrl = cleanUrl.replace(/\.html$/, '');
196
+ if (cleanUrls) {
197
+ if (cleanUrl.endsWith('.html')) cleanUrl = cleanUrl.replace(/\.html$/, '');
198
+ if (cleanUrls && cleanUrl.endsWith('/index')) cleanUrl = cleanUrl.replace(/\/index$/, '/');
199
+ } else if (!cleanUrl.endsWith('.html')) if (cleanUrl.endsWith('/')) cleanUrl += 'index.html';
200
+ else cleanUrl += '.html';
202
201
  return addLeadingSlash(hash ? `${cleanUrl}#${hash}` : cleanUrl);
203
202
  }
204
203
  function withoutLang(path, langs) {
@@ -216,8 +215,80 @@ function withBase(url, base) {
216
215
  function removeBase(url, base) {
217
216
  return addLeadingSlash(url).replace(new RegExp(`^${normalizeSlash(base)}`), '');
218
217
  }
219
- var __webpack_export_target__ = exports;
220
- for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
221
- if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
218
+ const matchSidebar = (pattern, currentPathname, base)=>{
219
+ const prefix = withBase(pattern, base);
220
+ if (prefix === currentPathname) return true;
221
+ const prefixWithTrailingSlash = addTrailingSlash(prefix);
222
+ if (currentPathname.startsWith(prefixWithTrailingSlash)) return true;
223
+ const prefixWithDot = `${prefix}.`;
224
+ return currentPathname.startsWith(prefixWithDot);
225
+ };
226
+ exports.APPEARANCE_KEY = __webpack_exports__.APPEARANCE_KEY;
227
+ exports.DEFAULT_HIGHLIGHT_LANGUAGES = __webpack_exports__.DEFAULT_HIGHLIGHT_LANGUAGES;
228
+ exports.HASH_REGEXP = __webpack_exports__.HASH_REGEXP;
229
+ exports.MDX_OR_MD_REGEXP = __webpack_exports__.MDX_OR_MD_REGEXP;
230
+ exports.QUERY_REGEXP = __webpack_exports__.QUERY_REGEXP;
231
+ exports.RSPRESS_TEMP_DIR = __webpack_exports__.RSPRESS_TEMP_DIR;
232
+ exports.SEARCH_INDEX_NAME = __webpack_exports__.SEARCH_INDEX_NAME;
233
+ exports.addLeadingSlash = __webpack_exports__.addLeadingSlash;
234
+ exports.addTrailingSlash = __webpack_exports__.addTrailingSlash;
235
+ exports.cleanUrl = __webpack_exports__.cleanUrl;
236
+ exports.inBrowser = __webpack_exports__.inBrowser;
237
+ exports.isDataUrl = __webpack_exports__.isDataUrl;
238
+ exports.isDebugMode = __webpack_exports__.isDebugMode;
239
+ exports.isDevDebugMode = __webpack_exports__.isDevDebugMode;
240
+ exports.isExternalUrl = __webpack_exports__.isExternalUrl;
241
+ exports.isProduction = __webpack_exports__.isProduction;
242
+ exports.isSCM = __webpack_exports__.isSCM;
243
+ exports.matchSidebar = __webpack_exports__.matchSidebar;
244
+ exports.normalizeHref = __webpack_exports__.normalizeHref;
245
+ exports.normalizePosixPath = __webpack_exports__.normalizePosixPath;
246
+ exports.normalizeSlash = __webpack_exports__.normalizeSlash;
247
+ exports.parseUrl = __webpack_exports__.parseUrl;
248
+ exports.removeBase = __webpack_exports__.removeBase;
249
+ exports.removeHash = __webpack_exports__.removeHash;
250
+ exports.removeLeadingSlash = __webpack_exports__.removeLeadingSlash;
251
+ exports.removeTrailingSlash = __webpack_exports__.removeTrailingSlash;
252
+ exports.replaceLang = __webpack_exports__.replaceLang;
253
+ exports.replaceVersion = __webpack_exports__.replaceVersion;
254
+ exports.slash = __webpack_exports__.slash;
255
+ exports.withBase = __webpack_exports__.withBase;
256
+ exports.withoutBase = __webpack_exports__.withoutBase;
257
+ exports.withoutLang = __webpack_exports__.withoutLang;
258
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
259
+ "APPEARANCE_KEY",
260
+ "DEFAULT_HIGHLIGHT_LANGUAGES",
261
+ "HASH_REGEXP",
262
+ "MDX_OR_MD_REGEXP",
263
+ "QUERY_REGEXP",
264
+ "RSPRESS_TEMP_DIR",
265
+ "SEARCH_INDEX_NAME",
266
+ "addLeadingSlash",
267
+ "addTrailingSlash",
268
+ "cleanUrl",
269
+ "inBrowser",
270
+ "isDataUrl",
271
+ "isDebugMode",
272
+ "isDevDebugMode",
273
+ "isExternalUrl",
274
+ "isProduction",
275
+ "isSCM",
276
+ "matchSidebar",
277
+ "normalizeHref",
278
+ "normalizePosixPath",
279
+ "normalizeSlash",
280
+ "parseUrl",
281
+ "removeBase",
282
+ "removeHash",
283
+ "removeLeadingSlash",
284
+ "removeTrailingSlash",
285
+ "replaceLang",
286
+ "replaceVersion",
287
+ "slash",
288
+ "withBase",
289
+ "withoutBase",
290
+ "withoutLang"
291
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
292
+ Object.defineProperty(exports, '__esModule', {
222
293
  value: true
223
294
  });
package/dist/index.mjs CHANGED
@@ -42,7 +42,7 @@ const isDebugMode = ()=>{
42
42
  ].some((key)=>values.includes(key));
43
43
  };
44
44
  const isDevDebugMode = ()=>'rspress-dev' === process.env.DEBUG;
45
- const runtime_utils_cleanUrl = (url)=>url.replace(HASH_REGEXP, '').replace(QUERY_REGEXP, '');
45
+ const utils_cleanUrl = (url)=>url.replace(HASH_REGEXP, '').replace(QUERY_REGEXP, '');
46
46
  function slash(str) {
47
47
  return str.replace(/\\/g, '/');
48
48
  }
@@ -132,13 +132,13 @@ const parseUrl = (url)=>{
132
132
  function normalizeHref(url, cleanUrls = false) {
133
133
  if (!url) return '/';
134
134
  if (isExternalUrl(url)) return url;
135
+ if (url.startsWith('#')) return url;
135
136
  let { url: cleanUrl, hash } = parseUrl(decodeURIComponent(url));
136
- if (!cleanUrls && !cleanUrl.endsWith('.html')) {
137
- if (cleanUrl.endsWith('/')) cleanUrl += 'index.html';
138
- else cleanUrl += '.html';
139
- }
140
- if (cleanUrls && cleanUrl.endsWith('/')) cleanUrl += 'index';
141
- if (cleanUrls && cleanUrl.endsWith('.html')) cleanUrl = cleanUrl.replace(/\.html$/, '');
137
+ if (cleanUrls) {
138
+ if (cleanUrl.endsWith('.html')) cleanUrl = cleanUrl.replace(/\.html$/, '');
139
+ if (cleanUrls && cleanUrl.endsWith('/index')) cleanUrl = cleanUrl.replace(/\/index$/, '/');
140
+ } else if (!cleanUrl.endsWith('.html')) if (cleanUrl.endsWith('/')) cleanUrl += 'index.html';
141
+ else cleanUrl += '.html';
142
142
  return addLeadingSlash(hash ? `${cleanUrl}#${hash}` : cleanUrl);
143
143
  }
144
144
  function withoutLang(path, langs) {
@@ -156,4 +156,12 @@ function withBase(url, base) {
156
156
  function removeBase(url, base) {
157
157
  return addLeadingSlash(url).replace(new RegExp(`^${normalizeSlash(base)}`), '');
158
158
  }
159
- export { APPEARANCE_KEY, DEFAULT_HIGHLIGHT_LANGUAGES, HASH_REGEXP, MDX_OR_MD_REGEXP, QUERY_REGEXP, RSPRESS_TEMP_DIR, SEARCH_INDEX_NAME, addLeadingSlash, addTrailingSlash, runtime_utils_cleanUrl as cleanUrl, inBrowser, isDataUrl, isDebugMode, isDevDebugMode, isExternalUrl, isProduction, isSCM, normalizeHref, normalizePosixPath, normalizeSlash, parseUrl, removeBase, removeHash, removeLeadingSlash, removeTrailingSlash, replaceLang, replaceVersion, slash, withBase, withoutBase, withoutLang };
159
+ const matchSidebar = (pattern, currentPathname, base)=>{
160
+ const prefix = withBase(pattern, base);
161
+ if (prefix === currentPathname) return true;
162
+ const prefixWithTrailingSlash = addTrailingSlash(prefix);
163
+ if (currentPathname.startsWith(prefixWithTrailingSlash)) return true;
164
+ const prefixWithDot = `${prefix}.`;
165
+ return currentPathname.startsWith(prefixWithDot);
166
+ };
167
+ export { APPEARANCE_KEY, DEFAULT_HIGHLIGHT_LANGUAGES, HASH_REGEXP, MDX_OR_MD_REGEXP, QUERY_REGEXP, RSPRESS_TEMP_DIR, SEARCH_INDEX_NAME, addLeadingSlash, addTrailingSlash, utils_cleanUrl as cleanUrl, inBrowser, isDataUrl, isDebugMode, isDevDebugMode, isExternalUrl, isProduction, isSCM, matchSidebar, normalizeHref, normalizePosixPath, normalizeSlash, parseUrl, removeBase, removeHash, removeLeadingSlash, removeTrailingSlash, replaceLang, replaceVersion, slash, withBase, withoutBase, withoutLang };
package/dist/logger.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  var __webpack_require__ = {};
3
3
  (()=>{
4
- __webpack_require__.d = function(exports1, definition) {
4
+ __webpack_require__.d = (exports1, definition)=>{
5
5
  for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
6
  enumerable: true,
7
7
  get: definition[key]
@@ -9,12 +9,10 @@ var __webpack_require__ = {};
9
9
  };
10
10
  })();
11
11
  (()=>{
12
- __webpack_require__.o = function(obj, prop) {
13
- return Object.prototype.hasOwnProperty.call(obj, prop);
14
- };
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
15
13
  })();
16
14
  (()=>{
17
- __webpack_require__.r = function(exports1) {
15
+ __webpack_require__.r = (exports1)=>{
18
16
  if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
19
17
  value: 'Module'
20
18
  });
@@ -29,8 +27,10 @@ __webpack_require__.d(__webpack_exports__, {
29
27
  logger: ()=>core_namespaceObject.logger
30
28
  });
31
29
  const core_namespaceObject = require("@rsbuild/core");
32
- var __webpack_export_target__ = exports;
33
- for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
34
- if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
30
+ exports.logger = __webpack_exports__.logger;
31
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
32
+ "logger"
33
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
34
+ Object.defineProperty(exports, '__esModule', {
35
35
  value: true
36
36
  });
@@ -381,6 +381,7 @@ declare interface PageIndexInfo {
381
381
  routePath: string;
382
382
  toc: Header[];
383
383
  content: string;
384
+ flattenContent?: string;
384
385
  _html: string;
385
386
  frontmatter: FrontMatterMeta;
386
387
  lang: string;
@@ -496,6 +497,10 @@ declare interface RspressPlugin {
496
497
  * Callback after route generated
497
498
  */
498
499
  routeGenerated?: (routes: RouteMeta[], isProd: boolean) => Promise<void> | void;
500
+ /**
501
+ * Callback after routeService generated
502
+ */
503
+ routeServiceGenerated?: (routeService: any, isProd: boolean) => Promise<void> | void;
499
504
  /**
500
505
  * Add addition ssg routes, for dynamic routes.
501
506
  */
@@ -570,10 +575,6 @@ declare type SocialLinkIcon = 'lark' | 'discord' | 'facebook' | 'github' | 'inst
570
575
  svg: string;
571
576
  };
572
577
 
573
- declare type SSGConfig = boolean | {
574
- strict?: boolean;
575
- };
576
-
577
578
  declare interface UserConfig<ThemeConfig = Config> {
578
579
  /**
579
580
  * The root directory of the site.
@@ -674,7 +675,7 @@ declare interface UserConfig<ThemeConfig = Config> {
674
675
  /**
675
676
  * Whether to enable ssg, default is true
676
677
  */
677
- ssg?: SSGConfig;
678
+ ssg?: boolean;
678
679
  /**
679
680
  * Whether to enable medium-zoom, default is true
680
681
  */
@@ -15,12 +15,8 @@ function __webpack_require__(moduleId) {
15
15
  return module.exports;
16
16
  }
17
17
  (()=>{
18
- __webpack_require__.n = function(module) {
19
- var getter = module && module.__esModule ? function() {
20
- return module['default'];
21
- } : function() {
22
- return module;
23
- };
18
+ __webpack_require__.n = (module)=>{
19
+ var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
24
20
  __webpack_require__.d(getter, {
25
21
  a: getter
26
22
  });
@@ -28,7 +24,7 @@ function __webpack_require__(moduleId) {
28
24
  };
29
25
  })();
30
26
  (()=>{
31
- __webpack_require__.d = function(exports1, definition) {
27
+ __webpack_require__.d = (exports1, definition)=>{
32
28
  for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
33
29
  enumerable: true,
34
30
  get: definition[key]
@@ -36,12 +32,10 @@ function __webpack_require__(moduleId) {
36
32
  };
37
33
  })();
38
34
  (()=>{
39
- __webpack_require__.o = function(obj, prop) {
40
- return Object.prototype.hasOwnProperty.call(obj, prop);
41
- };
35
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
42
36
  })();
43
37
  (()=>{
44
- __webpack_require__.r = function(exports1) {
38
+ __webpack_require__.r = (exports1)=>{
45
39
  if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
46
40
  value: 'Module'
47
41
  });
@@ -56,8 +50,8 @@ var __webpack_exports__ = {};
56
50
  __webpack_require__.d(__webpack_exports__, {
57
51
  extractTextAndId: ()=>extractTextAndId,
58
52
  loadFrontMatter: ()=>loadFrontMatter,
59
- getNodeAttribute: ()=>getNodeAttribute,
60
- mergeDocConfig: ()=>mergeDocConfig
53
+ mergeDocConfig: ()=>mergeDocConfig,
54
+ getNodeAttribute: ()=>getNodeAttribute
61
55
  });
62
56
  const extractTextAndId = (title)=>{
63
57
  if (!title) return [
@@ -114,8 +108,16 @@ var __webpack_exports__ = {};
114
108
  });
115
109
  };
116
110
  })();
117
- var __webpack_export_target__ = exports;
118
- for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
119
- if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
111
+ exports.extractTextAndId = __webpack_exports__.extractTextAndId;
112
+ exports.getNodeAttribute = __webpack_exports__.getNodeAttribute;
113
+ exports.loadFrontMatter = __webpack_exports__.loadFrontMatter;
114
+ exports.mergeDocConfig = __webpack_exports__.mergeDocConfig;
115
+ for(var __webpack_i__ in __webpack_exports__)if (-1 === [
116
+ "extractTextAndId",
117
+ "getNodeAttribute",
118
+ "loadFrontMatter",
119
+ "mergeDocConfig"
120
+ ].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
121
+ Object.defineProperty(exports, '__esModule', {
120
122
  value: true
121
123
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/shared",
3
- "version": "1.43.11",
3
+ "version": "2.0.0-alpha-canary-202504162001",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/web-infra-dev/rspress",
@@ -36,22 +36,21 @@
36
36
  "dist"
37
37
  ],
38
38
  "dependencies": {
39
- "@rsbuild/core": "1.2.3",
39
+ "@rsbuild/core": "1.3.6",
40
40
  "gray-matter": "4.0.3",
41
41
  "lodash-es": "^4.17.21",
42
- "unified": "^10.1.2"
42
+ "unified": "^11.0.5"
43
43
  },
44
44
  "devDependencies": {
45
- "@rslib/core": "0.5.2",
46
- "@types/fs-extra": "11.0.4",
45
+ "@rslib/core": "0.6.3",
47
46
  "@types/jest": "~29.5.14",
48
47
  "@types/lodash-es": "^4.17.12",
49
48
  "@types/node": "^18.11.17",
50
- "@types/react": "^18.3.18",
51
- "mdast-util-mdx-jsx": "^2.1.4",
49
+ "@types/react": "^18.3.20",
50
+ "mdast-util-mdx-jsx": "^3.2.0",
52
51
  "medium-zoom": "1.1.0",
53
- "rimraf": "^3.0.2",
54
- "typescript": "^5.5.3"
52
+ "rimraf": "^6.0.1",
53
+ "typescript": "^5.8.2"
55
54
  },
56
55
  "publishConfig": {
57
56
  "access": "public",