@rspress/shared 2.0.11 → 2.0.13
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.d.ts +2 -2
- package/dist/index.d.ts +9 -5
- package/dist/index.js +1 -1
- package/dist/node-utils.d.ts +4 -2
- package/package.json +5 -5
package/dist/constants.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare const DEFAULT_CONFIG_EXTENSIONS: readonly [
|
|
1
|
+
export declare const DEFAULT_CONFIG_EXTENSIONS: readonly ['.js', '.ts', '.mjs', '.mts', '.cjs', '.cts'];
|
|
2
2
|
|
|
3
|
-
export declare const DEFAULT_CONFIG_NAME:
|
|
3
|
+
export declare const DEFAULT_CONFIG_NAME: 'rspress.config';
|
|
4
4
|
|
|
5
5
|
export declare const DEFAULT_PAGE_EXTENSIONS: string[];
|
|
6
6
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
1
2
|
import type { loadConfig } from '@rsbuild/core';
|
|
2
3
|
import type { PluggableList } from 'unified';
|
|
4
|
+
import type { ReactElement } from 'react';
|
|
5
|
+
import type { ReactNode } from 'react';
|
|
3
6
|
import type { RehypeShikiOptions } from '@shikijs/rehype';
|
|
4
7
|
import type { RsbuildConfig } from '@rsbuild/core';
|
|
5
8
|
|
|
@@ -153,6 +156,7 @@ export declare interface I18nText {
|
|
|
153
156
|
'overview.filterPlaceholderText'?: I18nTextValue;
|
|
154
157
|
'overview.filterNoResultText'?: I18nTextValue;
|
|
155
158
|
codeButtonGroupCopyButtonText?: I18nTextValue;
|
|
159
|
+
codeButtonGroupWrapButtonText?: I18nTextValue;
|
|
156
160
|
notFoundText?: I18nTextValue;
|
|
157
161
|
takeMeHomeText?: I18nTextValue;
|
|
158
162
|
promptCopyText?: I18nTextValue;
|
|
@@ -205,12 +209,12 @@ export declare type LlmsUI = {
|
|
|
205
209
|
*/
|
|
206
210
|
export declare type LlmsViewOption = 'markdownLink' | 'chatgpt' | 'claude' | {
|
|
207
211
|
title: string;
|
|
208
|
-
icon?:
|
|
212
|
+
icon?: ReactNode;
|
|
209
213
|
onClick?: () => void;
|
|
210
214
|
} | {
|
|
211
215
|
title: string;
|
|
212
216
|
href: string;
|
|
213
|
-
icon?:
|
|
217
|
+
icon?: ReactNode;
|
|
214
218
|
};
|
|
215
219
|
|
|
216
220
|
export declare interface Locale {
|
|
@@ -416,7 +420,7 @@ export declare interface PageIndexInfo {
|
|
|
416
420
|
_relativePath: string;
|
|
417
421
|
}
|
|
418
422
|
|
|
419
|
-
export declare interface PageModule<T extends
|
|
423
|
+
export declare interface PageModule<T extends ComponentType<unknown>> {
|
|
420
424
|
default: T;
|
|
421
425
|
frontmatter?: FrontMatterMeta;
|
|
422
426
|
content?: string;
|
|
@@ -526,9 +530,9 @@ export declare function replaceVersion(rawUrl: string, version: {
|
|
|
526
530
|
|
|
527
531
|
export declare interface Route {
|
|
528
532
|
path: string;
|
|
529
|
-
element:
|
|
533
|
+
element: ReactElement;
|
|
530
534
|
filePath: string;
|
|
531
|
-
preload: () => Promise<PageModule<
|
|
535
|
+
preload: () => Promise<PageModule<ComponentType<unknown>>>;
|
|
532
536
|
lang: string;
|
|
533
537
|
}
|
|
534
538
|
|
package/dist/index.js
CHANGED
|
@@ -35,7 +35,7 @@ function normalizePosixPath(id) {
|
|
|
35
35
|
if (isAbsolutePath) normalizedPath = `/${normalizedPath}`;
|
|
36
36
|
return normalizedPath;
|
|
37
37
|
}
|
|
38
|
-
const inBrowser = ()
|
|
38
|
+
const inBrowser = ()=>false;
|
|
39
39
|
function addLeadingSlash(url) {
|
|
40
40
|
return '/' === url.charAt(0) || isExternalUrl(url) ? url : `/${url}`;
|
|
41
41
|
}
|
package/dist/node-utils.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { MdxJsxExpressionAttribute } from 'mdast-util-mdx-jsx';
|
|
|
4
4
|
import type { MdxJsxFlowElement } from 'mdast-util-mdx-jsx';
|
|
5
5
|
import type { MdxJsxTextElement } from 'mdast-util-mdx-jsx';
|
|
6
6
|
import type { PluggableList } from 'unified';
|
|
7
|
+
import type { ReactNode } from 'react';
|
|
7
8
|
import type { RehypeShikiOptions } from '@shikijs/rehype';
|
|
8
9
|
import type { RsbuildConfig } from '@rsbuild/core';
|
|
9
10
|
|
|
@@ -158,6 +159,7 @@ declare interface I18nText {
|
|
|
158
159
|
'overview.filterPlaceholderText'?: I18nTextValue;
|
|
159
160
|
'overview.filterNoResultText'?: I18nTextValue;
|
|
160
161
|
codeButtonGroupCopyButtonText?: I18nTextValue;
|
|
162
|
+
codeButtonGroupWrapButtonText?: I18nTextValue;
|
|
161
163
|
notFoundText?: I18nTextValue;
|
|
162
164
|
takeMeHomeText?: I18nTextValue;
|
|
163
165
|
promptCopyText?: I18nTextValue;
|
|
@@ -198,12 +200,12 @@ declare type LlmsUI = {
|
|
|
198
200
|
*/
|
|
199
201
|
declare type LlmsViewOption = 'markdownLink' | 'chatgpt' | 'claude' | {
|
|
200
202
|
title: string;
|
|
201
|
-
icon?:
|
|
203
|
+
icon?: ReactNode;
|
|
202
204
|
onClick?: () => void;
|
|
203
205
|
} | {
|
|
204
206
|
title: string;
|
|
205
207
|
href: string;
|
|
206
|
-
icon?:
|
|
208
|
+
icon?: ReactNode;
|
|
207
209
|
};
|
|
208
210
|
|
|
209
211
|
export declare function loadFrontMatter<TFrontmatter extends Record<string, unknown> = FrontMatterMeta>(source: string, filepath: string, root: string, outputWarning?: boolean): {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspress/shared",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.13",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/web-infra-dev/rspress.git",
|
|
@@ -44,15 +44,15 @@
|
|
|
44
44
|
"dist"
|
|
45
45
|
],
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@rsbuild/core": "^2.0.
|
|
47
|
+
"@rsbuild/core": "^2.0.7",
|
|
48
48
|
"@shikijs/rehype": "^4.0.2",
|
|
49
49
|
"unified": "^11.0.5"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@rslib/core": "0.21.
|
|
52
|
+
"@rslib/core": "0.21.5",
|
|
53
53
|
"@types/lodash-es": "^4.17.12",
|
|
54
54
|
"@types/node": "^22.8.1",
|
|
55
|
-
"@types/react": "^19.2.
|
|
55
|
+
"@types/react": "^19.2.15",
|
|
56
56
|
"github-slugger": "^2.0.0",
|
|
57
57
|
"gray-matter": "4.0.3",
|
|
58
58
|
"lodash-es": "^4.18.1",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"medium-zoom": "1.1.0",
|
|
61
61
|
"rimraf": "^6.1.3",
|
|
62
62
|
"rsbuild-plugin-publint": "^0.3.4",
|
|
63
|
-
"typescript": "^
|
|
63
|
+
"typescript": "^6.0.3"
|
|
64
64
|
},
|
|
65
65
|
"publishConfig": {
|
|
66
66
|
"access": "public",
|