@rspress/core 2.0.0-beta.2 → 2.0.0-beta.20
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/README.md +1 -1
- package/dist/index.d.ts +40 -14
- package/dist/index.js +994 -548
- package/dist/loader.d.ts +38 -34
- package/dist/loader.js +30 -525
- package/dist/processor.d.ts +95 -0
- package/dist/processor.js +688 -0
- package/dist/runtime/App.d.ts +1 -4
- package/dist/runtime/App.js +17 -20
- package/dist/runtime/ClientApp.js +24 -13
- package/dist/runtime/csrClientEntry.js +5 -13
- package/dist/runtime/initPageData.d.ts +0 -1
- package/dist/runtime/initPageData.js +18 -18
- package/dist/runtime/ssrClientEntry.js +14 -14
- package/dist/runtime/ssrServerEntry.d.ts +3 -2
- package/dist/runtime/ssrServerEntry.js +41 -17
- package/dist/shiki-transformers.d.ts +38 -0
- package/dist/shiki-transformers.js +77 -0
- package/dist/shiki-transformers.js.LICENSE.txt +5 -0
- package/package.json +34 -28
- package/dist/runtime/tsconfig.js +0 -4
package/README.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export declare function build(options: BuildOptions): Promise<void>;
|
|
|
16
16
|
declare interface BuildOptions {
|
|
17
17
|
docDirectory: string;
|
|
18
18
|
config: UserConfig;
|
|
19
|
+
configFilePath: string;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
/**
|
|
@@ -44,9 +45,17 @@ declare interface DevOptions {
|
|
|
44
45
|
appDirectory: string;
|
|
45
46
|
docDirectory: string;
|
|
46
47
|
config: UserConfig;
|
|
48
|
+
configFilePath: string;
|
|
47
49
|
extraBuilderConfig?: RsbuildConfig;
|
|
48
50
|
}
|
|
49
51
|
|
|
52
|
+
declare interface InitOptions {
|
|
53
|
+
scanDir: string;
|
|
54
|
+
config: UserConfig;
|
|
55
|
+
runtimeTempDir: string;
|
|
56
|
+
pluginDriver: PluginDriver;
|
|
57
|
+
}
|
|
58
|
+
|
|
50
59
|
export { mergeDocConfig }
|
|
51
60
|
|
|
52
61
|
/**
|
|
@@ -85,7 +94,8 @@ declare interface Parent extends Node_2 {
|
|
|
85
94
|
|
|
86
95
|
declare class PluginDriver {
|
|
87
96
|
#private;
|
|
88
|
-
constructor(config: UserConfig, isProd: boolean);
|
|
97
|
+
constructor(config: UserConfig, configFilePath: string, isProd: boolean);
|
|
98
|
+
getConfigFilePath(): string;
|
|
89
99
|
init(): Promise<void>;
|
|
90
100
|
addPlugin(plugin: RspressPlugin): void;
|
|
91
101
|
getPlugins(): RspressPlugin[];
|
|
@@ -116,9 +126,10 @@ declare class PluginDriver {
|
|
|
116
126
|
*/
|
|
117
127
|
export declare const remarkPluginNormalizeLink: Plugin_2<[
|
|
118
128
|
{
|
|
119
|
-
root: string;
|
|
120
129
|
cleanUrls: boolean | string;
|
|
121
|
-
routeService
|
|
130
|
+
routeService: RouteService | null;
|
|
131
|
+
checkDeadLinks?: boolean;
|
|
132
|
+
__base?: string;
|
|
122
133
|
}
|
|
123
134
|
], Root>;
|
|
124
135
|
|
|
@@ -151,33 +162,48 @@ declare type RootContent = RootContentMap[keyof RootContentMap];
|
|
|
151
162
|
*/
|
|
152
163
|
declare interface RootData extends Data {}
|
|
153
164
|
|
|
165
|
+
declare class RoutePage {
|
|
166
|
+
#private;
|
|
167
|
+
routeMeta: RouteMeta;
|
|
168
|
+
static create(absolutePath: string, docsDir: string): RoutePage;
|
|
169
|
+
static createFromExternal(routePath: string, filepath: string, docDir: string): RoutePage;
|
|
170
|
+
private constructor();
|
|
171
|
+
static generateRouteMeta(routePath: string, filepath: string, docDir: string): RouteMeta;
|
|
172
|
+
}
|
|
173
|
+
|
|
154
174
|
export declare class RouteService {
|
|
155
175
|
#private;
|
|
156
|
-
routeData: Map<string,
|
|
157
|
-
|
|
176
|
+
routeData: Map<string, RoutePage>;
|
|
177
|
+
static __instance__: RouteService | null;
|
|
178
|
+
static getInstance(): RouteService;
|
|
179
|
+
static create(options: InitOptions): Promise<RouteService>;
|
|
180
|
+
private constructor();
|
|
158
181
|
get extensions(): readonly string[];
|
|
159
|
-
|
|
160
|
-
addRoute(routeInfo: RouteMeta): void;
|
|
161
|
-
removeRoute(filePath: string): void;
|
|
182
|
+
addRoute(routePage: RoutePage): Promise<void>;
|
|
162
183
|
getRoutes(): RouteMeta[];
|
|
184
|
+
getRoutePages(): RoutePage[];
|
|
163
185
|
isExistRoute(routePath: string): boolean;
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
186
|
+
generateRoutesCode(): string;
|
|
187
|
+
generateRoutesCodeByRouteMeta(routeMeta: RouteMeta[]): string;
|
|
188
|
+
getRoutePathParts(relativePath: string): readonly [string, string, string];
|
|
189
|
+
normalizeRoutePath(relativePath: string): {
|
|
190
|
+
pureRoutePath: string;
|
|
169
191
|
routePath: string;
|
|
170
192
|
lang: string;
|
|
171
193
|
version: string;
|
|
172
194
|
};
|
|
195
|
+
absolutePathToRoutePath(absolutePath: string): string;
|
|
196
|
+
absolutePathToRelativePath(absolutePath: string): string;
|
|
197
|
+
getRoutePageByRoutePath(routePath: string): RoutePage | undefined;
|
|
173
198
|
}
|
|
174
199
|
|
|
175
|
-
declare type RspressPluginHookKeys = 'beforeBuild' | 'afterBuild' | 'addPages' | 'addRuntimeModules' | 'routeGenerated' | 'routeServiceGenerated' | 'addSSGRoutes' | 'extendPageData' | 'modifySearchIndexData';
|
|
200
|
+
declare type RspressPluginHookKeys = 'beforeBuild' | 'config' | 'afterBuild' | 'addPages' | 'addRuntimeModules' | 'routeGenerated' | 'routeServiceGenerated' | 'addSSGRoutes' | 'extendPageData' | 'modifySearchIndexData';
|
|
176
201
|
|
|
177
202
|
export declare function serve(options: ServeOptions): Promise<ReturnType<RsbuildInstance['preview']>>;
|
|
178
203
|
|
|
179
204
|
declare interface ServeOptions {
|
|
180
205
|
config: UserConfig;
|
|
206
|
+
configFilePath: string;
|
|
181
207
|
port?: number;
|
|
182
208
|
host?: string;
|
|
183
209
|
}
|