mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-13 16:06:08 +00:00
refactor(web): migrate from Next.js to Vite + React Router
This commit is contained in:
Vendored
+71
@@ -0,0 +1,71 @@
|
||||
// This file is generated automatically by Next.js
|
||||
// Do not edit this file manually
|
||||
|
||||
type AppRoutes = "/" | "/auth/space/callback" | "/home" | "/home/bots" | "/home/knowledge" | "/home/monitoring" | "/home/pipelines" | "/home/plugins" | "/login" | "/register" | "/reset-password"
|
||||
type PageRoutes = never
|
||||
type LayoutRoutes = "/" | "/home" | "/login" | "/register" | "/reset-password"
|
||||
type RedirectRoutes = never
|
||||
type RewriteRoutes = never
|
||||
type Routes = AppRoutes | PageRoutes | LayoutRoutes | RedirectRoutes | RewriteRoutes
|
||||
|
||||
|
||||
interface ParamMap {
|
||||
"/": {}
|
||||
"/auth/space/callback": {}
|
||||
"/home": {}
|
||||
"/home/bots": {}
|
||||
"/home/knowledge": {}
|
||||
"/home/monitoring": {}
|
||||
"/home/pipelines": {}
|
||||
"/home/plugins": {}
|
||||
"/login": {}
|
||||
"/register": {}
|
||||
"/reset-password": {}
|
||||
}
|
||||
|
||||
|
||||
export type ParamsOf<Route extends Routes> = ParamMap[Route]
|
||||
|
||||
interface LayoutSlotMap {
|
||||
"/": never
|
||||
"/home": never
|
||||
"/login": never
|
||||
"/register": never
|
||||
"/reset-password": never
|
||||
}
|
||||
|
||||
|
||||
export type { AppRoutes, PageRoutes, LayoutRoutes, RedirectRoutes, RewriteRoutes, ParamMap }
|
||||
|
||||
declare global {
|
||||
/**
|
||||
* Props for Next.js App Router page components
|
||||
* @example
|
||||
* ```tsx
|
||||
* export default function Page(props: PageProps<'/blog/[slug]'>) {
|
||||
* const { slug } = await props.params
|
||||
* return <div>Blog post: {slug}</div>
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
interface PageProps<AppRoute extends AppRoutes> {
|
||||
params: Promise<ParamMap[AppRoute]>
|
||||
searchParams: Promise<Record<string, string | string[] | undefined>>
|
||||
}
|
||||
|
||||
/**
|
||||
* Props for Next.js App Router layout components
|
||||
* @example
|
||||
* ```tsx
|
||||
* export default function Layout(props: LayoutProps<'/dashboard'>) {
|
||||
* return <div>{props.children}</div>
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
type LayoutProps<LayoutRoute extends LayoutRoutes> = {
|
||||
params: Promise<ParamMap[LayoutRoute]>
|
||||
children: React.ReactNode
|
||||
} & {
|
||||
[K in LayoutSlotMap[LayoutRoute]]: React.ReactNode
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,187 @@
|
||||
// This file is generated automatically by Next.js
|
||||
// Do not edit this file manually
|
||||
// This file validates that all pages and layouts export the correct types
|
||||
|
||||
import type { AppRoutes, LayoutRoutes, ParamMap } from "./routes.js"
|
||||
import type { ResolvingMetadata, ResolvingViewport } from "next/types.js"
|
||||
|
||||
type AppPageConfig<Route extends AppRoutes = AppRoutes> = {
|
||||
default: React.ComponentType<{ params: Promise<ParamMap[Route]> } & any> | ((props: { params: Promise<ParamMap[Route]> } & any) => React.ReactNode | Promise<React.ReactNode> | never | void | Promise<void>)
|
||||
generateStaticParams?: (props: { params: ParamMap[Route] }) => Promise<any[]> | any[]
|
||||
generateMetadata?: (
|
||||
props: { params: Promise<ParamMap[Route]> } & any,
|
||||
parent: ResolvingMetadata
|
||||
) => Promise<any> | any
|
||||
generateViewport?: (
|
||||
props: { params: Promise<ParamMap[Route]> } & any,
|
||||
parent: ResolvingViewport
|
||||
) => Promise<any> | any
|
||||
metadata?: any
|
||||
viewport?: any
|
||||
}
|
||||
|
||||
type LayoutConfig<Route extends LayoutRoutes = LayoutRoutes> = {
|
||||
default: React.ComponentType<LayoutProps<Route>> | ((props: LayoutProps<Route>) => React.ReactNode | Promise<React.ReactNode> | never | void | Promise<void>)
|
||||
generateStaticParams?: (props: { params: ParamMap[Route] }) => Promise<any[]> | any[]
|
||||
generateMetadata?: (
|
||||
props: { params: Promise<ParamMap[Route]> } & any,
|
||||
parent: ResolvingMetadata
|
||||
) => Promise<any> | any
|
||||
generateViewport?: (
|
||||
props: { params: Promise<ParamMap[Route]> } & any,
|
||||
parent: ResolvingViewport
|
||||
) => Promise<any> | any
|
||||
metadata?: any
|
||||
viewport?: any
|
||||
}
|
||||
|
||||
|
||||
// Validate ../../src/app/auth/space/callback/page.tsx
|
||||
{
|
||||
type __IsExpected<Specific extends AppPageConfig<"/auth/space/callback">> = Specific
|
||||
const handler = {} as typeof import("../../src/app/auth/space/callback/page.js")
|
||||
type __Check = __IsExpected<typeof handler>
|
||||
// @ts-ignore
|
||||
type __Unused = __Check
|
||||
}
|
||||
|
||||
// Validate ../../src/app/home/bots/page.tsx
|
||||
{
|
||||
type __IsExpected<Specific extends AppPageConfig<"/home/bots">> = Specific
|
||||
const handler = {} as typeof import("../../src/app/home/bots/page.js")
|
||||
type __Check = __IsExpected<typeof handler>
|
||||
// @ts-ignore
|
||||
type __Unused = __Check
|
||||
}
|
||||
|
||||
// Validate ../../src/app/home/knowledge/page.tsx
|
||||
{
|
||||
type __IsExpected<Specific extends AppPageConfig<"/home/knowledge">> = Specific
|
||||
const handler = {} as typeof import("../../src/app/home/knowledge/page.js")
|
||||
type __Check = __IsExpected<typeof handler>
|
||||
// @ts-ignore
|
||||
type __Unused = __Check
|
||||
}
|
||||
|
||||
// Validate ../../src/app/home/monitoring/page.tsx
|
||||
{
|
||||
type __IsExpected<Specific extends AppPageConfig<"/home/monitoring">> = Specific
|
||||
const handler = {} as typeof import("../../src/app/home/monitoring/page.js")
|
||||
type __Check = __IsExpected<typeof handler>
|
||||
// @ts-ignore
|
||||
type __Unused = __Check
|
||||
}
|
||||
|
||||
// Validate ../../src/app/home/page.tsx
|
||||
{
|
||||
type __IsExpected<Specific extends AppPageConfig<"/home">> = Specific
|
||||
const handler = {} as typeof import("../../src/app/home/page.js")
|
||||
type __Check = __IsExpected<typeof handler>
|
||||
// @ts-ignore
|
||||
type __Unused = __Check
|
||||
}
|
||||
|
||||
// Validate ../../src/app/home/pipelines/page.tsx
|
||||
{
|
||||
type __IsExpected<Specific extends AppPageConfig<"/home/pipelines">> = Specific
|
||||
const handler = {} as typeof import("../../src/app/home/pipelines/page.js")
|
||||
type __Check = __IsExpected<typeof handler>
|
||||
// @ts-ignore
|
||||
type __Unused = __Check
|
||||
}
|
||||
|
||||
// Validate ../../src/app/home/plugins/page.tsx
|
||||
{
|
||||
type __IsExpected<Specific extends AppPageConfig<"/home/plugins">> = Specific
|
||||
const handler = {} as typeof import("../../src/app/home/plugins/page.js")
|
||||
type __Check = __IsExpected<typeof handler>
|
||||
// @ts-ignore
|
||||
type __Unused = __Check
|
||||
}
|
||||
|
||||
// Validate ../../src/app/login/page.tsx
|
||||
{
|
||||
type __IsExpected<Specific extends AppPageConfig<"/login">> = Specific
|
||||
const handler = {} as typeof import("../../src/app/login/page.js")
|
||||
type __Check = __IsExpected<typeof handler>
|
||||
// @ts-ignore
|
||||
type __Unused = __Check
|
||||
}
|
||||
|
||||
// Validate ../../src/app/page.tsx
|
||||
{
|
||||
type __IsExpected<Specific extends AppPageConfig<"/">> = Specific
|
||||
const handler = {} as typeof import("../../src/app/page.js")
|
||||
type __Check = __IsExpected<typeof handler>
|
||||
// @ts-ignore
|
||||
type __Unused = __Check
|
||||
}
|
||||
|
||||
// Validate ../../src/app/register/page.tsx
|
||||
{
|
||||
type __IsExpected<Specific extends AppPageConfig<"/register">> = Specific
|
||||
const handler = {} as typeof import("../../src/app/register/page.js")
|
||||
type __Check = __IsExpected<typeof handler>
|
||||
// @ts-ignore
|
||||
type __Unused = __Check
|
||||
}
|
||||
|
||||
// Validate ../../src/app/reset-password/page.tsx
|
||||
{
|
||||
type __IsExpected<Specific extends AppPageConfig<"/reset-password">> = Specific
|
||||
const handler = {} as typeof import("../../src/app/reset-password/page.js")
|
||||
type __Check = __IsExpected<typeof handler>
|
||||
// @ts-ignore
|
||||
type __Unused = __Check
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Validate ../../src/app/home/layout.tsx
|
||||
{
|
||||
type __IsExpected<Specific extends LayoutConfig<"/home">> = Specific
|
||||
const handler = {} as typeof import("../../src/app/home/layout.js")
|
||||
type __Check = __IsExpected<typeof handler>
|
||||
// @ts-ignore
|
||||
type __Unused = __Check
|
||||
}
|
||||
|
||||
// Validate ../../src/app/layout.tsx
|
||||
{
|
||||
type __IsExpected<Specific extends LayoutConfig<"/">> = Specific
|
||||
const handler = {} as typeof import("../../src/app/layout.js")
|
||||
type __Check = __IsExpected<typeof handler>
|
||||
// @ts-ignore
|
||||
type __Unused = __Check
|
||||
}
|
||||
|
||||
// Validate ../../src/app/login/layout.tsx
|
||||
{
|
||||
type __IsExpected<Specific extends LayoutConfig<"/login">> = Specific
|
||||
const handler = {} as typeof import("../../src/app/login/layout.js")
|
||||
type __Check = __IsExpected<typeof handler>
|
||||
// @ts-ignore
|
||||
type __Unused = __Check
|
||||
}
|
||||
|
||||
// Validate ../../src/app/register/layout.tsx
|
||||
{
|
||||
type __IsExpected<Specific extends LayoutConfig<"/register">> = Specific
|
||||
const handler = {} as typeof import("../../src/app/register/layout.js")
|
||||
type __Check = __IsExpected<typeof handler>
|
||||
// @ts-ignore
|
||||
type __Unused = __Check
|
||||
}
|
||||
|
||||
// Validate ../../src/app/reset-password/layout.tsx
|
||||
{
|
||||
type __IsExpected<Specific extends LayoutConfig<"/reset-password">> = Specific
|
||||
const handler = {} as typeof import("../../src/app/reset-password/layout.js")
|
||||
type __Check = __IsExpected<typeof handler>
|
||||
// @ts-ignore
|
||||
type __Unused = __Check
|
||||
}
|
||||
Reference in New Issue
Block a user