revojs 0.1.51 → 0.1.52
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/commands/index.mjs +8 -10
- package/dist/{index-CZcqzWwl.d.mts → index-B4nGVcLE.d.mts} +61 -60
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/kit/index.d.mts +3 -4
- package/dist/kit/index.mjs +3 -6
- package/dist/{package-DiFpQQya.mjs → package-BezU2VEq.mjs} +1 -1
- package/dist/{app-VHSJTEkd.mjs → server-BKOK-LN2.mjs} +488 -492
- package/dist/vite/index.d.mts +2 -3
- package/dist/vite/index.mjs +43 -38
- package/package.json +2 -2
- package/src/types/routes.d.ts +1 -1
- package/src/types/middlewares.d.ts +0 -7
package/dist/commands/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { n as version, t as name } from "../package-
|
|
2
|
+
import { n as version, t as name } from "../package-BezU2VEq.mjs";
|
|
3
3
|
import { resolvePaths } from "../kit/index.mjs";
|
|
4
4
|
import { defineCommand, runMain } from "citty";
|
|
5
5
|
import { copyFileSync, mkdirSync } from "fs";
|
|
@@ -25,28 +25,26 @@ var module_default = defineCommand({ subCommands: { build: defineCommand({ async
|
|
|
25
25
|
for (const path of resolvePaths([
|
|
26
26
|
"./src/**/*.*",
|
|
27
27
|
"!./src/**/*.js",
|
|
28
|
-
"!./src/**/*.ts"
|
|
29
|
-
"!./src/**/**.d.ts"
|
|
28
|
+
"!./src/**/*.ts"
|
|
30
29
|
])) {
|
|
31
30
|
const target = join("./dist", relative("./src", path));
|
|
32
31
|
mkdirSync(dirname(target), { recursive: true });
|
|
33
32
|
copyFileSync(path, target);
|
|
34
33
|
}
|
|
34
|
+
for (const path of resolvePaths(["./src/**/*.d.ts"])) {
|
|
35
|
+
const target = join("./dist", relative("./src", path));
|
|
36
|
+
mkdirSync(dirname(target), { recursive: true });
|
|
37
|
+
copyFileSync(path, target);
|
|
38
|
+
}
|
|
35
39
|
} }) } });
|
|
36
40
|
//#endregion
|
|
37
|
-
//#region src/commands/run/index.ts
|
|
38
|
-
var run_default = defineCommand({ setup() {} });
|
|
39
|
-
//#endregion
|
|
40
41
|
//#region src/commands/index.ts
|
|
41
42
|
runMain(defineCommand({
|
|
42
43
|
meta: {
|
|
43
44
|
name,
|
|
44
45
|
version
|
|
45
46
|
},
|
|
46
|
-
subCommands: {
|
|
47
|
-
module: module_default,
|
|
48
|
-
run: run_default
|
|
49
|
-
}
|
|
47
|
+
subCommands: { module: module_default }
|
|
50
48
|
}));
|
|
51
49
|
//#endregion
|
|
52
50
|
export {};
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
import { UserConfig } from "vite";
|
|
2
2
|
|
|
3
|
-
//#region src/
|
|
4
|
-
type Descriptor<T> = string & {
|
|
5
|
-
[descriptor]: T;
|
|
6
|
-
};
|
|
7
|
-
type Invoke = (...inputs: Array<any>) => any;
|
|
8
|
-
type Context = Record<string, any>;
|
|
9
|
-
type Output<T> = Success<T> | Failure;
|
|
10
|
-
type InferInput<T extends Schema> = NonNullable<T["~standard"]["types"]>["input"];
|
|
11
|
-
type InferOutput<T extends Schema> = NonNullable<T["~standard"]["types"]>["output"];
|
|
12
|
-
type Primitive = string | number | boolean | bigint | symbol | null | undefined;
|
|
13
|
-
type Awaitable<T> = T | PromiseLike<T>;
|
|
14
|
-
type Mergeable<T> = T extends Primitive ? T : T extends Array<infer U> ? Array<Mergeable<U>> : { [K in keyof T]?: Mergeable<T[K]> };
|
|
3
|
+
//#region src/router/index.d.ts
|
|
15
4
|
type Node<T> = PathNode<T> | WildcardNode<T> | OptionalWildcardNode<T> | ParameterNode<T> | OptionalParameterNode<T> | GroupNode<T> | HookNode<T>;
|
|
16
5
|
interface PathNode<T> {
|
|
17
6
|
type: "PATH";
|
|
@@ -45,63 +34,26 @@ interface OptionalParameterNode<T> {
|
|
|
45
34
|
interface GroupNode<T> {
|
|
46
35
|
type: "GROUP";
|
|
47
36
|
label: string;
|
|
48
|
-
value?: T;
|
|
49
37
|
children: Record<string, Node<T>>;
|
|
50
38
|
}
|
|
51
39
|
interface HookNode<T> {
|
|
52
40
|
type: "HOOK";
|
|
53
|
-
value?: T
|
|
41
|
+
value?: Array<T>;
|
|
54
42
|
children: Record<string, Node<T>>;
|
|
55
43
|
}
|
|
56
44
|
interface RouterContext<T> {
|
|
57
|
-
route
|
|
45
|
+
route?: T;
|
|
58
46
|
segments: Array<string>;
|
|
59
47
|
parameters: Record<string, string>;
|
|
60
48
|
groups: Array<string>;
|
|
61
49
|
hooks: Array<T>;
|
|
62
50
|
}
|
|
63
|
-
interface Issue {
|
|
64
|
-
readonly message: string;
|
|
65
|
-
}
|
|
66
|
-
interface Success<T> {
|
|
67
|
-
readonly value: T;
|
|
68
|
-
}
|
|
69
|
-
interface Failure {
|
|
70
|
-
readonly issues: ReadonlyArray<Issue>;
|
|
71
|
-
}
|
|
72
|
-
interface Schema<T = unknown, TOutput = T> {
|
|
73
|
-
readonly "~standard": {
|
|
74
|
-
readonly validate: (value: unknown) => Output<TOutput> | Promise<Output<TOutput>>;
|
|
75
|
-
readonly types?: {
|
|
76
|
-
readonly input: T;
|
|
77
|
-
readonly output: TOutput;
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
declare class Hookable {
|
|
82
|
-
private readonly hooks;
|
|
83
|
-
constructor();
|
|
84
|
-
registerHook<T extends Invoke>(name: Descriptor<T>, invoke: T): () => void;
|
|
85
|
-
dispatchHook<T extends Invoke>(name: Descriptor<T>, ...inputs: Parameters<T>): Promise<Awaited<ReturnType<T>>[]>;
|
|
86
|
-
}
|
|
87
|
-
declare class Scope extends Hookable {
|
|
88
|
-
private parentScope?;
|
|
89
|
-
private readonly context;
|
|
90
|
-
constructor(parentScope?: Scope);
|
|
91
|
-
getContext<T>(input: Descriptor<T>): T;
|
|
92
|
-
setContext<T>(input: Descriptor<T>, value: T): T;
|
|
93
|
-
}
|
|
94
51
|
declare class Router<T> {
|
|
95
52
|
readonly rootNode: Node<T>;
|
|
96
53
|
constructor(rootNode?: Node<T>);
|
|
97
54
|
use(segments: Array<string>, value: T): Node<T>;
|
|
98
55
|
match(segments: Array<string>): RouterContext<T>;
|
|
99
56
|
}
|
|
100
|
-
declare function defineHook<T extends Invoke>(name: string): Descriptor<T>;
|
|
101
|
-
declare function defineContext<T>(name: string): Descriptor<T>;
|
|
102
|
-
declare function isFailure<T>(result: Output<T>): result is Failure;
|
|
103
|
-
declare function parseSchema<T extends Schema>(scope: Scope, schema: T, value: unknown): InferOutput<T>;
|
|
104
|
-
declare function mergeObjects<TBase, TInput>(base: TBase, input: TInput): TBase & TInput;
|
|
105
57
|
declare const WILDCARD = "@";
|
|
106
58
|
declare const OPTIONAL_WILDCARD = "@@";
|
|
107
59
|
declare const PARAMETER = "@@@";
|
|
@@ -114,8 +66,60 @@ declare const PARAMETER_MATCH: RegExp;
|
|
|
114
66
|
declare const OPTIONAL_PARAMETER_MATCH: RegExp;
|
|
115
67
|
declare const GROUP_MATCH: RegExp;
|
|
116
68
|
declare const HOOK_MATCH: RegExp;
|
|
69
|
+
//#endregion
|
|
70
|
+
//#region src/shared/index.d.ts
|
|
71
|
+
type Descriptor<T> = string & {
|
|
72
|
+
[descriptor]: T;
|
|
73
|
+
};
|
|
74
|
+
type Invoke = (...inputs: Array<any>) => any;
|
|
75
|
+
type Context = Record<string, any>;
|
|
76
|
+
type Primitive = string | number | boolean | bigint | symbol | null | undefined;
|
|
77
|
+
type Awaitable<T> = T | PromiseLike<T>;
|
|
78
|
+
type Mergeable<T> = T extends Primitive ? T : T extends Array<infer U> ? Array<Mergeable<U>> : { [K in keyof T]?: Mergeable<T[K]> };
|
|
79
|
+
declare class Hookable {
|
|
80
|
+
private readonly hooks;
|
|
81
|
+
constructor();
|
|
82
|
+
registerHook<T extends Invoke>(name: Descriptor<T>, invoke: T): () => void;
|
|
83
|
+
dispatchHook<T extends Invoke>(name: Descriptor<T>, ...inputs: Parameters<T>): Promise<Awaited<ReturnType<T>>[]>;
|
|
84
|
+
}
|
|
85
|
+
declare class Scope extends Hookable {
|
|
86
|
+
private parentScope?;
|
|
87
|
+
private readonly context;
|
|
88
|
+
constructor(parentScope?: Scope);
|
|
89
|
+
getContext<T>(input: Descriptor<T>): T;
|
|
90
|
+
setContext<T>(input: Descriptor<T>, value: T): T;
|
|
91
|
+
}
|
|
92
|
+
declare function defineHook<T extends Invoke>(name: string): Descriptor<T>;
|
|
93
|
+
declare function defineContext<T>(name: string): Descriptor<T>;
|
|
94
|
+
declare function mergeObjects<TBase, TInput>(base: TBase, input: TInput): TBase & TInput;
|
|
117
95
|
declare const descriptor: unique symbol;
|
|
118
96
|
//#endregion
|
|
97
|
+
//#region src/schema/index.d.ts
|
|
98
|
+
type InferInput<T extends Schema> = NonNullable<T["~standard"]["types"]>["input"];
|
|
99
|
+
type InferOutput<T extends Schema> = NonNullable<T["~standard"]["types"]>["output"];
|
|
100
|
+
type Output<T> = Success<T> | Failure;
|
|
101
|
+
interface Issue {
|
|
102
|
+
readonly message: string;
|
|
103
|
+
}
|
|
104
|
+
interface Success<T> {
|
|
105
|
+
readonly value: T;
|
|
106
|
+
}
|
|
107
|
+
interface Failure {
|
|
108
|
+
readonly issues: ReadonlyArray<Issue>;
|
|
109
|
+
}
|
|
110
|
+
interface Schema<T = unknown, TOutput = T> {
|
|
111
|
+
readonly "~standard": {
|
|
112
|
+
readonly validate: (value: unknown) => Awaitable<Output<TOutput>>;
|
|
113
|
+
readonly types?: {
|
|
114
|
+
readonly input: T;
|
|
115
|
+
readonly output: TOutput;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
declare function isSuccess<T>(result: Output<T>): result is Success<T>;
|
|
120
|
+
declare function isFailure<T>(result: Output<T>): result is Failure;
|
|
121
|
+
declare function parseSchema<T extends Schema>(scope: Scope, schema: T, value: unknown): InferOutput<T>;
|
|
122
|
+
//#endregion
|
|
119
123
|
//#region src/server/index.d.ts
|
|
120
124
|
type CookiePriority = (typeof cookiePriorities)[number];
|
|
121
125
|
type CookieSameSite = (typeof cookieSameSites)[number];
|
|
@@ -123,7 +127,7 @@ type HttpMethod = (typeof httpMethods)[number];
|
|
|
123
127
|
type Encoding = (typeof encodings)[number];
|
|
124
128
|
type StatusCode = (typeof statusCodes)[number];
|
|
125
129
|
type MimeType = (typeof mimeTypes)[keyof typeof mimeTypes];
|
|
126
|
-
type Result =
|
|
130
|
+
type Result = Awaitable<void | Response>;
|
|
127
131
|
interface CookieOptions {
|
|
128
132
|
domain?: string;
|
|
129
133
|
expires?: Date;
|
|
@@ -151,10 +155,8 @@ interface Route {
|
|
|
151
155
|
interface Middleware {
|
|
152
156
|
fetch: (scope: Scope, next?: () => Result) => Result;
|
|
153
157
|
}
|
|
154
|
-
interface Server {
|
|
158
|
+
interface Server extends Route {
|
|
155
159
|
router: Router<Route>;
|
|
156
|
-
middleware: Array<Middleware>;
|
|
157
|
-
fetch: (scope: Scope) => Result;
|
|
158
160
|
}
|
|
159
161
|
declare function defineRoute<T extends Route>(route: T): T;
|
|
160
162
|
declare function defineMiddleware<T extends Middleware>(middleware: T): T;
|
|
@@ -204,8 +206,7 @@ declare const mimeTypes: Record<string, string>;
|
|
|
204
206
|
//#endregion
|
|
205
207
|
//#region src/app/index.d.ts
|
|
206
208
|
type Environment = typeof CLIENT | typeof SERVER;
|
|
207
|
-
type
|
|
208
|
-
type Content = () => Awaitable<string>;
|
|
209
|
+
type Content = (environment?: Environment) => Awaitable<undefined | string>;
|
|
209
210
|
interface Asset {
|
|
210
211
|
name: string;
|
|
211
212
|
type: string;
|
|
@@ -231,7 +232,7 @@ interface Config {
|
|
|
231
232
|
variables: Record<string, unknown>;
|
|
232
233
|
development: DevelopmentConfig;
|
|
233
234
|
templates: Record<string, Content>;
|
|
234
|
-
virtuals: Record<string,
|
|
235
|
+
virtuals: Record<string, Content>;
|
|
235
236
|
vite: UserConfig;
|
|
236
237
|
}
|
|
237
238
|
interface Module {
|
|
@@ -254,8 +255,8 @@ declare const CLOSE_HOOK: Descriptor<() => void>;
|
|
|
254
255
|
declare function fetch<T>(scope: Scope, input: string | URL, options?: RequestInit): Promise<T>;
|
|
255
256
|
//#endregion
|
|
256
257
|
//#region src/middleware/index.d.ts
|
|
257
|
-
declare function createStaticMiddleware
|
|
258
|
+
declare function createStaticMiddleware(resolve: (path: string | URL) => Awaitable<Blob>): {
|
|
258
259
|
fetch(scope: Scope, next: (() => Result) | undefined): Promise<void | Response>;
|
|
259
260
|
};
|
|
260
261
|
//#endregion
|
|
261
|
-
export {
|
|
262
|
+
export { sendUnauthorized as $, WILDCARD as $t, StatusCode as A, Scope as At, isClient as B, Node as Bt, Result as C, Awaitable as Ct, STATES as D, Invoke as Dt, SERVER_ROUTER_CONTEXT as E, Hookable as Et, defineRoute as F, GROUP_MATCH as Ft, sendBadRequest as G, OptionalParameterNode as Gt, mimeType as H, OPTIONAL_PARAMETER_MATCH as Ht, encodings as I, GroupNode as It, sendNoContent as J, PARAMETER_MATCH as Jt, sendCreated as K, OptionalWildcardNode as Kt, getState as L, HOOK as Lt, cookieSameSites as M, defineHook as Mt, createServer as N, mergeObjects as Nt, Server as O, Mergeable as Ot, defineMiddleware as P, GROUP as Pt, sendResponse as Q, RouterContext as Qt, httpMethods as R, HOOK_MATCH as Rt, ResponseConfig as S, parseSchema as St, SERVER_CONTEXT as T, Descriptor as Tt, mimeTypes as U, OPTIONAL_WILDCARD as Ut, isServer as V, OPTIONAL_PARAMETER as Vt, parseCookiePair as W, OPTIONAL_WILDCARD_MATCH as Wt, sendOk as X, PathNode as Xt, sendNotFound as Y, ParameterNode as Yt, sendRedirect as Z, Router as Zt, CookieSameSite as _, Output as _t, CLIENT as a, useHeaders as at, Middleware as b, isFailure as bt, Content as c, useRouter as ct, Module as d, useUrl as dt, WILDCARD_MATCH as en, setCookie as et, SERVER as f, withQuery as ft, CookiePriority as g, Issue as gt, CookieOptions as h, InferOutput as ht, Asset as i, useCookies as it, cookiePriorities as j, defineContext as jt, ServerContext as k, Primitive as kt, DevelopmentConfig as l, useServer as lt, Template as m, InferInput as mt, fetch as n, statusCodes as nt, CLOSE_HOOK as o, useParameters as ot, Source as p, Failure as pt, sendForbidden as q, PARAMETER as qt, App as r, useBody as rt, Config as s, useQuery as st, createStaticMiddleware as t, WildcardNode as tn, setState as tt, Environment as u, useSetCookies as ut, Encoding as v, Schema as vt, Route as w, Context as wt, MimeType as x, isSuccess as xt, HttpMethod as y, Success as yt, invoke as z, HookNode as zt };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
export { App, Asset, Awaitable, CLIENT, CLOSE_HOOK, Config, Content, Context, CookieOptions, CookiePriority, CookieSameSite, Descriptor, DevelopmentConfig, Encoding, Environment, Failure, GROUP, GROUP_MATCH, GroupNode, HOOK, HOOK_MATCH, HookNode, Hookable, HttpMethod, InferInput, InferOutput, Invoke, Issue, Mergeable, Middleware, MimeType, Module, Node, OPTIONAL_PARAMETER, OPTIONAL_PARAMETER_MATCH, OPTIONAL_WILDCARD, OPTIONAL_WILDCARD_MATCH, OptionalParameterNode, OptionalWildcardNode, Output, PARAMETER, PARAMETER_MATCH, ParameterNode, PathNode, Primitive, ResponseConfig, Result, Route, Router, RouterContext, SERVER, SERVER_CONTEXT, SERVER_ROUTER_CONTEXT, STATES, Schema, Scope, Server, ServerContext, Source, StatusCode, Success, Template,
|
|
1
|
+
import { $ as sendUnauthorized, $t as WILDCARD, A as StatusCode, At as Scope, B as isClient, Bt as Node, C as Result, Ct as Awaitable, D as STATES, Dt as Invoke, E as SERVER_ROUTER_CONTEXT, Et as Hookable, F as defineRoute, Ft as GROUP_MATCH, G as sendBadRequest, Gt as OptionalParameterNode, H as mimeType, Ht as OPTIONAL_PARAMETER_MATCH, I as encodings, It as GroupNode, J as sendNoContent, Jt as PARAMETER_MATCH, K as sendCreated, Kt as OptionalWildcardNode, L as getState, Lt as HOOK, M as cookieSameSites, Mt as defineHook, N as createServer, Nt as mergeObjects, O as Server, Ot as Mergeable, P as defineMiddleware, Pt as GROUP, Q as sendResponse, Qt as RouterContext, R as httpMethods, Rt as HOOK_MATCH, S as ResponseConfig, St as parseSchema, T as SERVER_CONTEXT, Tt as Descriptor, U as mimeTypes, Ut as OPTIONAL_WILDCARD, V as isServer, Vt as OPTIONAL_PARAMETER, W as parseCookiePair, Wt as OPTIONAL_WILDCARD_MATCH, X as sendOk, Xt as PathNode, Y as sendNotFound, Yt as ParameterNode, Z as sendRedirect, Zt as Router, _ as CookieSameSite, _t as Output, a as CLIENT, at as useHeaders, b as Middleware, bt as isFailure, c as Content, ct as useRouter, d as Module, dt as useUrl, en as WILDCARD_MATCH, et as setCookie, f as SERVER, ft as withQuery, g as CookiePriority, gt as Issue, h as CookieOptions, ht as InferOutput, i as Asset, it as useCookies, j as cookiePriorities, jt as defineContext, k as ServerContext, kt as Primitive, l as DevelopmentConfig, lt as useServer, m as Template, mt as InferInput, n as fetch, nt as statusCodes, o as CLOSE_HOOK, ot as useParameters, p as Source, pt as Failure, q as sendForbidden, qt as PARAMETER, r as App, rt as useBody, s as Config, st as useQuery, t as createStaticMiddleware, tn as WildcardNode, tt as setState, u as Environment, ut as useSetCookies, v as Encoding, vt as Schema, w as Route, wt as Context, x as MimeType, xt as isSuccess, y as HttpMethod, yt as Success, z as invoke, zt as HookNode } from "./index-B4nGVcLE.mjs";
|
|
2
|
+
export { App, Asset, Awaitable, CLIENT, CLOSE_HOOK, Config, Content, Context, CookieOptions, CookiePriority, CookieSameSite, Descriptor, DevelopmentConfig, Encoding, Environment, Failure, GROUP, GROUP_MATCH, GroupNode, HOOK, HOOK_MATCH, HookNode, Hookable, HttpMethod, InferInput, InferOutput, Invoke, Issue, Mergeable, Middleware, MimeType, Module, Node, OPTIONAL_PARAMETER, OPTIONAL_PARAMETER_MATCH, OPTIONAL_WILDCARD, OPTIONAL_WILDCARD_MATCH, OptionalParameterNode, OptionalWildcardNode, Output, PARAMETER, PARAMETER_MATCH, ParameterNode, PathNode, Primitive, ResponseConfig, Result, Route, Router, RouterContext, SERVER, SERVER_CONTEXT, SERVER_ROUTER_CONTEXT, STATES, Schema, Scope, Server, ServerContext, Source, StatusCode, Success, Template, WILDCARD, WILDCARD_MATCH, WildcardNode, cookiePriorities, cookieSameSites, createServer, createStaticMiddleware, defineContext, defineHook, defineMiddleware, defineRoute, encodings, fetch, getState, httpMethods, invoke, isClient, isFailure, isServer, isSuccess, mergeObjects, mimeType, mimeTypes, parseCookiePair, parseSchema, sendBadRequest, sendCreated, sendForbidden, sendNoContent, sendNotFound, sendOk, sendRedirect, sendResponse, sendUnauthorized, setCookie, setState, statusCodes, useBody, useCookies, useHeaders, useParameters, useQuery, useRouter, useServer, useSetCookies, useUrl, withQuery };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as Router, A as useBody, B as isFailure, C as sendOk, D as setCookie, E as sendUnauthorized, F as useRouter, G as HOOK, H as parseSchema, I as useServer, J as OPTIONAL_PARAMETER_MATCH, K as HOOK_MATCH, L as useSetCookies, M as useHeaders, N as useParameters, O as setState, P as useQuery, Q as PARAMETER_MATCH, R as useUrl, S as sendNotFound, T as sendResponse, U as GROUP, V as isSuccess, W as GROUP_MATCH, X as OPTIONAL_WILDCARD_MATCH, Y as OPTIONAL_WILDCARD, Z as PARAMETER, _ as parseCookiePair, a as cookieSameSites, at as SERVER, b as sendForbidden, c as defineRoute, ct as defineContext, d as httpMethods, et as WILDCARD, f as invoke, g as mimeTypes, h as mimeType, i as cookiePriorities, it as CLOSE_HOOK, j as useCookies, k as statusCodes, l as encodings, lt as defineHook, m as isServer, n as SERVER_ROUTER_CONTEXT, nt as App, o as createServer, ot as Hookable, p as isClient, q as OPTIONAL_PARAMETER, r as STATES, rt as CLIENT, s as defineMiddleware, st as Scope, t as SERVER_CONTEXT, tt as WILDCARD_MATCH, u as getState, ut as mergeObjects, v as sendBadRequest, w as sendRedirect, x as sendNoContent, y as sendCreated, z as withQuery } from "./server-BKOK-LN2.mjs";
|
|
2
2
|
import assets from "#assets";
|
|
3
3
|
//#region src/client/index.ts
|
|
4
4
|
async function fetch(scope, input, options) {
|
|
@@ -52,4 +52,4 @@ function createStaticMiddleware(resolve) {
|
|
|
52
52
|
} });
|
|
53
53
|
}
|
|
54
54
|
//#endregion
|
|
55
|
-
export { App, CLIENT, CLOSE_HOOK, GROUP, GROUP_MATCH, HOOK, HOOK_MATCH, Hookable, OPTIONAL_PARAMETER, OPTIONAL_PARAMETER_MATCH, OPTIONAL_WILDCARD, OPTIONAL_WILDCARD_MATCH, PARAMETER, PARAMETER_MATCH, Router, SERVER, SERVER_CONTEXT, SERVER_ROUTER_CONTEXT, STATES, Scope, WILDCARD, WILDCARD_MATCH, cookiePriorities, cookieSameSites, createServer, createStaticMiddleware, defineContext, defineHook, defineMiddleware, defineRoute, encodings, fetch, getState, httpMethods, invoke, isClient, isFailure, isServer, mergeObjects, mimeType, mimeTypes, parseCookiePair, parseSchema, sendBadRequest, sendCreated, sendForbidden, sendNoContent, sendNotFound, sendOk, sendRedirect, sendResponse, sendUnauthorized, setCookie, setState, statusCodes, useBody, useCookies, useHeaders, useParameters, useQuery, useRouter, useServer, useSetCookies, useUrl, withQuery };
|
|
55
|
+
export { App, CLIENT, CLOSE_HOOK, GROUP, GROUP_MATCH, HOOK, HOOK_MATCH, Hookable, OPTIONAL_PARAMETER, OPTIONAL_PARAMETER_MATCH, OPTIONAL_WILDCARD, OPTIONAL_WILDCARD_MATCH, PARAMETER, PARAMETER_MATCH, Router, SERVER, SERVER_CONTEXT, SERVER_ROUTER_CONTEXT, STATES, Scope, WILDCARD, WILDCARD_MATCH, cookiePriorities, cookieSameSites, createServer, createStaticMiddleware, defineContext, defineHook, defineMiddleware, defineRoute, encodings, fetch, getState, httpMethods, invoke, isClient, isFailure, isServer, isSuccess, mergeObjects, mimeType, mimeTypes, parseCookiePair, parseSchema, sendBadRequest, sendCreated, sendForbidden, sendNoContent, sendNotFound, sendOk, sendRedirect, sendResponse, sendUnauthorized, setCookie, setState, statusCodes, useBody, useCookies, useHeaders, useParameters, useQuery, useRouter, useServer, useSetCookies, useUrl, withQuery };
|
package/dist/kit/index.d.mts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { c as Content,
|
|
1
|
+
import { c as Content, r as App } from "../index-B4nGVcLE.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/kit/index.d.ts
|
|
4
4
|
declare function useKit(source: string | URL): {
|
|
5
5
|
fromModule(...paths: Array<string>): string;
|
|
6
6
|
};
|
|
7
7
|
declare function addTemplate(app: App, name: string, content: Content): void;
|
|
8
|
-
declare function addVirtual(app: App, name: string,
|
|
8
|
+
declare function addVirtual(app: App, name: string, content: Content): void;
|
|
9
9
|
declare function addRoutes(app: App, path: string): void;
|
|
10
|
-
declare function addMiddleware(app: App, path: string): void;
|
|
11
10
|
declare function addTypes(app: App, name: string, content: Content): void;
|
|
12
11
|
declare function resolvePaths(path: string | Array<string>, cwd?: string): string[];
|
|
13
12
|
//#endregion
|
|
14
|
-
export {
|
|
13
|
+
export { addRoutes, addTemplate, addTypes, addVirtual, resolvePaths, useKit };
|
package/dist/kit/index.mjs
CHANGED
|
@@ -12,15 +12,12 @@ function useKit(source) {
|
|
|
12
12
|
function addTemplate(app, name, content) {
|
|
13
13
|
app.config.templates[name] = content;
|
|
14
14
|
}
|
|
15
|
-
function addVirtual(app, name,
|
|
16
|
-
app.config.virtuals[
|
|
15
|
+
function addVirtual(app, name, content) {
|
|
16
|
+
app.config.virtuals[name] = content;
|
|
17
17
|
}
|
|
18
18
|
function addRoutes(app, path) {
|
|
19
19
|
app.config.sources.routes?.entries.push(path);
|
|
20
20
|
}
|
|
21
|
-
function addMiddleware(app, path) {
|
|
22
|
-
app.config.sources.middleware?.entries.push(path);
|
|
23
|
-
}
|
|
24
21
|
function addTypes(app, name, content) {
|
|
25
22
|
addTemplate(app, `types/${name}.d.ts`, content);
|
|
26
23
|
}
|
|
@@ -49,4 +46,4 @@ function resolvePaths(path, cwd) {
|
|
|
49
46
|
return Array.from(entries);
|
|
50
47
|
}
|
|
51
48
|
//#endregion
|
|
52
|
-
export {
|
|
49
|
+
export { addRoutes, addTemplate, addTypes, addVirtual, resolvePaths, useKit };
|