chore: restructure repository into packages/ folder (#3197)

We're having a growing number of packages in this repository. This PR
moves them into a `packages/` directory like it's commonly done in other
projects.
This commit is contained in:
Marvin Hagemeister
2025-08-06 15:52:45 +02:00
committed by GitHub
parent 27e407a1e3
commit 815b1940e3
184 changed files with 94 additions and 82 deletions
+73
View File
@@ -0,0 +1,73 @@
import type { ComponentChildren } from "preact";
import type { Context } from "./context.ts";
import type { PageProps } from "./render.ts";
import type { HandlerFn, RouteHandler } from "./handlers.ts";
/**
* @deprecated Use {@linkcode PageProps} instead.
*/
export type AppProps<_Data = unknown, T = unknown> = Context<T>;
/**
* @deprecated Use {@linkcode PageProps} instead.
*/
export type LayoutProps<_Data = unknown, T = unknown> = Context<T>;
/**
* @deprecated Use {@linkcode PageProps} instead.
*/
export type UnknownPageProps<_Data = unknown, T = unknown> = Context<T>;
/**
* @deprecated Use {@linkcode PageProps} instead.
*/
export type ErrorPageProps<_Data = unknown, T = unknown> = Context<T>;
/**
* @deprecated Use {@linkcode FreshContext} instead.
*/
export type RouteContext<_T = never, S = Record<string, unknown>> = Context<S>;
/**
* @deprecated Use {@linkcode RouteHandler} instead.
*/
// deno-lint-ignore no-explicit-any
export type Handlers<T = any, State = Record<string, unknown>> = RouteHandler<
T,
State
>;
/**
* @deprecated Use {@linkcode HandlerFn} instead.
*/
// deno-lint-ignore no-explicit-any
export type Handler<T = any, State = Record<string, unknown>> = HandlerFn<
T,
State
>;
function defineFn<State>(
fn: (
ctx: PageProps<State>,
) =>
| ComponentChildren
| Response
| Promise<Response | ComponentChildren>,
): (
ctx: PageProps<State>,
) =>
| ComponentChildren
| Response
| Promise<Response | ComponentChildren> {
return fn;
}
/**
* @deprecated Use {@linkcode [./mod.ts].Define.page|define.page} instead.
*/
export const defineApp = defineFn;
/**
* @deprecated Use {@linkcode [./mod.ts].Define.page|define.page} instead.
*/
export const defineRoute = defineFn;
/**
* @deprecated Use {@linkcode [./mod.ts].Define.page|define.page} instead.
*/
export const defineLayout = defineFn;