bun-plugin-stx 0.2.563 → 0.2.565

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 -3
  2. package/package.json +3 -3
package/dist/serve.js CHANGED
@@ -8716,7 +8716,7 @@ var defaultConfigDir4 = /* @__PURE__ */ resolve12(process20.cwd(), "config");
8716
8716
  var defaultGeneratedDir4 = /* @__PURE__ */ resolve12(process20.cwd(), "src/generated");
8717
8717
 
8718
8718
  // src/serve.ts
8719
- import { BUILD_ID_HEADER, decodeTitleEntities, extractPageResponseStatus, findContainerRegion, FRAGMENT_CACHE_CONTROL, getBuildId, mergeCssConfig, readResponseHeaders, readResponseStatus, renderFontCSS, SPA_NAV_HEADER, spaNavVaryHeaders, stateDir, stateDirName } from "@stacksjs/stx";
8719
+ import { BUILD_ID_HEADER, decodeTitleEntities, externalScriptsOutsideContainer, extractPageResponseStatus, findContainerRegion, FRAGMENT_CACHE_CONTROL, getBuildId, mergeCssConfig, readResponseHeaders, readResponseStatus, renderFontCSS, SPA_NAV_HEADER, spaNavVaryHeaders, stateDir, stateDirName } from "@stacksjs/stx";
8720
8720
  import { buildCodeFrame, locateFailureLine } from "@stacksjs/stx/build-message";
8721
8721
  import { clearBundleFailures, getBundleFailures } from "@stacksjs/stx/client-script-bundler";
8722
8722
  import { actionRedirectResponse, compressResponse, runPageAction as sharedRunPageAction } from "@stacksjs/stx";
@@ -11081,6 +11081,7 @@ ${block}`;
11081
11081
  mainContentEnd = mainCloseIdx;
11082
11082
  fragment = fragment.slice(mainStart, mainCloseIdx).trim();
11083
11083
  }
11084
+ const externalPageScripts = containerRegion ? externalScriptsOutsideContainer(content, containerRegion) : [];
11084
11085
  const pageSetupScripts = [];
11085
11086
  const pageSetupScriptOffsets = new Set;
11086
11087
  const appendOutsideMainScript = (match) => {
@@ -11113,10 +11114,13 @@ ${block}`;
11113
11114
  }
11114
11115
  fragment = fragment.replace(/<script data-stx-scoped>\s*;?\(function\(\)\s*\{[\s\S]*?<\/script>/g, "");
11115
11116
  const clearStale = "<script data-stx-page>if(window.stx)window.stx._latestSetup=null;</script>";
11116
- const componentFactoryScripts = pageSetupScripts.filter((script) => script.includes("data-stx-component-factories"));
11117
- const trailingPageScripts = pageSetupScripts.filter((script) => !script.includes("data-stx-component-factories"));
11117
+ const inlinePageScripts = pageSetupScripts.filter((script) => !externalPageScripts.includes(script));
11118
+ const componentFactoryScripts = inlinePageScripts.filter((script) => script.includes("data-stx-component-factories"));
11119
+ const trailingPageScripts = inlinePageScripts.filter((script) => !script.includes("data-stx-component-factories"));
11118
11120
  fragment = `${headStyles.join(`
11119
11121
  `)}
11122
+ ${externalPageScripts.join(`
11123
+ `)}
11120
11124
  ${componentFactoryScripts.join(`
11121
11125
  `)}
11122
11126
  ${fragment}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bun-plugin-stx",
3
3
  "type": "module",
4
- "version": "0.2.563",
4
+ "version": "0.2.565",
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.563",
78
- "stx-router": "0.2.563"
77
+ "@stacksjs/stx": "0.2.565",
78
+ "stx-router": "0.2.565"
79
79
  }
80
80
  }