create-croissant 0.1.50 → 0.1.52
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 +1 -1
- package/template/apps/desktop/package.json +2 -6
- package/template/apps/desktop/src/renderer/src/components/app-sidebar.tsx +1 -1
- package/template/apps/desktop/src/renderer/src/components/login-form.tsx +10 -6
- package/template/apps/desktop/src/renderer/src/components/signup-form.tsx +13 -9
- package/template/apps/desktop/src/renderer/src/env.d.ts +5 -0
- package/template/apps/desktop/src/renderer/src/routes/__root.tsx +1 -1
- package/template/apps/desktop/src/renderer/src/routes/_auth/account.tsx +1 -1
- package/template/apps/desktop/src/renderer/src/routes/_auth/dashboard.tsx +1 -1
- package/template/apps/desktop/src/renderer/src/routes/_auth/examples/client-orpc-auth.tsx +1 -1
- package/template/apps/desktop/src/renderer/src/routes/_auth.tsx +2 -2
- package/template/apps/desktop/src/renderer/src/routes/_public/examples/client-orpc.tsx +12 -8
- package/template/apps/desktop/src/renderer/src/routes/_public/login.tsx +1 -1
- package/template/apps/desktop/src/renderer/src/routes/_public/signup.tsx +1 -1
- package/template/apps/desktop/src/renderer/src/routes/_public.tsx +1 -1
- package/template/apps/desktop/tsconfig.web.json +0 -1
- package/template/apps/mobile/package.json +4 -3
- package/template/apps/platform/package.json +5 -8
- package/template/apps/platform/src/components/login-form.tsx +9 -5
- package/template/apps/platform/src/components/signup-form.tsx +12 -8
- package/template/apps/platform/src/routes/_public/examples/client-orpc.tsx +13 -12
- package/template/apps/platform/src/routes/_public/examples/ssr-orpc.tsx +12 -8
- package/template/package.json +11 -13
- package/template/packages/auth/package.json +1 -2
- package/template/packages/orpc/package.json +2 -0
- package/template/packages/ui/package.json +0 -1
- package/template/packages/ui/src/components/input-otp.tsx +14 -3
package/package.json
CHANGED
|
@@ -21,17 +21,11 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@electron-toolkit/preload": "^3.0.2",
|
|
23
23
|
"@electron-toolkit/utils": "^4.0.0",
|
|
24
|
-
"@orpc/client": "^1.14.3",
|
|
25
|
-
"@orpc/server": "^1.14.3",
|
|
26
|
-
"@orpc/tanstack-query": "^1.14.3",
|
|
27
24
|
"@tailwindcss/vite": "^4.2.4",
|
|
28
|
-
"@tanstack/react-form": "^1.32.0",
|
|
29
|
-
"@tanstack/react-query": "^5.100.10",
|
|
30
25
|
"@tanstack/react-router": "^1.169.2",
|
|
31
26
|
"@workspace/auth": "workspace:*",
|
|
32
27
|
"@workspace/orpc": "workspace:*",
|
|
33
28
|
"@workspace/ui": "workspace:*",
|
|
34
|
-
"better-auth": "^1.6.11",
|
|
35
29
|
"electron-updater": "^6.3.9",
|
|
36
30
|
"lucide-react": "^1.14.0",
|
|
37
31
|
"react": "19.2.5",
|
|
@@ -44,6 +38,8 @@
|
|
|
44
38
|
"@tanstack/react-router-devtools": "^1.166.13",
|
|
45
39
|
"@tanstack/router-plugin": "^1.167.35",
|
|
46
40
|
"@types/node": "^22.19.1",
|
|
41
|
+
"@types/react": "^19.2.14",
|
|
42
|
+
"@types/react-dom": "^19.2.3",
|
|
47
43
|
"@vitejs/plugin-react": "^5.1.1",
|
|
48
44
|
"@workspace/config-typescript": "workspace:*",
|
|
49
45
|
"electron": "39.8.9",
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
import { Avatar, AvatarFallback, AvatarImage } from "@workspace/ui/components/avatar";
|
|
19
19
|
import { ModeToggle } from "@workspace/ui/components/mode-toggle";
|
|
20
20
|
|
|
21
|
-
import { authClient } from "
|
|
21
|
+
import { authClient } from "@renderer/lib/auth-client";
|
|
22
22
|
|
|
23
23
|
// This is sample data.
|
|
24
24
|
export const authNavItems = [
|
|
@@ -20,7 +20,7 @@ import { Link, useNavigate } from "@tanstack/react-router";
|
|
|
20
20
|
import { useForm } from "@tanstack/react-form";
|
|
21
21
|
import { z } from "zod";
|
|
22
22
|
|
|
23
|
-
import { authClient } from "
|
|
23
|
+
import { authClient } from "@renderer/lib/auth-client";
|
|
24
24
|
|
|
25
25
|
const loginSchema = z.object({
|
|
26
26
|
email: z.string().email("Invalid email address"),
|
|
@@ -128,13 +128,17 @@ export function LoginForm({ className, ...props }: React.ComponentProps<"div">)
|
|
|
128
128
|
/>
|
|
129
129
|
<Field>
|
|
130
130
|
<form.Subscribe
|
|
131
|
-
selector={(state) =>
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
131
|
+
selector={(state) => ({
|
|
132
|
+
canSubmit: state.canSubmit,
|
|
133
|
+
isSubmitting: state.isSubmitting,
|
|
134
|
+
})}
|
|
135
|
+
>
|
|
136
|
+
{(state: { canSubmit: boolean; isSubmitting: boolean }) => (
|
|
137
|
+
<Button type="submit" disabled={!state.canSubmit || state.isSubmitting || loading}>
|
|
138
|
+
{state.isSubmitting || loading ? "Logging in..." : "Login"}
|
|
135
139
|
</Button>
|
|
136
140
|
)}
|
|
137
|
-
|
|
141
|
+
</form.Subscribe>
|
|
138
142
|
<Button variant="outline" type="button" disabled={loading}>
|
|
139
143
|
Login with Google
|
|
140
144
|
</Button>
|
|
@@ -18,7 +18,7 @@ import { useState } from "react";
|
|
|
18
18
|
import { Link, useNavigate } from "@tanstack/react-router";
|
|
19
19
|
import { useForm } from "@tanstack/react-form";
|
|
20
20
|
import { z } from "zod";
|
|
21
|
-
import { authClient } from "
|
|
21
|
+
import { authClient } from "@renderer/lib/auth-client";
|
|
22
22
|
|
|
23
23
|
const signupSchema = z
|
|
24
24
|
.object({
|
|
@@ -174,14 +174,18 @@ export function SignupForm({ ...props }: React.ComponentProps<typeof Card>) {
|
|
|
174
174
|
/>
|
|
175
175
|
<FieldGroup>
|
|
176
176
|
<Field>
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
177
|
+
<form.Subscribe
|
|
178
|
+
selector={(state) => ({
|
|
179
|
+
canSubmit: state.canSubmit,
|
|
180
|
+
isSubmitting: state.isSubmitting,
|
|
181
|
+
})}
|
|
182
|
+
>
|
|
183
|
+
{(state: { canSubmit: boolean; isSubmitting: boolean }) => (
|
|
184
|
+
<Button type="submit" disabled={!state.canSubmit || state.isSubmitting || loading}>
|
|
185
|
+
{state.isSubmitting || loading ? "Creating..." : "Create Account"}
|
|
186
|
+
</Button>
|
|
187
|
+
)}
|
|
188
|
+
</form.Subscribe>
|
|
185
189
|
<Button variant="outline" type="button" disabled={loading}>
|
|
186
190
|
Sign up with Google
|
|
187
191
|
</Button>
|
|
@@ -3,7 +3,7 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
|
3
3
|
import { Toaster } from "@workspace/ui/components/sonner";
|
|
4
4
|
import { ThemeProvider } from "@workspace/ui/components/theme-provider";
|
|
5
5
|
import { ORPCProvider } from "@workspace/orpc/react";
|
|
6
|
-
import { orpc } from "
|
|
6
|
+
import { orpc } from "@renderer/lib/orpc";
|
|
7
7
|
import { TanStackRouterDevtools } from "@tanstack/react-router-devtools";
|
|
8
8
|
|
|
9
9
|
import "@workspace/ui/globals.css";
|
|
@@ -19,7 +19,7 @@ import { Field, FieldError, FieldLabel } from "@workspace/ui/components/field";
|
|
|
19
19
|
import { Avatar, AvatarFallback, AvatarImage } from "@workspace/ui/components/avatar";
|
|
20
20
|
import { Separator } from "@workspace/ui/components/separator";
|
|
21
21
|
|
|
22
|
-
import { authClient } from "
|
|
22
|
+
import { authClient } from "@renderer/lib/auth-client";
|
|
23
23
|
|
|
24
24
|
const profileSchema = z.object({
|
|
25
25
|
name: z.string().min(1, "Name is required"),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createFileRoute } from "@tanstack/react-router";
|
|
2
|
-
import { authClient } from "
|
|
2
|
+
import { authClient } from "@renderer/lib/auth-client";
|
|
3
3
|
import { useSecretData } from "@workspace/orpc/react";
|
|
4
4
|
|
|
5
5
|
export const Route = createFileRoute("/_auth/dashboard")({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createFileRoute } from "@tanstack/react-router";
|
|
2
2
|
import { useSecretData } from "@workspace/orpc/react";
|
|
3
|
-
import { authClient } from "
|
|
3
|
+
import { authClient } from "@renderer/lib/auth-client";
|
|
4
4
|
|
|
5
5
|
export const Route = createFileRoute("/_auth/examples/client-orpc-auth")({
|
|
6
6
|
component: ClientORPCAuth,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Outlet, createFileRoute, redirect } from "@tanstack/react-router";
|
|
2
2
|
import { SidebarProvider, SidebarTrigger } from "@workspace/ui/components/sidebar";
|
|
3
|
-
import { AuthSidebar } from "
|
|
4
|
-
import { authClient } from "
|
|
3
|
+
import { AuthSidebar } from "@renderer/components/app-sidebar";
|
|
4
|
+
import { authClient } from "@renderer/lib/auth-client";
|
|
5
5
|
|
|
6
6
|
export const Route = createFileRoute("/_auth")({
|
|
7
7
|
beforeLoad: async ({ location }) => {
|
|
@@ -216,24 +216,28 @@ function ClientORPC() {
|
|
|
216
216
|
</div>
|
|
217
217
|
<div className="mt-6 flex gap-2">
|
|
218
218
|
<form.Subscribe
|
|
219
|
-
selector={(state) =>
|
|
220
|
-
|
|
219
|
+
selector={(state) => ({
|
|
220
|
+
canSubmit: state.canSubmit,
|
|
221
|
+
isSubmitting: state.isSubmitting,
|
|
222
|
+
})}
|
|
223
|
+
>
|
|
224
|
+
{(state: { canSubmit: boolean; isSubmitting: boolean }) => (
|
|
221
225
|
<>
|
|
222
226
|
{editingId ? (
|
|
223
227
|
<>
|
|
224
228
|
<Button
|
|
225
229
|
type="submit"
|
|
226
230
|
className="flex items-center gap-2"
|
|
227
|
-
disabled={!canSubmit || isSubmitting || updateMutation.isPending}
|
|
231
|
+
disabled={!state.canSubmit || state.isSubmitting || updateMutation.isPending}
|
|
228
232
|
>
|
|
229
233
|
<Check className="h-4 w-4" />{" "}
|
|
230
|
-
{isSubmitting || updateMutation.isPending ? "Saving..." : "Save Changes"}
|
|
234
|
+
{state.isSubmitting || updateMutation.isPending ? "Saving..." : "Save Changes"}
|
|
231
235
|
</Button>
|
|
232
236
|
<Button
|
|
233
237
|
variant="outline"
|
|
234
238
|
type="button"
|
|
235
239
|
onClick={resetForm}
|
|
236
|
-
disabled={isSubmitting || updateMutation.isPending}
|
|
240
|
+
disabled={state.isSubmitting || updateMutation.isPending}
|
|
237
241
|
>
|
|
238
242
|
Cancel
|
|
239
243
|
</Button>
|
|
@@ -242,15 +246,15 @@ function ClientORPC() {
|
|
|
242
246
|
<Button
|
|
243
247
|
type="submit"
|
|
244
248
|
className="flex items-center gap-2"
|
|
245
|
-
disabled={!canSubmit || isSubmitting || createMutation.isPending}
|
|
249
|
+
disabled={!state.canSubmit || state.isSubmitting || createMutation.isPending}
|
|
246
250
|
>
|
|
247
251
|
<Plus className="h-4 w-4" />{" "}
|
|
248
|
-
{isSubmitting || createMutation.isPending ? "Adding..." : "Add Planet"}
|
|
252
|
+
{state.isSubmitting || createMutation.isPending ? "Adding..." : "Add Planet"}
|
|
249
253
|
</Button>
|
|
250
254
|
)}
|
|
251
255
|
</>
|
|
252
256
|
)}
|
|
253
|
-
|
|
257
|
+
</form.Subscribe>
|
|
254
258
|
</div>
|
|
255
259
|
</form>
|
|
256
260
|
</div>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Outlet, createFileRoute } from "@tanstack/react-router";
|
|
2
2
|
import { SidebarProvider, SidebarTrigger } from "@workspace/ui/components/sidebar";
|
|
3
|
-
import { PublicSidebar } from "
|
|
3
|
+
import { PublicSidebar } from "@renderer/components/app-sidebar";
|
|
4
4
|
|
|
5
5
|
export const Route = createFileRoute("/_public")({
|
|
6
6
|
component: PublicLayout,
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"expo-symbols": "~1.0.8",
|
|
28
28
|
"expo-system-ui": "~6.0.9",
|
|
29
29
|
"expo-web-browser": "~15.0.10",
|
|
30
|
-
"react": "19.
|
|
31
|
-
"react-dom": "19.
|
|
30
|
+
"react": "19.2.5",
|
|
31
|
+
"react-dom": "19.2.5",
|
|
32
32
|
"react-native": "0.81.5",
|
|
33
33
|
"react-native-gesture-handler": "~2.28.0",
|
|
34
34
|
"react-native-worklets": "0.5.1",
|
|
@@ -39,7 +39,8 @@
|
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@workspace/config-typescript": "workspace:*",
|
|
42
|
-
"@types/react": "
|
|
42
|
+
"@types/react": "19.2.14",
|
|
43
|
+
"@types/react-dom": "19.2.3"
|
|
43
44
|
},
|
|
44
45
|
"private": true
|
|
45
46
|
}
|
|
@@ -13,28 +13,25 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@noble/ciphers": "^2.2.0",
|
|
16
|
-
"@orpc/client": "^1.14.0",
|
|
17
|
-
"@orpc/server": "^1.14.0",
|
|
18
|
-
"@orpc/tanstack-query": "^1.14.0",
|
|
19
16
|
"@tailwindcss/vite": "^4.2.4",
|
|
20
|
-
"@tanstack/react-form": "^1.29.1",
|
|
21
|
-
"@tanstack/react-query": "^5.100.5",
|
|
22
17
|
"@tanstack/react-router": "^1.168.24",
|
|
23
18
|
"@tanstack/react-start": "^1.167.49",
|
|
24
19
|
"@tanstack/router-plugin": "^1.167.27",
|
|
25
20
|
"@workspace/auth": "workspace:*",
|
|
26
21
|
"@workspace/orpc": "workspace:*",
|
|
27
22
|
"@workspace/ui": "workspace:*",
|
|
28
|
-
"better-auth": "^1.6.9",
|
|
29
23
|
"lucide-react": "^1.11.0",
|
|
30
24
|
"nitro": "latest",
|
|
31
25
|
"sonner": "^2.0.7",
|
|
26
|
+
"react": "19.2.5",
|
|
27
|
+
"react-dom": "19.2.5",
|
|
32
28
|
"tailwindcss": "^4.2.4",
|
|
33
|
-
"vite-tsconfig-paths": "^6.1.1"
|
|
34
|
-
"zod": "4.3.6"
|
|
29
|
+
"vite-tsconfig-paths": "^6.1.1"
|
|
35
30
|
},
|
|
36
31
|
"devDependencies": {
|
|
37
32
|
"@types/node": "^25.6.0",
|
|
33
|
+
"@types/react": "^19.2.14",
|
|
34
|
+
"@types/react-dom": "^19.2.3",
|
|
38
35
|
"@vitejs/plugin-react": "^6.0.1",
|
|
39
36
|
"@workspace/config-typescript": "workspace:*",
|
|
40
37
|
"dotenv": "^17.4.2",
|
|
@@ -126,13 +126,17 @@ export function LoginForm({ className, ...props }: React.ComponentProps<"div">)
|
|
|
126
126
|
/>
|
|
127
127
|
<Field>
|
|
128
128
|
<form.Subscribe
|
|
129
|
-
selector={(state) =>
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
129
|
+
selector={(state) => ({
|
|
130
|
+
canSubmit: state.canSubmit,
|
|
131
|
+
isSubmitting: state.isSubmitting,
|
|
132
|
+
})}
|
|
133
|
+
>
|
|
134
|
+
{(state: { canSubmit: boolean; isSubmitting: boolean }) => (
|
|
135
|
+
<Button type="submit" disabled={!state.canSubmit || state.isSubmitting || loading}>
|
|
136
|
+
{state.isSubmitting || loading ? "Logging in..." : "Login"}
|
|
133
137
|
</Button>
|
|
134
138
|
)}
|
|
135
|
-
|
|
139
|
+
</form.Subscribe>
|
|
136
140
|
<Button variant="outline" type="button" disabled={loading}>
|
|
137
141
|
Login with Google
|
|
138
142
|
</Button>
|
|
@@ -172,14 +172,18 @@ export function SignupForm({ ...props }: React.ComponentProps<typeof Card>) {
|
|
|
172
172
|
/>
|
|
173
173
|
<FieldGroup>
|
|
174
174
|
<Field>
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
175
|
+
<form.Subscribe
|
|
176
|
+
selector={(state) => ({
|
|
177
|
+
canSubmit: state.canSubmit,
|
|
178
|
+
isSubmitting: state.isSubmitting,
|
|
179
|
+
})}
|
|
180
|
+
>
|
|
181
|
+
{(state: { canSubmit: boolean; isSubmitting: boolean }) => (
|
|
182
|
+
<Button type="submit" disabled={!state.canSubmit || state.isSubmitting || loading}>
|
|
183
|
+
{state.isSubmitting || loading ? "Creating..." : "Create Account"}
|
|
184
|
+
</Button>
|
|
185
|
+
)}
|
|
186
|
+
</form.Subscribe>
|
|
183
187
|
<Button variant="outline" type="button" disabled={loading}>
|
|
184
188
|
Sign up with Google
|
|
185
189
|
</Button>
|
|
@@ -2,7 +2,6 @@ import * as React from "react";
|
|
|
2
2
|
import { createFileRoute } from "@tanstack/react-router";
|
|
3
3
|
import { Check, Pencil, Plus, Trash2 } from "lucide-react";
|
|
4
4
|
import { toast } from "sonner";
|
|
5
|
-
import { useQueryClient } from "@tanstack/react-query";
|
|
6
5
|
import { useForm } from "@tanstack/react-form";
|
|
7
6
|
import { z } from "zod";
|
|
8
7
|
|
|
@@ -11,10 +10,9 @@ import { Input } from "@workspace/ui/components/input";
|
|
|
11
10
|
import { Field, FieldError, FieldLabel } from "@workspace/ui/components/field";
|
|
12
11
|
|
|
13
12
|
import type { router } from "@workspace/orpc/router";
|
|
14
|
-
import type {
|
|
13
|
+
import type { InferRouterOutputs } from "@orpc/server";
|
|
15
14
|
import { usePlanets, useCreatePlanet, useUpdatePlanet, useDeletePlanet } from "@workspace/orpc/react";
|
|
16
15
|
|
|
17
|
-
type Inputs = InferRouterInputs<typeof router>;
|
|
18
16
|
type Outputs = InferRouterOutputs<typeof router>;
|
|
19
17
|
type Planet = Outputs["planets"]["getPlanets"][number];
|
|
20
18
|
|
|
@@ -45,7 +43,6 @@ export const Route = createFileRoute("/_public/examples/client-orpc")({
|
|
|
45
43
|
});
|
|
46
44
|
|
|
47
45
|
function ClientORPC() {
|
|
48
|
-
const queryClient = useQueryClient();
|
|
49
46
|
const [editingId, setEditingId] = React.useState<number | null>(null);
|
|
50
47
|
|
|
51
48
|
const { data: planets = [], isLoading } = usePlanets();
|
|
@@ -230,24 +227,28 @@ function ClientORPC() {
|
|
|
230
227
|
</div>
|
|
231
228
|
<div className="mt-6 flex gap-2">
|
|
232
229
|
<form.Subscribe
|
|
233
|
-
selector={(state) =>
|
|
234
|
-
|
|
230
|
+
selector={(state) => ({
|
|
231
|
+
canSubmit: state.canSubmit,
|
|
232
|
+
isSubmitting: state.isSubmitting,
|
|
233
|
+
})}
|
|
234
|
+
>
|
|
235
|
+
{(state: { canSubmit: boolean; isSubmitting: boolean }) => (
|
|
235
236
|
<>
|
|
236
237
|
{editingId ? (
|
|
237
238
|
<>
|
|
238
239
|
<Button
|
|
239
240
|
type="submit"
|
|
240
241
|
className="flex items-center gap-2"
|
|
241
|
-
disabled={!canSubmit || isSubmitting || updateMutation.isPending}
|
|
242
|
+
disabled={!state.canSubmit || state.isSubmitting || updateMutation.isPending}
|
|
242
243
|
>
|
|
243
244
|
<Check className="h-4 w-4" />{" "}
|
|
244
|
-
{isSubmitting || updateMutation.isPending ? "Saving..." : "Save Changes"}
|
|
245
|
+
{state.isSubmitting || updateMutation.isPending ? "Saving..." : "Save Changes"}
|
|
245
246
|
</Button>
|
|
246
247
|
<Button
|
|
247
248
|
variant="outline"
|
|
248
249
|
type="button"
|
|
249
250
|
onClick={resetForm}
|
|
250
|
-
disabled={isSubmitting || updateMutation.isPending}
|
|
251
|
+
disabled={state.isSubmitting || updateMutation.isPending}
|
|
251
252
|
>
|
|
252
253
|
Cancel
|
|
253
254
|
</Button>
|
|
@@ -256,15 +257,15 @@ function ClientORPC() {
|
|
|
256
257
|
<Button
|
|
257
258
|
type="submit"
|
|
258
259
|
className="flex items-center gap-2"
|
|
259
|
-
disabled={!canSubmit || isSubmitting || createMutation.isPending}
|
|
260
|
+
disabled={!state.canSubmit || state.isSubmitting || createMutation.isPending}
|
|
260
261
|
>
|
|
261
262
|
<Plus className="h-4 w-4" />{" "}
|
|
262
|
-
{isSubmitting || createMutation.isPending ? "Adding..." : "Add Planet"}
|
|
263
|
+
{state.isSubmitting || createMutation.isPending ? "Adding..." : "Add Planet"}
|
|
263
264
|
</Button>
|
|
264
265
|
)}
|
|
265
266
|
</>
|
|
266
267
|
)}
|
|
267
|
-
|
|
268
|
+
</form.Subscribe>
|
|
268
269
|
</div>
|
|
269
270
|
</form>
|
|
270
271
|
</div>
|
|
@@ -223,23 +223,27 @@ function SSRORPC() {
|
|
|
223
223
|
</div>
|
|
224
224
|
<div className="mt-6 flex gap-2">
|
|
225
225
|
<form.Subscribe
|
|
226
|
-
selector={(state) =>
|
|
227
|
-
|
|
226
|
+
selector={(state) => ({
|
|
227
|
+
canSubmit: state.canSubmit,
|
|
228
|
+
isSubmitting: state.isSubmitting,
|
|
229
|
+
})}
|
|
230
|
+
>
|
|
231
|
+
{(state: { canSubmit: boolean; isSubmitting: boolean }) => (
|
|
228
232
|
<>
|
|
229
233
|
{editingId ? (
|
|
230
234
|
<>
|
|
231
235
|
<Button
|
|
232
236
|
type="submit"
|
|
233
237
|
className="flex items-center gap-2"
|
|
234
|
-
disabled={!canSubmit || isSubmitting}
|
|
238
|
+
disabled={!state.canSubmit || state.isSubmitting}
|
|
235
239
|
>
|
|
236
|
-
<Check className="h-4 w-4" /> {isSubmitting ? "Saving..." : "Save Changes"}
|
|
240
|
+
<Check className="h-4 w-4" /> {state.isSubmitting ? "Saving..." : "Save Changes"}
|
|
237
241
|
</Button>
|
|
238
242
|
<Button
|
|
239
243
|
variant="outline"
|
|
240
244
|
type="button"
|
|
241
245
|
onClick={resetForm}
|
|
242
|
-
disabled={isSubmitting}
|
|
246
|
+
disabled={state.isSubmitting}
|
|
243
247
|
>
|
|
244
248
|
Cancel
|
|
245
249
|
</Button>
|
|
@@ -248,14 +252,14 @@ function SSRORPC() {
|
|
|
248
252
|
<Button
|
|
249
253
|
type="submit"
|
|
250
254
|
className="flex items-center gap-2"
|
|
251
|
-
disabled={!canSubmit || isSubmitting}
|
|
255
|
+
disabled={!state.canSubmit || state.isSubmitting}
|
|
252
256
|
>
|
|
253
|
-
<Plus className="h-4 w-4" /> {isSubmitting ? "Adding..." : "Add Planet"}
|
|
257
|
+
<Plus className="h-4 w-4" /> {state.isSubmitting ? "Adding..." : "Add Planet"}
|
|
254
258
|
</Button>
|
|
255
259
|
)}
|
|
256
260
|
</>
|
|
257
261
|
)}
|
|
258
|
-
|
|
262
|
+
</form.Subscribe>
|
|
259
263
|
</div>
|
|
260
264
|
</form>
|
|
261
265
|
</div>
|
package/template/package.json
CHANGED
|
@@ -21,24 +21,22 @@
|
|
|
21
21
|
"prepare": "husky"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@orpc/client": "
|
|
25
|
-
"@orpc/server": "
|
|
26
|
-
"@tanstack
|
|
27
|
-
"react": "
|
|
28
|
-
"react-
|
|
24
|
+
"@orpc/client": "latest",
|
|
25
|
+
"@orpc/server": "latest",
|
|
26
|
+
"@orpc/tanstack-query": "latest",
|
|
27
|
+
"@tanstack/react-form": "latest",
|
|
28
|
+
"@tanstack/react-query": "latest",
|
|
29
|
+
"better-auth": "^1.6.11"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
|
-
"@better-auth/core": "^1.6.
|
|
32
|
-
"@types/react": "^19.2.7",
|
|
33
|
-
"@types/react-dom": "^19.2.3",
|
|
32
|
+
"@better-auth/core": "^1.6.11",
|
|
34
33
|
"husky": "latest",
|
|
35
34
|
"oxfmt": "latest",
|
|
36
35
|
"oxlint": "latest",
|
|
37
|
-
"portless": "
|
|
38
|
-
"turbo": "
|
|
36
|
+
"portless": "latest",
|
|
37
|
+
"turbo": "latest",
|
|
39
38
|
"typescript": "6.0.3",
|
|
40
|
-
"
|
|
41
|
-
"zod": "4.3.6"
|
|
39
|
+
"zod": "latest"
|
|
42
40
|
},
|
|
43
41
|
"pnpm": {
|
|
44
42
|
"onlyBuiltDependencies": [
|
|
@@ -54,5 +52,5 @@
|
|
|
54
52
|
"engines": {
|
|
55
53
|
"node": ">=20"
|
|
56
54
|
},
|
|
57
|
-
"packageManager": "pnpm@11.1.
|
|
55
|
+
"packageManager": "pnpm@11.1.2"
|
|
58
56
|
}
|
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
"generate": "better-auth generate --output ../db/src/lib/auth-schema.ts"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@workspace/db": "workspace:*"
|
|
16
|
-
"better-auth": "^1.6.9"
|
|
15
|
+
"@workspace/db": "workspace:*"
|
|
17
16
|
},
|
|
18
17
|
"devDependencies": {
|
|
19
18
|
"@better-auth/cli": "^1.4.22",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { OTPInput, OTPInputContext } from "input-otp";
|
|
2
|
+
import { OTPInput, OTPInputContext, type RenderProps } from "input-otp";
|
|
3
3
|
|
|
4
4
|
import { MinusIcon } from "lucide-react";
|
|
5
5
|
import { cn } from "@workspace/ui/lib/utils";
|
|
@@ -45,8 +45,19 @@ function InputOTPSlot({
|
|
|
45
45
|
}: React.ComponentProps<"div"> & {
|
|
46
46
|
index: number;
|
|
47
47
|
}) {
|
|
48
|
-
const inputOTPContext = React.useContext(OTPInputContext);
|
|
49
|
-
|
|
48
|
+
const inputOTPContext = React.useContext(OTPInputContext) as RenderProps | null;
|
|
49
|
+
|
|
50
|
+
if (!inputOTPContext) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const slot = inputOTPContext.slots[index];
|
|
55
|
+
|
|
56
|
+
if (!slot) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const { char, hasFakeCaret, isActive } = slot;
|
|
50
61
|
|
|
51
62
|
return (
|
|
52
63
|
<div
|