From 6afe7675e982b93d604410dafbec1d78d758a37a Mon Sep 17 00:00:00 2001 From: Lordmau5 Date: Tue, 14 Nov 2023 19:43:51 +0100 Subject: [PATCH] Update files --- .eslintrc-auto-import.json | 7 +- auto-imports.d.ts | 228 +++++++++++++++++++++++++++- src/App.vue | 9 +- src/components/EditorComponent.vue | 5 +- src/components/MarkdownRenderer.vue | 5 +- src/components/NavbarComponent.vue | 7 +- src/components/SidebarComponent.vue | 5 +- vite.config.ts | 63 ++++---- 8 files changed, 275 insertions(+), 54 deletions(-) diff --git a/.eslintrc-auto-import.json b/.eslintrc-auto-import.json index 805f265..a136e11 100644 --- a/.eslintrc-auto-import.json +++ b/.eslintrc-auto-import.json @@ -85,6 +85,11 @@ "ComponentBase": true, "EditorComponent": true, "VueMarkdown": true, - "MarkdownRenderer": true + "MarkdownRenderer": true, + "VueComponent": true, + "DComponent": true, + "__Component": true, + "__Ref": true, + "DRef": true } } diff --git a/auto-imports.d.ts b/auto-imports.d.ts index fb46694..3cdaf47 100644 --- a/auto-imports.d.ts +++ b/auto-imports.d.ts @@ -5,9 +5,10 @@ // Generated by unplugin-auto-import export {} declare global { - const Component: typeof import('vue-facing-decorator')['Component'] - const ComponentBase: typeof import('vue-facing-decorator')['ComponentBase'] + const DComponent: typeof import('vue-facing-decorator')['Component'] + const DRef: typeof import('vue-facing-decorator')['Ref'] const EditorComponent: typeof import('./src/components/EditorComponent.vue')['default'] + const EffectScope: typeof import('vue')['EffectScope'] const Emit: typeof import('vue-facing-decorator')['Emit'] const Hook: typeof import('vue-facing-decorator')['Hook'] const Inject: typeof import('vue-facing-decorator')['Inject'] @@ -16,13 +17,232 @@ declare global { const NavbarComponent: typeof import('./src/components/NavbarComponent.vue')['default'] const Prop: typeof import('vue-facing-decorator')['Prop'] const Provide: typeof import('vue-facing-decorator')['Provide'] - const Ref: typeof import('vue-facing-decorator')['Ref'] const Setup: typeof import('vue-facing-decorator')['Setup'] const SidebarComponent: typeof import('./src/components/SidebarComponent.vue')['default'] const VModel: typeof import('vue-facing-decorator')['VModel'] const Vanilla: typeof import('vue-facing-decorator')['Vanilla'] const Vue: typeof import('vue-facing-decorator')['Vue'] - const VueMarkdown: typeof import('vue-markdown')['VueMarkdown'] const Watch: typeof import('vue-facing-decorator')['Watch'] + const computed: typeof import('vue')['computed'] + const createApp: typeof import('vue')['createApp'] + const customRef: typeof import('vue')['customRef'] + const defineAsyncComponent: typeof import('vue')['defineAsyncComponent'] + const defineComponent: typeof import('vue')['defineComponent'] + const effectScope: typeof import('vue')['effectScope'] + const getCurrentInstance: typeof import('vue')['getCurrentInstance'] + const getCurrentScope: typeof import('vue')['getCurrentScope'] + const h: typeof import('vue')['h'] + const inject: typeof import('vue')['inject'] + const isProxy: typeof import('vue')['isProxy'] + const isReactive: typeof import('vue')['isReactive'] + const isReadonly: typeof import('vue')['isReadonly'] + const isRef: typeof import('vue')['isRef'] + const markRaw: typeof import('vue')['markRaw'] + const nextTick: typeof import('vue')['nextTick'] + const onActivated: typeof import('vue')['onActivated'] + const onBeforeMount: typeof import('vue')['onBeforeMount'] + const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave'] + const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate'] + const onBeforeUnmount: typeof import('vue')['onBeforeUnmount'] + const onBeforeUpdate: typeof import('vue')['onBeforeUpdate'] + const onDeactivated: typeof import('vue')['onDeactivated'] + const onErrorCaptured: typeof import('vue')['onErrorCaptured'] + const onMounted: typeof import('vue')['onMounted'] + const onRenderTracked: typeof import('vue')['onRenderTracked'] + const onRenderTriggered: typeof import('vue')['onRenderTriggered'] + const onScopeDispose: typeof import('vue')['onScopeDispose'] + const onServerPrefetch: typeof import('vue')['onServerPrefetch'] + const onUnmounted: typeof import('vue')['onUnmounted'] + const onUpdated: typeof import('vue')['onUpdated'] + const provide: typeof import('vue')['provide'] + const reactive: typeof import('vue')['reactive'] + const readonly: typeof import('vue')['readonly'] + const ref: typeof import('vue')['ref'] + const resolveComponent: typeof import('vue')['resolveComponent'] + const shallowReactive: typeof import('vue')['shallowReactive'] + const shallowReadonly: typeof import('vue')['shallowReadonly'] + const shallowRef: typeof import('vue')['shallowRef'] const toNative: typeof import('vue-facing-decorator')['toNative'] + const toRaw: typeof import('vue')['toRaw'] + const toRef: typeof import('vue')['toRef'] + const toRefs: typeof import('vue')['toRefs'] + const toValue: typeof import('vue')['toValue'] + const triggerRef: typeof import('vue')['triggerRef'] + const unref: typeof import('vue')['unref'] + const useAttrs: typeof import('vue')['useAttrs'] + const useCssModule: typeof import('vue')['useCssModule'] + const useCssVars: typeof import('vue')['useCssVars'] + const useLink: typeof import('vue-router')['useLink'] + const useRoute: typeof import('vue-router')['useRoute'] + const useRouter: typeof import('vue-router')['useRouter'] + const useSlots: typeof import('vue')['useSlots'] + const watch: typeof import('vue')['watch'] + const watchEffect: typeof import('vue')['watchEffect'] + const watchPostEffect: typeof import('vue')['watchPostEffect'] + const watchSyncEffect: typeof import('vue')['watchSyncEffect'] +} +// for type re-export +declare global { + // @ts-ignore + export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue' +} +// for vue template auto import +import { UnwrapRef } from 'vue' +declare module 'vue' { + interface ComponentCustomProperties { + readonly DComponent: UnwrapRef + readonly DRef: UnwrapRef + readonly EditorComponent: UnwrapRef + readonly EffectScope: UnwrapRef + readonly Emit: UnwrapRef + readonly Hook: UnwrapRef + readonly Inject: UnwrapRef + readonly MarkdownRenderer: UnwrapRef + readonly Model: UnwrapRef + readonly NavbarComponent: UnwrapRef + readonly Prop: UnwrapRef + readonly Provide: UnwrapRef + readonly Setup: UnwrapRef + readonly SidebarComponent: UnwrapRef + readonly VModel: UnwrapRef + readonly Vanilla: UnwrapRef + readonly Vue: UnwrapRef + readonly Watch: UnwrapRef + readonly computed: UnwrapRef + readonly createApp: UnwrapRef + readonly customRef: UnwrapRef + readonly defineAsyncComponent: UnwrapRef + readonly defineComponent: UnwrapRef + readonly effectScope: UnwrapRef + readonly getCurrentInstance: UnwrapRef + readonly getCurrentScope: UnwrapRef + readonly h: UnwrapRef + readonly inject: UnwrapRef + readonly isProxy: UnwrapRef + readonly isReactive: UnwrapRef + readonly isReadonly: UnwrapRef + readonly isRef: UnwrapRef + readonly markRaw: UnwrapRef + readonly nextTick: UnwrapRef + readonly onActivated: UnwrapRef + readonly onBeforeMount: UnwrapRef + readonly onBeforeRouteLeave: UnwrapRef + readonly onBeforeRouteUpdate: UnwrapRef + readonly onBeforeUnmount: UnwrapRef + readonly onBeforeUpdate: UnwrapRef + readonly onDeactivated: UnwrapRef + readonly onErrorCaptured: UnwrapRef + readonly onMounted: UnwrapRef + readonly onRenderTracked: UnwrapRef + readonly onRenderTriggered: UnwrapRef + readonly onScopeDispose: UnwrapRef + readonly onServerPrefetch: UnwrapRef + readonly onUnmounted: UnwrapRef + readonly onUpdated: UnwrapRef + readonly provide: UnwrapRef + readonly reactive: UnwrapRef + readonly readonly: UnwrapRef + readonly ref: UnwrapRef + readonly resolveComponent: UnwrapRef + readonly shallowReactive: UnwrapRef + readonly shallowReadonly: UnwrapRef + readonly shallowRef: UnwrapRef + readonly toNative: UnwrapRef + readonly toRaw: UnwrapRef + readonly toRef: UnwrapRef + readonly toRefs: UnwrapRef + readonly toValue: UnwrapRef + readonly triggerRef: UnwrapRef + readonly unref: UnwrapRef + readonly useAttrs: UnwrapRef + readonly useCssModule: UnwrapRef + readonly useCssVars: UnwrapRef + readonly useLink: UnwrapRef + readonly useRoute: UnwrapRef + readonly useRouter: UnwrapRef + readonly useSlots: UnwrapRef + readonly watch: UnwrapRef + readonly watchEffect: UnwrapRef + readonly watchPostEffect: UnwrapRef + readonly watchSyncEffect: UnwrapRef + } +} +declare module '@vue/runtime-core' { + interface ComponentCustomProperties { + readonly DComponent: UnwrapRef + readonly DRef: UnwrapRef + readonly EditorComponent: UnwrapRef + readonly EffectScope: UnwrapRef + readonly Emit: UnwrapRef + readonly Hook: UnwrapRef + readonly Inject: UnwrapRef + readonly MarkdownRenderer: UnwrapRef + readonly Model: UnwrapRef + readonly NavbarComponent: UnwrapRef + readonly Prop: UnwrapRef + readonly Provide: UnwrapRef + readonly Setup: UnwrapRef + readonly SidebarComponent: UnwrapRef + readonly VModel: UnwrapRef + readonly Vanilla: UnwrapRef + readonly Vue: UnwrapRef + readonly Watch: UnwrapRef + readonly computed: UnwrapRef + readonly createApp: UnwrapRef + readonly customRef: UnwrapRef + readonly defineAsyncComponent: UnwrapRef + readonly defineComponent: UnwrapRef + readonly effectScope: UnwrapRef + readonly getCurrentInstance: UnwrapRef + readonly getCurrentScope: UnwrapRef + readonly h: UnwrapRef + readonly inject: UnwrapRef + readonly isProxy: UnwrapRef + readonly isReactive: UnwrapRef + readonly isReadonly: UnwrapRef + readonly isRef: UnwrapRef + readonly markRaw: UnwrapRef + readonly nextTick: UnwrapRef + readonly onActivated: UnwrapRef + readonly onBeforeMount: UnwrapRef + readonly onBeforeRouteLeave: UnwrapRef + readonly onBeforeRouteUpdate: UnwrapRef + readonly onBeforeUnmount: UnwrapRef + readonly onBeforeUpdate: UnwrapRef + readonly onDeactivated: UnwrapRef + readonly onErrorCaptured: UnwrapRef + readonly onMounted: UnwrapRef + readonly onRenderTracked: UnwrapRef + readonly onRenderTriggered: UnwrapRef + readonly onScopeDispose: UnwrapRef + readonly onServerPrefetch: UnwrapRef + readonly onUnmounted: UnwrapRef + readonly onUpdated: UnwrapRef + readonly provide: UnwrapRef + readonly reactive: UnwrapRef + readonly readonly: UnwrapRef + readonly ref: UnwrapRef + readonly resolveComponent: UnwrapRef + readonly shallowReactive: UnwrapRef + readonly shallowReadonly: UnwrapRef + readonly shallowRef: UnwrapRef + readonly toNative: UnwrapRef + readonly toRaw: UnwrapRef + readonly toRef: UnwrapRef + readonly toRefs: UnwrapRef + readonly toValue: UnwrapRef + readonly triggerRef: UnwrapRef + readonly unref: UnwrapRef + readonly useAttrs: UnwrapRef + readonly useCssModule: UnwrapRef + readonly useCssVars: UnwrapRef + readonly useLink: UnwrapRef + readonly useRoute: UnwrapRef + readonly useRouter: UnwrapRef + readonly useSlots: UnwrapRef + readonly watch: UnwrapRef + readonly watchEffect: UnwrapRef + readonly watchPostEffect: UnwrapRef + readonly watchSyncEffect: UnwrapRef + } } diff --git a/src/App.vue b/src/App.vue index 4ac7fba..313dec8 100644 --- a/src/App.vue +++ b/src/App.vue @@ -11,17 +11,12 @@ diff --git a/src/components/EditorComponent.vue b/src/components/EditorComponent.vue index fa1825e..920fc85 100644 --- a/src/components/EditorComponent.vue +++ b/src/components/EditorComponent.vue @@ -126,8 +126,8 @@ import { games } from '@/js/ParseGamesJSON.js'; -@Component -class EditorComponent extends Vue { +@DComponent +export default class EditorComponent extends Vue { games: BingoGame[] = Array.from(games.values()); selected_game: BingoGame | undefined = undefined; @@ -152,5 +152,4 @@ class EditorComponent extends Vue { return this.games.filter(game => game.name.toLocaleLowerCase().includes(this.search.toLocaleLowerCase())); } } -export default toNative(EditorComponent); diff --git a/src/components/MarkdownRenderer.vue b/src/components/MarkdownRenderer.vue index ba40f53..fda746f 100644 --- a/src/components/MarkdownRenderer.vue +++ b/src/components/MarkdownRenderer.vue @@ -6,8 +6,8 @@ import MarkdownIt from 'markdown-it'; const md = new MarkdownIt(); -@Component -class MarkdownRenderer extends Vue { +@DComponent +export default class MarkdownRenderer extends Vue { @Prop({ default: false, required: true @@ -18,5 +18,4 @@ class MarkdownRenderer extends Vue { return md.render(this.text); } } -export default toNative(MarkdownRenderer); diff --git a/src/components/NavbarComponent.vue b/src/components/NavbarComponent.vue index 5629fc4..c5e9203 100644 --- a/src/components/NavbarComponent.vue +++ b/src/components/NavbarComponent.vue @@ -7,19 +7,18 @@ - Title + The Bingo Experience diff --git a/src/components/SidebarComponent.vue b/src/components/SidebarComponent.vue index dfee2ab..d7fca0e 100644 --- a/src/components/SidebarComponent.vue +++ b/src/components/SidebarComponent.vue @@ -21,8 +21,8 @@ diff --git a/vite.config.ts b/vite.config.ts index 8793b65..a0859af 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -25,46 +25,51 @@ export default defineConfig({ plugins: [ VueRouter(), Components({ - resolvers: [ QuasarResolver() ] + resolvers: [ QuasarResolver() ], + dts: true }), AutoImport({ include: [ /\.[tj]sx?$/, // .ts, .tsx, .js, .jsx /\.vue$/, - /\.vue\?vue/, // .vue - /\.md$/ // .md + /\.vue\?vue/ // .vue ], - // imports: [ - // // presets - // 'vue', - // 'vue-router' - // ], - imports: [ { - 'vue-facing-decorator': [ - 'Component', - 'ComponentBase', - 'Setup', - 'Ref', - 'Watch', - 'Prop', - 'Provide', - 'Inject', - 'Emit', - 'VModel', - 'Model', - 'Vanilla', - 'Hook', + imports: [ + // presets + 'vue', + 'vue-router', + { + 'vue-facing-decorator': [ + [ + 'Component', + 'DComponent' + ], + [ + 'Ref', + 'DRef' + ], + 'Setup', + 'Watch', + 'Prop', + 'Provide', + 'Inject', + 'Emit', + 'VModel', + 'Model', + 'Vanilla', + 'Hook', - 'toNative', - 'Vue' - ], - 'vue-markdown': [ 'VueMarkdown' ] - } ], + 'toNative', + 'Vue' + ] + } + ], dirs: [ './src/components/**' ], dts: true, eslintrc: { enabled: true - } + }, + vueTemplate: true }), vue({