@rspress/shared 2.0.22 → 2.0.23
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/LICENSE +21 -0
- package/dist/gray-matter.js +1 -4
- package/dist/index.js +2 -2
- package/package.json +4 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023-present Bytedance, Inc. and its affiliates.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/gray-matter.js
CHANGED
|
@@ -22,7 +22,7 @@ moduleFactories.add({
|
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
24
|
"../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/index.js" (module) {
|
|
25
|
-
const fs =
|
|
25
|
+
const fs = __rspack_createRequire_require("fs");
|
|
26
26
|
const sections = rspackRequire("../../node_modules/.pnpm/section-matter@1.0.0/node_modules/section-matter/index.js");
|
|
27
27
|
const defaults = rspackRequire("../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/defaults.js");
|
|
28
28
|
const stringify = rspackRequire("../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/lib/stringify.js");
|
|
@@ -2758,9 +2758,6 @@ moduleFactories.add({
|
|
|
2758
2758
|
if ('string' == typeof str && '\ufeff' === str.charAt(0)) return str.slice(1);
|
|
2759
2759
|
return str;
|
|
2760
2760
|
};
|
|
2761
|
-
},
|
|
2762
|
-
fs (module) {
|
|
2763
|
-
module.exports = __rspack_createRequire_require("fs");
|
|
2764
2761
|
}
|
|
2765
2762
|
});
|
|
2766
2763
|
const gray_matter = rspackRequire("../../node_modules/.pnpm/gray-matter@4.0.3/node_modules/gray-matter/index.js");
|
package/dist/index.js
CHANGED
|
@@ -132,7 +132,7 @@ function normalizeSlash(url) {
|
|
|
132
132
|
function withBase(url, base) {
|
|
133
133
|
const normalizedUrl = addLeadingSlash(url);
|
|
134
134
|
const normalizedBase = normalizeSlash(base);
|
|
135
|
-
const hasBase = normalizedUrl.startsWith(normalizedBase);
|
|
135
|
+
const hasBase = normalizedUrl === normalizedBase || normalizedUrl.startsWith(`${normalizedBase}/`);
|
|
136
136
|
if (hasBase) {
|
|
137
137
|
if (`${normalizedUrl}/` === base) return base;
|
|
138
138
|
return normalizedUrl;
|
|
@@ -146,7 +146,7 @@ function withSiteOrigin(url, siteOrigin) {
|
|
|
146
146
|
function removeBase(url, base) {
|
|
147
147
|
const normalizedUrl = addLeadingSlash(url);
|
|
148
148
|
const normalizedBase = normalizeSlash(base);
|
|
149
|
-
const removedBaseUrl = normalizedUrl.replace(new RegExp(`^${normalizedBase}`), '');
|
|
149
|
+
const removedBaseUrl = normalizedUrl.replace(new RegExp(`^${normalizedBase}(?=/|$)`), '');
|
|
150
150
|
if ('' === removedBaseUrl) return '/';
|
|
151
151
|
return removedBaseUrl;
|
|
152
152
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspress/shared",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.23",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/web-infra-dev/rspress.git",
|
|
@@ -45,13 +45,14 @@
|
|
|
45
45
|
"dist"
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@rsbuild/core": "^2.2.
|
|
48
|
+
"@rsbuild/core": "^2.2.10",
|
|
49
49
|
"@shikijs/rehype": "^4.2.0",
|
|
50
50
|
"@types/react": "^19.2.18",
|
|
51
51
|
"mdast-util-mdx-jsx": "^3.2.0",
|
|
52
52
|
"unified": "^11.0.5"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
+
"@rspress/config": "1.0.0",
|
|
55
56
|
"@types/lodash-es": "^4.17.12",
|
|
56
57
|
"@types/node": "^22.8.1",
|
|
57
58
|
"github-slugger": "^2.0.0",
|
|
@@ -60,8 +61,7 @@
|
|
|
60
61
|
"medium-zoom": "1.1.0",
|
|
61
62
|
"rimraf": "^6.1.3",
|
|
62
63
|
"rsbuild-plugin-publint": "^1.0.0",
|
|
63
|
-
"typescript": "^6.0.3"
|
|
64
|
-
"@rspress/config": "1.0.0"
|
|
64
|
+
"typescript": "^6.0.3"
|
|
65
65
|
},
|
|
66
66
|
"publishConfig": {
|
|
67
67
|
"access": "public",
|