Skip to content

Commit 8c973f6

Browse files
ci: apply automated fixes
1 parent 45c5e0f commit 8c973f6

8 files changed

Lines changed: 56 additions & 24 deletions

File tree

examples/react/start-cloudflare/src/routes/__root.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ function RootDocument({ children }: { children: React.ReactNode }) {
2323
{children}
2424
<TanStackDevtools
2525
eventBusConfig={{
26-
connectToServerBus: true
27-
}}
26+
connectToServerBus: true,
27+
}}
2828
config={{ position: 'bottom-right' }}
2929
plugins={[
3030
{

examples/react/start-cloudflare/src/routes/index.tsx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ function App() {
4040
const [results, setResults] = useState<Array<string>>([])
4141

4242
const addResult = (text: string) => {
43-
setResults((prev) => [`[${new Date().toLocaleTimeString()}] ${text}`, ...prev].slice(0, 20))
43+
setResults((prev) =>
44+
[`[${new Date().toLocaleTimeString()}] ${text}`, ...prev].slice(0, 20),
45+
)
4446
}
4547

4648
return (
@@ -55,7 +57,14 @@ function App() {
5557
server.
5658
</p>
5759

58-
<div style={{ display: 'flex', gap: '12px', marginBottom: '24px', flexWrap: 'wrap' }}>
60+
<div
61+
style={{
62+
display: 'flex',
63+
gap: '12px',
64+
marginBottom: '24px',
65+
flexWrap: 'wrap',
66+
}}
67+
>
5968
<button
6069
onClick={async () => {
6170
const msg = await greet()
@@ -121,12 +130,12 @@ function App() {
121130
marginBottom: '24px',
122131
}}
123132
>
124-
<div style={{ fontSize: '12px', color: '#94a3b8', marginBottom: '4px' }}>
133+
<div
134+
style={{ fontSize: '12px', color: '#94a3b8', marginBottom: '4px' }}
135+
>
125136
Loader data (also emits server event on navigation):
126137
</div>
127-
<code style={{ fontSize: '13px' }}>
128-
{JSON.stringify(loaderData)}
129-
</code>
138+
<code style={{ fontSize: '13px' }}>{JSON.stringify(loaderData)}</code>
130139
</div>
131140

132141
{results.length > 0 && (

examples/react/start-cloudflare/wrangler.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
"name": "tanstack-start-cloudflare-devtools-test",
44
"compatibility_date": "2025-09-02",
55
"compatibility_flags": ["nodejs_compat"],
6-
"main": "@tanstack/react-start/server-entry"
6+
"main": "@tanstack/react-start/server-entry",
77
}

examples/react/start-nitro/src/routes/__root.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ function RootDocument({ children }: { children: React.ReactNode }) {
2222
<body style={{ margin: 0, fontFamily: 'system-ui, sans-serif' }}>
2323
{children}
2424
<TanStackDevtools
25-
eventBusConfig={{
26-
connectToServerBus: true
27-
}}
25+
eventBusConfig={{
26+
connectToServerBus: true,
27+
}}
2828
config={{ position: 'bottom-right' }}
2929
plugins={[
3030
{

examples/react/start-nitro/src/routes/index.tsx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ function App() {
4040
const [results, setResults] = useState<Array<string>>([])
4141

4242
const addResult = (text: string) => {
43-
setResults((prev) => [`[${new Date().toLocaleTimeString()}] ${text}`, ...prev].slice(0, 20))
43+
setResults((prev) =>
44+
[`[${new Date().toLocaleTimeString()}] ${text}`, ...prev].slice(0, 20),
45+
)
4446
}
4547

4648
return (
@@ -54,7 +56,14 @@ function App() {
5456
the "Server Events" tab to see events arriving from the server.
5557
</p>
5658

57-
<div style={{ display: 'flex', gap: '12px', marginBottom: '24px', flexWrap: 'wrap' }}>
59+
<div
60+
style={{
61+
display: 'flex',
62+
gap: '12px',
63+
marginBottom: '24px',
64+
flexWrap: 'wrap',
65+
}}
66+
>
5867
<button
5968
onClick={async () => {
6069
const msg = await greet()
@@ -120,12 +129,12 @@ function App() {
120129
marginBottom: '24px',
121130
}}
122131
>
123-
<div style={{ fontSize: '12px', color: '#94a3b8', marginBottom: '4px' }}>
132+
<div
133+
style={{ fontSize: '12px', color: '#94a3b8', marginBottom: '4px' }}
134+
>
124135
Loader data (also emits server event on navigation):
125136
</div>
126-
<code style={{ fontSize: '13px' }}>
127-
{JSON.stringify(loaderData)}
128-
</code>
137+
<code style={{ fontSize: '13px' }}>{JSON.stringify(loaderData)}</code>
129138
</div>
130139

131140
{results.length > 0 && (

packages/devtools-vite/src/plugin.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,9 @@ export const devtools = (args?: TanStackDevtoolsViteConfig): Array<Plugin> => {
202202
devtoolsPort = await bus.start()
203203
if ((server as any).environments) {
204204
const teardownBridge = wireRuntimeBridgeChannels(
205-
server as unknown as Parameters<typeof wireRuntimeBridgeChannels>[0],
205+
server as unknown as Parameters<
206+
typeof wireRuntimeBridgeChannels
207+
>[0],
206208
() => globalThis.__TANSTACK_EVENT_TARGET__,
207209
)
208210
server.httpServer?.on('close', teardownBridge)

packages/devtools-vite/src/runtime-bridge.test.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ describe('injectRuntimeBridge', () => {
7272
})
7373

7474
test('skips event-client-pathed modules that lack the EventClient class', () => {
75-
const id = '/repo/node_modules/@tanstack/devtools-event-client/dist/esm/foo.js'
75+
const id =
76+
'/repo/node_modules/@tanstack/devtools-event-client/dist/esm/foo.js'
7677
expect(injectRuntimeBridge('export const y = 2', id, 'ssr')).toBeUndefined()
7778
})
7879
})
@@ -117,7 +118,9 @@ describe('wireRuntimeBridgeChannels', () => {
117118

118119
wireRuntimeBridgeChannels(server as any, () => target)
119120
const evt = { type: 'q:bar', payload: 2 }
120-
target.dispatchEvent(new CustomEvent('tanstack-devtools-global', { detail: evt }))
121+
target.dispatchEvent(
122+
new CustomEvent('tanstack-devtools-global', { detail: evt }),
123+
)
121124

122125
expect(ssr.__sent).toEqual([{ event: 'tsd:to-client', data: evt }])
123126
})
@@ -154,7 +157,10 @@ describe('wireRuntimeBridgeChannels', () => {
154157
teardown()
155158

156159
// hot.off must have been called with the exact same handler reference.
157-
expect(ssr.__removed).toContainEqual({ event: 'tsd:to-server', cb: registeredHandler })
160+
expect(ssr.__removed).toContainEqual({
161+
event: 'tsd:to-server',
162+
cb: registeredHandler,
163+
})
158164

159165
// Dispatching a worker event after teardown must not reach the target.
160166
const received: any[] = []
@@ -165,6 +171,8 @@ describe('wireRuntimeBridgeChannels', () => {
165171
// The handler still dispatches (it holds a closure over getTarget) but the
166172
// important invariant is that hot.off was called so the real HMR channel
167173
// will no longer invoke it on subsequent dev-server restarts.
168-
expect(ssr.__removed.filter((r) => r.event === 'tsd:to-server')).toHaveLength(1)
174+
expect(
175+
ssr.__removed.filter((r) => r.event === 'tsd:to-server'),
176+
).toHaveLength(1)
169177
})
170178
})

packages/devtools-vite/src/runtime-bridge.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@ export function wireRuntimeBridgeChannels(
8282
for (const [name, env] of Object.entries(server.environments)) {
8383
if (name === 'client') continue
8484
const hot = env?.hot
85-
if (!hot || typeof hot.on !== 'function' || typeof hot.send !== 'function') {
85+
if (
86+
!hot ||
87+
typeof hot.on !== 'function' ||
88+
typeof hot.send !== 'function'
89+
) {
8690
continue
8791
}
8892

0 commit comments

Comments
 (0)