@rspress/shared 2.1.0-beta.1 → 2.1.0-beta.2
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 +14 -4
- package/dist/node-utils.d.ts +12 -4
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { PluggableList } from 'unified';
|
|
|
4
4
|
import type { ReactElement } from 'react';
|
|
5
5
|
import type { RehypeShikiOptions } from '@shikijs/rehype';
|
|
6
6
|
import type { RsbuildConfig } from '@rsbuild/core';
|
|
7
|
+
import type { TransformContext } from '@rsbuild/core';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* There are two ways to define what addition routes represent.
|
|
@@ -379,7 +380,7 @@ export declare interface MarkdownOptions {
|
|
|
379
380
|
*/
|
|
380
381
|
rehypePlugins?: PluggableList;
|
|
381
382
|
/**
|
|
382
|
-
* @default { checkDeadLinks: true, checkAnchors:
|
|
383
|
+
* @default { checkDeadLinks: true, checkAnchors: true, autoPrefix: true }
|
|
383
384
|
*/
|
|
384
385
|
link?: RemarkLinkOptions;
|
|
385
386
|
/**
|
|
@@ -601,7 +602,7 @@ export declare type RemarkLinkOptions = {
|
|
|
601
602
|
};
|
|
602
603
|
/**
|
|
603
604
|
* Whether to enable dead anchor checks
|
|
604
|
-
* @default
|
|
605
|
+
* @default true
|
|
605
606
|
*/
|
|
606
607
|
checkAnchors?: boolean | {
|
|
607
608
|
excludes: string[] | ((url: string) => boolean);
|
|
@@ -724,7 +725,7 @@ export declare interface RouteOptions {
|
|
|
724
725
|
excludeConvention?: string[];
|
|
725
726
|
/**
|
|
726
727
|
* use links without .html files
|
|
727
|
-
* @default
|
|
728
|
+
* @default true
|
|
728
729
|
*/
|
|
729
730
|
cleanUrls?: boolean;
|
|
730
731
|
/**
|
|
@@ -791,6 +792,10 @@ declare interface RspressPlugin {
|
|
|
791
792
|
config?: (config: UserConfig, utils: {
|
|
792
793
|
addPlugin: (plugin: RspressPlugin) => void;
|
|
793
794
|
removePlugin: (pluginName: string) => void;
|
|
795
|
+
/**
|
|
796
|
+
* Read the shared i18n data for the current build.
|
|
797
|
+
*/
|
|
798
|
+
getI18nData: (context?: Pick<TransformContext, 'addDependency' | 'addMissingDependency'>) => Promise<Record<string, Record<string, string>>>;
|
|
794
799
|
}, isProd: boolean) => UserConfig | Promise<UserConfig>;
|
|
795
800
|
/**
|
|
796
801
|
* Callback before build
|
|
@@ -906,6 +911,8 @@ export declare interface SiteData {
|
|
|
906
911
|
logo: string | {
|
|
907
912
|
dark: string;
|
|
908
913
|
light: string;
|
|
914
|
+
width?: number;
|
|
915
|
+
height?: number;
|
|
909
916
|
};
|
|
910
917
|
logoText: string;
|
|
911
918
|
logoHref: string;
|
|
@@ -1054,12 +1061,15 @@ export declare interface UserConfig {
|
|
|
1054
1061
|
*/
|
|
1055
1062
|
root?: string;
|
|
1056
1063
|
/**
|
|
1057
|
-
* Path to the logo file in nav bar.
|
|
1064
|
+
* Path to the logo file in nav bar. The object form can also provide the
|
|
1065
|
+
* image's intrinsic dimensions to avoid layout shifts.
|
|
1058
1066
|
* @default ''
|
|
1059
1067
|
*/
|
|
1060
1068
|
logo?: string | {
|
|
1061
1069
|
dark: string;
|
|
1062
1070
|
light: string;
|
|
1071
|
+
width?: number;
|
|
1072
|
+
height?: number;
|
|
1063
1073
|
};
|
|
1064
1074
|
/**
|
|
1065
1075
|
* The text of the logo in nav bar.
|
package/dist/node-utils.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type { MdxJsxTextElement } from 'mdast-util-mdx-jsx';
|
|
|
6
6
|
import type { PluggableList } from 'unified';
|
|
7
7
|
import type { RehypeShikiOptions } from '@shikijs/rehype';
|
|
8
8
|
import type { RsbuildConfig } from '@rsbuild/core';
|
|
9
|
+
import type { TransformContext } from '@rsbuild/core';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
12
|
* There are two ways to define what addition routes represent.
|
|
@@ -372,7 +373,7 @@ declare interface MarkdownOptions {
|
|
|
372
373
|
*/
|
|
373
374
|
rehypePlugins?: PluggableList;
|
|
374
375
|
/**
|
|
375
|
-
* @default { checkDeadLinks: true, checkAnchors:
|
|
376
|
+
* @default { checkDeadLinks: true, checkAnchors: true, autoPrefix: true }
|
|
376
377
|
*/
|
|
377
378
|
link?: RemarkLinkOptions;
|
|
378
379
|
/**
|
|
@@ -519,7 +520,7 @@ declare type RemarkLinkOptions = {
|
|
|
519
520
|
};
|
|
520
521
|
/**
|
|
521
522
|
* Whether to enable dead anchor checks
|
|
522
|
-
* @default
|
|
523
|
+
* @default true
|
|
523
524
|
*/
|
|
524
525
|
checkAnchors?: boolean | {
|
|
525
526
|
excludes: string[] | ((url: string) => boolean);
|
|
@@ -598,7 +599,7 @@ declare interface RouteOptions {
|
|
|
598
599
|
excludeConvention?: string[];
|
|
599
600
|
/**
|
|
600
601
|
* use links without .html files
|
|
601
|
-
* @default
|
|
602
|
+
* @default true
|
|
602
603
|
*/
|
|
603
604
|
cleanUrls?: boolean;
|
|
604
605
|
/**
|
|
@@ -663,6 +664,10 @@ declare interface RspressPlugin {
|
|
|
663
664
|
config?: (config: UserConfig, utils: {
|
|
664
665
|
addPlugin: (plugin: RspressPlugin) => void;
|
|
665
666
|
removePlugin: (pluginName: string) => void;
|
|
667
|
+
/**
|
|
668
|
+
* Read the shared i18n data for the current build.
|
|
669
|
+
*/
|
|
670
|
+
getI18nData: (context?: Pick<TransformContext, 'addDependency' | 'addMissingDependency'>) => Promise<Record<string, Record<string, string>>>;
|
|
666
671
|
}, isProd: boolean) => UserConfig | Promise<UserConfig>;
|
|
667
672
|
/**
|
|
668
673
|
* Callback before build
|
|
@@ -883,12 +888,15 @@ declare interface UserConfig {
|
|
|
883
888
|
*/
|
|
884
889
|
root?: string;
|
|
885
890
|
/**
|
|
886
|
-
* Path to the logo file in nav bar.
|
|
891
|
+
* Path to the logo file in nav bar. The object form can also provide the
|
|
892
|
+
* image's intrinsic dimensions to avoid layout shifts.
|
|
887
893
|
* @default ''
|
|
888
894
|
*/
|
|
889
895
|
logo?: string | {
|
|
890
896
|
dark: string;
|
|
891
897
|
light: string;
|
|
898
|
+
width?: number;
|
|
899
|
+
height?: number;
|
|
892
900
|
};
|
|
893
901
|
/**
|
|
894
902
|
* The text of the logo in nav bar.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspress/shared",
|
|
3
|
-
"version": "2.1.0-beta.
|
|
3
|
+
"version": "2.1.0-beta.2",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/web-infra-dev/rspress.git",
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"dist"
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@rsbuild/core": "^2.2.
|
|
48
|
+
"@rsbuild/core": "^2.2.14",
|
|
49
49
|
"@shikijs/rehype": "^4.2.0",
|
|
50
|
-
"@types/react": "^19.
|
|
50
|
+
"@types/react": "^19.3.0",
|
|
51
51
|
"mdast-util-mdx-jsx": "^3.2.0",
|
|
52
52
|
"unified": "^11.0.5"
|
|
53
53
|
},
|