bun-plugin-stx 0.2.899 → 0.2.901

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.
Files changed (2) hide show
  1. package/dist/serve.js +7 -4
  2. package/package.json +3 -3
package/dist/serve.js CHANGED
@@ -11540,7 +11540,8 @@ ${output}`;
11540
11540
  }
11541
11541
  if (path === "/_stx/sw.js" && stxConfig.offline?.enabled) {
11542
11542
  const stx = await stxModule;
11543
- return new Response(stx.generateOfflineWorker(stxConfig.offline, getBuildId()), {
11543
+ await discoverFiles();
11544
+ return new Response(stx.generateOfflineWorker(stxConfig.offline, getBuildId(), [...discoveredPagePaths ?? []]), {
11544
11545
  headers: {
11545
11546
  "Content-Type": "text/javascript; charset=utf-8",
11546
11547
  "Cache-Control": "no-cache",
@@ -11724,9 +11725,10 @@ ${output}`;
11724
11725
  }
11725
11726
  if (path === "/index")
11726
11727
  path = "/";
11728
+ let content;
11727
11729
  if (path === "/") {
11728
- const indexContent = await getRoute("/", reqCtx);
11729
- if (!indexContent) {
11730
+ content = await getRoute("/", reqCtx);
11731
+ if (!content) {
11730
11732
  const homeContent = await getRoute("/home", reqCtx);
11731
11733
  if (homeContent) {
11732
11734
  return new Response(null, {
@@ -11739,7 +11741,8 @@ ${output}`;
11739
11741
  }
11740
11742
  }
11741
11743
  }
11742
- const content = await getRoute(path, reqCtx);
11744
+ if (content === undefined)
11745
+ content = await getRoute(path, reqCtx);
11743
11746
  if (reqCtx.actionRedirect) {
11744
11747
  const redirectResponse = actionRedirectResponse(reqCtx.actionRedirect, reqCtx.actionCookies, reqCtx.responseHeaders);
11745
11748
  for (const [key, value] of Object.entries(corsHeaders))
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bun-plugin-stx",
3
3
  "type": "module",
4
- "version": "0.2.899",
4
+ "version": "0.2.901",
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",
@@ -74,7 +74,7 @@
74
74
  "typecheck": "bun tsc --noEmit"
75
75
  },
76
76
  "dependencies": {
77
- "@stacksjs/stx": "0.2.899",
78
- "stx-router": "0.2.899"
77
+ "@stacksjs/stx": "0.2.901",
78
+ "stx-router": "0.2.901"
79
79
  }
80
80
  }