Skip to content

Commit

Permalink
♻️ back to ModuleOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
acidjazz committed Jan 20, 2025
1 parent fa74d41 commit 531907a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 43 deletions.
37 changes: 0 additions & 37 deletions .github/workflows/nuxthub.yml

This file was deleted.

5 changes: 1 addition & 4 deletions src/runtime/care.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
interface Config {
apiKey: string
apiDomain?: string
}
import type { ModuleOptions as Config } from '../module'

interface ErrorPayload {
name: string
Expand Down
3 changes: 2 additions & 1 deletion src/runtime/nitro.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { defineNitroPlugin, useRuntimeConfig } from 'nitropack/runtime'
import type { ModuleOptions } from '../module'
import { careNitroError } from './care'

export default defineNitroPlugin((nitroApp) => {
nitroApp.hooks.hook('error', async (error, { event }) => {
const config = useRuntimeConfig(event).public.care as Required<{ apiKey: string, apiDomain?: string }>
const config = useRuntimeConfig(event).public.care as Required<ModuleOptions>
careNitroError(error, config)
})
})
3 changes: 2 additions & 1 deletion src/runtime/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
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<{ apiKey: string, apiDomain?: string }>
const config = useRuntimeConfig().public.care as Required<ModuleOptions>
nuxtApp.hook('vue:error', (error: unknown, _instance, _info) => careVueError(error, config))
nuxtApp.hook('app:error', (error: unknown) => careAppError(error, config))
})

0 comments on commit 531907a

Please sign in to comment.