refactor(frontend): moved types to global types and successfull build

This commit is contained in:
2025-03-03 06:32:46 -06:00
parent 89a2b3ea9e
commit f3b92e94e3
11 changed files with 91 additions and 50 deletions

View File

@@ -19,6 +19,7 @@ import { Route as IndexImport } from './routes/index'
import { Route as OcpIndexImport } from './routes/ocp/index'
import { Route as OcpLotsImport } from './routes/ocp/lots'
import { Route as AuthProfileImport } from './routes/_auth/profile'
import { Route as AdminModulesImport } from './routes/_admin/modules'
// Create/Update Routes
@@ -68,6 +69,12 @@ const AuthProfileRoute = AuthProfileImport.update({
getParentRoute: () => AuthRoute,
} as any)
const AdminModulesRoute = AdminModulesImport.update({
id: '/modules',
path: '/modules',
getParentRoute: () => AdminRoute,
} as any)
// Populate the FileRoutesByPath interface
declare module '@tanstack/react-router' {
@@ -107,6 +114,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof LoginImport
parentRoute: typeof rootRoute
}
'/_admin/modules': {
id: '/_admin/modules'
path: '/modules'
fullPath: '/modules'
preLoaderRoute: typeof AdminModulesImport
parentRoute: typeof AdminImport
}
'/_auth/profile': {
id: '/_auth/profile'
path: '/profile'
@@ -133,6 +147,16 @@ declare module '@tanstack/react-router' {
// Create and export the route tree
interface AdminRouteChildren {
AdminModulesRoute: typeof AdminModulesRoute
}
const AdminRouteChildren: AdminRouteChildren = {
AdminModulesRoute: AdminModulesRoute,
}
const AdminRouteWithChildren = AdminRoute._addFileChildren(AdminRouteChildren)
interface AuthRouteChildren {
AuthProfileRoute: typeof AuthProfileRoute
}
@@ -148,6 +172,7 @@ export interface FileRoutesByFullPath {
'': typeof AuthRouteWithChildren
'/about': typeof AboutRoute
'/login': typeof LoginRoute
'/modules': typeof AdminModulesRoute
'/profile': typeof AuthProfileRoute
'/ocp/lots': typeof OcpLotsRoute
'/ocp': typeof OcpIndexRoute
@@ -158,6 +183,7 @@ export interface FileRoutesByTo {
'': typeof AuthRouteWithChildren
'/about': typeof AboutRoute
'/login': typeof LoginRoute
'/modules': typeof AdminModulesRoute
'/profile': typeof AuthProfileRoute
'/ocp/lots': typeof OcpLotsRoute
'/ocp': typeof OcpIndexRoute
@@ -166,10 +192,11 @@ export interface FileRoutesByTo {
export interface FileRoutesById {
__root__: typeof rootRoute
'/': typeof IndexRoute
'/_admin': typeof AdminRoute
'/_admin': typeof AdminRouteWithChildren
'/_auth': typeof AuthRouteWithChildren
'/about': typeof AboutRoute
'/login': typeof LoginRoute
'/_admin/modules': typeof AdminModulesRoute
'/_auth/profile': typeof AuthProfileRoute
'/ocp/lots': typeof OcpLotsRoute
'/ocp/': typeof OcpIndexRoute
@@ -177,9 +204,25 @@ export interface FileRoutesById {
export interface FileRouteTypes {
fileRoutesByFullPath: FileRoutesByFullPath
fullPaths: '/' | '' | '/about' | '/login' | '/profile' | '/ocp/lots' | '/ocp'
fullPaths:
| '/'
| ''
| '/about'
| '/login'
| '/modules'
| '/profile'
| '/ocp/lots'
| '/ocp'
fileRoutesByTo: FileRoutesByTo
to: '/' | '' | '/about' | '/login' | '/profile' | '/ocp/lots' | '/ocp'
to:
| '/'
| ''
| '/about'
| '/login'
| '/modules'
| '/profile'
| '/ocp/lots'
| '/ocp'
id:
| '__root__'
| '/'
@@ -187,6 +230,7 @@ export interface FileRouteTypes {
| '/_auth'
| '/about'
| '/login'
| '/_admin/modules'
| '/_auth/profile'
| '/ocp/lots'
| '/ocp/'
@@ -195,7 +239,7 @@ export interface FileRouteTypes {
export interface RootRouteChildren {
IndexRoute: typeof IndexRoute
AdminRoute: typeof AdminRoute
AdminRoute: typeof AdminRouteWithChildren
AuthRoute: typeof AuthRouteWithChildren
AboutRoute: typeof AboutRoute
LoginRoute: typeof LoginRoute
@@ -205,7 +249,7 @@ export interface RootRouteChildren {
const rootRouteChildren: RootRouteChildren = {
IndexRoute: IndexRoute,
AdminRoute: AdminRoute,
AdminRoute: AdminRouteWithChildren,
AuthRoute: AuthRouteWithChildren,
AboutRoute: AboutRoute,
LoginRoute: LoginRoute,
@@ -236,7 +280,10 @@ export const routeTree = rootRoute
"filePath": "index.tsx"
},
"/_admin": {
"filePath": "_admin.tsx"
"filePath": "_admin.tsx",
"children": [
"/_admin/modules"
]
},
"/_auth": {
"filePath": "_auth.tsx",
@@ -250,6 +297,10 @@ export const routeTree = rootRoute
"/login": {
"filePath": "login.tsx"
},
"/_admin/modules": {
"filePath": "_admin/modules.tsx",
"parent": "/_admin"
},
"/_auth/profile": {
"filePath": "_auth/profile.tsx",
"parent": "/_auth"