rspress 2.0.0-beta.16 → 2.0.0-beta.18
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.js +1 -1
- package/meta-json-schema.json +94 -192
- package/nav-json-schema.json +118 -0
- package/package.json +9 -7
- package/shiki-transformers.ts +2 -1
package/dist/index.js
CHANGED
@@ -6,7 +6,7 @@ import chokidar from "chokidar";
|
|
6
6
|
import picocolors from "picocolors";
|
7
7
|
import node_fs from "node:fs";
|
8
8
|
import { DEFAULT_CONFIG_EXTENSIONS, DEFAULT_CONFIG_NAME } from "@rspress/shared/constants";
|
9
|
-
var package_namespaceObject = JSON.parse('{"i8":"2.0.0-beta.
|
9
|
+
var package_namespaceObject = JSON.parse('{"i8":"2.0.0-beta.18"}');
|
10
10
|
const findConfig = (basePath)=>DEFAULT_CONFIG_EXTENSIONS.map((ext)=>basePath + ext).find(node_fs.existsSync);
|
11
11
|
async function loadConfigFile(customConfigFile) {
|
12
12
|
const baseDir = process.cwd();
|
package/meta-json-schema.json
CHANGED
@@ -3,264 +3,166 @@
|
|
3
3
|
"$ref": "#/definitions/MetaJson",
|
4
4
|
"definitions": {
|
5
5
|
"MetaJson": {
|
6
|
-
"
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
{
|
14
|
-
"type": "array",
|
15
|
-
"items": {
|
16
|
-
"$ref": "#/definitions/NavItem"
|
17
|
-
}
|
18
|
-
}
|
19
|
-
]
|
6
|
+
"$ref": "#/definitions/SideMeta"
|
7
|
+
},
|
8
|
+
"SideMeta": {
|
9
|
+
"type": "array",
|
10
|
+
"items": {
|
11
|
+
"$ref": "#/definitions/SideMetaItem"
|
12
|
+
}
|
20
13
|
},
|
21
14
|
"SideMetaItem": {
|
22
15
|
"anyOf": [
|
23
16
|
{
|
24
|
-
"
|
25
|
-
"properties": {
|
26
|
-
"type": {
|
27
|
-
"type": "string",
|
28
|
-
"const": "file"
|
29
|
-
},
|
30
|
-
"name": {
|
31
|
-
"type": "string"
|
32
|
-
},
|
33
|
-
"label": {
|
34
|
-
"type": "string"
|
35
|
-
},
|
36
|
-
"tag": {
|
37
|
-
"type": "string"
|
38
|
-
},
|
39
|
-
"overviewHeaders": {
|
40
|
-
"type": "array",
|
41
|
-
"items": {
|
42
|
-
"type": "number"
|
43
|
-
}
|
44
|
-
},
|
45
|
-
"context": {
|
46
|
-
"type": "string"
|
47
|
-
}
|
48
|
-
},
|
49
|
-
"required": [
|
50
|
-
"type",
|
51
|
-
"name"
|
52
|
-
],
|
53
|
-
"additionalProperties": false
|
17
|
+
"$ref": "#/definitions/FileSideMeta"
|
54
18
|
},
|
55
19
|
{
|
56
|
-
"
|
57
|
-
"properties": {
|
58
|
-
"type": {
|
59
|
-
"type": "string",
|
60
|
-
"const": "dir"
|
61
|
-
},
|
62
|
-
"name": {
|
63
|
-
"type": "string"
|
64
|
-
},
|
65
|
-
"label": {
|
66
|
-
"type": "string"
|
67
|
-
},
|
68
|
-
"collapsible": {
|
69
|
-
"type": "boolean"
|
70
|
-
},
|
71
|
-
"collapsed": {
|
72
|
-
"type": "boolean"
|
73
|
-
},
|
74
|
-
"tag": {
|
75
|
-
"type": "string"
|
76
|
-
},
|
77
|
-
"overviewHeaders": {
|
78
|
-
"type": "array",
|
79
|
-
"items": {
|
80
|
-
"type": "number"
|
81
|
-
}
|
82
|
-
},
|
83
|
-
"context": {
|
84
|
-
"type": "string"
|
85
|
-
}
|
86
|
-
},
|
87
|
-
"required": [
|
88
|
-
"type",
|
89
|
-
"name"
|
90
|
-
],
|
91
|
-
"additionalProperties": false
|
20
|
+
"$ref": "#/definitions/DirSideMeta"
|
92
21
|
},
|
93
22
|
{
|
94
|
-
"
|
95
|
-
"properties": {
|
96
|
-
"type": {
|
97
|
-
"type": "string",
|
98
|
-
"const": "divider"
|
99
|
-
},
|
100
|
-
"dashed": {
|
101
|
-
"type": "boolean"
|
102
|
-
}
|
103
|
-
},
|
104
|
-
"required": [
|
105
|
-
"type"
|
106
|
-
],
|
107
|
-
"additionalProperties": false
|
23
|
+
"$ref": "#/definitions/DividerSideMeta"
|
108
24
|
},
|
109
25
|
{
|
110
|
-
"
|
111
|
-
"properties": {
|
112
|
-
"type": {
|
113
|
-
"type": "string",
|
114
|
-
"const": "section-header"
|
115
|
-
},
|
116
|
-
"label": {
|
117
|
-
"type": "string"
|
118
|
-
},
|
119
|
-
"tag": {
|
120
|
-
"type": "string"
|
121
|
-
}
|
122
|
-
},
|
123
|
-
"required": [
|
124
|
-
"type",
|
125
|
-
"label"
|
126
|
-
],
|
127
|
-
"additionalProperties": false
|
26
|
+
"$ref": "#/definitions/SectionHeaderMeta"
|
128
27
|
},
|
129
28
|
{
|
130
|
-
"
|
131
|
-
"properties": {
|
132
|
-
"type": {
|
133
|
-
"type": "string",
|
134
|
-
"const": "custom-link"
|
135
|
-
},
|
136
|
-
"label": {
|
137
|
-
"type": "string"
|
138
|
-
},
|
139
|
-
"link": {
|
140
|
-
"type": "string"
|
141
|
-
},
|
142
|
-
"context": {
|
143
|
-
"type": "string"
|
144
|
-
},
|
145
|
-
"tag": {
|
146
|
-
"type": "string"
|
147
|
-
}
|
148
|
-
},
|
149
|
-
"required": [
|
150
|
-
"type",
|
151
|
-
"label",
|
152
|
-
"link"
|
153
|
-
],
|
154
|
-
"additionalProperties": false
|
29
|
+
"$ref": "#/definitions/CustomLinkMeta"
|
155
30
|
},
|
156
31
|
{
|
157
32
|
"type": "string"
|
158
33
|
}
|
159
34
|
]
|
160
35
|
},
|
161
|
-
"
|
162
|
-
"anyOf": [
|
163
|
-
{
|
164
|
-
"$ref": "#/definitions/NavItemWithLink"
|
165
|
-
},
|
166
|
-
{
|
167
|
-
"$ref": "#/definitions/NavItemWithChildren"
|
168
|
-
},
|
169
|
-
{
|
170
|
-
"$ref": "#/definitions/NavItemWithLinkAndChildren"
|
171
|
-
}
|
172
|
-
]
|
173
|
-
},
|
174
|
-
"NavItemWithLink": {
|
36
|
+
"FileSideMeta": {
|
175
37
|
"type": "object",
|
176
38
|
"properties": {
|
177
|
-
"
|
39
|
+
"type": {
|
40
|
+
"type": "string",
|
41
|
+
"const": "file"
|
42
|
+
},
|
43
|
+
"name": {
|
178
44
|
"type": "string"
|
179
45
|
},
|
180
|
-
"
|
46
|
+
"label": {
|
181
47
|
"type": "string"
|
182
48
|
},
|
183
49
|
"tag": {
|
184
50
|
"type": "string"
|
185
51
|
},
|
186
|
-
"
|
187
|
-
"type": "
|
52
|
+
"overviewHeaders": {
|
53
|
+
"type": "array",
|
54
|
+
"items": {
|
55
|
+
"type": "number"
|
56
|
+
}
|
188
57
|
},
|
189
|
-
"
|
190
|
-
"type": "string"
|
191
|
-
"enum": [
|
192
|
-
"left",
|
193
|
-
"right"
|
194
|
-
]
|
58
|
+
"context": {
|
59
|
+
"type": "string"
|
195
60
|
}
|
196
61
|
},
|
197
62
|
"required": [
|
198
|
-
"
|
199
|
-
"
|
63
|
+
"type",
|
64
|
+
"name"
|
200
65
|
],
|
201
66
|
"additionalProperties": false
|
202
67
|
},
|
203
|
-
"
|
68
|
+
"DirSideMeta": {
|
204
69
|
"type": "object",
|
205
70
|
"properties": {
|
206
|
-
"
|
71
|
+
"type": {
|
72
|
+
"type": "string",
|
73
|
+
"const": "dir"
|
74
|
+
},
|
75
|
+
"name": {
|
76
|
+
"type": "string"
|
77
|
+
},
|
78
|
+
"label": {
|
207
79
|
"type": "string"
|
208
80
|
},
|
81
|
+
"collapsible": {
|
82
|
+
"type": "boolean"
|
83
|
+
},
|
84
|
+
"collapsed": {
|
85
|
+
"type": "boolean"
|
86
|
+
},
|
209
87
|
"tag": {
|
210
88
|
"type": "string"
|
211
89
|
},
|
212
|
-
"
|
90
|
+
"overviewHeaders": {
|
213
91
|
"type": "array",
|
214
92
|
"items": {
|
215
|
-
"
|
93
|
+
"type": "number"
|
216
94
|
}
|
217
95
|
},
|
218
|
-
"
|
96
|
+
"context": {
|
97
|
+
"type": "string"
|
98
|
+
}
|
99
|
+
},
|
100
|
+
"required": [
|
101
|
+
"type",
|
102
|
+
"name"
|
103
|
+
],
|
104
|
+
"additionalProperties": false
|
105
|
+
},
|
106
|
+
"DividerSideMeta": {
|
107
|
+
"type": "object",
|
108
|
+
"properties": {
|
109
|
+
"type": {
|
219
110
|
"type": "string",
|
220
|
-
"
|
221
|
-
|
222
|
-
|
223
|
-
|
111
|
+
"const": "divider"
|
112
|
+
},
|
113
|
+
"dashed": {
|
114
|
+
"type": "boolean"
|
224
115
|
}
|
225
116
|
},
|
226
117
|
"required": [
|
227
|
-
"
|
118
|
+
"type"
|
228
119
|
],
|
229
120
|
"additionalProperties": false
|
230
121
|
},
|
231
|
-
"
|
122
|
+
"SectionHeaderMeta": {
|
232
123
|
"type": "object",
|
233
124
|
"properties": {
|
234
|
-
"
|
125
|
+
"type": {
|
126
|
+
"type": "string",
|
127
|
+
"const": "section-header"
|
128
|
+
},
|
129
|
+
"label": {
|
235
130
|
"type": "string"
|
236
131
|
},
|
237
|
-
"
|
132
|
+
"tag": {
|
238
133
|
"type": "string"
|
134
|
+
}
|
135
|
+
},
|
136
|
+
"required": [
|
137
|
+
"type",
|
138
|
+
"label"
|
139
|
+
],
|
140
|
+
"additionalProperties": false
|
141
|
+
},
|
142
|
+
"CustomLinkMeta": {
|
143
|
+
"type": "object",
|
144
|
+
"properties": {
|
145
|
+
"type": {
|
146
|
+
"type": "string",
|
147
|
+
"const": "custom-link"
|
239
148
|
},
|
240
|
-
"
|
241
|
-
"type": "
|
242
|
-
"items": {
|
243
|
-
"$ref": "#/definitions/NavItemWithLink"
|
244
|
-
}
|
149
|
+
"label": {
|
150
|
+
"type": "string"
|
245
151
|
},
|
246
|
-
"
|
152
|
+
"link": {
|
247
153
|
"type": "string"
|
248
154
|
},
|
249
|
-
"
|
155
|
+
"context": {
|
250
156
|
"type": "string"
|
251
157
|
},
|
252
|
-
"
|
253
|
-
"type": "string"
|
254
|
-
"enum": [
|
255
|
-
"left",
|
256
|
-
"right"
|
257
|
-
]
|
158
|
+
"tag": {
|
159
|
+
"type": "string"
|
258
160
|
}
|
259
161
|
},
|
260
162
|
"required": [
|
261
|
-
"
|
262
|
-
"
|
263
|
-
"
|
163
|
+
"type",
|
164
|
+
"label",
|
165
|
+
"link"
|
264
166
|
],
|
265
167
|
"additionalProperties": false
|
266
168
|
}
|
@@ -0,0 +1,118 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
3
|
+
"$ref": "#/definitions/NavJson",
|
4
|
+
"definitions": {
|
5
|
+
"NavJson": {
|
6
|
+
"type": "array",
|
7
|
+
"items": {
|
8
|
+
"$ref": "#/definitions/NavItem"
|
9
|
+
}
|
10
|
+
},
|
11
|
+
"NavItem": {
|
12
|
+
"anyOf": [
|
13
|
+
{
|
14
|
+
"$ref": "#/definitions/NavItemWithLink"
|
15
|
+
},
|
16
|
+
{
|
17
|
+
"$ref": "#/definitions/NavItemWithChildren"
|
18
|
+
},
|
19
|
+
{
|
20
|
+
"$ref": "#/definitions/NavItemWithLinkAndChildren"
|
21
|
+
}
|
22
|
+
]
|
23
|
+
},
|
24
|
+
"NavItemWithLink": {
|
25
|
+
"type": "object",
|
26
|
+
"properties": {
|
27
|
+
"text": {
|
28
|
+
"type": "string"
|
29
|
+
},
|
30
|
+
"link": {
|
31
|
+
"type": "string"
|
32
|
+
},
|
33
|
+
"tag": {
|
34
|
+
"type": "string"
|
35
|
+
},
|
36
|
+
"activeMatch": {
|
37
|
+
"type": "string"
|
38
|
+
},
|
39
|
+
"position": {
|
40
|
+
"type": "string",
|
41
|
+
"enum": [
|
42
|
+
"left",
|
43
|
+
"right"
|
44
|
+
]
|
45
|
+
}
|
46
|
+
},
|
47
|
+
"required": [
|
48
|
+
"text",
|
49
|
+
"link"
|
50
|
+
],
|
51
|
+
"additionalProperties": false
|
52
|
+
},
|
53
|
+
"NavItemWithChildren": {
|
54
|
+
"type": "object",
|
55
|
+
"properties": {
|
56
|
+
"text": {
|
57
|
+
"type": "string"
|
58
|
+
},
|
59
|
+
"tag": {
|
60
|
+
"type": "string"
|
61
|
+
},
|
62
|
+
"items": {
|
63
|
+
"type": "array",
|
64
|
+
"items": {
|
65
|
+
"$ref": "#/definitions/NavItemWithLink"
|
66
|
+
}
|
67
|
+
},
|
68
|
+
"position": {
|
69
|
+
"type": "string",
|
70
|
+
"enum": [
|
71
|
+
"left",
|
72
|
+
"right"
|
73
|
+
]
|
74
|
+
}
|
75
|
+
},
|
76
|
+
"required": [
|
77
|
+
"items"
|
78
|
+
],
|
79
|
+
"additionalProperties": false
|
80
|
+
},
|
81
|
+
"NavItemWithLinkAndChildren": {
|
82
|
+
"type": "object",
|
83
|
+
"properties": {
|
84
|
+
"text": {
|
85
|
+
"type": "string"
|
86
|
+
},
|
87
|
+
"link": {
|
88
|
+
"type": "string"
|
89
|
+
},
|
90
|
+
"items": {
|
91
|
+
"type": "array",
|
92
|
+
"items": {
|
93
|
+
"$ref": "#/definitions/NavItemWithLink"
|
94
|
+
}
|
95
|
+
},
|
96
|
+
"tag": {
|
97
|
+
"type": "string"
|
98
|
+
},
|
99
|
+
"activeMatch": {
|
100
|
+
"type": "string"
|
101
|
+
},
|
102
|
+
"position": {
|
103
|
+
"type": "string",
|
104
|
+
"enum": [
|
105
|
+
"left",
|
106
|
+
"right"
|
107
|
+
]
|
108
|
+
}
|
109
|
+
},
|
110
|
+
"required": [
|
111
|
+
"text",
|
112
|
+
"link",
|
113
|
+
"items"
|
114
|
+
],
|
115
|
+
"additionalProperties": false
|
116
|
+
}
|
117
|
+
}
|
118
|
+
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "rspress",
|
3
|
-
"version": "2.0.0-beta.
|
3
|
+
"version": "2.0.0-beta.18",
|
4
4
|
"repository": {
|
5
5
|
"type": "git",
|
6
6
|
"url": "git+https://github.com/web-infra-dev/rspress.git",
|
@@ -23,7 +23,8 @@
|
|
23
23
|
},
|
24
24
|
"./shiki-transformers": {
|
25
25
|
"default": "./shiki-transformers.ts"
|
26
|
-
}
|
26
|
+
},
|
27
|
+
"./package.json": "./package.json"
|
27
28
|
},
|
28
29
|
"main": "./dist/index.js",
|
29
30
|
"module": "./dist/index.js",
|
@@ -38,19 +39,20 @@
|
|
38
39
|
"theme.ts",
|
39
40
|
"config.ts",
|
40
41
|
"shiki-transformers.ts",
|
41
|
-
"meta-json-schema.json"
|
42
|
+
"meta-json-schema.json",
|
43
|
+
"nav-json-schema.json"
|
42
44
|
],
|
43
45
|
"dependencies": {
|
44
|
-
"@rsbuild/core": "~1.
|
46
|
+
"@rsbuild/core": "~1.4.0",
|
45
47
|
"cac": "^6.7.14",
|
46
48
|
"chokidar": "^3.6.0",
|
47
49
|
"picocolors": "^1.1.1",
|
48
|
-
"@rspress/core": "2.0.0-beta.
|
49
|
-
"@rspress/shared": "2.0.0-beta.
|
50
|
+
"@rspress/core": "2.0.0-beta.18",
|
51
|
+
"@rspress/shared": "2.0.0-beta.18"
|
50
52
|
},
|
51
53
|
"devDependencies": {
|
52
54
|
"@microsoft/api-extractor": "^7.52.8",
|
53
|
-
"@rslib/core": "0.10.
|
55
|
+
"@rslib/core": "0.10.3",
|
54
56
|
"@types/jest": "~29.5.14",
|
55
57
|
"@types/node": "^22.8.1",
|
56
58
|
"@types/react": "^19.1.8",
|
package/shiki-transformers.ts
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
export * from '@rspress/core/shiki-transformers';
|
1
|
+
// FIXME: rspack-resolver bug, export * from '@rspress/core/shiki-transformers';
|
2
|
+
export * from '@rspress/core/dist/shiki-transformers.js';
|