Skip to content

Commit

Permalink
Update to vite 4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlancollins committed Jul 16, 2023
1 parent 58fca7b commit 1133e9c
Show file tree
Hide file tree
Showing 40 changed files with 198 additions and 411 deletions.
2 changes: 1 addition & 1 deletion examples/react/algolia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@types/react-dom": "^18.2.4",
"@vitejs/plugin-react": "^4.0.0",
"typescript": "^5.0.4",
"vite": "^4.2.0"
"vite": "^4.4.4"
},
"browserslist": {
"production": [
Expand Down
2 changes: 1 addition & 1 deletion examples/react/basic-graphql-request/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"devDependencies": {
"@vitejs/plugin-react": "^4.0.0",
"vite": "^4.2.0"
"vite": "^4.4.4"
},
"browserslist": {
"production": [
Expand Down
2 changes: 1 addition & 1 deletion examples/react/basic-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"eslint": "^8.34.0",
"eslint-config-prettier": "^8.8.0",
"typescript": "^5.0.4",
"vite": "^4.2.0"
"vite": "^4.4.4"
},
"browserslist": {
"production": [
Expand Down
2 changes: 1 addition & 1 deletion examples/react/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"devDependencies": {
"@tanstack/eslint-plugin-query": "^5.0.0-alpha.74",
"@vitejs/plugin-react": "^4.0.0",
"vite": "^4.2.0"
"vite": "^4.4.4"
},
"browserslist": {
"production": [
Expand Down
2 changes: 1 addition & 1 deletion examples/react/default-query-function/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"devDependencies": {
"@vitejs/plugin-react": "^4.0.0",
"vite": "^4.2.0"
"vite": "^4.4.4"
},
"browserslist": {
"production": [
Expand Down
2 changes: 1 addition & 1 deletion examples/react/offline/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"devDependencies": {
"@vitejs/plugin-react": "^4.0.0",
"vite": "^4.2.0"
"vite": "^4.4.4"
},
"browserslist": {
"production": [
Expand Down
2 changes: 1 addition & 1 deletion examples/react/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"devDependencies": {
"@vitejs/plugin-react": "^4.0.0",
"vite": "^4.2.0"
"vite": "^4.4.4"
},
"browserslist": {
"production": [
Expand Down
2 changes: 1 addition & 1 deletion examples/react/react-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"devDependencies": {
"@vitejs/plugin-react": "^4.0.0",
"vite": "^4.2.0"
"vite": "^4.4.4"
},
"browserslist": {
"production": [
Expand Down
2 changes: 1 addition & 1 deletion examples/react/rick-morty/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"devDependencies": {
"@vitejs/plugin-react": "^4.0.0",
"vite": "^4.2.0"
"vite": "^4.4.4"
},
"browserslist": {
"production": [
Expand Down
2 changes: 1 addition & 1 deletion examples/react/simple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"devDependencies": {
"@vitejs/plugin-react": "^4.0.0",
"vite": "^4.2.0"
"vite": "^4.4.4"
},
"browserslist": {
"production": [
Expand Down
2 changes: 1 addition & 1 deletion examples/react/star-wars/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"devDependencies": {
"@vitejs/plugin-react": "^4.0.0",
"vite": "^4.2.0"
"vite": "^4.4.4"
},
"browserslist": {
"production": [
Expand Down
2 changes: 1 addition & 1 deletion examples/react/suspense/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
},
"devDependencies": {
"@vitejs/plugin-react": "^4.0.0",
"vite": "^4.2.0"
"vite": "^4.4.4"
},
"scripts": {
"dev": "vite",
Expand Down
2 changes: 1 addition & 1 deletion examples/solid/basic-graphql-request/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"devDependencies": {
"typescript": "^5.0.4",
"vite": "^4.2.0",
"vite": "^4.4.4",
"vite-plugin-solid": "^2.5.0"
}
}
2 changes: 1 addition & 1 deletion examples/solid/basic-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"devDependencies": {
"typescript": "^5.0.4",
"vite": "^4.2.0",
"vite": "^4.4.4",
"vite-plugin-solid": "^2.5.0"
}
}
2 changes: 1 addition & 1 deletion examples/solid/default-query-function/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"devDependencies": {
"typescript": "^5.0.4",
"vite": "^4.2.0",
"vite": "^4.4.4",
"vite-plugin-solid": "^2.5.0"
}
}
2 changes: 1 addition & 1 deletion examples/solid/simple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"devDependencies": {
"@tanstack/eslint-plugin-query": "^5.0.0-alpha.74",
"typescript": "^5.0.4",
"vite": "^4.2.0",
"vite": "^4.4.4",
"vite-plugin-solid": "^2.5.0"
}
}
2 changes: 1 addition & 1 deletion examples/solid/solid-start-streaming/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"postcss": "^8.4.23",
"solid-start-node": "^0.2.0",
"typescript": "^5.0.4",
"vite": "^4.2.0"
"vite": "^4.4.4"
},
"engines": {
"node": ">=16.8"
Expand Down
2 changes: 1 addition & 1 deletion examples/svelte/auto-refetching/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
"svelte-check": "^3.4.4",
"tslib": "^2.5.2",
"typescript": "^5.0.4",
"vite": "^4.2.0"
"vite": "^4.4.4"
}
}
2 changes: 1 addition & 1 deletion examples/svelte/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
"svelte-check": "^3.4.4",
"tslib": "^2.5.2",
"typescript": "^5.0.4",
"vite": "^4.2.0"
"vite": "^4.4.4"
}
}
2 changes: 1 addition & 1 deletion examples/svelte/load-more-infinite-scroll/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
"svelte-check": "^3.4.4",
"tslib": "^2.5.2",
"typescript": "^5.0.4",
"vite": "^4.2.0"
"vite": "^4.4.4"
}
}
2 changes: 1 addition & 1 deletion examples/svelte/optimistic-updates-typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
"svelte-check": "^3.4.4",
"tslib": "^2.5.2",
"typescript": "^5.0.4",
"vite": "^4.2.0"
"vite": "^4.4.4"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { json, } from '@sveltejs/kit'
import { json } from '@sveltejs/kit'
import type { RequestHandler } from '@sveltejs/kit'

type Todo = {
Expand Down
2 changes: 1 addition & 1 deletion examples/svelte/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
"svelte-check": "^3.4.4",
"tslib": "^2.5.2",
"typescript": "^5.0.4",
"vite": "^4.2.0"
"vite": "^4.4.4"
}
}
2 changes: 1 addition & 1 deletion examples/svelte/simple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
"svelte-check": "^3.4.4",
"tslib": "^2.5.2",
"typescript": "^5.0.4",
"vite": "^4.2.0"
"vite": "^4.4.4"
}
}
2 changes: 1 addition & 1 deletion examples/svelte/ssr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
"svelte-check": "^3.4.4",
"tslib": "^2.5.2",
"typescript": "^5.0.4",
"vite": "^4.2.0"
"vite": "^4.4.4"
}
}
2 changes: 1 addition & 1 deletion examples/svelte/star-wars/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"tailwindcss": "^3.3.2",
"tslib": "^2.5.2",
"typescript": "^5.0.4",
"vite": "^4.2.0"
"vite": "^4.4.4"
}
}
2 changes: 1 addition & 1 deletion examples/vue/2.6-basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"devDependencies": {
"typescript": "^5.0.4",
"vite": "^4.2.0",
"vite": "^4.4.4",
"vite-plugin-vue2": "2.0.2"
}
}
2 changes: 1 addition & 1 deletion examples/vue/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"devDependencies": {
"@vitejs/plugin-vue": "^4.2.3",
"typescript": "^5.0.4",
"vite": "^4.2.0"
"vite": "^4.4.4"
}
}
2 changes: 1 addition & 1 deletion examples/vue/dependent-queries/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"devDependencies": {
"@vitejs/plugin-vue": "^4.2.3",
"typescript": "^5.0.4",
"vite": "^4.2.0"
"vite": "^4.4.4"
}
}
2 changes: 1 addition & 1 deletion examples/vue/persister/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"devDependencies": {
"@vitejs/plugin-vue": "^4.2.3",
"typescript": "^5.0.4",
"vite": "^4.2.0"
"vite": "^4.4.4"
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"tsup": "^7.1.0",
"type-fest": "^3.13.0",
"typescript": "^5.0.4",
"vite": "^4.2.0",
"vite": "^4.4.4",
"vitest": "^0.33.0",
"vue": "^3.2.47"
},
Expand Down
7 changes: 4 additions & 3 deletions packages/query-core/src/tests/utils.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import { act } from '@testing-library/react'
import { vi } from 'vitest'
import type { SpyInstance } from 'vitest'

import { QueryClient } from '..'
import * as utils from '../utils'
import type { SpyInstance } from 'vitest'
import type { MutationOptions, QueryClientConfig } from '..'

export function createQueryClient(config?: QueryClientConfig): QueryClient {
return new QueryClient(config)
}

export function mockVisibilityState(value: DocumentVisibilityState): SpyInstance<[], DocumentVisibilityState> {
export function mockVisibilityState(
value: DocumentVisibilityState,
): SpyInstance<[], DocumentVisibilityState> {
return vi.spyOn(document, 'visibilityState', 'get').mockReturnValue(value)
}

Expand Down
4 changes: 3 additions & 1 deletion packages/react-query/src/__tests__/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ export function createQueryClient(config?: QueryClientConfig): QueryClient {
return new QueryClient(config)
}

export function mockVisibilityState(value: DocumentVisibilityState): SpyInstance<[], DocumentVisibilityState> {
export function mockVisibilityState(
value: DocumentVisibilityState,
): SpyInstance<[], DocumentVisibilityState> {
return vi.spyOn(document, 'visibilityState', 'get').mockReturnValue(value)
}

Expand Down
4 changes: 3 additions & 1 deletion packages/solid-query/src/__tests__/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ export function createQueryClient(config?: QueryClientConfig): QueryClient {
return new QueryClient(config)
}

export function mockVisibilityState(value: DocumentVisibilityState): SpyInstance<[], DocumentVisibilityState> {
export function mockVisibilityState(
value: DocumentVisibilityState,
): SpyInstance<[], DocumentVisibilityState> {
return vi.spyOn(document, 'visibilityState', 'get').mockReturnValue(value)
}

Expand Down
2 changes: 1 addition & 1 deletion packages/svelte-query-devtools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"svelte-check": "^3.4.4",
"tslib": "^2.5.2",
"typescript": "^5.0.4",
"vite": "^4.2.0"
"vite": "^4.4.4"
},
"peerDependencies": {
"@tanstack/svelte-query": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/svelte-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"svelte-check": "^3.4.4",
"tslib": "^2.5.2",
"typescript": "^5.0.4",
"vite": "^4.2.0"
"vite": "^4.4.4"
},
"peerDependencies": {
"svelte": ">=3 <5"
Expand Down
4 changes: 3 additions & 1 deletion packages/svelte-query/src/__tests__/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ export function createQueryClient(config?: QueryClientConfig): QueryClient {
return new QueryClient(config)
}

export function mockVisibilityState(value: DocumentVisibilityState): SpyInstance<[], DocumentVisibilityState> {
export function mockVisibilityState(
value: DocumentVisibilityState,
): SpyInstance<[], DocumentVisibilityState> {
return vi.spyOn(document, 'visibilityState', 'get').mockReturnValue(value)
}

Expand Down
3 changes: 2 additions & 1 deletion packages/vue-query/src/__mocks__/useBaseQuery.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { vi } from 'vitest'
import type { Mock } from 'vitest'

const { useBaseQuery: originImpl, unrefQueryArgs: originalParse } =
// @ts-expect-error - vitest uses esmodules; tsconfig is not set to use them
(await vi.importActual('../useBaseQuery')) as any

export const useBaseQuery = vi.fn(originImpl)
export const useBaseQuery: Mock<any[], any> = vi.fn(originImpl)
export const unrefQueryArgs = originalParse
3 changes: 2 additions & 1 deletion packages/vue-query/src/__mocks__/useQueryClient.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { vi } from 'vitest'
import { QueryClient } from '../queryClient'
import type { Mock } from 'vitest'

const queryClient = new QueryClient({
defaultOptions: {
queries: { retry: false, gcTime: Infinity },
},
})

export const useQueryClient = vi.fn(() => queryClient)
export const useQueryClient: Mock<[], QueryClient> = vi.fn(() => queryClient)
Loading

0 comments on commit 1133e9c

Please sign in to comment.