@rspress/shared 2.0.0-alpha.6 → 2.0.0-alpha.8
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 +9 -3
- package/dist/index.d.ts +2 -1
- package/dist/index.js +67 -7
- package/dist/index.mjs +2 -4
- package/dist/logger.js +5 -3
- package/dist/node-utils.d.ts +2 -1
- package/dist/node-utils.js +11 -3
- package/package.json +4 -4
package/dist/constants.js
CHANGED
@@ -45,8 +45,14 @@ const DEFAULT_PAGE_EXTENSIONS = [
|
|
45
45
|
'.md',
|
46
46
|
'.mdx'
|
47
47
|
];
|
48
|
-
|
49
|
-
|
50
|
-
|
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', {
|
51
57
|
value: true
|
52
58
|
});
|
package/dist/index.d.ts
CHANGED
@@ -210,6 +210,7 @@ export declare interface FrontMatterMeta {
|
|
210
210
|
titleSuffix?: string;
|
211
211
|
head?: [string, Record<string, string>][];
|
212
212
|
context?: string;
|
213
|
+
footer?: boolean;
|
213
214
|
[key: string]: unknown;
|
214
215
|
}
|
215
216
|
|
@@ -737,7 +738,7 @@ export declare type SocialLinkIcon = 'lark' | 'discord' | 'facebook' | 'github'
|
|
737
738
|
};
|
738
739
|
|
739
740
|
export declare type SSGConfig = boolean | {
|
740
|
-
|
741
|
+
fallback?: false | 'csr';
|
741
742
|
};
|
742
743
|
|
743
744
|
export declare interface UserConfig<ThemeConfig = DefaultThemeConfig> {
|
package/dist/index.js
CHANGED
@@ -195,10 +195,8 @@ function normalizeHref(url, cleanUrls = false) {
|
|
195
195
|
if (cleanUrls) {
|
196
196
|
if (cleanUrl.endsWith('.html')) cleanUrl = cleanUrl.replace(/\.html$/, '');
|
197
197
|
if (cleanUrls && cleanUrl.endsWith('/index')) cleanUrl = cleanUrl.replace(/\/index$/, '/');
|
198
|
-
} else if (!cleanUrl.endsWith('.html'))
|
199
|
-
|
200
|
-
else cleanUrl += '.html';
|
201
|
-
}
|
198
|
+
} else if (!cleanUrl.endsWith('.html')) if (cleanUrl.endsWith('/')) cleanUrl += 'index.html';
|
199
|
+
else cleanUrl += '.html';
|
202
200
|
return addLeadingSlash(hash ? `${cleanUrl}#${hash}` : cleanUrl);
|
203
201
|
}
|
204
202
|
function withoutLang(path, langs) {
|
@@ -216,8 +214,70 @@ function withBase(url, base) {
|
|
216
214
|
function removeBase(url, base) {
|
217
215
|
return addLeadingSlash(url).replace(new RegExp(`^${normalizeSlash(base)}`), '');
|
218
216
|
}
|
219
|
-
|
220
|
-
|
221
|
-
|
217
|
+
exports.APPEARANCE_KEY = __webpack_exports__.APPEARANCE_KEY;
|
218
|
+
exports.DEFAULT_HIGHLIGHT_LANGUAGES = __webpack_exports__.DEFAULT_HIGHLIGHT_LANGUAGES;
|
219
|
+
exports.HASH_REGEXP = __webpack_exports__.HASH_REGEXP;
|
220
|
+
exports.MDX_OR_MD_REGEXP = __webpack_exports__.MDX_OR_MD_REGEXP;
|
221
|
+
exports.QUERY_REGEXP = __webpack_exports__.QUERY_REGEXP;
|
222
|
+
exports.RSPRESS_TEMP_DIR = __webpack_exports__.RSPRESS_TEMP_DIR;
|
223
|
+
exports.SEARCH_INDEX_NAME = __webpack_exports__.SEARCH_INDEX_NAME;
|
224
|
+
exports.addLeadingSlash = __webpack_exports__.addLeadingSlash;
|
225
|
+
exports.addTrailingSlash = __webpack_exports__.addTrailingSlash;
|
226
|
+
exports.cleanUrl = __webpack_exports__.cleanUrl;
|
227
|
+
exports.inBrowser = __webpack_exports__.inBrowser;
|
228
|
+
exports.isDataUrl = __webpack_exports__.isDataUrl;
|
229
|
+
exports.isDebugMode = __webpack_exports__.isDebugMode;
|
230
|
+
exports.isDevDebugMode = __webpack_exports__.isDevDebugMode;
|
231
|
+
exports.isExternalUrl = __webpack_exports__.isExternalUrl;
|
232
|
+
exports.isProduction = __webpack_exports__.isProduction;
|
233
|
+
exports.isSCM = __webpack_exports__.isSCM;
|
234
|
+
exports.normalizeHref = __webpack_exports__.normalizeHref;
|
235
|
+
exports.normalizePosixPath = __webpack_exports__.normalizePosixPath;
|
236
|
+
exports.normalizeSlash = __webpack_exports__.normalizeSlash;
|
237
|
+
exports.parseUrl = __webpack_exports__.parseUrl;
|
238
|
+
exports.removeBase = __webpack_exports__.removeBase;
|
239
|
+
exports.removeHash = __webpack_exports__.removeHash;
|
240
|
+
exports.removeLeadingSlash = __webpack_exports__.removeLeadingSlash;
|
241
|
+
exports.removeTrailingSlash = __webpack_exports__.removeTrailingSlash;
|
242
|
+
exports.replaceLang = __webpack_exports__.replaceLang;
|
243
|
+
exports.replaceVersion = __webpack_exports__.replaceVersion;
|
244
|
+
exports.slash = __webpack_exports__.slash;
|
245
|
+
exports.withBase = __webpack_exports__.withBase;
|
246
|
+
exports.withoutBase = __webpack_exports__.withoutBase;
|
247
|
+
exports.withoutLang = __webpack_exports__.withoutLang;
|
248
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
249
|
+
"APPEARANCE_KEY",
|
250
|
+
"DEFAULT_HIGHLIGHT_LANGUAGES",
|
251
|
+
"HASH_REGEXP",
|
252
|
+
"MDX_OR_MD_REGEXP",
|
253
|
+
"QUERY_REGEXP",
|
254
|
+
"RSPRESS_TEMP_DIR",
|
255
|
+
"SEARCH_INDEX_NAME",
|
256
|
+
"addLeadingSlash",
|
257
|
+
"addTrailingSlash",
|
258
|
+
"cleanUrl",
|
259
|
+
"inBrowser",
|
260
|
+
"isDataUrl",
|
261
|
+
"isDebugMode",
|
262
|
+
"isDevDebugMode",
|
263
|
+
"isExternalUrl",
|
264
|
+
"isProduction",
|
265
|
+
"isSCM",
|
266
|
+
"normalizeHref",
|
267
|
+
"normalizePosixPath",
|
268
|
+
"normalizeSlash",
|
269
|
+
"parseUrl",
|
270
|
+
"removeBase",
|
271
|
+
"removeHash",
|
272
|
+
"removeLeadingSlash",
|
273
|
+
"removeTrailingSlash",
|
274
|
+
"replaceLang",
|
275
|
+
"replaceVersion",
|
276
|
+
"slash",
|
277
|
+
"withBase",
|
278
|
+
"withoutBase",
|
279
|
+
"withoutLang"
|
280
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
281
|
+
Object.defineProperty(exports, '__esModule', {
|
222
282
|
value: true
|
223
283
|
});
|
package/dist/index.mjs
CHANGED
@@ -137,10 +137,8 @@ function normalizeHref(url, cleanUrls = false) {
|
|
137
137
|
if (cleanUrls) {
|
138
138
|
if (cleanUrl.endsWith('.html')) cleanUrl = cleanUrl.replace(/\.html$/, '');
|
139
139
|
if (cleanUrls && cleanUrl.endsWith('/index')) cleanUrl = cleanUrl.replace(/\/index$/, '/');
|
140
|
-
} else if (!cleanUrl.endsWith('.html'))
|
141
|
-
|
142
|
-
else cleanUrl += '.html';
|
143
|
-
}
|
140
|
+
} else if (!cleanUrl.endsWith('.html')) if (cleanUrl.endsWith('/')) cleanUrl += 'index.html';
|
141
|
+
else cleanUrl += '.html';
|
144
142
|
return addLeadingSlash(hash ? `${cleanUrl}#${hash}` : cleanUrl);
|
145
143
|
}
|
146
144
|
function withoutLang(path, langs) {
|
package/dist/logger.js
CHANGED
@@ -27,8 +27,10 @@ __webpack_require__.d(__webpack_exports__, {
|
|
27
27
|
logger: ()=>core_namespaceObject.logger
|
28
28
|
});
|
29
29
|
const core_namespaceObject = require("@rsbuild/core");
|
30
|
-
|
31
|
-
for(var __webpack_i__ in __webpack_exports__)
|
32
|
-
|
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', {
|
33
35
|
value: true
|
34
36
|
});
|
package/dist/node-utils.d.ts
CHANGED
@@ -203,6 +203,7 @@ declare interface FrontMatterMeta {
|
|
203
203
|
titleSuffix?: string;
|
204
204
|
head?: [string, Record<string, string>][];
|
205
205
|
context?: string;
|
206
|
+
footer?: boolean;
|
206
207
|
[key: string]: unknown;
|
207
208
|
}
|
208
209
|
|
@@ -570,7 +571,7 @@ declare type SocialLinkIcon = 'lark' | 'discord' | 'facebook' | 'github' | 'inst
|
|
570
571
|
};
|
571
572
|
|
572
573
|
declare type SSGConfig = boolean | {
|
573
|
-
|
574
|
+
fallback?: false | 'csr';
|
574
575
|
};
|
575
576
|
|
576
577
|
declare interface UserConfig<ThemeConfig = Config> {
|
package/dist/node-utils.js
CHANGED
@@ -108,8 +108,16 @@ var __webpack_exports__ = {};
|
|
108
108
|
});
|
109
109
|
};
|
110
110
|
})();
|
111
|
-
|
112
|
-
|
113
|
-
|
111
|
+
exports.extractTextAndId = __webpack_exports__.extractTextAndId;
|
112
|
+
exports.getNodeAttribute = __webpack_exports__.getNodeAttribute;
|
113
|
+
exports.loadFrontMatter = __webpack_exports__.loadFrontMatter;
|
114
|
+
exports.mergeDocConfig = __webpack_exports__.mergeDocConfig;
|
115
|
+
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
116
|
+
"extractTextAndId",
|
117
|
+
"getNodeAttribute",
|
118
|
+
"loadFrontMatter",
|
119
|
+
"mergeDocConfig"
|
120
|
+
].indexOf(__webpack_i__)) exports[__webpack_i__] = __webpack_exports__[__webpack_i__];
|
121
|
+
Object.defineProperty(exports, '__esModule', {
|
114
122
|
value: true
|
115
123
|
});
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@rspress/shared",
|
3
|
-
"version": "2.0.0-alpha.
|
3
|
+
"version": "2.0.0-alpha.8",
|
4
4
|
"repository": {
|
5
5
|
"type": "git",
|
6
6
|
"url": "https://github.com/web-infra-dev/rspress",
|
@@ -36,18 +36,18 @@
|
|
36
36
|
"dist"
|
37
37
|
],
|
38
38
|
"dependencies": {
|
39
|
-
"@rsbuild/core": "1.
|
39
|
+
"@rsbuild/core": "1.3.0",
|
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.0",
|
46
46
|
"@types/fs-extra": "11.0.4",
|
47
47
|
"@types/jest": "~29.5.14",
|
48
48
|
"@types/lodash-es": "^4.17.12",
|
49
49
|
"@types/node": "^18.11.17",
|
50
|
-
"@types/react": "^18.3.
|
50
|
+
"@types/react": "^18.3.20",
|
51
51
|
"mdast-util-mdx-jsx": "^2.1.4",
|
52
52
|
"medium-zoom": "1.1.0",
|
53
53
|
"rimraf": "^6.0.1",
|