Skip to content

Commit

Permalink
fix: typescript errors in nuxt3 module (#792)
Browse files Browse the repository at this point in the history
  • Loading branch information
justintaddei authored Sep 11, 2024
1 parent 7a918d1 commit 02543de
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions nuxt/index.ts
Original file line number Diff line number Diff line change
@@ -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<IVWavePluginOptions>

Expand All @@ -9,17 +9,17 @@ export default defineNuxtModule<ModuleOptions>({
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'))
}
},
})
4 changes: 2 additions & 2 deletions nuxt/runtime/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ export default defineNuxtPlugin((app) => {
...vWave,
getSSRProps() {
return {}
}
},
})

app.vueApp.directive(`${options.directive}-trigger`, {
...vWaveTrigger,
getSSRProps() {
return {}
}
},
})
})
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 02543de

Please sign in to comment.