Skip to content

Commit

Permalink
fix: auto import
Browse files Browse the repository at this point in the history
  • Loading branch information
logustra committed Nov 21, 2022
1 parent 1110d5d commit 395ed56
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/app.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts" setup>
import { VLayout } from 'templates'
import VLayout from 'templates/VLayout/vlayout.vue'
</script>

<template>
Expand Down
3 changes: 0 additions & 3 deletions src/components/molecules/index.ts

This file was deleted.

5 changes: 0 additions & 5 deletions src/components/templates/index.ts

This file was deleted.

5 changes: 0 additions & 5 deletions src/composables/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/modules/About/views/about.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts" setup>
import { onMounted } from 'vue'
import { useCommon } from '@/composables'
import useCommon from '@/composables/useCommon'
const { setTitle } = useCommon()
Expand Down
4 changes: 2 additions & 2 deletions src/modules/Home/views/home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { useI18n } from 'vue-i18n'
import { useVuelidate } from '@vuelidate/core'
import { required } from '@vuelidate/validators'
import { VFormItem } from 'molecules'
import { useCommon } from '@/composables'
import VFormItem from 'molecules/VFormItem/vformItem.vue'
import useCommon from '@/composables/useCommon'
const {
t,
Expand Down
2 changes: 1 addition & 1 deletion src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
createWebHistory,
} from 'vue-router'

import { routerGuard } from '@/utils'
import routerGuard from '@/utils/routerGuard'

const domainRouterFiles = import.meta.globEager('../src/modules/**/router.ts')
const domainRoutes: RouteRecordRaw[] = []
Expand Down
28 changes: 28 additions & 0 deletions src/typings/auto-imports.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
export {}
declare global {
const EffectScope: typeof import('vue')['EffectScope']
const SET_TITLE: typeof import('/Volumes/DIST/Documents/Open Source/vivu/src/stores/Common/commonTypes')['SET_TITLE']
const common: typeof import('/Volumes/DIST/Documents/Open Source/vivu/src/stores/Common/index')['default']
const commonActions: typeof import('/Volumes/DIST/Documents/Open Source/vivu/src/stores/Common/commonActions')['default']
const commonGetters: typeof import('/Volumes/DIST/Documents/Open Source/vivu/src/stores/Common/commonGetters')['default']
const commonMutations: typeof import('/Volumes/DIST/Documents/Open Source/vivu/src/stores/Common/commonMutations')['default']
const commonState: typeof import('/Volumes/DIST/Documents/Open Source/vivu/src/stores/Common/commonState')['default']
const computed: typeof import('vue')['computed']
const createApp: typeof import('vue')['createApp']
const createLogger: typeof import('vuex')['createLogger']
Expand All @@ -9,13 +15,18 @@ declare global {
const customRef: typeof import('vue')['customRef']
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
const defineComponent: typeof import('vue')['defineComponent']
const delErrorPage: typeof import('/Volumes/DIST/Documents/Open Source/vivu/src/utils/storage')['delErrorPage']
const effectScope: typeof import('vue')['effectScope']
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
const getCurrentScope: typeof import('vue')['getCurrentScope']
const getErrorPage: typeof import('/Volumes/DIST/Documents/Open Source/vivu/src/utils/storage')['getErrorPage']
const h: typeof import('vue')['h']
const http: typeof import('/Volumes/DIST/Documents/Open Source/vivu/src/services/Http')['default']
const httpService: typeof import('/Volumes/DIST/Documents/Open Source/vivu/src/services/index')['httpService']
const inject: typeof import('vue')['inject']
const isReadonly: typeof import('vue')['isReadonly']
const isRef: typeof import('vue')['isRef']
const isUndefined: typeof import('/Volumes/DIST/Documents/Open Source/vivu/src/utils/filters')['isUndefined']
const mapActions: typeof import('vuex')['mapActions']
const mapGetters: typeof import('vuex')['mapGetters']
const mapMutations: typeof import('vuex')['mapMutations']
Expand All @@ -40,6 +51,8 @@ declare global {
const readonly: typeof import('vue')['readonly']
const ref: typeof import('vue')['ref']
const resolveComponent: typeof import('vue')['resolveComponent']
const routerGuard: typeof import('/Volumes/DIST/Documents/Open Source/vivu/src/utils/routerGuard')['default']
const setErrorPage: typeof import('/Volumes/DIST/Documents/Open Source/vivu/src/utils/storage')['setErrorPage']
const shallowReactive: typeof import('vue')['shallowReactive']
const shallowReadonly: typeof import('vue')['shallowReadonly']
const shallowRef: typeof import('vue')['shallowRef']
Expand All @@ -50,6 +63,7 @@ declare global {
const triggerRef: typeof import('vue')['triggerRef']
const unref: typeof import('vue')['unref']
const useAttrs: typeof import('vue')['useAttrs']
const useCommon: typeof import('/Volumes/DIST/Documents/Open Source/vivu/src/composables/useCommon')['default']
const useCssModule: typeof import('vue')['useCssModule']
const useCssVars: typeof import('vue')['useCssVars']
const useI18n: typeof import('vue-i18n')['useI18n']
Expand All @@ -65,6 +79,12 @@ import { UnwrapRef } from 'vue'
declare module 'vue' {
interface ComponentCustomProperties {
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
readonly SET_TITLE: UnwrapRef<typeof import('/Volumes/DIST/Documents/Open Source/vivu/src/stores/Common/commonTypes')['SET_TITLE']>
readonly common: UnwrapRef<typeof import('/Volumes/DIST/Documents/Open Source/vivu/src/stores/Common/index')['default']>
readonly commonActions: UnwrapRef<typeof import('/Volumes/DIST/Documents/Open Source/vivu/src/stores/Common/commonActions')['default']>
readonly commonGetters: UnwrapRef<typeof import('/Volumes/DIST/Documents/Open Source/vivu/src/stores/Common/commonGetters')['default']>
readonly commonMutations: UnwrapRef<typeof import('/Volumes/DIST/Documents/Open Source/vivu/src/stores/Common/commonMutations')['default']>
readonly commonState: UnwrapRef<typeof import('/Volumes/DIST/Documents/Open Source/vivu/src/stores/Common/commonState')['default']>
readonly computed: UnwrapRef<typeof import('vue')['computed']>
readonly createApp: UnwrapRef<typeof import('vue')['createApp']>
readonly createLogger: UnwrapRef<typeof import('vuex')['createLogger']>
Expand All @@ -73,13 +93,18 @@ declare module 'vue' {
readonly customRef: UnwrapRef<typeof import('vue')['customRef']>
readonly defineAsyncComponent: UnwrapRef<typeof import('vue')['defineAsyncComponent']>
readonly defineComponent: UnwrapRef<typeof import('vue')['defineComponent']>
readonly delErrorPage: UnwrapRef<typeof import('/Volumes/DIST/Documents/Open Source/vivu/src/utils/storage')['delErrorPage']>
readonly effectScope: UnwrapRef<typeof import('vue')['effectScope']>
readonly getCurrentInstance: UnwrapRef<typeof import('vue')['getCurrentInstance']>
readonly getCurrentScope: UnwrapRef<typeof import('vue')['getCurrentScope']>
readonly getErrorPage: UnwrapRef<typeof import('/Volumes/DIST/Documents/Open Source/vivu/src/utils/storage')['getErrorPage']>
readonly h: UnwrapRef<typeof import('vue')['h']>
readonly http: UnwrapRef<typeof import('/Volumes/DIST/Documents/Open Source/vivu/src/services/Http')['default']>
readonly httpService: UnwrapRef<typeof import('/Volumes/DIST/Documents/Open Source/vivu/src/services/index')['httpService']>
readonly inject: UnwrapRef<typeof import('vue')['inject']>
readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']>
readonly isRef: UnwrapRef<typeof import('vue')['isRef']>
readonly isUndefined: UnwrapRef<typeof import('/Volumes/DIST/Documents/Open Source/vivu/src/utils/filters')['isUndefined']>
readonly mapActions: UnwrapRef<typeof import('vuex')['mapActions']>
readonly mapGetters: UnwrapRef<typeof import('vuex')['mapGetters']>
readonly mapMutations: UnwrapRef<typeof import('vuex')['mapMutations']>
Expand All @@ -104,6 +129,8 @@ declare module 'vue' {
readonly readonly: UnwrapRef<typeof import('vue')['readonly']>
readonly ref: UnwrapRef<typeof import('vue')['ref']>
readonly resolveComponent: UnwrapRef<typeof import('vue')['resolveComponent']>
readonly routerGuard: UnwrapRef<typeof import('/Volumes/DIST/Documents/Open Source/vivu/src/utils/routerGuard')['default']>
readonly setErrorPage: UnwrapRef<typeof import('/Volumes/DIST/Documents/Open Source/vivu/src/utils/storage')['setErrorPage']>
readonly shallowReactive: UnwrapRef<typeof import('vue')['shallowReactive']>
readonly shallowReadonly: UnwrapRef<typeof import('vue')['shallowReadonly']>
readonly shallowRef: UnwrapRef<typeof import('vue')['shallowRef']>
Expand All @@ -114,6 +141,7 @@ declare module 'vue' {
readonly triggerRef: UnwrapRef<typeof import('vue')['triggerRef']>
readonly unref: UnwrapRef<typeof import('vue')['unref']>
readonly useAttrs: UnwrapRef<typeof import('vue')['useAttrs']>
readonly useCommon: UnwrapRef<typeof import('/Volumes/DIST/Documents/Open Source/vivu/src/composables/useCommon')['default']>
readonly useCssModule: UnwrapRef<typeof import('vue')['useCssModule']>
readonly useCssVars: UnwrapRef<typeof import('vue')['useCssVars']>
readonly useI18n: UnwrapRef<typeof import('vue-i18n')['useI18n']>
Expand Down
5 changes: 0 additions & 5 deletions src/utils/index.ts

This file was deleted.

10 changes: 9 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,16 @@ export default defineConfig(({ mode }) => {
*/
ViteUnimport.vite({
dirs: [
'src/components/**/**/*.{vue,ts}',
'src/composables',
'src/stores',
'src/services',
'src/stores/**',
'src/utils',
'src/modules/components/**/**/*.{vue,ts}',
'src/modules/composables',
'src/modules/services',
'src/modules/stores/**',
'src/modules/utils',
],
dts: 'src/typings/auto-imports.d.ts',
addons: {
Expand Down

0 comments on commit 395ed56

Please sign in to comment.