bun-plugin-stx 0.2.70 → 0.2.72
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 +4 -4
- package/dist/serve.js +5 -0
- package/package.json +3 -3
package/dist/serve.d.ts
CHANGED
|
@@ -32,10 +32,10 @@ export declare interface ServeOptions {
|
|
|
32
32
|
site?: import('@stacksjs/stx').SiteConfig
|
|
33
33
|
routes?: Record<string, (req: Request) => Response | Promise<Response>>
|
|
34
34
|
onRequest?: (req: Request) =>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
| Response
|
|
36
|
+
| null
|
|
37
|
+
| undefined
|
|
38
|
+
| Promise<Response | null | undefined>
|
|
39
39
|
middleware?: Record<string, MiddlewareHandler>
|
|
40
40
|
globalMiddleware?: string[]
|
|
41
41
|
middlewareGroups?: Record<string, string[]>
|
package/dist/serve.js
CHANGED
|
@@ -8819,6 +8819,10 @@ async function serve(options) {
|
|
|
8819
8819
|
const partialsDir = options.partialsDir ?? stxConfig.partialsDir ?? defaultStxConfig.partialsDir;
|
|
8820
8820
|
const publicDir = options.publicDir ?? stxConfig.publicDir ?? "public";
|
|
8821
8821
|
const stxModule = options.stxModule ? Promise.resolve(options.stxModule) : defaultStxModule;
|
|
8822
|
+
let resolvedStxModule = null;
|
|
8823
|
+
Promise.resolve(stxModule).then((m) => {
|
|
8824
|
+
resolvedStxModule = m;
|
|
8825
|
+
}).catch(() => {});
|
|
8822
8826
|
const { patterns, port = 3456 } = options;
|
|
8823
8827
|
if (patterns.length === 0) {
|
|
8824
8828
|
console.error("Usage: serve <files...> [--port 3000]");
|
|
@@ -8883,6 +8887,7 @@ After installing: bun add bun-plugin-stx`);
|
|
|
8883
8887
|
routes.clear();
|
|
8884
8888
|
htmlCache.clear();
|
|
8885
8889
|
crosswindCssCache.clear();
|
|
8890
|
+
resolvedStxModule?.clearDevCaches?.();
|
|
8886
8891
|
}
|
|
8887
8892
|
broadcastHmr(isCss && !isStxLike ? { type: "css", file: f } : { type: "reload", file: f });
|
|
8888
8893
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bun-plugin-stx",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.72",
|
|
5
5
|
"description": "A Bun plugin that allows for using Laravel Blade-like syntax.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"typecheck": "bun tsc --noEmit"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@stacksjs/stx": "0.2.
|
|
77
|
-
"stx-router": "0.2.
|
|
76
|
+
"@stacksjs/stx": "0.2.72",
|
|
77
|
+
"stx-router": "0.2.72"
|
|
78
78
|
}
|
|
79
79
|
}
|