Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update vite and vitest #5724

Merged
merged 3 commits into from
Jul 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { json, type RequestHandler } from '@sveltejs/kit'
import { json } from '@sveltejs/kit'
import type { RequestHandler } from '@sveltejs/kit'

const list = { items: ['Item 1', 'Item 2', 'Item 3'] }

Expand Down
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,5 @@
import { json, type RequestHandler } from '@sveltejs/kit'
import { json } from '@sveltejs/kit'
import type { RequestHandler } from '@sveltejs/kit'

type Todo = {
id: string
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"
}
}
3 changes: 2 additions & 1 deletion examples/vue/persister/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { createApp } from 'vue'
import { VueQueryPlugin, type VueQueryPluginOptions } from '@tanstack/vue-query'
import { VueQueryPlugin } from '@tanstack/vue-query'
import { persistQueryClient } from '@tanstack/query-persist-client-core'
import { createSyncStoragePersister } from '@tanstack/query-sync-storage-persister'
import type { VueQueryPluginOptions } from '@tanstack/vue-query'

import App from './App.vue'

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"@types/testing-library__jest-dom": "^5.14.5",
"@typescript-eslint/eslint-plugin": "^5.54.0",
"@typescript-eslint/parser": "^5.54.0",
"@vitest/coverage-istanbul": "^0.27.1",
"@vitest/coverage-istanbul": "^0.33.0",
"axios": "^1.4.0",
"babel-preset-solid": "^1.6.10",
"chalk": "^5.2.0",
Expand Down Expand Up @@ -95,8 +95,8 @@
"tsup": "^7.1.0",
"type-fest": "^3.13.0",
"typescript": "^5.0.4",
"vite": "^4.2.0",
"vitest": "^0.27.1",
"vite": "^4.4.4",
"vitest": "^0.33.0",
"vue": "^3.2.47"
},
"pnpm": {
Expand Down
8 changes: 5 additions & 3 deletions packages/query-core/src/tests/utils.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
import { act } from '@testing-library/react'
import { vi } 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) {
export function mockVisibilityState(
value: DocumentVisibilityState,
): SpyInstance<[], DocumentVisibilityState> {
return vi.spyOn(document, 'visibilityState', 'get').mockReturnValue(value)
}

export function mockNavigatorOnLine(value: boolean) {
export function mockNavigatorOnLine(value: boolean): SpyInstance<[], boolean> {
return vi.spyOn(navigator, 'onLine', 'get').mockReturnValue(value)
}

Expand Down
3 changes: 2 additions & 1 deletion packages/react-query-devtools/src/__tests__/utils.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { type RenderOptions, render } from '@testing-library/react'
import { render } from '@testing-library/react'
import * as React from 'react'
import {
QueryCache,
QueryClient,
QueryClientProvider,
} from '@tanstack/react-query'
import { ReactQueryDevtools } from '../devtools'
import type { RenderOptions } from '@testing-library/react'

export function renderWithClient(
client: QueryClient,
Expand Down
7 changes: 5 additions & 2 deletions packages/react-query/src/__tests__/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import * as utils from '@tanstack/query-core'
import { vi } from 'vitest'
import { QueryClient, QueryClientProvider } from '..'
import type { QueryClientConfig } from '..'
import type { SpyInstance } from 'vitest'

export function renderWithClient(
client: QueryClient,
Expand Down Expand Up @@ -45,11 +46,13 @@ export function createQueryClient(config?: QueryClientConfig): QueryClient {
return new QueryClient(config)
}

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

export function mockNavigatorOnLine(value: boolean) {
export function mockNavigatorOnLine(value: boolean): SpyInstance<[], boolean> {
return vi.spyOn(navigator, 'onLine', 'get').mockReturnValue(value)
}

Expand Down
7 changes: 5 additions & 2 deletions packages/solid-query/src/__tests__/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { vi } from 'vitest'
import { QueryClient } from '../QueryClient'
import type { QueryClientConfig } from '@tanstack/query-core'
import type { ParentProps } from 'solid-js'
import type { SpyInstance } from 'vitest'

let queryKeyCount = 0
export function queryKey(): Array<string> {
Expand Down Expand Up @@ -34,11 +35,13 @@ export function createQueryClient(config?: QueryClientConfig): QueryClient {
return new QueryClient(config)
}

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

export function mockNavigatorOnLine(value: boolean) {
export function mockNavigatorOnLine(value: boolean): SpyInstance<[], boolean> {
return vi.spyOn(navigator, 'onLine', '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
Loading