@stacksjs/stx 0.2.179 → 0.2.181
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 +871 -867
- package/dist/client-script-bundler.js +5 -2
- package/dist/component-renderer.js +1 -1
- package/dist/composable-loader.js +2 -1
- package/dist/craft.js +391 -389
- package/dist/framework-composables.js +2 -1
- package/dist/pwa.js +367 -365
- package/dist/ssg.js +348 -344
- package/dist/store-loader.js +2 -1
- package/dist/stx.d.ts +36 -2
- package/dist/utils.d.ts +1 -0
- package/dist/utils.js +31 -4
- package/dist/variable-extractor.js +2 -1
- package/package.json +5 -5
- package/stx.d.ts +36 -2
|
@@ -239,8 +239,11 @@ export { ${declNames.join(", ")} }` : "";
|
|
|
239
239
|
root: projectRoot
|
|
240
240
|
});
|
|
241
241
|
if (!result.success) {
|
|
242
|
-
const
|
|
243
|
-
console.warn("[stx:bundler] build failed:",
|
|
242
|
+
const failure = result.logs.filter((l) => l.level === "error").map((l) => l.message).join(", ") || `Unable to bundle ${path.basename(filePath)}`, details = describeBuildFailure(result.logs, filePath || void 0);
|
|
243
|
+
console.warn("[stx:bundler] build failed:", failure);
|
|
244
|
+
recordBundleFailure(filePath || "", failure, details);
|
|
245
|
+
if (resolveBundlerFallback() === "error")
|
|
246
|
+
throw Error(failure);
|
|
244
247
|
return code;
|
|
245
248
|
}
|
|
246
249
|
let bundled = "";
|
|
@@ -655,7 +655,7 @@ async function processCustomElementTags(template, context, filePath, options, de
|
|
|
655
655
|
mergedProps[key] = value;
|
|
656
656
|
for (const [key, value] of Object.entries(resolvedProps.serverDynamic))
|
|
657
657
|
mergedProps[key] = value;
|
|
658
|
-
let finalContent = await renderComponentWithSlot(componentPath, mergedProps, tag.content, componentsDir, context, filePath, options, processedComponents, dependencies);
|
|
658
|
+
let finalContent = await renderComponentWithSlot(componentPath, mergedProps, restoreStashedScripts(tag.content, stashed.scripts), componentsDir, context, filePath, options, processedComponents, dependencies);
|
|
659
659
|
if (Object.keys(resolvedProps.clientReactive).length > 0)
|
|
660
660
|
finalContent = emitClientReactiveAttrs(finalContent, resolvedProps.clientReactive);
|
|
661
661
|
if (Object.keys(resolvedProps.events).length > 0) {
|
|
@@ -5,6 +5,7 @@ import { readSigned, sourceSignature, writeSigned } from "./source-signature.js"
|
|
|
5
5
|
import { stripModuleImports } from "./store-imports.js";
|
|
6
6
|
import { STX_RUNTIME_GLOBALS } from "./runtime-globals.js";
|
|
7
7
|
import { transformStoreImports } from "./store-imports.js";
|
|
8
|
+
import { getSharedTranspiler } from "./utils.js";
|
|
8
9
|
const _cachedComposableScripts = new Map, _cachedDirs = new Map, DEFAULT_DIR_CANDIDATES = ["composables", "functions"];
|
|
9
10
|
function isSkippedFile(file) {
|
|
10
11
|
const name = path.basename(file, ".ts");
|
|
@@ -60,7 +61,7 @@ export async function getComposableScript(composablesDir) {
|
|
|
60
61
|
return null;
|
|
61
62
|
}
|
|
62
63
|
composableFiles.sort();
|
|
63
|
-
const transpiler =
|
|
64
|
+
const transpiler = getSharedTranspiler({ loader: "ts", target: "browser", define: getPublicEnvDefine() }), chunks = [], exportedNames = new Set, declaredNames = new Set;
|
|
64
65
|
for (const file of composableFiles)
|
|
65
66
|
try {
|
|
66
67
|
let code = await Bun.file(file).text();
|