updated codegen, added client query generation, etc.

This commit is contained in:
lnn0q 2025-03-02 21:11:11 +02:00
parent 864f37a652
commit 9518787206
17 changed files with 5244 additions and 445 deletions

View file

@ -13,12 +13,13 @@ import { createFileRoute } from '@tanstack/react-router'
// Import Routes
import { Route as rootRoute } from './pages/__root'
import { Route as RegisterImport } from './pages/register'
import { Route as LoginImport } from './pages/login'
import { Route as IndexImport } from './pages/index'
// Create Virtual Routes
const BookLazyImport = createFileRoute('/book')()
const AboutLazyImport = createFileRoute('/about')()
const IndexLazyImport = createFileRoute('/')()
// Create/Update Routes
@ -28,17 +29,23 @@ const BookLazyRoute = BookLazyImport.update({
getParentRoute: () => rootRoute,
} as any).lazy(() => import('./pages/book.lazy').then((d) => d.Route))
const AboutLazyRoute = AboutLazyImport.update({
id: '/about',
path: '/about',
const RegisterRoute = RegisterImport.update({
id: '/register',
path: '/register',
getParentRoute: () => rootRoute,
} as any).lazy(() => import('./pages/about.lazy').then((d) => d.Route))
} as any)
const IndexLazyRoute = IndexLazyImport.update({
const LoginRoute = LoginImport.update({
id: '/login',
path: '/login',
getParentRoute: () => rootRoute,
} as any)
const IndexRoute = IndexImport.update({
id: '/',
path: '/',
getParentRoute: () => rootRoute,
} as any).lazy(() => import('./pages/index.lazy').then((d) => d.Route))
} as any)
// Populate the FileRoutesByPath interface
@ -48,14 +55,21 @@ declare module '@tanstack/react-router' {
id: '/'
path: '/'
fullPath: '/'
preLoaderRoute: typeof IndexLazyImport
preLoaderRoute: typeof IndexImport
parentRoute: typeof rootRoute
}
'/about': {
id: '/about'
path: '/about'
fullPath: '/about'
preLoaderRoute: typeof AboutLazyImport
'/login': {
id: '/login'
path: '/login'
fullPath: '/login'
preLoaderRoute: typeof LoginImport
parentRoute: typeof rootRoute
}
'/register': {
id: '/register'
path: '/register'
fullPath: '/register'
preLoaderRoute: typeof RegisterImport
parentRoute: typeof rootRoute
}
'/book': {
@ -71,42 +85,47 @@ declare module '@tanstack/react-router' {
// Create and export the route tree
export interface FileRoutesByFullPath {
'/': typeof IndexLazyRoute
'/about': typeof AboutLazyRoute
'/': typeof IndexRoute
'/login': typeof LoginRoute
'/register': typeof RegisterRoute
'/book': typeof BookLazyRoute
}
export interface FileRoutesByTo {
'/': typeof IndexLazyRoute
'/about': typeof AboutLazyRoute
'/': typeof IndexRoute
'/login': typeof LoginRoute
'/register': typeof RegisterRoute
'/book': typeof BookLazyRoute
}
export interface FileRoutesById {
__root__: typeof rootRoute
'/': typeof IndexLazyRoute
'/about': typeof AboutLazyRoute
'/': typeof IndexRoute
'/login': typeof LoginRoute
'/register': typeof RegisterRoute
'/book': typeof BookLazyRoute
}
export interface FileRouteTypes {
fileRoutesByFullPath: FileRoutesByFullPath
fullPaths: '/' | '/about' | '/book'
fullPaths: '/' | '/login' | '/register' | '/book'
fileRoutesByTo: FileRoutesByTo
to: '/' | '/about' | '/book'
id: '__root__' | '/' | '/about' | '/book'
to: '/' | '/login' | '/register' | '/book'
id: '__root__' | '/' | '/login' | '/register' | '/book'
fileRoutesById: FileRoutesById
}
export interface RootRouteChildren {
IndexLazyRoute: typeof IndexLazyRoute
AboutLazyRoute: typeof AboutLazyRoute
IndexRoute: typeof IndexRoute
LoginRoute: typeof LoginRoute
RegisterRoute: typeof RegisterRoute
BookLazyRoute: typeof BookLazyRoute
}
const rootRouteChildren: RootRouteChildren = {
IndexLazyRoute: IndexLazyRoute,
AboutLazyRoute: AboutLazyRoute,
IndexRoute: IndexRoute,
LoginRoute: LoginRoute,
RegisterRoute: RegisterRoute,
BookLazyRoute: BookLazyRoute,
}
@ -121,15 +140,19 @@ export const routeTree = rootRoute
"filePath": "__root.tsx",
"children": [
"/",
"/about",
"/login",
"/register",
"/book"
]
},
"/": {
"filePath": "index.lazy.tsx"
"filePath": "index.tsx"
},
"/about": {
"filePath": "about.lazy.tsx"
"/login": {
"filePath": "login.tsx"
},
"/register": {
"filePath": "register.tsx"
},
"/book": {
"filePath": "book.lazy.tsx"