Skip to content

Commit 84ca95f

Browse files
committed
fix CI
1 parent f8b97b6 commit 84ca95f

File tree

12 files changed

+85
-84
lines changed

12 files changed

+85
-84
lines changed

packages/devtools/src/components/content-panel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { JSX } from 'solid-js/jsx-runtime'
21
import { useStyles } from '../styles/use-styles'
2+
import type { JSX } from 'solid-js/jsx-runtime'
33

44
export const ContentPanel = (props: {
55
ref: (el: HTMLDivElement | undefined) => void

packages/devtools/src/components/main-panel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import clsx from 'clsx'
2-
import { Accessor } from 'solid-js'
3-
import { JSX } from 'solid-js/jsx-runtime'
42
import { useHeight } from '../context/use-devtools-context'
53
import { useStyles } from '../styles/use-styles'
64
import { TANSTACK_DEVTOOLS } from '../utils/storage'
5+
import type { JSX } from 'solid-js/jsx-runtime'
6+
import type { Accessor } from 'solid-js'
77

88
export const MainPanel = (props: {
99
isOpen: Accessor<boolean>

packages/devtools/src/components/trigger.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { Accessor, createMemo } from 'solid-js'
1+
import { createMemo } from 'solid-js'
2+
import clsx from 'clsx'
23
import { useDevtoolsSettings } from '../context/use-devtools-context'
34
import { useStyles } from '../styles/use-styles'
4-
import clsx from 'clsx'
55
import { TanStackLogo } from './logo'
6+
import type { Accessor} from 'solid-js';
67

78
export const Trigger = ({
89
isOpen,
Lines changed: 65 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,93 @@
1-
import type { Setter } from 'solid-js'
21
import { createContext } from 'solid-js'
32
import { createStore } from 'solid-js/store'
43
import { tryParseJson } from '../utils/sanitize'
54
import {
6-
TANSTACK_DEVTOOLS_SETTINGS,
7-
TANSTACK_DEVTOOLS_STATE,
8-
getStorageItem,
9-
setStorageItem,
5+
TANSTACK_DEVTOOLS_SETTINGS,
6+
TANSTACK_DEVTOOLS_STATE,
7+
getStorageItem,
8+
setStorageItem,
109
} from '../utils/storage'
11-
import { type DevtoolsStore, initialState } from './devtools-store'
10+
import { initialState } from './devtools-store'
11+
import type { DevtoolsStore } from './devtools-store';
12+
import type { Setter } from 'solid-js'
1213
import type { JSX } from 'solid-js/jsx-runtime'
1314

1415
export interface DevtoolsPlugin {
15-
name: string | ((el: HTMLDivElement) => void)
16-
id: string
17-
component: (el: HTMLDivElement) => void
16+
name: string | ((el: HTMLDivElement) => void)
17+
id: string
18+
component: (el: HTMLDivElement) => void
1819
}
1920

2021
export const DevtoolsContext = createContext<{
21-
store: DevtoolsStore
22-
setStore: Setter<DevtoolsStore>
22+
store: DevtoolsStore
23+
setStore: Setter<DevtoolsStore>
2324
}>()
2425

2526
interface ContextProps {
26-
children: JSX.Element
27-
plugins?: DevtoolsPlugin[]
28-
config?: DevtoolsSettings
27+
children: JSX.Element
28+
plugins?: Array<DevtoolsPlugin>
29+
config?: DevtoolsSettings
2930
}
3031

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

39-
export const getExistingStateFromStorage = (
40-
config?: DevtoolsSettings,
41-
plugins?: DevtoolsPlugin[],
40+
const getExistingStateFromStorage = (
41+
config?: DevtoolsSettings,
42+
plugins?: Array<DevtoolsPlugin>,
4243
) => {
43-
const existingState = getStorageItem(TANSTACK_DEVTOOLS_STATE)
44-
const settings = getSettings()
44+
const existingState = getStorageItem(TANSTACK_DEVTOOLS_STATE)
45+
const settings = getSettings()
4546

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
47+
const state: DevtoolsStore = {
48+
...initialState,
49+
plugins: plugins || [],
50+
state: {
51+
...initialState.state,
52+
...(existingState ? JSON.parse(existingState) : {}),
53+
},
54+
settings: {
55+
...initialState.settings,
56+
...config,
57+
...settings,
58+
},
59+
}
60+
return state
6061
}
6162

6263
export type DevtoolsSettings = DevtoolsStore['settings']
6364

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

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

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

packages/devtools/src/context/devtools-store.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export type DevtoolsStore = {
5353
activePlugin?: DevtoolsPlugin | undefined
5454
persistOpen: boolean
5555
}
56-
plugins?: DevtoolsPlugin[]
56+
plugins?: Array<DevtoolsPlugin>
5757
}
5858

5959
export const initialState: DevtoolsStore = {

packages/devtools/src/context/use-devtools-context.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createMemo, useContext } from 'solid-js'
2-
import type { DevtoolsPlugin } from './devtools-context'
32
import { DevtoolsContext } from './devtools-context.jsx'
3+
/* import type { DevtoolsPlugin } from './devtools-context' */
44
import type { DevtoolsStore } from './devtools-store.js'
55

66
/**
@@ -16,7 +16,7 @@ const useDevtoolsContext = () => {
1616
}
1717
return context
1818
}
19-
19+
/*
2020
export const usePlugins = () => {
2121
const { store, setStore } = useDevtoolsContext()
2222
@@ -34,9 +34,9 @@ export const usePlugins = () => {
3434
}
3535
3636
return { plugins, setActivePlugin, activePlugin }
37-
}
37+
} */
3838

39-
export const useDevtoolsState = () => {
39+
const useDevtoolsState = () => {
4040
const { store, setStore } = useDevtoolsContext()
4141
const state = createMemo(() => store.state)
4242
const setState = (newState: Partial<DevtoolsStore['state']>) => {

packages/devtools/src/core.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
import { lazy } from 'solid-js'
22
import { Portal, render } from 'solid-js/web'
33
import {
4-
DevtoolsSettings,
5-
DevtoolsPlugin,
64
DevtoolsProvider,
75
} from './context/devtools-context'
86
import { initialState } from './context/devtools-store'
7+
import type {
8+
DevtoolsPlugin,
9+
DevtoolsSettings} from './context/devtools-context';
910

1011
export interface DevtoolsOptions {
1112
options?: Partial<DevtoolsSettings>
12-
plugins?: DevtoolsPlugin[]
13+
plugins?: Array<DevtoolsPlugin>
1314
}
1415

1516
class TanStackDevtoolsCore {
1617
#options: DevtoolsSettings = {
1718
...initialState.settings,
1819
}
19-
#plugins: DevtoolsPlugin[] = []
20+
#plugins: Array<DevtoolsPlugin> = []
2021
#isMounted = false
2122
#dispose?: () => void
2223
#Component: any

packages/devtools/src/devtools.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { createEffect, createSignal } from 'solid-js'
22
import {
3+
useDevtoolsSettings,
34
useHeight,
45
usePersistOpen,
5-
useDevtoolsSettings,
66
} from './context/use-devtools-context'
77
import { useDisableTabbing } from './hooks/use-disable-tabbing'
88
import { TANSTACK_DEVTOOLS } from './utils/storage'

packages/devtools/src/styles/use-styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as goober from 'goober'
22
import { createSignal } from 'solid-js'
33
import { tokens } from './tokens'
4+
import type { DevtoolsSettings } from '../context/devtools-context'
45
import type { Accessor } from 'solid-js'
5-
import { DevtoolsSettings } from '../context/devtools-context'
66

77
const stylesFactory = () => {
88
const { colors, font, size, alpha, border } = tokens

packages/devtools/src/utils/string.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)