@stacksjs/stx 0.2.583 → 0.2.584
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/{chunk-ck1yca7g.js → chunk-03qf2z4d.js} +1 -1
- package/dist/{chunk-hp9nxva6.js → chunk-07869zev.js} +4 -4
- package/dist/chunk-08g5j4fq.js +2 -0
- package/dist/chunk-0hpw65yr.js +2 -0
- package/dist/chunk-11jmasqb.js +2 -0
- package/dist/chunk-2c7ysn9s.js +2 -0
- package/dist/chunk-2wb1w0p6.js +2 -0
- package/dist/chunk-2wx2aczp.js +2 -0
- package/dist/chunk-325dn55d.js +4 -0
- package/dist/chunk-34kxj258.js +2 -0
- package/dist/{chunk-ktyctev3.js → chunk-3y5tzxm6.js} +2 -2
- package/dist/{chunk-h0a2s340.js → chunk-49xtxzr8.js} +2 -2
- package/dist/chunk-4efqcpg5.js +2 -0
- package/dist/{chunk-5kh5ehfh.js → chunk-4h58as2c.js} +2 -2
- package/dist/chunk-4k6h00kk.js +2 -0
- package/dist/{chunk-ky1426s1.js → chunk-4myvw20e.js} +10 -10
- package/dist/chunk-4szz2esp.js +2 -0
- package/dist/chunk-4wkghwag.js +2 -0
- package/dist/chunk-53grq69s.js +2 -0
- package/dist/chunk-55n8mhq4.js +2 -0
- package/dist/chunk-5s229r1e.js +2 -0
- package/dist/{chunk-521pe0hb.js → chunk-5zg3xj45.js} +4 -4
- package/dist/{chunk-ye66wc53.js → chunk-67m2prah.js} +2 -2
- package/dist/chunk-6djvj6hg.js +2 -0
- package/dist/chunk-6ebj7gfr.js +2 -0
- package/dist/{chunk-4pmgr32a.js → chunk-6hgngmn0.js} +3 -3
- package/dist/chunk-71tnfe1n.js +2 -0
- package/dist/{chunk-mjj24qpb.js → chunk-794v5crp.js} +2 -2
- package/dist/chunk-7dkwf9h5.js +2 -0
- package/dist/{chunk-cnknvvwm.js → chunk-7fghm9zy.js} +1 -1
- package/dist/{chunk-02qaqamv.js → chunk-7ra30crf.js} +7 -7
- package/dist/{chunk-117xss52.js → chunk-7xw1e8t6.js} +2 -2
- package/dist/{chunk-w6wtxj54.js → chunk-7ydavm3h.js} +2 -2
- package/dist/{chunk-qdyp2zqf.js → chunk-82bttwqm.js} +2 -2
- package/dist/chunk-8992smwz.js +2 -0
- package/dist/{chunk-qn8gdw21.js → chunk-8s7zbhdd.js} +4 -4
- package/dist/chunk-8zn83jfs.js +2 -0
- package/dist/{chunk-h3z9b6bw.js → chunk-96zgn94z.js} +11 -11
- package/dist/{chunk-6m3me7yj.js → chunk-9cpxzze0.js} +9 -9
- package/dist/{chunk-6fc8vw2v.js → chunk-9e091vkf.js} +3 -3
- package/dist/chunk-9pk5jhqa.js +3 -0
- package/dist/{chunk-09zwhsf9.js → chunk-9r5w6s80.js} +3 -3
- package/dist/{chunk-c0h2eqe0.js → chunk-a8n6mt7s.js} +2 -2
- package/dist/{chunk-ac6v3s3k.js → chunk-agy4mxn8.js} +2 -2
- package/dist/{chunk-mt9x626h.js → chunk-axz1x4r9.js} +5 -5
- package/dist/{chunk-07anexcg.js → chunk-b5van393.js} +2 -2
- package/dist/{chunk-w3rmepwy.js → chunk-bfbmdjh4.js} +2 -2
- package/dist/chunk-bqtph83n.js +2 -0
- package/dist/chunk-bs1bdhvp.js +2 -0
- package/dist/{chunk-0k5faspy.js → chunk-bsy10tz6.js} +6 -6
- package/dist/chunk-c1c4sh7t.js +2 -0
- package/dist/{chunk-dvc15djp.js → chunk-c6egfhy6.js} +2 -2
- package/dist/chunk-ce2d0hz9.js +2 -0
- package/dist/chunk-cjq9k1xb.js +2 -0
- package/dist/{chunk-ym1sb5bg.js → chunk-d2jb1rkp.js} +5 -5
- package/dist/{chunk-nhd9m8h5.js → chunk-d4awfk42.js} +6 -6
- package/dist/chunk-d9vjsqs4.js +2 -0
- package/dist/{chunk-e809x7m0.js → chunk-e26pzdxy.js} +1 -1
- package/dist/{chunk-kfwmqacd.js → chunk-e556dvy4.js} +3 -3
- package/dist/{chunk-cby4mkjf.js → chunk-e6h7pzym.js} +1 -1
- package/dist/{chunk-0dfgefjv.js → chunk-ebfpjnf3.js} +2 -2
- package/dist/chunk-ede39b7h.js +3 -0
- package/dist/chunk-f0fxyh3e.js +2 -0
- package/dist/{chunk-4srg0qbv.js → chunk-f29fk7dw.js} +2 -2
- package/dist/chunk-fjyhc41r.js +2 -0
- package/dist/{chunk-vke73gts.js → chunk-fkq55rh7.js} +1 -1
- package/dist/chunk-fn4wwgnc.js +2 -0
- package/dist/{chunk-pbwk8tzz.js → chunk-g8mxprxj.js} +1 -1
- package/dist/chunk-h2534p6q.js +2 -0
- package/dist/{chunk-2nehykbm.js → chunk-h7atbtds.js} +5 -5
- package/dist/{chunk-nh3svtvj.js → chunk-h988fxh3.js} +5 -5
- package/dist/chunk-hr34x6sx.js +2 -0
- package/dist/{chunk-en7xxgtb.js → chunk-hsy9rhct.js} +2 -2
- package/dist/chunk-hygxh993.js +2 -0
- package/dist/{chunk-s12bnv32.js → chunk-hz11wmx9.js} +2 -2
- package/dist/{chunk-wyn5rfzk.js → chunk-j7kcjgxy.js} +115 -26
- package/dist/chunk-j87tntna.js +2 -0
- package/dist/{chunk-ycj0342k.js → chunk-jqbk6pfk.js} +2 -2
- package/dist/{chunk-vkc51n9m.js → chunk-k1szsenr.js} +2 -2
- package/dist/{chunk-xp7fxc6p.js → chunk-k3rnpjxf.js} +5 -5
- package/dist/{chunk-sv08pd66.js → chunk-k71e38fk.js} +4 -4
- package/dist/chunk-kgtnfvqb.js +2 -0
- package/dist/chunk-krwrx9x9.js +2 -0
- package/dist/{chunk-je1as16r.js → chunk-m3w67x05.js} +5 -5
- package/dist/chunk-m5j8hht5.js +2 -0
- package/dist/chunk-mc8j6dwa.js +2 -0
- package/dist/{chunk-vpdx7qr3.js → chunk-mmbspaqh.js} +2 -2
- package/dist/{chunk-hzqyfdpy.js → chunk-n0t938d2.js} +7 -7
- package/dist/{chunk-8tq83fq7.js → chunk-n2gy2arh.js} +57 -57
- package/dist/chunk-n2j3pn9s.js +2 -0
- package/dist/{chunk-sv5nvfmb.js → chunk-np6nm4rq.js} +2 -2
- package/dist/chunk-ns1jqzqk.js +2 -0
- package/dist/chunk-p973efbe.js +2 -0
- package/dist/{chunk-m8tm44rq.js → chunk-pg164sdw.js} +2 -2
- package/dist/{chunk-x552npae.js → chunk-pxw4edw8.js} +4 -4
- package/dist/{chunk-1r1maqep.js → chunk-q1cvef6b.js} +3 -3
- package/dist/chunk-q765v7b2.js +2 -0
- package/dist/{chunk-96mb3brj.js → chunk-qebxzf9w.js} +3 -3
- package/dist/{chunk-jpqkm8tm.js → chunk-qf3axv86.js} +3 -3
- package/dist/{chunk-dhq80e4r.js → chunk-qhr1tkhj.js} +7 -7
- package/dist/chunk-qq59xzwc.js +2 -0
- package/dist/chunk-r0e743c3.js +2 -0
- package/dist/{chunk-qccgncp2.js → chunk-rdm5mfc5.js} +6 -6
- package/dist/chunk-s043hpvd.js +2 -0
- package/dist/{chunk-m417sp42.js → chunk-s1ptn02h.js} +3 -3
- package/dist/{chunk-g9zeybqh.js → chunk-s5vxxwg6.js} +2 -2
- package/dist/chunk-sckze59r.js +2 -0
- package/dist/chunk-sjkdpsca.js +3 -0
- package/dist/chunk-sr1md7vv.js +2845 -0
- package/dist/chunk-t431anrx.js +2 -0
- package/dist/chunk-t7mxbt40.js +2 -0
- package/dist/{chunk-r47cs92n.js → chunk-tc15vkfh.js} +2 -2
- package/dist/{chunk-6z3e1tyz.js → chunk-tnafnb23.js} +1 -1
- package/dist/{chunk-ah9xyss2.js → chunk-v8ze2q95.js} +2 -2
- package/dist/{chunk-xytkfa48.js → chunk-vf15db1j.js} +6 -6
- package/dist/chunk-vvqxbhfx.js +2 -0
- package/dist/{chunk-dm1qh2vq.js → chunk-w24qmxc3.js} +3 -3
- package/dist/chunk-w7zgftez.js +2 -0
- package/dist/chunk-wfp36qf4.js +2 -0
- package/dist/chunk-wn2gzwmv.js +2 -0
- package/dist/{chunk-wwj8zbzc.js → chunk-wywprjc5.js} +5 -5
- package/dist/chunk-x5qymgxa.js +2 -0
- package/dist/chunk-xfe2nzxd.js +2 -0
- package/dist/chunk-xjwgzp6s.js +2 -0
- package/dist/chunk-xyepqdjy.js +2 -0
- package/dist/chunk-y5ryjdpv.js +122 -0
- package/dist/{chunk-3e3dpp7w.js → chunk-y5x8xnnf.js} +3 -3
- package/dist/chunk-yhqaafsw.js +2 -0
- package/dist/{chunk-4pkpr5cg.js → chunk-z2mg470f.js} +4 -4
- package/dist/chunk-z7trbwn3.js +2 -0
- package/dist/{chunk-2943qhdt.js → chunk-zgv1h2np.js} +2 -2
- package/dist/{chunk-bj29pwm0.js → chunk-zrw1zf54.js} +3 -3
- package/dist/chunk-zxf8f71v.js +2 -0
- package/dist/chunk-zxt75k06.js +2 -0
- package/dist/cli.js +20 -20
- package/dist/client/signals-host-runtime.js +52 -1
- package/dist/client/signals-manifest-hydration-runtime.js +13 -0
- package/dist/client/signals-overlay-runtime.js +29 -6
- package/dist/client/signals-public-api-runtime.js +2 -0
- package/dist/client/signals-style-runtime.js +1 -1
- package/dist/component-renderer.js +26 -6
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/native/compiler/design-tokens.d.ts +4 -0
- package/dist/native/compiler/design-tokens.js +28 -0
- package/dist/native/compiler/headwind-to-style.d.ts +5 -4
- package/dist/native/compiler/headwind-to-style.js +105 -65
- package/dist/native/compiler/html-to-ir.d.ts +3 -1
- package/dist/native/compiler/html-to-ir.js +47 -243
- package/dist/native/compiler/inline-style.d.ts +13 -0
- package/dist/native/compiler/inline-style.js +285 -0
- package/dist/native/compiler/ir.d.ts +5 -1
- package/dist/native/compiler/render-screen.js +3 -1
- package/dist/native/compiler/style-variables.d.ts +8 -0
- package/dist/native/compiler/style-variables.js +142 -0
- package/dist/native/compiler/stylesheet-theme.d.ts +6 -0
- package/dist/native/compiler/stylesheet-theme.js +110 -0
- package/dist/native/runtime/craft-bridge.js +3 -1
- package/dist/native/runtime/native-host.d.ts +13 -2
- package/dist/native/runtime/native-host.js +237 -36
- package/dist/native/runtime/overlay-presenter.d.ts +29 -0
- package/dist/native/runtime/overlay-presenter.js +69 -0
- package/dist/native/runtime/shared-screen.js +12 -1
- package/dist/native/runtime/view-operations.d.ts +20 -0
- package/dist/native/runtime/view-operations.js +35 -0
- package/dist/native/testing-mutations.d.ts +4 -0
- package/dist/native/testing-mutations.js +64 -0
- package/dist/native/testing.d.ts +2 -0
- package/dist/native/testing.js +18 -1
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +9 -9
- package/dist/testing.js +2 -0
- package/dist/types/config-types.d.ts +2 -0
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +25 -5
- package/package.json +5 -5
- package/dist/chunk-00p22wzr.js +0 -3
- package/dist/chunk-0fx3ppnt.js +0 -2
- package/dist/chunk-0sfexf9t.js +0 -2
- package/dist/chunk-2927nax9.js +0 -2
- package/dist/chunk-2rj0ttas.js +0 -2
- package/dist/chunk-2rx9d75e.js +0 -4
- package/dist/chunk-3ae39ttg.js +0 -2
- package/dist/chunk-3x6p9me0.js +0 -2
- package/dist/chunk-440yjsk5.js +0 -2
- package/dist/chunk-58z26y07.js +0 -2
- package/dist/chunk-5db5sxy3.js +0 -3
- package/dist/chunk-5r9k9s3m.js +0 -2
- package/dist/chunk-76vza4ve.js +0 -2
- package/dist/chunk-84f9dnq5.js +0 -2
- package/dist/chunk-8tq5x4z8.js +0 -2
- package/dist/chunk-8y8bbsh5.js +0 -2
- package/dist/chunk-9kzycb15.js +0 -2
- package/dist/chunk-agfhb2qd.js +0 -2
- package/dist/chunk-ay6dzpt4.js +0 -2
- package/dist/chunk-b9njk81d.js +0 -2
- package/dist/chunk-bfbcmfww.js +0 -2
- package/dist/chunk-br01jvra.js +0 -2
- package/dist/chunk-c12y2bet.js +0 -2
- package/dist/chunk-c2nwchk0.js +0 -2
- package/dist/chunk-cxqrwvc5.js +0 -2
- package/dist/chunk-czea8zr1.js +0 -2
- package/dist/chunk-d99kfx3k.js +0 -2
- package/dist/chunk-dpn1pmxj.js +0 -2
- package/dist/chunk-dskrwa8f.js +0 -2
- package/dist/chunk-e6ycqvdm.js +0 -2
- package/dist/chunk-efgk2xv1.js +0 -2
- package/dist/chunk-fj70wq7k.js +0 -2
- package/dist/chunk-fvx6pd66.js +0 -2
- package/dist/chunk-hrbjapvr.js +0 -2
- package/dist/chunk-jc4mxq56.js +0 -2
- package/dist/chunk-jdpyxt8j.js +0 -2
- package/dist/chunk-k0zev8wc.js +0 -2
- package/dist/chunk-mhjwtkx9.js +0 -2
- package/dist/chunk-n4e02qdz.js +0 -2838
- package/dist/chunk-nx8rf4qd.js +0 -2
- package/dist/chunk-pe5bk9ns.js +0 -2
- package/dist/chunk-qb2j34sp.js +0 -2
- package/dist/chunk-qknfceta.js +0 -2
- package/dist/chunk-s932zfjz.js +0 -2
- package/dist/chunk-sf98zgw2.js +0 -2
- package/dist/chunk-sgsp4dph.js +0 -2
- package/dist/chunk-t48ws5j0.js +0 -2
- package/dist/chunk-tfxmzat6.js +0 -122
- package/dist/chunk-thbc9gtj.js +0 -2
- package/dist/chunk-tms7amrb.js +0 -2
- package/dist/chunk-tn9v10q2.js +0 -2
- package/dist/chunk-v0zgarvv.js +0 -2
- package/dist/chunk-v9jd283e.js +0 -2
- package/dist/chunk-vczw73ga.js +0 -2
- package/dist/chunk-webrqm20.js +0 -2
- package/dist/chunk-wg2w7zmt.js +0 -3
- package/dist/chunk-wgkxgsqx.js +0 -2
- package/dist/chunk-wngqr949.js +0 -2
- package/dist/chunk-xyzy84x0.js +0 -2
- package/dist/chunk-y1jffvkj.js +0 -2
- package/dist/chunk-yas134jv.js +0 -2
- package/dist/chunk-yd55vynh.js +0 -2
- package/dist/chunk-yygze2s0.js +0 -2
- package/dist/chunk-z732tf98.js +0 -2
- package/dist/chunk-ze86h6vp.js +0 -2
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export function validateTestMutations(source, operations) {
|
|
2
|
+
const containers = new Set(["View", "SafeAreaView", "ScrollView", "KeyboardAvoidingView", "Modal", "Pressable", "TouchableOpacity", "TouchableHighlight", "ImageBackground", "FlatList", "SectionList", "Fragment", "Svg", "G", "Map"].map((type) => type.toLowerCase())), nodes = new Map([...source].map(([id, node]) => [id, {
|
|
3
|
+
type: node.type,
|
|
4
|
+
parent: null,
|
|
5
|
+
children: node.children.filter((child) => typeof child !== "string").map((child) => child.id)
|
|
6
|
+
}]));
|
|
7
|
+
for (const [id, node] of nodes)
|
|
8
|
+
for (const child of node.children) {
|
|
9
|
+
const entry = nodes.get(child);
|
|
10
|
+
if (entry)
|
|
11
|
+
entry.parent = id;
|
|
12
|
+
}
|
|
13
|
+
const drop = (id) => {
|
|
14
|
+
const node = nodes.get(id);
|
|
15
|
+
if (!node)
|
|
16
|
+
return;
|
|
17
|
+
node.children.forEach(drop);
|
|
18
|
+
nodes.delete(id);
|
|
19
|
+
};
|
|
20
|
+
for (const [operationIndex, op] of operations.entries()) {
|
|
21
|
+
const fail = (code, message) => ({ code, message, operationIndex });
|
|
22
|
+
if (op.op === "createNode") {
|
|
23
|
+
if (nodes.has(op.id))
|
|
24
|
+
return fail("DUPLICATE_NODE", `Node ${op.id} already exists`);
|
|
25
|
+
if (!op.node?.type)
|
|
26
|
+
return fail("INVALID_NODE", "createNode requires a node type");
|
|
27
|
+
nodes.set(op.id, { type: op.node.type, parent: null, children: [] });
|
|
28
|
+
} else if (op.op === "insertChild" || op.op === "moveChild") {
|
|
29
|
+
const parent = nodes.get(op.parentId), child = nodes.get(op.childId);
|
|
30
|
+
if (!parent)
|
|
31
|
+
return fail("UNKNOWN_PARENT", `Node ${op.parentId} does not exist`);
|
|
32
|
+
if (!child)
|
|
33
|
+
return fail("UNKNOWN_NODE", `Node ${op.childId} does not exist`);
|
|
34
|
+
if (!containers.has(parent.type.toLowerCase()))
|
|
35
|
+
return fail("INVALID_PARENT", `Node ${op.parentId} cannot contain children`);
|
|
36
|
+
if (op.op === "insertChild" && child.parent !== null)
|
|
37
|
+
return fail("NODE_ATTACHED", `Node ${op.childId} already has a parent`);
|
|
38
|
+
if (op.op === "moveChild") {
|
|
39
|
+
if (child.parent !== op.parentId || !parent.children.includes(op.childId))
|
|
40
|
+
return fail("NOT_A_CHILD", `Node ${op.childId} is not a child of ${op.parentId}`);
|
|
41
|
+
parent.children.splice(parent.children.indexOf(op.childId), 1);
|
|
42
|
+
}
|
|
43
|
+
for (let id = op.parentId;id; id = nodes.get(id)?.parent ?? null)
|
|
44
|
+
if (id === op.childId)
|
|
45
|
+
return fail("CYCLE", "Placement would create a cycle");
|
|
46
|
+
if (!Number.isInteger(op.index) || op.index < 0 || op.index > parent.children.length)
|
|
47
|
+
return fail("INVALID_INDEX", `Index must be between 0 and ${parent.children.length}`);
|
|
48
|
+
parent.children.splice(op.index, 0, op.childId);
|
|
49
|
+
child.parent = op.parentId;
|
|
50
|
+
} else if (op.op === "removeNode" || op.op === "updateNode") {
|
|
51
|
+
const node = nodes.get(op.id);
|
|
52
|
+
if (!node)
|
|
53
|
+
return fail("UNKNOWN_NODE", `Node ${op.id} does not exist`);
|
|
54
|
+
if (op.op === "removeNode") {
|
|
55
|
+
const parent = node.parent ? nodes.get(node.parent) : null;
|
|
56
|
+
if (parent)
|
|
57
|
+
parent.children = parent.children.filter((id) => id !== op.id);
|
|
58
|
+
drop(op.id);
|
|
59
|
+
}
|
|
60
|
+
} else
|
|
61
|
+
return fail("INVALID_OPERATION", `Unknown mutation ${op.op}`);
|
|
62
|
+
}
|
|
63
|
+
return null;
|
|
64
|
+
}
|
package/dist/native/testing.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type TestMutationError } from './testing-mutations';
|
|
1
2
|
import path from 'node:path';
|
|
2
3
|
import vm from 'node:vm';
|
|
3
4
|
/** Wait for `check` to hold, polling every 5ms; throws after `timeoutMs`. */
|
|
@@ -68,6 +69,7 @@ export declare interface NativeScreenOptions {
|
|
|
68
69
|
export declare interface NativeScreen {
|
|
69
70
|
nodes: Map<string, NativeNode>
|
|
70
71
|
messages: NativeMessage[]
|
|
72
|
+
mutationErrors: TestMutationError[]
|
|
71
73
|
requests: string[]
|
|
72
74
|
headers: Array<Record<string, string>>
|
|
73
75
|
opened: string[]
|
package/dist/native/testing.js
CHANGED
|
@@ -2,6 +2,7 @@ var {require}=import.meta;import path from "node:path";
|
|
|
2
2
|
import vm from "node:vm";
|
|
3
3
|
import { compileSharedScreenBundle } from "./compiler/bundle.js";
|
|
4
4
|
import { NativeFormData } from "./runtime/jsc-globals.js";
|
|
5
|
+
import { validateTestMutations } from "./testing-mutations.js";
|
|
5
6
|
import { createTempDir } from "../temp-dir.js";
|
|
6
7
|
|
|
7
8
|
export class StatusAnswer {
|
|
@@ -69,7 +70,7 @@ export function mountNativeScreen(code, screen, options = {}) {
|
|
|
69
70
|
intervals.delete(id);
|
|
70
71
|
clearInterval(id);
|
|
71
72
|
}
|
|
72
|
-
}, apiBase = options.apiBase || "", label = options.requestLabel || ((method, at, init) => `${method} ${at}${init.headers && Object.keys(init.headers).some((name) => name.toLowerCase() === "authorization") ? "" : " (guest)"}`), nodes = new Map, messages = [], requests = [], headers = [], opened = [], replaced = [], moves = [], stored = copy(options.storage ?? {}), natives = [], animations = [], streams = [], secureStorage = { ...options.keychain, ...options.secureStorage }, sessionTokenKey = options.sessionTokenKey ?? "auth.token", sessionWritten = (key, previous) => {
|
|
73
|
+
}, apiBase = options.apiBase || "", label = options.requestLabel || ((method, at, init) => `${method} ${at}${init.headers && Object.keys(init.headers).some((name) => name.toLowerCase() === "authorization") ? "" : " (guest)"}`), nodes = new Map, messages = [], mutationErrors = [], requests = [], headers = [], opened = [], replaced = [], moves = [], stored = copy(options.storage ?? {}), natives = [], animations = [], streams = [], secureStorage = { ...options.keychain, ...options.secureStorage }, sessionTokenKey = options.sessionTokenKey ?? "auth.token", sessionWritten = (key, previous) => {
|
|
73
74
|
if (key !== sessionTokenKey || options.sessionEvents === !1)
|
|
74
75
|
return;
|
|
75
76
|
const token = secureStorage[key] || null;
|
|
@@ -251,6 +252,17 @@ export function mountNativeScreen(code, screen, options = {}) {
|
|
|
251
252
|
postMessage: (raw) => {
|
|
252
253
|
const message = JSON.parse(raw);
|
|
253
254
|
messages.push(JSON.parse(raw));
|
|
255
|
+
if (message.type === "MUTATE") {
|
|
256
|
+
const error = validateTestMutations(nodes, message.payload.operations || []);
|
|
257
|
+
if (error) {
|
|
258
|
+
mutationErrors.push(error);
|
|
259
|
+
queueMicrotask(() => {
|
|
260
|
+
if (!ended)
|
|
261
|
+
receive(JSON.stringify({ type: "MUTATION_ERROR", payload: { ...error, version: 1, batchId: message.payload.batchId } }));
|
|
262
|
+
});
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
254
266
|
if (message.payload.document)
|
|
255
267
|
visit(message.payload.document);
|
|
256
268
|
for (const operation of message.payload.operations || []) {
|
|
@@ -374,6 +386,7 @@ export function mountNativeScreen(code, screen, options = {}) {
|
|
|
374
386
|
return {
|
|
375
387
|
nodes,
|
|
376
388
|
messages,
|
|
389
|
+
mutationErrors,
|
|
377
390
|
requests,
|
|
378
391
|
headers,
|
|
379
392
|
opened,
|
|
@@ -440,6 +453,10 @@ export function mountNativeScreen(code, screen, options = {}) {
|
|
|
440
453
|
await Bun.sleep(ms);
|
|
441
454
|
while (performance.now() - started < 5000 && (fetching > 0 || performance.now() - answeredAt < ms))
|
|
442
455
|
await Bun.sleep(5);
|
|
456
|
+
if (mutationErrors.length) {
|
|
457
|
+
const error = mutationErrors[0];
|
|
458
|
+
throw Error(`Native mutation rejected (${error.code}, operation ${error.operationIndex}): ${error.message}`);
|
|
459
|
+
}
|
|
443
460
|
},
|
|
444
461
|
operations: () => messages.filter((message) => message.type === "MUTATE").flatMap((message) => message.payload.operations || []),
|
|
445
462
|
get ended() {
|
package/dist/pwa.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
Icon generation requires the sharp package for image processing.`),e.success=!1,e}let g=await c.default(o).metadata();if(g.width&&g.width<512)e.warnings.push(`Source icon is ${g.width}x${g.height}. Recommend using at least 512x512 for best quality.`);for(let i of s){let d=u.join(a,`icon-${i}x${i}.png`);if(await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d),l){let x=u.join(a,`icon-${i}x${i}.webp`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).webp({quality:90}).toFile(x),e.generatedFiles.push(x)}}if(p){for(let d of S){let x=u.join(a,`apple-touch-icon-${d}x${d}.png`);await c.default(o).resize(d,d,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(x),e.generatedFiles.push(x)}let i=u.join(a,"apple-touch-icon.png");await c.default(o).resize(180,180,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(i),e.generatedFiles.push(i)}for(let i of P){let d=u.join(a,`favicon-${i}x${i}.png`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d)}let f=512,y=u.join(a,`icon-maskable-${f}x${f}.png`),m=Math.floor(f*0.1),k=f-m*2;await c.default(o).resize(k,k,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).extend({top:m,bottom:m,left:m,right:m,background:{r:255,g:255,b:255,alpha:1}}).png().toFile(y),e.generatedFiles.push(y)}catch(c){let h=c instanceof Error?c.message:String(c);e.errors.push(`Icon generation failed: ${h}`),e.success=!1}return e}function N(n){let t=n.sizes||v,e=n.outputDir?`/${n.outputDir}`:"/pwa-icons",r=n.generateWebP??!0,o=n.generateAppleIcons??!0,a=[];for(let s of t)if(a.push(`${e}/icon-${s}x${s}.png`),r)a.push(`${e}/icon-${s}x${s}.webp`);if(o){a.push(`${e}/apple-touch-icon.png`);for(let s of S)a.push(`${e}/apple-touch-icon-${s}x${s}.png`)}for(let s of P)a.push(`${e}/favicon-${s}x${s}.png`);return a.push(`${e}/icon-maskable-512x512.png`),a}async function I(){try{return await import("sharp"),!0}catch{return!1}}function A(n,t,e,r){let o=[],a=r.join(" ");for(let s of n)if(o.push({src:`${t}/icon-${s}x${s}.png`,sizes:`${s}x${s}`,type:"image/png",purpose:a}),e)o.push({src:`${t}/icon-${s}x${s}.webp`,sizes:`${s}x${s}`,type:"image/webp",purpose:a});return o}function C(n){return n.map((t)=>({name:t.name,short_name:t.shortName,description:t.description,url:t.url,icons:t.icons?.map((e)=>({src:e.src,sizes:e.sizes,type:e.type}))}))}function T(n){let t=n.pwa?.shareTarget;if(!t?.enabled)return;let e={action:t.action||"/share",method:t.method||"POST",enctype:t.enctype||"multipart/form-data",params:{title:t.params?.title||"title",text:t.params?.text||"text",url:t.params?.url||"url"}};if(t.acceptFiles&&t.acceptFiles.length>0)e.params.files=t.acceptFiles.map((r)=>({name:r.name,accept:r.accept}));return e}function H(n){let t=n.pwa?.fileHandlers;if(!t?.enabled||!t.accept)return;let e=[{action:t.action||"/",accept:t.accept,launch_type:t.launchType||"single-client"}];if(t.icons)e[0].icons=t.icons.map((r)=>({src:r.src,sizes:r.sizes,type:r.type}));return e}function W(n){let t=n.pwa?.protocolHandlers;if(!t||t.length===0)return;return t.map((e)=>({protocol:e.protocol,url:e.url}))}function j(n){let t=n.pwa;if(!t?.enabled||!t.manifest)return null;let{manifest:e,icons:r}=t,o=r?.sizes||[72,96,128,144,152,192,384,512],a=r?.outputDir?`/${r.outputDir}`:"/pwa-icons",s=r?.generateWebP??!0,l=r?.purpose||["any","maskable"],p={name:e.name,short_name:e.shortName||e.name,description:e.description,start_url:e.startUrl||"/",display:e.display||"standalone",display_override:e.displayOverride,orientation:e.orientation,theme_color:e.themeColor,background_color:e.backgroundColor,scope:e.scope||"/",lang:e.lang,dir:e.dir,id:e.id,categories:e.categories,icons:A(o,a,s,l)};if(e.shortcuts&&e.shortcuts.length>0)p.shortcuts=C(e.shortcuts);if(e.screenshots&&e.screenshots.length>0)p.screenshots=e.screenshots.map((f)=>({src:f.src,sizes:f.sizes,type:f.type,label:f.label,form_factor:f.platform}));let c=T(n);if(c)p.share_target=c;let h=H(n);if(h)p.file_handlers=h;let g=W(n);if(g)p.protocol_handlers=g;if(e.launchHandler)p.launch_handler={client_mode:e.launchHandler};if(e.handleLinks)p.handle_links=e.handleLinks;if(e.edgeSidePanel?.enabled)p.edge_side_panel={preferred_width:e.edgeSidePanel.preferredWidth};return p}function _(n){let t=j(n);if(!t)return"";let e=JSON.parse(JSON.stringify(t));return JSON.stringify(e,null,2)}function q(n,t){return{...t,...n,shortcuts:n.shortcuts||t.shortcuts,screenshots:n.screenshots||t.screenshots,categories:n.categories||t.categories}}function D(n){let t=[],e=n.pwa;if(!e?.enabled)return t;let r=e.manifest;if(!r)return t.push("PWA manifest configuration is missing"),t;if(!r.name)t.push("Manifest name is required");let o=["fullscreen","standalone","minimal-ui","browser"];if(r.display&&!o.includes(r.display))t.push(`Invalid display mode: ${r.display}. Must be one of: ${o.join(", ")}`);let a=["any","natural","landscape","landscape-primary","landscape-secondary","portrait","portrait-primary","portrait-secondary"];if(r.orientation&&!a.includes(r.orientation))t.push(`Invalid orientation: ${r.orientation}`);let s=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;if(r.themeColor&&!s.test(r.themeColor))t.push(`Invalid theme color: ${r.themeColor}. Must be a valid hex color.`);if(r.backgroundColor&&!s.test(r.backgroundColor))t.push(`Invalid background color: ${r.backgroundColor}. Must be a valid hex color.`);if(e.shareTarget?.enabled){if(!e.shareTarget.action)t.push("Share target action URL is required")}if(e.fileHandlers?.enabled){if(!e.fileHandlers.accept||Object.keys(e.fileHandlers.accept).length===0)t.push("File handlers must specify accepted MIME types")}if(e.protocolHandlers)for(let l of e.protocolHandlers){if(!l.protocol)t.push("Protocol handler missing protocol");if(!l.url||!l.url.includes("%s"))t.push(`Protocol handler URL must contain %s placeholder: ${l.protocol}`)}return t}import z from"path";async function F(n){let t=n.pwa?.offline;if(!t?.enabled)return"";if(t.page){let e=z.isAbsolute(t.page)?t.page:z.resolve(process.cwd(),t.page);if(await Bun.file(e).exists())try{let{processDirectives:r}=await import("./chunk-
|
|
2
|
+
import{Yn,je,ni,lc}from"./chunk-07869zev.js";import{Jn,ss,ic,ac,cc}from"./chunk-vf15db1j.js";import{Qo,ei,ti,sc,oc}from"./chunk-a8n6mt7s.js";import{ae,bt,os}from"./chunk-qf3axv86.js";import{dl,pl,fl,gl,Rr,Dd}from"./chunk-67m2prah.js";import B from"fs";import w from"path";import O from"fs";import u from"path";var v=[72,96,128,144,152,192,384,512],S=[120,152,167,180],P=[16,32];async function M(n,t){let e={success:!0,generatedFiles:[],errors:[],warnings:[]},r=n.pwa?.icons;if(!r?.src)return e.errors.push("No source icon specified in pwa.icons.src"),e.success=!1,e;let o=u.isAbsolute(r.src)?r.src:u.resolve(process.cwd(),r.src);if(!await Bun.file(o).exists())return e.errors.push(`Source icon not found: ${o}`),e.success=!1,e;let a=u.resolve(t,r.outputDir||"pwa-icons");try{O.mkdirSync(a,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${a}`),e.success=!1,e}let s=r.sizes||v,l=r.generateWebP??!0,p=r.generateAppleIcons??!0;try{let c;try{c=await import("sharp")}catch{return e.errors.push(`sharp is not installed. Install it with: bun add sharp
|
|
3
|
+
Icon generation requires the sharp package for image processing.`),e.success=!1,e}let g=await c.default(o).metadata();if(g.width&&g.width<512)e.warnings.push(`Source icon is ${g.width}x${g.height}. Recommend using at least 512x512 for best quality.`);for(let i of s){let d=u.join(a,`icon-${i}x${i}.png`);if(await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d),l){let x=u.join(a,`icon-${i}x${i}.webp`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).webp({quality:90}).toFile(x),e.generatedFiles.push(x)}}if(p){for(let d of S){let x=u.join(a,`apple-touch-icon-${d}x${d}.png`);await c.default(o).resize(d,d,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(x),e.generatedFiles.push(x)}let i=u.join(a,"apple-touch-icon.png");await c.default(o).resize(180,180,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(i),e.generatedFiles.push(i)}for(let i of P){let d=u.join(a,`favicon-${i}x${i}.png`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d)}let f=512,y=u.join(a,`icon-maskable-${f}x${f}.png`),m=Math.floor(f*0.1),k=f-m*2;await c.default(o).resize(k,k,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).extend({top:m,bottom:m,left:m,right:m,background:{r:255,g:255,b:255,alpha:1}}).png().toFile(y),e.generatedFiles.push(y)}catch(c){let h=c instanceof Error?c.message:String(c);e.errors.push(`Icon generation failed: ${h}`),e.success=!1}return e}function N(n){let t=n.sizes||v,e=n.outputDir?`/${n.outputDir}`:"/pwa-icons",r=n.generateWebP??!0,o=n.generateAppleIcons??!0,a=[];for(let s of t)if(a.push(`${e}/icon-${s}x${s}.png`),r)a.push(`${e}/icon-${s}x${s}.webp`);if(o){a.push(`${e}/apple-touch-icon.png`);for(let s of S)a.push(`${e}/apple-touch-icon-${s}x${s}.png`)}for(let s of P)a.push(`${e}/favicon-${s}x${s}.png`);return a.push(`${e}/icon-maskable-512x512.png`),a}async function I(){try{return await import("sharp"),!0}catch{return!1}}function A(n,t,e,r){let o=[],a=r.join(" ");for(let s of n)if(o.push({src:`${t}/icon-${s}x${s}.png`,sizes:`${s}x${s}`,type:"image/png",purpose:a}),e)o.push({src:`${t}/icon-${s}x${s}.webp`,sizes:`${s}x${s}`,type:"image/webp",purpose:a});return o}function C(n){return n.map((t)=>({name:t.name,short_name:t.shortName,description:t.description,url:t.url,icons:t.icons?.map((e)=>({src:e.src,sizes:e.sizes,type:e.type}))}))}function T(n){let t=n.pwa?.shareTarget;if(!t?.enabled)return;let e={action:t.action||"/share",method:t.method||"POST",enctype:t.enctype||"multipart/form-data",params:{title:t.params?.title||"title",text:t.params?.text||"text",url:t.params?.url||"url"}};if(t.acceptFiles&&t.acceptFiles.length>0)e.params.files=t.acceptFiles.map((r)=>({name:r.name,accept:r.accept}));return e}function H(n){let t=n.pwa?.fileHandlers;if(!t?.enabled||!t.accept)return;let e=[{action:t.action||"/",accept:t.accept,launch_type:t.launchType||"single-client"}];if(t.icons)e[0].icons=t.icons.map((r)=>({src:r.src,sizes:r.sizes,type:r.type}));return e}function W(n){let t=n.pwa?.protocolHandlers;if(!t||t.length===0)return;return t.map((e)=>({protocol:e.protocol,url:e.url}))}function j(n){let t=n.pwa;if(!t?.enabled||!t.manifest)return null;let{manifest:e,icons:r}=t,o=r?.sizes||[72,96,128,144,152,192,384,512],a=r?.outputDir?`/${r.outputDir}`:"/pwa-icons",s=r?.generateWebP??!0,l=r?.purpose||["any","maskable"],p={name:e.name,short_name:e.shortName||e.name,description:e.description,start_url:e.startUrl||"/",display:e.display||"standalone",display_override:e.displayOverride,orientation:e.orientation,theme_color:e.themeColor,background_color:e.backgroundColor,scope:e.scope||"/",lang:e.lang,dir:e.dir,id:e.id,categories:e.categories,icons:A(o,a,s,l)};if(e.shortcuts&&e.shortcuts.length>0)p.shortcuts=C(e.shortcuts);if(e.screenshots&&e.screenshots.length>0)p.screenshots=e.screenshots.map((f)=>({src:f.src,sizes:f.sizes,type:f.type,label:f.label,form_factor:f.platform}));let c=T(n);if(c)p.share_target=c;let h=H(n);if(h)p.file_handlers=h;let g=W(n);if(g)p.protocol_handlers=g;if(e.launchHandler)p.launch_handler={client_mode:e.launchHandler};if(e.handleLinks)p.handle_links=e.handleLinks;if(e.edgeSidePanel?.enabled)p.edge_side_panel={preferred_width:e.edgeSidePanel.preferredWidth};return p}function _(n){let t=j(n);if(!t)return"";let e=JSON.parse(JSON.stringify(t));return JSON.stringify(e,null,2)}function q(n,t){return{...t,...n,shortcuts:n.shortcuts||t.shortcuts,screenshots:n.screenshots||t.screenshots,categories:n.categories||t.categories}}function D(n){let t=[],e=n.pwa;if(!e?.enabled)return t;let r=e.manifest;if(!r)return t.push("PWA manifest configuration is missing"),t;if(!r.name)t.push("Manifest name is required");let o=["fullscreen","standalone","minimal-ui","browser"];if(r.display&&!o.includes(r.display))t.push(`Invalid display mode: ${r.display}. Must be one of: ${o.join(", ")}`);let a=["any","natural","landscape","landscape-primary","landscape-secondary","portrait","portrait-primary","portrait-secondary"];if(r.orientation&&!a.includes(r.orientation))t.push(`Invalid orientation: ${r.orientation}`);let s=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;if(r.themeColor&&!s.test(r.themeColor))t.push(`Invalid theme color: ${r.themeColor}. Must be a valid hex color.`);if(r.backgroundColor&&!s.test(r.backgroundColor))t.push(`Invalid background color: ${r.backgroundColor}. Must be a valid hex color.`);if(e.shareTarget?.enabled){if(!e.shareTarget.action)t.push("Share target action URL is required")}if(e.fileHandlers?.enabled){if(!e.fileHandlers.accept||Object.keys(e.fileHandlers.accept).length===0)t.push("File handlers must specify accepted MIME types")}if(e.protocolHandlers)for(let l of e.protocolHandlers){if(!l.protocol)t.push("Protocol handler missing protocol");if(!l.url||!l.url.includes("%s"))t.push(`Protocol handler URL must contain %s placeholder: ${l.protocol}`)}return t}import z from"path";async function F(n){let t=n.pwa?.offline;if(!t?.enabled)return"";if(t.page){let e=z.isAbsolute(t.page)?t.page:z.resolve(process.cwd(),t.page);if(await Bun.file(e).exists())try{let{processDirectives:r}=await import("./chunk-55n8mhq4.js"),o=await Bun.file(e).text();return await r(o,{},e,n,new Set)}catch(r){console.warn(`[PWA] Failed to process custom offline page: ${r}`)}else console.warn(`[PWA] Custom offline page not found: ${e}`)}return E(n)}function E(n){let t=n.pwa?.offline,e=n.pwa?.manifest,r=t?.fallbackTitle||"You are offline",o=t?.fallbackMessage||"Please check your internet connection and try again.",a=e?.themeColor||"#4f46e5",s=e?.shortName||e?.name||"App";return`<!DOCTYPE html>
|
|
4
4
|
<html lang="en">
|
|
5
5
|
<head>
|
|
6
6
|
<meta charset="UTF-8">
|
|
@@ -233,4 +233,4 @@ Icon generation requires the sharp package for image processing.`),e.success=!1,
|
|
|
233
233
|
}, 5000);
|
|
234
234
|
</script>
|
|
235
235
|
</body>
|
|
236
|
-
</html>`}function b(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}async function re(n,t){let e={success:!0,files:{icons:[]},errors:[],warnings:[]},r=n.pwa;if(!r?.enabled)return e;try{B.mkdirSync(t,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${t}`),e.success=!1,e}try{let a=_(n);if(a){let s=w.join(t,"manifest.json");await Bun.write(s,a),e.files.manifest=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate manifest.json: ${s}`),e.success=!1}if(r.icons?.src)if(await I()){let s=await M(n,t);if(e.files.icons=s.generatedFiles,e.warnings.push(...s.warnings),!s.success)e.errors.push(...s.errors),e.success=!1}else e.warnings.push("sharp is not installed. Skipping icon generation. Install with: bun add sharp");if(r.offline?.enabled)try{let a=await F(n);if(a){let s=w.join(t,"offline.html");await Bun.write(s,a),e.files.offlinePage=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate offline page: ${s}`),e.success=!1}let o;if(r.precache?.enabled){let a=ae(t,n);o={fileCount:a.fileCount,totalSize:a.totalSize},e.precacheStats=o}try{let a=
|
|
236
|
+
</html>`}function b(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}async function re(n,t){let e={success:!0,files:{icons:[]},errors:[],warnings:[]},r=n.pwa;if(!r?.enabled)return e;try{B.mkdirSync(t,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${t}`),e.success=!1,e}try{let a=_(n);if(a){let s=w.join(t,"manifest.json");await Bun.write(s,a),e.files.manifest=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate manifest.json: ${s}`),e.success=!1}if(r.icons?.src)if(await I()){let s=await M(n,t);if(e.files.icons=s.generatedFiles,e.warnings.push(...s.warnings),!s.success)e.errors.push(...s.errors),e.success=!1}else e.warnings.push("sharp is not installed. Skipping icon generation. Install with: bun add sharp");if(r.offline?.enabled)try{let a=await F(n);if(a){let s=w.join(t,"offline.html");await Bun.write(s,a),e.files.offlinePage=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate offline page: ${s}`),e.success=!1}let o;if(r.precache?.enabled){let a=ae(t,n);o={fileCount:a.fileCount,totalSize:a.totalSize},e.precacheStats=o}try{let a=Yn(n,t);if(a){let s=je(n),l=w.join(t,s);await Bun.write(l,a),e.files.serviceWorker=l}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate service worker: ${s}`),e.success=!1}return e}function se(n,t){return ss(n,t)}function oe(n){return n.pwa?.enabled===!0}export{S as APPLE_TOUCH_ICON_SIZES,v as DEFAULT_ICON_SIZES,P as FAVICON_SIZES,ei as auditBuildOutput,Qo as auditConfig,re as buildPwaAssets,ti as calculateAuditResult,oc as formatAuditResult,os as formatSize,j as generateManifest,_ as generateManifestJson,ac as generateManifestLink,F as generateOfflinePage,ae as generatePrecacheManifest,bt as generatePrecacheManifestJs,M as generatePwaIcons,Jn as generatePwaTags,Yn as generateServiceWorker,lc as generateServiceWorkerAuto,ic as generateSwRegistrationScript,cc as generateThemeColorMeta,N as getExpectedIconPaths,je as getServiceWorkerFileName,ss as injectPwaTags,oe as isPwaEnabled,I as isSharpAvailable,ni as isWorkboxEnabled,q as mergeManifestConfig,se as processPwaHtml,Rr as pwaDirectives,dl as pwaInstallDirective,fl as pwaOfflineDirective,gl as pwaPushDirective,pl as pwaUpdateDirective,Dd as registerPwaDirectives,sc as runPwaAudit,D as validateManifest};
|
package/dist/ssg.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
3
|
-
`)}class
|
|
2
|
+
import"./chunk-3y5tzxm6.js";import"./chunk-qhr1tkhj.js";import"./chunk-v8ze2q95.js";import{st,ot,it,at,ct,lt}from"./chunk-pxw4edw8.js";import"./chunk-c6egfhy6.js";import"./chunk-mmbspaqh.js";import{f,Ue,L,J,n,o}from"./chunk-sr1md7vv.js";import"./chunk-9cpxzze0.js";import{yr}from"./chunk-7ra30crf.js";import"./chunk-k1szsenr.js";import"./chunk-zgv1h2np.js";import"./chunk-82bttwqm.js";import"./chunk-k71e38fk.js";import"./chunk-h988fxh3.js";import{ce,vt,wt}from"./chunk-z2mg470f.js";import{Jo,Yo,Zo}from"./chunk-zrw1zf54.js";import{yt,an,cn}from"./chunk-9pk5jhqa.js";import"./chunk-w24qmxc3.js";import{a}from"./chunk-sjkdpsca.js";import x from"fs";import g from"path";import{createHash as Dt}from"crypto";function Rt(t){try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return t}}var kt=/<script\s+type="stx\/island"\s+data-stx-island="([^"]+)"([^>]*)>([\s\S]*?)<\/script>/g;function Ct(t){return Bun.hash(t).toString(16)}function ut(t,i={}){if(!t.includes('type="stx/island"'))return{html:t,chunks:[]};let s=new Map,r=t.replace(kt,(e,l,w,y)=>{let h=y.trim();if(!h)return e;if(/\bdata-stx-src=/.test(w))return e;if(i.minify)h=Rt(h);let S=Ct(h);if(!s.has(S))s.set(S,h);let P=i.integrity?` data-stx-integrity="sha384-${Dt("sha384").update(h).digest("base64")}"`:"";return`<script type="stx/island" data-stx-island="${l}" data-stx-src="/_stx/islands/${S}.js"${P}${w}></script>`}),c=Array.from(s,([e,l])=>({hash:e,code:l}));return{html:r,chunks:c}}var Et=new Set(["visible","idle"]);function dt(t){if(!t.includes("data-stx-src="))return t;let i=new Map,s=/data-stx-scope="([^"]+)"[^>]*?stx-hydrate="([^"]+)"/g,r;while((r=s.exec(t))!==null)i.set(r[1],r[2]);let c=new Set,e=/data-stx-island="([^"]+)"[^>]*?data-stx-src="([^"]+)"/g,l;while((l=e.exec(t))!==null)if(Et.has(i.get(l[1])||""))c.add(l[2]);let w=t.lastIndexOf("</head>");if(c.size===0||w===-1)return t;let y=Array.from(c).filter((h)=>!t.includes(`rel="prefetch" href="${h}"`)).map((h)=>`<link rel="prefetch" href="${h}" as="script">`).join("");if(!y)return t;return t.slice(0,w)+y+t.slice(w)}var It=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function q(t){let i=t.trim();if(!i)return null;let s=/^https?:\/\//i.test(i)?i:`https://${i}`;try{return new URL(s).origin+new URL(s).pathname.replace(/\/$/,"")}catch{return null}}function Bt(t){for(let i of It){let s=t[i];if(!s)continue;let r=q(s);if(r)return{url:r,source:"env",via:i}}return null}function gt(t){if(!t||typeof t!=="object")return null;let i=t,s=i.site?.url??i.url??i.app?.url;return typeof s==="string"?q(s):null}async function jt(t){let{existsSync:i}=await import("fs"),s=await import("path");for(let r of["site.config.ts","site.config.js",".config/site.config.ts"]){let c=s.resolve(t,r);if(!i(c))continue;try{let e=await import(c),l=gt(e.default??e);if(l)return l}catch{}}return null}async function pt(t={}){let i=t.cwd??process.cwd(),s=t.env??process.env;if(t.explicit){let l=q(t.explicit);if(l)return{url:l,source:"option"}}let r=gt(t.stxConfig);if(r)return{url:r,source:"stx.config",via:"site.url"};let c=await jt(i);if(c)return{url:c,source:"site.config",via:"url"};let e=Bt(s);if(e)return e;return{url:"http://localhost",source:"fallback"}}function ht(){return["No site URL configured \u2014 sitemap.xml and robots.txt will point at http://localhost."," Set one in stx.config.ts (site: { url: 'https://example.com' }), in site.config.ts,"," via --domain, or with SITE_URL in the build environment."].join(`
|
|
3
|
+
`)}class ft{cacheDir;cache=new Map;loaded=!1;salt;constructor(t,i=""){this.cacheDir=t,this.salt=i}async load(){if(this.loaded)return;let t=g.join(this.cacheDir,"build-cache.json");if(await Bun.file(t).exists())try{let i=JSON.parse(await Bun.file(t).text());for(let[s,r]of Object.entries(i))this.cache.set(s,r)}catch{}this.loaded=!0}async save(){await x.promises.mkdir(this.cacheDir,{recursive:!0});let t=g.join(this.cacheDir,"build-cache.json"),i={};for(let[s,r]of this.cache)i[s]=r;await Bun.write(t,JSON.stringify(i))}getHash(t,i){let s=x.statSync(t),r=`${this.salt}|${t}:${s.mtimeMs}`;for(let e of i)if(x.existsSync(e)){let l=x.statSync(e);r+=`:${e}:${l.mtimeMs}`}let c=0;for(let e=0;e<r.length;e++){let l=r.charCodeAt(e);c=(c<<5)-c+l,c=c&c}return Math.abs(c).toString(36)}get(t,i){let s=this.cache.get(t);if(!s)return null;let r=this.getHash(i,s.dependencies??[]);if(s.hash!==r)return this.cache.delete(t),null;return s.html}set(t,i,s,r){let c=this.getHash(i,s);this.cache.set(t,{hash:c,html:r,generatedAt:Date.now(),dependencies:s})}}class mt{cacheDir;constructor(t){this.cacheDir=t}getFilePath(t){let i=t.replace(/[^a-zA-Z0-9]/g,"_")+".json";return g.join(this.cacheDir,"isr",i)}async get(t){let i=this.getFilePath(t);if(!await Bun.file(i).exists())return null;try{return JSON.parse(await Bun.file(i).text())}catch{return null}}async set(t,i){let s=this.getFilePath(t);await x.promises.mkdir(g.dirname(s),{recursive:!0}),await Bun.write(s,JSON.stringify(i))}async invalidate(t){let i=this.getFilePath(t);if(await Bun.file(i).exists())await x.promises.unlink(i)}async invalidatePattern(t){let i=g.join(this.cacheDir,"isr");if(!x.existsSync(i))return;let s=await x.promises.readdir(i);for(let r of s){let c=r.replace(/_/g,"/").replace(".json","");if(t.test(c))await x.promises.unlink(g.join(i,r))}}async needsRevalidation(t){let i=await this.get(t);if(!i)return!0;return Date.now()>i.revalidateAfter}}async function Ft(t){try{let s=(await Bun.file(t).text()).match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!s)return null;let r=s[1];if(!r.includes("getStaticPaths"))return null;let c=r.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticPaths\s*\([^)]*\)\s*\{([\s\S]*?)\n[\t ]*\}/);if(!c)return null;return await Function(`
|
|
4
4
|
return (async function getStaticPaths() {
|
|
5
5
|
${c[1]}
|
|
6
6
|
})()
|
|
@@ -8,7 +8,7 @@ import"./chunk-ktyctev3.js";import"./chunk-dhq80e4r.js";import"./chunk-ah9xyss2.
|
|
|
8
8
|
return (async function getStaticProps() {
|
|
9
9
|
${e[1]}
|
|
10
10
|
})()
|
|
11
|
-
`)(i)}catch(e){return console.error(`Error executing getStaticProps in ${s}:`,e),null}}function Lt(t){return/(?:^|[^\w$.])(?:export\s+)?(?:async\s+)?function\s+action\s*\(/.test(t)||/(?:^|[^\w$.])(?:export\s+)?(?:const|let|var)\s+action\s*=/.test(t)}async function
|
|
11
|
+
`)(i)}catch(e){return console.error(`Error executing getStaticProps in ${s}:`,e),null}}function Lt(t){return/(?:^|[^\w$.])(?:export\s+)?(?:async\s+)?function\s+action\s*\(/.test(t)||/(?:^|[^\w$.])(?:export\s+)?(?:const|let|var)\s+action\s*=/.test(t)}async function St(t,i,s={},r,c){let e=await Bun.file(t.filePath).text(),l=await Tt(t.filePath),w=await At(e,i,t.filePath),y={...l||{},...w||{},...s,params:i,$route:{path:t.pattern,params:i}},h=new Set,S=[],P=[],D={...c,...r.partialsDir?{partialsDir:r.partialsDir}:{},...r.componentsDir?{componentsDir:r.componentsDir}:{},debug:!1,cache:!1,autoShell:!0,onIncludeError:(b)=>{S.push(`${g.relative(process.cwd(),b.templatePath)}: ${b.message}
|
|
12
12
|
resolved against partialsDir: ${b.partialsDir}`)},onServerScriptError:(b)=>{P.push(`${g.relative(process.cwd(),b.sourcePath)} (${b.kind}): ${b.message}`)}};if(Lt(e))console.warn(`Warning: ${t.pattern} exports a page action, which cannot run in a static build. Its form will submit to a file. Serve this route with the production server, or point the form's action at a route handler.`);let p=await n(e,y,t.filePath,D,h);for(let b of[t.filePath,...h])for(let B of ce(b))h.add(B);if(Object.keys(i).length>0){let b=`<script>if(window.stx)window.stx._rp=${JSON.stringify(i)};else window.__stx_rp=${JSON.stringify(i)};</script>`;if(p.includes("</head>"))p=p.replace("</head>",`${b}
|
|
13
13
|
</head>`);else p=`${b}
|
|
14
14
|
${p}`}if(p=await J(p,{router:r.router}),p=await f(p),r.minify!==!1)return{html:Mt(p),dependencies:Array.from(h),includeFailures:S,serverScriptFailures:P};return{html:p,dependencies:Array.from(h),includeFailures:S,serverScriptFailures:P}}function Mt(t){let i=[],s=0,r=/(<script[^>]*>)([\s\S]*?)(<\/script>)/gi,c;while((c=r.exec(t))!==null){let l=t.slice(s,c.index);i.push(l.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><"));let w=c[1],y=c[2],h=c[3];y=y.replace(/([^:"\\'`])\/\/(?!\/)(?![*!])([^\n]*)/g,"$1"),i.push(w+y+h),s=c.index+c[0].length}let e=t.slice(s);return i.push(e.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><")),i.join("").trim()}function Ut(t){let i=0;for(let s=0;s<t.length;s++){let r=t.charCodeAt(s);i=(i<<5)-i+r,i=i&i}return`"${Math.abs(i).toString(36)}"`}function _t(t,i,s,r){if(s?.sitemap===!1)return!0;if(/<meta[^>]+name=["']robots["'][^>]+content=["'][^"']*noindex/i.test(i))return!0;return r.some((c)=>{if(c instanceof RegExp)return c.test(t);return c.endsWith("/")?t===c.slice(0,-1)||t.startsWith(c):t===c})}function Gt(t,i){return`<?xml version="1.0" encoding="UTF-8"?>
|
|
@@ -41,16 +41,16 @@ ${t.map((r)=>{let c=new URL(r.loc,i).href,e=` <url>
|
|
|
41
41
|
${s.join(`
|
|
42
42
|
`)}
|
|
43
43
|
</channel>
|
|
44
|
-
</rss>`}async function zt(t={}){let i=Date.now();
|
|
44
|
+
</rss>`}async function zt(t={}){let i=Date.now();wt();let s=await o(process.cwd()),r=s.build||{},c=await pt({explicit:t.domain||r.domain,stxConfig:s});if(c.source==="fallback"&&(t.sitemap??r.sitemap??!0))console.warn(ht());let e={router:t.router??s?.router??{},pagesDir:t.pagesDir||r.pagesDir||"pages",outputDir:t.outputDir||r.outputDir||"dist",baseUrl:t.baseUrl||r.baseUrl||"/",domain:c.url,revalidate:t.revalidate??r.revalidate??!1,sitemap:t.sitemap??r.sitemap??!0,sitemapExclude:t.sitemapExclude||r.sitemapExclude||[],robots:t.robots??r.robots??!0,rss:t.rss??r.rss??!1,concurrency:t.concurrency||r.concurrency||10,cache:t.cache??r.cache??!0,cacheDir:t.cacheDir||r.cacheDir||a(process.cwd(),"ssg-cache"),contentLoaders:t.contentLoaders||[],hooks:t.hooks||{},minify:t.minify??r.minify??!0,generate404:t.generate404??r.generate404??!0,publicDir:t.publicDir||r.publicDir||"public",trailingSlash:t.trailingSlash??r.trailingSlash??!1,cleanOutput:t.cleanOutput??r.cleanOutput??!0,cacheSalt:t.cacheSalt??"",partialsDir:t.partialsDir||s?.partialsDir||"",componentsDir:t.componentsDir||s?.componentsDir||"",failOnIncludeError:t.failOnIncludeError??!0,failOnServerScriptError:t.failOnServerScriptError??!0,chunkIslands:t.chunkIslands===!0,prefetchIslands:t.prefetchIslands===!0,integrityIslands:t.integrityIslands===!0},l={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},w=new Set,y=0,h={},S={};await e.hooks.onBuildStart?.();try{if(e.cleanOutput&&x.existsSync(e.outputDir))await x.promises.rm(e.outputDir,{recursive:!0});await x.promises.mkdir(e.outputDir,{recursive:!0});let D=e.cacheSalt;if(!D){let{resolveUserCssConfig:u,fingerprintConfig:m}=await import("./chunk-f0fxyh3e.js");try{D=m(await u(process.cwd()))}catch{}}let{prepareImageDelivery:p}=await import("./chunk-hr34x6sx.js"),b=await p(e.publicDir,e.outputDir);if(b.count>0)console.log(`Optimized ${b.count} image(s) for responsive delivery`),D=[D,b.fingerprint].filter(Boolean).join(":");let B=new ft(e.cacheDir,D);if(e.cache)await B.load();try{let{generateCss:u}=await import("./chunk-f0fxyh3e.js");await u('<div class="bg-black"></div>')}catch{}st();let xt=s?.routeMiddleware?.dir||"middleware";await it(process.cwd(),xt);let H=ot();if(H.length>0)console.log(`Loaded ${H.length} middleware: ${H.join(", ")}`);let bt=s?.routeMiddleware?.global||[];Zo(s?.layoutsDir,a(process.cwd()));let K=L(".",{pagesDir:e.pagesDir,pagesDirs:s?._layerPageDirs});console.log(`Found ${K.length} routes`);let G=[];for(let u of K){let m=await Ot(u);for(let v of m)G.push({route:u,url:v.url,params:v.params,props:v.props,revalidate:v.revalidate??e.revalidate})}l.totalPages=G.length,console.log(`Generating ${l.totalPages} pages...`);let A=[],X=[];for(let u=0;u<G.length;u+=e.concurrency)X.push(G.slice(u,u+e.concurrency));for(let u of X)await Promise.all(u.map(async(m)=>{let{route:v,url:d,params:M,props:Pt,revalidate:Q}=m;try{await e.hooks.onPageStart?.(d);let j=await Bun.file(v.filePath).text(),F=Jt(j),$t=F?.middleware?Array.isArray(F.middleware)?F.middleware:[F.middleware]:[],tt=[...bt,...$t];if(tt.length>0){let C=at(d,M,F||{}),O=ct(C,null,void 0,{isServer:!0}),E=await lt(tt,O);if(E.redirect){let R=typeof E.redirect==="string"?E.redirect:E.redirect.path||E.redirect,_=Vt(String(R),d),T=Kt(d,e);await x.promises.mkdir(g.dirname(T),{recursive:!0}),await Bun.write(T,_),l.successCount++,l.pages.push({route:d,outputPath:T,size:Buffer.byteLength(_),cached:!1}),A.push({loc:d,lastmod:new Date().toISOString()}),console.log(` \u21B3 ${d} \u2192 redirect to ${R}`);return}if(E.abort){let R=typeof E.abort==="string"?E.abort:E.abort?.error?.message||"aborted";console.warn(` \u21B3 ${d} \u2014 middleware aborted: ${R}`);return}}let et=j.match(/definePageMeta\s*\(\s*\{[\s\S]*?validate\s*:\s*((?:\([^)]*\)|[^,}])*(?:\{[\s\S]*?\})?)/m);if(et)try{if(!await Function("route",`
|
|
45
45
|
const validate = ${et[1]};
|
|
46
46
|
return validate(route);
|
|
47
|
-
`)({params:M})){console.warn(`Validation failed for ${d}, skipping...`);return}}catch{}let k=null,
|
|
47
|
+
`)({params:M})){console.warn(`Validation failed for ${d}, skipping...`);return}}catch{}let k=null,rt=!1;if(e.cache){if(k=B.get(d,v.filePath),k)rt=!0,l.cachedCount++}if(!k){let C=await St(v,M,Pt,e,s);if(k=C.html,e.failOnIncludeError&&C.includeFailures.length>0)throw Error(`${C.includeFailures.length} include(s) failed to resolve, so this page would have shipped with an error banner where the markup should be:
|
|
48
48
|
${C.includeFailures.join(`
|
|
49
49
|
`)}
|
|
50
50
|
Set ssg.failOnIncludeError to false to build anyway.`);if(e.failOnServerScriptError&&C.serverScriptFailures.length>0)throw Error(`${C.serverScriptFailures.length} <script server> block(s) failed, so this page would have shipped with the content they produce missing:
|
|
51
51
|
${C.serverScriptFailures.join(`
|
|
52
52
|
`)}
|
|
53
|
-
Set ssg.failOnServerScriptError to false to build anyway.`);if(e.cache)B.set(d,v.filePath,C.dependencies,k)}let U;if(e.trailingSlash)U=g.join(e.outputDir,d,"index.html");else U=d==="/"?g.join(e.outputDir,"index.html"):g.join(e.outputDir,`${d}.html`);if(e.chunkIslands){let{html:C,chunks:O}=ut(k,{integrity:e.integrityIslands,minify:e.minify});if(O.length>0){let E=g.join(e.outputDir,"_stx","islands");await x.promises.mkdir(E,{recursive:!0});for(let R of O){let _=g.join(E,`${R.hash}.js`);if(!await Bun.file(_).exists())await Bun.write(_,R.code);if(!w.has(R.hash)){w.add(R.hash);let T=Buffer.byteLength(R.code,"utf8");y+=T,h[R.hash]={bytes:T,file:`/_stx/islands/${R.hash}.js`}}}if(S[d]=O.map((R)=>R.hash),k=C,e.prefetchIslands)k=dt(k)}}if(await x.promises.mkdir(g.dirname(U),{recursive:!0}),await Bun.write(U,k),!_t(d,k,F,e.sitemapExclude))A.push({loc:d,lastmod:new Date().toISOString().split("T")[0],priority:d==="/"?1:0.8});let
|
|
53
|
+
Set ssg.failOnServerScriptError to false to build anyway.`);if(e.cache)B.set(d,v.filePath,C.dependencies,k)}let U;if(e.trailingSlash)U=g.join(e.outputDir,d,"index.html");else U=d==="/"?g.join(e.outputDir,"index.html"):g.join(e.outputDir,`${d}.html`);if(e.chunkIslands){let{html:C,chunks:O}=ut(k,{integrity:e.integrityIslands,minify:e.minify});if(O.length>0){let E=g.join(e.outputDir,"_stx","islands");await x.promises.mkdir(E,{recursive:!0});for(let R of O){let _=g.join(E,`${R.hash}.js`);if(!await Bun.file(_).exists())await Bun.write(_,R.code);if(!w.has(R.hash)){w.add(R.hash);let T=Buffer.byteLength(R.code,"utf8");y+=T,h[R.hash]={bytes:T,file:`/_stx/islands/${R.hash}.js`}}}if(S[d]=O.map((R)=>R.hash),k=C,e.prefetchIslands)k=dt(k)}}if(await x.promises.mkdir(g.dirname(U),{recursive:!0}),await Bun.write(U,k),!_t(d,k,F,e.sitemapExclude))A.push({loc:d,lastmod:new Date().toISOString().split("T")[0],priority:d==="/"?1:0.8});let nt={route:d,outputPath:U,size:Buffer.byteLength(k,"utf8"),cached:rt};if(Q!==!1)nt.revalidateAt=Date.now()+Q*1000;l.pages.push(nt),l.successCount++,await e.hooks.onPageEnd?.(d,k)}catch(j){l.failedCount++,l.errors.push({route:d,error:j}),await e.hooks.onError?.(j,d),console.error(`Error generating ${d}:`,j)}}));let Y=vt();if(Y.length>0){let u=Y.map((m)=>`${m.filePath}: ${m.message}`).join(`
|
|
54
54
|
`);throw Error(`Client script bundling failed:
|
|
55
55
|
${u}`)}if(e.cache)await B.save();if(e.generate404){let u=g.join(e.pagesDir,"404.stx");if(await Bun.file(u).exists()){let m=new Set,v={...s,debug:!1,cache:!1},d=await n(await Bun.file(u).text(),{},u,v,m);await Bun.write(g.join(e.outputDir,"404.html"),d)}else await Bun.write(g.join(e.outputDir,"404.html"),`<!DOCTYPE html>
|
|
56
56
|
<html lang="en">
|
|
@@ -73,7 +73,7 @@ ${u}`)}if(e.cache)await B.save();if(e.generate404){let u=g.join(e.pagesDir,"404.
|
|
|
73
73
|
<a href="/">Go home</a>
|
|
74
74
|
</div>
|
|
75
75
|
</body>
|
|
76
|
-
</html>`)}for(let u of[500]){let m=g.join(e.pagesDir,`${u}.stx`);if(await Bun.file(m).exists()){let v=new Set,d={...s,debug:!1,cache:!1},M=await n(await Bun.file(m).text(),{},m,d,v);await Bun.write(g.join(e.outputDir,`${u}.html`),M)}}let W=g.join(e.pagesDir,"error.stx");if(await Bun.file(W).exists()){let u=new Set,m={...s,debug:!1,cache:!1},v=await n(await Bun.file(W).text(),{},W,m,u);await Bun.write(g.join(e.outputDir,"error.html"),v)}if(e.sitemap&&A.length>0){let u=Gt(A,e.domain),m=g.join(e.outputDir,"sitemap.xml");await Bun.write(m,u),l.sitemapPath=m,console.log(`Generated sitemap.xml with ${A.length} URLs`)}if(e.robots!==!1){let u=typeof e.robots==="object"?e.robots:{},m=[...e.sitemapExclude.filter((d)=>typeof d==="string"),...u.disallow||[]],v=
|
|
76
|
+
</html>`)}for(let u of[500]){let m=g.join(e.pagesDir,`${u}.stx`);if(await Bun.file(m).exists()){let v=new Set,d={...s,debug:!1,cache:!1},M=await n(await Bun.file(m).text(),{},m,d,v);await Bun.write(g.join(e.outputDir,`${u}.html`),M)}}let W=g.join(e.pagesDir,"error.stx");if(await Bun.file(W).exists()){let u=new Set,m={...s,debug:!1,cache:!1},v=await n(await Bun.file(W).text(),{},W,m,u);await Bun.write(g.join(e.outputDir,"error.html"),v)}if(e.sitemap&&A.length>0){let u=Gt(A,e.domain),m=g.join(e.outputDir,"sitemap.xml");await Bun.write(m,u),l.sitemapPath=m,console.log(`Generated sitemap.xml with ${A.length} URLs`)}if(e.robots!==!1){let u=typeof e.robots==="object"?e.robots:{},m=[...e.sitemapExclude.filter((d)=>typeof d==="string"),...u.disallow||[]],v=yr({rules:[{userAgent:u.userAgent||"*",allow:u.allow||["/"],...m.length>0?{disallow:m}:{}}],...u.sitemap!==!1&&l.sitemapPath?{sitemap:new URL("/sitemap.xml",e.domain).href}:{}});await Bun.write(g.join(e.outputDir,"robots.txt"),v),console.log("Generated robots.txt")}if(e.rss){let u=typeof e.rss==="object"?e.rss:{title:"Site Feed",description:"Latest updates",link:e.domain},m=[];if(u.getItems)m=await u.getItems();let v=Nt(u,m),d=g.join(e.outputDir,"rss.xml");await Bun.write(d,v),l.rssPath=d,console.log(`Generated rss.xml with ${m.length} items`)}let N=Jo(e.outputDir);if(N.assets>0)console.log(`Externalized ${N.assets} asset(s) from ${N.pages} page(s) (${(N.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);let z=Yo(e.outputDir);if(z.assets>0)console.log(`Externalized ${z.assets} repeated asset(s) from ${z.pages} page(s) (${(z.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);if(e.publicDir&&x.existsSync(e.publicDir))await V(e.publicDir,e.outputDir),console.log(`Copied public assets from ${e.publicDir}`);let Z=cn();if(Z)await V(Z,g.join(e.outputDir,an)),console.log(`Copied assets from ${yt}`)}catch(D){throw await e.hooks.onError?.(D),D}if(l.buildTime=Date.now()-i,w.size>0){l.islandChunks={count:w.size,totalBytes:y};let D={generatedChunks:w.size,totalBytes:y,chunks:h,pages:S};await Bun.write(g.join(e.outputDir,"_stx","islands-manifest.json"),JSON.stringify(D,null,2))}await e.hooks.onBuildEnd?.(l);let P=l.islandChunks?`
|
|
77
77
|
Island chunks: ${l.islandChunks.count} (${(l.islandChunks.totalBytes/1024).toFixed(1)} KB lifted out of inline HTML)`:"";return console.log(`
|
|
78
78
|
Build complete!
|
|
79
79
|
Total: ${l.totalPages} pages
|
|
@@ -81,8 +81,8 @@ Build complete!
|
|
|
81
81
|
Cached: ${l.cachedCount}
|
|
82
82
|
Failed: ${l.failedCount}
|
|
83
83
|
Time: ${l.buildTime}ms${P}
|
|
84
|
-
`),l}async function V(t,i){await x.promises.mkdir(i,{recursive:!0});let s=await x.promises.readdir(t,{withFileTypes:!0});for(let r of s){let c=g.join(t,r.name),e=g.join(i,r.name);if(r.isDirectory())await x.promises.mkdir(e,{recursive:!0}),await V(c,e);else await x.promises.copyFile(c,e)}}function Ht(t={}){let i=t.cacheDir||a(process.cwd(),"ssg-cache"),s=new
|
|
85
|
-
`)){let P=S.indexOf(":");if(P>0){let D=S.slice(0,P).trim(),p=S.slice(P+1).trim();if(p==="true")p=!0;else if(p==="false")p=!1;else if(/^\d+$/.test(p))p=parseInt(p,10);else if(/^\d+\.\d+$/.test(p))p=parseFloat(p);else if(p.startsWith("[")&&p.endsWith("]"))p=p.slice(1,-1).split(",").map((b)=>b.trim().replace(/^['"]|['"]$/g,""));r[D]=p}}}let e=c.replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/\*\*(.*)\*\*/gim,"<strong>$1</strong>").replace(/\*(.*)\*/gim,"<em>$1</em>").replace(/`([^`]+)`/gim,"<code>$1</code>").replace(/\[([^\]]+)\]\(([^)]+)\)/gim,'<a href="$2">$1</a>').replace(/\n/gim,"<br>"),l=[],w=/<h([1-6])>([^<]+)<\/h[1-6]>/gi,y;while((y=w.exec(e))!==null){let h=parseInt(y[1],10),S=y[2],P=S.toLowerCase().replace(/[^a-z0-9]+/g,"-");l.push({id:P,text:S,level:h})}return{content:e,data:r,toc:l}}}}function Jt(t){return
|
|
84
|
+
`),l}async function V(t,i){await x.promises.mkdir(i,{recursive:!0});let s=await x.promises.readdir(t,{withFileTypes:!0});for(let r of s){let c=g.join(t,r.name),e=g.join(i,r.name);if(r.isDirectory())await x.promises.mkdir(e,{recursive:!0}),await V(c,e);else await x.promises.copyFile(c,e)}}function Ht(t={}){let i=t.cacheDir||a(process.cwd(),"ssg-cache"),s=new mt(i),r=t.revalidate||3600;return{async get(c){let e=await s.get(c);if(!e)return null;if(Date.now()>e.revalidateAfter)this.revalidate(c).catch(console.error);return{html:e.html,headers:{"Cache-Control":`public, max-age=${r}, stale-while-revalidate=${r*2}`,ETag:e.etag,"X-ISR-Generated":new Date(e.generatedAt).toISOString(),...e.headers}}},async revalidate(c){let l=L(".",{pagesDir:t.pagesDir||"pages"}).find((P)=>c.match(P.regex)!==null);if(!l){console.warn(`Route not found for revalidation: ${c}`);return}let w=c.match(l.regex),y={};if(w)l.params.forEach((P,D)=>{y[P]=w[D+1]});let h=await o(),{html:S}=await St(l,y,{},t,h);await s.set(c,{html:S,generatedAt:Date.now(),revalidateAfter:Date.now()+r*1000,etag:Ut(S)}),console.log(`Revalidated: ${c}`)},async invalidate(c){if(typeof c==="string")await s.invalidate(c);else await s.invalidatePattern(c)}}}function Wt(t){return async()=>({paths:await t(),fallback:!1})}function qt(){return{name:"markdown",extensions:[".md",".mdx"],async load(t){let i=await Bun.file(t).text(),s=i.match(/^---\n([\s\S]*?)\n---/),r={},c=i;if(s){let h=s[1];c=i.slice(s[0].length).trim();for(let S of h.split(`
|
|
85
|
+
`)){let P=S.indexOf(":");if(P>0){let D=S.slice(0,P).trim(),p=S.slice(P+1).trim();if(p==="true")p=!0;else if(p==="false")p=!1;else if(/^\d+$/.test(p))p=parseInt(p,10);else if(/^\d+\.\d+$/.test(p))p=parseFloat(p);else if(p.startsWith("[")&&p.endsWith("]"))p=p.slice(1,-1).split(",").map((b)=>b.trim().replace(/^['"]|['"]$/g,""));r[D]=p}}}let e=c.replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/\*\*(.*)\*\*/gim,"<strong>$1</strong>").replace(/\*(.*)\*/gim,"<em>$1</em>").replace(/`([^`]+)`/gim,"<code>$1</code>").replace(/\[([^\]]+)\]\(([^)]+)\)/gim,'<a href="$2">$1</a>').replace(/\n/gim,"<br>"),l=[],w=/<h([1-6])>([^<]+)<\/h[1-6]>/gi,y;while((y=w.exec(e))!==null){let h=parseInt(y[1],10),S=y[2],P=S.toLowerCase().replace(/[^a-z0-9]+/g,"-");l.push({id:P,text:S,level:h})}return{content:e,data:r,toc:l}}}}function Jt(t){return Ue(t)}function Vt(t,i){return`<!DOCTYPE html>
|
|
86
86
|
<html>
|
|
87
87
|
<head>
|
|
88
88
|
<meta charset="utf-8">
|
package/dist/testing.js
CHANGED
|
@@ -23,6 +23,8 @@ export function shimAttributes(root) {
|
|
|
23
23
|
const map = el.attributes;
|
|
24
24
|
if (!(map instanceof Map))
|
|
25
25
|
continue;
|
|
26
|
+
if (el.tagName === "INPUT" && !("indeterminate" in el))
|
|
27
|
+
el.indeterminate = !1;
|
|
26
28
|
el.__attrMap = map;
|
|
27
29
|
Object.defineProperty(el, "attributes", {
|
|
28
30
|
configurable: !0,
|
|
@@ -304,6 +304,8 @@ export declare interface StxConfig {
|
|
|
304
304
|
componentsDir: string
|
|
305
305
|
_rootComponentsDir?: string
|
|
306
306
|
_targetComponentDirs?: string[]
|
|
307
|
+
_targetComponentFallbackNames?: string[]
|
|
308
|
+
_nativeHostAttrs?: boolean
|
|
307
309
|
layoutsDir?: string
|
|
308
310
|
fallbackLayoutsDir?: string
|
|
309
311
|
fallbackComponentsDir?: string
|
package/dist/utils.d.ts
CHANGED
|
@@ -65,7 +65,7 @@ export declare function slotContentHasExpressions(slotContent: string): boolean;
|
|
|
65
65
|
* named `title` also exists in the server context.
|
|
66
66
|
*/
|
|
67
67
|
export declare function componentClientSignalNames(scripts: string[]): string[];
|
|
68
|
-
export declare function renderComponentWithSlot(componentPath: string, props: Record<string, unknown>, slotContent: string, componentsDir: string, parentContext: Record<string, unknown>, parentFilePath: string, options: StxOptions, processedComponents?: Set<string> | undefined, dependencies: Set<string>, clientLoopNames?: readonly string[], renderMetadata?: { declaredProps: Set<string
|
|
68
|
+
export declare function renderComponentWithSlot(componentPath: string, props: Record<string, unknown>, slotContent: string, componentsDir: string, parentContext: Record<string, unknown>, parentFilePath: string, options: StxOptions, processedComponents?: Set<string> | undefined, dependencies: Set<string>, clientLoopNames?: readonly string[], renderMetadata?: { declaredProps: Set<string>, consumedProps?: Set<string>, reactiveProps?: string[] }, lookupName?: string): Promise<string>;
|
|
69
69
|
/**
|
|
70
70
|
* Check if a file exists
|
|
71
71
|
*/
|
package/dist/utils.js
CHANGED
|
@@ -481,8 +481,10 @@ export async function userComponentFileExists(componentPath, componentsDir, pare
|
|
|
481
481
|
push(options._rootComponentsDir);
|
|
482
482
|
push(path.join(path.dirname(parentFilePath), "components"));
|
|
483
483
|
push(options.componentsDir);
|
|
484
|
-
|
|
485
|
-
|
|
484
|
+
const targetIsFallback = options._targetComponentFallbackNames?.some((name) => name.toLowerCase() === baseName.toLowerCase());
|
|
485
|
+
if (!targetIsFallback)
|
|
486
|
+
for (const dir of options._targetComponentDirs ?? [])
|
|
487
|
+
push(dir);
|
|
486
488
|
if (configuredRoot) {
|
|
487
489
|
push(path.resolve(configuredRoot, "resources/views/components"));
|
|
488
490
|
push(path.resolve(configuredRoot, "resources/components"));
|
|
@@ -496,6 +498,9 @@ export async function userComponentFileExists(componentPath, componentsDir, pare
|
|
|
496
498
|
for (const dir of pluginDirs)
|
|
497
499
|
push(typeof dir === "string" ? dir : null);
|
|
498
500
|
push(options.fallbackComponentsDir);
|
|
501
|
+
if (targetIsFallback)
|
|
502
|
+
for (const dir of options._targetComponentDirs ?? [])
|
|
503
|
+
push(dir);
|
|
499
504
|
if (baseName.startsWith("./") || baseName.startsWith("../"))
|
|
500
505
|
return fileExists(path.resolve(path.dirname(parentFilePath), `${baseName}.stx`));
|
|
501
506
|
const ownComponentsDir = realDir(path.resolve(import.meta.dir, "components")), resolvedDirs = searchDirs.map((dir) => path.isAbsolute(dir) ? dir : path.resolve(resolveBase, dir)), key = `${variants.join("\x00")}\x00\x00${resolvedDirs.join("\x00")}`, known = userComponentFileCache.get(key);
|
|
@@ -630,7 +635,8 @@ export async function renderComponentWithSlot(componentPath, props, slotContent,
|
|
|
630
635
|
searchDirs.push(parentRelative);
|
|
631
636
|
if (options.componentsDir && options.componentsDir !== componentsDir && !searchDirs.includes(options.componentsDir))
|
|
632
637
|
searchDirs.push(options.componentsDir);
|
|
633
|
-
|
|
638
|
+
const targetIsFallback = options._targetComponentFallbackNames?.some((name) => name.toLowerCase() === baseName.toLowerCase());
|
|
639
|
+
for (const dir of targetIsFallback ? [] : options._targetComponentDirs ?? [])
|
|
634
640
|
if (dir && !searchDirs.includes(dir))
|
|
635
641
|
searchDirs.push(dir);
|
|
636
642
|
const configuredRoot = typeof options.root === "string" ? path.resolve(options.root) : void 0, resolveBase = configuredRoot ?? path.dirname(parentFilePath), fallbackDirs = [];
|
|
@@ -652,6 +658,11 @@ export async function renderComponentWithSlot(componentPath, props, slotContent,
|
|
|
652
658
|
}
|
|
653
659
|
if (options.fallbackComponentsDir && !searchDirs.includes(options.fallbackComponentsDir))
|
|
654
660
|
searchDirs.push(options.fallbackComponentsDir);
|
|
661
|
+
if (targetIsFallback) {
|
|
662
|
+
for (const dir of options._targetComponentDirs ?? [])
|
|
663
|
+
if (dir && !searchDirs.includes(dir))
|
|
664
|
+
searchDirs.push(dir);
|
|
665
|
+
}
|
|
655
666
|
const normalizedSearchDirs = [...new Set(searchDirs.map((dir) => {
|
|
656
667
|
if (!dir)
|
|
657
668
|
return dir;
|
|
@@ -742,13 +753,15 @@ export async function renderComponentWithSlot(componentPath, props, slotContent,
|
|
|
742
753
|
return unresolvedComponentMarkup(componentPath);
|
|
743
754
|
}
|
|
744
755
|
if (renderMetadata)
|
|
745
|
-
for (const propName of Object.keys(props)) {
|
|
756
|
+
for (const propName of new Set([...Object.keys(props), ...renderMetadata.reactiveProps ?? []])) {
|
|
746
757
|
const normalized = propName.toLowerCase();
|
|
747
758
|
if (normalized.startsWith("aria-") || normalized.startsWith("data-"))
|
|
748
759
|
continue;
|
|
749
760
|
const escaped = propName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
750
761
|
if (new RegExp(`\\b${escaped}\\b`).test(componentContent))
|
|
751
762
|
renderMetadata.declaredProps.add(propName);
|
|
763
|
+
if (new RegExp(`\\$props\\s*(?:\\.\\s*${escaped}\\b|\\[\\s*['"]${escaped}['"]\\s*\\])`).test(componentContent) || new RegExp(`\\buseReactiveProp\\s*\\(\\s*['"]${escaped}['"]`).test(componentContent))
|
|
764
|
+
renderMetadata.consumedProps?.add(propName);
|
|
752
765
|
}
|
|
753
766
|
const internalKeysToPreserve = new Set([
|
|
754
767
|
"__originalFilePath",
|
|
@@ -1354,8 +1367,14 @@ async function buildComponentIsland(rawContent, componentFilePath, minify) {
|
|
|
1354
1367
|
__scopeVars.__destroyCallbacks = __scopeVars.__destroyCallbacks || [];
|
|
1355
1368
|
__scopeVars.__mountHooks = __scopeVars.__mountHooks || [];
|
|
1356
1369
|
__scopeVars.__destroyHooks = __scopeVars.__destroyHooks || [];
|
|
1370
|
+
let __registeringSetupHooks = true;
|
|
1357
1371
|
const onMount = (fn) => { __scopeVars.__mountCallbacks.push(fn); __scopeVars.__mountHooks.push(fn); };
|
|
1358
|
-
const onDestroy = (fn) => {
|
|
1372
|
+
const onDestroy = (fn) => {
|
|
1373
|
+
__scopeVars.__destroyCallbacks.push(fn);
|
|
1374
|
+
// A teardown registered inside onMount belongs to this mount alone.
|
|
1375
|
+
// Replaying it AND registering the next mount's teardown doubles cleanup.
|
|
1376
|
+
if (__registeringSetupHooks) __scopeVars.__destroyHooks.push(fn);
|
|
1377
|
+
};
|
|
1359
1378
|
|
|
1360
1379
|
try {
|
|
1361
1380
|
${content}
|
|
@@ -1370,6 +1389,7 @@ catch (e) {}
|
|
|
1370
1389
|
Object.assign(__scopeVars, __localVars);
|
|
1371
1390
|
}
|
|
1372
1391
|
finally {
|
|
1392
|
+
__registeringSetupHooks = false;
|
|
1373
1393
|
window.__STX_CURRENT_ELEMENT__ = __previousCurrentElement;
|
|
1374
1394
|
window.__STX_CURRENT_PROPS__ = __previousCurrentProps;
|
|
1375
1395
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/stx",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.584",
|
|
5
5
|
"description": "A performant UI Framework. Powered by Bun.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -128,12 +128,12 @@
|
|
|
128
128
|
"dependencies": {
|
|
129
129
|
"@stacksjs/ts-css": "^0.3.11",
|
|
130
130
|
"@stacksjs/clapp": "^0.2.16",
|
|
131
|
-
"@stacksjs/desktop": "0.2.
|
|
132
|
-
"@stacksjs/sanitizer": "0.2.
|
|
131
|
+
"@stacksjs/desktop": "0.2.584",
|
|
132
|
+
"@stacksjs/sanitizer": "0.2.584",
|
|
133
133
|
"@stacksjs/ts-i18n": "^0.1.11",
|
|
134
|
-
"bun-plugin-stx": "0.2.
|
|
134
|
+
"bun-plugin-stx": "0.2.584",
|
|
135
135
|
"bunfig": "^0.15.21",
|
|
136
|
-
"stx-router": "0.2.
|
|
136
|
+
"stx-router": "0.2.584",
|
|
137
137
|
"ts-broadcasting": "^0.0.11",
|
|
138
138
|
"ts-images": "^0.2.22",
|
|
139
139
|
"ts-syntax-highlighter": "^0.2.1"
|
package/dist/chunk-00p22wzr.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import i from"path";var Pt=".stx",o="STX_DIR",e=null;function Di(t){e=t?.trim()||null}function mn(){return process.env[o]?.trim()||e||Pt}function a(t=process.cwd(),...n){let r=mn();return i.isAbsolute(r)?i.join(r,...n):i.join(t,r,...n)}function hn(t){if(!t||i.isAbsolute(t))return t;let n=t.replace(/\\/g,"/");if(n!==Pt&&!n.startsWith(`${Pt}/`))return t;let r=n.slice(Pt.length+1);return r?i.join(mn(),r):mn()}
|
|
3
|
-
export{Pt,Di,mn,a,hn};
|
package/dist/chunk-0fx3ppnt.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Qu,si,ed,oi,vc,wc,$t,pn,td,xc,Sc,nd,f}from"./chunk-n4e02qdz.js";import"./chunk-dm1qh2vq.js";import"./chunk-ah9xyss2.js";import"./chunk-sv08pd66.js";import"./chunk-2943qhdt.js";import"./chunk-vkc51n9m.js";import"./chunk-02qaqamv.js";import"./chunk-6m3me7yj.js";import"./chunk-dhq80e4r.js";import"./chunk-vpdx7qr3.js";import"./chunk-dvc15djp.js";import"./chunk-x552npae.js";import"./chunk-qdyp2zqf.js";export{$t as buildCss,xc as extractClassNames,wc as fingerprintConfig,Sc as generateCss,td as getCachedCSS,Qu as getCssServeAsset,f as injectCss,si as loadCssEngine,oi as loadCssEngineConfig,pn as rebuildCss,ed as resetCssCache,vc as resolveUserCssConfig,nd as withLinkedModuleBundles};
|
package/dist/chunk-0sfexf9t.js
DELETED
package/dist/chunk-2927nax9.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{A,qc,As,o,P,ld,ud}from"./chunk-n4e02qdz.js";import"./chunk-dm1qh2vq.js";import"./chunk-ah9xyss2.js";import"./chunk-sv08pd66.js";import"./chunk-2943qhdt.js";import"./chunk-vkc51n9m.js";import"./chunk-02qaqamv.js";import"./chunk-6m3me7yj.js";import"./chunk-dhq80e4r.js";import"./chunk-vpdx7qr3.js";import"./chunk-dvc15djp.js";import"./chunk-x552npae.js";import"./chunk-qdyp2zqf.js";export{P as config,A as defaultConfig,ld as defineStxConfig,As as discoverConfig,o as loadStxConfig,qc as resolveStxDirectories,ud as validateConfig};
|
package/dist/chunk-2rj0ttas.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ne,Zt,gu}from"./chunk-wyn5rfzk.js";import{W,Qt,mu,en,Gr,zn,Hn,hu,yu,bu,tn,nn,Kr,Un,vu}from"./chunk-w6wtxj54.js";import"./chunk-dvc15djp.js";export{Gr as batch,gu as default,Qt as derived,en as effect,Ne as generateSignalsRuntime,Zt as generateSignalsRuntimeDev,nn as isDerived,tn as isSignal,mu as memo,Hn as onDestroy,zn as onMount,Un as peek,bu as pendingLifecycleCounts,yu as runDestroyCallbacks,hu as runMountCallbacks,W as state,Kr as untrack,vu as useOptimistic};
|
package/dist/chunk-2rx9d75e.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import a from"fs";function Me(r){return o(r)}var g=1000,i=new Map;function Yt(){i.clear()}function o(r){return[...r].sort().map((n)=>{try{let t=a.statSync(n);return`${n}:${t.size}:${t.mtimeMs}`}catch{return`${n}:missing`}}).join(`
|
|
3
|
-
`)}function mt(r,n,t){let e=r.get(n);return e!==void 0&&e.signature===t?e.value:void 0}function V(r,n,t,e){return r.set(n,{signature:t,value:e}),e}
|
|
4
|
-
export{Me,Yt,mt,V};
|
package/dist/chunk-3ae39ttg.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{qr,Wl,ql}from"./chunk-6fc8vw2v.js";import"./chunk-4pkpr5cg.js";import"./chunk-nh3svtvj.js";import"./chunk-ktyctev3.js";import"./chunk-n4e02qdz.js";import"./chunk-dm1qh2vq.js";import"./chunk-ah9xyss2.js";import"./chunk-sv08pd66.js";import"./chunk-2943qhdt.js";import"./chunk-vkc51n9m.js";import"./chunk-02qaqamv.js";import"./chunk-6m3me7yj.js";import"./chunk-dhq80e4r.js";import"./chunk-vpdx7qr3.js";import"./chunk-dvc15djp.js";import"./chunk-x552npae.js";import"./chunk-qdyp2zqf.js";export{ql as clearComposableCache,Wl as getComposableScript,qr as listComposableModules};
|
package/dist/chunk-3x6p9me0.js
DELETED
package/dist/chunk-440yjsk5.js
DELETED
package/dist/chunk-58z26y07.js
DELETED
package/dist/chunk-5db5sxy3.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
function E(){let{NODE_ENV:n}=process.env;return n==="production"}function M(){let{STX_DEBUG:n}=process.env;return!E()||n==="true"}function En(){let{NODE_ENV:n}=process.env;return n==="test"}function Ws(n){return n==="compile"||E()}function Tn(n){if(!n)return n;try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(n).trim()}catch{return n}}
|
|
3
|
-
export{E,M,En,Ws,Tn};
|
package/dist/chunk-5r9k9s3m.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{fn,Cc,hs}from"./chunk-n4e02qdz.js";import"./chunk-dm1qh2vq.js";import"./chunk-ah9xyss2.js";import"./chunk-sv08pd66.js";import"./chunk-2943qhdt.js";import"./chunk-vkc51n9m.js";import"./chunk-02qaqamv.js";import"./chunk-6m3me7yj.js";import{_e}from"./chunk-dhq80e4r.js";import"./chunk-vpdx7qr3.js";import"./chunk-dvc15djp.js";import"./chunk-x552npae.js";import"./chunk-qdyp2zqf.js";export{_e as freeIdentifiers,hs as processComponents,Cc as processESImports,fn as rendersAsElement};
|
package/dist/chunk-76vza4ve.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ba,Pl,va,wa,Il,Ol}from"./chunk-0dfgefjv.js";import"./chunk-n4e02qdz.js";import"./chunk-dm1qh2vq.js";import"./chunk-ah9xyss2.js";import"./chunk-sv08pd66.js";import"./chunk-2943qhdt.js";import"./chunk-vkc51n9m.js";import"./chunk-02qaqamv.js";import"./chunk-6m3me7yj.js";import"./chunk-dhq80e4r.js";import"./chunk-vpdx7qr3.js";import"./chunk-dvc15djp.js";import"./chunk-x552npae.js";import"./chunk-qdyp2zqf.js";export{Ol as applySlots,Il as extractSlotContent,Pl as parseSlotElement,ba as parseSlots,wa as processSlots,va as renderSlot};
|
package/dist/chunk-84f9dnq5.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Oa,Da,Ma,Na,La,ja,Ba,Fa,za,Ha,Hl}from"./chunk-qccgncp2.js";export{Oa as createIslandRegistry,Hl as default,Ha as generateIslandManifest,Ma as generatePartialHydrationCSS,ja as hydrateAll,La as hydrateByStrategy,Na as hydrateIsland,Ba as isHydrated,Fa as onHydrated,Da as processPartialHydrationDirectives,za as processStaticDirectives};
|
package/dist/chunk-8tq5x4z8.js
DELETED
package/dist/chunk-8y8bbsh5.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{kt,es,ts,ns,Bu,rs}from"./chunk-nh3svtvj.js";import"./chunk-sv08pd66.js";import"./chunk-vkc51n9m.js";import"./chunk-x552npae.js";export{ts as buildServerApi,Bu as createServerApi,kt as discoverServerApi,es as generateApiTypes,rs as isServerApiSource,ns as productionApiDispatcher};
|
package/dist/chunk-9kzycb15.js
DELETED
package/dist/chunk-agfhb2qd.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{K,ss,os,lc,_t,Zo,is,Qo,Fu,be,ln,ve}from"./chunk-n4e02qdz.js";import"./chunk-dm1qh2vq.js";import"./chunk-ah9xyss2.js";import{Ai,s}from"./chunk-3e3dpp7w.js";import"./chunk-sv08pd66.js";import"./chunk-2943qhdt.js";import"./chunk-vkc51n9m.js";import"./chunk-02qaqamv.js";import"./chunk-6m3me7yj.js";import"./chunk-dhq80e4r.js";import"./chunk-vpdx7qr3.js";import"./chunk-dvc15djp.js";import"./chunk-x552npae.js";import"./chunk-qdyp2zqf.js";export{K as BROWSER_CORE_IMPORTS,lc as STX_AUTO_IMPORTS,ss as extractAndStripCssImports,be as extractBridgeData,Ai as findInterpolationEnd,Qo as generateAutoImportDestructuring,Fu as generateBrowserAutoImportDestructuring,ln as generateServerDataBridge,_t as injectBrowserCoreAutoImports,ve as processClientScript,is as referencesName,os as renderVendorStyleTags,s as stripCommentsAndLiterals,Zo as transformAutoImports};
|
package/dist/chunk-ay6dzpt4.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{u,xs,bi,vi,Lc,jc,Bc,Fc,zc,Hc,Ge,j,Ke,Uc,nr,Vc,ki,Wc,Xe,r,rr,Ci,g,ne,cd}from"./chunk-n4e02qdz.js";import"./chunk-dm1qh2vq.js";import"./chunk-ah9xyss2.js";import"./chunk-sv08pd66.js";import"./chunk-2943qhdt.js";import"./chunk-vkc51n9m.js";import"./chunk-02qaqamv.js";import"./chunk-6m3me7yj.js";import"./chunk-dhq80e4r.js";import"./chunk-vpdx7qr3.js";import"./chunk-dvc15djp.js";import"./chunk-x552npae.js";import"./chunk-qdyp2zqf.js";export{ne as clearComponentCache,Wc as componentClientSignalNames,xs as convertToCommonJS,g as createDetailedErrorMessage,zc as extractDirectiveNames,bi as extractScriptFromTemplate,u as extractVariables,r as fileExists,cd as getComponentCacheStats,jc as getPositionInfo,j as getSharedTranspiler,Ci as getSourceLineInfo,Fc as hasDirectives,vi as hasVariables,Vc as isHydrateTrigger,Hc as isJavaScriptScript,Xe as renderComponentWithSlot,rr as resolveTemplatePath,Uc as scopeOnRootElement,Ge as shouldTranspileTypeScript,ki as slotContentHasExpressions,Ke as transpileTypeScript,nr as userComponentFileExists,Bc as validateDirective,Lc as validateTemplate};
|
package/dist/chunk-b9njk81d.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ra,po,sa,oa,fo,ia,aa,ca,la,go,ua,pl}from"./chunk-ym1sb5bg.js";import{Co,ha}from"./chunk-h0a2s340.js";import{B,F,z,zt,Q,ie,Bn,De,gt,Ht,Ut,Vt,H,Wt,qt,Fn}from"./chunk-sv5nvfmb.js";import{Ga}from"./chunk-w3rmepwy.js";import"./chunk-117xss52.js";export{F as DEFAULT_FORMATS,z as DEFAULT_QUALITY,B as DEFAULT_WIDTHS,Fn as ImageProcessingError,oa as clearImageCache,fo as createImageDirective,ha as createImageHandler,aa as createImagePlugin,pl as defaultImageConfig,qt as formatSize,go as generateImageManifest,gt as generateSizes,De as generateSrcSet,Ht as getFallbackVariant,Bn as getImageMetadata,H as getMimeType,Wt as getTotalSize,Ut as groupVariantsByFormat,Co as handleImageRequest,ia as imageDirective,Q as isImageBackendAvailable,Vt as isImageFile,zt as isSharpAvailable,la as optimizeDirectory,ca as optimizeImage,po as parseImageComponent,ie as processImage,sa as processImageComponents,ra as renderImageComponent,Ga as rewriteImagesWithSiblings,ua as writeImageManifest};
|
package/dist/chunk-bfbcmfww.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{pu,fu}from"./chunk-m417sp42.js";import"./chunk-4pkpr5cg.js";import"./chunk-nh3svtvj.js";import"./chunk-ktyctev3.js";import"./chunk-n4e02qdz.js";import"./chunk-dm1qh2vq.js";import"./chunk-ah9xyss2.js";import"./chunk-sv08pd66.js";import"./chunk-2943qhdt.js";import"./chunk-vkc51n9m.js";import"./chunk-02qaqamv.js";import"./chunk-6m3me7yj.js";import"./chunk-dhq80e4r.js";import"./chunk-vpdx7qr3.js";import"./chunk-dvc15djp.js";import"./chunk-x552npae.js";import"./chunk-qdyp2zqf.js";export{fu as clearStoreCache,pu as getStoreScript};
|
package/dist/chunk-br01jvra.js
DELETED
package/dist/chunk-c12y2bet.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ks,Xs,nt,Z,Rn,br,An,vr,wr,Xc,Jc,Yc,Pn,Zc,Qc,el,tl,Yi,Zi,Qi,Js,ea,nl,rt,st,ot,it,at,ct,Te,rl}from"./chunk-x552npae.js";export{An as Router,el as abortNavigation,br as bracketPathToRegex,rt as clearMiddleware,Zi as createClientCookieManager,at as createMiddlewareContext,it as createRouteLocation,Yi as createServerCookieManager,Qi as createStorageManager,tl as defineMiddleware,Jc as defineRoute,Yc as defineRoutes,vr as findErrorPage,wr as formatRoutes,Xs as generateRouteManifest,Ks as generateRouteTypes,ea as getMiddleware,st as getMiddlewareNames,Te as getRouterScript,rl as getRouterScriptDev,nl as hasMiddleware,nt as isFileRequestPath,ot as loadMiddlewareFromDirectory,Rn as matchRoute,Qc as navigateTo,Z as patternToRegex,Js as registerMiddleware,Zc as resetRoutes,Pn as route,ct as runMiddleware,Xc as setAppUrl};
|