From 02543de646c53b643f7a9a2280a6313f96d358cc Mon Sep 17 00:00:00 2001 From: Justin Taddei Date: Wed, 11 Sep 2024 13:21:00 -0600 Subject: [PATCH] fix: typescript errors in nuxt3 module (#792) --- nuxt/index.ts | 14 +++++++------- nuxt/runtime/plugin.ts | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/nuxt/index.ts b/nuxt/index.ts index 07a8dde..ebde409 100644 --- a/nuxt/index.ts +++ b/nuxt/index.ts @@ -1,5 +1,5 @@ -import { defineNuxtModule, addPlugin, createResolver } from '@nuxt/kit' -import type { IVWavePluginOptions } from '../src/options' +import { addPlugin, createResolver, defineNuxtModule } from '@nuxt/kit' +import { DEFAULT_PLUGIN_OPTIONS, type IVWavePluginOptions } from '../src/options' type ModuleOptions = Partial @@ -9,17 +9,17 @@ export default defineNuxtModule({ configKey: 'vWave', compatibility: { nuxt: '>=3.0.0', - bridge: true - } + bridge: true, + }, }, defaults: { - directive: "wave" + ...DEFAULT_PLUGIN_OPTIONS, }, setup(options, nuxt) { const { resolve } = createResolver(import.meta.url) - nuxt.options.runtimeConfig.public.vWave = options + nuxt.options.runtimeConfig.public.vWave = options as unknown as typeof nuxt.options.runtimeConfig.public.vWave addPlugin(resolve('./runtime/plugin.ts')) - } + }, }) diff --git a/nuxt/runtime/plugin.ts b/nuxt/runtime/plugin.ts index 4039903..fbb5bf8 100644 --- a/nuxt/runtime/plugin.ts +++ b/nuxt/runtime/plugin.ts @@ -10,13 +10,13 @@ export default defineNuxtPlugin((app) => { ...vWave, getSSRProps() { return {} - } + }, }) app.vueApp.directive(`${options.directive}-trigger`, { ...vWaveTrigger, getSSRProps() { return {} - } + }, }) }) diff --git a/package.json b/package.json index fbe7bca..81e8257 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "module": "dist/index.js", "types": "dist/index.d.ts", "unpkg": "dist/index.global.js", - "files": ["dist/**/*", "nuxt/**/*"], + "files": ["dist/**/*", "nuxt/**/*", "src/options.ts"], "exports": { "./nuxt": { "import": "./nuxt/index.ts",