@vixt/uni 0.1.3 → 0.1.4

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 CHANGED
@@ -32,7 +32,7 @@ declare function vueusePolyfill(code: string, id: string): string;
32
32
  declare function patchNormalizeNodeModules(): void;
33
33
  declare const uniPatch: (options?: any) => vite.PluginOption;
34
34
 
35
- declare const useImports: () => ImportsMap;
35
+ declare function useImports(): ImportsMap;
36
36
 
37
37
  declare const _default: (options?: _vixt_core.VixtOptions | undefined) => vite.PluginOption;
38
38
 
package/dist/index.d.ts CHANGED
@@ -32,7 +32,7 @@ declare function vueusePolyfill(code: string, id: string): string;
32
32
  declare function patchNormalizeNodeModules(): void;
33
33
  declare const uniPatch: (options?: any) => vite.PluginOption;
34
34
 
35
- declare const useImports: () => ImportsMap;
35
+ declare function useImports(): ImportsMap;
36
36
 
37
37
  declare const _default: (options?: _vixt_core.VixtOptions | undefined) => vite.PluginOption;
38
38
 
package/dist/index.mjs CHANGED
@@ -18,26 +18,26 @@ const presetUni = defineVixtModule({
18
18
  meta: { name },
19
19
  setup(_, vixt) {
20
20
  const { components, composables = [], constants = [], utils = [], stores = [] } = resolveLayersDirs(vixt._layers);
21
- const typesDir = `${vixt.options.buildDir}/types`;
21
+ const { buildTypesDir } = vixt.options;
22
22
  const defaultOptions = {
23
23
  uni: {},
24
- pages: { dts: `${typesDir}/uni-pages.d.ts` },
24
+ pages: { dts: `${buildTypesDir}/uni-pages.d.ts` },
25
25
  uniLayouts: {},
26
26
  components: {
27
- dts: `${typesDir}/components.d.ts`,
27
+ dts: `${buildTypesDir}/components.d.ts`,
28
28
  dirs: components,
29
29
  directoryAsNamespace: true,
30
30
  collapseSamePrefixes: true
31
31
  },
32
32
  imports: {
33
33
  imports: ["vue", "uni-app", "pinia", useImports()],
34
- dts: `${typesDir}/auto-imports.d.ts`,
34
+ dts: `${buildTypesDir}/auto-imports.d.ts`,
35
35
  dirs: [...composables, ...constants, ...stores, ...utils],
36
36
  vueTemplate: true
37
37
  },
38
38
  unocss: {}
39
39
  };
40
- const options = defu(vixt.options, defaultOptions);
40
+ const options = vixt.options = defu(vixt.options, defaultOptions);
41
41
  const modules = [
42
42
  Pages(options.pages),
43
43
  Layouts(options.uniLayouts),
@@ -83,7 +83,7 @@ const uniPatch = defineVitePlugin(() => {
83
83
  });
84
84
 
85
85
  let _cache;
86
- const useImports = () => {
86
+ function useImports() {
87
87
  const excluded = [
88
88
  "toRefs",
89
89
  "utils",
@@ -114,17 +114,14 @@ const useImports = () => {
114
114
  }
115
115
  }
116
116
  return _cache || {};
117
- };
117
+ }
118
118
 
119
119
  const defaults = {
120
120
  modules: [presetUni],
121
121
  app: {
122
- head: {
123
- link: [{ rel: "icon", href: "/static/favicon.ico" }]
124
- },
125
- css: ["virtual:uno.css"],
126
122
  transformMain(code) {
127
123
  code += `
124
+ import 'virtual:uno.css'
128
125
  import { createSSRApp } from 'vue'
129
126
  import * as Pinia from 'pinia'
130
127
  import { createUnistorage } from 'pinia-plugin-unistorage'
@@ -145,7 +142,6 @@ export function createApp() {
145
142
  }
146
143
  },
147
144
  typescript: {
148
- // references: ['types/uni-pages.d.ts', 'types/components.d.ts', 'types/auto-imports.d.ts'],
149
145
  tsConfig: {
150
146
  compilerOptions: {
151
147
  types: ["@dcloudio/types", "@uni-helper/uni-app-types", "@uni-helper/vite-plugin-uni-pages/client"]
@@ -153,8 +149,7 @@ export function createApp() {
153
149
  vueCompilerOptions: {
154
150
  plugins: ["@uni-helper/uni-app-types/volar-plugin"]
155
151
  }
156
- },
157
- typeCheck: { vueTsc: true }
152
+ }
158
153
  }
159
154
  };
160
155
  const index = createVixtPlugin({ defaults });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vixt/uni",
3
3
  "type": "module",
4
- "version": "0.1.3",
4
+ "version": "0.1.4",
5
5
  "author": "SoulLyoko<https://github.com/SoulLyoko>",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/SoulLyoko/vixt#readme",
@@ -32,7 +32,7 @@
32
32
  "unocss": "^0.61.3",
33
33
  "unplugin-auto-import": "^0.18.0",
34
34
  "vue": "^3.4.31",
35
- "@vixt/core": "0.1.3"
35
+ "@vixt/core": "0.1.4"
36
36
  },
37
37
  "scripts": {
38
38
  "build": "unbuild"