bun-plugin-stx 0.2.229 → 0.2.231
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/serve.d.ts +13 -0
- package/dist/serve.js +5 -1
- package/package.json +1 -1
package/dist/serve.d.ts
CHANGED
|
@@ -217,6 +217,7 @@ export declare interface ServeOptions {
|
|
|
217
217
|
componentsDir?: string
|
|
218
218
|
layoutsDir?: string
|
|
219
219
|
fallbackLayoutsDir?: string
|
|
220
|
+
fallbackComponentsDir?: string
|
|
220
221
|
partialsDir?: string
|
|
221
222
|
watchDirs?: string[]
|
|
222
223
|
renderCache?: boolean
|
|
@@ -259,6 +260,18 @@ export declare interface MiddlewareContext {
|
|
|
259
260
|
cookies: Record<string, string>
|
|
260
261
|
redirect: (to: string, status?: number) => Response
|
|
261
262
|
}
|
|
263
|
+
/**
|
|
264
|
+
* The slice of Crosswind this server calls, taken from the package's own types
|
|
265
|
+
* rather than restated here.
|
|
266
|
+
*
|
|
267
|
+
* `CSSGenerator` has to be a constructor type, because it is `new`-ed below.
|
|
268
|
+
* Widening it to `unknown` satisfies the no-explicit-any rule and still fails to
|
|
269
|
+
* compile (`new (unknown)` is TS18046) — that is how d84349dd74 turned main red.
|
|
270
|
+
* Restating the shape by hand is the other trap: a stale hand-written copy is
|
|
271
|
+
* what made this hard to see in the first place (see the deleted
|
|
272
|
+
* `cwcss-crosswind.d.ts`). `typeof import` cannot drift from the real engine.
|
|
273
|
+
*/
|
|
274
|
+
declare type CrosswindEngine = Pick<typeof import('@cwcss/crosswind'), 'CSSGenerator' | 'config'>;
|
|
262
275
|
/**
|
|
263
276
|
* Middleware handler — a Laravel-style gate that either passes through
|
|
264
277
|
* (returns `void`/`null`/`undefined`) or terminates the pipeline by
|
package/dist/serve.js
CHANGED
|
@@ -9106,6 +9106,7 @@ async function serve(options) {
|
|
|
9106
9106
|
const componentsDir = options.componentsDir ?? stxConfig.componentsDir ?? defaultStxConfig.componentsDir;
|
|
9107
9107
|
const layoutsDir = options.layoutsDir ?? stxConfig.layoutsDir ?? defaultStxConfig.layoutsDir;
|
|
9108
9108
|
const fallbackLayoutsDir = options.fallbackLayoutsDir ?? stxConfig.fallbackLayoutsDir;
|
|
9109
|
+
const fallbackComponentsDir = options.fallbackComponentsDir ?? stxConfig.fallbackComponentsDir;
|
|
9109
9110
|
const partialsDir = options.partialsDir ?? stxConfig.partialsDir ?? defaultStxConfig.partialsDir;
|
|
9110
9111
|
const publicDir = options.publicDir ?? stxConfig.publicDir ?? "public";
|
|
9111
9112
|
let markPlaceholdersReady = () => {};
|
|
@@ -9831,6 +9832,7 @@ function __stxOverlay(errs){
|
|
|
9831
9832
|
...componentsDir && { componentsDir },
|
|
9832
9833
|
...layoutsDir && { layoutsDir },
|
|
9833
9834
|
...fallbackLayoutsDir && { fallbackLayoutsDir },
|
|
9835
|
+
...fallbackComponentsDir && { fallbackComponentsDir },
|
|
9834
9836
|
...partialsDir && { partialsDir },
|
|
9835
9837
|
autoShell: true,
|
|
9836
9838
|
buildMode: "serve",
|
|
@@ -10019,6 +10021,7 @@ function __stxOverlay(errs){
|
|
|
10019
10021
|
...componentsDir && { componentsDir },
|
|
10020
10022
|
...layoutsDir && { layoutsDir },
|
|
10021
10023
|
...fallbackLayoutsDir && { fallbackLayoutsDir },
|
|
10024
|
+
...fallbackComponentsDir && { fallbackComponentsDir },
|
|
10022
10025
|
...partialsDir && { partialsDir },
|
|
10023
10026
|
autoShell: true,
|
|
10024
10027
|
buildMode: "serve",
|
|
@@ -10399,6 +10402,7 @@ ${html}`;
|
|
|
10399
10402
|
...componentsDir && { componentsDir },
|
|
10400
10403
|
...layoutsDir && { layoutsDir },
|
|
10401
10404
|
...fallbackLayoutsDir && { fallbackLayoutsDir },
|
|
10405
|
+
...fallbackComponentsDir && { fallbackComponentsDir },
|
|
10402
10406
|
...partialsDir && { partialsDir },
|
|
10403
10407
|
autoShell: false
|
|
10404
10408
|
};
|
|
@@ -10506,7 +10510,7 @@ ${html}`;
|
|
|
10506
10510
|
}
|
|
10507
10511
|
const content = await getRoute(path, reqCtx);
|
|
10508
10512
|
if (reqCtx.actionRedirect) {
|
|
10509
|
-
const redirectResponse = actionRedirectResponse(reqCtx.actionRedirect, reqCtx.actionCookies);
|
|
10513
|
+
const redirectResponse = actionRedirectResponse(reqCtx.actionRedirect, reqCtx.actionCookies, reqCtx.responseHeaders);
|
|
10510
10514
|
for (const [key, value] of Object.entries(corsHeaders))
|
|
10511
10515
|
redirectResponse.headers.set(key, value);
|
|
10512
10516
|
return redirectResponse;
|
package/package.json
CHANGED