@rspress/shared 2.0.0-beta.21 → 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 +45 -21
- package/dist/node-utils.d.ts +43 -18
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -132,6 +132,7 @@ export declare interface DefaultThemeConfig {
|
|
|
132
132
|
enableContentAnimation?: boolean;
|
|
133
133
|
/**
|
|
134
134
|
* Whether to enable view transition animation for the theme
|
|
135
|
+
* @default false
|
|
135
136
|
*/
|
|
136
137
|
enableAppearanceAnimation?: boolean;
|
|
137
138
|
/**
|
|
@@ -336,13 +337,11 @@ export declare type LocalSearchOptions = SearchHooks & {
|
|
|
336
337
|
export declare interface MarkdownOptions {
|
|
337
338
|
remarkPlugins?: PluggableList;
|
|
338
339
|
rehypePlugins?: PluggableList;
|
|
339
|
-
|
|
340
|
-
* Whether to enable check dead links, default is false
|
|
341
|
-
*/
|
|
342
|
-
checkDeadLinks?: boolean;
|
|
340
|
+
link?: RemarkLinkOptions;
|
|
343
341
|
showLineNumbers?: boolean;
|
|
344
342
|
/**
|
|
345
|
-
* Whether to wrap code by default
|
|
343
|
+
* Whether to wrap code by default
|
|
344
|
+
* @default false
|
|
346
345
|
*/
|
|
347
346
|
defaultWrapCode?: boolean;
|
|
348
347
|
/**
|
|
@@ -352,7 +351,7 @@ export declare interface MarkdownOptions {
|
|
|
352
351
|
/**
|
|
353
352
|
* @type import('@shikijs/rehype').RehypeShikiOptions
|
|
354
353
|
*/
|
|
355
|
-
shiki?: Partial<
|
|
354
|
+
shiki?: Partial<RehypeShikiOptions>;
|
|
356
355
|
/**
|
|
357
356
|
* Speed up build time by caching mdx parsing result in `rspress build`
|
|
358
357
|
* @default true
|
|
@@ -477,10 +476,23 @@ export declare const parseUrl: (url: string) => {
|
|
|
477
476
|
hash: string;
|
|
478
477
|
};
|
|
479
478
|
|
|
480
|
-
declare type PluginShikiOptions = RehypeShikiOptions;
|
|
481
|
-
|
|
482
479
|
export declare const QUERY_REGEXP: RegExp;
|
|
483
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
|
+
|
|
484
496
|
export declare type RemotePageInfo = PageIndexInfo & {
|
|
485
497
|
_matchesPosition: {
|
|
486
498
|
content: {
|
|
@@ -547,14 +559,22 @@ export declare interface RouteOptions {
|
|
|
547
559
|
extensions?: string[];
|
|
548
560
|
/**
|
|
549
561
|
* Include extra files from being converted to routes
|
|
562
|
+
* @default []
|
|
550
563
|
*/
|
|
551
564
|
include?: string[];
|
|
552
565
|
/**
|
|
553
566
|
* Exclude files from being converted to routes
|
|
567
|
+
* @default []
|
|
554
568
|
*/
|
|
555
569
|
exclude?: string[];
|
|
570
|
+
/**
|
|
571
|
+
* Exclude convention files from being converted to routes
|
|
572
|
+
* @default ['**\/_[^_]*']
|
|
573
|
+
*/
|
|
574
|
+
excludeConvention?: string[];
|
|
556
575
|
/**
|
|
557
576
|
* use links without .html files
|
|
577
|
+
* @default false
|
|
558
578
|
*/
|
|
559
579
|
cleanUrls?: boolean;
|
|
560
580
|
}
|
|
@@ -622,14 +642,6 @@ declare interface RspressPlugin {
|
|
|
622
642
|
* Callback after routeService generated
|
|
623
643
|
*/
|
|
624
644
|
routeServiceGenerated?: (routeService: any, isProd: boolean) => Promise<void> | void;
|
|
625
|
-
/**
|
|
626
|
-
* Add addition ssg routes, for dynamic routes.
|
|
627
|
-
*/
|
|
628
|
-
addSSGRoutes?: (config: UserConfig, isProd: boolean) => {
|
|
629
|
-
path: string;
|
|
630
|
-
}[] | Promise<{
|
|
631
|
-
path: string;
|
|
632
|
-
}[]>;
|
|
633
645
|
/**
|
|
634
646
|
* @private
|
|
635
647
|
* Modify search index data.
|
|
@@ -709,11 +721,10 @@ export declare interface SiteData<ThemeConfig = NormalizedConfig> {
|
|
|
709
721
|
logoText: string;
|
|
710
722
|
pages: BaseRuntimePageInfo[];
|
|
711
723
|
search: SearchOptions;
|
|
712
|
-
ssg: boolean;
|
|
713
724
|
markdown: {
|
|
714
725
|
showLineNumbers: boolean;
|
|
715
726
|
defaultWrapCode: boolean;
|
|
716
|
-
shiki: Partial<
|
|
727
|
+
shiki: Partial<RehypeShikiOptions>;
|
|
717
728
|
};
|
|
718
729
|
multiVersion: {
|
|
719
730
|
default: string;
|
|
@@ -831,11 +842,24 @@ export declare interface UserConfig<ThemeConfig = DefaultThemeConfig> {
|
|
|
831
842
|
*/
|
|
832
843
|
search?: SearchOptions;
|
|
833
844
|
/**
|
|
834
|
-
* Whether to enable ssg
|
|
845
|
+
* Whether to enable ssg
|
|
846
|
+
* @default true
|
|
835
847
|
*/
|
|
836
|
-
ssg?: boolean
|
|
848
|
+
ssg?: boolean | {
|
|
849
|
+
/**
|
|
850
|
+
* After enabled, you can use worker to accelerate the SSG process and reduce memory usage. It is suitable for large document sites and is based on [tinypool](https://github.com/tinylibs/tinypool).
|
|
851
|
+
* @default false
|
|
852
|
+
*/
|
|
853
|
+
experimentalWorker?: boolean;
|
|
854
|
+
/**
|
|
855
|
+
* After enabled, some pages will not be rendered by SSG, and they will directly use html under CSR. This is suitable for SSG errors in large document sites bypassing a small number of pages. It is not recommended to enable this option actively.
|
|
856
|
+
* @default []
|
|
857
|
+
*/
|
|
858
|
+
experimentalExcludeRoutePaths?: (string | RegExp)[];
|
|
859
|
+
};
|
|
837
860
|
/**
|
|
838
|
-
* Whether to enable medium-zoom
|
|
861
|
+
* Whether to enable medium-zoom
|
|
862
|
+
* @default true
|
|
839
863
|
*/
|
|
840
864
|
mediumZoom?: boolean | {
|
|
841
865
|
selector?: string;
|
package/dist/node-utils.d.ts
CHANGED
|
@@ -120,6 +120,7 @@ declare interface Config {
|
|
|
120
120
|
enableContentAnimation?: boolean;
|
|
121
121
|
/**
|
|
122
122
|
* Whether to enable view transition animation for the theme
|
|
123
|
+
* @default false
|
|
123
124
|
*/
|
|
124
125
|
enableAppearanceAnimation?: boolean;
|
|
125
126
|
/**
|
|
@@ -313,13 +314,11 @@ declare type LocalSearchOptions = SearchHooks & {
|
|
|
313
314
|
declare interface MarkdownOptions {
|
|
314
315
|
remarkPlugins?: PluggableList;
|
|
315
316
|
rehypePlugins?: PluggableList;
|
|
316
|
-
|
|
317
|
-
* Whether to enable check dead links, default is false
|
|
318
|
-
*/
|
|
319
|
-
checkDeadLinks?: boolean;
|
|
317
|
+
link?: RemarkLinkOptions;
|
|
320
318
|
showLineNumbers?: boolean;
|
|
321
319
|
/**
|
|
322
|
-
* Whether to wrap code by default
|
|
320
|
+
* Whether to wrap code by default
|
|
321
|
+
* @default false
|
|
323
322
|
*/
|
|
324
323
|
defaultWrapCode?: boolean;
|
|
325
324
|
/**
|
|
@@ -329,7 +328,7 @@ declare interface MarkdownOptions {
|
|
|
329
328
|
/**
|
|
330
329
|
* @type import('@shikijs/rehype').RehypeShikiOptions
|
|
331
330
|
*/
|
|
332
|
-
shiki?: Partial<
|
|
331
|
+
shiki?: Partial<RehypeShikiOptions>;
|
|
333
332
|
/**
|
|
334
333
|
* Speed up build time by caching mdx parsing result in `rspress build`
|
|
335
334
|
* @default true
|
|
@@ -390,7 +389,20 @@ declare interface PageIndexInfo {
|
|
|
390
389
|
|
|
391
390
|
declare type PageType = 'home' | 'doc' | 'custom' | '404' | 'blank';
|
|
392
391
|
|
|
393
|
-
declare type
|
|
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
|
+
};
|
|
394
406
|
|
|
395
407
|
declare interface ReplaceRule {
|
|
396
408
|
search: string | RegExp;
|
|
@@ -414,14 +426,22 @@ declare interface RouteOptions {
|
|
|
414
426
|
extensions?: string[];
|
|
415
427
|
/**
|
|
416
428
|
* Include extra files from being converted to routes
|
|
429
|
+
* @default []
|
|
417
430
|
*/
|
|
418
431
|
include?: string[];
|
|
419
432
|
/**
|
|
420
433
|
* Exclude files from being converted to routes
|
|
434
|
+
* @default []
|
|
421
435
|
*/
|
|
422
436
|
exclude?: string[];
|
|
437
|
+
/**
|
|
438
|
+
* Exclude convention files from being converted to routes
|
|
439
|
+
* @default ['**\/_[^_]*']
|
|
440
|
+
*/
|
|
441
|
+
excludeConvention?: string[];
|
|
423
442
|
/**
|
|
424
443
|
* use links without .html files
|
|
444
|
+
* @default false
|
|
425
445
|
*/
|
|
426
446
|
cleanUrls?: boolean;
|
|
427
447
|
}
|
|
@@ -487,14 +507,6 @@ declare interface RspressPlugin {
|
|
|
487
507
|
* Callback after routeService generated
|
|
488
508
|
*/
|
|
489
509
|
routeServiceGenerated?: (routeService: any, isProd: boolean) => Promise<void> | void;
|
|
490
|
-
/**
|
|
491
|
-
* Add addition ssg routes, for dynamic routes.
|
|
492
|
-
*/
|
|
493
|
-
addSSGRoutes?: (config: UserConfig, isProd: boolean) => {
|
|
494
|
-
path: string;
|
|
495
|
-
}[] | Promise<{
|
|
496
|
-
path: string;
|
|
497
|
-
}[]>;
|
|
498
510
|
/**
|
|
499
511
|
* @private
|
|
500
512
|
* Modify search index data.
|
|
@@ -659,11 +671,24 @@ declare interface UserConfig<ThemeConfig = Config> {
|
|
|
659
671
|
*/
|
|
660
672
|
search?: SearchOptions;
|
|
661
673
|
/**
|
|
662
|
-
* Whether to enable ssg
|
|
674
|
+
* Whether to enable ssg
|
|
675
|
+
* @default true
|
|
663
676
|
*/
|
|
664
|
-
ssg?: boolean
|
|
677
|
+
ssg?: boolean | {
|
|
678
|
+
/**
|
|
679
|
+
* After enabled, you can use worker to accelerate the SSG process and reduce memory usage. It is suitable for large document sites and is based on [tinypool](https://github.com/tinylibs/tinypool).
|
|
680
|
+
* @default false
|
|
681
|
+
*/
|
|
682
|
+
experimentalWorker?: boolean;
|
|
683
|
+
/**
|
|
684
|
+
* After enabled, some pages will not be rendered by SSG, and they will directly use html under CSR. This is suitable for SSG errors in large document sites bypassing a small number of pages. It is not recommended to enable this option actively.
|
|
685
|
+
* @default []
|
|
686
|
+
*/
|
|
687
|
+
experimentalExcludeRoutePaths?: (string | RegExp)[];
|
|
688
|
+
};
|
|
665
689
|
/**
|
|
666
|
-
* Whether to enable medium-zoom
|
|
690
|
+
* Whether to enable medium-zoom
|
|
691
|
+
* @default true
|
|
667
692
|
*/
|
|
668
693
|
mediumZoom?: boolean | {
|
|
669
694
|
selector?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspress/shared",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
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.
|
|
36
|
-
"@shikijs/rehype": "^3.
|
|
35
|
+
"@rsbuild/core": "~1.4.11",
|
|
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.
|
|
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",
|