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(devtools): consistent casing of devtools types #7971

Merged
merged 1 commit into from
Aug 29, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import type {
SimpleChanges,
} from '@angular/core'
import type {
DevToolsErrorType,
DevtoolsErrorType,
TanstackQueryDevtools,
} from '@tanstack/query-devtools'

Expand Down Expand Up @@ -91,7 +91,7 @@ export class AngularQueryDevtools
/**
* Use this so you can define custom errors that can be shown in the devtools.
*/
@Input() errorTypes?: Array<DevToolsErrorType>
@Input() errorTypes?: Array<DevtoolsErrorType>

@ViewChild('ref') ref!: ElementRef

Expand Down
4 changes: 2 additions & 2 deletions packages/query-devtools/src/Context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ type YPosition = 'top' | 'bottom'
export type DevtoolsPosition = XPosition | YPosition
export type DevtoolsButtonPosition = `${YPosition}-${XPosition}` | 'relative'

export interface DevToolsErrorType {
export interface DevtoolsErrorType {
/**
* The name of the error.
*/
Expand All @@ -27,7 +27,7 @@ export interface QueryDevtoolsProps {
buttonPosition?: DevtoolsButtonPosition
position?: DevtoolsPosition
initialIsOpen?: boolean
errorTypes?: Array<DevToolsErrorType>
errorTypes?: Array<DevtoolsErrorType>
shadowDOMTarget?: ShadowRoot
}

Expand Down
4 changes: 2 additions & 2 deletions packages/query-devtools/src/Devtools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
useTheme,
} from './Context'
import type {
DevToolsErrorType,
DevtoolsButtonPosition,
DevtoolsErrorType,
DevtoolsPosition,
QueryDevtoolsProps,
} from './Context'
Expand Down Expand Up @@ -1916,7 +1916,7 @@
promise?.catch(() => {})
}

const triggerError = (errorType?: DevToolsErrorType) => {
const triggerError = (errorType?: DevtoolsErrorType) => {

Check warning on line 1919 in packages/query-devtools/src/Devtools.tsx

View check run for this annotation

Codecov / codecov/patch

packages/query-devtools/src/Devtools.tsx#L1919

Added line #L1919 was not covered by tests
const error =
errorType?.initializer(activeQuery()!) ??
new Error('Unknown error from devtools')
Expand Down
8 changes: 4 additions & 4 deletions packages/query-devtools/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
} from '@tanstack/query-core'
import type { DevtoolsComponentType } from './Devtools'
import type {
DevToolsErrorType,
DevtoolsButtonPosition,
DevtoolsErrorType,
DevtoolsPosition,
QueryDevtoolsProps,
} from './Context'
import type { Signal } from 'solid-js'

export type { DevtoolsButtonPosition, DevtoolsPosition, DevToolsErrorType }
export type { DevtoolsButtonPosition, DevtoolsPosition, DevtoolsErrorType }
export interface TanstackQueryDevtoolsConfig extends QueryDevtoolsProps {
styleNonce?: string
shadowDOMTarget?: ShadowRoot
Expand All @@ -31,7 +31,7 @@
#buttonPosition: Signal<DevtoolsButtonPosition | undefined>
#position: Signal<DevtoolsPosition | undefined>
#initialIsOpen: Signal<boolean | undefined>
#errorTypes: Signal<Array<DevToolsErrorType> | undefined>
#errorTypes: Signal<Array<DevtoolsErrorType> | undefined>
#Component: DevtoolsComponentType | undefined
#dispose?: () => void

Expand Down Expand Up @@ -72,7 +72,7 @@
this.#initialIsOpen[1](isOpen)
}

setErrorTypes(errorTypes: Array<DevToolsErrorType>) {
setErrorTypes(errorTypes: Array<DevtoolsErrorType>) {

Check warning on line 75 in packages/query-devtools/src/index.tsx

View check run for this annotation

Codecov / codecov/patch

packages/query-devtools/src/index.tsx#L75

Added line #L75 was not covered by tests
this.#errorTypes[1](errorTypes)
}

Expand Down
4 changes: 2 additions & 2 deletions packages/react-query-devtools/src/devtools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import * as React from 'react'
import { onlineManager, useQueryClient } from '@tanstack/react-query'
import { TanstackQueryDevtools } from '@tanstack/query-devtools'
import type {
DevToolsErrorType,
DevtoolsButtonPosition,
DevtoolsErrorType,
DevtoolsPosition,
} from '@tanstack/query-devtools'
import type { QueryClient } from '@tanstack/react-query'
Expand Down Expand Up @@ -33,7 +33,7 @@ export interface DevtoolsOptions {
/**
* Use this so you can define custom errors that can be shown in the devtools.
*/
errorTypes?: Array<DevToolsErrorType>
errorTypes?: Array<DevtoolsErrorType>
/**
* Use this to pass a nonce to the style tag that is added to the document head. This is useful if you are using a Content Security Policy (CSP) nonce to allow inline styles.
*/
Expand Down
4 changes: 2 additions & 2 deletions packages/solid-query-devtools/src/devtools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import { onlineManager, useQueryClient } from '@tanstack/solid-query'
import { isServer } from 'solid-js/web'
import { TanstackQueryDevtools } from '@tanstack/query-devtools'
import type {
DevToolsErrorType,
DevtoolsButtonPosition,
DevtoolsErrorType,
DevtoolsPosition,
} from '@tanstack/query-devtools'
import type { QueryClient } from '@tanstack/solid-query'
Expand Down Expand Up @@ -43,7 +43,7 @@ interface DevtoolsOptions {
/**
* Use this so you can define custom errors that can be shown in the devtools.
*/
errorTypes?: Array<DevToolsErrorType>
errorTypes?: Array<DevtoolsErrorType>
/**
* Use this to pass a nonce to the style tag that is added to the document head. This is useful if you are using a Content Security Policy (CSP) nonce to allow inline styles.
*/
Expand Down
4 changes: 2 additions & 2 deletions packages/svelte-query-devtools/src/Devtools.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import { onlineManager, useQueryClient } from '@tanstack/svelte-query'
import type { QueryClient } from '@tanstack/svelte-query'
import type {
DevToolsErrorType,
DevtoolsButtonPosition,
DevtoolsErrorType,
DevtoolsPosition,
TanstackQueryDevtools,
} from '@tanstack/query-devtools'
Expand All @@ -14,7 +14,7 @@
export let buttonPosition: DevtoolsButtonPosition = 'bottom-right'
export let position: DevtoolsPosition = 'bottom'
export let client: QueryClient = useQueryClient()
export let errorTypes: Array<DevToolsErrorType> = []
export let errorTypes: Array<DevtoolsErrorType> = []
export let styleNonce: string | undefined = undefined
export let shadowDOMTarget: ShadowRoot | undefined = undefined

Expand Down
4 changes: 2 additions & 2 deletions packages/vue-query-devtools/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type {
DevToolsErrorType,
DevtoolsButtonPosition,
DevtoolsErrorType,
DevtoolsPosition,
} from '@tanstack/query-devtools'
import type { QueryClient } from '@tanstack/vue-query'
Expand Down Expand Up @@ -29,7 +29,7 @@ export interface DevtoolsOptions {
/**
* Use this so you can define custom errors that can be shown in the devtools.
*/
errorTypes?: Array<DevToolsErrorType>
errorTypes?: Array<DevtoolsErrorType>
/**
* Use this to pass a nonce to the style tag that is added to the document head. This is useful if you are using a Content Security Policy (CSP) nonce to allow inline styles.
*/
Expand Down
Loading