create-ej-app 10.0.0 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -17,24 +17,24 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@hookform/resolvers": "5.2.2",
|
|
20
|
-
"@next/third-parties": "16.1.
|
|
20
|
+
"@next/third-parties": "16.1.1",
|
|
21
21
|
"@paralleldrive/cuid2": "3.0.4",
|
|
22
22
|
"@radix-ui/react-label": "2.1.8",
|
|
23
23
|
"@radix-ui/react-separator": "1.1.8",
|
|
24
24
|
"@radix-ui/react-slot": "1.2.4",
|
|
25
25
|
"@t3-oss/env-nextjs": "0.13.10",
|
|
26
26
|
"@tanstack/react-query": "5.90.12",
|
|
27
|
-
"better-auth": "1.4.
|
|
27
|
+
"better-auth": "1.4.8",
|
|
28
28
|
"class-variance-authority": "0.7.1",
|
|
29
29
|
"clsx": "2.1.1",
|
|
30
30
|
"drizzle-orm": "0.45.1",
|
|
31
31
|
"fakefilter": "0.1.1401",
|
|
32
32
|
"lucide-react": "0.562.0",
|
|
33
|
-
"next": "16.1.
|
|
33
|
+
"next": "16.1.1",
|
|
34
34
|
"next-safe-action": "8.0.11",
|
|
35
35
|
"next-themes": "0.4.6",
|
|
36
36
|
"nextjs-toploader": "3.9.17",
|
|
37
|
-
"nodemailer": "7.0.
|
|
37
|
+
"nodemailer": "7.0.12",
|
|
38
38
|
"postgres": "3.4.7",
|
|
39
39
|
"react": "19.2.3",
|
|
40
40
|
"react-dom": "19.2.3",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"zod": "4.2.1"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@next/bundle-analyzer": "16.1.
|
|
49
|
+
"@next/bundle-analyzer": "16.1.1",
|
|
50
50
|
"@tailwindcss/postcss": "4.1.18",
|
|
51
51
|
"@types/bun": "1.3.5",
|
|
52
52
|
"@types/nodemailer": "7.0.4",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"babel-plugin-react-compiler": "1.0.0",
|
|
56
56
|
"drizzle-kit": "0.31.8",
|
|
57
57
|
"eslint": "9.39.2",
|
|
58
|
-
"eslint-config-next": "16.1.
|
|
58
|
+
"eslint-config-next": "16.1.1",
|
|
59
59
|
"prettier": "3.7.4",
|
|
60
60
|
"prettier-plugin-organize-imports": "4.3.0",
|
|
61
61
|
"prettier-plugin-tailwindcss": "0.7.2",
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import Link from 'next/link'
|
|
2
|
-
import { Navbar } from '~/components/navbar'
|
|
3
2
|
import { Button } from '~/components/ui/button'
|
|
4
|
-
import { getAuthSession } from '~/lib/auth'
|
|
5
|
-
|
|
6
|
-
export default async function NotFound() {
|
|
7
|
-
const data = await getAuthSession()
|
|
8
3
|
|
|
4
|
+
export default function NotFound() {
|
|
9
5
|
return (
|
|
10
6
|
<main className="bg-background text-foreground flex min-h-screen flex-col">
|
|
11
|
-
<Navbar isLoggedIn={!!data?.session} />
|
|
12
|
-
|
|
13
7
|
<section className="flex min-h-[60vh] flex-col items-center justify-center px-4">
|
|
14
8
|
<div className="text-center">
|
|
15
9
|
<h1 className="text-foreground mb-2 text-6xl font-bold">404</h1>
|
|
@@ -14,17 +14,34 @@ type AnyAction = (
|
|
|
14
14
|
type ActionInput<T extends AnyAction> = Parameters<T>[0]
|
|
15
15
|
type ActionData<T extends AnyAction> = Awaited<ReturnType<T>>['data']
|
|
16
16
|
|
|
17
|
+
class SafeActionError extends Error {
|
|
18
|
+
constructor(
|
|
19
|
+
public message: string,
|
|
20
|
+
public validationErrors?: Record<string, string[] | undefined>
|
|
21
|
+
) {
|
|
22
|
+
super(message)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
17
26
|
export function useSafeActionQuery<TAction extends AnyAction>(
|
|
27
|
+
key: string,
|
|
18
28
|
action: TAction,
|
|
19
29
|
input: ActionInput<TAction>,
|
|
20
30
|
options?: Omit<UseQueryOptions<ActionData<TAction>>, 'queryKey' | 'queryFn'>
|
|
21
31
|
) {
|
|
22
32
|
return useQuery({
|
|
23
|
-
queryKey: [
|
|
33
|
+
queryKey: [key, input],
|
|
24
34
|
queryFn: async () => {
|
|
25
35
|
const result = await action(input)
|
|
26
|
-
|
|
27
|
-
if (result?.
|
|
36
|
+
|
|
37
|
+
if (result?.serverError) {
|
|
38
|
+
throw new SafeActionError(result.serverError)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (result?.validationErrors) {
|
|
42
|
+
throw new SafeActionError('Validation failed', result.validationErrors)
|
|
43
|
+
}
|
|
44
|
+
|
|
28
45
|
return result?.data
|
|
29
46
|
},
|
|
30
47
|
...options
|
|
@@ -33,13 +50,24 @@ export function useSafeActionQuery<TAction extends AnyAction>(
|
|
|
33
50
|
|
|
34
51
|
export function useSafeActionMutation<TAction extends AnyAction>(
|
|
35
52
|
action: TAction,
|
|
36
|
-
options?: UseMutationOptions<
|
|
53
|
+
options?: UseMutationOptions<
|
|
54
|
+
ActionData<TAction>,
|
|
55
|
+
SafeActionError,
|
|
56
|
+
ActionInput<TAction>
|
|
57
|
+
>
|
|
37
58
|
) {
|
|
38
59
|
return useMutation({
|
|
39
60
|
mutationFn: async (input: ActionInput<TAction>) => {
|
|
40
61
|
const result = await action(input)
|
|
41
|
-
|
|
42
|
-
if (result?.
|
|
62
|
+
|
|
63
|
+
if (result?.serverError) {
|
|
64
|
+
throw new SafeActionError(result.serverError)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (result?.validationErrors) {
|
|
68
|
+
throw new SafeActionError('Validation failed', result.validationErrors)
|
|
69
|
+
}
|
|
70
|
+
|
|
43
71
|
return result?.data
|
|
44
72
|
},
|
|
45
73
|
...options
|