create-croissant 0.1.57 → 0.1.59

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.
Files changed (74) hide show
  1. package/package.json +2 -1
  2. package/template/apps/platform/package.json +1 -0
  3. package/template/apps/platform/src/components/access-denied.tsx +32 -0
  4. package/template/apps/platform/src/components/app-sidebar.tsx +30 -50
  5. package/template/apps/platform/src/lib/auth-utils.ts +17 -3
  6. package/template/apps/platform/src/routes/__root.tsx +1 -1
  7. package/template/apps/platform/src/routes/_auth/account.tsx +7 -9
  8. package/template/apps/platform/src/routes/_auth/dashboard.tsx +8 -7
  9. package/template/apps/platform/src/routes/_auth/examples/client-orpc-auth.tsx +6 -9
  10. package/template/apps/platform/src/routes/_auth/examples/ssr-orpc-auth.tsx +8 -9
  11. package/template/apps/platform/src/routes/_auth.tsx +2 -2
  12. package/template/apps/platform/src/routes/_public.tsx +2 -2
  13. package/template/apps/platform/src/routes/api/auth/$.ts +25 -15
  14. package/template/apps/platform/src/routes/api/rpc.$.ts +15 -8
  15. package/template/docker-compose.yml +1 -3
  16. package/template/package.json +1 -12
  17. package/template/packages/auth/package.json +2 -2
  18. package/template/packages/auth/src/lib/auth.ts +10 -0
  19. package/template/apps/desktop/.vscode/extensions.json +0 -3
  20. package/template/apps/desktop/README.md +0 -7
  21. package/template/apps/desktop/index.html +0 -14
  22. package/template/apps/desktop/package.json +0 -40
  23. package/template/apps/desktop/public/tauri.svg +0 -6
  24. package/template/apps/desktop/public/vite.svg +0 -1
  25. package/template/apps/desktop/src/App.css +0 -116
  26. package/template/apps/desktop/src/App.tsx +0 -51
  27. package/template/apps/desktop/src/assets/react.svg +0 -1
  28. package/template/apps/desktop/src/components/app-sidebar.tsx +0 -186
  29. package/template/apps/desktop/src/components/login-form.tsx +0 -160
  30. package/template/apps/desktop/src/components/search-form.tsx +0 -19
  31. package/template/apps/desktop/src/components/signup-form.tsx +0 -206
  32. package/template/apps/desktop/src/components/version-switcher.tsx +0 -54
  33. package/template/apps/desktop/src/env.d.ts +0 -1
  34. package/template/apps/desktop/src/lib/auth-client.ts +0 -5
  35. package/template/apps/desktop/src/lib/orpc.ts +0 -10
  36. package/template/apps/desktop/src/main.tsx +0 -12
  37. package/template/apps/desktop/src/routeTree.gen.ts +0 -240
  38. package/template/apps/desktop/src/router.tsx +0 -19
  39. package/template/apps/desktop/src/routes/__root.tsx +0 -52
  40. package/template/apps/desktop/src/routes/_auth/account.tsx +0 -275
  41. package/template/apps/desktop/src/routes/_auth/dashboard.tsx +0 -58
  42. package/template/apps/desktop/src/routes/_auth/examples/client-orpc-auth.tsx +0 -46
  43. package/template/apps/desktop/src/routes/_auth.tsx +0 -23
  44. package/template/apps/desktop/src/routes/_public/examples/client-orpc.tsx +0 -330
  45. package/template/apps/desktop/src/routes/_public/index.tsx +0 -66
  46. package/template/apps/desktop/src/routes/_public/login.tsx +0 -34
  47. package/template/apps/desktop/src/routes/_public/signup.tsx +0 -31
  48. package/template/apps/desktop/src/routes/_public.tsx +0 -23
  49. package/template/apps/desktop/src/vite-env.d.ts +0 -1
  50. package/template/apps/desktop/src-tauri/Cargo.toml +0 -25
  51. package/template/apps/desktop/src-tauri/build.rs +0 -3
  52. package/template/apps/desktop/src-tauri/capabilities/default.json +0 -7
  53. package/template/apps/desktop/src-tauri/icons/128x128.png +0 -0
  54. package/template/apps/desktop/src-tauri/icons/128x128@2x.png +0 -0
  55. package/template/apps/desktop/src-tauri/icons/32x32.png +0 -0
  56. package/template/apps/desktop/src-tauri/icons/Square107x107Logo.png +0 -0
  57. package/template/apps/desktop/src-tauri/icons/Square142x142Logo.png +0 -0
  58. package/template/apps/desktop/src-tauri/icons/Square150x150Logo.png +0 -0
  59. package/template/apps/desktop/src-tauri/icons/Square284x284Logo.png +0 -0
  60. package/template/apps/desktop/src-tauri/icons/Square30x30Logo.png +0 -0
  61. package/template/apps/desktop/src-tauri/icons/Square310x310Logo.png +0 -0
  62. package/template/apps/desktop/src-tauri/icons/Square44x44Logo.png +0 -0
  63. package/template/apps/desktop/src-tauri/icons/Square71x71Logo.png +0 -0
  64. package/template/apps/desktop/src-tauri/icons/Square89x89Logo.png +0 -0
  65. package/template/apps/desktop/src-tauri/icons/StoreLogo.png +0 -0
  66. package/template/apps/desktop/src-tauri/icons/icon.icns +0 -0
  67. package/template/apps/desktop/src-tauri/icons/icon.ico +0 -0
  68. package/template/apps/desktop/src-tauri/icons/icon.png +0 -0
  69. package/template/apps/desktop/src-tauri/src/lib.rs +0 -14
  70. package/template/apps/desktop/src-tauri/src/main.rs +0 -6
  71. package/template/apps/desktop/src-tauri/tauri.conf.json +0 -35
  72. package/template/apps/desktop/tsconfig.json +0 -17
  73. package/template/apps/desktop/tsconfig.node.json +0 -10
  74. package/template/apps/desktop/vite.config.ts +0 -40
@@ -1,206 +0,0 @@
1
- import { Button } from "@workspace/ui/components/button";
2
- import {
3
- Card,
4
- CardContent,
5
- CardDescription,
6
- CardHeader,
7
- CardTitle,
8
- } from "@workspace/ui/components/card";
9
- import {
10
- Field,
11
- FieldDescription,
12
- FieldError,
13
- FieldGroup,
14
- FieldLabel,
15
- } from "@workspace/ui/components/field";
16
- import { Input } from "@workspace/ui/components/input";
17
- import { useState } from "react";
18
- import { Link } from "@tanstack/react-router";
19
- import { useForm } from "@tanstack/react-form";
20
- import { z } from "zod";
21
- import { authClient } from "@/lib/auth-client";
22
-
23
- const signupSchema = z
24
- .object({
25
- name: z.string().min(1, "Name is required"),
26
- email: z.string().email("Invalid email address"),
27
- password: z.string().min(8, "Password must be at least 8 characters"),
28
- confirmPassword: z.string().min(1, "Confirm password is required"),
29
- })
30
- .refine((data) => data.password === data.confirmPassword, {
31
- message: "Passwords do not match",
32
- path: ["confirmPassword"],
33
- });
34
-
35
- export function SignupForm({ ...props }: React.ComponentProps<typeof Card>) {
36
- const [loading, setLoading] = useState(false);
37
- const [error, setError] = useState<string | null>(null);
38
-
39
- const form = useForm({
40
- defaultValues: {
41
- name: "",
42
- email: "",
43
- password: "",
44
- confirmPassword: "",
45
- },
46
- validators: {
47
- onChange: signupSchema,
48
- },
49
- onSubmit: async ({ value }) => {
50
- setLoading(true);
51
- setError(null);
52
- const { error: signUpError } = await authClient.signUp.email({
53
- email: value.email,
54
- password: value.password,
55
- name: value.name,
56
- callbackURL: "/dashboard",
57
- });
58
- if (signUpError) {
59
- setError(signUpError.message || "Failed to sign up");
60
- }
61
- setLoading(false);
62
- },
63
- });
64
-
65
- return (
66
- <Card {...props}>
67
- <CardHeader>
68
- <CardTitle>Create an account</CardTitle>
69
- <CardDescription>Enter your information below to create your account</CardDescription>
70
- </CardHeader>
71
- <CardContent>
72
- <form
73
- onSubmit={(e) => {
74
- e.preventDefault();
75
- e.stopPropagation();
76
- form.handleSubmit();
77
- }}
78
- >
79
- <FieldGroup>
80
- {error && <div className="rounded bg-red-100 p-2 text-sm text-red-600">{error}</div>}
81
- <form.Field
82
- name="name"
83
- children={(field) => {
84
- const isInvalid = field.state.meta.isTouched && field.state.meta.errors.length > 0;
85
- return (
86
- <Field data-invalid={isInvalid}>
87
- <FieldLabel htmlFor={field.name}>Full Name</FieldLabel>
88
- <Input
89
- id={field.name}
90
- name={field.name}
91
- type="text"
92
- placeholder="John Doe"
93
- value={field.state.value}
94
- onBlur={field.handleBlur}
95
- onChange={(e) => field.handleChange(e.target.value)}
96
- required
97
- />
98
- {isInvalid && <FieldError errors={field.state.meta.errors} />}
99
- </Field>
100
- );
101
- }}
102
- />
103
- <form.Field
104
- name="email"
105
- children={(field) => {
106
- const isInvalid = field.state.meta.isTouched && field.state.meta.errors.length > 0;
107
- return (
108
- <Field data-invalid={isInvalid}>
109
- <FieldLabel htmlFor={field.name}>Email</FieldLabel>
110
- <Input
111
- id={field.name}
112
- name={field.name}
113
- type="email"
114
- placeholder="m@example.com"
115
- value={field.state.value}
116
- onBlur={field.handleBlur}
117
- onChange={(e) => field.handleChange(e.target.value)}
118
- required
119
- />
120
- <FieldDescription>
121
- We&apos;ll use this to contact you. We will not share your email with anyone
122
- else.
123
- </FieldDescription>
124
- {isInvalid && <FieldError errors={field.state.meta.errors} />}
125
- </Field>
126
- );
127
- }}
128
- />
129
- <form.Field
130
- name="password"
131
- children={(field) => {
132
- const isInvalid = field.state.meta.isTouched && field.state.meta.errors.length > 0;
133
- return (
134
- <Field data-invalid={isInvalid}>
135
- <FieldLabel htmlFor={field.name}>Password</FieldLabel>
136
- <Input
137
- id={field.name}
138
- name={field.name}
139
- type="password"
140
- value={field.state.value}
141
- onBlur={field.handleBlur}
142
- onChange={(e) => field.handleChange(e.target.value)}
143
- required
144
- />
145
- <FieldDescription>Must be at least 8 characters long.</FieldDescription>
146
- {isInvalid && <FieldError errors={field.state.meta.errors} />}
147
- </Field>
148
- );
149
- }}
150
- />
151
- <form.Field
152
- name="confirmPassword"
153
- children={(field) => {
154
- const isInvalid = field.state.meta.isTouched && field.state.meta.errors.length > 0;
155
- return (
156
- <Field data-invalid={isInvalid}>
157
- <FieldLabel htmlFor={field.name}>Confirm Password</FieldLabel>
158
- <Input
159
- id={field.name}
160
- name={field.name}
161
- type="password"
162
- value={field.state.value}
163
- onBlur={field.handleBlur}
164
- onChange={(e) => field.handleChange(e.target.value)}
165
- required
166
- />
167
- <FieldDescription>Please confirm your password.</FieldDescription>
168
- {isInvalid && <FieldError errors={field.state.meta.errors} />}
169
- </Field>
170
- );
171
- }}
172
- />
173
- <FieldGroup>
174
- <Field>
175
- <form.Subscribe
176
- selector={(state) => ({
177
- canSubmit: state.canSubmit,
178
- isSubmitting: state.isSubmitting,
179
- })}
180
- >
181
- {(state: { canSubmit: boolean; isSubmitting: boolean }) => (
182
- <Button
183
- type="submit"
184
- disabled={!state.canSubmit || state.isSubmitting || loading}
185
- >
186
- {state.isSubmitting || loading ? "Creating..." : "Create Account"}
187
- </Button>
188
- )}
189
- </form.Subscribe>
190
- <Button variant="outline" type="button" disabled={loading}>
191
- Sign up with Google
192
- </Button>
193
- <FieldDescription className="px-6 text-center">
194
- Already have an account?{" "}
195
- <Link to="/login" className="underline">
196
- Sign in
197
- </Link>
198
- </FieldDescription>
199
- </Field>
200
- </FieldGroup>
201
- </FieldGroup>
202
- </form>
203
- </CardContent>
204
- </Card>
205
- );
206
- }
@@ -1,54 +0,0 @@
1
- "use client";
2
-
3
- import * as React from "react";
4
-
5
- import {
6
- DropdownMenu,
7
- DropdownMenuContent,
8
- DropdownMenuItem,
9
- DropdownMenuTrigger,
10
- } from "@workspace/ui/components/dropdown-menu";
11
- import { SidebarMenu, SidebarMenuButton, SidebarMenuItem } from "@workspace/ui/components/sidebar";
12
- import { CheckIcon, ChevronsUpDownIcon, GalleryVerticalEndIcon } from "lucide-react";
13
-
14
- export function VersionSwitcher({
15
- versions,
16
- defaultVersion,
17
- }: {
18
- versions: Array<string>;
19
- defaultVersion: string;
20
- }) {
21
- const [selectedVersion, setSelectedVersion] = React.useState(defaultVersion);
22
- return (
23
- <SidebarMenu>
24
- <SidebarMenuItem>
25
- <DropdownMenu>
26
- <DropdownMenuTrigger
27
- render={
28
- <SidebarMenuButton
29
- size="lg"
30
- className="data-open:bg-sidebar-accent data-open:text-sidebar-accent-foreground"
31
- />
32
- }
33
- >
34
- <div className="flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground">
35
- <GalleryVerticalEndIcon className="size-4" />
36
- </div>
37
- <div className="flex flex-col gap-0.5 leading-none">
38
- <span className="font-medium">Documentation</span>
39
- <span className="">v{selectedVersion}</span>
40
- </div>
41
- <ChevronsUpDownIcon className="ml-auto" />
42
- </DropdownMenuTrigger>
43
- <DropdownMenuContent align="start">
44
- {versions.map((version) => (
45
- <DropdownMenuItem key={version} onSelect={() => setSelectedVersion(version)}>
46
- v{version} {version === selectedVersion && <CheckIcon className="ml-auto" />}
47
- </DropdownMenuItem>
48
- ))}
49
- </DropdownMenuContent>
50
- </DropdownMenu>
51
- </SidebarMenuItem>
52
- </SidebarMenu>
53
- );
54
- }
@@ -1 +0,0 @@
1
- /// <reference types="vite/client" />
@@ -1,5 +0,0 @@
1
- import { createAuthClient } from "better-auth/react";
2
-
3
- export const authClient = createAuthClient({
4
- baseURL: import.meta.env.VITE_API_URL || "https://platform.localhost",
5
- });
@@ -1,10 +0,0 @@
1
- import { createORPCClient } from "@orpc/client";
2
- import { RPCLink } from "@orpc/client/fetch";
3
- import type { AppRouter } from "@workspace/orpc/router";
4
- import type { RouterClient } from "@orpc/server";
5
-
6
- const link = new RPCLink({
7
- url: `${import.meta.env.VITE_API_URL || "https://platform.localhost"}/api/rpc`,
8
- });
9
-
10
- export const orpc = createORPCClient(link) as RouterClient<AppRouter>;
@@ -1,12 +0,0 @@
1
- import { StrictMode } from "react";
2
- import { createRoot } from "react-dom/client";
3
- import { RouterProvider } from "@tanstack/react-router";
4
- import { getRouter } from "./router";
5
-
6
- const router = getRouter();
7
-
8
- createRoot(document.getElementById("root")!).render(
9
- <StrictMode>
10
- <RouterProvider router={router} />
11
- </StrictMode>,
12
- );
@@ -1,240 +0,0 @@
1
- /* eslint-disable */
2
-
3
- // @ts-nocheck
4
-
5
- // noinspection JSUnusedGlobalSymbols
6
-
7
- // This file was automatically generated by TanStack Router.
8
- // You should NOT make any changes in this file as it will be overwritten.
9
- // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
10
-
11
- import { Route as rootRouteImport } from './routes/__root'
12
- import { Route as PublicRouteImport } from './routes/_public'
13
- import { Route as AuthRouteImport } from './routes/_auth'
14
- import { Route as PublicIndexRouteImport } from './routes/_public/index'
15
- import { Route as PublicSignupRouteImport } from './routes/_public/signup'
16
- import { Route as PublicLoginRouteImport } from './routes/_public/login'
17
- import { Route as AuthDashboardRouteImport } from './routes/_auth/dashboard'
18
- import { Route as AuthAccountRouteImport } from './routes/_auth/account'
19
- import { Route as PublicExamplesClientOrpcRouteImport } from './routes/_public/examples/client-orpc'
20
- import { Route as AuthExamplesClientOrpcAuthRouteImport } from './routes/_auth/examples/client-orpc-auth'
21
-
22
- const PublicRoute = PublicRouteImport.update({
23
- id: '/_public',
24
- getParentRoute: () => rootRouteImport,
25
- } as any)
26
- const AuthRoute = AuthRouteImport.update({
27
- id: '/_auth',
28
- getParentRoute: () => rootRouteImport,
29
- } as any)
30
- const PublicIndexRoute = PublicIndexRouteImport.update({
31
- id: '/',
32
- path: '/',
33
- getParentRoute: () => PublicRoute,
34
- } as any)
35
- const PublicSignupRoute = PublicSignupRouteImport.update({
36
- id: '/signup',
37
- path: '/signup',
38
- getParentRoute: () => PublicRoute,
39
- } as any)
40
- const PublicLoginRoute = PublicLoginRouteImport.update({
41
- id: '/login',
42
- path: '/login',
43
- getParentRoute: () => PublicRoute,
44
- } as any)
45
- const AuthDashboardRoute = AuthDashboardRouteImport.update({
46
- id: '/dashboard',
47
- path: '/dashboard',
48
- getParentRoute: () => AuthRoute,
49
- } as any)
50
- const AuthAccountRoute = AuthAccountRouteImport.update({
51
- id: '/account',
52
- path: '/account',
53
- getParentRoute: () => AuthRoute,
54
- } as any)
55
- const PublicExamplesClientOrpcRoute =
56
- PublicExamplesClientOrpcRouteImport.update({
57
- id: '/examples/client-orpc',
58
- path: '/examples/client-orpc',
59
- getParentRoute: () => PublicRoute,
60
- } as any)
61
- const AuthExamplesClientOrpcAuthRoute =
62
- AuthExamplesClientOrpcAuthRouteImport.update({
63
- id: '/examples/client-orpc-auth',
64
- path: '/examples/client-orpc-auth',
65
- getParentRoute: () => AuthRoute,
66
- } as any)
67
-
68
- export interface FileRoutesByFullPath {
69
- '/': typeof PublicIndexRoute
70
- '/account': typeof AuthAccountRoute
71
- '/dashboard': typeof AuthDashboardRoute
72
- '/login': typeof PublicLoginRoute
73
- '/signup': typeof PublicSignupRoute
74
- '/examples/client-orpc-auth': typeof AuthExamplesClientOrpcAuthRoute
75
- '/examples/client-orpc': typeof PublicExamplesClientOrpcRoute
76
- }
77
- export interface FileRoutesByTo {
78
- '/': typeof PublicIndexRoute
79
- '/account': typeof AuthAccountRoute
80
- '/dashboard': typeof AuthDashboardRoute
81
- '/login': typeof PublicLoginRoute
82
- '/signup': typeof PublicSignupRoute
83
- '/examples/client-orpc-auth': typeof AuthExamplesClientOrpcAuthRoute
84
- '/examples/client-orpc': typeof PublicExamplesClientOrpcRoute
85
- }
86
- export interface FileRoutesById {
87
- __root__: typeof rootRouteImport
88
- '/_auth': typeof AuthRouteWithChildren
89
- '/_public': typeof PublicRouteWithChildren
90
- '/_auth/account': typeof AuthAccountRoute
91
- '/_auth/dashboard': typeof AuthDashboardRoute
92
- '/_public/login': typeof PublicLoginRoute
93
- '/_public/signup': typeof PublicSignupRoute
94
- '/_public/': typeof PublicIndexRoute
95
- '/_auth/examples/client-orpc-auth': typeof AuthExamplesClientOrpcAuthRoute
96
- '/_public/examples/client-orpc': typeof PublicExamplesClientOrpcRoute
97
- }
98
- export interface FileRouteTypes {
99
- fileRoutesByFullPath: FileRoutesByFullPath
100
- fullPaths:
101
- | '/'
102
- | '/account'
103
- | '/dashboard'
104
- | '/login'
105
- | '/signup'
106
- | '/examples/client-orpc-auth'
107
- | '/examples/client-orpc'
108
- fileRoutesByTo: FileRoutesByTo
109
- to:
110
- | '/'
111
- | '/account'
112
- | '/dashboard'
113
- | '/login'
114
- | '/signup'
115
- | '/examples/client-orpc-auth'
116
- | '/examples/client-orpc'
117
- id:
118
- | '__root__'
119
- | '/_auth'
120
- | '/_public'
121
- | '/_auth/account'
122
- | '/_auth/dashboard'
123
- | '/_public/login'
124
- | '/_public/signup'
125
- | '/_public/'
126
- | '/_auth/examples/client-orpc-auth'
127
- | '/_public/examples/client-orpc'
128
- fileRoutesById: FileRoutesById
129
- }
130
- export interface RootRouteChildren {
131
- AuthRoute: typeof AuthRouteWithChildren
132
- PublicRoute: typeof PublicRouteWithChildren
133
- }
134
-
135
- declare module '@tanstack/react-router' {
136
- interface FileRoutesByPath {
137
- '/_public': {
138
- id: '/_public'
139
- path: ''
140
- fullPath: '/'
141
- preLoaderRoute: typeof PublicRouteImport
142
- parentRoute: typeof rootRouteImport
143
- }
144
- '/_auth': {
145
- id: '/_auth'
146
- path: ''
147
- fullPath: '/'
148
- preLoaderRoute: typeof AuthRouteImport
149
- parentRoute: typeof rootRouteImport
150
- }
151
- '/_public/': {
152
- id: '/_public/'
153
- path: '/'
154
- fullPath: '/'
155
- preLoaderRoute: typeof PublicIndexRouteImport
156
- parentRoute: typeof PublicRoute
157
- }
158
- '/_public/signup': {
159
- id: '/_public/signup'
160
- path: '/signup'
161
- fullPath: '/signup'
162
- preLoaderRoute: typeof PublicSignupRouteImport
163
- parentRoute: typeof PublicRoute
164
- }
165
- '/_public/login': {
166
- id: '/_public/login'
167
- path: '/login'
168
- fullPath: '/login'
169
- preLoaderRoute: typeof PublicLoginRouteImport
170
- parentRoute: typeof PublicRoute
171
- }
172
- '/_auth/dashboard': {
173
- id: '/_auth/dashboard'
174
- path: '/dashboard'
175
- fullPath: '/dashboard'
176
- preLoaderRoute: typeof AuthDashboardRouteImport
177
- parentRoute: typeof AuthRoute
178
- }
179
- '/_auth/account': {
180
- id: '/_auth/account'
181
- path: '/account'
182
- fullPath: '/account'
183
- preLoaderRoute: typeof AuthAccountRouteImport
184
- parentRoute: typeof AuthRoute
185
- }
186
- '/_public/examples/client-orpc': {
187
- id: '/_public/examples/client-orpc'
188
- path: '/examples/client-orpc'
189
- fullPath: '/examples/client-orpc'
190
- preLoaderRoute: typeof PublicExamplesClientOrpcRouteImport
191
- parentRoute: typeof PublicRoute
192
- }
193
- '/_auth/examples/client-orpc-auth': {
194
- id: '/_auth/examples/client-orpc-auth'
195
- path: '/examples/client-orpc-auth'
196
- fullPath: '/examples/client-orpc-auth'
197
- preLoaderRoute: typeof AuthExamplesClientOrpcAuthRouteImport
198
- parentRoute: typeof AuthRoute
199
- }
200
- }
201
- }
202
-
203
- interface AuthRouteChildren {
204
- AuthAccountRoute: typeof AuthAccountRoute
205
- AuthDashboardRoute: typeof AuthDashboardRoute
206
- AuthExamplesClientOrpcAuthRoute: typeof AuthExamplesClientOrpcAuthRoute
207
- }
208
-
209
- const AuthRouteChildren: AuthRouteChildren = {
210
- AuthAccountRoute: AuthAccountRoute,
211
- AuthDashboardRoute: AuthDashboardRoute,
212
- AuthExamplesClientOrpcAuthRoute: AuthExamplesClientOrpcAuthRoute,
213
- }
214
-
215
- const AuthRouteWithChildren = AuthRoute._addFileChildren(AuthRouteChildren)
216
-
217
- interface PublicRouteChildren {
218
- PublicLoginRoute: typeof PublicLoginRoute
219
- PublicSignupRoute: typeof PublicSignupRoute
220
- PublicIndexRoute: typeof PublicIndexRoute
221
- PublicExamplesClientOrpcRoute: typeof PublicExamplesClientOrpcRoute
222
- }
223
-
224
- const PublicRouteChildren: PublicRouteChildren = {
225
- PublicLoginRoute: PublicLoginRoute,
226
- PublicSignupRoute: PublicSignupRoute,
227
- PublicIndexRoute: PublicIndexRoute,
228
- PublicExamplesClientOrpcRoute: PublicExamplesClientOrpcRoute,
229
- }
230
-
231
- const PublicRouteWithChildren =
232
- PublicRoute._addFileChildren(PublicRouteChildren)
233
-
234
- const rootRouteChildren: RootRouteChildren = {
235
- AuthRoute: AuthRouteWithChildren,
236
- PublicRoute: PublicRouteWithChildren,
237
- }
238
- export const routeTree = rootRouteImport
239
- ._addFileChildren(rootRouteChildren)
240
- ._addFileTypes<FileRouteTypes>()
@@ -1,19 +0,0 @@
1
- import { createRouter as createTanStackRouter } from "@tanstack/react-router";
2
- import { routeTree } from "./routeTree.gen";
3
-
4
- export function getRouter() {
5
- const router = createTanStackRouter({
6
- routeTree,
7
- scrollRestoration: true,
8
- defaultPreload: "intent",
9
- defaultPreloadStaleTime: 0,
10
- });
11
-
12
- return router;
13
- }
14
-
15
- declare module "@tanstack/react-router" {
16
- interface Register {
17
- router: ReturnType<typeof getRouter>;
18
- }
19
- }
@@ -1,52 +0,0 @@
1
- import { Link, Outlet, createRootRoute } from "@tanstack/react-router";
2
- import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
3
- import { Toaster } from "@workspace/ui/components/sonner";
4
- import { ThemeProvider } from "@workspace/ui/components/theme-provider";
5
- import { ORPCProvider } from "@workspace/orpc/react";
6
- import { orpc } from "@/lib/orpc";
7
- import {
8
- Empty,
9
- EmptyContent,
10
- EmptyDescription,
11
- EmptyHeader,
12
- EmptyTitle,
13
- } from "@workspace/ui/components/empty";
14
- import { buttonVariants } from "@workspace/ui/components/button";
15
-
16
- import "@workspace/ui/globals.css";
17
-
18
- const queryClient = new QueryClient();
19
-
20
- export const Route = createRootRoute({
21
- component: RootLayout,
22
- notFoundComponent: () => {
23
- return (
24
- <Empty className="h-screen border-none">
25
- <EmptyHeader>
26
- <EmptyTitle>404 - Page Not Found</EmptyTitle>
27
- <EmptyDescription>
28
- The page you are looking for does not exist or has been moved.
29
- </EmptyDescription>
30
- </EmptyHeader>
31
- <EmptyContent>
32
- <Link to="/" className={buttonVariants({ variant: "outline" })}>
33
- Go Home
34
- </Link>
35
- </EmptyContent>
36
- </Empty>
37
- );
38
- },
39
- });
40
-
41
- function RootLayout() {
42
- return (
43
- <ThemeProvider defaultTheme="system" storageKey="theme">
44
- <QueryClientProvider client={queryClient}>
45
- <ORPCProvider client={orpc}>
46
- <Outlet />
47
- <Toaster />
48
- </ORPCProvider>
49
- </QueryClientProvider>
50
- </ThemeProvider>
51
- );
52
- }