Skip to content

Commit 18c4808

Browse files
ci: apply automated fixes
1 parent 3ba5825 commit 18c4808

5 files changed

Lines changed: 38 additions & 33 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,4 @@
8585
"@tanstack/solid-devtools": "workspace:*",
8686
"@tanstack/devtools-vite": "workspace:*"
8787
}
88-
}
88+
}

packages/devtools/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,4 @@
6666
"tsup-preset-solid": "^2.2.0",
6767
"vite-plugin-solid": "^2.11.8"
6868
}
69-
}
69+
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ export interface TanStackDevtoolsPlugin {
3939
* ```
4040
*/
4141
name:
42-
| string
43-
| ((
44-
el: HTMLHeadingElement,
45-
theme: DevtoolsStore['settings']['theme'],
46-
) => void)
42+
| string
43+
| ((
44+
el: HTMLHeadingElement,
45+
theme: DevtoolsStore['settings']['theme'],
46+
) => void)
4747
/**
4848
* Unique identifier for the plugin.
4949
* If not provided, it will be generated based on the name.

packages/devtools/src/core.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import { ClientEventBus } from '@tanstack/devtools-event-bus/client'
32
import { initialState } from './context/initial-state'
43
import type { ClientEventBusConfig } from '@tanstack/devtools-event-bus/client'
@@ -59,7 +58,6 @@ export class TanStackDevtoolsCore {
5958
}
6059

6160
async mount<T extends HTMLElement>(el: T) {
62-
6361
if (this.#isMounted) {
6462
throw new Error('Devtools is already mounted')
6563
}
@@ -68,8 +66,16 @@ export class TanStackDevtoolsCore {
6866
const mountTo = el
6967
const dispose = render(() => {
7068
this.#Component = lazy(() => import('./devtools'))
71-
const DevtoolsProvider = lazy(() => import('./context/devtools-context').then(m => ({ default: m.DevtoolsProvider })))
72-
const PiPProvider = lazy(() => import('./context/pip-context').then(m => ({ default: m.PiPProvider })))
69+
const DevtoolsProvider = lazy(() =>
70+
import('./context/devtools-context').then((m) => ({
71+
default: m.DevtoolsProvider,
72+
})),
73+
)
74+
const PiPProvider = lazy(() =>
75+
import('./context/pip-context').then((m) => ({
76+
default: m.PiPProvider,
77+
})),
78+
)
7379
const Devtools = this.#Component
7480
this.#eventBus = new ClientEventBus(this.#eventBusConfig)
7581
this.#eventBus.start()

packages/react-devtools/src/devtools.tsx

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -135,23 +135,23 @@ export const TanStackDevtools = ({
135135
typeof plugin.name === 'string'
136136
? plugin.name
137137
: (e, theme) => {
138-
const id = e.getAttribute('id')!
139-
const target = e.ownerDocument.getElementById(id)
140-
141-
if (target) {
142-
setTitleContainers((prev) => ({
143-
...prev,
144-
[id]: e,
145-
}))
146-
}
147-
148-
convertRender(
149-
plugin.name as PluginRender,
150-
setTitleComponents,
151-
e,
152-
theme,
153-
)
154-
},
138+
const id = e.getAttribute('id')!
139+
const target = e.ownerDocument.getElementById(id)
140+
141+
if (target) {
142+
setTitleContainers((prev) => ({
143+
...prev,
144+
[id]: e,
145+
}))
146+
}
147+
148+
convertRender(
149+
plugin.name as PluginRender,
150+
setTitleComponents,
151+
e,
152+
theme,
153+
)
154+
},
155155
render: (e, theme) => {
156156
const id = e.getAttribute('id')!
157157
const target = e.ownerDocument.getElementById(id)
@@ -182,7 +182,6 @@ export const TanStackDevtools = ({
182182
})
183183
}, [config, eventBusConfig, pluginsMap])
184184

185-
186185
useEffect(() => {
187186
devtoolInstance.current?.setConfig({
188187
plugins: pluginsMap,
@@ -212,14 +211,14 @@ export const TanStackDevtools = ({
212211

213212
{hasPlugins
214213
? Object.entries(pluginContainers).map(([key, pluginContainer]) =>
215-
createPortal(<>{PluginComponents[key]}</>, pluginContainer),
216-
)
214+
createPortal(<>{PluginComponents[key]}</>, pluginContainer),
215+
)
217216
: null}
218217

219218
{hasTitles
220219
? Object.entries(titleContainers).map(([key, titleContainer]) =>
221-
createPortal(<>{TitleComponents[key]}</>, titleContainer),
222-
)
220+
createPortal(<>{TitleComponents[key]}</>, titleContainer),
221+
)
223222
: null}
224223
</>
225224
)

0 commit comments

Comments
 (0)