Skip to content

Commit cff3008

Browse files
committed
chore: fix type errors
1 parent 648a687 commit cff3008

4 files changed

Lines changed: 13 additions & 9 deletions

File tree

packages/devtools/client/components/ModuleInstallList.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import type { ModuleStaticInfo } from '../../src/types'
33
import Fuse from 'fuse.js'
44
import { computed, ref } from 'vue'
5-
// @ts-expect-error missing types
65
import { RecycleScroller } from 'vue-virtual-scroller'
76
import { useInstalledModules, useModulesList } from '~/composables/state-modules'
87
@@ -117,11 +116,11 @@ const items = computed(() => {
117116
<RecycleScroller
118117
v-slot="{ item }"
119118
class="scroller"
120-
:items="items"
119+
:items="(items || []) as any[]"
121120
:item-size="200"
122121
key-field="name"
123122
>
124-
<ModuleItemInstall :item="item" @start="emit('close')" />
123+
<ModuleItemInstall :item="(item as ModuleStaticInfo)" @start="emit('close')" />
125124
</RecycleScroller>
126125
</div>
127126
</div>

packages/devtools/src/module-main.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import type {} from '@vitejs/devtools-kit'
1+
import type { PluginWithDevTools } from '@vitejs/devtools-kit'
22
import type { ServerResponse } from 'node:http'
33
import type { Nuxt } from 'nuxt/schema'
4+
import type { Plugin } from 'vite'
45
import type { ModuleOptions, NuxtDevToolsOptions } from './types'
56
import { existsSync } from 'node:fs'
67
import fs from 'node:fs/promises'
@@ -65,10 +66,10 @@ export async function enableModule(options: ModuleOptions, nuxt: Nuxt) {
6566
logger.info('[nuxt-devtools] Enabling experimental Vite DevTools integration')
6667
const DevTools = await import('@vitejs/devtools').then(r => r.DevTools())
6768
addVitePlugin(DevTools)
68-
addVitePlugin({
69+
addVitePlugin(defineViteDevToolsPlugin({
6970
name: 'nuxt:devtools',
7071
devtools: {
71-
setup(ctx) {
72+
setup(ctx: any) {
7273
ctx.docks.register({
7374
id: 'nuxt:devtools',
7475
type: 'iframe',
@@ -78,7 +79,7 @@ export async function enableModule(options: ModuleOptions, nuxt: Nuxt) {
7879
})
7980
},
8081
},
81-
})
82+
}))
8283
addPlugin({
8384
src: join(runtimeDir, 'plugins/vite-devtools.client'),
8485
mode: 'client',
@@ -262,3 +263,7 @@ window.__NUXT_DEVTOOLS_TIME_METRIC__.appInit = Date.now()
262263
'\n',
263264
].join(''))
264265
}
266+
267+
function defineViteDevToolsPlugin(plugin: PluginWithDevTools): Plugin<any> {
268+
return plugin as any
269+
}

packages/devtools/src/server-rpc/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export function setupRPC(nuxt: Nuxt, options: ModuleOptions) {
103103
...setupTimelineRPC(ctx),
104104
...setupTelemetryRPC(ctx),
105105
...setupServerDataRPC(ctx),
106-
} satisfies ServerFunctions)
106+
} as ServerFunctions)
107107

108108
const wsClients = new Set<WebSocket>()
109109

packages/devtools/src/server-rpc/server-data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,5 @@ export function setupServerDataRPC({
7272
},
7373
}
7474
},
75-
} satisfies Partial<ServerFunctions>
75+
} as any as Partial<ServerFunctions>
7676
}

0 commit comments

Comments
 (0)