Skip to content

Commit aadc40a

Browse files
committed
chore: broken types
1 parent 71e02aa commit aadc40a

File tree

5 files changed

+2
-8
lines changed

5 files changed

+2
-8
lines changed

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@
9999
"ohash": "^2.0.11",
100100
"pathe": "^2.0.3",
101101
"pkg-types": "^2.1.0",
102-
"semver": "^7.7.1",
103102
"sirv": "^3.0.1",
104103
"std-env": "^3.8.1",
105104
"ufo": "^1.5.4",

pnpm-lock.yaml

-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/module.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
hasNuxtModule,
1010
} from '@nuxt/kit'
1111
import { readPackageJSON } from 'pkg-types'
12-
import { gte } from 'semver'
1312
import type { FetchOptions } from 'ofetch'
1413
import { setupDevToolsUI } from './devtools'
1514
import { NuxtScriptBundleTransformer } from './plugins/transform'
@@ -118,7 +117,7 @@ export default defineNuxtModule<ModuleOptions>({
118117
}
119118
// couldn't be found for some reason, assume compatibility
120119
const { version: unheadVersion } = await readPackageJSON('@unhead/vue')
121-
if (unheadVersion && gte(unheadVersion, '2.0.0-rc.8')) {
120+
if (unheadVersion?.startsWith('1')) {
122121
logger.error(`Nuxt Scripts requires Unhead >= 2, you are using v${unheadVersion}. Please run \`nuxi upgrade --clean\` to upgrade...`)
123122
}
124123
nuxt.options.runtimeConfig['nuxt-scripts'] = { version }

src/runtime/composables/useScript.ts

-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ export function useScript<T extends Record<symbol | string, any> = Record<symbol
6565
}
6666

6767
if (!nuxtApp._scripts[instance.id]) {
68-
// @ts-expect-error untyped
6968
head.hooks.hook('script:updated', (ctx) => {
7069
if (ctx.script.id !== instance.id)
7170
return

src/runtime/utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export function useRegistryScript<T extends Record<string | symbol, any>, O = Em
7474
options.clientInit?.()
7575
}
7676
}
77-
return useScript<T, U>(scriptInput, scriptOptions as NuxtUseScriptOptions<T>)
77+
return useScript<T>(scriptInput, scriptOptions as NuxtUseScriptOptions<T>)
7878
}
7979

8080
export function pick(obj: Record<string, any>, keys: string[]) {

0 commit comments

Comments
 (0)