@rspress/shared 1.43.13 → 1.44.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/constants.js +12 -8
- package/dist/index.js +90 -32
- package/dist/index.mjs +2 -4
- package/dist/logger.js +8 -8
- package/dist/node-utils.js +21 -17
- package/package.json +3 -3
package/dist/constants.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
var __webpack_require__ = {};
|
3
3
|
(()=>{
|
4
|
-
__webpack_require__.d =
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
5
5
|
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
6
6
|
enumerable: true,
|
7
7
|
get: definition[key]
|
@@ -9,12 +9,10 @@ var __webpack_require__ = {};
|
|
9
9
|
};
|
10
10
|
})();
|
11
11
|
(()=>{
|
12
|
-
__webpack_require__.o =
|
13
|
-
return Object.prototype.hasOwnProperty.call(obj, prop);
|
14
|
-
};
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
15
13
|
})();
|
16
14
|
(()=>{
|
17
|
-
__webpack_require__.r =
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
18
16
|
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
19
17
|
value: 'Module'
|
20
18
|
});
|
@@ -47,8 +45,14 @@ const DEFAULT_PAGE_EXTENSIONS = [
|
|
47
45
|
'.md',
|
48
46
|
'.mdx'
|
49
47
|
];
|
50
|
-
|
51
|
-
|
52
|
-
|
48
|
+
exports.DEFAULT_CONFIG_EXTENSIONS = __webpack_exports__.DEFAULT_CONFIG_EXTENSIONS;
|
49
|
+
exports.DEFAULT_CONFIG_NAME = __webpack_exports__.DEFAULT_CONFIG_NAME;
|
50
|
+
exports.DEFAULT_PAGE_EXTENSIONS = __webpack_exports__.DEFAULT_PAGE_EXTENSIONS;
|
51
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
52
|
+
"DEFAULT_CONFIG_EXTENSIONS",
|
53
|
+
"DEFAULT_CONFIG_NAME",
|
54
|
+
"DEFAULT_PAGE_EXTENSIONS"
|
55
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
56
|
+
Object.defineProperty(exports, '__esModule', {
|
53
57
|
value: true
|
54
58
|
});
|
package/dist/index.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
var __webpack_require__ = {};
|
3
3
|
(()=>{
|
4
|
-
__webpack_require__.d =
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
5
5
|
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
6
6
|
enumerable: true,
|
7
7
|
get: definition[key]
|
@@ -9,12 +9,10 @@ var __webpack_require__ = {};
|
|
9
9
|
};
|
10
10
|
})();
|
11
11
|
(()=>{
|
12
|
-
__webpack_require__.o =
|
13
|
-
return Object.prototype.hasOwnProperty.call(obj, prop);
|
14
|
-
};
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
15
13
|
})();
|
16
14
|
(()=>{
|
17
|
-
__webpack_require__.r =
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
18
16
|
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
19
17
|
value: 'Module'
|
20
18
|
});
|
@@ -26,37 +24,37 @@ var __webpack_require__ = {};
|
|
26
24
|
var __webpack_exports__ = {};
|
27
25
|
__webpack_require__.r(__webpack_exports__);
|
28
26
|
__webpack_require__.d(__webpack_exports__, {
|
29
|
-
SEARCH_INDEX_NAME: ()=>SEARCH_INDEX_NAME,
|
30
27
|
RSPRESS_TEMP_DIR: ()=>RSPRESS_TEMP_DIR,
|
31
|
-
|
32
|
-
|
33
|
-
addTrailingSlash: ()=>addTrailingSlash,
|
28
|
+
parseUrl: ()=>parseUrl,
|
29
|
+
withBase: ()=>withBase,
|
34
30
|
slash: ()=>slash,
|
31
|
+
removeBase: ()=>removeBase,
|
32
|
+
replaceLang: ()=>replaceLang,
|
35
33
|
removeLeadingSlash: ()=>removeLeadingSlash,
|
36
|
-
|
34
|
+
addLeadingSlash: ()=>addLeadingSlash,
|
37
35
|
replaceVersion: ()=>replaceVersion,
|
36
|
+
isDevDebugMode: ()=>isDevDebugMode,
|
38
37
|
HASH_REGEXP: ()=>HASH_REGEXP,
|
39
|
-
|
38
|
+
withoutLang: ()=>withoutLang,
|
40
39
|
MDX_OR_MD_REGEXP: ()=>MDX_OR_MD_REGEXP,
|
41
|
-
|
40
|
+
SEARCH_INDEX_NAME: ()=>SEARCH_INDEX_NAME,
|
41
|
+
withoutBase: ()=>withoutBase,
|
42
|
+
isDebugMode: ()=>isDebugMode,
|
43
|
+
isExternalUrl: ()=>isExternalUrl,
|
44
|
+
isSCM: ()=>isSCM,
|
45
|
+
addTrailingSlash: ()=>addTrailingSlash,
|
42
46
|
normalizeSlash: ()=>normalizeSlash,
|
47
|
+
APPEARANCE_KEY: ()=>APPEARANCE_KEY,
|
48
|
+
normalizeHref: ()=>normalizeHref,
|
43
49
|
normalizePosixPath: ()=>normalizePosixPath,
|
44
|
-
inBrowser: ()=>inBrowser,
|
45
|
-
isDataUrl: ()=>isDataUrl,
|
46
|
-
replaceLang: ()=>replaceLang,
|
47
50
|
removeHash: ()=>removeHash,
|
48
|
-
cleanUrl: ()=>runtime_utils_cleanUrl,
|
49
|
-
withBase: ()=>withBase,
|
50
|
-
isDevDebugMode: ()=>isDevDebugMode,
|
51
51
|
removeTrailingSlash: ()=>removeTrailingSlash,
|
52
|
-
|
53
|
-
isExternalUrl: ()=>isExternalUrl,
|
54
|
-
removeBase: ()=>removeBase,
|
55
|
-
DEFAULT_HIGHLIGHT_LANGUAGES: ()=>DEFAULT_HIGHLIGHT_LANGUAGES,
|
56
|
-
parseUrl: ()=>parseUrl,
|
57
|
-
withoutLang: ()=>withoutLang,
|
52
|
+
QUERY_REGEXP: ()=>QUERY_REGEXP,
|
58
53
|
isProduction: ()=>isProduction,
|
59
|
-
|
54
|
+
DEFAULT_HIGHLIGHT_LANGUAGES: ()=>DEFAULT_HIGHLIGHT_LANGUAGES,
|
55
|
+
inBrowser: ()=>inBrowser,
|
56
|
+
isDataUrl: ()=>isDataUrl,
|
57
|
+
cleanUrl: ()=>runtime_utils_cleanUrl
|
60
58
|
});
|
61
59
|
const QUERY_REGEXP = /\?.*$/s;
|
62
60
|
const HASH_REGEXP = /#.*$/s;
|
@@ -193,10 +191,8 @@ function normalizeHref(url, cleanUrls = false) {
|
|
193
191
|
if (!url) return '/';
|
194
192
|
if (isExternalUrl(url)) return url;
|
195
193
|
let { url: cleanUrl, hash } = parseUrl(decodeURIComponent(url));
|
196
|
-
if (!cleanUrls && !cleanUrl.endsWith('.html'))
|
197
|
-
|
198
|
-
else cleanUrl += '.html';
|
199
|
-
}
|
194
|
+
if (!cleanUrls && !cleanUrl.endsWith('.html')) if (cleanUrl.endsWith('/')) cleanUrl += 'index.html';
|
195
|
+
else cleanUrl += '.html';
|
200
196
|
if (cleanUrls && cleanUrl.endsWith('/')) cleanUrl += 'index';
|
201
197
|
if (cleanUrls && cleanUrl.endsWith('.html')) cleanUrl = cleanUrl.replace(/\.html$/, '');
|
202
198
|
return addLeadingSlash(hash ? `${cleanUrl}#${hash}` : cleanUrl);
|
@@ -216,8 +212,70 @@ function withBase(url, base) {
|
|
216
212
|
function removeBase(url, base) {
|
217
213
|
return addLeadingSlash(url).replace(new RegExp(`^${normalizeSlash(base)}`), '');
|
218
214
|
}
|
219
|
-
|
220
|
-
|
221
|
-
|
215
|
+
exports.APPEARANCE_KEY = __webpack_exports__.APPEARANCE_KEY;
|
216
|
+
exports.DEFAULT_HIGHLIGHT_LANGUAGES = __webpack_exports__.DEFAULT_HIGHLIGHT_LANGUAGES;
|
217
|
+
exports.HASH_REGEXP = __webpack_exports__.HASH_REGEXP;
|
218
|
+
exports.MDX_OR_MD_REGEXP = __webpack_exports__.MDX_OR_MD_REGEXP;
|
219
|
+
exports.QUERY_REGEXP = __webpack_exports__.QUERY_REGEXP;
|
220
|
+
exports.RSPRESS_TEMP_DIR = __webpack_exports__.RSPRESS_TEMP_DIR;
|
221
|
+
exports.SEARCH_INDEX_NAME = __webpack_exports__.SEARCH_INDEX_NAME;
|
222
|
+
exports.addLeadingSlash = __webpack_exports__.addLeadingSlash;
|
223
|
+
exports.addTrailingSlash = __webpack_exports__.addTrailingSlash;
|
224
|
+
exports.cleanUrl = __webpack_exports__.cleanUrl;
|
225
|
+
exports.inBrowser = __webpack_exports__.inBrowser;
|
226
|
+
exports.isDataUrl = __webpack_exports__.isDataUrl;
|
227
|
+
exports.isDebugMode = __webpack_exports__.isDebugMode;
|
228
|
+
exports.isDevDebugMode = __webpack_exports__.isDevDebugMode;
|
229
|
+
exports.isExternalUrl = __webpack_exports__.isExternalUrl;
|
230
|
+
exports.isProduction = __webpack_exports__.isProduction;
|
231
|
+
exports.isSCM = __webpack_exports__.isSCM;
|
232
|
+
exports.normalizeHref = __webpack_exports__.normalizeHref;
|
233
|
+
exports.normalizePosixPath = __webpack_exports__.normalizePosixPath;
|
234
|
+
exports.normalizeSlash = __webpack_exports__.normalizeSlash;
|
235
|
+
exports.parseUrl = __webpack_exports__.parseUrl;
|
236
|
+
exports.removeBase = __webpack_exports__.removeBase;
|
237
|
+
exports.removeHash = __webpack_exports__.removeHash;
|
238
|
+
exports.removeLeadingSlash = __webpack_exports__.removeLeadingSlash;
|
239
|
+
exports.removeTrailingSlash = __webpack_exports__.removeTrailingSlash;
|
240
|
+
exports.replaceLang = __webpack_exports__.replaceLang;
|
241
|
+
exports.replaceVersion = __webpack_exports__.replaceVersion;
|
242
|
+
exports.slash = __webpack_exports__.slash;
|
243
|
+
exports.withBase = __webpack_exports__.withBase;
|
244
|
+
exports.withoutBase = __webpack_exports__.withoutBase;
|
245
|
+
exports.withoutLang = __webpack_exports__.withoutLang;
|
246
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
247
|
+
"APPEARANCE_KEY",
|
248
|
+
"DEFAULT_HIGHLIGHT_LANGUAGES",
|
249
|
+
"HASH_REGEXP",
|
250
|
+
"MDX_OR_MD_REGEXP",
|
251
|
+
"QUERY_REGEXP",
|
252
|
+
"RSPRESS_TEMP_DIR",
|
253
|
+
"SEARCH_INDEX_NAME",
|
254
|
+
"addLeadingSlash",
|
255
|
+
"addTrailingSlash",
|
256
|
+
"cleanUrl",
|
257
|
+
"inBrowser",
|
258
|
+
"isDataUrl",
|
259
|
+
"isDebugMode",
|
260
|
+
"isDevDebugMode",
|
261
|
+
"isExternalUrl",
|
262
|
+
"isProduction",
|
263
|
+
"isSCM",
|
264
|
+
"normalizeHref",
|
265
|
+
"normalizePosixPath",
|
266
|
+
"normalizeSlash",
|
267
|
+
"parseUrl",
|
268
|
+
"removeBase",
|
269
|
+
"removeHash",
|
270
|
+
"removeLeadingSlash",
|
271
|
+
"removeTrailingSlash",
|
272
|
+
"replaceLang",
|
273
|
+
"replaceVersion",
|
274
|
+
"slash",
|
275
|
+
"withBase",
|
276
|
+
"withoutBase",
|
277
|
+
"withoutLang"
|
278
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
279
|
+
Object.defineProperty(exports, '__esModule', {
|
222
280
|
value: true
|
223
281
|
});
|
package/dist/index.mjs
CHANGED
@@ -133,10 +133,8 @@ function normalizeHref(url, cleanUrls = false) {
|
|
133
133
|
if (!url) return '/';
|
134
134
|
if (isExternalUrl(url)) return url;
|
135
135
|
let { url: cleanUrl, hash } = parseUrl(decodeURIComponent(url));
|
136
|
-
if (!cleanUrls && !cleanUrl.endsWith('.html'))
|
137
|
-
|
138
|
-
else cleanUrl += '.html';
|
139
|
-
}
|
136
|
+
if (!cleanUrls && !cleanUrl.endsWith('.html')) if (cleanUrl.endsWith('/')) cleanUrl += 'index.html';
|
137
|
+
else cleanUrl += '.html';
|
140
138
|
if (cleanUrls && cleanUrl.endsWith('/')) cleanUrl += 'index';
|
141
139
|
if (cleanUrls && cleanUrl.endsWith('.html')) cleanUrl = cleanUrl.replace(/\.html$/, '');
|
142
140
|
return addLeadingSlash(hash ? `${cleanUrl}#${hash}` : cleanUrl);
|
package/dist/logger.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
var __webpack_require__ = {};
|
3
3
|
(()=>{
|
4
|
-
__webpack_require__.d =
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
5
5
|
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
6
6
|
enumerable: true,
|
7
7
|
get: definition[key]
|
@@ -9,12 +9,10 @@ var __webpack_require__ = {};
|
|
9
9
|
};
|
10
10
|
})();
|
11
11
|
(()=>{
|
12
|
-
__webpack_require__.o =
|
13
|
-
return Object.prototype.hasOwnProperty.call(obj, prop);
|
14
|
-
};
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
15
13
|
})();
|
16
14
|
(()=>{
|
17
|
-
__webpack_require__.r =
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
18
16
|
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
19
17
|
value: 'Module'
|
20
18
|
});
|
@@ -29,8 +27,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
29
27
|
logger: ()=>core_namespaceObject.logger
|
30
28
|
});
|
31
29
|
const core_namespaceObject = require("@rsbuild/core");
|
32
|
-
|
33
|
-
for(var __webpack_i__ in __webpack_exports__)
|
34
|
-
|
30
|
+
exports.logger = __webpack_exports__.logger;
|
31
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
32
|
+
"logger"
|
33
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
34
|
+
Object.defineProperty(exports, '__esModule', {
|
35
35
|
value: true
|
36
36
|
});
|
package/dist/node-utils.js
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
var __webpack_modules__ = {
|
3
3
|
"lodash-es": function(module) {
|
4
|
-
module.exports = import("lodash-es")
|
4
|
+
module.exports = import("lodash-es").then(function(module) {
|
5
|
+
return module;
|
6
|
+
});
|
5
7
|
}
|
6
8
|
};
|
7
9
|
var __webpack_module_cache__ = {};
|
@@ -15,12 +17,8 @@ function __webpack_require__(moduleId) {
|
|
15
17
|
return module.exports;
|
16
18
|
}
|
17
19
|
(()=>{
|
18
|
-
__webpack_require__.n =
|
19
|
-
var getter = module && module.__esModule ?
|
20
|
-
return module['default'];
|
21
|
-
} : function() {
|
22
|
-
return module;
|
23
|
-
};
|
20
|
+
__webpack_require__.n = (module)=>{
|
21
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
24
22
|
__webpack_require__.d(getter, {
|
25
23
|
a: getter
|
26
24
|
});
|
@@ -28,7 +26,7 @@ function __webpack_require__(moduleId) {
|
|
28
26
|
};
|
29
27
|
})();
|
30
28
|
(()=>{
|
31
|
-
__webpack_require__.d =
|
29
|
+
__webpack_require__.d = (exports1, definition)=>{
|
32
30
|
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
33
31
|
enumerable: true,
|
34
32
|
get: definition[key]
|
@@ -36,12 +34,10 @@ function __webpack_require__(moduleId) {
|
|
36
34
|
};
|
37
35
|
})();
|
38
36
|
(()=>{
|
39
|
-
__webpack_require__.o =
|
40
|
-
return Object.prototype.hasOwnProperty.call(obj, prop);
|
41
|
-
};
|
37
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
42
38
|
})();
|
43
39
|
(()=>{
|
44
|
-
__webpack_require__.r =
|
40
|
+
__webpack_require__.r = (exports1)=>{
|
45
41
|
if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
46
42
|
value: 'Module'
|
47
43
|
});
|
@@ -56,8 +52,8 @@ var __webpack_exports__ = {};
|
|
56
52
|
__webpack_require__.d(__webpack_exports__, {
|
57
53
|
extractTextAndId: ()=>extractTextAndId,
|
58
54
|
loadFrontMatter: ()=>loadFrontMatter,
|
59
|
-
|
60
|
-
|
55
|
+
mergeDocConfig: ()=>mergeDocConfig,
|
56
|
+
getNodeAttribute: ()=>getNodeAttribute
|
61
57
|
});
|
62
58
|
const extractTextAndId = (title)=>{
|
63
59
|
if (!title) return [
|
@@ -114,8 +110,16 @@ var __webpack_exports__ = {};
|
|
114
110
|
});
|
115
111
|
};
|
116
112
|
})();
|
117
|
-
|
118
|
-
|
119
|
-
|
113
|
+
exports.extractTextAndId = __webpack_exports__.extractTextAndId;
|
114
|
+
exports.getNodeAttribute = __webpack_exports__.getNodeAttribute;
|
115
|
+
exports.loadFrontMatter = __webpack_exports__.loadFrontMatter;
|
116
|
+
exports.mergeDocConfig = __webpack_exports__.mergeDocConfig;
|
117
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
118
|
+
"extractTextAndId",
|
119
|
+
"getNodeAttribute",
|
120
|
+
"loadFrontMatter",
|
121
|
+
"mergeDocConfig"
|
122
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
123
|
+
Object.defineProperty(exports, '__esModule', {
|
120
124
|
value: true
|
121
125
|
});
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@rspress/shared",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.44.0",
|
4
4
|
"repository": {
|
5
5
|
"type": "git",
|
6
6
|
"url": "https://github.com/web-infra-dev/rspress",
|
@@ -36,13 +36,13 @@
|
|
36
36
|
"dist"
|
37
37
|
],
|
38
38
|
"dependencies": {
|
39
|
-
"@rsbuild/core": "1.3.
|
39
|
+
"@rsbuild/core": "~1.3.18",
|
40
40
|
"gray-matter": "4.0.3",
|
41
41
|
"lodash-es": "^4.17.21",
|
42
42
|
"unified": "^10.1.2"
|
43
43
|
},
|
44
44
|
"devDependencies": {
|
45
|
-
"@rslib/core": "0.
|
45
|
+
"@rslib/core": "~0.6.9",
|
46
46
|
"@types/fs-extra": "11.0.4",
|
47
47
|
"@types/jest": "~29.5.14",
|
48
48
|
"@types/lodash-es": "^4.17.12",
|