bun-plugin-stx 0.2.567 → 0.2.571

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 +5 -2
  2. package/package.json +3 -3
package/dist/serve.js CHANGED
@@ -8929,6 +8929,7 @@ var ENGINE_SPECIFIERS = [
8929
8929
  ];
8930
8930
  var defaultStxModule = import("@stacksjs/stx");
8931
8931
  var REACTIVE_TEMPLATE_DIRECTIVE_RE = /@for|:for|@if|:if|@else|:else|x-for|x-if|x-else/;
8932
+ var warnedMissingContainer = new Set;
8932
8933
  function extractServerScriptsFromTemplate(content) {
8933
8934
  const openRe = /<script\b([^>]*)>/gi;
8934
8935
  const lower = content.toLowerCase();
@@ -11058,8 +11059,10 @@ ${block}`;
11058
11059
  }
11059
11060
  const containerSelector = stxConfig?.router?.container || "main";
11060
11061
  const containerRegion = findContainerRegion(fragment, containerSelector);
11061
- if (!containerRegion) {
11062
- console.warn(`[stx] No SPA swap container matching "${containerSelector}" in ${new URL(req.url).pathname}. SPA navigation is disabled for links on this page; the full document will load instead. Add a matching element, or point router.container at one this page has.`);
11062
+ const containerPath = new URL(req.url).pathname;
11063
+ if (!containerRegion && !warnedMissingContainer.has(containerPath)) {
11064
+ warnedMissingContainer.add(containerPath);
11065
+ console.warn(`[stx] No SPA swap container matching "${containerSelector}" in ${containerPath}. SPA navigation is disabled for links on this page; the full document will load instead. Add a matching element, or point router.container at one this page has.`);
11063
11066
  }
11064
11067
  const mainOpenMatch = containerRegion ? { 0: containerRegion.openTag, index: containerRegion.openIndex } : null;
11065
11068
  const mainCloseIdx = containerRegion ? containerRegion.end : -1;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bun-plugin-stx",
3
3
  "type": "module",
4
- "version": "0.2.567",
4
+ "version": "0.2.571",
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.567",
78
- "stx-router": "0.2.567"
77
+ "@stacksjs/stx": "0.2.571",
78
+ "stx-router": "0.2.571"
79
79
  }
80
80
  }