@rspress/core 1.39.3 → 1.40.0
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 +1 -1
- package/dist/index.js +1006 -902
- package/dist/index.js.map +1 -1
- package/dist/loader.d.ts +7 -7
- package/dist/loader.js +102 -104
- package/dist/loader.js.map +1 -1
- package/dist/runtime/App.js +9 -9
- package/dist/runtime/clientEntry.js +5 -5
- package/dist/runtime/ssrEntry.js +1 -1
- package/index.html +12 -14
- package/package.json +42 -41
- package/src/runtime/App.tsx +8 -8
- package/src/runtime/clientEntry.tsx +4 -4
- package/src/runtime/ssrEntry.tsx +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspress/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.40.0",
|
|
4
4
|
"description": "The Rspress Documentation Framework",
|
|
5
5
|
"bugs": "https://github.com/web-infra-dev/rspress/issues",
|
|
6
6
|
"repository": {
|
|
@@ -9,11 +9,16 @@
|
|
|
9
9
|
"directory": "packages/cli/core"
|
|
10
10
|
},
|
|
11
11
|
"license": "MIT",
|
|
12
|
+
"sideEffects": [
|
|
13
|
+
"*.css",
|
|
14
|
+
"*.less",
|
|
15
|
+
"*.sass",
|
|
16
|
+
"*.scss",
|
|
17
|
+
"**/virtual-global-styles.js",
|
|
18
|
+
"virtual-global-styles",
|
|
19
|
+
"./src/theme-default/styles/index.ts"
|
|
20
|
+
],
|
|
12
21
|
"type": "module",
|
|
13
|
-
"jsnext:source": "./src/index.ts",
|
|
14
|
-
"types": "./dist/index.d.ts",
|
|
15
|
-
"main": "./dist/index.js",
|
|
16
|
-
"module": "./dist/node/index.js",
|
|
17
22
|
"exports": {
|
|
18
23
|
".": {
|
|
19
24
|
"types": "./dist/index.d.ts",
|
|
@@ -29,18 +34,29 @@
|
|
|
29
34
|
"default": "./runtime.ts"
|
|
30
35
|
}
|
|
31
36
|
},
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
37
|
+
"main": "./dist/index.js",
|
|
38
|
+
"module": "./dist/node/index.js",
|
|
39
|
+
"types": "./dist/index.d.ts",
|
|
40
|
+
"files": [
|
|
41
|
+
"dist",
|
|
42
|
+
"src/runtime",
|
|
43
|
+
"src/theme-default",
|
|
44
|
+
"src/shared",
|
|
45
|
+
"index.html",
|
|
46
|
+
"runtime.ts",
|
|
47
|
+
"theme.ts",
|
|
48
|
+
"loader.cjs",
|
|
49
|
+
"compiled"
|
|
50
|
+
],
|
|
35
51
|
"dependencies": {
|
|
36
52
|
"@mdx-js/loader": "2.3.0",
|
|
37
53
|
"@mdx-js/mdx": "2.3.0",
|
|
38
54
|
"@mdx-js/react": "2.3.0",
|
|
39
|
-
"@rsbuild/core": "~1.1.
|
|
55
|
+
"@rsbuild/core": "~1.1.13",
|
|
40
56
|
"@rsbuild/plugin-less": "~1.1.0",
|
|
41
57
|
"@rsbuild/plugin-react": "~1.1.0",
|
|
42
58
|
"@rsbuild/plugin-sass": "~1.1.2",
|
|
43
|
-
"@rspress/mdx-rs": "0.6.
|
|
59
|
+
"@rspress/mdx-rs": "0.6.6",
|
|
44
60
|
"enhanced-resolve": "5.18.0",
|
|
45
61
|
"github-slugger": "^2.0.0",
|
|
46
62
|
"hast-util-from-html": "^2.0.3",
|
|
@@ -49,6 +65,7 @@
|
|
|
49
65
|
"htmr": "^1.0.2",
|
|
50
66
|
"lodash-es": "^4.17.21",
|
|
51
67
|
"mdast-util-mdxjs-esm": "^1.3.1",
|
|
68
|
+
"memfs": "^4.17.0",
|
|
52
69
|
"react": "^18.3.1",
|
|
53
70
|
"react-dom": "^18.3.1",
|
|
54
71
|
"react-helmet-async": "^1.3.0",
|
|
@@ -61,22 +78,22 @@
|
|
|
61
78
|
"unified": "^10.1.2",
|
|
62
79
|
"unist-util-visit": "^4.1.2",
|
|
63
80
|
"unist-util-visit-children": "^3.0.0",
|
|
64
|
-
"@rspress/plugin-
|
|
65
|
-
"@rspress/plugin-
|
|
66
|
-
"@rspress/plugin-
|
|
67
|
-
"@rspress/plugin-
|
|
68
|
-
"@rspress/runtime": "1.
|
|
69
|
-
"@rspress/
|
|
70
|
-
"@rspress/
|
|
81
|
+
"@rspress/plugin-container-syntax": "1.40.0",
|
|
82
|
+
"@rspress/plugin-auto-nav-sidebar": "1.40.0",
|
|
83
|
+
"@rspress/plugin-last-updated": "1.40.0",
|
|
84
|
+
"@rspress/plugin-medium-zoom": "1.40.0",
|
|
85
|
+
"@rspress/runtime": "1.40.0",
|
|
86
|
+
"@rspress/theme-default": "1.40.0",
|
|
87
|
+
"@rspress/shared": "1.40.0"
|
|
71
88
|
},
|
|
72
89
|
"devDependencies": {
|
|
73
|
-
"@modern-js/plugin-tailwindcss": "2.63.
|
|
74
|
-
"@modern-js/tsconfig": "2.63.
|
|
90
|
+
"@modern-js/plugin-tailwindcss": "2.63.6",
|
|
91
|
+
"@modern-js/tsconfig": "2.63.6",
|
|
75
92
|
"@types/hast": "3.0.4",
|
|
76
93
|
"@types/html-to-text": "^9.0.4",
|
|
77
94
|
"@types/jest": "~29.5.14",
|
|
78
95
|
"@types/lodash-es": "^4.17.12",
|
|
79
|
-
"@types/mdast": "^
|
|
96
|
+
"@types/mdast": "^3.0.15",
|
|
80
97
|
"@types/node": "^18.11.17",
|
|
81
98
|
"@types/react": "^18.3.18",
|
|
82
99
|
"@types/react-dom": "^18.3.5",
|
|
@@ -89,34 +106,18 @@
|
|
|
89
106
|
"typescript": "^5.5.3",
|
|
90
107
|
"vitest": "2.1.8"
|
|
91
108
|
},
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
|
|
95
|
-
"*.sass",
|
|
96
|
-
"*.scss",
|
|
97
|
-
"**/virtual-global-styles.js",
|
|
98
|
-
"virtual-global-styles",
|
|
99
|
-
"./src/theme-default/styles/index.ts"
|
|
100
|
-
],
|
|
101
|
-
"files": [
|
|
102
|
-
"dist",
|
|
103
|
-
"src/runtime",
|
|
104
|
-
"src/theme-default",
|
|
105
|
-
"src/shared",
|
|
106
|
-
"index.html",
|
|
107
|
-
"runtime.ts",
|
|
108
|
-
"theme.ts",
|
|
109
|
-
"loader.cjs",
|
|
110
|
-
"compiled"
|
|
111
|
-
],
|
|
109
|
+
"engines": {
|
|
110
|
+
"node": ">=14.17.6"
|
|
111
|
+
},
|
|
112
112
|
"publishConfig": {
|
|
113
113
|
"access": "public",
|
|
114
114
|
"provenance": true,
|
|
115
115
|
"registry": "https://registry.npmjs.org/"
|
|
116
116
|
},
|
|
117
|
+
"jsnext:source": "./src/index.ts",
|
|
117
118
|
"scripts": {
|
|
118
|
-
"dev": "modern build -w",
|
|
119
119
|
"build": "modern build",
|
|
120
|
+
"dev": "modern build -w",
|
|
120
121
|
"reset": "rimraf ./**/node_modules",
|
|
121
122
|
"test": "vitest run --passWithNoTests"
|
|
122
123
|
}
|
package/src/runtime/App.tsx
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import siteData from 'virtual-site-data';
|
|
2
1
|
import {
|
|
3
|
-
|
|
4
|
-
useLocation,
|
|
2
|
+
DataContext,
|
|
5
3
|
isEqualPath,
|
|
4
|
+
matchRoutes,
|
|
6
5
|
normalizeRoutePath,
|
|
7
|
-
|
|
6
|
+
useLocation,
|
|
8
7
|
} from '@rspress/runtime';
|
|
9
|
-
import { HelmetProvider } from 'react-helmet-async';
|
|
10
|
-
import React, { useContext, useLayoutEffect } from 'react';
|
|
11
8
|
import {
|
|
12
9
|
type Header,
|
|
10
|
+
MDX_REGEXP,
|
|
13
11
|
type PageData,
|
|
14
12
|
cleanUrl,
|
|
15
|
-
MDX_REGEXP,
|
|
16
13
|
} from '@rspress/shared';
|
|
17
|
-
import globalComponents from 'virtual-global-components';
|
|
18
14
|
import Theme from '@theme';
|
|
15
|
+
import React, { useContext, useLayoutEffect } from 'react';
|
|
16
|
+
import { HelmetProvider } from 'react-helmet-async';
|
|
17
|
+
import globalComponents from 'virtual-global-components';
|
|
18
|
+
import siteData from 'virtual-site-data';
|
|
19
19
|
import 'virtual-global-styles';
|
|
20
20
|
|
|
21
21
|
export enum QueryStatus {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { useState, useMemo } from 'react';
|
|
2
|
-
import { isProduction } from '@rspress/shared';
|
|
3
|
-
import siteData from 'virtual-site-data';
|
|
4
1
|
import {
|
|
2
|
+
BrowserRouter,
|
|
5
3
|
DataContext,
|
|
6
4
|
ThemeContext,
|
|
7
5
|
normalizeRoutePath,
|
|
8
|
-
BrowserRouter,
|
|
9
6
|
} from '@rspress/runtime';
|
|
7
|
+
import { isProduction } from '@rspress/shared';
|
|
8
|
+
import { useMemo, useState } from 'react';
|
|
9
|
+
import siteData from 'virtual-site-data';
|
|
10
10
|
import { App, initPageData } from './App';
|
|
11
11
|
|
|
12
12
|
const enableSSG = siteData.ssg;
|
package/src/runtime/ssrEntry.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { renderToString } from 'react-dom/server';
|
|
2
|
-
import type { PageData } from '@rspress/shared';
|
|
3
1
|
import { DataContext, ThemeContext } from '@rspress/runtime';
|
|
4
2
|
import { StaticRouter } from '@rspress/runtime/server';
|
|
3
|
+
import type { PageData } from '@rspress/shared';
|
|
4
|
+
import { renderToString } from 'react-dom/server';
|
|
5
5
|
import { App, initPageData } from './App';
|
|
6
6
|
|
|
7
7
|
const DEFAULT_THEME = 'light';
|