@rspress/shared 2.0.0-beta.26 → 2.0.0-beta.28

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
@@ -28,8 +28,6 @@ export declare const cleanUrl: (url: string) => string;
28
28
 
29
29
  export declare type Config = UserConfig | Promise<UserConfig> | ((...args: Parameters<typeof loadConfig>) => UserConfig | Promise<UserConfig>);
30
30
 
31
- export declare const DEFAULT_HIGHLIGHT_LANGUAGES: string[][];
32
-
33
31
  export declare interface DefaultThemeConfig {
34
32
  /**
35
33
  * Whether to enable dark mode.
package/dist/index.js CHANGED
@@ -19,32 +19,6 @@ const MDX_OR_MD_REGEXP = /\.mdx?$/;
19
19
  const APPEARANCE_KEY = 'rspress-theme-appearance';
20
20
  const SEARCH_INDEX_NAME = 'search_index';
21
21
  const RSPRESS_TEMP_DIR = '.rspress';
22
- const DEFAULT_HIGHLIGHT_LANGUAGES = [
23
- [
24
- 'js',
25
- "javascript"
26
- ],
27
- [
28
- 'ts',
29
- "typescript"
30
- ],
31
- [
32
- 'jsx',
33
- 'tsx'
34
- ],
35
- [
36
- 'xml',
37
- 'xml-doc'
38
- ],
39
- [
40
- 'md',
41
- 'markdown'
42
- ],
43
- [
44
- 'mdx',
45
- 'tsx'
46
- ]
47
- ];
48
22
  const isProduction = ()=>'production' === process.env.NODE_ENV;
49
23
  const isDebugMode = ()=>{
50
24
  if (!process.env.DEBUG) return false;
@@ -153,7 +127,7 @@ function normalizeHref(url, cleanUrls = false) {
153
127
  if (cleanUrl.endsWith('.html')) cleanUrl = cleanUrl.replace(/\.html$/, '');
154
128
  if (cleanUrls && cleanUrl.endsWith('/index')) cleanUrl = cleanUrl.replace(/\/index$/, '/');
155
129
  } else {
156
- const hasExt = /\.[a-zA-Z]\w*$/.test(cleanUrl);
130
+ const hasExt = cleanUrl.endsWith('.html');
157
131
  if (!hasExt) if (cleanUrl.endsWith('/')) cleanUrl += 'index.html';
158
132
  else cleanUrl += '.html';
159
133
  }
@@ -171,4 +145,4 @@ function withBase(url, base) {
171
145
  function removeBase(url, base) {
172
146
  return addLeadingSlash(url).replace(new RegExp(`^${normalizeSlash(base)}`), '');
173
147
  }
174
- 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 };
148
+ export { APPEARANCE_KEY, 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/shared",
3
- "version": "2.0.0-beta.26",
3
+ "version": "2.0.0-beta.28",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/web-infra-dev/rspress.git",
@@ -39,11 +39,11 @@
39
39
  "unified": "^11.0.5"
40
40
  },
41
41
  "devDependencies": {
42
- "@rslib/core": "0.11.2",
42
+ "@rslib/core": "0.12.1",
43
43
  "@types/jest": "~29.5.14",
44
44
  "@types/lodash-es": "^4.17.12",
45
45
  "@types/node": "^22.8.1",
46
- "@types/react": "^19.1.9",
46
+ "@types/react": "^19.1.10",
47
47
  "mdast-util-mdx-jsx": "^3.2.0",
48
48
  "medium-zoom": "1.1.0",
49
49
  "rimraf": "^6.0.1",
@@ -57,6 +57,7 @@
57
57
  "scripts": {
58
58
  "build": "rslib build",
59
59
  "build:watch": "rslib build -w",
60
+ "dev": "rslib build -w",
60
61
  "reset": "rimraf ./**/node_modules"
61
62
  }
62
63
  }