create-croissant 0.1.22 → 0.1.23

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
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.1.22",
6
+ "version": "0.1.23",
7
7
  "description": "Scaffold a new project using the Croissant Stack",
8
8
  "repository": {
9
9
  "type": "git",
@@ -19,37 +19,91 @@ import { Avatar, AvatarFallback, AvatarImage } from "@workspace/ui/components/av
19
19
  import { authClient } from "@/lib/auth-client"
20
20
 
21
21
  // This is sample data.
22
- const data = {
23
- navMain: [
24
- {
25
- title: "Examples",
26
- items: [
27
- {
28
- title: "SSR + oRPC",
29
- url: "/examples/ssr-orpc",
30
- },
31
- {
32
- title: "SSR + oRPC (Auth)",
33
- url: "/examples/ssr-orpc-auth",
34
- },
35
- {
36
- title: "Client + oRPC",
37
- url: "/examples/client-orpc",
38
- },
39
- {
40
- title: "Client + oRPC (Auth)",
41
- url: "/examples/client-orpc-auth",
42
- },
43
- {
44
- title: "ISR",
45
- url: "/examples/isr",
46
- },
47
- ],
48
- },
49
- ],
22
+ export const authNavItems = [
23
+ {
24
+ title: "Dashboard",
25
+ items: [
26
+ {
27
+ title: "Overview",
28
+ url: "/dashboard",
29
+ },
30
+ {
31
+ title: "Account",
32
+ url: "/account",
33
+ },
34
+ ],
35
+ },
36
+ {
37
+ title: "Examples",
38
+ items: [
39
+ {
40
+ title: "SSR + oRPC (Auth)",
41
+ url: "/examples/ssr-orpc-auth",
42
+ },
43
+ {
44
+ title: "Client + oRPC (Auth)",
45
+ url: "/examples/client-orpc-auth",
46
+ },
47
+ ],
48
+ },
49
+ ]
50
+
51
+ export const publicNavItems = [
52
+ {
53
+ title: "Welcome",
54
+ items: [
55
+ {
56
+ title: "Home",
57
+ url: "/",
58
+ },
59
+ {
60
+ title: "Login",
61
+ url: "/login",
62
+ },
63
+ {
64
+ title: "Sign Up",
65
+ url: "/signup",
66
+ },
67
+ ],
68
+ },
69
+ {
70
+ title: "Examples",
71
+ items: [
72
+ {
73
+ title: "SSR + oRPC",
74
+ url: "/examples/ssr-orpc",
75
+ },
76
+ {
77
+ title: "Client + oRPC",
78
+ url: "/examples/client-orpc",
79
+ },
80
+ {
81
+ title: "ISR",
82
+ url: "/examples/isr",
83
+ },
84
+ ],
85
+ },
86
+ ]
87
+
88
+ interface AppSidebarProps extends React.ComponentProps<typeof Sidebar> {
89
+ items?: Array<{
90
+ title: string
91
+ items: Array<{
92
+ title: string
93
+ url: string
94
+ }>
95
+ }>
96
+ }
97
+
98
+ export function AuthSidebar(props: React.ComponentProps<typeof Sidebar>) {
99
+ return <AppSidebar items={authNavItems} {...props} />
100
+ }
101
+
102
+ export function PublicSidebar(props: React.ComponentProps<typeof Sidebar>) {
103
+ return <AppSidebar items={publicNavItems} {...props} />
50
104
  }
51
105
 
52
- export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
106
+ export function AppSidebar({ items = authNavItems, ...props }: AppSidebarProps) {
53
107
  const {
54
108
  data: session,
55
109
  } = authClient.useSession()
@@ -64,7 +118,7 @@ export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
64
118
  </div>
65
119
  </SidebarHeader>
66
120
  <SidebarContent>
67
- {data.navMain.map((item) => (
121
+ {items.map((item) => (
68
122
  <SidebarGroup key={item.title}>
69
123
  <SidebarGroupLabel>{item.title}</SidebarGroupLabel>
70
124
  <SidebarGroupContent>
@@ -9,68 +9,53 @@
9
9
  // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
10
10
 
11
11
  import { Route as rootRouteImport } from './routes/__root'
12
- import { Route as publicIndexRouteImport } from './routes/(public)/index'
13
- import { Route as ExamplesSsrOrpcAuthRouteImport } from './routes/examples/ssr-orpc-auth'
14
- import { Route as ExamplesSsrOrpcRouteImport } from './routes/examples/ssr-orpc'
15
- import { Route as ExamplesIsrRouteImport } from './routes/examples/isr'
16
- import { Route as ExamplesClientOrpcAuthRouteImport } from './routes/examples/client-orpc-auth'
17
- import { Route as ExamplesClientOrpcRouteImport } from './routes/examples/client-orpc'
18
- import { Route as publicSignupRouteImport } from './routes/(public)/signup'
19
- import { Route as publicLoginRouteImport } from './routes/(public)/login'
20
- import { Route as authDashboardRouteImport } from './routes/(auth)/dashboard'
21
- import { Route as authAccountRouteImport } from './routes/(auth)/account'
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'
22
19
  import { Route as ApiRpcSplatRouteImport } from './routes/api/rpc.$'
23
20
  import { Route as ApiAuthSplatRouteImport } from './routes/api/auth/$'
21
+ import { Route as PublicExamplesSsrOrpcRouteImport } from './routes/_public/examples/ssr-orpc'
22
+ import { Route as PublicExamplesIsrRouteImport } from './routes/_public/examples/isr'
23
+ import { Route as PublicExamplesClientOrpcRouteImport } from './routes/_public/examples/client-orpc'
24
+ import { Route as AuthExamplesSsrOrpcAuthRouteImport } from './routes/_auth/examples/ssr-orpc-auth'
25
+ import { Route as AuthExamplesClientOrpcAuthRouteImport } from './routes/_auth/examples/client-orpc-auth'
24
26
 
25
- const publicIndexRoute = publicIndexRouteImport.update({
26
- id: '/(public)/',
27
- path: '/',
28
- getParentRoute: () => rootRouteImport,
29
- } as any)
30
- const ExamplesSsrOrpcAuthRoute = ExamplesSsrOrpcAuthRouteImport.update({
31
- id: '/examples/ssr-orpc-auth',
32
- path: '/examples/ssr-orpc-auth',
33
- getParentRoute: () => rootRouteImport,
34
- } as any)
35
- const ExamplesSsrOrpcRoute = ExamplesSsrOrpcRouteImport.update({
36
- id: '/examples/ssr-orpc',
37
- path: '/examples/ssr-orpc',
38
- getParentRoute: () => rootRouteImport,
39
- } as any)
40
- const ExamplesIsrRoute = ExamplesIsrRouteImport.update({
41
- id: '/examples/isr',
42
- path: '/examples/isr',
27
+ const PublicRoute = PublicRouteImport.update({
28
+ id: '/_public',
43
29
  getParentRoute: () => rootRouteImport,
44
30
  } as any)
45
- const ExamplesClientOrpcAuthRoute = ExamplesClientOrpcAuthRouteImport.update({
46
- id: '/examples/client-orpc-auth',
47
- path: '/examples/client-orpc-auth',
31
+ const AuthRoute = AuthRouteImport.update({
32
+ id: '/_auth',
48
33
  getParentRoute: () => rootRouteImport,
49
34
  } as any)
50
- const ExamplesClientOrpcRoute = ExamplesClientOrpcRouteImport.update({
51
- id: '/examples/client-orpc',
52
- path: '/examples/client-orpc',
53
- getParentRoute: () => rootRouteImport,
35
+ const PublicIndexRoute = PublicIndexRouteImport.update({
36
+ id: '/',
37
+ path: '/',
38
+ getParentRoute: () => PublicRoute,
54
39
  } as any)
55
- const publicSignupRoute = publicSignupRouteImport.update({
56
- id: '/(public)/signup',
40
+ const PublicSignupRoute = PublicSignupRouteImport.update({
41
+ id: '/signup',
57
42
  path: '/signup',
58
- getParentRoute: () => rootRouteImport,
43
+ getParentRoute: () => PublicRoute,
59
44
  } as any)
60
- const publicLoginRoute = publicLoginRouteImport.update({
61
- id: '/(public)/login',
45
+ const PublicLoginRoute = PublicLoginRouteImport.update({
46
+ id: '/login',
62
47
  path: '/login',
63
- getParentRoute: () => rootRouteImport,
48
+ getParentRoute: () => PublicRoute,
64
49
  } as any)
65
- const authDashboardRoute = authDashboardRouteImport.update({
66
- id: '/(auth)/dashboard',
50
+ const AuthDashboardRoute = AuthDashboardRouteImport.update({
51
+ id: '/dashboard',
67
52
  path: '/dashboard',
68
- getParentRoute: () => rootRouteImport,
53
+ getParentRoute: () => AuthRoute,
69
54
  } as any)
70
- const authAccountRoute = authAccountRouteImport.update({
71
- id: '/(auth)/account',
55
+ const AuthAccountRoute = AuthAccountRouteImport.update({
56
+ id: '/account',
72
57
  path: '/account',
73
- getParentRoute: () => rootRouteImport,
58
+ getParentRoute: () => AuthRoute,
74
59
  } as any)
75
60
  const ApiRpcSplatRoute = ApiRpcSplatRouteImport.update({
76
61
  id: '/api/rpc/$',
@@ -82,181 +67,183 @@ const ApiAuthSplatRoute = ApiAuthSplatRouteImport.update({
82
67
  path: '/api/auth/$',
83
68
  getParentRoute: () => rootRouteImport,
84
69
  } as any)
70
+ const PublicExamplesSsrOrpcRoute = PublicExamplesSsrOrpcRouteImport.update({
71
+ id: '/examples/ssr-orpc',
72
+ path: '/examples/ssr-orpc',
73
+ getParentRoute: () => PublicRoute,
74
+ } as any)
75
+ const PublicExamplesIsrRoute = PublicExamplesIsrRouteImport.update({
76
+ id: '/examples/isr',
77
+ path: '/examples/isr',
78
+ getParentRoute: () => PublicRoute,
79
+ } as any)
80
+ const PublicExamplesClientOrpcRoute =
81
+ PublicExamplesClientOrpcRouteImport.update({
82
+ id: '/examples/client-orpc',
83
+ path: '/examples/client-orpc',
84
+ getParentRoute: () => PublicRoute,
85
+ } as any)
86
+ const AuthExamplesSsrOrpcAuthRoute = AuthExamplesSsrOrpcAuthRouteImport.update({
87
+ id: '/examples/ssr-orpc-auth',
88
+ path: '/examples/ssr-orpc-auth',
89
+ getParentRoute: () => AuthRoute,
90
+ } as any)
91
+ const AuthExamplesClientOrpcAuthRoute =
92
+ AuthExamplesClientOrpcAuthRouteImport.update({
93
+ id: '/examples/client-orpc-auth',
94
+ path: '/examples/client-orpc-auth',
95
+ getParentRoute: () => AuthRoute,
96
+ } as any)
85
97
 
86
98
  export interface FileRoutesByFullPath {
87
- '/account': typeof authAccountRoute
88
- '/dashboard': typeof authDashboardRoute
89
- '/login': typeof publicLoginRoute
90
- '/signup': typeof publicSignupRoute
91
- '/examples/client-orpc': typeof ExamplesClientOrpcRoute
92
- '/examples/client-orpc-auth': typeof ExamplesClientOrpcAuthRoute
93
- '/examples/isr': typeof ExamplesIsrRoute
94
- '/examples/ssr-orpc': typeof ExamplesSsrOrpcRoute
95
- '/examples/ssr-orpc-auth': typeof ExamplesSsrOrpcAuthRoute
96
- '/': typeof publicIndexRoute
99
+ '/': typeof PublicIndexRoute
100
+ '/account': typeof AuthAccountRoute
101
+ '/dashboard': typeof AuthDashboardRoute
102
+ '/login': typeof PublicLoginRoute
103
+ '/signup': typeof PublicSignupRoute
104
+ '/examples/client-orpc-auth': typeof AuthExamplesClientOrpcAuthRoute
105
+ '/examples/ssr-orpc-auth': typeof AuthExamplesSsrOrpcAuthRoute
106
+ '/examples/client-orpc': typeof PublicExamplesClientOrpcRoute
107
+ '/examples/isr': typeof PublicExamplesIsrRoute
108
+ '/examples/ssr-orpc': typeof PublicExamplesSsrOrpcRoute
97
109
  '/api/auth/$': typeof ApiAuthSplatRoute
98
110
  '/api/rpc/$': typeof ApiRpcSplatRoute
99
111
  }
100
112
  export interface FileRoutesByTo {
101
- '/account': typeof authAccountRoute
102
- '/dashboard': typeof authDashboardRoute
103
- '/login': typeof publicLoginRoute
104
- '/signup': typeof publicSignupRoute
105
- '/examples/client-orpc': typeof ExamplesClientOrpcRoute
106
- '/examples/client-orpc-auth': typeof ExamplesClientOrpcAuthRoute
107
- '/examples/isr': typeof ExamplesIsrRoute
108
- '/examples/ssr-orpc': typeof ExamplesSsrOrpcRoute
109
- '/examples/ssr-orpc-auth': typeof ExamplesSsrOrpcAuthRoute
110
- '/': typeof publicIndexRoute
113
+ '/': typeof PublicIndexRoute
114
+ '/account': typeof AuthAccountRoute
115
+ '/dashboard': typeof AuthDashboardRoute
116
+ '/login': typeof PublicLoginRoute
117
+ '/signup': typeof PublicSignupRoute
118
+ '/examples/client-orpc-auth': typeof AuthExamplesClientOrpcAuthRoute
119
+ '/examples/ssr-orpc-auth': typeof AuthExamplesSsrOrpcAuthRoute
120
+ '/examples/client-orpc': typeof PublicExamplesClientOrpcRoute
121
+ '/examples/isr': typeof PublicExamplesIsrRoute
122
+ '/examples/ssr-orpc': typeof PublicExamplesSsrOrpcRoute
111
123
  '/api/auth/$': typeof ApiAuthSplatRoute
112
124
  '/api/rpc/$': typeof ApiRpcSplatRoute
113
125
  }
114
126
  export interface FileRoutesById {
115
127
  __root__: typeof rootRouteImport
116
- '/(auth)/account': typeof authAccountRoute
117
- '/(auth)/dashboard': typeof authDashboardRoute
118
- '/(public)/login': typeof publicLoginRoute
119
- '/(public)/signup': typeof publicSignupRoute
120
- '/examples/client-orpc': typeof ExamplesClientOrpcRoute
121
- '/examples/client-orpc-auth': typeof ExamplesClientOrpcAuthRoute
122
- '/examples/isr': typeof ExamplesIsrRoute
123
- '/examples/ssr-orpc': typeof ExamplesSsrOrpcRoute
124
- '/examples/ssr-orpc-auth': typeof ExamplesSsrOrpcAuthRoute
125
- '/(public)/': typeof publicIndexRoute
128
+ '/_auth': typeof AuthRouteWithChildren
129
+ '/_public': typeof PublicRouteWithChildren
130
+ '/_auth/account': typeof AuthAccountRoute
131
+ '/_auth/dashboard': typeof AuthDashboardRoute
132
+ '/_public/login': typeof PublicLoginRoute
133
+ '/_public/signup': typeof PublicSignupRoute
134
+ '/_public/': typeof PublicIndexRoute
135
+ '/_auth/examples/client-orpc-auth': typeof AuthExamplesClientOrpcAuthRoute
136
+ '/_auth/examples/ssr-orpc-auth': typeof AuthExamplesSsrOrpcAuthRoute
137
+ '/_public/examples/client-orpc': typeof PublicExamplesClientOrpcRoute
138
+ '/_public/examples/isr': typeof PublicExamplesIsrRoute
139
+ '/_public/examples/ssr-orpc': typeof PublicExamplesSsrOrpcRoute
126
140
  '/api/auth/$': typeof ApiAuthSplatRoute
127
141
  '/api/rpc/$': typeof ApiRpcSplatRoute
128
142
  }
129
143
  export interface FileRouteTypes {
130
144
  fileRoutesByFullPath: FileRoutesByFullPath
131
145
  fullPaths:
146
+ | '/'
132
147
  | '/account'
133
148
  | '/dashboard'
134
149
  | '/login'
135
150
  | '/signup'
136
- | '/examples/client-orpc'
137
151
  | '/examples/client-orpc-auth'
152
+ | '/examples/ssr-orpc-auth'
153
+ | '/examples/client-orpc'
138
154
  | '/examples/isr'
139
155
  | '/examples/ssr-orpc'
140
- | '/examples/ssr-orpc-auth'
141
- | '/'
142
156
  | '/api/auth/$'
143
157
  | '/api/rpc/$'
144
158
  fileRoutesByTo: FileRoutesByTo
145
159
  to:
160
+ | '/'
146
161
  | '/account'
147
162
  | '/dashboard'
148
163
  | '/login'
149
164
  | '/signup'
150
- | '/examples/client-orpc'
151
165
  | '/examples/client-orpc-auth'
166
+ | '/examples/ssr-orpc-auth'
167
+ | '/examples/client-orpc'
152
168
  | '/examples/isr'
153
169
  | '/examples/ssr-orpc'
154
- | '/examples/ssr-orpc-auth'
155
- | '/'
156
170
  | '/api/auth/$'
157
171
  | '/api/rpc/$'
158
172
  id:
159
173
  | '__root__'
160
- | '/(auth)/account'
161
- | '/(auth)/dashboard'
162
- | '/(public)/login'
163
- | '/(public)/signup'
164
- | '/examples/client-orpc'
165
- | '/examples/client-orpc-auth'
166
- | '/examples/isr'
167
- | '/examples/ssr-orpc'
168
- | '/examples/ssr-orpc-auth'
169
- | '/(public)/'
174
+ | '/_auth'
175
+ | '/_public'
176
+ | '/_auth/account'
177
+ | '/_auth/dashboard'
178
+ | '/_public/login'
179
+ | '/_public/signup'
180
+ | '/_public/'
181
+ | '/_auth/examples/client-orpc-auth'
182
+ | '/_auth/examples/ssr-orpc-auth'
183
+ | '/_public/examples/client-orpc'
184
+ | '/_public/examples/isr'
185
+ | '/_public/examples/ssr-orpc'
170
186
  | '/api/auth/$'
171
187
  | '/api/rpc/$'
172
188
  fileRoutesById: FileRoutesById
173
189
  }
174
190
  export interface RootRouteChildren {
175
- authAccountRoute: typeof authAccountRoute
176
- authDashboardRoute: typeof authDashboardRoute
177
- publicLoginRoute: typeof publicLoginRoute
178
- publicSignupRoute: typeof publicSignupRoute
179
- ExamplesClientOrpcRoute: typeof ExamplesClientOrpcRoute
180
- ExamplesClientOrpcAuthRoute: typeof ExamplesClientOrpcAuthRoute
181
- ExamplesIsrRoute: typeof ExamplesIsrRoute
182
- ExamplesSsrOrpcRoute: typeof ExamplesSsrOrpcRoute
183
- ExamplesSsrOrpcAuthRoute: typeof ExamplesSsrOrpcAuthRoute
184
- publicIndexRoute: typeof publicIndexRoute
191
+ AuthRoute: typeof AuthRouteWithChildren
192
+ PublicRoute: typeof PublicRouteWithChildren
185
193
  ApiAuthSplatRoute: typeof ApiAuthSplatRoute
186
194
  ApiRpcSplatRoute: typeof ApiRpcSplatRoute
187
195
  }
188
196
 
189
197
  declare module '@tanstack/react-router' {
190
198
  interface FileRoutesByPath {
191
- '/(public)/': {
192
- id: '/(public)/'
193
- path: '/'
199
+ '/_public': {
200
+ id: '/_public'
201
+ path: ''
194
202
  fullPath: '/'
195
- preLoaderRoute: typeof publicIndexRouteImport
203
+ preLoaderRoute: typeof PublicRouteImport
196
204
  parentRoute: typeof rootRouteImport
197
205
  }
198
- '/examples/ssr-orpc-auth': {
199
- id: '/examples/ssr-orpc-auth'
200
- path: '/examples/ssr-orpc-auth'
201
- fullPath: '/examples/ssr-orpc-auth'
202
- preLoaderRoute: typeof ExamplesSsrOrpcAuthRouteImport
203
- parentRoute: typeof rootRouteImport
204
- }
205
- '/examples/ssr-orpc': {
206
- id: '/examples/ssr-orpc'
207
- path: '/examples/ssr-orpc'
208
- fullPath: '/examples/ssr-orpc'
209
- preLoaderRoute: typeof ExamplesSsrOrpcRouteImport
210
- parentRoute: typeof rootRouteImport
211
- }
212
- '/examples/isr': {
213
- id: '/examples/isr'
214
- path: '/examples/isr'
215
- fullPath: '/examples/isr'
216
- preLoaderRoute: typeof ExamplesIsrRouteImport
217
- parentRoute: typeof rootRouteImport
218
- }
219
- '/examples/client-orpc-auth': {
220
- id: '/examples/client-orpc-auth'
221
- path: '/examples/client-orpc-auth'
222
- fullPath: '/examples/client-orpc-auth'
223
- preLoaderRoute: typeof ExamplesClientOrpcAuthRouteImport
206
+ '/_auth': {
207
+ id: '/_auth'
208
+ path: ''
209
+ fullPath: '/'
210
+ preLoaderRoute: typeof AuthRouteImport
224
211
  parentRoute: typeof rootRouteImport
225
212
  }
226
- '/examples/client-orpc': {
227
- id: '/examples/client-orpc'
228
- path: '/examples/client-orpc'
229
- fullPath: '/examples/client-orpc'
230
- preLoaderRoute: typeof ExamplesClientOrpcRouteImport
231
- parentRoute: typeof rootRouteImport
213
+ '/_public/': {
214
+ id: '/_public/'
215
+ path: '/'
216
+ fullPath: '/'
217
+ preLoaderRoute: typeof PublicIndexRouteImport
218
+ parentRoute: typeof PublicRoute
232
219
  }
233
- '/(public)/signup': {
234
- id: '/(public)/signup'
220
+ '/_public/signup': {
221
+ id: '/_public/signup'
235
222
  path: '/signup'
236
223
  fullPath: '/signup'
237
- preLoaderRoute: typeof publicSignupRouteImport
238
- parentRoute: typeof rootRouteImport
224
+ preLoaderRoute: typeof PublicSignupRouteImport
225
+ parentRoute: typeof PublicRoute
239
226
  }
240
- '/(public)/login': {
241
- id: '/(public)/login'
227
+ '/_public/login': {
228
+ id: '/_public/login'
242
229
  path: '/login'
243
230
  fullPath: '/login'
244
- preLoaderRoute: typeof publicLoginRouteImport
245
- parentRoute: typeof rootRouteImport
231
+ preLoaderRoute: typeof PublicLoginRouteImport
232
+ parentRoute: typeof PublicRoute
246
233
  }
247
- '/(auth)/dashboard': {
248
- id: '/(auth)/dashboard'
234
+ '/_auth/dashboard': {
235
+ id: '/_auth/dashboard'
249
236
  path: '/dashboard'
250
237
  fullPath: '/dashboard'
251
- preLoaderRoute: typeof authDashboardRouteImport
252
- parentRoute: typeof rootRouteImport
238
+ preLoaderRoute: typeof AuthDashboardRouteImport
239
+ parentRoute: typeof AuthRoute
253
240
  }
254
- '/(auth)/account': {
255
- id: '/(auth)/account'
241
+ '/_auth/account': {
242
+ id: '/_auth/account'
256
243
  path: '/account'
257
244
  fullPath: '/account'
258
- preLoaderRoute: typeof authAccountRouteImport
259
- parentRoute: typeof rootRouteImport
245
+ preLoaderRoute: typeof AuthAccountRouteImport
246
+ parentRoute: typeof AuthRoute
260
247
  }
261
248
  '/api/rpc/$': {
262
249
  id: '/api/rpc/$'
@@ -272,20 +259,84 @@ declare module '@tanstack/react-router' {
272
259
  preLoaderRoute: typeof ApiAuthSplatRouteImport
273
260
  parentRoute: typeof rootRouteImport
274
261
  }
262
+ '/_public/examples/ssr-orpc': {
263
+ id: '/_public/examples/ssr-orpc'
264
+ path: '/examples/ssr-orpc'
265
+ fullPath: '/examples/ssr-orpc'
266
+ preLoaderRoute: typeof PublicExamplesSsrOrpcRouteImport
267
+ parentRoute: typeof PublicRoute
268
+ }
269
+ '/_public/examples/isr': {
270
+ id: '/_public/examples/isr'
271
+ path: '/examples/isr'
272
+ fullPath: '/examples/isr'
273
+ preLoaderRoute: typeof PublicExamplesIsrRouteImport
274
+ parentRoute: typeof PublicRoute
275
+ }
276
+ '/_public/examples/client-orpc': {
277
+ id: '/_public/examples/client-orpc'
278
+ path: '/examples/client-orpc'
279
+ fullPath: '/examples/client-orpc'
280
+ preLoaderRoute: typeof PublicExamplesClientOrpcRouteImport
281
+ parentRoute: typeof PublicRoute
282
+ }
283
+ '/_auth/examples/ssr-orpc-auth': {
284
+ id: '/_auth/examples/ssr-orpc-auth'
285
+ path: '/examples/ssr-orpc-auth'
286
+ fullPath: '/examples/ssr-orpc-auth'
287
+ preLoaderRoute: typeof AuthExamplesSsrOrpcAuthRouteImport
288
+ parentRoute: typeof AuthRoute
289
+ }
290
+ '/_auth/examples/client-orpc-auth': {
291
+ id: '/_auth/examples/client-orpc-auth'
292
+ path: '/examples/client-orpc-auth'
293
+ fullPath: '/examples/client-orpc-auth'
294
+ preLoaderRoute: typeof AuthExamplesClientOrpcAuthRouteImport
295
+ parentRoute: typeof AuthRoute
296
+ }
275
297
  }
276
298
  }
277
299
 
300
+ interface AuthRouteChildren {
301
+ AuthAccountRoute: typeof AuthAccountRoute
302
+ AuthDashboardRoute: typeof AuthDashboardRoute
303
+ AuthExamplesClientOrpcAuthRoute: typeof AuthExamplesClientOrpcAuthRoute
304
+ AuthExamplesSsrOrpcAuthRoute: typeof AuthExamplesSsrOrpcAuthRoute
305
+ }
306
+
307
+ const AuthRouteChildren: AuthRouteChildren = {
308
+ AuthAccountRoute: AuthAccountRoute,
309
+ AuthDashboardRoute: AuthDashboardRoute,
310
+ AuthExamplesClientOrpcAuthRoute: AuthExamplesClientOrpcAuthRoute,
311
+ AuthExamplesSsrOrpcAuthRoute: AuthExamplesSsrOrpcAuthRoute,
312
+ }
313
+
314
+ const AuthRouteWithChildren = AuthRoute._addFileChildren(AuthRouteChildren)
315
+
316
+ interface PublicRouteChildren {
317
+ PublicLoginRoute: typeof PublicLoginRoute
318
+ PublicSignupRoute: typeof PublicSignupRoute
319
+ PublicIndexRoute: typeof PublicIndexRoute
320
+ PublicExamplesClientOrpcRoute: typeof PublicExamplesClientOrpcRoute
321
+ PublicExamplesIsrRoute: typeof PublicExamplesIsrRoute
322
+ PublicExamplesSsrOrpcRoute: typeof PublicExamplesSsrOrpcRoute
323
+ }
324
+
325
+ const PublicRouteChildren: PublicRouteChildren = {
326
+ PublicLoginRoute: PublicLoginRoute,
327
+ PublicSignupRoute: PublicSignupRoute,
328
+ PublicIndexRoute: PublicIndexRoute,
329
+ PublicExamplesClientOrpcRoute: PublicExamplesClientOrpcRoute,
330
+ PublicExamplesIsrRoute: PublicExamplesIsrRoute,
331
+ PublicExamplesSsrOrpcRoute: PublicExamplesSsrOrpcRoute,
332
+ }
333
+
334
+ const PublicRouteWithChildren =
335
+ PublicRoute._addFileChildren(PublicRouteChildren)
336
+
278
337
  const rootRouteChildren: RootRouteChildren = {
279
- authAccountRoute: authAccountRoute,
280
- authDashboardRoute: authDashboardRoute,
281
- publicLoginRoute: publicLoginRoute,
282
- publicSignupRoute: publicSignupRoute,
283
- ExamplesClientOrpcRoute: ExamplesClientOrpcRoute,
284
- ExamplesClientOrpcAuthRoute: ExamplesClientOrpcAuthRoute,
285
- ExamplesIsrRoute: ExamplesIsrRoute,
286
- ExamplesSsrOrpcRoute: ExamplesSsrOrpcRoute,
287
- ExamplesSsrOrpcAuthRoute: ExamplesSsrOrpcAuthRoute,
288
- publicIndexRoute: publicIndexRoute,
338
+ AuthRoute: AuthRouteWithChildren,
339
+ PublicRoute: PublicRouteWithChildren,
289
340
  ApiAuthSplatRoute: ApiAuthSplatRoute,
290
341
  ApiRpcSplatRoute: ApiRpcSplatRoute,
291
342
  }
@@ -1,10 +1,8 @@
1
1
  import { HeadContent, Scripts, createRootRoute } from "@tanstack/react-router"
2
2
  import { QueryClient, QueryClientProvider } from "@tanstack/react-query"
3
- import { SidebarProvider, SidebarTrigger } from "@workspace/ui/components/sidebar"
4
3
  import { Toaster } from "@workspace/ui/components/sonner"
5
4
 
6
5
  import appCss from "@workspace/ui/globals.css?url"
7
- import { AppSidebar } from "@/components/app-sidebar"
8
6
 
9
7
  const queryClient = new QueryClient()
10
8
 
@@ -40,18 +38,8 @@ function RootDocument({ children }: { children: React.ReactNode }) {
40
38
  </head>
41
39
  <body>
42
40
  <QueryClientProvider client={queryClient}>
43
- <SidebarProvider>
44
- <AppSidebar />
45
- <main className="flex flex-1 flex-col overflow-hidden">
46
- <header className="flex h-16 shrink-0 items-center gap-2 border-b px-4">
47
- <SidebarTrigger />
48
- </header>
49
- <div className="flex-1 overflow-auto p-4">
50
- {children}
51
- </div>
52
- </main>
53
- <Toaster />
54
- </SidebarProvider>
41
+ {children}
42
+ <Toaster />
55
43
  </QueryClientProvider>
56
44
  <Scripts />
57
45
  </body>
@@ -28,7 +28,7 @@ const passwordSchema = z.object({
28
28
  path: ["confirmPassword"],
29
29
  })
30
30
 
31
- export const Route = createFileRoute("/(auth)/account")({
31
+ export const Route = createFileRoute("/_auth/account")({
32
32
  beforeLoad: async () => {
33
33
  const session = await getSessionFn()
34
34
  if (!session) {
@@ -3,7 +3,7 @@ import { getSessionFn } from "@/lib/auth-utils"
3
3
  import { authClient } from "@/lib/auth-client"
4
4
  import { orpc } from "@/lib/orpc"
5
5
 
6
- export const Route = createFileRoute("/(auth)/dashboard")({
6
+ export const Route = createFileRoute("/_auth/dashboard")({
7
7
  beforeLoad: async () => {
8
8
  const session = await getSessionFn()
9
9
  if (!session) {
@@ -3,7 +3,7 @@ import { useQuery } from "@tanstack/react-query"
3
3
  import { getSessionFn } from "@/lib/auth-utils"
4
4
  import { orpc } from "@/lib/orpc"
5
5
 
6
- export const Route = createFileRoute("/examples/client-orpc-auth")({
6
+ export const Route = createFileRoute("/_auth/examples/client-orpc-auth")({
7
7
  beforeLoad: async () => {
8
8
  const session = await getSessionFn()
9
9
  if (!session) {
@@ -2,7 +2,7 @@ import { createFileRoute, redirect } from "@tanstack/react-router"
2
2
  import { getSessionFn } from "@/lib/auth-utils"
3
3
  import { orpc } from "@/lib/orpc"
4
4
 
5
- export const Route = createFileRoute("/examples/ssr-orpc-auth")({
5
+ export const Route = createFileRoute("/_auth/examples/ssr-orpc-auth")({
6
6
  beforeLoad: async () => {
7
7
  const session = await getSessionFn()
8
8
  if (!session) {
@@ -0,0 +1,23 @@
1
+ import { Outlet, createFileRoute } from "@tanstack/react-router"
2
+ import { SidebarProvider, SidebarTrigger } from "@workspace/ui/components/sidebar"
3
+ import { AuthSidebar } from "@/components/app-sidebar"
4
+
5
+ export const Route = createFileRoute("/_auth")({
6
+ component: AuthLayout,
7
+ })
8
+
9
+ function AuthLayout() {
10
+ return (
11
+ <SidebarProvider>
12
+ <AuthSidebar />
13
+ <main className="flex flex-1 flex-col overflow-hidden">
14
+ <header className="flex h-16 shrink-0 items-center gap-2 border-b px-4">
15
+ <SidebarTrigger />
16
+ </header>
17
+ <div className="flex-1 overflow-auto p-4">
18
+ <Outlet />
19
+ </div>
20
+ </main>
21
+ </SidebarProvider>
22
+ )
23
+ }
@@ -29,7 +29,7 @@ const planetSchema = z.object({
29
29
  diameter: z.string().refine((val) => !isNaN(parseFloat(val)), "Must be a number"),
30
30
  })
31
31
 
32
- export const Route = createFileRoute("/examples/client-orpc")({
32
+ export const Route = createFileRoute("/_public/examples/client-orpc")({
33
33
  component: ClientORPC,
34
34
  })
35
35
 
@@ -1,7 +1,7 @@
1
1
  import { createFileRoute } from "@tanstack/react-router"
2
2
  import { orpc } from "@/lib/orpc"
3
3
 
4
- export const Route = createFileRoute("/examples/isr")({
4
+ export const Route = createFileRoute("/_public/examples/isr")({
5
5
  loader: async () => {
6
6
  // In a real ISR scenario, this would be cached on the server
7
7
  // For this example, we'll fetch planets via oRPC
@@ -27,7 +27,7 @@ const planetSchema = z.object({
27
27
  diameter: z.string().refine((val) => !isNaN(parseFloat(val)), "Must be a number"),
28
28
  })
29
29
 
30
- export const Route = createFileRoute("/examples/ssr-orpc")({
30
+ export const Route = createFileRoute("/_public/examples/ssr-orpc")({
31
31
  loader: async () => {
32
32
  const planets = await orpc.planets.getPlanets()
33
33
  return { planets }
@@ -7,7 +7,7 @@ import { orpc } from "@/lib/orpc"
7
7
  type Outputs = InferRouterOutputs<typeof router>
8
8
  type Planet = Outputs["planets"]["getPlanets"][number]
9
9
 
10
- export const Route = createFileRoute("/(public)/")({
10
+ export const Route = createFileRoute("/_public/")({
11
11
  loader: async () => {
12
12
  const [helloRes, planets] = await Promise.all([
13
13
  orpc.hello({ name: "Croissant Stack" }),
@@ -1,7 +1,7 @@
1
1
  import { createFileRoute } from "@tanstack/react-router"
2
2
  import { LoginForm } from "@/components/login-form"
3
3
 
4
- export const Route = createFileRoute("/(public)/login")({
4
+ export const Route = createFileRoute("/_public/login")({
5
5
  headers: () => ({
6
6
  "Cache-Control": "public, max-age=3600, s-maxage=3600, stale-while-revalidate=86400",
7
7
  }),
@@ -1,7 +1,7 @@
1
1
  import { createFileRoute } from "@tanstack/react-router"
2
2
  import { SignupForm } from "@/components/signup-form"
3
3
 
4
- export const Route = createFileRoute("/(public)/signup")({
4
+ export const Route = createFileRoute("/_public/signup")({
5
5
  headers: () => ({
6
6
  "Cache-Control": "public, max-age=3600, s-maxage=3600, stale-while-revalidate=86400",
7
7
  }),
@@ -0,0 +1,23 @@
1
+ import { Outlet, createFileRoute } from "@tanstack/react-router"
2
+ import { SidebarProvider, SidebarTrigger } from "@workspace/ui/components/sidebar"
3
+ import { PublicSidebar } from "@/components/app-sidebar"
4
+
5
+ export const Route = createFileRoute("/_public")({
6
+ component: PublicLayout,
7
+ })
8
+
9
+ function PublicLayout() {
10
+ return (
11
+ <SidebarProvider>
12
+ <PublicSidebar />
13
+ <main className="flex flex-1 flex-col overflow-hidden">
14
+ <header className="flex h-16 shrink-0 items-center gap-2 border-b px-4">
15
+ <SidebarTrigger />
16
+ </header>
17
+ <div className="flex-1 overflow-auto p-4">
18
+ <Outlet />
19
+ </div>
20
+ </main>
21
+ </SidebarProvider>
22
+ )
23
+ }