@rspress/shared 2.0.0-beta.20 → 2.0.0-beta.21

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 CHANGED
@@ -2,7 +2,6 @@ import type { loadConfig } from '@rsbuild/core';
2
2
  import type { PluggableList } from 'unified';
3
3
  import type { RehypeShikiOptions } from '@shikijs/rehype';
4
4
  import type { RsbuildConfig } from '@rsbuild/core';
5
- import type { RsbuildPlugin } from '@rsbuild/core';
6
5
 
7
6
  /**
8
7
  * There are two ways to define what addition routes represent.
@@ -274,8 +273,6 @@ export declare function isExternalUrl(url?: string): boolean;
274
273
 
275
274
  export declare const isProduction: () => boolean;
276
275
 
277
- export declare const isSCM: () => boolean;
278
-
279
276
  export declare interface Locale {
280
277
  lang: string;
281
278
  label: string;
@@ -462,7 +459,6 @@ export declare interface PageIndexInfo {
462
459
  frontmatter: FrontMatterMeta;
463
460
  lang: string;
464
461
  version: string;
465
- domain: string;
466
462
  _filepath: string;
467
463
  _relativePath: string;
468
464
  }
@@ -494,20 +490,6 @@ export declare type RemotePageInfo = PageIndexInfo & {
494
490
  };
495
491
  };
496
492
 
497
- export declare type RemoteSearchIndexInfo = string | {
498
- value: string;
499
- label: string;
500
- };
501
-
502
- export declare type RemoteSearchOptions = SearchHooks & {
503
- mode: 'remote';
504
- apiUrl: string;
505
- domain?: string;
506
- indexName: string;
507
- searchIndexes?: RemoteSearchIndexInfo[];
508
- searchLoading?: boolean;
509
- };
510
-
511
493
  export declare function removeBase(url: string, base: string): string;
512
494
 
513
495
  export declare function removeHash(str: string): string;
@@ -666,7 +648,7 @@ export declare interface SearchHooks {
666
648
  searchHooks?: string;
667
649
  }
668
650
 
669
- export declare type SearchOptions = LocalSearchOptions | RemoteSearchOptions | false;
651
+ export declare type SearchOptions = LocalSearchOptions | false;
670
652
 
671
653
  export declare interface Sidebar {
672
654
  [path: string]: (SidebarGroup | SidebarItem | SidebarDivider | SidebarSectionHeader)[];
@@ -859,10 +841,6 @@ export declare interface UserConfig<ThemeConfig = DefaultThemeConfig> {
859
841
  selector?: string;
860
842
  options?: ZoomOptions;
861
843
  };
862
- /**
863
- * Add some extra builder plugins
864
- */
865
- builderPlugins?: RsbuildPlugin[];
866
844
  /**
867
845
  * Multi version config
868
846
  */
package/dist/index.js CHANGED
@@ -45,7 +45,6 @@ const DEFAULT_HIGHLIGHT_LANGUAGES = [
45
45
  'tsx'
46
46
  ]
47
47
  ];
48
- const isSCM = ()=>Boolean(process.env.BUILD_VERSION);
49
48
  const isProduction = ()=>'production' === process.env.NODE_ENV;
50
49
  const isDebugMode = ()=>{
51
50
  if (!process.env.DEBUG) return false;
@@ -168,4 +167,4 @@ function withBase(url, base) {
168
167
  function removeBase(url, base) {
169
168
  return addLeadingSlash(url).replace(new RegExp(`^${normalizeSlash(base)}`), '');
170
169
  }
171
- export { APPEARANCE_KEY, DEFAULT_HIGHLIGHT_LANGUAGES, HASH_REGEXP, MDX_OR_MD_REGEXP, QUERY_REGEXP, RSPRESS_TEMP_DIR, SEARCH_INDEX_NAME, addLeadingSlash, addTrailingSlash, utils_cleanUrl as cleanUrl, getSidebarDataGroup, inBrowser, isDataUrl, isDebugMode, isDevDebugMode, isExternalUrl, isProduction, isSCM, matchNavbar, matchSidebar, normalizeHref, normalizePosixPath, normalizeSlash, parseUrl, removeBase, removeHash, removeLeadingSlash, removeTrailingSlash, replaceLang, replaceVersion, slash, withBase, withoutLang };
170
+ export { APPEARANCE_KEY, DEFAULT_HIGHLIGHT_LANGUAGES, HASH_REGEXP, MDX_OR_MD_REGEXP, QUERY_REGEXP, RSPRESS_TEMP_DIR, SEARCH_INDEX_NAME, addLeadingSlash, addTrailingSlash, utils_cleanUrl as cleanUrl, getSidebarDataGroup, inBrowser, isDataUrl, isDebugMode, isDevDebugMode, isExternalUrl, isProduction, matchNavbar, matchSidebar, normalizeHref, normalizePosixPath, normalizeSlash, parseUrl, removeBase, removeHash, removeLeadingSlash, removeTrailingSlash, replaceLang, replaceVersion, slash, withBase, withoutLang };
@@ -6,7 +6,6 @@ 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 { RsbuildPlugin } from '@rsbuild/core';
10
9
 
11
10
  /**
12
11
  * There are two ways to define what addition routes represent.
@@ -385,7 +384,6 @@ declare interface PageIndexInfo {
385
384
  frontmatter: FrontMatterMeta;
386
385
  lang: string;
387
386
  version: string;
388
- domain: string;
389
387
  _filepath: string;
390
388
  _relativePath: string;
391
389
  }
@@ -394,20 +392,6 @@ declare type PageType = 'home' | 'doc' | 'custom' | '404' | 'blank';
394
392
 
395
393
  declare type PluginShikiOptions = RehypeShikiOptions;
396
394
 
397
- declare type RemoteSearchIndexInfo = string | {
398
- value: string;
399
- label: string;
400
- };
401
-
402
- declare type RemoteSearchOptions = SearchHooks & {
403
- mode: 'remote';
404
- apiUrl: string;
405
- domain?: string;
406
- indexName: string;
407
- searchIndexes?: RemoteSearchIndexInfo[];
408
- searchLoading?: boolean;
409
- };
410
-
411
395
  declare interface ReplaceRule {
412
396
  search: string | RegExp;
413
397
  replace: string;
@@ -525,7 +509,7 @@ declare interface SearchHooks {
525
509
  searchHooks?: string;
526
510
  }
527
511
 
528
- declare type SearchOptions = LocalSearchOptions | RemoteSearchOptions | false;
512
+ declare type SearchOptions = LocalSearchOptions | false;
529
513
 
530
514
  declare interface Sidebar {
531
515
  [path: string]: (SidebarGroup | SidebarItem | SidebarDivider | SidebarSectionHeader)[];
@@ -685,10 +669,6 @@ declare interface UserConfig<ThemeConfig = Config> {
685
669
  selector?: string;
686
670
  options?: ZoomOptions;
687
671
  };
688
- /**
689
- * Add some extra builder plugins
690
- */
691
- builderPlugins?: RsbuildPlugin[];
692
672
  /**
693
673
  * Multi version config
694
674
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/shared",
3
- "version": "2.0.0-beta.20",
3
+ "version": "2.0.0-beta.21",
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.3",
35
+ "@rsbuild/core": "~1.4.6",
36
36
  "@shikijs/rehype": "^3.4.2",
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.10.4",
42
+ "@rslib/core": "0.10.5",
43
43
  "@types/jest": "~29.5.14",
44
44
  "@types/lodash-es": "^4.17.12",
45
45
  "@types/node": "^22.8.1",