@rspress/shared 2.0.0-beta.22 → 2.0.0-beta.23

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.d.ts CHANGED
@@ -337,11 +337,7 @@ export declare type LocalSearchOptions = SearchHooks & {
337
337
  export declare interface MarkdownOptions {
338
338
  remarkPlugins?: PluggableList;
339
339
  rehypePlugins?: PluggableList;
340
- /**
341
- * Whether to enable check dead links
342
- * @default false
343
- */
344
- checkDeadLinks?: boolean;
340
+ link?: RemarkLinkOptions;
345
341
  showLineNumbers?: boolean;
346
342
  /**
347
343
  * Whether to wrap code by default
@@ -355,7 +351,7 @@ export declare interface MarkdownOptions {
355
351
  /**
356
352
  * @type import('@shikijs/rehype').RehypeShikiOptions
357
353
  */
358
- shiki?: Partial<PluginShikiOptions>;
354
+ shiki?: Partial<RehypeShikiOptions>;
359
355
  /**
360
356
  * Speed up build time by caching mdx parsing result in `rspress build`
361
357
  * @default true
@@ -480,10 +476,23 @@ export declare const parseUrl: (url: string) => {
480
476
  hash: string;
481
477
  };
482
478
 
483
- declare type PluginShikiOptions = RehypeShikiOptions;
484
-
485
479
  export declare const QUERY_REGEXP: RegExp;
486
480
 
481
+ export declare type RemarkLinkOptions = {
482
+ /**
483
+ * Whether to enable check dead links
484
+ * @default true
485
+ */
486
+ checkDeadLinks?: boolean | {
487
+ excludes: string[] | ((url: string) => boolean);
488
+ };
489
+ /**
490
+ * [](/v3/zh/guide) [](/zh/guide) [](/guide) will be regarded as the same [](/v3/zh/guide) according to the directory.
491
+ * @default true
492
+ */
493
+ autoPrefix?: boolean;
494
+ };
495
+
487
496
  export declare type RemotePageInfo = PageIndexInfo & {
488
497
  _matchesPosition: {
489
498
  content: {
@@ -550,12 +559,19 @@ export declare interface RouteOptions {
550
559
  extensions?: string[];
551
560
  /**
552
561
  * Include extra files from being converted to routes
562
+ * @default []
553
563
  */
554
564
  include?: string[];
555
565
  /**
556
566
  * Exclude files from being converted to routes
567
+ * @default []
557
568
  */
558
569
  exclude?: string[];
570
+ /**
571
+ * Exclude convention files from being converted to routes
572
+ * @default ['**\/_[^_]*']
573
+ */
574
+ excludeConvention?: string[];
559
575
  /**
560
576
  * use links without .html files
561
577
  * @default false
@@ -708,7 +724,7 @@ export declare interface SiteData<ThemeConfig = NormalizedConfig> {
708
724
  markdown: {
709
725
  showLineNumbers: boolean;
710
726
  defaultWrapCode: boolean;
711
- shiki: Partial<PluginShikiOptions>;
727
+ shiki: Partial<RehypeShikiOptions>;
712
728
  };
713
729
  multiVersion: {
714
730
  default: string;
@@ -314,11 +314,7 @@ declare type LocalSearchOptions = SearchHooks & {
314
314
  declare interface MarkdownOptions {
315
315
  remarkPlugins?: PluggableList;
316
316
  rehypePlugins?: PluggableList;
317
- /**
318
- * Whether to enable check dead links
319
- * @default false
320
- */
321
- checkDeadLinks?: boolean;
317
+ link?: RemarkLinkOptions;
322
318
  showLineNumbers?: boolean;
323
319
  /**
324
320
  * Whether to wrap code by default
@@ -332,7 +328,7 @@ declare interface MarkdownOptions {
332
328
  /**
333
329
  * @type import('@shikijs/rehype').RehypeShikiOptions
334
330
  */
335
- shiki?: Partial<PluginShikiOptions>;
331
+ shiki?: Partial<RehypeShikiOptions>;
336
332
  /**
337
333
  * Speed up build time by caching mdx parsing result in `rspress build`
338
334
  * @default true
@@ -393,7 +389,20 @@ declare interface PageIndexInfo {
393
389
 
394
390
  declare type PageType = 'home' | 'doc' | 'custom' | '404' | 'blank';
395
391
 
396
- declare type PluginShikiOptions = RehypeShikiOptions;
392
+ declare type RemarkLinkOptions = {
393
+ /**
394
+ * Whether to enable check dead links
395
+ * @default true
396
+ */
397
+ checkDeadLinks?: boolean | {
398
+ excludes: string[] | ((url: string) => boolean);
399
+ };
400
+ /**
401
+ * [](/v3/zh/guide) [](/zh/guide) [](/guide) will be regarded as the same [](/v3/zh/guide) according to the directory.
402
+ * @default true
403
+ */
404
+ autoPrefix?: boolean;
405
+ };
397
406
 
398
407
  declare interface ReplaceRule {
399
408
  search: string | RegExp;
@@ -417,12 +426,19 @@ declare interface RouteOptions {
417
426
  extensions?: string[];
418
427
  /**
419
428
  * Include extra files from being converted to routes
429
+ * @default []
420
430
  */
421
431
  include?: string[];
422
432
  /**
423
433
  * Exclude files from being converted to routes
434
+ * @default []
424
435
  */
425
436
  exclude?: string[];
437
+ /**
438
+ * Exclude convention files from being converted to routes
439
+ * @default ['**\/_[^_]*']
440
+ */
441
+ excludeConvention?: string[];
426
442
  /**
427
443
  * use links without .html files
428
444
  * @default false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/shared",
3
- "version": "2.0.0-beta.22",
3
+ "version": "2.0.0-beta.23",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/web-infra-dev/rspress.git",
@@ -32,14 +32,14 @@
32
32
  "dist"
33
33
  ],
34
34
  "dependencies": {
35
- "@rsbuild/core": "~1.4.8",
35
+ "@rsbuild/core": "~1.4.11",
36
36
  "@shikijs/rehype": "^3.8.1",
37
37
  "gray-matter": "4.0.3",
38
38
  "lodash-es": "^4.17.21",
39
39
  "unified": "^11.0.5"
40
40
  },
41
41
  "devDependencies": {
42
- "@rslib/core": "0.10.6",
42
+ "@rslib/core": "0.11.0",
43
43
  "@types/jest": "~29.5.14",
44
44
  "@types/lodash-es": "^4.17.12",
45
45
  "@types/node": "^22.8.1",