create-croissant 0.1.14 → 0.1.16
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/web/src/components/app-sidebar.tsx +5 -5
- package/template/apps/web/src/routeTree.gen.ts +105 -105
- package/template/apps/web/src/routes/{client-orpc-auth.tsx → examples/client-orpc-auth.tsx} +2 -2
- package/template/apps/web/src/routes/{client-orpc.tsx → examples/client-orpc.tsx} +1 -1
- package/template/apps/web/src/routes/{isr.tsx → examples/isr.tsx} +1 -1
- package/template/apps/web/src/routes/{ssr-orpc-auth.tsx → examples/ssr-orpc-auth.tsx} +2 -2
- package/template/apps/web/src/routes/{ssr-orpc.tsx → examples/ssr-orpc.tsx} +1 -1
- package/template/apps/web/vite.config.ts +1 -1
- package/template/SKILL.md +0 -56
package/package.json
CHANGED
|
@@ -26,23 +26,23 @@ const data = {
|
|
|
26
26
|
items: [
|
|
27
27
|
{
|
|
28
28
|
title: "SSR + oRPC",
|
|
29
|
-
url: "/ssr-orpc",
|
|
29
|
+
url: "/examples/ssr-orpc",
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
title: "SSR + oRPC (Auth)",
|
|
33
|
-
url: "/ssr-orpc-auth",
|
|
33
|
+
url: "/examples/ssr-orpc-auth",
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
36
|
title: "Client + oRPC",
|
|
37
|
-
url: "/client-orpc",
|
|
37
|
+
url: "/examples/client-orpc",
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
title: "Client + oRPC (Auth)",
|
|
41
|
-
url: "/client-orpc-auth",
|
|
41
|
+
url: "/examples/client-orpc-auth",
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
title: "ISR",
|
|
45
|
-
url: "/isr",
|
|
45
|
+
url: "/examples/isr",
|
|
46
46
|
},
|
|
47
47
|
],
|
|
48
48
|
},
|
|
@@ -9,29 +9,19 @@
|
|
|
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 SsrOrpcAuthRouteImport } from './routes/ssr-orpc-auth'
|
|
13
|
-
import { Route as SsrOrpcRouteImport } from './routes/ssr-orpc'
|
|
14
12
|
import { Route as SignupRouteImport } from './routes/signup'
|
|
15
13
|
import { Route as LoginRouteImport } from './routes/login'
|
|
16
|
-
import { Route as IsrRouteImport } from './routes/isr'
|
|
17
14
|
import { Route as DashboardRouteImport } from './routes/dashboard'
|
|
18
|
-
import { Route as ClientOrpcAuthRouteImport } from './routes/client-orpc-auth'
|
|
19
|
-
import { Route as ClientOrpcRouteImport } from './routes/client-orpc'
|
|
20
15
|
import { Route as AccountRouteImport } from './routes/account'
|
|
21
16
|
import { Route as IndexRouteImport } from './routes/index'
|
|
17
|
+
import { Route as ExamplesSsrOrpcAuthRouteImport } from './routes/examples/ssr-orpc-auth'
|
|
18
|
+
import { Route as ExamplesSsrOrpcRouteImport } from './routes/examples/ssr-orpc'
|
|
19
|
+
import { Route as ExamplesIsrRouteImport } from './routes/examples/isr'
|
|
20
|
+
import { Route as ExamplesClientOrpcAuthRouteImport } from './routes/examples/client-orpc-auth'
|
|
21
|
+
import { Route as ExamplesClientOrpcRouteImport } from './routes/examples/client-orpc'
|
|
22
22
|
import { Route as ApiRpcSplatRouteImport } from './routes/api/rpc.$'
|
|
23
23
|
import { Route as ApiAuthSplatRouteImport } from './routes/api/auth/$'
|
|
24
24
|
|
|
25
|
-
const SsrOrpcAuthRoute = SsrOrpcAuthRouteImport.update({
|
|
26
|
-
id: '/ssr-orpc-auth',
|
|
27
|
-
path: '/ssr-orpc-auth',
|
|
28
|
-
getParentRoute: () => rootRouteImport,
|
|
29
|
-
} as any)
|
|
30
|
-
const SsrOrpcRoute = SsrOrpcRouteImport.update({
|
|
31
|
-
id: '/ssr-orpc',
|
|
32
|
-
path: '/ssr-orpc',
|
|
33
|
-
getParentRoute: () => rootRouteImport,
|
|
34
|
-
} as any)
|
|
35
25
|
const SignupRoute = SignupRouteImport.update({
|
|
36
26
|
id: '/signup',
|
|
37
27
|
path: '/signup',
|
|
@@ -42,26 +32,11 @@ const LoginRoute = LoginRouteImport.update({
|
|
|
42
32
|
path: '/login',
|
|
43
33
|
getParentRoute: () => rootRouteImport,
|
|
44
34
|
} as any)
|
|
45
|
-
const IsrRoute = IsrRouteImport.update({
|
|
46
|
-
id: '/isr',
|
|
47
|
-
path: '/isr',
|
|
48
|
-
getParentRoute: () => rootRouteImport,
|
|
49
|
-
} as any)
|
|
50
35
|
const DashboardRoute = DashboardRouteImport.update({
|
|
51
36
|
id: '/dashboard',
|
|
52
37
|
path: '/dashboard',
|
|
53
38
|
getParentRoute: () => rootRouteImport,
|
|
54
39
|
} as any)
|
|
55
|
-
const ClientOrpcAuthRoute = ClientOrpcAuthRouteImport.update({
|
|
56
|
-
id: '/client-orpc-auth',
|
|
57
|
-
path: '/client-orpc-auth',
|
|
58
|
-
getParentRoute: () => rootRouteImport,
|
|
59
|
-
} as any)
|
|
60
|
-
const ClientOrpcRoute = ClientOrpcRouteImport.update({
|
|
61
|
-
id: '/client-orpc',
|
|
62
|
-
path: '/client-orpc',
|
|
63
|
-
getParentRoute: () => rootRouteImport,
|
|
64
|
-
} as any)
|
|
65
40
|
const AccountRoute = AccountRouteImport.update({
|
|
66
41
|
id: '/account',
|
|
67
42
|
path: '/account',
|
|
@@ -72,6 +47,31 @@ const IndexRoute = IndexRouteImport.update({
|
|
|
72
47
|
path: '/',
|
|
73
48
|
getParentRoute: () => rootRouteImport,
|
|
74
49
|
} as any)
|
|
50
|
+
const ExamplesSsrOrpcAuthRoute = ExamplesSsrOrpcAuthRouteImport.update({
|
|
51
|
+
id: '/examples/ssr-orpc-auth',
|
|
52
|
+
path: '/examples/ssr-orpc-auth',
|
|
53
|
+
getParentRoute: () => rootRouteImport,
|
|
54
|
+
} as any)
|
|
55
|
+
const ExamplesSsrOrpcRoute = ExamplesSsrOrpcRouteImport.update({
|
|
56
|
+
id: '/examples/ssr-orpc',
|
|
57
|
+
path: '/examples/ssr-orpc',
|
|
58
|
+
getParentRoute: () => rootRouteImport,
|
|
59
|
+
} as any)
|
|
60
|
+
const ExamplesIsrRoute = ExamplesIsrRouteImport.update({
|
|
61
|
+
id: '/examples/isr',
|
|
62
|
+
path: '/examples/isr',
|
|
63
|
+
getParentRoute: () => rootRouteImport,
|
|
64
|
+
} as any)
|
|
65
|
+
const ExamplesClientOrpcAuthRoute = ExamplesClientOrpcAuthRouteImport.update({
|
|
66
|
+
id: '/examples/client-orpc-auth',
|
|
67
|
+
path: '/examples/client-orpc-auth',
|
|
68
|
+
getParentRoute: () => rootRouteImport,
|
|
69
|
+
} as any)
|
|
70
|
+
const ExamplesClientOrpcRoute = ExamplesClientOrpcRouteImport.update({
|
|
71
|
+
id: '/examples/client-orpc',
|
|
72
|
+
path: '/examples/client-orpc',
|
|
73
|
+
getParentRoute: () => rootRouteImport,
|
|
74
|
+
} as any)
|
|
75
75
|
const ApiRpcSplatRoute = ApiRpcSplatRouteImport.update({
|
|
76
76
|
id: '/api/rpc/$',
|
|
77
77
|
path: '/api/rpc/$',
|
|
@@ -86,28 +86,28 @@ const ApiAuthSplatRoute = ApiAuthSplatRouteImport.update({
|
|
|
86
86
|
export interface FileRoutesByFullPath {
|
|
87
87
|
'/': typeof IndexRoute
|
|
88
88
|
'/account': typeof AccountRoute
|
|
89
|
-
'/client-orpc': typeof ClientOrpcRoute
|
|
90
|
-
'/client-orpc-auth': typeof ClientOrpcAuthRoute
|
|
91
89
|
'/dashboard': typeof DashboardRoute
|
|
92
|
-
'/isr': typeof IsrRoute
|
|
93
90
|
'/login': typeof LoginRoute
|
|
94
91
|
'/signup': typeof SignupRoute
|
|
95
|
-
'/
|
|
96
|
-
'/
|
|
92
|
+
'/examples/client-orpc': typeof ExamplesClientOrpcRoute
|
|
93
|
+
'/examples/client-orpc-auth': typeof ExamplesClientOrpcAuthRoute
|
|
94
|
+
'/examples/isr': typeof ExamplesIsrRoute
|
|
95
|
+
'/examples/ssr-orpc': typeof ExamplesSsrOrpcRoute
|
|
96
|
+
'/examples/ssr-orpc-auth': typeof ExamplesSsrOrpcAuthRoute
|
|
97
97
|
'/api/auth/$': typeof ApiAuthSplatRoute
|
|
98
98
|
'/api/rpc/$': typeof ApiRpcSplatRoute
|
|
99
99
|
}
|
|
100
100
|
export interface FileRoutesByTo {
|
|
101
101
|
'/': typeof IndexRoute
|
|
102
102
|
'/account': typeof AccountRoute
|
|
103
|
-
'/client-orpc': typeof ClientOrpcRoute
|
|
104
|
-
'/client-orpc-auth': typeof ClientOrpcAuthRoute
|
|
105
103
|
'/dashboard': typeof DashboardRoute
|
|
106
|
-
'/isr': typeof IsrRoute
|
|
107
104
|
'/login': typeof LoginRoute
|
|
108
105
|
'/signup': typeof SignupRoute
|
|
109
|
-
'/
|
|
110
|
-
'/
|
|
106
|
+
'/examples/client-orpc': typeof ExamplesClientOrpcRoute
|
|
107
|
+
'/examples/client-orpc-auth': typeof ExamplesClientOrpcAuthRoute
|
|
108
|
+
'/examples/isr': typeof ExamplesIsrRoute
|
|
109
|
+
'/examples/ssr-orpc': typeof ExamplesSsrOrpcRoute
|
|
110
|
+
'/examples/ssr-orpc-auth': typeof ExamplesSsrOrpcAuthRoute
|
|
111
111
|
'/api/auth/$': typeof ApiAuthSplatRoute
|
|
112
112
|
'/api/rpc/$': typeof ApiRpcSplatRoute
|
|
113
113
|
}
|
|
@@ -115,14 +115,14 @@ export interface FileRoutesById {
|
|
|
115
115
|
__root__: typeof rootRouteImport
|
|
116
116
|
'/': typeof IndexRoute
|
|
117
117
|
'/account': typeof AccountRoute
|
|
118
|
-
'/client-orpc': typeof ClientOrpcRoute
|
|
119
|
-
'/client-orpc-auth': typeof ClientOrpcAuthRoute
|
|
120
118
|
'/dashboard': typeof DashboardRoute
|
|
121
|
-
'/isr': typeof IsrRoute
|
|
122
119
|
'/login': typeof LoginRoute
|
|
123
120
|
'/signup': typeof SignupRoute
|
|
124
|
-
'/
|
|
125
|
-
'/
|
|
121
|
+
'/examples/client-orpc': typeof ExamplesClientOrpcRoute
|
|
122
|
+
'/examples/client-orpc-auth': typeof ExamplesClientOrpcAuthRoute
|
|
123
|
+
'/examples/isr': typeof ExamplesIsrRoute
|
|
124
|
+
'/examples/ssr-orpc': typeof ExamplesSsrOrpcRoute
|
|
125
|
+
'/examples/ssr-orpc-auth': typeof ExamplesSsrOrpcAuthRoute
|
|
126
126
|
'/api/auth/$': typeof ApiAuthSplatRoute
|
|
127
127
|
'/api/rpc/$': typeof ApiRpcSplatRoute
|
|
128
128
|
}
|
|
@@ -131,42 +131,42 @@ export interface FileRouteTypes {
|
|
|
131
131
|
fullPaths:
|
|
132
132
|
| '/'
|
|
133
133
|
| '/account'
|
|
134
|
-
| '/client-orpc'
|
|
135
|
-
| '/client-orpc-auth'
|
|
136
134
|
| '/dashboard'
|
|
137
|
-
| '/isr'
|
|
138
135
|
| '/login'
|
|
139
136
|
| '/signup'
|
|
140
|
-
| '/
|
|
141
|
-
| '/
|
|
137
|
+
| '/examples/client-orpc'
|
|
138
|
+
| '/examples/client-orpc-auth'
|
|
139
|
+
| '/examples/isr'
|
|
140
|
+
| '/examples/ssr-orpc'
|
|
141
|
+
| '/examples/ssr-orpc-auth'
|
|
142
142
|
| '/api/auth/$'
|
|
143
143
|
| '/api/rpc/$'
|
|
144
144
|
fileRoutesByTo: FileRoutesByTo
|
|
145
145
|
to:
|
|
146
146
|
| '/'
|
|
147
147
|
| '/account'
|
|
148
|
-
| '/client-orpc'
|
|
149
|
-
| '/client-orpc-auth'
|
|
150
148
|
| '/dashboard'
|
|
151
|
-
| '/isr'
|
|
152
149
|
| '/login'
|
|
153
150
|
| '/signup'
|
|
154
|
-
| '/
|
|
155
|
-
| '/
|
|
151
|
+
| '/examples/client-orpc'
|
|
152
|
+
| '/examples/client-orpc-auth'
|
|
153
|
+
| '/examples/isr'
|
|
154
|
+
| '/examples/ssr-orpc'
|
|
155
|
+
| '/examples/ssr-orpc-auth'
|
|
156
156
|
| '/api/auth/$'
|
|
157
157
|
| '/api/rpc/$'
|
|
158
158
|
id:
|
|
159
159
|
| '__root__'
|
|
160
160
|
| '/'
|
|
161
161
|
| '/account'
|
|
162
|
-
| '/client-orpc'
|
|
163
|
-
| '/client-orpc-auth'
|
|
164
162
|
| '/dashboard'
|
|
165
|
-
| '/isr'
|
|
166
163
|
| '/login'
|
|
167
164
|
| '/signup'
|
|
168
|
-
| '/
|
|
169
|
-
| '/
|
|
165
|
+
| '/examples/client-orpc'
|
|
166
|
+
| '/examples/client-orpc-auth'
|
|
167
|
+
| '/examples/isr'
|
|
168
|
+
| '/examples/ssr-orpc'
|
|
169
|
+
| '/examples/ssr-orpc-auth'
|
|
170
170
|
| '/api/auth/$'
|
|
171
171
|
| '/api/rpc/$'
|
|
172
172
|
fileRoutesById: FileRoutesById
|
|
@@ -174,34 +174,20 @@ export interface FileRouteTypes {
|
|
|
174
174
|
export interface RootRouteChildren {
|
|
175
175
|
IndexRoute: typeof IndexRoute
|
|
176
176
|
AccountRoute: typeof AccountRoute
|
|
177
|
-
ClientOrpcRoute: typeof ClientOrpcRoute
|
|
178
|
-
ClientOrpcAuthRoute: typeof ClientOrpcAuthRoute
|
|
179
177
|
DashboardRoute: typeof DashboardRoute
|
|
180
|
-
IsrRoute: typeof IsrRoute
|
|
181
178
|
LoginRoute: typeof LoginRoute
|
|
182
179
|
SignupRoute: typeof SignupRoute
|
|
183
|
-
|
|
184
|
-
|
|
180
|
+
ExamplesClientOrpcRoute: typeof ExamplesClientOrpcRoute
|
|
181
|
+
ExamplesClientOrpcAuthRoute: typeof ExamplesClientOrpcAuthRoute
|
|
182
|
+
ExamplesIsrRoute: typeof ExamplesIsrRoute
|
|
183
|
+
ExamplesSsrOrpcRoute: typeof ExamplesSsrOrpcRoute
|
|
184
|
+
ExamplesSsrOrpcAuthRoute: typeof ExamplesSsrOrpcAuthRoute
|
|
185
185
|
ApiAuthSplatRoute: typeof ApiAuthSplatRoute
|
|
186
186
|
ApiRpcSplatRoute: typeof ApiRpcSplatRoute
|
|
187
187
|
}
|
|
188
188
|
|
|
189
189
|
declare module '@tanstack/react-router' {
|
|
190
190
|
interface FileRoutesByPath {
|
|
191
|
-
'/ssr-orpc-auth': {
|
|
192
|
-
id: '/ssr-orpc-auth'
|
|
193
|
-
path: '/ssr-orpc-auth'
|
|
194
|
-
fullPath: '/ssr-orpc-auth'
|
|
195
|
-
preLoaderRoute: typeof SsrOrpcAuthRouteImport
|
|
196
|
-
parentRoute: typeof rootRouteImport
|
|
197
|
-
}
|
|
198
|
-
'/ssr-orpc': {
|
|
199
|
-
id: '/ssr-orpc'
|
|
200
|
-
path: '/ssr-orpc'
|
|
201
|
-
fullPath: '/ssr-orpc'
|
|
202
|
-
preLoaderRoute: typeof SsrOrpcRouteImport
|
|
203
|
-
parentRoute: typeof rootRouteImport
|
|
204
|
-
}
|
|
205
191
|
'/signup': {
|
|
206
192
|
id: '/signup'
|
|
207
193
|
path: '/signup'
|
|
@@ -216,13 +202,6 @@ declare module '@tanstack/react-router' {
|
|
|
216
202
|
preLoaderRoute: typeof LoginRouteImport
|
|
217
203
|
parentRoute: typeof rootRouteImport
|
|
218
204
|
}
|
|
219
|
-
'/isr': {
|
|
220
|
-
id: '/isr'
|
|
221
|
-
path: '/isr'
|
|
222
|
-
fullPath: '/isr'
|
|
223
|
-
preLoaderRoute: typeof IsrRouteImport
|
|
224
|
-
parentRoute: typeof rootRouteImport
|
|
225
|
-
}
|
|
226
205
|
'/dashboard': {
|
|
227
206
|
id: '/dashboard'
|
|
228
207
|
path: '/dashboard'
|
|
@@ -230,20 +209,6 @@ declare module '@tanstack/react-router' {
|
|
|
230
209
|
preLoaderRoute: typeof DashboardRouteImport
|
|
231
210
|
parentRoute: typeof rootRouteImport
|
|
232
211
|
}
|
|
233
|
-
'/client-orpc-auth': {
|
|
234
|
-
id: '/client-orpc-auth'
|
|
235
|
-
path: '/client-orpc-auth'
|
|
236
|
-
fullPath: '/client-orpc-auth'
|
|
237
|
-
preLoaderRoute: typeof ClientOrpcAuthRouteImport
|
|
238
|
-
parentRoute: typeof rootRouteImport
|
|
239
|
-
}
|
|
240
|
-
'/client-orpc': {
|
|
241
|
-
id: '/client-orpc'
|
|
242
|
-
path: '/client-orpc'
|
|
243
|
-
fullPath: '/client-orpc'
|
|
244
|
-
preLoaderRoute: typeof ClientOrpcRouteImport
|
|
245
|
-
parentRoute: typeof rootRouteImport
|
|
246
|
-
}
|
|
247
212
|
'/account': {
|
|
248
213
|
id: '/account'
|
|
249
214
|
path: '/account'
|
|
@@ -258,6 +223,41 @@ declare module '@tanstack/react-router' {
|
|
|
258
223
|
preLoaderRoute: typeof IndexRouteImport
|
|
259
224
|
parentRoute: typeof rootRouteImport
|
|
260
225
|
}
|
|
226
|
+
'/examples/ssr-orpc-auth': {
|
|
227
|
+
id: '/examples/ssr-orpc-auth'
|
|
228
|
+
path: '/examples/ssr-orpc-auth'
|
|
229
|
+
fullPath: '/examples/ssr-orpc-auth'
|
|
230
|
+
preLoaderRoute: typeof ExamplesSsrOrpcAuthRouteImport
|
|
231
|
+
parentRoute: typeof rootRouteImport
|
|
232
|
+
}
|
|
233
|
+
'/examples/ssr-orpc': {
|
|
234
|
+
id: '/examples/ssr-orpc'
|
|
235
|
+
path: '/examples/ssr-orpc'
|
|
236
|
+
fullPath: '/examples/ssr-orpc'
|
|
237
|
+
preLoaderRoute: typeof ExamplesSsrOrpcRouteImport
|
|
238
|
+
parentRoute: typeof rootRouteImport
|
|
239
|
+
}
|
|
240
|
+
'/examples/isr': {
|
|
241
|
+
id: '/examples/isr'
|
|
242
|
+
path: '/examples/isr'
|
|
243
|
+
fullPath: '/examples/isr'
|
|
244
|
+
preLoaderRoute: typeof ExamplesIsrRouteImport
|
|
245
|
+
parentRoute: typeof rootRouteImport
|
|
246
|
+
}
|
|
247
|
+
'/examples/client-orpc-auth': {
|
|
248
|
+
id: '/examples/client-orpc-auth'
|
|
249
|
+
path: '/examples/client-orpc-auth'
|
|
250
|
+
fullPath: '/examples/client-orpc-auth'
|
|
251
|
+
preLoaderRoute: typeof ExamplesClientOrpcAuthRouteImport
|
|
252
|
+
parentRoute: typeof rootRouteImport
|
|
253
|
+
}
|
|
254
|
+
'/examples/client-orpc': {
|
|
255
|
+
id: '/examples/client-orpc'
|
|
256
|
+
path: '/examples/client-orpc'
|
|
257
|
+
fullPath: '/examples/client-orpc'
|
|
258
|
+
preLoaderRoute: typeof ExamplesClientOrpcRouteImport
|
|
259
|
+
parentRoute: typeof rootRouteImport
|
|
260
|
+
}
|
|
261
261
|
'/api/rpc/$': {
|
|
262
262
|
id: '/api/rpc/$'
|
|
263
263
|
path: '/api/rpc/$'
|
|
@@ -278,14 +278,14 @@ declare module '@tanstack/react-router' {
|
|
|
278
278
|
const rootRouteChildren: RootRouteChildren = {
|
|
279
279
|
IndexRoute: IndexRoute,
|
|
280
280
|
AccountRoute: AccountRoute,
|
|
281
|
-
ClientOrpcRoute: ClientOrpcRoute,
|
|
282
|
-
ClientOrpcAuthRoute: ClientOrpcAuthRoute,
|
|
283
281
|
DashboardRoute: DashboardRoute,
|
|
284
|
-
IsrRoute: IsrRoute,
|
|
285
282
|
LoginRoute: LoginRoute,
|
|
286
283
|
SignupRoute: SignupRoute,
|
|
287
|
-
|
|
288
|
-
|
|
284
|
+
ExamplesClientOrpcRoute: ExamplesClientOrpcRoute,
|
|
285
|
+
ExamplesClientOrpcAuthRoute: ExamplesClientOrpcAuthRoute,
|
|
286
|
+
ExamplesIsrRoute: ExamplesIsrRoute,
|
|
287
|
+
ExamplesSsrOrpcRoute: ExamplesSsrOrpcRoute,
|
|
288
|
+
ExamplesSsrOrpcAuthRoute: ExamplesSsrOrpcAuthRoute,
|
|
289
289
|
ApiAuthSplatRoute: ApiAuthSplatRoute,
|
|
290
290
|
ApiRpcSplatRoute: ApiRpcSplatRoute,
|
|
291
291
|
}
|
|
@@ -3,14 +3,14 @@ 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("/client-orpc-auth")({
|
|
6
|
+
export const Route = createFileRoute("/examples/client-orpc-auth")({
|
|
7
7
|
beforeLoad: async () => {
|
|
8
8
|
const session = await getSessionFn()
|
|
9
9
|
if (!session) {
|
|
10
10
|
throw redirect({
|
|
11
11
|
to: "/login",
|
|
12
12
|
search: {
|
|
13
|
-
redirect: "/client-orpc-auth",
|
|
13
|
+
redirect: "/examples/client-orpc-auth",
|
|
14
14
|
},
|
|
15
15
|
})
|
|
16
16
|
}
|
|
@@ -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("/client-orpc")({
|
|
32
|
+
export const Route = createFileRoute("/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("/isr")({
|
|
4
|
+
export const Route = createFileRoute("/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
|
|
@@ -2,14 +2,14 @@ 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("/ssr-orpc-auth")({
|
|
5
|
+
export const Route = createFileRoute("/examples/ssr-orpc-auth")({
|
|
6
6
|
beforeLoad: async () => {
|
|
7
7
|
const session = await getSessionFn()
|
|
8
8
|
if (!session) {
|
|
9
9
|
throw redirect({
|
|
10
10
|
to: "/login",
|
|
11
11
|
search: {
|
|
12
|
-
redirect: "/ssr-orpc-auth",
|
|
12
|
+
redirect: "/examples/ssr-orpc-auth",
|
|
13
13
|
},
|
|
14
14
|
})
|
|
15
15
|
}
|
|
@@ -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("/ssr-orpc")({
|
|
30
|
+
export const Route = createFileRoute("/examples/ssr-orpc")({
|
|
31
31
|
loader: async () => {
|
|
32
32
|
const planets = await orpc.planets.getPlanets()
|
|
33
33
|
return { planets }
|
package/template/SKILL.md
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: croissant-stack
|
|
3
|
-
description: Expert guidance for working with the Croissant Stack (TanStack Start, Better Auth, oRPC, Drizzle)
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Croissant Stack
|
|
7
|
-
|
|
8
|
-
This skill provides specialized knowledge and instructions for working within the Croissant Stack repository—a modern, type-safe full-stack monorepo.
|
|
9
|
-
|
|
10
|
-
## When to use
|
|
11
|
-
|
|
12
|
-
Use this skill when performing any task within this repository, including:
|
|
13
|
-
- Developing features in the TanStack Start application (`apps/web`).
|
|
14
|
-
- Managing the database schema or migrations (`packages/db`).
|
|
15
|
-
- Extending the oRPC API (`packages/orpc`).
|
|
16
|
-
- Configuring authentication with Better Auth (`packages/auth`).
|
|
17
|
-
- Creating or modifying shared UI components (`packages/ui`).
|
|
18
|
-
- Using or maintaining the `create-croissant` CLI.
|
|
19
|
-
|
|
20
|
-
## Instructions
|
|
21
|
-
|
|
22
|
-
### 1. Project Architecture
|
|
23
|
-
Understand the monorepo structure powered by **Turborepo**:
|
|
24
|
-
- **`apps/web`**: The main TanStack Start application.
|
|
25
|
-
- **`packages/auth`**: Authentication logic using Better Auth.
|
|
26
|
-
- **`packages/db`**: Database schema and Drizzle client.
|
|
27
|
-
- **`packages/orpc`**: Modular, type-safe API layer.
|
|
28
|
-
- **`packages/ui`**: Shared UI components using shadcn/ui.
|
|
29
|
-
|
|
30
|
-
### 2. Local Development
|
|
31
|
-
- **Install dependencies**: Use `npm install`.
|
|
32
|
-
- **Database setup**: Run `npm run db:up` to start the PostgreSQL container.
|
|
33
|
-
- **Environment variables**: Ensure `.env` exists at the root (copy from `.env.example`).
|
|
34
|
-
- **Push schema**: Run `npm run db:push --filter @workspace/db` after schema changes.
|
|
35
|
-
- **Start dev server**: Run `npm run dev` from the root. The app runs at `http://localhost:3000`.
|
|
36
|
-
|
|
37
|
-
### 3. Working with oRPC
|
|
38
|
-
- API procedures are located in `packages/orpc/src/lib/`.
|
|
39
|
-
- The main router is in `packages/orpc/src/lib/router.ts`.
|
|
40
|
-
- When adding new procedures, follow the modular pattern (e.g., create a new file in `lib/` and import it into the main router).
|
|
41
|
-
|
|
42
|
-
### 4. Database & Schema
|
|
43
|
-
- Define schemas in `packages/db/src/schema.ts` or modular files in `packages/db/src/`.
|
|
44
|
-
- Use Drizzle Kit commands via Turbo: `npm run db:push --filter @workspace/db` or `npm run db:studio --filter @workspace/db`.
|
|
45
|
-
|
|
46
|
-
### 5. UI Components
|
|
47
|
-
- Shared components live in `packages/ui/src/components`.
|
|
48
|
-
- Use the shadcn CLI to add new components: `npx shadcn@latest add [component-name] -c apps/web`. This is configured to place components into the shared package.
|
|
49
|
-
|
|
50
|
-
### 6. Turborepo Commands
|
|
51
|
-
- Use `--filter` to target specific packages: `npm run [command] --filter [package-name]`.
|
|
52
|
-
- Example: `npm run build --filter web` or `npm run lint --filter @workspace/db`.
|
|
53
|
-
|
|
54
|
-
### 7. Creating New Projects
|
|
55
|
-
- The `packages/create-croissant` directory contains the source for the CLI tool.
|
|
56
|
-
- The `template/` directory inside it should be kept in sync with the main repository structure.
|