@vixt/vue 0.5.16 → 0.6.0
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.d.ts +8 -0
- package/dist/client/App.js +8 -0
- package/dist/client/entry.d.ts +8 -0
- package/dist/client/entry.js +28 -0
- package/dist/client/plugins/pinia.d.ts +6 -0
- package/dist/client/plugins/pinia.js +18 -0
- package/dist/client/plugins/router.d.ts +6 -0
- package/dist/client/plugins/router.js +23 -0
- package/dist/index.d.mts +6 -63
- package/dist/index.mjs +8805 -205
- package/dist/types/client.d.ts +20 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/node.d.ts +28 -0
- package/package.json +15 -19
- package/dist/index.d.ts +0 -64
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createApp } from "vue";
|
|
2
|
+
import "virtual:vixt:css";
|
|
3
|
+
import "virtual:uno.css";
|
|
4
|
+
import { applyPlugins, createVixtApp } from "@vixt/core/client";
|
|
5
|
+
import appConfig from "virtual:vixt:app-config";
|
|
6
|
+
import plugins from "virtual:vixt:plugins";
|
|
7
|
+
import RootComponent from "virtual:vixt:root-component";
|
|
8
|
+
|
|
9
|
+
//#region src/client/entry.ts
|
|
10
|
+
async function entry() {
|
|
11
|
+
const app = createApp(RootComponent);
|
|
12
|
+
const vixt = createVixtApp({
|
|
13
|
+
app,
|
|
14
|
+
appConfig
|
|
15
|
+
});
|
|
16
|
+
try {
|
|
17
|
+
await applyPlugins(vixt, plugins);
|
|
18
|
+
} catch (err) {
|
|
19
|
+
console.error(err);
|
|
20
|
+
}
|
|
21
|
+
app.mount(`#${vixt.appConfig.rootId || "app"}`);
|
|
22
|
+
return app;
|
|
23
|
+
}
|
|
24
|
+
entry();
|
|
25
|
+
var entry_default = entry;
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
export { entry_default as default };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineVixtPlugin } from "@vixt/core/client";
|
|
2
|
+
import { createPinia } from "pinia";
|
|
3
|
+
import { createPersistedState } from "pinia-plugin-persistedstate";
|
|
4
|
+
|
|
5
|
+
//#region src/client/plugins/pinia.ts
|
|
6
|
+
var pinia_default = defineVixtPlugin({
|
|
7
|
+
name: "vixt:pinia",
|
|
8
|
+
setup(vixt) {
|
|
9
|
+
const { app, appConfig } = vixt;
|
|
10
|
+
const pinia = createPinia();
|
|
11
|
+
pinia.use(createPersistedState(appConfig.piniaPersistedState));
|
|
12
|
+
app.use(pinia);
|
|
13
|
+
vixt.pinia = pinia;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { pinia_default as default };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createRouter, createWebHistory } from "vue-router";
|
|
2
|
+
import { defineVixtPlugin } from "@vixt/core/client";
|
|
3
|
+
import { setupLayouts } from "virtual:generated-layouts";
|
|
4
|
+
import { routes } from "vue-router/auto-routes";
|
|
5
|
+
|
|
6
|
+
//#region src/client/plugins/router.ts
|
|
7
|
+
var router_default = defineVixtPlugin({
|
|
8
|
+
name: "vixt:router",
|
|
9
|
+
setup(vixt) {
|
|
10
|
+
const { app, appConfig } = vixt;
|
|
11
|
+
const router = createRouter({
|
|
12
|
+
routes: setupLayouts(routes),
|
|
13
|
+
history: createWebHistory(appConfig.baseURL),
|
|
14
|
+
...appConfig.router
|
|
15
|
+
});
|
|
16
|
+
app.use(router);
|
|
17
|
+
vixt.routes = routes;
|
|
18
|
+
vixt.router = router;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { router_default as default };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,64 +1,7 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
3
|
-
import { AppOptions, Vixt, PluginOptions as PluginOptions$1, VixtOptions } from '@vixt/core';
|
|
4
|
-
import { Pinia } from 'pinia';
|
|
5
|
-
import { PluginOptions } from 'pinia-plugin-persistedstate';
|
|
6
|
-
import { App } from 'vue';
|
|
7
|
-
import { RouterOptions, Router, RouteRecord } from 'vue-router';
|
|
8
|
-
import Vue from '@vitejs/plugin-vue';
|
|
9
|
-
import VueJsx from '@vitejs/plugin-vue-jsx';
|
|
10
|
-
import UnoCSS from 'unocss/vite';
|
|
11
|
-
import AutoImport from 'unplugin-auto-import/vite';
|
|
12
|
-
import Components from 'unplugin-vue-components/vite';
|
|
13
|
-
import VueRouter from 'unplugin-vue-router/vite';
|
|
14
|
-
import VueDevTools from 'vite-plugin-vue-devtools';
|
|
15
|
-
import Layouts from 'vite-plugin-vue-layouts';
|
|
1
|
+
import * as _vixt_core0 from "@vixt/core";
|
|
2
|
+
import * as vite0 from "vite";
|
|
16
3
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
piniaPersistedState?: PluginOptions
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
interface VixtApp {
|
|
25
|
-
app: App
|
|
26
|
-
router: Router
|
|
27
|
-
routes: RouteRecord[]
|
|
28
|
-
pinia: Pinia
|
|
29
|
-
appConfig: VixtAppConfig
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
declare const appVue: _vixt_core.VixtModule<AppOptions>;
|
|
34
|
-
|
|
35
|
-
declare function getAppComponentPath(vixt: Vixt): string | undefined;
|
|
36
|
-
declare function genarateAppComponent(vixt: Vixt): string;
|
|
37
|
-
|
|
38
|
-
declare function generateMainTs(options: AppOptions, vixt: Vixt): string;
|
|
39
|
-
|
|
40
|
-
declare module '@vixt/core' {
|
|
41
|
-
interface VixtOptions {
|
|
42
|
-
vue?: PluginOptions$1<typeof Vue>;
|
|
43
|
-
vueJsx?: PluginOptions$1<typeof VueJsx>;
|
|
44
|
-
/** https://github.com/posva/unplugin-vue-router */
|
|
45
|
-
router?: PluginOptions$1<typeof VueRouter>;
|
|
46
|
-
/** https://github.com/JohnCampionJr/vite-plugin-vue-layouts */
|
|
47
|
-
layouts?: PluginOptions$1<typeof Layouts>;
|
|
48
|
-
/** https://github.com/unplugin/unplugin-vue-components */
|
|
49
|
-
components?: PluginOptions$1<typeof Components>;
|
|
50
|
-
/** https://github.com/unplugin/unplugin-auto-import */
|
|
51
|
-
imports?: PluginOptions$1<typeof AutoImport>;
|
|
52
|
-
/** https://github.com/unocss/unocss */
|
|
53
|
-
unocss?: PluginOptions$1<typeof UnoCSS>;
|
|
54
|
-
/** https://github.com/webfansplz/vite-plugin-vue-devtools */
|
|
55
|
-
devtools?: PluginOptions$1<typeof VueDevTools> & {
|
|
56
|
-
enabled?: boolean;
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
declare const presetVue: _vixt_core.VixtModule<VixtOptions>;
|
|
61
|
-
|
|
62
|
-
declare const _default: (options?: VixtOptions | undefined) => vite.PluginOption;
|
|
63
|
-
|
|
64
|
-
export { appVue, _default as default, genarateAppComponent, generateMainTs, getAppComponentPath, presetVue };
|
|
4
|
+
//#region src/index.d.ts
|
|
5
|
+
declare const _default: (options?: _vixt_core0.VixtOptions | undefined) => vite0.PluginOption;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { _default as default };
|