@rspress/core 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/cli.js CHANGED
@@ -8,7 +8,7 @@ import picocolors from "picocolors";
8
8
  import { build, dev, serve } from "./index.js";
9
9
  import node_fs from "node:fs";
10
10
  import { DEFAULT_CONFIG_EXTENSIONS, DEFAULT_CONFIG_NAME } from "@rspress/shared/constants";
11
- var package_namespaceObject = JSON.parse('{"i8":"2.0.0-beta.22"}');
11
+ var package_namespaceObject = JSON.parse('{"i8":"2.0.0-beta.23"}');
12
12
  const findConfig = (basePath)=>DEFAULT_CONFIG_EXTENSIONS.map((ext)=>basePath + ext).find(node_fs.existsSync);
13
13
  async function loadConfigFile(customConfigFile) {
14
14
  const baseDir = process.cwd();
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ import { getIconUrlPath } from '@rspress/shared/node-utils';
5
5
  import { getNodeAttribute } from '@rspress/shared/node-utils';
6
6
  import { getSidebarDataGroup } from '@rspress/shared';
7
7
  import { logger } from '@rspress/shared/logger';
8
+ import { MarkdownOptions } from '@rspress/shared';
8
9
  import { matchPath } from '@rspress/runtime/server';
9
10
  import { mergeDocConfig } from '@rspress/shared/node-utils';
10
11
  import { Nav } from '@rspress/shared';
@@ -18,6 +19,7 @@ import { removeTrailingSlash } from '@rspress/shared';
18
19
  import { RouteMeta } from '@rspress/shared';
19
20
  import type { RsbuildConfig } from '@rsbuild/core';
20
21
  import { RsbuildInstance } from '@rsbuild/core';
22
+ import type { Rspack as Rspack_2 } from '@rsbuild/core';
21
23
  import { RSPRESS_TEMP_DIR } from '@rspress/shared';
22
24
  import { RspressPlugin } from '@rspress/shared';
23
25
  import { Sidebar } from '@rspress/shared';
@@ -155,18 +157,23 @@ declare class PluginDriver {
155
157
  _runSerialAsyncHook<H extends RspressPluginHookKeys>(hookName: H, ...args: Parameters<Required<RspressPlugin>[H]>): RspressPlugin;
156
158
  }
157
159
 
158
- export declare const remarkFileCodeBlock: Plugin_2<[{
160
+ export declare const remarkFileCodeBlock: Plugin_2<[
161
+ {
159
162
  filepath: string;
160
- }], Root>;
163
+ addDependency?: Rspack_2.LoaderContext['addDependency'];
164
+ }
165
+ ], Root>;
161
166
 
162
167
  /**
163
168
  * Remark plugin to normalize a link href
169
+ * 1. add version and lang prefix to the link
170
+ * 2. checkDeadLinks
164
171
  */
165
- export declare const remarkPluginNormalizeLink: Plugin_2<[
172
+ export declare const remarkLink: Plugin_2<[
166
173
  {
167
174
  cleanUrls: boolean | string;
168
175
  routeService: RouteService | null;
169
- checkDeadLinks?: boolean;
176
+ remarkLinkOptions?: MarkdownOptions['link'];
170
177
  __base?: string;
171
178
  }
172
179
  ], Root>;
@@ -227,7 +234,8 @@ export declare class RouteService {
227
234
  isExistRoute(routePath: string): boolean;
228
235
  generateRoutesCode(): string;
229
236
  private generateRoutesCodeByRouteMeta;
230
- getRoutePathParts(relativePath: string): readonly [string, string, string];
237
+ getRoutePathParts(relativePath: string): string[];
238
+ splitRoutePathParts(relativePath: string): readonly [string, string, string];
231
239
  normalizeRoutePath(relativePath: string): {
232
240
  pureRoutePath: string;
233
241
  routePath: string;
@@ -235,6 +243,7 @@ export declare class RouteService {
235
243
  version: string;
236
244
  };
237
245
  absolutePathToRoutePath(absolutePath: string): string;
246
+ isInDocsDir(absolutePath: string): boolean;
238
247
  absolutePathToRelativePath(absolutePath: string): string;
239
248
  getRoutePageByRoutePath(routePath: string): RoutePage | undefined;
240
249
  }