@lolyjs/core 0.2.0-alpha.32 → 0.2.0-alpha.34
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/README.md +63 -0
- package/dist/cli.cjs +345 -248
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +339 -242
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +311 -214
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +311 -214
- package/dist/index.js.map +1 -1
- package/dist/{index.types-JJ0KjvFU.d.mts → index.types-Duhjyfit.d.mts} +15 -1
- package/dist/{index.types-JJ0KjvFU.d.ts → index.types-Duhjyfit.d.ts} +15 -1
- package/dist/react/cache.d.mts +1 -1
- package/dist/react/cache.d.ts +1 -1
- package/package.json +1 -1
|
@@ -134,6 +134,20 @@ interface WssActions {
|
|
|
134
134
|
type RouteMiddleware = (ctx: ServerContext & {
|
|
135
135
|
theme?: string;
|
|
136
136
|
}, next: () => Promise<void>) => Promise<void> | void;
|
|
137
|
+
/**
|
|
138
|
+
* Global middleware type for middlewares that run before route matching.
|
|
139
|
+
* These middlewares establish context (ctx.locals) and always execute (both SSR and SPA navigation).
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* // global.middleware.ts
|
|
143
|
+
* export const globalMiddlewares: GlobalMiddleware[] = [
|
|
144
|
+
* async (ctx, next) => {
|
|
145
|
+
* ctx.locals.user = await getSession(ctx.req);
|
|
146
|
+
* await next();
|
|
147
|
+
* }
|
|
148
|
+
* ];
|
|
149
|
+
*/
|
|
150
|
+
type GlobalMiddleware = (ctx: ServerContext, next: () => Promise<void>) => Promise<void> | void;
|
|
137
151
|
/**
|
|
138
152
|
* Result returned by a server loader (getServerSideProps).
|
|
139
153
|
* @template TProps - Type of props that will be passed to the component (defaults to Record<string, any>)
|
|
@@ -263,4 +277,4 @@ interface ApiContext extends BaseContext {
|
|
|
263
277
|
*/
|
|
264
278
|
type ApiMiddleware = (ctx: ApiContext, next: () => Promise<void>) => void | Promise<void>;
|
|
265
279
|
|
|
266
|
-
export { type ApiMiddleware as A, type
|
|
280
|
+
export { type ApiMiddleware as A, type GlobalMiddleware as G, type LoaderResult as L, type MetadataLoader as M, NotFoundResponse as N, type PageMetadata as P, type RouteMiddleware as R, type ServerContext as S, type WssActions as W, type ApiContext as a, type GenerateStaticParams as b, type ServerLoader as c, RedirectResponse as d };
|
|
@@ -134,6 +134,20 @@ interface WssActions {
|
|
|
134
134
|
type RouteMiddleware = (ctx: ServerContext & {
|
|
135
135
|
theme?: string;
|
|
136
136
|
}, next: () => Promise<void>) => Promise<void> | void;
|
|
137
|
+
/**
|
|
138
|
+
* Global middleware type for middlewares that run before route matching.
|
|
139
|
+
* These middlewares establish context (ctx.locals) and always execute (both SSR and SPA navigation).
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* // global.middleware.ts
|
|
143
|
+
* export const globalMiddlewares: GlobalMiddleware[] = [
|
|
144
|
+
* async (ctx, next) => {
|
|
145
|
+
* ctx.locals.user = await getSession(ctx.req);
|
|
146
|
+
* await next();
|
|
147
|
+
* }
|
|
148
|
+
* ];
|
|
149
|
+
*/
|
|
150
|
+
type GlobalMiddleware = (ctx: ServerContext, next: () => Promise<void>) => Promise<void> | void;
|
|
137
151
|
/**
|
|
138
152
|
* Result returned by a server loader (getServerSideProps).
|
|
139
153
|
* @template TProps - Type of props that will be passed to the component (defaults to Record<string, any>)
|
|
@@ -263,4 +277,4 @@ interface ApiContext extends BaseContext {
|
|
|
263
277
|
*/
|
|
264
278
|
type ApiMiddleware = (ctx: ApiContext, next: () => Promise<void>) => void | Promise<void>;
|
|
265
279
|
|
|
266
|
-
export { type ApiMiddleware as A, type
|
|
280
|
+
export { type ApiMiddleware as A, type GlobalMiddleware as G, type LoaderResult as L, type MetadataLoader as M, NotFoundResponse as N, type PageMetadata as P, type RouteMiddleware as R, type ServerContext as S, type WssActions as W, type ApiContext as a, type GenerateStaticParams as b, type ServerLoader as c, RedirectResponse as d };
|
package/dist/react/cache.d.mts
CHANGED
package/dist/react/cache.d.ts
CHANGED