@vuepress/client 2.0.0-beta.43 → 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 +28 -12
- package/dist/index.js +3 -7
- 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,7 +1,7 @@
|
|
|
1
1
|
import { PageData, PageFrontmatter, HeadConfig, SiteData } from '@vuepress/shared';
|
|
2
2
|
export { PageData, PageFrontmatter, PageHeader, SiteData } from '@vuepress/shared';
|
|
3
3
|
import * as vue from 'vue';
|
|
4
|
-
import { Ref, ComputedRef, InjectionKey, App, FunctionalComponent } from 'vue';
|
|
4
|
+
import { Ref, ComputedRef, InjectionKey, App, ComponentOptions, FunctionalComponent } from 'vue';
|
|
5
5
|
import { Router } from 'vue-router';
|
|
6
6
|
export { C as CreateVueAppFunction } from './createVueAppFunction-c8e67ca1.js';
|
|
7
7
|
|
|
@@ -166,13 +166,28 @@ declare const updateHeadSymbol: InjectionKey<UpdateHead>;
|
|
|
166
166
|
*/
|
|
167
167
|
declare const useUpdateHead: () => UpdateHead;
|
|
168
168
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
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
|
+
}
|
|
176
191
|
|
|
177
192
|
declare const ClientOnly: vue.DefineComponent<{}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
178
193
|
[key: string]: any;
|
|
@@ -192,9 +207,10 @@ declare const Vuepress: vue.DefineComponent<{}, () => vue.VNode<vue.RendererNode
|
|
|
192
207
|
[key: string]: any;
|
|
193
208
|
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, vue.EmitsOptions, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{}>>, {}>;
|
|
194
209
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
210
|
+
/**
|
|
211
|
+
* A helper function to help you define vuepress client config file
|
|
212
|
+
*/
|
|
213
|
+
declare const defineClientConfig: (clientConfig: ClientConfig) => ClientConfig;
|
|
198
214
|
|
|
199
215
|
/**
|
|
200
216
|
* Resolver methods to get global computed
|
|
@@ -216,4 +232,4 @@ declare const resolvers: {
|
|
|
216
232
|
*/
|
|
217
233
|
declare const withBase: (url: string) => string;
|
|
218
234
|
|
|
219
|
-
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,17 +27,13 @@ import {
|
|
|
27
27
|
withBase
|
|
28
28
|
} from "./chunk-RTLFYRTT.js";
|
|
29
29
|
|
|
30
|
-
// src/helpers/
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
// src/helpers/defineClientAppSetup.ts
|
|
34
|
-
var defineClientAppSetup = (clientAppSetup) => clientAppSetup;
|
|
30
|
+
// src/helpers/defineClientConfig.ts
|
|
31
|
+
var defineClientConfig = (clientConfig) => clientConfig;
|
|
35
32
|
export {
|
|
36
33
|
ClientOnly,
|
|
37
34
|
Content,
|
|
38
35
|
Vuepress,
|
|
39
|
-
|
|
40
|
-
defineClientAppSetup,
|
|
36
|
+
defineClientConfig,
|
|
41
37
|
pageData,
|
|
42
38
|
pageDataEmpty,
|
|
43
39
|
pageFrontmatterSymbol,
|
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",
|