wcz-test 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.d.ts +3 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +2 -0
- package/dist/client.d.ts +2 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +7 -0
- package/dist/components/DefaultCatchBoundary.d.ts +3 -0
- package/dist/components/DefaultCatchBoundary.d.ts.map +1 -0
- package/dist/components/DefaultCatchBoundary.js +16 -0
- package/dist/components/MyComponent.d.ts +4 -0
- package/dist/components/MyComponent.d.ts.map +1 -0
- package/dist/components/MyComponent.js +5 -0
- package/dist/components/NotFound.d.ts +4 -0
- package/dist/components/NotFound.d.ts.map +1 -0
- package/dist/components/NotFound.js +5 -0
- package/dist/components/PostError.d.ts +3 -0
- package/dist/components/PostError.d.ts.map +1 -0
- package/dist/components/PostError.js +5 -0
- package/dist/components/UserError.d.ts +3 -0
- package/dist/components/UserError.d.ts.map +1 -0
- package/dist/components/UserError.js +5 -0
- package/dist/global-middleware.d.ts +2 -0
- package/dist/global-middleware.d.ts.map +1 -0
- package/dist/global-middleware.js +5 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/routeTree.gen.d.ts +249 -0
- package/dist/routeTree.gen.d.ts.map +1 -0
- package/dist/routeTree.gen.js +204 -0
- package/dist/router.d.ts +7 -0
- package/dist/router.d.ts.map +1 -0
- package/dist/router.js +15 -0
- package/dist/routes/__root.d.ts +2 -0
- package/dist/routes/__root.d.ts.map +1 -0
- package/dist/routes/__root.js +73 -0
- package/dist/routes/_pathlessLayout/_nested-layout/route-a.d.ts +2 -0
- package/dist/routes/_pathlessLayout/_nested-layout/route-a.d.ts.map +1 -0
- package/dist/routes/_pathlessLayout/_nested-layout/route-a.js +8 -0
- package/dist/routes/_pathlessLayout/_nested-layout/route-b.d.ts +2 -0
- package/dist/routes/_pathlessLayout/_nested-layout/route-b.d.ts.map +1 -0
- package/dist/routes/_pathlessLayout/_nested-layout/route-b.js +8 -0
- package/dist/routes/_pathlessLayout/_nested-layout.d.ts +2 -0
- package/dist/routes/_pathlessLayout/_nested-layout.d.ts.map +1 -0
- package/dist/routes/_pathlessLayout/_nested-layout.js +12 -0
- package/dist/routes/_pathlessLayout.d.ts +2 -0
- package/dist/routes/_pathlessLayout.d.ts.map +1 -0
- package/dist/routes/_pathlessLayout.js +8 -0
- package/dist/routes/api/users.$id.d.ts +5 -0
- package/dist/routes/api/users.$id.d.ts.map +1 -0
- package/dist/routes/api/users.$id.js +20 -0
- package/dist/routes/api/users.d.ts +5 -0
- package/dist/routes/api/users.d.ts.map +1 -0
- package/dist/routes/api/users.js +11 -0
- package/dist/routes/deferred.d.ts +12 -0
- package/dist/routes/deferred.d.ts.map +1 -0
- package/dist/routes/deferred.js +30 -0
- package/dist/routes/index.d.ts +2 -0
- package/dist/routes/index.d.ts.map +1 -0
- package/dist/routes/index.js +8 -0
- package/dist/routes/posts.$postId.d.ts +14 -0
- package/dist/routes/posts.$postId.d.ts.map +1 -0
- package/dist/routes/posts.$postId.js +19 -0
- package/dist/routes/posts.index.d.ts +6 -0
- package/dist/routes/posts.index.d.ts.map +1 -0
- package/dist/routes/posts.index.js +8 -0
- package/dist/routes/posts.route.d.ts +6 -0
- package/dist/routes/posts.route.d.ts.map +1 -0
- package/dist/routes/posts.route.js +15 -0
- package/dist/routes/posts_.$postId.deep.d.ts +6 -0
- package/dist/routes/posts_.$postId.deep.d.ts.map +1 -0
- package/dist/routes/posts_.$postId.deep.js +15 -0
- package/dist/routes/redirect.d.ts +2 -0
- package/dist/routes/redirect.d.ts.map +1 -0
- package/{src/routes/redirect.tsx → dist/routes/redirect.js} +7 -8
- package/dist/routes/users.$userId.d.ts +3 -0
- package/dist/routes/users.$userId.d.ts.map +1 -0
- package/dist/routes/users.$userId.js +25 -0
- package/dist/routes/users.index.d.ts +2 -0
- package/dist/routes/users.index.d.ts.map +1 -0
- package/dist/routes/users.index.js +9 -0
- package/dist/routes/users.route.d.ts +3 -0
- package/dist/routes/users.route.d.ts.map +1 -0
- package/dist/routes/users.route.js +26 -0
- package/dist/ssr.d.ts +3 -0
- package/dist/ssr.d.ts.map +1 -0
- package/dist/ssr.js +8 -0
- package/dist/utils/loggingMiddleware.d.ts +9 -0
- package/dist/utils/loggingMiddleware.d.ts.map +1 -0
- package/dist/utils/loggingMiddleware.js +34 -0
- package/dist/utils/posts.d.ts +8 -0
- package/dist/utils/posts.d.ts.map +1 -0
- package/dist/utils/posts.js +25 -0
- package/dist/utils/seo.d.ts +15 -0
- package/dist/utils/seo.d.ts.map +1 -0
- package/dist/utils/seo.js +22 -0
- package/dist/utils/users.d.ts +7 -0
- package/dist/utils/users.d.ts.map +1 -0
- package/dist/utils/users.js +1 -0
- package/package.json +4 -5
- package/src/api.ts +0 -6
- package/src/client.tsx +0 -8
- package/src/components/DefaultCatchBoundary.tsx +0 -53
- package/src/components/MyComponent.tsx +0 -6
- package/src/components/NotFound.tsx +0 -25
- package/src/components/PostError.tsx +0 -5
- package/src/components/UserError.tsx +0 -5
- package/src/global-middleware.ts +0 -6
- package/src/index.ts +0 -1
- package/src/routeTree.gen.ts +0 -483
- package/src/router.tsx +0 -22
- package/src/routes/__root.tsx +0 -139
- package/src/routes/_pathlessLayout/_nested-layout/route-a.tsx +0 -11
- package/src/routes/_pathlessLayout/_nested-layout/route-b.tsx +0 -11
- package/src/routes/_pathlessLayout/_nested-layout.tsx +0 -34
- package/src/routes/_pathlessLayout.tsx +0 -16
- package/src/routes/api/users.$id.ts +0 -24
- package/src/routes/api/users.ts +0 -17
- package/src/routes/deferred.tsx +0 -62
- package/src/routes/index.tsx +0 -13
- package/src/routes/posts.$postId.tsx +0 -34
- package/src/routes/posts.index.tsx +0 -9
- package/src/routes/posts.route.tsx +0 -38
- package/src/routes/posts_.$postId.deep.tsx +0 -29
- package/src/routes/users.$userId.tsx +0 -33
- package/src/routes/users.index.tsx +0 -10
- package/src/routes/users.route.tsx +0 -48
- package/src/ssr.tsx +0 -13
- package/src/styles/app.css +0 -22
- package/src/utils/loggingMiddleware.tsx +0 -41
- package/src/utils/posts.tsx +0 -36
- package/src/utils/seo.ts +0 -33
- package/src/utils/users.tsx +0 -7
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
// noinspection JSUnusedGlobalSymbols
|
|
4
|
+
// This file was automatically generated by TanStack Router.
|
|
5
|
+
// You should NOT make any changes in this file as it will be overwritten.
|
|
6
|
+
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
|
|
7
|
+
// Import Routes
|
|
8
|
+
import { Route as rootRoute } from './routes/__root';
|
|
9
|
+
import { Route as RedirectImport } from './routes/redirect';
|
|
10
|
+
import { Route as DeferredImport } from './routes/deferred';
|
|
11
|
+
import { Route as PathlessLayoutImport } from './routes/_pathlessLayout';
|
|
12
|
+
import { Route as UsersRouteImport } from './routes/users.route';
|
|
13
|
+
import { Route as PostsRouteImport } from './routes/posts.route';
|
|
14
|
+
import { Route as IndexImport } from './routes/index';
|
|
15
|
+
import { Route as UsersIndexImport } from './routes/users.index';
|
|
16
|
+
import { Route as PostsIndexImport } from './routes/posts.index';
|
|
17
|
+
import { Route as UsersUserIdImport } from './routes/users.$userId';
|
|
18
|
+
import { Route as PostsPostIdImport } from './routes/posts.$postId';
|
|
19
|
+
import { Route as PathlessLayoutNestedLayoutImport } from './routes/_pathlessLayout/_nested-layout';
|
|
20
|
+
import { Route as PostsPostIdDeepImport } from './routes/posts_.$postId.deep';
|
|
21
|
+
import { Route as PathlessLayoutNestedLayoutRouteBImport } from './routes/_pathlessLayout/_nested-layout/route-b';
|
|
22
|
+
import { Route as PathlessLayoutNestedLayoutRouteAImport } from './routes/_pathlessLayout/_nested-layout/route-a';
|
|
23
|
+
// Create/Update Routes
|
|
24
|
+
const RedirectRoute = RedirectImport.update({
|
|
25
|
+
id: '/redirect',
|
|
26
|
+
path: '/redirect',
|
|
27
|
+
getParentRoute: () => rootRoute,
|
|
28
|
+
});
|
|
29
|
+
const DeferredRoute = DeferredImport.update({
|
|
30
|
+
id: '/deferred',
|
|
31
|
+
path: '/deferred',
|
|
32
|
+
getParentRoute: () => rootRoute,
|
|
33
|
+
});
|
|
34
|
+
const PathlessLayoutRoute = PathlessLayoutImport.update({
|
|
35
|
+
id: '/_pathlessLayout',
|
|
36
|
+
getParentRoute: () => rootRoute,
|
|
37
|
+
});
|
|
38
|
+
const UsersRouteRoute = UsersRouteImport.update({
|
|
39
|
+
id: '/users',
|
|
40
|
+
path: '/users',
|
|
41
|
+
getParentRoute: () => rootRoute,
|
|
42
|
+
});
|
|
43
|
+
const PostsRouteRoute = PostsRouteImport.update({
|
|
44
|
+
id: '/posts',
|
|
45
|
+
path: '/posts',
|
|
46
|
+
getParentRoute: () => rootRoute,
|
|
47
|
+
});
|
|
48
|
+
const IndexRoute = IndexImport.update({
|
|
49
|
+
id: '/',
|
|
50
|
+
path: '/',
|
|
51
|
+
getParentRoute: () => rootRoute,
|
|
52
|
+
});
|
|
53
|
+
const UsersIndexRoute = UsersIndexImport.update({
|
|
54
|
+
id: '/',
|
|
55
|
+
path: '/',
|
|
56
|
+
getParentRoute: () => UsersRouteRoute,
|
|
57
|
+
});
|
|
58
|
+
const PostsIndexRoute = PostsIndexImport.update({
|
|
59
|
+
id: '/',
|
|
60
|
+
path: '/',
|
|
61
|
+
getParentRoute: () => PostsRouteRoute,
|
|
62
|
+
});
|
|
63
|
+
const UsersUserIdRoute = UsersUserIdImport.update({
|
|
64
|
+
id: '/$userId',
|
|
65
|
+
path: '/$userId',
|
|
66
|
+
getParentRoute: () => UsersRouteRoute,
|
|
67
|
+
});
|
|
68
|
+
const PostsPostIdRoute = PostsPostIdImport.update({
|
|
69
|
+
id: '/$postId',
|
|
70
|
+
path: '/$postId',
|
|
71
|
+
getParentRoute: () => PostsRouteRoute,
|
|
72
|
+
});
|
|
73
|
+
const PathlessLayoutNestedLayoutRoute = PathlessLayoutNestedLayoutImport.update({
|
|
74
|
+
id: '/_nested-layout',
|
|
75
|
+
getParentRoute: () => PathlessLayoutRoute,
|
|
76
|
+
});
|
|
77
|
+
const PostsPostIdDeepRoute = PostsPostIdDeepImport.update({
|
|
78
|
+
id: '/posts_/$postId/deep',
|
|
79
|
+
path: '/posts/$postId/deep',
|
|
80
|
+
getParentRoute: () => rootRoute,
|
|
81
|
+
});
|
|
82
|
+
const PathlessLayoutNestedLayoutRouteBRoute = PathlessLayoutNestedLayoutRouteBImport.update({
|
|
83
|
+
id: '/route-b',
|
|
84
|
+
path: '/route-b',
|
|
85
|
+
getParentRoute: () => PathlessLayoutNestedLayoutRoute,
|
|
86
|
+
});
|
|
87
|
+
const PathlessLayoutNestedLayoutRouteARoute = PathlessLayoutNestedLayoutRouteAImport.update({
|
|
88
|
+
id: '/route-a',
|
|
89
|
+
path: '/route-a',
|
|
90
|
+
getParentRoute: () => PathlessLayoutNestedLayoutRoute,
|
|
91
|
+
});
|
|
92
|
+
const PostsRouteRouteChildren = {
|
|
93
|
+
PostsPostIdRoute: PostsPostIdRoute,
|
|
94
|
+
PostsIndexRoute: PostsIndexRoute,
|
|
95
|
+
};
|
|
96
|
+
const PostsRouteRouteWithChildren = PostsRouteRoute._addFileChildren(PostsRouteRouteChildren);
|
|
97
|
+
const UsersRouteRouteChildren = {
|
|
98
|
+
UsersUserIdRoute: UsersUserIdRoute,
|
|
99
|
+
UsersIndexRoute: UsersIndexRoute,
|
|
100
|
+
};
|
|
101
|
+
const UsersRouteRouteWithChildren = UsersRouteRoute._addFileChildren(UsersRouteRouteChildren);
|
|
102
|
+
const PathlessLayoutNestedLayoutRouteChildren = {
|
|
103
|
+
PathlessLayoutNestedLayoutRouteARoute: PathlessLayoutNestedLayoutRouteARoute,
|
|
104
|
+
PathlessLayoutNestedLayoutRouteBRoute: PathlessLayoutNestedLayoutRouteBRoute,
|
|
105
|
+
};
|
|
106
|
+
const PathlessLayoutNestedLayoutRouteWithChildren = PathlessLayoutNestedLayoutRoute._addFileChildren(PathlessLayoutNestedLayoutRouteChildren);
|
|
107
|
+
const PathlessLayoutRouteChildren = {
|
|
108
|
+
PathlessLayoutNestedLayoutRoute: PathlessLayoutNestedLayoutRouteWithChildren,
|
|
109
|
+
};
|
|
110
|
+
const PathlessLayoutRouteWithChildren = PathlessLayoutRoute._addFileChildren(PathlessLayoutRouteChildren);
|
|
111
|
+
const rootRouteChildren = {
|
|
112
|
+
IndexRoute: IndexRoute,
|
|
113
|
+
PostsRouteRoute: PostsRouteRouteWithChildren,
|
|
114
|
+
UsersRouteRoute: UsersRouteRouteWithChildren,
|
|
115
|
+
PathlessLayoutRoute: PathlessLayoutRouteWithChildren,
|
|
116
|
+
DeferredRoute: DeferredRoute,
|
|
117
|
+
RedirectRoute: RedirectRoute,
|
|
118
|
+
PostsPostIdDeepRoute: PostsPostIdDeepRoute,
|
|
119
|
+
};
|
|
120
|
+
export const routeTree = rootRoute
|
|
121
|
+
._addFileChildren(rootRouteChildren)
|
|
122
|
+
._addFileTypes();
|
|
123
|
+
/* ROUTE_MANIFEST_START
|
|
124
|
+
{
|
|
125
|
+
"routes": {
|
|
126
|
+
"__root__": {
|
|
127
|
+
"filePath": "__root.tsx",
|
|
128
|
+
"children": [
|
|
129
|
+
"/",
|
|
130
|
+
"/posts",
|
|
131
|
+
"/users",
|
|
132
|
+
"/_pathlessLayout",
|
|
133
|
+
"/deferred",
|
|
134
|
+
"/redirect",
|
|
135
|
+
"/posts_/$postId/deep"
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
"/": {
|
|
139
|
+
"filePath": "index.tsx"
|
|
140
|
+
},
|
|
141
|
+
"/posts": {
|
|
142
|
+
"filePath": "posts.route.tsx",
|
|
143
|
+
"children": [
|
|
144
|
+
"/posts/$postId",
|
|
145
|
+
"/posts/"
|
|
146
|
+
]
|
|
147
|
+
},
|
|
148
|
+
"/users": {
|
|
149
|
+
"filePath": "users.route.tsx",
|
|
150
|
+
"children": [
|
|
151
|
+
"/users/$userId",
|
|
152
|
+
"/users/"
|
|
153
|
+
]
|
|
154
|
+
},
|
|
155
|
+
"/_pathlessLayout": {
|
|
156
|
+
"filePath": "_pathlessLayout.tsx",
|
|
157
|
+
"children": [
|
|
158
|
+
"/_pathlessLayout/_nested-layout"
|
|
159
|
+
]
|
|
160
|
+
},
|
|
161
|
+
"/deferred": {
|
|
162
|
+
"filePath": "deferred.tsx"
|
|
163
|
+
},
|
|
164
|
+
"/redirect": {
|
|
165
|
+
"filePath": "redirect.tsx"
|
|
166
|
+
},
|
|
167
|
+
"/_pathlessLayout/_nested-layout": {
|
|
168
|
+
"filePath": "_pathlessLayout/_nested-layout.tsx",
|
|
169
|
+
"parent": "/_pathlessLayout",
|
|
170
|
+
"children": [
|
|
171
|
+
"/_pathlessLayout/_nested-layout/route-a",
|
|
172
|
+
"/_pathlessLayout/_nested-layout/route-b"
|
|
173
|
+
]
|
|
174
|
+
},
|
|
175
|
+
"/posts/$postId": {
|
|
176
|
+
"filePath": "posts.$postId.tsx",
|
|
177
|
+
"parent": "/posts"
|
|
178
|
+
},
|
|
179
|
+
"/users/$userId": {
|
|
180
|
+
"filePath": "users.$userId.tsx",
|
|
181
|
+
"parent": "/users"
|
|
182
|
+
},
|
|
183
|
+
"/posts/": {
|
|
184
|
+
"filePath": "posts.index.tsx",
|
|
185
|
+
"parent": "/posts"
|
|
186
|
+
},
|
|
187
|
+
"/users/": {
|
|
188
|
+
"filePath": "users.index.tsx",
|
|
189
|
+
"parent": "/users"
|
|
190
|
+
},
|
|
191
|
+
"/_pathlessLayout/_nested-layout/route-a": {
|
|
192
|
+
"filePath": "_pathlessLayout/_nested-layout/route-a.tsx",
|
|
193
|
+
"parent": "/_pathlessLayout/_nested-layout"
|
|
194
|
+
},
|
|
195
|
+
"/_pathlessLayout/_nested-layout/route-b": {
|
|
196
|
+
"filePath": "_pathlessLayout/_nested-layout/route-b.tsx",
|
|
197
|
+
"parent": "/_pathlessLayout/_nested-layout"
|
|
198
|
+
},
|
|
199
|
+
"/posts_/$postId/deep": {
|
|
200
|
+
"filePath": "posts_.$postId.deep.tsx"
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
ROUTE_MANIFEST_END */
|
package/dist/router.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function createRouter(): import("@tanstack/router-core").RouterCore<import("@tanstack/router-core").Route<any, "/", "/", string, "__root__", undefined, {}, {}, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, import("./routeTree.gen").RootRouteChildren, import("./routeTree.gen").FileRouteTypes>, "never", false, import("@tanstack/history").RouterHistory, Record<string, any>>;
|
|
2
|
+
declare module '@tanstack/react-router' {
|
|
3
|
+
interface Register {
|
|
4
|
+
router: ReturnType<typeof createRouter>;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=router.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../src/router.tsx"],"names":[],"mappings":"AAKA,wBAAgB,YAAY,0ZAU3B;AAED,OAAO,QAAQ,wBAAwB,CAAC;IACtC,UAAU,QAAQ;QAChB,MAAM,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,CAAA;KACxC;CACF"}
|
package/dist/router.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createRouter as createTanStackRouter } from '@tanstack/react-router';
|
|
3
|
+
import { routeTree } from './routeTree.gen';
|
|
4
|
+
import { DefaultCatchBoundary } from './components/DefaultCatchBoundary';
|
|
5
|
+
import { NotFound } from './components/NotFound';
|
|
6
|
+
export function createRouter() {
|
|
7
|
+
const router = createTanStackRouter({
|
|
8
|
+
routeTree,
|
|
9
|
+
defaultPreload: 'intent',
|
|
10
|
+
defaultErrorComponent: DefaultCatchBoundary,
|
|
11
|
+
defaultNotFoundComponent: () => _jsx(NotFound, {}),
|
|
12
|
+
scrollRestoration: true,
|
|
13
|
+
});
|
|
14
|
+
return router;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"__root.d.ts","sourceRoot":"","sources":["../../src/routes/__root.tsx"],"names":[],"mappings":"AAcA,eAAO,MAAM,KAAK,oLAgDhB,CAAA"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { HeadContent, Link, Outlet, Scripts, createRootRoute, } from '@tanstack/react-router';
|
|
3
|
+
import { TanStackRouterDevtools } from '@tanstack/react-router-devtools';
|
|
4
|
+
import { DefaultCatchBoundary } from '~/components/DefaultCatchBoundary';
|
|
5
|
+
import { NotFound } from '~/components/NotFound';
|
|
6
|
+
import appCss from '~/styles/app.css?url';
|
|
7
|
+
import { seo } from '~/utils/seo';
|
|
8
|
+
export const Route = createRootRoute({
|
|
9
|
+
head: () => ({
|
|
10
|
+
meta: [
|
|
11
|
+
{
|
|
12
|
+
charSet: 'utf-8',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: 'viewport',
|
|
16
|
+
content: 'width=device-width, initial-scale=1',
|
|
17
|
+
},
|
|
18
|
+
...seo({
|
|
19
|
+
title: 'TanStack Start | Type-Safe, Client-First, Full-Stack React Framework',
|
|
20
|
+
description: `TanStack Start is a type-safe, client-first, full-stack React framework. `,
|
|
21
|
+
}),
|
|
22
|
+
],
|
|
23
|
+
links: [
|
|
24
|
+
{ rel: 'stylesheet', href: appCss },
|
|
25
|
+
{
|
|
26
|
+
rel: 'apple-touch-icon',
|
|
27
|
+
sizes: '180x180',
|
|
28
|
+
href: '/apple-touch-icon.png',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
rel: 'icon',
|
|
32
|
+
type: 'image/png',
|
|
33
|
+
sizes: '32x32',
|
|
34
|
+
href: '/favicon-32x32.png',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
rel: 'icon',
|
|
38
|
+
type: 'image/png',
|
|
39
|
+
sizes: '16x16',
|
|
40
|
+
href: '/favicon-16x16.png',
|
|
41
|
+
},
|
|
42
|
+
{ rel: 'manifest', href: '/site.webmanifest', color: '#fffff' },
|
|
43
|
+
{ rel: 'icon', href: '/favicon.ico' },
|
|
44
|
+
],
|
|
45
|
+
}),
|
|
46
|
+
errorComponent: (props) => {
|
|
47
|
+
return (_jsx(RootDocument, { children: _jsx(DefaultCatchBoundary, { ...props }) }));
|
|
48
|
+
},
|
|
49
|
+
notFoundComponent: () => _jsx(NotFound, {}),
|
|
50
|
+
component: RootComponent,
|
|
51
|
+
});
|
|
52
|
+
function RootComponent() {
|
|
53
|
+
return (_jsx(RootDocument, { children: _jsx(Outlet, {}) }));
|
|
54
|
+
}
|
|
55
|
+
function RootDocument({ children }) {
|
|
56
|
+
return (_jsxs("html", { children: [_jsx("head", { children: _jsx(HeadContent, {}) }), _jsxs("body", { children: [_jsxs("div", { className: "p-2 flex gap-2 text-lg", children: [_jsx(Link, { to: "/", activeProps: {
|
|
57
|
+
className: 'font-bold',
|
|
58
|
+
}, activeOptions: { exact: true }, children: "Home" }), ' ', _jsx(Link, { to: "/posts", activeProps: {
|
|
59
|
+
className: 'font-bold',
|
|
60
|
+
}, children: "Posts" }), ' ', _jsx(Link, { to: "/users", activeProps: {
|
|
61
|
+
className: 'font-bold',
|
|
62
|
+
}, children: "Users" }), ' ', _jsx(Link, { to: "/route-a", activeProps: {
|
|
63
|
+
className: 'font-bold',
|
|
64
|
+
}, children: "Pathless Layout" }), ' ', _jsx(Link, { to: "/deferred", activeProps: {
|
|
65
|
+
className: 'font-bold',
|
|
66
|
+
}, children: "Deferred" }), ' ', _jsx(Link
|
|
67
|
+
// @ts-expect-error
|
|
68
|
+
, {
|
|
69
|
+
// @ts-expect-error
|
|
70
|
+
to: "/this-route-does-not-exist", activeProps: {
|
|
71
|
+
className: 'font-bold',
|
|
72
|
+
}, children: "This Route Does Not Exist" })] }), _jsx("hr", {}), children, _jsx(TanStackRouterDevtools, { position: "bottom-right" }), _jsx(Scripts, {})] })] }));
|
|
73
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const Route: import("@tanstack/router-core").Route<import("@tanstack/router-core").Route<import("@tanstack/router-core").Route<import("@tanstack/react-router").RootRoute<undefined, {}, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown>, "", "", "/_pathlessLayout", "/_pathlessLayout", undefined, Record<never, string>, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown>, "", "", "/_pathlessLayout/_nested-layout", "/_pathlessLayout/_nested-layout", undefined, Record<never, string>, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown>, "/route-a", "/route-a", "/_pathlessLayout/_nested-layout/route-a", "/_pathlessLayout/_nested-layout/route-a", undefined, Record<never, string>, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown>;
|
|
2
|
+
//# sourceMappingURL=route-a.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route-a.d.ts","sourceRoot":"","sources":["../../../../src/routes/_pathlessLayout/_nested-layout/route-a.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,0mCAIjB,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createFileRoute } from '@tanstack/react-router';
|
|
3
|
+
export const Route = createFileRoute('/_pathlessLayout/_nested-layout/route-a')({
|
|
4
|
+
component: LayoutAComponent,
|
|
5
|
+
});
|
|
6
|
+
function LayoutAComponent() {
|
|
7
|
+
return _jsx("div", { children: "I'm A!" });
|
|
8
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const Route: import("@tanstack/router-core").Route<import("@tanstack/router-core").Route<import("@tanstack/router-core").Route<import("@tanstack/react-router").RootRoute<undefined, {}, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown>, "", "", "/_pathlessLayout", "/_pathlessLayout", undefined, Record<never, string>, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown>, "", "", "/_pathlessLayout/_nested-layout", "/_pathlessLayout/_nested-layout", undefined, Record<never, string>, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown>, "/route-b", "/route-b", "/_pathlessLayout/_nested-layout/route-b", "/_pathlessLayout/_nested-layout/route-b", undefined, Record<never, string>, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown>;
|
|
2
|
+
//# sourceMappingURL=route-b.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route-b.d.ts","sourceRoot":"","sources":["../../../../src/routes/_pathlessLayout/_nested-layout/route-b.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,0mCAIjB,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createFileRoute } from '@tanstack/react-router';
|
|
3
|
+
export const Route = createFileRoute('/_pathlessLayout/_nested-layout/route-b')({
|
|
4
|
+
component: LayoutBComponent,
|
|
5
|
+
});
|
|
6
|
+
function LayoutBComponent() {
|
|
7
|
+
return _jsx("div", { children: "I'm B!" });
|
|
8
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const Route: import("@tanstack/router-core").Route<import("@tanstack/router-core").Route<import("@tanstack/react-router").RootRoute<undefined, {}, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown>, "", "", "/_pathlessLayout", "/_pathlessLayout", undefined, Record<never, string>, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown>, "", "", "/_pathlessLayout/_nested-layout", "/_pathlessLayout/_nested-layout", undefined, Record<never, string>, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown>;
|
|
2
|
+
//# sourceMappingURL=_nested-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_nested-layout.d.ts","sourceRoot":"","sources":["../../../src/routes/_pathlessLayout/_nested-layout.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,8wBAEhB,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Link, Outlet, createFileRoute } from '@tanstack/react-router';
|
|
3
|
+
export const Route = createFileRoute('/_pathlessLayout/_nested-layout')({
|
|
4
|
+
component: LayoutComponent,
|
|
5
|
+
});
|
|
6
|
+
function LayoutComponent() {
|
|
7
|
+
return (_jsxs("div", { children: [_jsx("div", { children: "I'm a nested layout" }), _jsxs("div", { className: "flex gap-2 border-b", children: [_jsx(Link, { to: "/route-a", activeProps: {
|
|
8
|
+
className: 'font-bold',
|
|
9
|
+
}, children: "Go to route A" }), _jsx(Link, { to: "/route-b", activeProps: {
|
|
10
|
+
className: 'font-bold',
|
|
11
|
+
}, children: "Go to route B" })] }), _jsx("div", { children: _jsx(Outlet, {}) })] }));
|
|
12
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const Route: import("@tanstack/router-core").Route<import("@tanstack/react-router").RootRoute<undefined, {}, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown>, "", "", "/_pathlessLayout", "/_pathlessLayout", undefined, Record<never, string>, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown>;
|
|
2
|
+
//# sourceMappingURL=_pathlessLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_pathlessLayout.d.ts","sourceRoot":"","sources":["../../src/routes/_pathlessLayout.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,kdAEhB,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Outlet, createFileRoute } from '@tanstack/react-router';
|
|
3
|
+
export const Route = createFileRoute('/_pathlessLayout')({
|
|
4
|
+
component: LayoutComponent,
|
|
5
|
+
});
|
|
6
|
+
function LayoutComponent() {
|
|
7
|
+
return (_jsxs("div", { className: "p-2", children: [_jsx("div", { className: "border-b", children: "I'm a layout" }), _jsx("div", { children: _jsx(Outlet, {}) })] }));
|
|
8
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const APIRoute: {
|
|
2
|
+
path: "/api/users/$id";
|
|
3
|
+
methods: Partial<Record<"GET" | "POST" | "HEAD" | "PATCH" | "PUT" | "DELETE" | "OPTIONS", import("@tanstack/start-api-routes").StartAPIMethodCallback<"/api/users/$id">>>;
|
|
4
|
+
};
|
|
5
|
+
//# sourceMappingURL=users.$id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"users.$id.d.ts","sourceRoot":"","sources":["../../../src/routes/api/users.$id.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,QAAQ;;;CAkBnB,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { json } from '@tanstack/react-start';
|
|
2
|
+
import { createAPIFileRoute } from '@tanstack/react-start/api';
|
|
3
|
+
import axios from 'redaxios';
|
|
4
|
+
export const APIRoute = createAPIFileRoute('/api/users/$id')({
|
|
5
|
+
GET: async ({ request, params }) => {
|
|
6
|
+
console.info(`Fetching users by id=${params.id}... @`, request.url);
|
|
7
|
+
try {
|
|
8
|
+
const res = await axios.get('https://jsonplaceholder.typicode.com/users/' + params.id);
|
|
9
|
+
return json({
|
|
10
|
+
id: res.data.id,
|
|
11
|
+
name: res.data.name,
|
|
12
|
+
email: res.data.email,
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
catch (e) {
|
|
16
|
+
console.error(e);
|
|
17
|
+
return json({ error: 'User not found' }, { status: 404 });
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../src/routes/api/users.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,QAAQ;;;CAWnB,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { json } from '@tanstack/react-start';
|
|
2
|
+
import { createAPIFileRoute } from '@tanstack/react-start/api';
|
|
3
|
+
import axios from 'redaxios';
|
|
4
|
+
export const APIRoute = createAPIFileRoute('/api/users')({
|
|
5
|
+
GET: async ({ request }) => {
|
|
6
|
+
console.info('Fetching users... @', request.url);
|
|
7
|
+
const res = await axios.get('https://jsonplaceholder.typicode.com/users');
|
|
8
|
+
const list = res.data.slice(0, 10);
|
|
9
|
+
return json(list.map((u) => ({ id: u.id, name: u.name, email: u.email })));
|
|
10
|
+
},
|
|
11
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const Route: import("@tanstack/router-core").Route<import("@tanstack/react-router").RootRoute<undefined, {}, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown>, "/deferred", "/deferred", "/deferred", "/deferred", undefined, Record<never, string>, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, () => Promise<{
|
|
2
|
+
deferredStuff: Promise<string>;
|
|
3
|
+
deferredPerson: Promise<{
|
|
4
|
+
name: string;
|
|
5
|
+
randomNumber: number;
|
|
6
|
+
}>;
|
|
7
|
+
person: {
|
|
8
|
+
name: string;
|
|
9
|
+
randomNumber: number;
|
|
10
|
+
};
|
|
11
|
+
}>, unknown, unknown>;
|
|
12
|
+
//# sourceMappingURL=deferred.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deferred.d.ts","sourceRoot":"","sources":["../../src/routes/deferred.tsx"],"names":[],"mappings":"AAiBA,eAAO,MAAM,KAAK;;;;;;;;;;qBAWhB,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Await, createFileRoute } from '@tanstack/react-router';
|
|
3
|
+
import { createServerFn } from '@tanstack/react-start';
|
|
4
|
+
import { Suspense, useState } from 'react';
|
|
5
|
+
const personServerFn = createServerFn({ method: 'GET' })
|
|
6
|
+
.validator((d) => d)
|
|
7
|
+
.handler(({ data: name }) => {
|
|
8
|
+
return { name, randomNumber: Math.floor(Math.random() * 100) };
|
|
9
|
+
});
|
|
10
|
+
const slowServerFn = createServerFn({ method: 'GET' })
|
|
11
|
+
.validator((d) => d)
|
|
12
|
+
.handler(async ({ data: name }) => {
|
|
13
|
+
await new Promise((r) => setTimeout(r, 1000));
|
|
14
|
+
return { name, randomNumber: Math.floor(Math.random() * 100) };
|
|
15
|
+
});
|
|
16
|
+
export const Route = createFileRoute('/deferred')({
|
|
17
|
+
loader: async () => {
|
|
18
|
+
return {
|
|
19
|
+
deferredStuff: new Promise((r) => setTimeout(() => r('Hello deferred!'), 2000)),
|
|
20
|
+
deferredPerson: slowServerFn({ data: 'Tanner Linsley' }),
|
|
21
|
+
person: await personServerFn({ data: 'John Doe' }),
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
component: Deferred,
|
|
25
|
+
});
|
|
26
|
+
function Deferred() {
|
|
27
|
+
const [count, setCount] = useState(0);
|
|
28
|
+
const { deferredStuff, deferredPerson, person } = Route.useLoaderData();
|
|
29
|
+
return (_jsxs("div", { className: "p-2", children: [_jsxs("div", { "data-testid": "regular-person", children: [person.name, " - ", person.randomNumber] }), _jsx(Suspense, { fallback: _jsx("div", { children: "Loading person..." }), children: _jsx(Await, { promise: deferredPerson, children: (data) => (_jsxs("div", { "data-testid": "deferred-person", children: [data.name, " - ", data.randomNumber] })) }) }), _jsx(Suspense, { fallback: _jsx("div", { children: "Loading stuff..." }), children: _jsx(Await, { promise: deferredStuff, children: (data) => _jsx("h3", { "data-testid": "deferred-stuff", children: data }) }) }), _jsxs("div", { children: ["Count: ", count] }), _jsx("div", { children: _jsx("button", { onClick: () => setCount(count + 1), children: "Increment" }) })] }));
|
|
30
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const Route: import("@tanstack/router-core").Route<import("@tanstack/react-router").RootRoute<undefined, {}, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown>, "/", "/", "/", "/", undefined, Record<never, string>, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown>;
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/routes/index.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,sbAEhB,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createFileRoute } from '@tanstack/react-router';
|
|
3
|
+
export const Route = createFileRoute('/')({
|
|
4
|
+
component: Home,
|
|
5
|
+
});
|
|
6
|
+
function Home() {
|
|
7
|
+
return (_jsx("div", { className: "p-2", children: _jsx("h3", { children: "Welcome Home!!!" }) }));
|
|
8
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const Route: import("@tanstack/router-core").Route<import("@tanstack/router-core").Route<import("@tanstack/react-router").RootRoute<undefined, {}, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown>, "/posts", "/posts", "/posts", "/posts", undefined, Record<never, string>, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, () => Promise<{
|
|
2
|
+
id: string;
|
|
3
|
+
title: string;
|
|
4
|
+
body: string;
|
|
5
|
+
}[]>, unknown, unknown>, "/$postId", "/posts/$postId", "/posts/$postId", "/posts/$postId", undefined, Record<"postId", string>, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, ({ params: { postId } }: import("@tanstack/router-core").LoaderFnContext<import("@tanstack/router-core").Route<import("@tanstack/react-router").RootRoute<undefined, {}, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown>, "/posts", "/posts", "/posts", "/posts", undefined, Record<never, string>, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, () => Promise<{
|
|
6
|
+
id: string;
|
|
7
|
+
title: string;
|
|
8
|
+
body: string;
|
|
9
|
+
}[]>, unknown, unknown>, "/posts/$postId", Record<"postId", string>, {}, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext>) => Promise<{
|
|
10
|
+
id: string;
|
|
11
|
+
title: string;
|
|
12
|
+
body: string;
|
|
13
|
+
}>, unknown, unknown>;
|
|
14
|
+
//# sourceMappingURL=posts.$postId.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"posts.$postId.d.ts","sourceRoot":"","sources":["../../src/routes/posts.$postId.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,KAAK;;;;;;;;;;;;qBAOhB,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Link, createFileRoute } from '@tanstack/react-router';
|
|
3
|
+
import { fetchPost } from '../utils/posts';
|
|
4
|
+
import { NotFound } from '~/components/NotFound';
|
|
5
|
+
import { PostErrorComponent } from '~/components/PostError';
|
|
6
|
+
export const Route = createFileRoute('/posts/$postId')({
|
|
7
|
+
loader: ({ params: { postId } }) => fetchPost({ data: postId }),
|
|
8
|
+
errorComponent: PostErrorComponent,
|
|
9
|
+
component: PostComponent,
|
|
10
|
+
notFoundComponent: () => {
|
|
11
|
+
return _jsx(NotFound, { children: "Post not found" });
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
function PostComponent() {
|
|
15
|
+
const post = Route.useLoaderData();
|
|
16
|
+
return (_jsxs("div", { className: "space-y-2", children: [_jsx("h4", { className: "text-xl font-bold underline", children: post.title }), _jsx("div", { className: "text-sm", children: post.body }), _jsx(Link, { to: "/posts/$postId/deep", params: {
|
|
17
|
+
postId: post.id,
|
|
18
|
+
}, activeProps: { className: 'text-black font-bold' }, className: "block py-1 text-blue-800 hover:text-blue-600", children: "Deep View" })] }));
|
|
19
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const Route: import("@tanstack/router-core").Route<import("@tanstack/router-core").Route<import("@tanstack/react-router").RootRoute<undefined, {}, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown>, "/posts", "/posts", "/posts", "/posts", undefined, Record<never, string>, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, () => Promise<{
|
|
2
|
+
id: string;
|
|
3
|
+
title: string;
|
|
4
|
+
body: string;
|
|
5
|
+
}[]>, unknown, unknown>, "/", "/posts/", "/posts/", "/posts/", undefined, Record<never, string>, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown>;
|
|
6
|
+
//# sourceMappingURL=posts.index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"posts.index.d.ts","sourceRoot":"","sources":["../../src/routes/posts.index.tsx"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK;;;;qQAEhB,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createFileRoute } from '@tanstack/react-router';
|
|
3
|
+
export const Route = createFileRoute('/posts/')({
|
|
4
|
+
component: PostsIndexComponent,
|
|
5
|
+
});
|
|
6
|
+
function PostsIndexComponent() {
|
|
7
|
+
return _jsx("div", { children: "Select a post." });
|
|
8
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const Route: import("@tanstack/router-core").Route<import("@tanstack/react-router").RootRoute<undefined, {}, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown>, "/posts", "/posts", "/posts", "/posts", undefined, Record<never, string>, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, () => Promise<{
|
|
2
|
+
id: string;
|
|
3
|
+
title: string;
|
|
4
|
+
body: string;
|
|
5
|
+
}[]>, unknown, unknown>;
|
|
6
|
+
//# sourceMappingURL=posts.route.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"posts.route.d.ts","sourceRoot":"","sources":["../../src/routes/posts.route.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,KAAK;;;;uBAGhB,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Link, Outlet, createFileRoute } from '@tanstack/react-router';
|
|
3
|
+
import { fetchPosts } from '../utils/posts';
|
|
4
|
+
export const Route = createFileRoute('/posts')({
|
|
5
|
+
loader: async () => fetchPosts(),
|
|
6
|
+
component: PostsLayoutComponent,
|
|
7
|
+
});
|
|
8
|
+
function PostsLayoutComponent() {
|
|
9
|
+
const posts = Route.useLoaderData();
|
|
10
|
+
return (_jsxs("div", { className: "p-2 flex gap-2", children: [_jsx("ul", { className: "list-disc pl-4", children: [...posts, { id: 'i-do-not-exist', title: 'Non-existent Post' }].map((post) => {
|
|
11
|
+
return (_jsx("li", { className: "whitespace-nowrap", children: _jsx(Link, { to: "/posts/$postId", params: {
|
|
12
|
+
postId: post.id,
|
|
13
|
+
}, className: "block py-1 text-blue-800 hover:text-blue-600", activeProps: { className: 'text-black font-bold' }, children: _jsx("div", { children: post.title.substring(0, 20) }) }) }, post.id));
|
|
14
|
+
}) }), _jsx("hr", {}), _jsx(Outlet, {})] }));
|
|
15
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const Route: import("@tanstack/router-core").Route<import("@tanstack/react-router").RootRoute<undefined, {}, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown>, "/posts/$postId/deep", "/posts/$postId/deep", "/posts_/$postId/deep", "/posts_/$postId/deep", undefined, Record<"postId", string>, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, ({ params: { postId } }: import("@tanstack/router-core").LoaderFnContext<import("@tanstack/react-router").RootRoute<undefined, {}, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, {}, undefined, unknown, unknown>, "/posts_/$postId/deep", Record<"postId", string>, {}, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext, import("@tanstack/router-core").AnyContext>) => Promise<{
|
|
2
|
+
id: string;
|
|
3
|
+
title: string;
|
|
4
|
+
body: string;
|
|
5
|
+
}>, unknown, unknown>;
|
|
6
|
+
//# sourceMappingURL=posts_.$postId.deep.d.ts.map
|