Skip to content

Commit 055f505

Browse files
committed
chore: update tanstack start
1 parent 8861a31 commit 055f505

File tree

76 files changed

+1014
-1028
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1014
-1028
lines changed

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@
5252
"@tanstack/pacer": "^0.16.4",
5353
"@tanstack/react-pacer": "^0.17.4",
5454
"@tanstack/react-query": "^5.90.12",
55-
"@tanstack/react-router": "1.141.6",
56-
"@tanstack/react-router-devtools": "1.141.6",
57-
"@tanstack/react-router-ssr-query": "1.141.6",
58-
"@tanstack/react-start": "1.141.8",
55+
"@tanstack/react-router": "1.157.16",
56+
"@tanstack/react-router-devtools": "1.157.16",
57+
"@tanstack/react-router-ssr-query": "1.157.16",
58+
"@tanstack/react-start": "1.157.16",
5959
"@tanstack/react-table": "^8.21.3",
6060
"@types/d3": "^7.4.3",
6161
"@uploadthing/react": "^7.3.3",
@@ -84,9 +84,9 @@
8484
"mermaid": "^11.11.0",
8585
"postgres": "^3.4.7",
8686
"posthog-node": "^5.20.0",
87-
"react": "^19.2.0",
87+
"react": "^19.2.4",
8888
"react-colorful": "^5.6.1",
89-
"react-dom": "^19.2.0",
89+
"react-dom": "^19.2.4",
9090
"react-easy-crop": "^5.5.6",
9191
"react-instantsearch": "7",
9292
"rehype-autolink-headings": "^7.1.0",
@@ -124,8 +124,8 @@
124124
"@types/hast": "^3.0.4",
125125
"@types/node": "^24.3.0",
126126
"@types/pg": "^8.15.6",
127-
"@types/react": "^19.2.0",
128-
"@types/react-dom": "^19.2.0",
127+
"@types/react": "^19.2.4",
128+
"@types/react-dom": "^19.2.3",
129129
"@types/remove-markdown": "^0.3.4",
130130
"@types/three": "^0.182.0",
131131
"autoprefixer": "^10.4.18",

pnpm-lock.yaml

Lines changed: 678 additions & 795 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/builder/api/compile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ function extractWarnings(addOns: Array<AddOn>): Array<string> {
174174
.map((a) => `${a.name}: ${a.warning}`)
175175
}
176176

177-
function convertToStarter(template: StarterCompiled): Starter {
177+
function _convertToStarter(template: StarterCompiled): Starter {
178178
return {
179179
...template,
180180
getFiles: () => Promise.resolve(Object.keys(template.files)),

src/components/AuthenticatedUserMenu.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,11 @@ export function AuthenticatedUserMenu({
8080
)}
8181
{canAdmin && (
8282
<DropdownItem asChild>
83-
<Link to="/admin" className="flex items-center gap-2">
83+
<Link
84+
to="/admin"
85+
search={{ tab: 'overview' }}
86+
className="flex items-center gap-2"
87+
>
8488
<Lock className="w-4 h-4" />
8589
<span>Admin</span>
8690
</Link>

src/components/BottomCTA.tsx

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import * as React from 'react'
2-
import type { LinkProps } from '@tanstack/react-router'
32
import { Link } from '@tanstack/react-router'
4-
import { Button } from '~/ui'
3+
import type { LibraryId } from '~/libraries'
54

65
type BottomCTAProps = {
7-
linkProps: Omit<LinkProps, 'className' | 'children'>
6+
linkProps: {
7+
to: '/$libraryId/$version/docs'
8+
params: { libraryId: LibraryId; version?: string }
9+
}
810
label?: string
911
className?: string
1012
}
@@ -23,13 +25,16 @@ export function BottomCTA({
2325
Only one thing left to do...
2426
</div>
2527
<div>
26-
<Button
27-
as={Link}
28-
{...linkProps}
29-
className={`py-2 px-4 text-sm shadow-xs hover:shadow-sm ${className}`}
28+
<Link
29+
to={linkProps.to}
30+
params={{
31+
...linkProps.params,
32+
version: linkProps.params.version ?? 'latest',
33+
}}
34+
className={`inline-flex items-center justify-center gap-2 cursor-pointer transition-colors py-2 px-4 text-sm shadow-xs hover:shadow-sm rounded-lg border font-medium bg-blue-600 text-white border-blue-600 hover:bg-blue-700 ${className}`}
3035
>
3136
{label}
32-
</Button>
37+
</Link>
3338
</div>
3439
</div>
3540
)

src/components/ExampleDeployDialog.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,14 @@ export function ExampleDeployDialog({
9292
// Reset repo name when dialog opens with new example
9393
useEffect(() => {
9494
if (isOpen) {
95+
// eslint-disable-next-line react-hooks/set-state-in-effect
9596
setRepoName(defaultRepoName)
9697
}
9798
}, [isOpen, defaultRepoName])
9899

99100
// Validate and check repo name
100101
useEffect(() => {
102+
// eslint-disable-next-line react-hooks/set-state-in-effect
101103
setRepoNameError(null)
102104

103105
const validation = validateRepoNameFormat(repoName)
@@ -126,6 +128,7 @@ export function ExampleDeployDialog({
126128
// Check auth state when dialog opens or auth changes
127129
useEffect(() => {
128130
if (!isOpen) {
131+
// eslint-disable-next-line react-hooks/set-state-in-effect
129132
setState({ step: 'auth-check' })
130133
setCountdown(null)
131134
return
@@ -155,6 +158,7 @@ export function ExampleDeployDialog({
155158
if (state.step !== 'success' || countdown === null) return
156159

157160
if (countdown <= 0) {
161+
// eslint-disable-next-line react-hooks/set-state-in-effect
158162
setCountdown(null)
159163
const deployUrl = providerInfo.deployUrl(state.owner, state.repoName)
160164
window.open(deployUrl, '_blank')

src/components/FeedbackModerationTopBar.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { libraries } from '~/libraries'
1+
import { libraries, type LibraryId } from '~/libraries'
22
import { DOC_FEEDBACK_STATUSES, type DocFeedbackStatus } from '~/db/types'
33
import {
44
TopBarFilter,
@@ -13,14 +13,14 @@ import { FormInput } from '~/ui'
1313
interface FeedbackModerationTopBarProps {
1414
filters: {
1515
status?: DocFeedbackStatus[]
16-
libraryId?: string
16+
libraryId?: LibraryId
1717
isDetached?: boolean
1818
dateFrom?: string
1919
dateTo?: string
2020
}
2121
onFilterChange: (filters: {
2222
status?: DocFeedbackStatus[]
23-
libraryId?: string
23+
libraryId?: LibraryId
2424
isDetached?: boolean
2525
dateFrom?: string
2626
dateTo?: string
@@ -63,7 +63,7 @@ export function FeedbackModerationTopBar({
6363
filters.dateTo,
6464
)
6565

66-
const getLibraryName = (id: string) =>
66+
const getLibraryName = (id: LibraryId) =>
6767
libraries.find((l) => l.id === id)?.name || id
6868

6969
const formatDateRange = () => {
@@ -130,7 +130,11 @@ export function FeedbackModerationTopBar({
130130
<select
131131
value={filters.libraryId || ''}
132132
onChange={(e) =>
133-
onFilterChange({ libraryId: e.target.value || undefined })
133+
onFilterChange({
134+
libraryId: (e.target.value || undefined) as
135+
| LibraryId
136+
| undefined,
137+
})
134138
}
135139
className="w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-white focus:outline-none focus:ring-2 focus:ring-blue-500"
136140
>

src/components/LibraryHero.tsx

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import * as React from 'react'
22
import { twMerge } from 'tailwind-merge'
3-
import { Link, LinkProps } from '@tanstack/react-router'
4-
import type { Library } from '~/libraries'
5-
import { Button } from '~/ui'
3+
import { Link } from '@tanstack/react-router'
4+
import type { Library, LibraryId } from '~/libraries'
65

76
type LibraryHeroProps = {
87
project: Library
98
cta?: {
10-
linkProps: LinkProps
9+
linkProps: {
10+
to: '/$libraryId/$version/docs'
11+
params: { libraryId: LibraryId; version?: string }
12+
}
1113
label: string
1214
className?: string
1315
}
@@ -54,13 +56,19 @@ export function LibraryHero({ project, cta, actions }: LibraryHeroProps) {
5456
{actions ? (
5557
<div className="flex flex-wrap gap-2 justify-center">{actions}</div>
5658
) : cta ? (
57-
<Button
58-
as={Link}
59-
{...cta.linkProps}
60-
className={twMerge('py-2 px-4 text-sm', cta.className)}
59+
<Link
60+
to={cta.linkProps.to}
61+
params={{
62+
...cta.linkProps.params,
63+
version: cta.linkProps.params.version ?? 'latest',
64+
}}
65+
className={twMerge(
66+
'inline-flex items-center justify-center gap-2 cursor-pointer transition-colors py-2 px-4 text-sm rounded-lg border font-medium bg-blue-600 text-white border-blue-600 hover:bg-blue-700',
67+
cta.className,
68+
)}
6169
>
6270
{cta.label}
63-
</Button>
71+
</Link>
6472
) : null}
6573
</div>
6674
)

src/components/Navbar.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ export function Navbar({ children }: { children: React.ReactNode }) {
180180

181181
const { Title, library } = React.useMemo(() => {
182182
const match = [...matches].reverse().find((m) => m.staticData.Title)
183-
const libraryId = match?.params?.libraryId
183+
const params = match?.params as { libraryId?: string } | undefined
184+
const libraryId = params?.libraryId
184185

185186
return {
186187
Title: match?.staticData.Title ?? null,
@@ -253,7 +254,7 @@ export function Navbar({ children }: { children: React.ReactNode }) {
253254
<Authenticated>
254255
<React.Suspense fallback={<div className="w-[26px] h-[26px]" />}>
255256
<LazyAuthenticatedUserMenu
256-
user={user}
257+
user={user ?? null}
257258
canAdmin={canAdmin}
258259
canApiKeys={canApiKeys}
259260
onSignOut={signOut}
@@ -333,7 +334,8 @@ export function Navbar({ children }: { children: React.ReactNode }) {
333334
</div>
334335
<div className="hidden xl:flex flex-1 justify-end min-w-0">
335336
<Link
336-
to="/cli"
337+
to="/$libraryId/$version"
338+
params={{ libraryId: 'cli', version: 'latest' }}
337339
className="inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md
338340
bg-gradient-to-r from-indigo-600 to-violet-700
339341
hover:from-indigo-500 hover:to-violet-600
@@ -437,7 +439,8 @@ export function Navbar({ children }: { children: React.ReactNode }) {
437439
{/* Mobile: Direct link with Card */}
438440
<MobileCard isActive={isActive}>
439441
<Link
440-
to={`${library.to}/latest`}
442+
to="/$libraryId/$version"
443+
params={{ libraryId: library.id, version: 'latest' }}
441444
className={twMerge(
442445
linkClasses,
443446
'md:hidden',
@@ -477,7 +480,8 @@ export function Navbar({ children }: { children: React.ReactNode }) {
477480
</MobileCard>
478481
{/* Desktop: Simple link */}
479482
<Link
480-
to={`${library.to}/latest`}
483+
to="/$libraryId/$version"
484+
params={{ libraryId: library.id, version: 'latest' }}
481485
className={twMerge(
482486
linkClasses,
483487
'hidden md:flex',

src/components/NotesModerationTopBar.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { libraries } from '~/libraries'
1+
import { libraries, type LibraryId } from '~/libraries'
22
import {
33
TopBarFilter,
44
FilterChip,
@@ -10,13 +10,13 @@ import { FormInput } from '~/ui'
1010

1111
interface NotesModerationTopBarProps {
1212
filters: {
13-
libraryId?: string
13+
libraryId?: LibraryId
1414
isDetached?: boolean
1515
dateFrom?: string
1616
dateTo?: string
1717
}
1818
onFilterChange: (filters: {
19-
libraryId?: string
19+
libraryId?: LibraryId
2020
isDetached?: boolean
2121
dateFrom?: string
2222
dateTo?: string
@@ -43,7 +43,7 @@ export function NotesModerationTopBar({
4343
filters.dateTo,
4444
)
4545

46-
const getLibraryName = (id: string) =>
46+
const getLibraryName = (id: LibraryId) =>
4747
libraries.find((l) => l.id === id)?.name || id
4848

4949
const formatDateRange = () => {
@@ -89,7 +89,11 @@ export function NotesModerationTopBar({
8989
<select
9090
value={filters.libraryId || ''}
9191
onChange={(e) =>
92-
onFilterChange({ libraryId: e.target.value || undefined })
92+
onFilterChange({
93+
libraryId: (e.target.value || undefined) as
94+
| LibraryId
95+
| undefined,
96+
})
9397
}
9498
className="w-full px-3 py-2 text-sm border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-white focus:outline-none focus:ring-2 focus:ring-blue-500"
9599
>

0 commit comments

Comments
 (0)