Skip to content

Commit

Permalink
chore(deps): update all non-major dependencies (nuxt#9670)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Daniel Roe <daniel@roe.dev>
  • Loading branch information
renovate[bot] and danielroe authored Dec 12, 2022
1 parent 2a2f21b commit 3733f12
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 72 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"vitest": "^0.25.7",
"vue-tsc": "^1.0.13"
},
"packageManager": "pnpm@7.18.1",
"packageManager": "pnpm@7.18.2",
"engines": {
"node": "^14.16.0 || ^16.10.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"knitwork": "^1.0.0",
"magic-string": "^0.27.0",
"mlly": "^1.0.0",
"nitropack": "npm:nitropack-edge@2.0.0-27847479.5831707",
"nitropack": "npm:nitropack-edge@2.0.0-27847631.8186a02",
"nuxi": "3.0.0",
"ohash": "^1.0.0",
"ofetch": "^1.0.0",
Expand All @@ -70,7 +70,7 @@
"scule": "^1.0.0",
"strip-literal": "^1.0.0",
"ufo": "^1.0.1",
"ultrahtml": "^1.1.0",
"ultrahtml": "^1.2.0",
"unctx": "^2.1.1",
"unenv": "^1.0.0",
"unimport": "^1.0.2",
Expand Down
17 changes: 9 additions & 8 deletions packages/nuxt/src/app/composables/fetch.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { FetchError, FetchOptions } from 'ofetch'
import type { TypedInternalResponse, NitroFetchRequest } from 'nitropack'
import type { FetchError } from 'ofetch'
import type { TypedInternalResponse, NitroFetchOptions, NitroFetchRequest } from 'nitropack'
import type { Ref } from 'vue'
import { computed, unref, reactive } from 'vue'
import { hash } from 'ohash'
Expand All @@ -12,13 +12,14 @@ type ComputedOptions<T extends Record<string, any>> = {
[K in keyof T]: T[K] extends Function ? T[K] : T[K] extends Record<string, any> ? ComputedOptions<T[K]> | Ref<T[K]> | T[K] : Ref<T[K]> | T[K]
}

type ComputedFetchOptions = ComputedOptions<FetchOptions>
type ComputedFetchOptions<R extends NitroFetchRequest> = ComputedOptions<NitroFetchOptions<R>>

export interface UseFetchOptions<
DataT,
Transform extends _Transform<DataT, any> = _Transform<DataT, DataT>,
PickKeys extends KeyOfRes<Transform> = KeyOfRes<Transform>
> extends AsyncDataOptions<DataT, Transform, PickKeys>, ComputedFetchOptions {
PickKeys extends KeyOfRes<Transform> = KeyOfRes<Transform>,
R extends NitroFetchRequest = string & {}
> extends AsyncDataOptions<DataT, Transform, PickKeys>, ComputedFetchOptions<R> {
key?: string
}

Expand All @@ -31,7 +32,7 @@ export function useFetch<
PickKeys extends KeyOfRes<Transform> = KeyOfRes<Transform>
> (
request: Ref<ReqT> | ReqT | (() => ReqT),
opts?: UseFetchOptions<_ResT, Transform, PickKeys>
opts?: UseFetchOptions<_ResT, Transform, PickKeys, ReqT>
): AsyncData<PickFrom<ReturnType<Transform>, PickKeys>, ErrorT | null>
export function useFetch<
ResT = void,
Expand All @@ -42,7 +43,7 @@ export function useFetch<
PickKeys extends KeyOfRes<Transform> = KeyOfRes<Transform>
> (
request: Ref<ReqT> | ReqT | (() => ReqT),
arg1?: string | UseFetchOptions<_ResT, Transform, PickKeys>,
arg1?: string | UseFetchOptions<_ResT, Transform, PickKeys, ReqT>,
arg2?: string
) {
const [opts = {}, autoKey] = typeof arg1 === 'string' ? [{}, arg1] : [arg1, arg2]
Expand Down Expand Up @@ -98,7 +99,7 @@ export function useFetch<
const asyncData = useAsyncData<_ResT, ErrorT, Transform, PickKeys>(key, () => {
controller?.abort?.()
controller = typeof AbortController !== 'undefined' ? new AbortController() : {} as AbortController
return $fetch(_request.value, { signal: controller.signal, ..._fetchOptions }) as Promise<_ResT>
return $fetch(_request.value, { signal: controller.signal, ..._fetchOptions } as any) as Promise<_ResT>
}, _asyncDataOptions)

return asyncData
Expand Down
2 changes: 1 addition & 1 deletion packages/schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@types/semver": "^7",
"@unhead/schema": "^1.0.13",
"@vitejs/plugin-vue": "^4.0.0",
"nitropack": "npm:nitropack-edge@2.0.0-27847479.5831707",
"nitropack": "npm:nitropack-edge@2.0.0-27847631.8186a02",
"unbuild": "latest",
"vite": "~4.0.0"
},
Expand Down
76 changes: 16 additions & 60 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3733f12

Please sign in to comment.