Skip to content

Commit 093faa7

Browse files
committed
all tests passing (with some node_modules changes in remix-utils)
1 parent a69e20e commit 093faa7

File tree

16 files changed

+929
-2688
lines changed

16 files changed

+929
-2688
lines changed

app/root.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
type DataFunctionArgs,
77
type HeadersFunction,
88
type LinksFunction,
9-
type V2_MetaFunction,
9+
type MetaFunction,
1010
} from '@remix-run/node'
1111
import {
1212
Form,
@@ -59,7 +59,7 @@ import { type Theme, setTheme, getTheme } from './utils/theme.server.ts'
5959
import { makeTimings, time } from './utils/timing.server.ts'
6060
import { getToast } from './utils/toast.server.ts'
6161
import { useOptionalUser, useUser } from './utils/user.ts'
62-
62+
6363
const RemixDevTools =
6464
process.env.NODE_ENV === 'development'
6565
? lazy(() => import('remix-development-tools'))
@@ -93,7 +93,7 @@ export const links: LinksFunction = () => {
9393
].filter(Boolean)
9494
}
9595

96-
export const meta: V2_MetaFunction<typeof loader> = ({ data }) => {
96+
export const meta: MetaFunction<typeof loader> = ({ data }) => {
9797
return [
9898
{ title: data ? 'Epic Notes' : 'Error | Epic Notes' },
9999
{ name: 'description', content: `Your own captain's log` },
@@ -282,8 +282,8 @@ function App() {
282282
<ThemeSwitch userPreference={data.requestInfo.userPrefs.theme} />
283283
</div>
284284
</div>
285-
<Confetti id={data.confettiId} />
286-
<EpicToaster toast={data.toast} />
285+
<Confetti id={data.confettiId} />
286+
<EpicToaster toast={data.toast} />
287287
{RemixDevTools ? (
288288
<Suspense>
289289
<RemixDevTools />

app/routes/_auth+/forgot-password.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
json,
66
redirect,
77
type DataFunctionArgs,
8-
type V2_MetaFunction,
8+
type MetaFunction,
99
} from '@remix-run/node'
1010
import { Link, useFetcher } from '@remix-run/react'
1111
import { z } from 'zod'
@@ -108,7 +108,7 @@ function ForgotPasswordEmail({
108108
)
109109
}
110110

111-
export const meta: V2_MetaFunction = () => {
111+
export const meta: MetaFunction = () => {
112112
return [{ title: 'Password Recovery for Epic Notes' }]
113113
}
114114

app/routes/_auth+/login.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
json,
55
redirect,
66
type DataFunctionArgs,
7-
type V2_MetaFunction,
7+
type MetaFunction,
88
} from '@remix-run/node'
99
import { Form, Link, useActionData, useSearchParams } from '@remix-run/react'
1010
import { safeRedirect } from 'remix-utils'
@@ -81,9 +81,8 @@ export async function handleNewSession(
8181
combineResponseInits(
8282
{
8383
headers: {
84-
'set-cookie': await verifySessionStorage.commitSession(
85-
verifySession,
86-
),
84+
'set-cookie':
85+
await verifySessionStorage.commitSession(verifySession),
8786
},
8887
},
8988
responseInit,
@@ -346,7 +345,7 @@ export default function LoginPage() {
346345
)
347346
}
348347

349-
export const meta: V2_MetaFunction = () => {
348+
export const meta: MetaFunction = () => {
350349
return [{ title: 'Login to Epic Notes' }]
351350
}
352351

app/routes/_auth+/onboarding.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
json,
55
redirect,
66
type DataFunctionArgs,
7-
type V2_MetaFunction,
7+
type MetaFunction,
88
} from '@remix-run/node'
99
import {
1010
Form,
@@ -142,7 +142,7 @@ export async function handleVerification({
142142
})
143143
}
144144

145-
export const meta: V2_MetaFunction = () => {
145+
export const meta: MetaFunction = () => {
146146
return [{ title: 'Setup Epic Notes Account' }]
147147
}
148148

app/routes/_auth+/onboarding_.$provider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
json,
55
redirect,
66
type DataFunctionArgs,
7-
type V2_MetaFunction,
7+
type MetaFunction,
88
} from '@remix-run/node'
99
import {
1010
Form,
@@ -182,7 +182,7 @@ export async function handleVerification({
182182
})
183183
}
184184

185-
export const meta: V2_MetaFunction = () => {
185+
export const meta: MetaFunction = () => {
186186
return [{ title: 'Setup Epic Notes Account' }]
187187
}
188188

app/routes/_auth+/reset-password.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
json,
55
redirect,
66
type DataFunctionArgs,
7-
type V2_MetaFunction,
7+
type MetaFunction,
88
} from '@remix-run/node'
99
import { Form, useActionData, useLoaderData } from '@remix-run/react'
1010
import { z } from 'zod'
@@ -102,7 +102,7 @@ export async function action({ request }: DataFunctionArgs) {
102102
})
103103
}
104104

105-
export const meta: V2_MetaFunction = () => {
105+
export const meta: MetaFunction = () => {
106106
return [{ title: 'Reset Password | Epic Notes' }]
107107
}
108108

app/routes/_auth+/signup.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
json,
66
redirect,
77
type DataFunctionArgs,
8-
type V2_MetaFunction,
8+
type MetaFunction,
99
} from '@remix-run/node'
1010
import { Form, useActionData, useSearchParams } from '@remix-run/react'
1111
import { z } from 'zod'
@@ -100,7 +100,7 @@ export function SignupEmail({
100100
)
101101
}
102102

103-
export const meta: V2_MetaFunction = () => {
103+
export const meta: MetaFunction = () => {
104104
return [{ title: 'Sign Up | Epic Notes' }]
105105
}
106106

app/routes/_marketing+/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type V2_MetaFunction } from '@remix-run/node'
1+
import { type MetaFunction } from '@remix-run/node'
22
import {
33
Tooltip,
44
TooltipContent,
@@ -7,7 +7,7 @@ import {
77
} from '#app/components/ui/tooltip.tsx'
88
import { logos, stars } from './logos/logos.ts'
99

10-
export const meta: V2_MetaFunction = () => [{ title: 'Epic Notes' }]
10+
export const meta: MetaFunction = () => [{ title: 'Epic Notes' }]
1111

1212
export default function Index() {
1313
return (

app/routes/settings+/profile.tsx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { requireUserId } from '#app/utils/auth.server.ts'
66
import { prisma } from '#app/utils/db.server.ts'
77
import { cn, invariantResponse } from '#app/utils/misc.tsx'
88
import { useUser } from '#app/utils/user.ts'
9+
import { z } from 'zod'
910

1011
export const handle = {
1112
breadcrumb: <Icon name="file-text">Edit Profile</Icon>,
@@ -21,17 +22,23 @@ export async function loader({ request }: DataFunctionArgs) {
2122
return json({})
2223
}
2324

25+
const BreadcrumbHandleMatch = z.object({
26+
handle: z.object({ breadcrumb: z.any() }),
27+
})
28+
2429
export default function EditUserProfile() {
2530
const user = useUser()
2631
const matches = useMatches()
2732
const breadcrumbs = matches
28-
.map(m =>
29-
m.handle?.breadcrumb ? (
33+
.map(m => {
34+
const result = BreadcrumbHandleMatch.safeParse(m)
35+
if (!result.success) return null
36+
return (
3037
<Link key={m.id} to={m.pathname} className="flex items-center">
31-
{m.handle.breadcrumb}
38+
{result.data.handle.breadcrumb}
3239
</Link>
33-
) : null,
34-
)
40+
)
41+
})
3542
.filter(Boolean)
3643

3744
return (

app/routes/users+/$username.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
import { json, type DataFunctionArgs } from '@remix-run/node'
2-
import {
3-
Form,
4-
Link,
5-
useLoaderData,
6-
type V2_MetaFunction,
7-
} from '@remix-run/react'
2+
import { Form, Link, useLoaderData, type MetaFunction } from '@remix-run/react'
83
import { GeneralErrorBoundary } from '#app/components/error-boundary.tsx'
94
import { Spacer } from '#app/components/spacer.tsx'
105
import { Button } from '#app/components/ui/button.tsx'
@@ -102,7 +97,7 @@ export default function ProfileRoute() {
10297
)
10398
}
10499

105-
export const meta: V2_MetaFunction<typeof loader> = ({ data, params }) => {
100+
export const meta: MetaFunction<typeof loader> = ({ data, params }) => {
106101
const displayName = data?.user.name ?? params.username
107102
return [
108103
{ title: `${displayName} | Epic Notes` },

0 commit comments

Comments
 (0)