@stacksjs/stx 0.2.136 → 0.2.138
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/cli.js +860 -853
- package/dist/component-client-factories.d.ts +9 -0
- package/dist/component-client-factories.js +47 -0
- package/dist/craft.js +321 -314
- package/dist/process.js +5 -0
- package/dist/pwa.js +284 -277
- package/dist/ssg.js +263 -256
- package/dist/utils.js +10 -6
- package/package.json +5 -5
package/dist/process.js
CHANGED
|
@@ -46,6 +46,7 @@ import { safeEvaluate } from "./safe-evaluator.js";
|
|
|
46
46
|
import { isProduction, isTest } from "./env.js";
|
|
47
47
|
import { warnUnbalancedTags } from "./template-tag-balance.js";
|
|
48
48
|
import { deriveLayoutGroup } from "stx-router/layout-metadata";
|
|
49
|
+
import { initializeComponentClientFactories, injectComponentClientFactories } from "./component-client-factories.js";
|
|
49
50
|
export { injectRouterScript } from "./runtime-injection.js";
|
|
50
51
|
export { processJsonDirective, processOnceDirective } from "./misc-directives.js";
|
|
51
52
|
export { validateClientScript } from "./script-validation.js";
|
|
@@ -243,6 +244,8 @@ export async function processDirectives(template, context, filePath, options, de
|
|
|
243
244
|
if (options.ssr === !1 && !options.autoShell && options.buildMode === "spa")
|
|
244
245
|
return template;
|
|
245
246
|
const isTopLevel = !context.__stxProcessingDepth;
|
|
247
|
+
if (isTopLevel)
|
|
248
|
+
initializeComponentClientFactories(context);
|
|
246
249
|
if (!context.__stxProcessingDepth)
|
|
247
250
|
context.__stxProcessingDepth = 0;
|
|
248
251
|
context.__stxProcessingDepth++;
|
|
@@ -634,6 +637,8 @@ async function processOtherDirectives(template, context, filePath, options, depe
|
|
|
634
637
|
output = processMethodDirectives(output);
|
|
635
638
|
output = await processIncludes(output, context, filePath, opts, dependencies);
|
|
636
639
|
output = await processComponents(output, context, filePath, opts, dependencies);
|
|
640
|
+
if (context.__stxProcessingDepth === 1)
|
|
641
|
+
output = injectComponentClientFactories(output, context);
|
|
637
642
|
output = output.replace(/@push\s*\(\s*['"][^'"]+['"]\s*\)[\s\S]*?@endpush/g, "");
|
|
638
643
|
output = processRefAttributes(output);
|
|
639
644
|
output = processConditionals(output, context, filePath);
|