Skip to content

Commit 25297f3

Browse files
ci: apply automated fixes
1 parent c25f92d commit 25297f3

File tree

13 files changed

+108
-112
lines changed

13 files changed

+108
-112
lines changed

examples/react/basic/src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import ReactDOM from 'react-dom/client'
2-
import { Devtools } from "@tanstack/react-devtools"
2+
import { Devtools } from '@tanstack/react-devtools'
33
function App() {
44
return (
55
<div>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,4 @@
7878
"@tanstack/react-devtools": "workspace:*",
7979
"@tanstack/solid-devtools": "workspace:*"
8080
}
81-
}
81+
}
Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
import { JSX } from "solid-js/jsx-runtime"
2-
import { useStyles } from "../styles/use-styles"
1+
import { JSX } from 'solid-js/jsx-runtime'
2+
import { useStyles } from '../styles/use-styles'
33

44
export const ContentPanel = (props: {
5-
ref: (el: HTMLDivElement | undefined) => void,
6-
children: JSX.Element,
7-
handleDragStart?: (e: any,) => void
8-
5+
ref: (el: HTMLDivElement | undefined) => void
6+
children: JSX.Element
7+
handleDragStart?: (e: any) => void
98
}) => {
109
const styles = useStyles()
1110
return (
1211
<div ref={props.ref} class={styles().devtoolsPanel}>
1312
{props.handleDragStart ? (
14-
<div class={styles().dragHandle} onMouseDown={props.handleDragStart}></div>
13+
<div
14+
class={styles().dragHandle}
15+
onMouseDown={props.handleDragStart}
16+
></div>
1517
) : null}
1618
{props.children}
1719
</div>
1820
)
19-
}
21+
}

packages/devtools/src/components/logo.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useStyles } from '../styles/use-styles'
33

44
export function TanStackLogo() {
55
const id = createUniqueId()
6-
const styles = useStyles();
6+
const styles = useStyles()
77
return (
88
<svg
99
class={styles().logo}
@@ -817,4 +817,4 @@ export function TanStackLogo() {
817817
</g>
818818
</svg>
819819
)
820-
}
820+
}
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import clsx from "clsx"
2-
import { Accessor } from "solid-js"
3-
import { JSX } from "solid-js/jsx-runtime"
4-
import { useHeight, } from "../context/use-devtools-context"
5-
import { useStyles } from "../styles/use-styles"
6-
import { TANSTACK_DEVTOOLS } from "../utils/storage"
1+
import clsx from 'clsx'
2+
import { Accessor } from 'solid-js'
3+
import { JSX } from 'solid-js/jsx-runtime'
4+
import { useHeight } from '../context/use-devtools-context'
5+
import { useStyles } from '../styles/use-styles'
6+
import { TANSTACK_DEVTOOLS } from '../utils/storage'
77

88
export const MainPanel = (props: {
99
isOpen: Accessor<boolean>
10-
children: JSX.Element,
10+
children: JSX.Element
1111
isResizing: Accessor<boolean>
1212
}) => {
1313
const styles = useStyles()
14-
const { height } = useHeight();
14+
const { height } = useHeight()
1515
return (
1616
<div
1717
id={TANSTACK_DEVTOOLS}
@@ -28,4 +28,4 @@ export const MainPanel = (props: {
2828
{props.children}
2929
</div>
3030
)
31-
}
31+
}

packages/devtools/src/context/devtools-context.tsx

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -3,90 +3,90 @@ import { createContext } from 'solid-js'
33
import { createStore } from 'solid-js/store'
44
import { tryParseJson } from '../utils/sanitize'
55
import {
6-
TANSTACK_DEVTOOLS_SETTINGS,
7-
TANSTACK_DEVTOOLS_STATE,
8-
getStorageItem,
9-
setStorageItem,
6+
TANSTACK_DEVTOOLS_SETTINGS,
7+
TANSTACK_DEVTOOLS_STATE,
8+
getStorageItem,
9+
setStorageItem,
1010
} from '../utils/storage'
1111
import { type DevtoolsStore, initialState } from './devtools-store'
1212
import type { JSX } from 'solid-js/jsx-runtime'
1313

1414
export interface DevtoolsPlugin {
15-
name: string | ((el: HTMLDivElement) => void)
16-
id: string
17-
component: (el: HTMLDivElement) => void
15+
name: string | ((el: HTMLDivElement) => void)
16+
id: string
17+
component: (el: HTMLDivElement) => void
1818
}
1919

2020
export const DevtoolsContext = createContext<{
21-
store: DevtoolsStore
22-
setStore: Setter<DevtoolsStore>
21+
store: DevtoolsStore
22+
setStore: Setter<DevtoolsStore>
2323
}>()
2424

2525
interface ContextProps {
26-
children: JSX.Element
27-
plugins?: DevtoolsPlugin[]
28-
config?: DevtoolsSettings
26+
children: JSX.Element
27+
plugins?: DevtoolsPlugin[]
28+
config?: DevtoolsSettings
2929
}
3030

3131
export const getSettings = () => {
32-
const settingsString = getStorageItem(TANSTACK_DEVTOOLS_SETTINGS)
33-
const settings = tryParseJson<DevtoolsStore['settings']>(settingsString)
34-
return {
35-
...settings,
36-
}
32+
const settingsString = getStorageItem(TANSTACK_DEVTOOLS_SETTINGS)
33+
const settings = tryParseJson<DevtoolsStore['settings']>(settingsString)
34+
return {
35+
...settings,
36+
}
3737
}
3838

3939
export const getExistingStateFromStorage = (
40-
config?: DevtoolsSettings,
41-
plugins?: DevtoolsPlugin[],
40+
config?: DevtoolsSettings,
41+
plugins?: DevtoolsPlugin[],
4242
) => {
43-
const existingState = getStorageItem(TANSTACK_DEVTOOLS_STATE)
44-
const settings = getSettings()
43+
const existingState = getStorageItem(TANSTACK_DEVTOOLS_STATE)
44+
const settings = getSettings()
4545

46-
const state: DevtoolsStore = {
47-
...initialState,
48-
plugins: plugins || [],
49-
state: {
50-
...initialState.state,
51-
...(existingState ? JSON.parse(existingState) : {}),
52-
},
53-
settings: {
54-
...initialState.settings,
55-
...config,
56-
...settings,
57-
},
58-
}
59-
return state
46+
const state: DevtoolsStore = {
47+
...initialState,
48+
plugins: plugins || [],
49+
state: {
50+
...initialState.state,
51+
...(existingState ? JSON.parse(existingState) : {}),
52+
},
53+
settings: {
54+
...initialState.settings,
55+
...config,
56+
...settings,
57+
},
58+
}
59+
return state
6060
}
6161

6262
export type DevtoolsSettings = DevtoolsStore['settings']
6363

6464
export const DevtoolsProvider = (props: ContextProps) => {
65-
const [store, setStore] = createStore(
66-
getExistingStateFromStorage(props.config, props.plugins),
67-
)
65+
const [store, setStore] = createStore(
66+
getExistingStateFromStorage(props.config, props.plugins),
67+
)
6868

69-
const value = {
70-
store,
71-
setStore: (
72-
updater: (prev: DevtoolsStore) => DevtoolsStore | Partial<DevtoolsStore>,
73-
) => {
74-
const newState = updater(store)
75-
const { settings, state: internalState } = newState
76-
// Store user settings for dev tools into local storage
77-
setStorageItem(TANSTACK_DEVTOOLS_SETTINGS, JSON.stringify(settings))
78-
// Store general state into local storage
79-
setStorageItem(TANSTACK_DEVTOOLS_STATE, JSON.stringify(internalState))
80-
setStore((prev) => ({
81-
...prev,
82-
...newState,
83-
}))
84-
},
85-
}
69+
const value = {
70+
store,
71+
setStore: (
72+
updater: (prev: DevtoolsStore) => DevtoolsStore | Partial<DevtoolsStore>,
73+
) => {
74+
const newState = updater(store)
75+
const { settings, state: internalState } = newState
76+
// Store user settings for dev tools into local storage
77+
setStorageItem(TANSTACK_DEVTOOLS_SETTINGS, JSON.stringify(settings))
78+
// Store general state into local storage
79+
setStorageItem(TANSTACK_DEVTOOLS_STATE, JSON.stringify(internalState))
80+
setStore((prev) => ({
81+
...prev,
82+
...newState,
83+
}))
84+
},
85+
}
8686

87-
return (
88-
<DevtoolsContext.Provider value={value}>
89-
{props.children}
90-
</DevtoolsContext.Provider>
91-
)
87+
return (
88+
<DevtoolsContext.Provider value={value}>
89+
{props.children}
90+
</DevtoolsContext.Provider>
91+
)
9292
}

packages/devtools/src/core.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export interface DevtoolsOptions {
1414

1515
class TanStackDevtoolsCore {
1616
#options: DevtoolsSettings = {
17-
...initialState.settings
17+
...initialState.settings,
1818
}
1919
#plugins: DevtoolsPlugin[] = []
2020
#isMounted = false

packages/devtools/src/devtools.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createEffect, createSignal, } from 'solid-js'
1+
import { createEffect, createSignal } from 'solid-js'
22
import {
33
useHeight,
44
usePersistOpen,
@@ -11,7 +11,7 @@ import { MainPanel } from './components/main-panel'
1111
import { ContentPanel } from './components/content-panel'
1212

1313
export default function DevTools() {
14-
const { settings, } = useDevtoolsSettings()
14+
const { settings } = useDevtoolsSettings()
1515
const { setHeight } = useHeight()
1616
const { persistOpen, setPersistOpen } = usePersistOpen()
1717
const [rootEl, setRootEl] = createSignal<HTMLDivElement>()
@@ -29,7 +29,7 @@ export default function DevTools() {
2929
// Used to resize the panel
3030
const handleDragStart = (
3131
panelElement: HTMLDivElement | undefined,
32-
startEvent: MouseEvent
32+
startEvent: MouseEvent,
3333
) => {
3434
if (startEvent.button !== 0) return // Only allow left click for drag
3535

@@ -63,7 +63,6 @@ export default function DevTools() {
6363
document.addEventListener('mouseup', unsub)
6464
}
6565

66-
6766
// Handle resizing and padding adjustments
6867
createEffect(() => {
6968
if (isOpen()) {
@@ -129,7 +128,10 @@ export default function DevTools() {
129128
<div ref={setRootEl} data-testid={TANSTACK_DEVTOOLS}>
130129
<Trigger isOpen={isOpen} setIsOpen={toggleOpen} />
131130
<MainPanel isResizing={isResizing} isOpen={isOpen}>
132-
<ContentPanel ref={ref => panelRef = ref} handleDragStart={e => handleDragStart(panelRef, e)}>
131+
<ContentPanel
132+
ref={(ref) => (panelRef = ref)}
133+
handleDragStart={(e) => handleDragStart(panelRef, e)}
134+
>
133135
hello
134136
</ContentPanel>
135137
</MainPanel>
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
export const uppercaseFirstLetter = (value: string) => value.charAt(0).toUpperCase() + value.slice(1)
1+
export const uppercaseFirstLetter = (value: string) =>
2+
value.charAt(0).toUpperCase() + value.slice(1)

packages/react-devtools/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,4 @@
7474
"@types/react": ">=16.8",
7575
"@types/react-dom": ">=16.8"
7676
}
77-
}
77+
}

0 commit comments

Comments
 (0)