component auto import added

Signed-off-by: Benny Samir Hierl <bennysamir@posteo.de>
This commit is contained in:
Benny Samir Hierl 2022-02-18 20:45:22 +01:00
parent dfc06dc54a
commit c517f0e07e
20 changed files with 219 additions and 80 deletions

38
components.d.ts vendored Normal file
View file

@ -0,0 +1,38 @@
// generated by unplugin-vue-components
// We suggest you to commit this file into source control
// Read more: https://github.com/vuejs/vue-next/pull/3399
declare module 'vue' {
export interface GlobalComponents {
ButtonBase: typeof import('./src/components/ButtonBase.vue')['default']
FormWishlist: typeof import('./src/components/FormWishlist.vue')['default']
FormWishlistItem: typeof import('./src/components/FormWishlistItem.vue')['default']
Header: typeof import('./src/components/Header.vue')['default']
IconCart: typeof import('./src/components/icons/IconCart.vue')['default']
IconCloudQuestion: typeof import('./src/components/icons/IconCloudQuestion.vue')['default']
IconCreation: typeof import('./src/components/icons/IconCreation.vue')['default']
IconDelete: typeof import('./src/components/icons/IconDelete.vue')['default']
IconError: typeof import('./src/components/icons/IconError.vue')['default']
IconImagePlaceholder: typeof import('./src/components/icons/IconImagePlaceholder.vue')['default']
IconLightDark: typeof import('./src/components/icons/IconLightDark.vue')['default']
IconLink: typeof import('./src/components/icons/IconLink.vue')['default']
IconLogin: typeof import('./src/components/icons/IconLogin.vue')['default']
IconLogout: typeof import('./src/components/icons/IconLogout.vue')['default']
IconNoGift: typeof import('./src/components/icons/IconNoGift.vue')['default']
IconPencil: typeof import('./src/components/icons/IconPencil.vue')['default']
IconSave: typeof import('./src/components/icons/IconSave.vue')['default']
IconSpinner: typeof import('./src/components/icons/IconSpinner.vue')['default']
IconToggleOff: typeof import('./src/components/icons/IconToggleOff.vue')['default']
IconToggleOn: typeof import('./src/components/icons/IconToggleOn.vue')['default']
ImagePreview: typeof import('./src/components/ImagePreview.vue')['default']
ImageTile: typeof import('./src/components/ImageTile.vue')['default']
InputCheckbox: typeof import('./src/components/InputCheckbox.vue')['default']
InputFile: typeof import('./src/components/InputFile.vue')['default']
InputText: typeof import('./src/components/InputText.vue')['default']
InputTextArea: typeof import('./src/components/InputTextArea.vue')['default']
Modal: typeof import('./src/components/Modal.vue')['default']
WishlistItem: typeof import('./src/components/WishlistItem.vue')['default']
}
}
export {}

162
package-lock.json generated
View file

@ -49,11 +49,24 @@
"tailwindcss": "^3.0.22",
"ts-node": "^10.5.0",
"typescript": "~4.5.5",
"unplugin-vue-components": "^0.17.18",
"vite": "^2.8.1",
"vitest": "^0.3.4",
"vue-tsc": "^0.31.3"
}
},
"node_modules/@antfu/utils": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/@antfu/utils/-/utils-0.4.0.tgz",
"integrity": "sha512-gqkpvjkgFUu+s3kP+Ly33OKpo5zvVY3FDFhv5BIb98SncS3KD6DNxPfNDjwHIoyXbz1leWo1j8DtRLZ1D2Jv+Q==",
"dev": true,
"dependencies": {
"@types/throttle-debounce": "^2.1.0"
},
"funding": {
"url": "https://github.com/sponsors/antfu"
}
},
"node_modules/@babel/code-frame": {
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz",
@ -408,6 +421,19 @@
"resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-3.9.0-58.bcc2ff906db47790ee902e7bbc76d7ffb1893009.tgz",
"integrity": "sha512-5Dh+qTDhpPR66w6NNAnPs+/W/Qt4r1DSd+qhfPFcDThUK4uxoZKGlPb2IYQn5LL+18aIGnmteDf7BnVMmvBNSQ=="
},
"node_modules/@rollup/pluginutils": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.1.2.tgz",
"integrity": "sha512-ROn4qvkxP9SyPeHaf7uQC/GPFY6L/OWy9+bd9AwcjOAWQwxRscoEyAUD8qCY5o5iL4jqQwoLk2kaTKJPb/HwzQ==",
"dev": true,
"dependencies": {
"estree-walker": "^2.0.1",
"picomatch": "^2.2.2"
},
"engines": {
"node": ">= 8.0.0"
}
},
"node_modules/@rushstack/eslint-patch": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.1.0.tgz",
@ -554,6 +580,12 @@
"@types/node": "*"
}
},
"node_modules/@types/throttle-debounce": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@types/throttle-debounce/-/throttle-debounce-2.1.0.tgz",
"integrity": "sha512-5eQEtSCoESnh2FsiLTxE121IiE60hnMqcb435fShf4bpLRjEu1Eoekht23y6zXS9Ts3l+Szu3TARnTsA0GkOkQ==",
"dev": true
},
"node_modules/@typescript-eslint/eslint-plugin": {
"version": "5.11.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.11.0.tgz",
@ -6563,6 +6595,72 @@
"node": ">= 4.0.0"
}
},
"node_modules/unplugin": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/unplugin/-/unplugin-0.3.2.tgz",
"integrity": "sha512-5d0DMYNKZU+S9eZUiBfw6Co32eRg8myUgBPoWSqG/wDFCUE/WznfSsJnZWi1P9l69x4uLJqt2qVq1xW/AsXFrw==",
"dev": true,
"dependencies": {
"webpack-virtual-modules": "^0.4.3"
},
"peerDependencies": {
"esbuild": ">=0.13",
"rollup": "^2.50.0",
"vite": "^2.3.0",
"webpack": "4 || 5"
},
"peerDependenciesMeta": {
"esbuild": {
"optional": true
},
"rollup": {
"optional": true
},
"vite": {
"optional": true
},
"webpack": {
"optional": true
}
}
},
"node_modules/unplugin-vue-components": {
"version": "0.17.18",
"resolved": "https://registry.npmjs.org/unplugin-vue-components/-/unplugin-vue-components-0.17.18.tgz",
"integrity": "sha512-4wvJnSShTXCnZpO1G6h0DlHjBXap0JqzFyU84guMT6EH0shUZZ3TAta4pDa8nNeWAtcJVTF9uQswePq1elhpKQ==",
"dev": true,
"dependencies": {
"@antfu/utils": "^0.4.0",
"@rollup/pluginutils": "^4.1.2",
"chokidar": "^3.5.2",
"debug": "^4.3.3",
"fast-glob": "^3.2.11",
"local-pkg": "^0.4.1",
"magic-string": "^0.25.7",
"minimatch": "^3.0.4",
"resolve": "^1.21.0",
"unplugin": "^0.3.0"
},
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/sponsors/antfu"
},
"peerDependencies": {
"@babel/parser": "^7.15.8",
"@babel/traverse": "^7.15.4",
"vue": "2 || 3"
},
"peerDependenciesMeta": {
"@babel/parser": {
"optional": true
},
"@babel/traverse": {
"optional": true
}
}
},
"node_modules/upath": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/upath/-/upath-2.0.1.tgz",
@ -7048,6 +7146,12 @@
"node": ">=12"
}
},
"node_modules/webpack-virtual-modules": {
"version": "0.4.3",
"resolved": "https://registry.npmjs.org/webpack-virtual-modules/-/webpack-virtual-modules-0.4.3.tgz",
"integrity": "sha512-5NUqC2JquIL2pBAAo/VfBP6KuGkHIZQXW/lNKupLPfhViwh8wNsu0BObtl09yuKZszeEUfbXz8xhrHvSG16Nqw==",
"dev": true
},
"node_modules/whatwg-encoding": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz",
@ -7308,6 +7412,15 @@
}
},
"dependencies": {
"@antfu/utils": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/@antfu/utils/-/utils-0.4.0.tgz",
"integrity": "sha512-gqkpvjkgFUu+s3kP+Ly33OKpo5zvVY3FDFhv5BIb98SncS3KD6DNxPfNDjwHIoyXbz1leWo1j8DtRLZ1D2Jv+Q==",
"dev": true,
"requires": {
"@types/throttle-debounce": "^2.1.0"
}
},
"@babel/code-frame": {
"version": "7.16.7",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz",
@ -7578,6 +7691,16 @@
"resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-3.9.0-58.bcc2ff906db47790ee902e7bbc76d7ffb1893009.tgz",
"integrity": "sha512-5Dh+qTDhpPR66w6NNAnPs+/W/Qt4r1DSd+qhfPFcDThUK4uxoZKGlPb2IYQn5LL+18aIGnmteDf7BnVMmvBNSQ=="
},
"@rollup/pluginutils": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.1.2.tgz",
"integrity": "sha512-ROn4qvkxP9SyPeHaf7uQC/GPFY6L/OWy9+bd9AwcjOAWQwxRscoEyAUD8qCY5o5iL4jqQwoLk2kaTKJPb/HwzQ==",
"dev": true,
"requires": {
"estree-walker": "^2.0.1",
"picomatch": "^2.2.2"
}
},
"@rushstack/eslint-patch": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.1.0.tgz",
@ -7710,6 +7833,12 @@
"@types/node": "*"
}
},
"@types/throttle-debounce": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/@types/throttle-debounce/-/throttle-debounce-2.1.0.tgz",
"integrity": "sha512-5eQEtSCoESnh2FsiLTxE121IiE60hnMqcb435fShf4bpLRjEu1Eoekht23y6zXS9Ts3l+Szu3TARnTsA0GkOkQ==",
"dev": true
},
"@typescript-eslint/eslint-plugin": {
"version": "5.11.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.11.0.tgz",
@ -12149,6 +12278,33 @@
"integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==",
"dev": true
},
"unplugin": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/unplugin/-/unplugin-0.3.2.tgz",
"integrity": "sha512-5d0DMYNKZU+S9eZUiBfw6Co32eRg8myUgBPoWSqG/wDFCUE/WznfSsJnZWi1P9l69x4uLJqt2qVq1xW/AsXFrw==",
"dev": true,
"requires": {
"webpack-virtual-modules": "^0.4.3"
}
},
"unplugin-vue-components": {
"version": "0.17.18",
"resolved": "https://registry.npmjs.org/unplugin-vue-components/-/unplugin-vue-components-0.17.18.tgz",
"integrity": "sha512-4wvJnSShTXCnZpO1G6h0DlHjBXap0JqzFyU84guMT6EH0shUZZ3TAta4pDa8nNeWAtcJVTF9uQswePq1elhpKQ==",
"dev": true,
"requires": {
"@antfu/utils": "^0.4.0",
"@rollup/pluginutils": "^4.1.2",
"chokidar": "^3.5.2",
"debug": "^4.3.3",
"fast-glob": "^3.2.11",
"local-pkg": "^0.4.1",
"magic-string": "^0.25.7",
"minimatch": "^3.0.4",
"resolve": "^1.21.0",
"unplugin": "^0.3.0"
}
},
"upath": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/upath/-/upath-2.0.1.tgz",
@ -12523,6 +12679,12 @@
"integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==",
"dev": true
},
"webpack-virtual-modules": {
"version": "0.4.3",
"resolved": "https://registry.npmjs.org/webpack-virtual-modules/-/webpack-virtual-modules-0.4.3.tgz",
"integrity": "sha512-5NUqC2JquIL2pBAAo/VfBP6KuGkHIZQXW/lNKupLPfhViwh8wNsu0BObtl09yuKZszeEUfbXz8xhrHvSG16Nqw==",
"dev": true
},
"whatwg-encoding": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz",

View file

@ -61,6 +61,7 @@
"tailwindcss": "^3.0.22",
"ts-node": "^10.5.0",
"typescript": "~4.5.5",
"unplugin-vue-components": "^0.17.18",
"vite": "^2.8.1",
"vitest": "^0.3.4",
"vue-tsc": "^0.31.3"

View file

@ -32,8 +32,6 @@
</template>
<script setup lang="ts">
import { onErrorCaptured, ref } from 'vue'
import Header from '@/components/Header.vue'
import { IconSpinner, IconError } from '@/components/icons'
import { useI18n } from 'vue-i18n'
const { t } = useI18n()

View file

@ -53,15 +53,8 @@
import { Wishlist } from '@/types'
import { useI18n } from 'vue-i18n'
import { Form } from 'vee-validate'
import IconSave from '@/components/icons/IconSave.vue'
import { object, string, boolean } from 'yup'
import {
ButtonBase,
InputText,
InputFile,
InputCheckbox,
InputTextArea,
} from '@/components'
import { IconSave } from '@/components/icons'
defineProps<{
wishlist: Wishlist

View file

@ -72,21 +72,10 @@
<script lang="ts" setup>
import { useI18n } from 'vue-i18n'
import { useForm } from 'vee-validate'
import ImagePreview from './ImagePreview.vue'
import { object, string, boolean } from 'yup'
import {
ButtonBase,
InputText,
InputCheckbox,
InputTextArea,
} from '@/components'
import {
IconSave,
IconDelete,
IconCreation,
IconPencil,
} from '@/components/icons'
import { WishlistItem } from '@/types'
import IconSave from '@/components/icons/IconSave.vue'
import IconDelete from '@/components/icons/IconDelete.vue'
import { PropType } from 'vue'
const props = defineProps({

View file

@ -26,13 +26,6 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n'
import { useDark, useToggle } from '@vueuse/core'
import {
IconLightDark,
IconLogout,
IconLogin,
IconToggleOn,
IconToggleOff,
} from '@/components/icons'
import { useAuth, useEditMode } from '@/composables/'
const { t } = useI18n()

View file

@ -1,6 +1,4 @@
<script setup lang="ts">
import IconImagePlaceholder from './icons/IconImagePlaceholder.vue'
defineProps({
src: {
type: String,

View file

@ -13,7 +13,6 @@
<script setup lang="ts">
import { useField } from 'vee-validate'
import { IconToggleOn, IconToggleOff } from '@/components/icons'
const props = defineProps({
value: {

View file

@ -45,7 +45,6 @@
<script setup lang="ts">
import { useField } from 'vee-validate'
import { ImagePreview } from './'
import { ref } from 'vue'
import { useI18n } from 'vue-i18n'
type FileEventTarget = EventTarget & { files: FileList }

View file

@ -1,5 +1,4 @@
<script lang="ts" setup>
import { ButtonBase } from './'
import { useModal } from '@/composables'
const modal = useModal()

View file

@ -1,8 +1,5 @@
<script lang="ts" setup>
import { useI18n } from 'vue-i18n'
import IconLink from './icons/IconLink.vue'
import ImagePreview from './ImagePreview.vue'
import { ButtonBase } from './'
import IconCart from './icons/IconCart.vue'
import { WishlistItem } from '@/types'
defineProps<{

View file

@ -1,16 +0,0 @@
export { default as IconError } from './IconError.vue'
export { default as IconCart } from './IconCart.vue'
export { default as IconImagePlaceholder } from './IconImagePlaceholder.vue'
export { default as IconLink } from './IconLink.vue'
export { default as IconSpinner } from './IconSpinner.vue'
export { default as IconNoGift } from './IconNoGift.vue'
export { default as IconLightDark } from './IconLightDark.vue'
export { default as IconLogout } from './IconLogout.vue'
export { default as IconLogin } from './IconLogin.vue'
export { default as IconCloudQuestion } from './IconCloudQuestion.vue'
export { default as IconToggleOn } from './IconToggleOn.vue'
export { default as IconToggleOff } from './IconToggleOff.vue'
export { default as IconSave } from './IconSave.vue'
export { default as IconDelete } from './IconDelete.vue'
export { default as IconCreation } from './IconCreation.vue'
export { default as IconPencil } from './IconPencil.vue'

View file

@ -1,12 +0,0 @@
export { default as ButtonBase } from './ButtonBase.vue'
export { default as Header } from './Header.vue'
export { default as ImagePreview } from './ImagePreview.vue'
export { default as ImageTile } from './ImageTile.vue'
export { default as InputCheckbox } from './InputCheckbox.vue'
export { default as InputText } from './InputText.vue'
export { default as InputFile } from './InputFile.vue'
export { default as InputTextArea } from './InputTextArea.vue'
export { default as Modal } from './Modal.vue'
export { default as FormWishlist } from './FormWishlist.vue'
export { default as FormWishlistItem } from './FormWishlistItem.vue'
export { default as WishlistItem } from './WishlistItem.vue'

View file

@ -4,13 +4,6 @@ import { Wishlist, WishlistItem as WishlistItemType } from '@/types'
import { useRoute, useRouter } from 'vue-router'
import { useTitle } from '@vueuse/core'
import { useWishlistStore, useModal, useEditMode } from '@/composables'
import {
FormWishlist,
ImageTile,
WishlistItem,
FormWishlistItem,
} from '@/components'
import { IconNoGift } from '../components/icons'
import { useToast } from 'vue-toastification'
import { computed } from 'vue'

View file

@ -1,6 +1,5 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n'
import ImageTile from '@/components/ImageTile.vue'
import { useWishlistsStore } from '@/composables'
const { t } = useI18n()

View file

@ -4,9 +4,7 @@ import { useI18n } from 'vue-i18n'
import { Form } from 'vee-validate'
import { object, string } from 'yup'
import { useAuth } from '@/composables'
import { IconLogin } from '@/components/icons'
import { ButtonBase } from '@/components'
import InputText from '@/components/InputText.vue'
import IconLogin from '@/components/icons/IconLogin.vue'
const router = useRouter()
const { setToken } = useAuth()

View file

@ -1,5 +1,4 @@
<script setup lang="ts">
import { IconCloudQuestion } from '@/components/icons'
import { useI18n } from 'vue-i18n'
const { t } = useI18n()
</script>

View file

@ -22,5 +22,11 @@
"module": "commonjs"
}
},
"include": ["vite.config.*", "env.d.ts", "src/**/*", "src/**/*.vue"]
"include": [
"vite.config.*",
"env.d.ts",
"src/**/*",
"src/**/*.vue",
"components.d.ts"
]
}

View file

@ -1,11 +1,17 @@
import { fileURLToPath, URL } from 'url'
import Components from 'unplugin-vue-components/vite'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
plugins: [
vue(),
Components({
dts: true,
}),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),