@vixt/uni 0.1.9 → 0.1.11
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 -2
- package/dist/index.d.ts +9 -2
- package/dist/index.mjs +9 -10
- package/package.json +7 -7
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
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 { PersistedStateFactoryOptions } from 'pinia-plugin-unistorage';
|
|
4
5
|
import Uni from '@dcloudio/vite-plugin-uni';
|
|
5
6
|
import Pages from '@uni-helper/vite-plugin-uni-pages';
|
|
6
7
|
import Layouts from '@uni-helper/vite-plugin-uni-layouts';
|
|
@@ -13,17 +14,23 @@ declare module '@vixt/core' {
|
|
|
13
14
|
interface VixtOptions {
|
|
14
15
|
uni?: PluginOptions<typeof Uni>;
|
|
15
16
|
/** https://github.com/uni-helper/vite-plugin-uni-pages */
|
|
16
|
-
|
|
17
|
+
uniPages?: PluginOptions<typeof Pages>;
|
|
17
18
|
/** https://github.com/uni-helper/vite-plugin-uni-layouts */
|
|
18
19
|
uniLayouts?: PluginOptions<typeof Layouts>;
|
|
19
20
|
/** https://github.com/uni-helper/vite-plugin-uni-components */
|
|
20
|
-
|
|
21
|
+
uniComponents?: PluginOptions<typeof Components>;
|
|
21
22
|
/** https://github.com/antfu/unplugin-auto-import */
|
|
22
23
|
imports?: PluginOptions<typeof AutoImport>;
|
|
23
24
|
/** https://github.com/antfu/unocss */
|
|
24
25
|
unocss?: PluginOptions<typeof UnoCSS>;
|
|
25
26
|
}
|
|
26
27
|
}
|
|
28
|
+
declare module '@vixt/core/client' {
|
|
29
|
+
interface VixtAppConfig {
|
|
30
|
+
/** https://github.com/dishait/pinia-plugin-unistorage */
|
|
31
|
+
piniaPersistedState?: PersistedStateFactoryOptions;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
27
34
|
declare const presetUni: _vixt_core.VixtModule<VixtOptions>;
|
|
28
35
|
|
|
29
36
|
/** 增加小程序中vueuse的运行所需 */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
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 { PersistedStateFactoryOptions } from 'pinia-plugin-unistorage';
|
|
4
5
|
import Uni from '@dcloudio/vite-plugin-uni';
|
|
5
6
|
import Pages from '@uni-helper/vite-plugin-uni-pages';
|
|
6
7
|
import Layouts from '@uni-helper/vite-plugin-uni-layouts';
|
|
@@ -13,17 +14,23 @@ declare module '@vixt/core' {
|
|
|
13
14
|
interface VixtOptions {
|
|
14
15
|
uni?: PluginOptions<typeof Uni>;
|
|
15
16
|
/** https://github.com/uni-helper/vite-plugin-uni-pages */
|
|
16
|
-
|
|
17
|
+
uniPages?: PluginOptions<typeof Pages>;
|
|
17
18
|
/** https://github.com/uni-helper/vite-plugin-uni-layouts */
|
|
18
19
|
uniLayouts?: PluginOptions<typeof Layouts>;
|
|
19
20
|
/** https://github.com/uni-helper/vite-plugin-uni-components */
|
|
20
|
-
|
|
21
|
+
uniComponents?: PluginOptions<typeof Components>;
|
|
21
22
|
/** https://github.com/antfu/unplugin-auto-import */
|
|
22
23
|
imports?: PluginOptions<typeof AutoImport>;
|
|
23
24
|
/** https://github.com/antfu/unocss */
|
|
24
25
|
unocss?: PluginOptions<typeof UnoCSS>;
|
|
25
26
|
}
|
|
26
27
|
}
|
|
28
|
+
declare module '@vixt/core/client' {
|
|
29
|
+
interface VixtAppConfig {
|
|
30
|
+
/** https://github.com/dishait/pinia-plugin-unistorage */
|
|
31
|
+
piniaPersistedState?: PersistedStateFactoryOptions;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
27
34
|
declare const presetUni: _vixt_core.VixtModule<VixtOptions>;
|
|
28
35
|
|
|
29
36
|
/** 增加小程序中vueuse的运行所需 */
|
package/dist/index.mjs
CHANGED
|
@@ -17,13 +17,13 @@ const name = "vixt:preset-uni";
|
|
|
17
17
|
const presetUni = defineVixtModule({
|
|
18
18
|
meta: { name },
|
|
19
19
|
setup(_, vixt) {
|
|
20
|
-
const { components, composables = [], constants = [], utils = [], stores = [] } = resolveLayersDirs(vixt._layers);
|
|
21
|
-
const { buildTypesDir } = vixt.options;
|
|
20
|
+
const { components, composables = [], constants = [], utils = [], stores = [] } = resolveLayersDirs(vixt._layers, vixt.options);
|
|
21
|
+
const { buildTypesDir, buildImportsDir } = vixt.options;
|
|
22
22
|
const defaultOptions = {
|
|
23
23
|
uni: {},
|
|
24
|
-
|
|
24
|
+
uniPages: { dts: `${buildTypesDir}/uni-pages.d.ts` },
|
|
25
25
|
uniLayouts: {},
|
|
26
|
-
|
|
26
|
+
uniComponents: {
|
|
27
27
|
dts: `${buildTypesDir}/components.d.ts`,
|
|
28
28
|
dirs: components,
|
|
29
29
|
directoryAsNamespace: true,
|
|
@@ -32,16 +32,16 @@ const presetUni = defineVixtModule({
|
|
|
32
32
|
imports: {
|
|
33
33
|
imports: ["vue", "uni-app", "pinia", useImports()],
|
|
34
34
|
dts: `${buildTypesDir}/auto-imports.d.ts`,
|
|
35
|
-
dirs: [...composables, ...constants, ...stores, ...utils],
|
|
35
|
+
dirs: [...composables, ...constants, ...stores, ...utils, buildImportsDir],
|
|
36
36
|
vueTemplate: true
|
|
37
37
|
},
|
|
38
38
|
unocss: {}
|
|
39
39
|
};
|
|
40
40
|
const options = vixt.options = defu(vixt.options, defaultOptions);
|
|
41
41
|
const modules = [
|
|
42
|
-
Pages(options.
|
|
42
|
+
Pages(options.uniPages),
|
|
43
43
|
Layouts(options.uniLayouts),
|
|
44
|
-
Components(options.
|
|
44
|
+
Components(options.uniComponents),
|
|
45
45
|
AutoImport(options.imports),
|
|
46
46
|
UnoCSS(options.unocss),
|
|
47
47
|
// @ts-expect-error
|
|
@@ -130,10 +130,9 @@ import { pages as routes } from 'virtual:uni-pages'
|
|
|
130
130
|
export function createApp() {
|
|
131
131
|
const app = createSSRApp(App)
|
|
132
132
|
const pinia = Pinia.createPinia()
|
|
133
|
-
pinia.use(createUnistorage())
|
|
133
|
+
pinia.use(createUnistorage(appConfig.piniaPersistedState))
|
|
134
134
|
app.use(pinia)
|
|
135
|
-
|
|
136
|
-
Object.values(plugins).forEach((plugin) => typeof plugin === 'function' && plugin({ app, routes, pinia, appConfig }))
|
|
135
|
+
usePlugins({ app, routes, pinia, appConfig })
|
|
137
136
|
|
|
138
137
|
return { app, Pinia }
|
|
139
138
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vixt/uni",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.11",
|
|
5
5
|
"author": "SoulLyoko<https://github.com/SoulLyoko>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/SoulLyoko/vixt#readme",
|
|
@@ -19,20 +19,20 @@
|
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@dcloudio/types": "^3.4.12",
|
|
22
|
-
"@uni-helper/eslint-config": "^0.0
|
|
22
|
+
"@uni-helper/eslint-config": "^0.1.0",
|
|
23
23
|
"@uni-helper/uni-app-types": "^0.5.13",
|
|
24
24
|
"@uni-helper/uni-use": "^0.19.12",
|
|
25
25
|
"@uni-helper/unocss-preset-uni": "^0.2.9",
|
|
26
|
-
"@uni-helper/vite-plugin-uni-components": "^0.0.
|
|
26
|
+
"@uni-helper/vite-plugin-uni-components": "^0.0.10",
|
|
27
27
|
"@uni-helper/vite-plugin-uni-layouts": "^0.1.10",
|
|
28
28
|
"@uni-helper/vite-plugin-uni-pages": "0.2.24",
|
|
29
|
-
"@vueuse/core": "^
|
|
30
|
-
"pinia": "^2.2.
|
|
29
|
+
"@vueuse/core": "^11.0.1",
|
|
30
|
+
"pinia": "^2.2.2",
|
|
31
31
|
"pinia-plugin-unistorage": "^0.1.2",
|
|
32
32
|
"unocss": "0.61.5",
|
|
33
33
|
"unplugin-auto-import": "^0.18.2",
|
|
34
|
-
"vue": "^3.4.
|
|
35
|
-
"@vixt/core": "0.1.
|
|
34
|
+
"vue": "^3.4.38",
|
|
35
|
+
"@vixt/core": "0.1.11"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "unbuild"
|