@vuepress/client 2.0.0-beta.41 → 2.0.0-beta.44
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/app.js +6 -8
- package/dist/index.d.ts +29 -14
- package/dist/index.js +3 -13
- package/package.json +4 -7
package/dist/app.js
CHANGED
|
@@ -17,9 +17,7 @@ import {
|
|
|
17
17
|
} from "./chunk-RTLFYRTT.js";
|
|
18
18
|
|
|
19
19
|
// src/app.ts
|
|
20
|
-
import {
|
|
21
|
-
import { clientAppRootComponents } from "@internal/clientAppRootComponents";
|
|
22
|
-
import { clientAppSetups } from "@internal/clientAppSetups";
|
|
20
|
+
import { clientConfigs } from "@internal/clientConfigs";
|
|
23
21
|
import { createApp, createSSRApp, h } from "vue";
|
|
24
22
|
import { RouterView } from "vue-router";
|
|
25
23
|
|
|
@@ -223,12 +221,12 @@ var createVueApp = async () => {
|
|
|
223
221
|
name: "VuepressApp",
|
|
224
222
|
setup() {
|
|
225
223
|
setupUpdateHead();
|
|
226
|
-
for (const
|
|
227
|
-
|
|
224
|
+
for (const clientConfig of clientConfigs) {
|
|
225
|
+
clientConfig.setup?.();
|
|
228
226
|
}
|
|
229
227
|
return () => [
|
|
230
228
|
h(RouterView),
|
|
231
|
-
...
|
|
229
|
+
...clientConfigs.flatMap(({ rootComponents = [] }) => rootComponents.map((component) => h(component)))
|
|
232
230
|
];
|
|
233
231
|
}
|
|
234
232
|
});
|
|
@@ -238,8 +236,8 @@ var createVueApp = async () => {
|
|
|
238
236
|
if (__VUEPRESS_DEV__ || __VUE_PROD_DEVTOOLS__) {
|
|
239
237
|
setupDevtools(app, globalComputed);
|
|
240
238
|
}
|
|
241
|
-
for (const
|
|
242
|
-
await
|
|
239
|
+
for (const clientConfig of clientConfigs) {
|
|
240
|
+
await clientConfig.enhance?.({ app, router, siteData });
|
|
243
241
|
}
|
|
244
242
|
app.use(router);
|
|
245
243
|
return {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { PageData, PageFrontmatter, HeadConfig, SiteData } from '@vuepress/shared';
|
|
2
2
|
export { PageData, PageFrontmatter, PageHeader, SiteData } from '@vuepress/shared';
|
|
3
|
-
import { Router } from 'vue-router';
|
|
4
|
-
export { RouterLink, useRoute, useRouter } from 'vue-router';
|
|
5
3
|
import * as vue from 'vue';
|
|
6
|
-
import { Ref, ComputedRef, InjectionKey, App, FunctionalComponent } from 'vue';
|
|
4
|
+
import { Ref, ComputedRef, InjectionKey, App, ComponentOptions, FunctionalComponent } from 'vue';
|
|
5
|
+
import { Router } from 'vue-router';
|
|
7
6
|
export { C as CreateVueAppFunction } from './createVueAppFunction-c8e67ca1.js';
|
|
8
7
|
|
|
9
8
|
/**
|
|
@@ -167,13 +166,28 @@ declare const updateHeadSymbol: InjectionKey<UpdateHead>;
|
|
|
167
166
|
*/
|
|
168
167
|
declare const useUpdateHead: () => UpdateHead;
|
|
169
168
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
169
|
+
/**
|
|
170
|
+
* Configure vuepress client
|
|
171
|
+
*/
|
|
172
|
+
interface ClientConfig {
|
|
173
|
+
/**
|
|
174
|
+
* An enhance function to be called after vue app instance and
|
|
175
|
+
* vue-router instance has been created
|
|
176
|
+
*/
|
|
177
|
+
enhance?: (context: {
|
|
178
|
+
app: App;
|
|
179
|
+
router: Router;
|
|
180
|
+
siteData: SiteDataRef;
|
|
181
|
+
}) => void | Promise<void>;
|
|
182
|
+
/**
|
|
183
|
+
* A function to be called inside the setup function of vue app
|
|
184
|
+
*/
|
|
185
|
+
setup?: () => void;
|
|
186
|
+
/**
|
|
187
|
+
* Components to be placed directly into the root node of vue app
|
|
188
|
+
*/
|
|
189
|
+
rootComponents?: ComponentOptions[];
|
|
190
|
+
}
|
|
177
191
|
|
|
178
192
|
declare const ClientOnly: vue.DefineComponent<{}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
179
193
|
[key: string]: any;
|
|
@@ -193,9 +207,10 @@ declare const Vuepress: vue.DefineComponent<{}, () => vue.VNode<vue.RendererNode
|
|
|
193
207
|
[key: string]: any;
|
|
194
208
|
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{}>>, {}>;
|
|
195
209
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
210
|
+
/**
|
|
211
|
+
* A helper function to help you define vuepress client config file
|
|
212
|
+
*/
|
|
213
|
+
declare const defineClientConfig: (clientConfig: ClientConfig) => ClientConfig;
|
|
199
214
|
|
|
200
215
|
/**
|
|
201
216
|
* Resolver methods to get global computed
|
|
@@ -217,4 +232,4 @@ declare const resolvers: {
|
|
|
217
232
|
*/
|
|
218
233
|
declare const withBase: (url: string) => string;
|
|
219
234
|
|
|
220
|
-
export {
|
|
235
|
+
export { ClientConfig, ClientOnly, Content, PageDataRef, PageFrontmatterRef, PageHead, PageHeadRef, PageHeadTitle, PageHeadTitleRef, PageLang, PageLangRef, PagesData, PagesDataRef, RouteLocale, RouteLocaleRef, SiteDataRef, SiteLocaleData, SiteLocaleDataRef, UpdateHead, Vuepress, defineClientConfig, pageData, pageDataEmpty, pageFrontmatterSymbol, pageHeadSymbol, pageHeadTitleSymbol, pageLangSymbol, pagesData, resolvers, routeLocaleSymbol, siteData, siteLocaleDataSymbol, updateHeadSymbol, usePageData, usePageFrontmatter, usePageHead, usePageHeadTitle, usePageLang, usePagesData, useRouteLocale, useSiteData, useSiteLocaleData, useUpdateHead, withBase };
|
package/dist/index.js
CHANGED
|
@@ -27,21 +27,13 @@ import {
|
|
|
27
27
|
withBase
|
|
28
28
|
} from "./chunk-RTLFYRTT.js";
|
|
29
29
|
|
|
30
|
-
// src/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
// src/helpers/defineClientAppEnhance.ts
|
|
34
|
-
var defineClientAppEnhance = (clientAppEnhance) => clientAppEnhance;
|
|
35
|
-
|
|
36
|
-
// src/helpers/defineClientAppSetup.ts
|
|
37
|
-
var defineClientAppSetup = (clientAppSetup) => clientAppSetup;
|
|
30
|
+
// src/helpers/defineClientConfig.ts
|
|
31
|
+
var defineClientConfig = (clientConfig) => clientConfig;
|
|
38
32
|
export {
|
|
39
33
|
ClientOnly,
|
|
40
34
|
Content,
|
|
41
|
-
RouterLink,
|
|
42
35
|
Vuepress,
|
|
43
|
-
|
|
44
|
-
defineClientAppSetup,
|
|
36
|
+
defineClientConfig,
|
|
45
37
|
pageData,
|
|
46
38
|
pageDataEmpty,
|
|
47
39
|
pageFrontmatterSymbol,
|
|
@@ -60,9 +52,7 @@ export {
|
|
|
60
52
|
usePageHeadTitle,
|
|
61
53
|
usePageLang,
|
|
62
54
|
usePagesData,
|
|
63
|
-
useRoute,
|
|
64
55
|
useRouteLocale,
|
|
65
|
-
useRouter,
|
|
66
56
|
useSiteData,
|
|
67
57
|
useSiteLocaleData,
|
|
68
58
|
useUpdateHead,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuepress/client",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.44",
|
|
4
4
|
"description": "Client package of VuePress",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vuepress",
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
"exports": {
|
|
21
21
|
".": "./dist/index.js",
|
|
22
22
|
"./app": "./dist/app.js",
|
|
23
|
-
"./helpers": "./helpers/index.js",
|
|
24
23
|
"./package.json": "./package.json",
|
|
25
24
|
"./templates/*": "./templates/*",
|
|
26
25
|
"./types": "./types.d.ts"
|
|
@@ -35,9 +34,9 @@
|
|
|
35
34
|
],
|
|
36
35
|
"dependencies": {
|
|
37
36
|
"@vue/devtools-api": "^6.1.4",
|
|
38
|
-
"@vuepress/shared": "2.0.0-beta.
|
|
37
|
+
"@vuepress/shared": "2.0.0-beta.44",
|
|
39
38
|
"vue": "^3.2.33",
|
|
40
|
-
"vue-router": "^4.0.
|
|
39
|
+
"vue-router": "^4.0.15"
|
|
41
40
|
},
|
|
42
41
|
"publishConfig": {
|
|
43
42
|
"access": "public"
|
|
@@ -52,9 +51,7 @@
|
|
|
52
51
|
"src/index.ts"
|
|
53
52
|
],
|
|
54
53
|
"external": [
|
|
55
|
-
"@internal/
|
|
56
|
-
"@internal/clientAppRootComponents",
|
|
57
|
-
"@internal/clientAppSetups",
|
|
54
|
+
"@internal/clientConfigs",
|
|
58
55
|
"@internal/layoutComponents",
|
|
59
56
|
"@internal/pagesComponents",
|
|
60
57
|
"@internal/pagesData",
|