@vixt/vue 0.1.10 → 0.1.12
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.d.mts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.mjs +6 -6
- package/package.json +10 -10
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as vite from 'vite';
|
|
2
2
|
import * as _vixt_core from '@vixt/core';
|
|
3
3
|
import { PluginOptions, VixtOptions } from '@vixt/core';
|
|
4
|
+
import { RouterOptions } from 'vue-router';
|
|
5
|
+
import { PersistedStateFactoryOptions } from 'pinia-plugin-persistedstate';
|
|
4
6
|
import Vue from '@vitejs/plugin-vue';
|
|
5
7
|
import Layouts from 'vite-plugin-vue-layouts';
|
|
6
8
|
import Components from 'unplugin-vue-components/vite';
|
|
@@ -28,6 +30,13 @@ declare module '@vixt/core' {
|
|
|
28
30
|
};
|
|
29
31
|
}
|
|
30
32
|
}
|
|
33
|
+
declare module '@vixt/core/client' {
|
|
34
|
+
interface VixtAppConfig {
|
|
35
|
+
router?: RouterOptions;
|
|
36
|
+
/** https://github.com/prazdevs/pinia-plugin-persistedstate */
|
|
37
|
+
piniaPersistedState?: PersistedStateFactoryOptions;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
31
40
|
declare const presetVue: _vixt_core.VixtModule<VixtOptions>;
|
|
32
41
|
|
|
33
42
|
declare const _default: (options?: VixtOptions | undefined) => vite.PluginOption;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as vite from 'vite';
|
|
2
2
|
import * as _vixt_core from '@vixt/core';
|
|
3
3
|
import { PluginOptions, VixtOptions } from '@vixt/core';
|
|
4
|
+
import { RouterOptions } from 'vue-router';
|
|
5
|
+
import { PersistedStateFactoryOptions } from 'pinia-plugin-persistedstate';
|
|
4
6
|
import Vue from '@vitejs/plugin-vue';
|
|
5
7
|
import Layouts from 'vite-plugin-vue-layouts';
|
|
6
8
|
import Components from 'unplugin-vue-components/vite';
|
|
@@ -28,6 +30,13 @@ declare module '@vixt/core' {
|
|
|
28
30
|
};
|
|
29
31
|
}
|
|
30
32
|
}
|
|
33
|
+
declare module '@vixt/core/client' {
|
|
34
|
+
interface VixtAppConfig {
|
|
35
|
+
router?: RouterOptions;
|
|
36
|
+
/** https://github.com/prazdevs/pinia-plugin-persistedstate */
|
|
37
|
+
piniaPersistedState?: PersistedStateFactoryOptions;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
31
40
|
declare const presetVue: _vixt_core.VixtModule<VixtOptions>;
|
|
32
41
|
|
|
33
42
|
declare const _default: (options?: VixtOptions | undefined) => vite.PluginOption;
|
package/dist/index.mjs
CHANGED
|
@@ -11,8 +11,8 @@ import UnoCSS from 'unocss/vite';
|
|
|
11
11
|
|
|
12
12
|
const presetVue = defineVixtModule({
|
|
13
13
|
async setup(_, vixt) {
|
|
14
|
-
const { components, composables = [], constants = [], utils = [], stores = [], pages, layouts } = resolveLayersDirs(vixt._layers);
|
|
15
|
-
const { buildTypesDir } = vixt.options;
|
|
14
|
+
const { components, composables = [], constants = [], utils = [], stores = [], pages, layouts } = resolveLayersDirs(vixt._layers, vixt.options);
|
|
15
|
+
const { buildTypesDir, buildImportsDir } = vixt.options;
|
|
16
16
|
const defaultOptions = {
|
|
17
17
|
vue: {},
|
|
18
18
|
router: { dts: `${buildTypesDir}/typed-router.d.ts`, routesFolder: pages },
|
|
@@ -26,7 +26,7 @@ const presetVue = defineVixtModule({
|
|
|
26
26
|
imports: {
|
|
27
27
|
imports: ["vue", "@vueuse/core", "pinia", VueRouterAutoImports],
|
|
28
28
|
dts: `${buildTypesDir}/auto-imports.d.ts`,
|
|
29
|
-
dirs: [...composables, ...constants, ...stores, ...utils],
|
|
29
|
+
dirs: [...composables, ...constants, ...stores, ...utils, buildImportsDir],
|
|
30
30
|
vueTemplate: true
|
|
31
31
|
},
|
|
32
32
|
unocss: {},
|
|
@@ -61,17 +61,17 @@ import { routes } from 'vue-router/auto-routes'
|
|
|
61
61
|
import { setupLayouts } from 'virtual:generated-layouts'
|
|
62
62
|
|
|
63
63
|
const pinia = createPinia()
|
|
64
|
-
pinia.use(createPersistedState())
|
|
64
|
+
pinia.use(createPersistedState(appConfig.piniaPersistedState))
|
|
65
65
|
|
|
66
66
|
const router = createRouter({
|
|
67
67
|
routes: setupLayouts(routes),
|
|
68
68
|
history: createWebHistory('${app.baseURL}'),
|
|
69
|
+
...appConfig.router,
|
|
69
70
|
})
|
|
70
71
|
|
|
71
72
|
const app = createApp(App)
|
|
72
73
|
app.use(pinia).use(router)
|
|
73
|
-
|
|
74
|
-
Object.values(plugins).forEach((plugin) => typeof plugin === 'function' && plugin({ app, router, routes, pinia, appConfig }))
|
|
74
|
+
usePlugins({ app, router, routes, pinia, appConfig })
|
|
75
75
|
|
|
76
76
|
app.mount('#${app.rootId}')
|
|
77
77
|
`;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vixt/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.12",
|
|
5
5
|
"author": "SoulLyoko<https://github.com/SoulLyoko>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/SoulLyoko/vixt#readme",
|
|
@@ -19,19 +19,19 @@
|
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@vitejs/plugin-vue": "^5.1.2",
|
|
22
|
-
"@vitejs/plugin-vue-jsx": "^4.0.
|
|
23
|
-
"@vueuse/core": "^
|
|
24
|
-
"pinia": "^2.2.
|
|
22
|
+
"@vitejs/plugin-vue-jsx": "^4.0.1",
|
|
23
|
+
"@vueuse/core": "^11.0.1",
|
|
24
|
+
"pinia": "^2.2.2",
|
|
25
25
|
"pinia-plugin-persistedstate": "^3.2.1",
|
|
26
|
-
"unocss": "0.61.
|
|
26
|
+
"unocss": "0.61.6",
|
|
27
27
|
"unplugin-auto-import": "^0.18.2",
|
|
28
|
-
"unplugin-vue-components": "^0.27.
|
|
29
|
-
"unplugin-vue-router": "^0.10.
|
|
30
|
-
"vite-plugin-vue-devtools": "^7.3.
|
|
28
|
+
"unplugin-vue-components": "^0.27.4",
|
|
29
|
+
"unplugin-vue-router": "^0.10.7",
|
|
30
|
+
"vite-plugin-vue-devtools": "^7.3.8",
|
|
31
31
|
"vite-plugin-vue-layouts": "^0.11.0",
|
|
32
|
-
"vue": "^3.4.
|
|
32
|
+
"vue": "^3.4.38",
|
|
33
33
|
"vue-router": "^4.4.3",
|
|
34
|
-
"@vixt/core": "0.1.
|
|
34
|
+
"@vixt/core": "0.1.12"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "unbuild"
|