Skip to content

Commit

Permalink
🚧 lets see if we dont include ModuleOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
acidjazz committed Jan 20, 2025
1 parent 5bc63ee commit 75fcb2d
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 63 deletions.
2 changes: 1 addition & 1 deletion src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ export default defineNuxtModule<ModuleOptions>({
const resolver = createResolver(import.meta.url)

addPlugin(resolver.resolve('./runtime/plugin'))
addServerPlugin(resolver.resolve('./runtime/server/plugins/care.ts'))
addServerPlugin(resolver.resolve('./runtime/nitro.ts'))
},
})
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { defineNitroPlugin, useRuntimeConfig } from 'nitropack/runtime'
import type { ModuleOptions } from '../../../module'
import { careNitroError } from '../care'
import { careNitroError } from './care'

export default defineNitroPlugin((nitroApp) => {
nitroApp.hooks.hook('error', async (error, { event }) => {
const config = useRuntimeConfig(event).public.care as Required<ModuleOptions>
const config = useRuntimeConfig(event).public.care as Required<{ apiKey: string, apiDomain?: string }>
careNitroError(error, config)
})
})
3 changes: 1 addition & 2 deletions src/runtime/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import type { ModuleOptions } from '../module'
import { careVueError, careAppError } from './care'
import { defineNuxtPlugin, useRuntimeConfig } from '#app'

export default defineNuxtPlugin((nuxtApp) => {
const config = useRuntimeConfig().public.care as Required<ModuleOptions>
const config = useRuntimeConfig().public.care as Required<{ apiKey: string, apiDomain?: string }>
nuxtApp.hook('vue:error', (error: unknown, _instance, _info) => careVueError(error, config))
nuxtApp.hook('app:error', (error: unknown) => careAppError(error, config))
})
54 changes: 0 additions & 54 deletions src/runtime/server/care.ts

This file was deleted.

3 changes: 0 additions & 3 deletions src/runtime/server/tsconfig.json

This file was deleted.

0 comments on commit 75fcb2d

Please sign in to comment.