@stacksjs/stx 0.2.139 → 0.2.141

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/utils.js CHANGED
@@ -10,6 +10,7 @@ import { processDirectives } from "./process.js";
10
10
  import { getPublicEnvDefine } from "./public-env.js";
11
11
  import { processScopedStyles } from "./style-scoping.js";
12
12
  import { findSfcTemplateBlock } from "./sfc-template.js";
13
+ import { importOnce } from "./lazy-module.js";
13
14
  export {
14
15
  extractDirectiveNames,
15
16
  getPositionInfo,
@@ -400,7 +401,7 @@ export function componentClientSignalNames(scripts) {
400
401
  return [...names];
401
402
  }
402
403
  export async function renderComponentWithSlot(componentPath, props, slotContent, componentsDir, parentContext, parentFilePath, options, processedComponents = new Set, dependencies) {
403
- const { extractVariables } = await import("./variable-extractor.js"), components = processedComponents ?? new Set;
404
+ const { extractVariables } = await importOnce("stx/variable-extractor", () => import("./variable-extractor.js")), components = processedComponents ?? new Set;
404
405
  if (components.has(componentPath))
405
406
  return `[Circular component reference: ${componentPath}]`;
406
407
  const branchComponents = new Set(components);
@@ -562,7 +563,7 @@ ${triedPaths.map((p) => ` - ${p}`).join(`
562
563
  for (const [key, val] of Object.entries(parentContext))
563
564
  if (!key.startsWith("__") || internalKeysToPreserve.has(key))
564
565
  filteredParentContext[key] = val;
565
- const { extractSlotContent } = await import("./slots.js"), parsedSlotContent = extractSlotContent(slotContent), $slots = {};
566
+ const { extractSlotContent } = await importOnce("stx/slots", () => import("./slots.js")), parsedSlotContent = extractSlotContent(slotContent), $slots = {};
566
567
  if (parsedSlotContent.defaultSlot?.trim())
567
568
  $slots.default = parsedSlotContent.defaultSlot;
568
569
  for (const [slotName, slotDef] of parsedSlotContent.namedSlots)
@@ -645,7 +646,7 @@ ${triedPaths.map((p) => ` - ${p}`).join(`
645
646
  }
646
647
  if (slotContent && templateContent.includes("{{ text || slot }}"))
647
648
  templateContent = templateContent.replace(/\{\{\s*text\s*\|\|\s*slot\s*\}\}/g, () => slotContent);
648
- const { applySlots } = await import("./slots.js"), { defaultSlot, namedSlots } = parsedSlotContent;
649
+ const { applySlots } = await importOnce("stx/slots", () => import("./slots.js")), { defaultSlot, namedSlots } = parsedSlotContent;
649
650
  templateContent = await applySlots(templateContent, defaultSlot, namedSlots, componentContext);
650
651
  for (const [key, value] of Object.entries(componentContext))
651
652
  if (typeof value === "string") {
@@ -692,13 +693,13 @@ ${triedPaths.map((p) => ` - ${p}`).join(`
692
693
  let bundledContent = cssExtraction.code;
693
694
  const vendorStyleTags = renderVendorStyleTags(cssExtraction.styles);
694
695
  bundledContent = injectBrowserCoreAutoImports(bundledContent).code;
695
- const { hasUserImports, bundleClientScript } = await import("./client-script-bundler.js");
696
+ const { hasUserImports, bundleClientScript } = await importOnce("stx/client-script-bundler", () => import("./client-script-bundler.js"));
696
697
  if (hasUserImports(bundledContent))
697
698
  bundledContent = await bundleClientScript(bundledContent, componentFilePath, {
698
699
  projectRoot: process.cwd(),
699
700
  minify: options.buildMode === "compile"
700
701
  });
701
- const { rewriteStxImportSpecifiers } = await import("./signal-processing.js");
702
+ const { rewriteStxImportSpecifiers } = await importOnce("stx/signal-processing", () => import("./signal-processing.js"));
702
703
  bundledContent = bundledContent.replace(/^\s*import\s+(?:type\s+)?\{([^}]*)\}\s+from\s+['"](?:stx|@stacksjs\/stx|@stacksjs\/browser)['"]\s*;?\s*$/gm, (_match, specifiers) => rewriteStxImportSpecifiers(specifiers));
703
704
  const content = transformStoreImports(bundledContent), componentLocalNames = extractVariableNames(content), factoryBody = `function(__scopeId) {
704
705
  ${buildRuntimeGlobalsDestructure("const", [...COMPONENT_SCOPE_LOCAL_GLOBALS, ...componentLocalNames], content)}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/stx",
3
3
  "type": "module",
4
- "version": "0.2.139",
4
+ "version": "0.2.141",
5
5
  "description": "A performant UI Framework. Powered by Bun.",
6
6
  "author": "Chris Breuer <chris@stacksjs.org>",
7
7
  "license": "MIT",
@@ -115,14 +115,14 @@
115
115
  "typecheck": "bun tsc -p tsconfig.src.json --noEmit"
116
116
  },
117
117
  "dependencies": {
118
- "@cwcss/crosswind": "^0.2.12",
118
+ "@cwcss/crosswind": "^0.2.14",
119
119
  "@stacksjs/clapp": "^0.2.0",
120
- "@stacksjs/desktop": "0.2.139",
121
- "@stacksjs/sanitizer": "0.2.139",
120
+ "@stacksjs/desktop": "0.2.141",
121
+ "@stacksjs/sanitizer": "0.2.141",
122
122
  "@stacksjs/ts-i18n": "^0.1.11",
123
- "bun-plugin-stx": "0.2.139",
123
+ "bun-plugin-stx": "0.2.141",
124
124
  "bunfig": "^0.15.15",
125
- "stx-router": "0.2.139",
125
+ "stx-router": "0.2.141",
126
126
  "ts-broadcasting": "^0.0.9",
127
127
  "ts-images": "^0.1.9",
128
128
  "ts-syntax-highlighter": "^0.2.1"