@vuepress/core 2.0.0-rc.7 → 2.0.0-rc.9
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 +11 -18
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -54,7 +54,7 @@ var preparePageComponent = async (app, page) => {
|
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
// src/app/prepare/prepareRoutes.ts
|
|
57
|
-
import {
|
|
57
|
+
import { normalizeRoutePath } from "@vuepress/shared";
|
|
58
58
|
var HMR_CODE2 = `
|
|
59
59
|
if (import.meta.webpackHot) {
|
|
60
60
|
import.meta.webpackHot.accept()
|
|
@@ -73,11 +73,7 @@ if (import.meta.hot) {
|
|
|
73
73
|
})
|
|
74
74
|
}
|
|
75
75
|
`;
|
|
76
|
-
var resolvePageRedirects = ({
|
|
77
|
-
path: path9,
|
|
78
|
-
pathInferred,
|
|
79
|
-
filePathRelative
|
|
80
|
-
}) => {
|
|
76
|
+
var resolvePageRedirects = ({ path: path9, pathInferred }) => {
|
|
81
77
|
const redirectsSet = /* @__PURE__ */ new Set();
|
|
82
78
|
const addRedirect = (redirect) => {
|
|
83
79
|
const normalizedPath = normalizeRoutePath(redirect);
|
|
@@ -89,10 +85,7 @@ var resolvePageRedirects = ({
|
|
|
89
85
|
redirectsSet.add(redirect);
|
|
90
86
|
};
|
|
91
87
|
if (pathInferred !== null) {
|
|
92
|
-
addRedirect(pathInferred);
|
|
93
|
-
}
|
|
94
|
-
if (filePathRelative !== null) {
|
|
95
|
-
addRedirect(ensureLeadingSlash(filePathRelative));
|
|
88
|
+
addRedirect(encodeURI(pathInferred));
|
|
96
89
|
}
|
|
97
90
|
return Array.from(redirectsSet);
|
|
98
91
|
};
|
|
@@ -164,7 +157,7 @@ var resolveAppMarkdown = async (app) => {
|
|
|
164
157
|
import { debug as debug2, globby } from "@vuepress/utils";
|
|
165
158
|
|
|
166
159
|
// src/page/inferPagePath.ts
|
|
167
|
-
import { ensureLeadingSlash
|
|
160
|
+
import { ensureLeadingSlash, resolveLocalePath } from "@vuepress/shared";
|
|
168
161
|
var inferPagePath = ({
|
|
169
162
|
app,
|
|
170
163
|
filePathRelative
|
|
@@ -175,7 +168,7 @@ var inferPagePath = ({
|
|
|
175
168
|
pathLocale: "/"
|
|
176
169
|
};
|
|
177
170
|
}
|
|
178
|
-
const pathInferred =
|
|
171
|
+
const pathInferred = ensureLeadingSlash(filePathRelative).replace(/\.md$/, ".html").replace(/\/(README|index).html$/i, "/");
|
|
179
172
|
const pathLocale = resolveLocalePath(app.siteData.locales, pathInferred);
|
|
180
173
|
return {
|
|
181
174
|
pathInferred,
|
|
@@ -235,14 +228,14 @@ var renderPageContent = ({
|
|
|
235
228
|
};
|
|
236
229
|
|
|
237
230
|
// src/page/resolvePageChunkInfo.ts
|
|
238
|
-
import {
|
|
231
|
+
import { path, sanitizeFileName } from "@vuepress/utils";
|
|
239
232
|
var resolvePageChunkInfo = ({
|
|
240
233
|
app,
|
|
241
234
|
htmlFilePathRelative
|
|
242
235
|
}) => {
|
|
243
236
|
const chunkFilePathRelative = path.join("pages", `${htmlFilePathRelative}.js`);
|
|
244
237
|
const chunkFilePath = app.dir.temp(chunkFilePathRelative);
|
|
245
|
-
const chunkName =
|
|
238
|
+
const chunkName = sanitizeFileName(path.basename(htmlFilePathRelative));
|
|
246
239
|
return {
|
|
247
240
|
chunkFilePath,
|
|
248
241
|
chunkFilePathRelative,
|
|
@@ -388,7 +381,7 @@ var resolvePageLang = ({
|
|
|
388
381
|
};
|
|
389
382
|
|
|
390
383
|
// src/page/resolvePagePath.ts
|
|
391
|
-
import { logger as logger2, sanitizeFileName } from "@vuepress/utils";
|
|
384
|
+
import { logger as logger2, sanitizeFileName as sanitizeFileName2 } from "@vuepress/utils";
|
|
392
385
|
var resolvePagePath = ({
|
|
393
386
|
permalink,
|
|
394
387
|
pathInferred,
|
|
@@ -400,11 +393,11 @@ var resolvePagePath = ({
|
|
|
400
393
|
`page path is empty, page options: ${JSON.stringify(options, null, 2)}`
|
|
401
394
|
);
|
|
402
395
|
}
|
|
403
|
-
return encodeURI(pagePath.split("/").map(
|
|
396
|
+
return encodeURI(pagePath.split("/").map(sanitizeFileName2).join("/"));
|
|
404
397
|
};
|
|
405
398
|
|
|
406
399
|
// src/page/resolvePagePermalink.ts
|
|
407
|
-
import { ensureLeadingSlash as
|
|
400
|
+
import { ensureLeadingSlash as ensureLeadingSlash2, isString as isString3 } from "@vuepress/shared";
|
|
408
401
|
import { path as path5 } from "@vuepress/utils";
|
|
409
402
|
var resolvePagePermalink = ({
|
|
410
403
|
app,
|
|
@@ -426,7 +419,7 @@ var resolvePagePermalink = ({
|
|
|
426
419
|
pathLocale,
|
|
427
420
|
permalinkPattern.replace(/:year/, year).replace(/:month/, month).replace(/:day/, day).replace(/:slug/, slug).replace(/:raw/, pathInferred?.replace(/^\//, "") ?? "")
|
|
428
421
|
);
|
|
429
|
-
return
|
|
422
|
+
return ensureLeadingSlash2(link);
|
|
430
423
|
};
|
|
431
424
|
var getPermalinkPattern = ({
|
|
432
425
|
app,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuepress/core",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.9",
|
|
4
4
|
"description": "Core package of VuePress",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vuepress",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"dist"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"vue": "^3.4.
|
|
31
|
-
"@vuepress/client": "2.0.0-rc.
|
|
32
|
-
"@vuepress/
|
|
33
|
-
"@vuepress/
|
|
34
|
-
"@vuepress/
|
|
30
|
+
"vue": "^3.4.21",
|
|
31
|
+
"@vuepress/client": "2.0.0-rc.9",
|
|
32
|
+
"@vuepress/markdown": "2.0.0-rc.9",
|
|
33
|
+
"@vuepress/shared": "2.0.0-rc.9",
|
|
34
|
+
"@vuepress/utils": "2.0.0-rc.9"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|