vitepress 0.22.3 → 0.22.4
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/client/app/index.js +4 -6
- package/dist/node/cli.js +8 -3
- package/dist/node/index.d.ts +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/{serve-777539c0.js → serve-3035f99b.js} +1416 -11418
- package/package.json +11 -11
- package/types/default-theme.d.ts +1 -1
package/dist/client/app/index.js
CHANGED
|
@@ -33,10 +33,6 @@ export function createApp() {
|
|
|
33
33
|
app.provide(RouterSymbol, router);
|
|
34
34
|
const data = initData(router.route);
|
|
35
35
|
app.provide(dataSymbol, data);
|
|
36
|
-
if (inBrowser) {
|
|
37
|
-
// dynamically update head tags
|
|
38
|
-
useUpdateHead(router.route, data.site);
|
|
39
|
-
}
|
|
40
36
|
// install global components
|
|
41
37
|
app.component('Content', Content);
|
|
42
38
|
app.component('ClientOnly', ClientOnly);
|
|
@@ -56,7 +52,7 @@ export function createApp() {
|
|
|
56
52
|
siteData: siteDataRef
|
|
57
53
|
});
|
|
58
54
|
}
|
|
59
|
-
return { app, router };
|
|
55
|
+
return { app, router, data };
|
|
60
56
|
}
|
|
61
57
|
function newApp() {
|
|
62
58
|
return import.meta.env.PROD
|
|
@@ -104,9 +100,11 @@ function shouldHotReload(payload) {
|
|
|
104
100
|
return payloadPath === locationPath;
|
|
105
101
|
}
|
|
106
102
|
if (inBrowser) {
|
|
107
|
-
const { app, router } = createApp();
|
|
103
|
+
const { app, router, data } = createApp();
|
|
108
104
|
// wait until page component is fetched before mounting
|
|
109
105
|
router.go().then(() => {
|
|
106
|
+
// dynamically update head tags
|
|
107
|
+
useUpdateHead(router.route, data.site);
|
|
110
108
|
app.mount('#app');
|
|
111
109
|
});
|
|
112
110
|
}
|
package/dist/node/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var serve = require('./serve-
|
|
3
|
+
var serve = require('./serve-3035f99b.js');
|
|
4
4
|
require('fs');
|
|
5
5
|
require('path');
|
|
6
6
|
require('url');
|
|
@@ -94,7 +94,7 @@ var minimist = function (args, opts) {
|
|
|
94
94
|
var o = obj;
|
|
95
95
|
for (var i = 0; i < keys.length-1; i++) {
|
|
96
96
|
var key = keys[i];
|
|
97
|
-
if (key
|
|
97
|
+
if (isConstructorOrProto(o, key)) return;
|
|
98
98
|
if (o[key] === undefined) o[key] = {};
|
|
99
99
|
if (o[key] === Object.prototype || o[key] === Number.prototype
|
|
100
100
|
|| o[key] === String.prototype) o[key] = {};
|
|
@@ -103,7 +103,7 @@ var minimist = function (args, opts) {
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
var key = keys[keys.length - 1];
|
|
106
|
-
if (key
|
|
106
|
+
if (isConstructorOrProto(o, key)) return;
|
|
107
107
|
if (o === Object.prototype || o === Number.prototype
|
|
108
108
|
|| o === String.prototype) o = {};
|
|
109
109
|
if (o === Array.prototype) o = [];
|
|
@@ -267,6 +267,11 @@ function isNumber (x) {
|
|
|
267
267
|
return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
+
|
|
271
|
+
function isConstructorOrProto (obj, key) {
|
|
272
|
+
return key === 'constructor' && typeof obj[key] === 'function' || key === '__proto__';
|
|
273
|
+
}
|
|
274
|
+
|
|
270
275
|
const argv = minimist(process.argv.slice(2));
|
|
271
276
|
console.log(serve.source.cyan(`vitepress v${require("../../package.json").version}`));
|
|
272
277
|
const command = argv._[0];
|
package/dist/node/index.d.ts
CHANGED
|
@@ -138,7 +138,7 @@ export declare namespace DefaultTheme {
|
|
|
138
138
|
// algolia ------------------------------------------------------------------
|
|
139
139
|
// partially copied from @docsearch/react/dist/esm/DocSearch.d.ts
|
|
140
140
|
export interface AlgoliaSearchOptions {
|
|
141
|
-
appId
|
|
141
|
+
appId: string
|
|
142
142
|
apiKey: string
|
|
143
143
|
indexName: string
|
|
144
144
|
placeholder?: string
|