@stacksjs/stx 0.2.144 → 0.2.145
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 +401 -409
- package/dist/client-script-bundler.js +0 -2
- package/dist/client-script.d.ts +1 -0
- package/dist/client-script.js +12 -6
- package/dist/craft.js +228 -236
- package/dist/pwa.js +195 -203
- package/dist/runtime-injection.d.ts +3 -2
- package/dist/signal-processing.d.ts +3 -2
- package/dist/signal-processing.js +1 -2
- package/dist/ssg.js +198 -206
- package/dist/variable-extractor.js +7 -5
- package/package.json +5 -5
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { StxOptions } from './types';
|
|
2
2
|
/**
|
|
3
|
-
* Inject @stacksjs/browser initialization
|
|
4
|
-
*
|
|
3
|
+
* Inject an @stacksjs/browser initialization input into a template that will
|
|
4
|
+
* continue through STX client-script processing. The later bundling pass turns
|
|
5
|
+
* this package specifier into browser-ready code.
|
|
5
6
|
*
|
|
6
7
|
* IMPORTANT: Only checks CLIENT scripts (not <script server>).
|
|
7
8
|
* Server scripts should use the server ORM directly, not browser functions.
|
|
@@ -128,8 +128,9 @@ export declare function extractExports(setupContent: string): string;
|
|
|
128
128
|
/**
|
|
129
129
|
* Main orchestrator for signal processing.
|
|
130
130
|
*
|
|
131
|
-
* Detects signal syntax, wraps scripts in setup functions,
|
|
132
|
-
*
|
|
131
|
+
* Detects signal syntax, wraps scripts in setup functions, and injects the
|
|
132
|
+
* signals runtime. Browser helpers and model bootstraps enter the same client
|
|
133
|
+
* bundle as the setup code, so rendered pages never depend on bare specifiers.
|
|
133
134
|
*/
|
|
134
135
|
export declare function processSignals(template: string, options: StxOptions, filePath?: string, serverData?: Record<string, unknown>): Promise<string>;
|
|
135
136
|
/**
|
|
@@ -3,7 +3,7 @@ import { findIfBlocks } from "./parser/index.js";
|
|
|
3
3
|
import { buildRuntimeGlobalsDestructure } from "./runtime-globals.js";
|
|
4
4
|
import { transformStoreImports } from "./store-imports.js";
|
|
5
5
|
import { shouldTranspileTypeScript, transpileTypeScript } from "./utils.js";
|
|
6
|
-
import { injectSignalsRuntime
|
|
6
|
+
import { injectSignalsRuntime } from "./runtime-injection.js";
|
|
7
7
|
import { matchScriptElement, scanAtElementPosition } from "./html-masking.js";
|
|
8
8
|
import { importOnce } from "./lazy-module.js";
|
|
9
9
|
let signalSetupCounter = 0;
|
|
@@ -918,7 +918,6 @@ export async function processSignals(template, options, filePath, serverData) {
|
|
|
918
918
|
const { output: processedOutput, setupCode } = await processScriptSetup(output, filePath, serverData);
|
|
919
919
|
output = processedOutput;
|
|
920
920
|
output = await injectSignalsRuntime(output, options);
|
|
921
|
-
output = injectBrowserRuntime(output);
|
|
922
921
|
if (setupCode) {
|
|
923
922
|
const headIdx = findMarkupIndexOutsideScripts(output, /<\/head>/i), bodyIdx = headIdx === -1 ? findMarkupIndexOutsideScripts(output, /<body[^>]*>/i) : -1;
|
|
924
923
|
if (headIdx !== -1)
|