@stacksjs/stx 0.2.543 → 0.2.545
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-0xydscd9.js +2 -0
- package/dist/chunk-13xhvx68.js +2 -0
- package/dist/chunk-16e1y0dk.js +2 -0
- package/dist/{chunk-bczcm7jk.js → chunk-1b50m7e7.js} +2 -2
- package/dist/chunk-1hqxdn25.js +2 -0
- package/dist/{chunk-r9m4cgq9.js → chunk-1m3k0exr.js} +2 -2
- package/dist/chunk-1v2vehpc.js +2 -0
- package/dist/chunk-1w11d6gq.js +2 -0
- package/dist/chunk-2bpj2dsh.js +2 -0
- package/dist/{chunk-qmza4327.js → chunk-39tkfkp7.js} +3 -3
- package/dist/chunk-3j5bg3xq.js +2 -0
- package/dist/chunk-3m2h76cz.js +2 -0
- package/dist/{chunk-ty1v368m.js → chunk-3nc2fr4q.js} +2 -2
- package/dist/{chunk-hsf7nz8x.js → chunk-3v1av932.js} +2 -2
- package/dist/chunk-5141wftw.js +2 -0
- package/dist/{chunk-66s4nhp7.js → chunk-5fx8m234.js} +2 -2
- package/dist/chunk-5g7d3r7a.js +2 -0
- package/dist/{chunk-tzf7znh0.js → chunk-5ghn1gh5.js} +15 -15
- package/dist/{chunk-h51g1ydb.js → chunk-5hdby5qp.js} +4 -4
- package/dist/{chunk-s3r2pv39.js → chunk-64pbmrqg.js} +1 -1
- package/dist/{chunk-4d925m39.js → chunk-652v9mq4.js} +16 -16
- package/dist/chunk-6bcvd3pg.js +2 -0
- package/dist/chunk-6sa2s18z.js +2 -0
- package/dist/chunk-6w8r81kh.js +2 -0
- package/dist/{chunk-p15j9fzt.js → chunk-6wktqt18.js} +3 -3
- package/dist/chunk-6wpgxryt.js +2 -0
- package/dist/{chunk-292vew7b.js → chunk-74j18qk0.js} +28 -28
- package/dist/{chunk-jjwg83xv.js → chunk-75hb7wg6.js} +1 -1
- package/dist/{chunk-8m1y1kyr.js → chunk-77j26p6r.js} +6 -6
- package/dist/{chunk-0m3sjh3t.js → chunk-7dn3bdeh.js} +5 -5
- package/dist/chunk-7pewegtw.js +2 -0
- package/dist/{chunk-nd8v4xgb.js → chunk-7ze47qgv.js} +5 -5
- package/dist/{chunk-6dtmants.js → chunk-8a4g0mex.js} +5 -5
- package/dist/{chunk-ngxqydsg.js → chunk-8nwzd6eg.js} +3 -3
- package/dist/chunk-8sfdj65f.js +2 -0
- package/dist/{chunk-6abvk7vj.js → chunk-97vj2cqz.js} +2 -2
- package/dist/chunk-a3452td4.js +2 -0
- package/dist/chunk-a5kaw8sc.js +40 -0
- package/dist/{chunk-hvpzy98g.js → chunk-ah7h9q0x.js} +2 -2
- package/dist/{chunk-3bma1215.js → chunk-at2d96rz.js} +4 -4
- package/dist/{chunk-jbfad9cc.js → chunk-avgx6hd9.js} +2 -2
- package/dist/{chunk-wav410fm.js → chunk-b2fkxk6k.js} +3 -3
- package/dist/{chunk-zzphh8g9.js → chunk-b9jb44kv.js} +5 -5
- package/dist/chunk-byjr72wz.js +2 -0
- package/dist/chunk-cg8hg6cs.js +3 -0
- package/dist/{chunk-fq9vhy6b.js → chunk-cr4ab43x.js} +2 -2
- package/dist/chunk-cv8ea5yp.js +2 -0
- package/dist/{chunk-wh7xn313.js → chunk-d0yx9kef.js} +1 -1
- package/dist/{chunk-33bzhsyw.js → chunk-d37enreq.js} +3 -3
- package/dist/chunk-d7mfkc61.js +2 -0
- package/dist/chunk-d8fhthyf.js +2 -0
- package/dist/{chunk-x607yxrc.js → chunk-dyreg5df.js} +2 -2
- package/dist/{chunk-v9vvzdag.js → chunk-e124cgb6.js} +2 -2
- package/dist/{chunk-bpr4bkde.js → chunk-ec8k75ep.js} +2 -2
- package/dist/{chunk-gxedmh17.js → chunk-eeadhr78.js} +1 -1
- package/dist/{chunk-m011s2ha.js → chunk-f1n5napx.js} +3 -3
- package/dist/chunk-f8cs6j3n.js +2 -0
- package/dist/chunk-fprgww47.js +2 -0
- package/dist/{chunk-2kvbg3t5.js → chunk-frgpx23w.js} +4 -4
- package/dist/chunk-ft447y2j.js +2 -0
- package/dist/chunk-fyq2gste.js +2 -0
- package/dist/chunk-fz7dxc1q.js +2 -0
- package/dist/{chunk-m5fw8jq1.js → chunk-gjx5256r.js} +5 -5
- package/dist/{chunk-vfcwvqvd.js → chunk-hmehxwzj.js} +193 -193
- package/dist/chunk-hvs58485.js +2 -0
- package/dist/chunk-hzx0vtw0.js +2 -0
- package/dist/{chunk-y18yvcjb.js → chunk-j2erwdgt.js} +11 -11
- package/dist/chunk-jj4b0y48.js +2 -0
- package/dist/{chunk-tkvp3rz0.js → chunk-jmvp99ay.js} +7 -7
- package/dist/chunk-kb62w54c.js +2 -0
- package/dist/{chunk-xab6b4mt.js → chunk-kch9a9v1.js} +2 -2
- package/dist/chunk-kg8rbkcf.js +2 -0
- package/dist/{chunk-2bvk0qyd.js → chunk-kvmg6r89.js} +2 -2
- package/dist/{chunk-g12j8ahm.js → chunk-m6m19hwd.js} +4 -4
- package/dist/chunk-m9cmc6np.js +2 -0
- package/dist/chunk-m9r4x7e6.js +2 -0
- package/dist/{chunk-aqra6vsk.js → chunk-mbazkfy1.js} +3 -3
- package/dist/chunk-mbwdn96z.js +2 -0
- package/dist/{chunk-2me3dm0z.js → chunk-me81wras.js} +3 -3
- package/dist/chunk-mqje968d.js +2 -0
- package/dist/chunk-mxzge1d8.js +2 -0
- package/dist/chunk-myndj1r8.js +3 -0
- package/dist/{chunk-7tabykst.js → chunk-n1cqg89v.js} +2 -2
- package/dist/{chunk-0vn4gzyb.js → chunk-n77shkpy.js} +1 -1
- package/dist/chunk-njrakvz7.js +2 -0
- package/dist/{chunk-r2sy59wb.js → chunk-nrnq7x7p.js} +2 -2
- package/dist/chunk-pq8mz4ma.js +2 -0
- package/dist/{chunk-90wh9zzy.js → chunk-pz8mf91e.js} +5 -5
- package/dist/{chunk-dyegyt6m.js → chunk-q04fdq91.js} +2 -2
- package/dist/chunk-q24yyt9k.js +2 -0
- package/dist/chunk-qbsnvmj0.js +2 -0
- package/dist/chunk-qdrvx7vh.js +2 -0
- package/dist/chunk-qyj6zygv.js +2 -0
- package/dist/chunk-qzs6q626.js +2 -0
- package/dist/{chunk-d7zterbp.js → chunk-r4199q6x.js} +2 -2
- package/dist/chunk-r63aqsc9.js +2 -0
- package/dist/chunk-rrw61yk5.js +2 -0
- package/dist/chunk-rwgp4vt5.js +2 -0
- package/dist/chunk-sn98t7ef.js +2 -0
- package/dist/{chunk-3zqq3f2b.js → chunk-ssthwjpr.js} +5 -5
- package/dist/{chunk-2qbvsvwc.js → chunk-t61vdbje.js} +6 -6
- package/dist/chunk-te6s2apv.js +2 -0
- package/dist/chunk-tgfpk4ng.js +2 -0
- package/dist/chunk-v02g9244.js +2 -0
- package/dist/{chunk-c56qtne1.js → chunk-v2b8pa86.js} +1 -1
- package/dist/chunk-v2rhpdw3.js +2 -0
- package/dist/{chunk-vb4xxpa6.js → chunk-v39ysweq.js} +2 -2
- package/dist/chunk-v40d4bdy.js +2 -0
- package/dist/{chunk-vjdj0ex3.js → chunk-v79qs0qh.js} +1 -1
- package/dist/{chunk-m56m95gk.js → chunk-vpmb8gcc.js} +4 -4
- package/dist/{chunk-p8qr0q85.js → chunk-vvkfde23.js} +2 -2
- package/dist/{chunk-sgh6zsmc.js → chunk-vyjsrvpr.js} +3 -3
- package/dist/{chunk-150v780g.js → chunk-wcp4tf94.js} +23 -17
- package/dist/{chunk-yn3kp3qy.js → chunk-wy4hfmjs.js} +5 -5
- package/dist/{chunk-r6gxy92f.js → chunk-xya3vdqy.js} +2 -2
- package/dist/{chunk-3r1m3tyr.js → chunk-xzcmh5va.js} +1 -1
- package/dist/chunk-y83we135.js +2 -0
- package/dist/{chunk-0dqxnx20.js → chunk-yq1mvakj.js} +2 -2
- package/dist/{chunk-c2ys6ezs.js → chunk-ys3640vq.js} +9 -9
- package/dist/chunk-zfypzka2.js +2 -0
- package/dist/{chunk-9a73re8k.js → chunk-zmq9hwta.js} +2 -2
- package/dist/cli.js +43 -43
- package/dist/conditionals.js +2 -7
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/expressions.js +57 -4
- package/dist/interpolation-context.d.ts +27 -0
- package/dist/interpolation-context.js +46 -0
- package/dist/native/compiler/bundle.js +7 -1
- package/dist/native/compiler/render-screen.d.ts +2 -1
- package/dist/native/compiler/render-screen.js +7 -4
- package/dist/native/compiler/setup-script.d.ts +7 -0
- package/dist/native/compiler/setup-script.js +13 -2
- package/dist/native/live-activity.js +2 -0
- package/dist/native/runtime/binding-tree.d.ts +1 -0
- package/dist/native/runtime/binding-tree.js +10 -2
- package/dist/native/runtime/shared-screen.d.ts +2 -0
- package/dist/native/runtime/shared-screen.js +3 -0
- package/dist/pwa.js +3 -3
- package/dist/safe-evaluator.d.ts +1 -1
- package/dist/safe-evaluator.js +171 -66
- package/dist/ssg.js +2 -2
- package/package.json +5 -5
- package/dist/chunk-08emfsq3.js +0 -2
- package/dist/chunk-12v4d123.js +0 -2
- package/dist/chunk-2a4szpje.js +0 -3
- package/dist/chunk-2j0h8m7g.js +0 -2
- package/dist/chunk-3bwvaxk7.js +0 -2
- package/dist/chunk-3j4rze3n.js +0 -2
- package/dist/chunk-4hyhr5r7.js +0 -2
- package/dist/chunk-4q7ge545.js +0 -2
- package/dist/chunk-4qts8zk7.js +0 -2
- package/dist/chunk-4y2av4ev.js +0 -2
- package/dist/chunk-5gq8m2m7.js +0 -2
- package/dist/chunk-5rmc52h6.js +0 -2
- package/dist/chunk-69v9cn6n.js +0 -2
- package/dist/chunk-6sd4zdtg.js +0 -2
- package/dist/chunk-6tnh3cyq.js +0 -2
- package/dist/chunk-6va8wt88.js +0 -2
- package/dist/chunk-9a111pet.js +0 -3
- package/dist/chunk-9e1hftmd.js +0 -2
- package/dist/chunk-9etv5vzp.js +0 -2
- package/dist/chunk-9skdekv5.js +0 -2
- package/dist/chunk-c2cdv6rh.js +0 -2
- package/dist/chunk-cp4dr9ch.js +0 -2
- package/dist/chunk-d576yrbj.js +0 -2
- package/dist/chunk-dw5hrb3n.js +0 -2
- package/dist/chunk-ev51qyw1.js +0 -2
- package/dist/chunk-f1fyvqz0.js +0 -2
- package/dist/chunk-frw35d2v.js +0 -2
- package/dist/chunk-fzn7k9kn.js +0 -2
- package/dist/chunk-gsm1y1kb.js +0 -2
- package/dist/chunk-h1kssqxk.js +0 -2
- package/dist/chunk-h4crv0by.js +0 -2
- package/dist/chunk-h5p3h200.js +0 -2
- package/dist/chunk-j9c0yam7.js +0 -2
- package/dist/chunk-jt6p29k1.js +0 -2
- package/dist/chunk-jxbx6dk4.js +0 -2
- package/dist/chunk-kqkja1n4.js +0 -2
- package/dist/chunk-m27w29q6.js +0 -2
- package/dist/chunk-m7ddp1jw.js +0 -2
- package/dist/chunk-m7jmpech.js +0 -2
- package/dist/chunk-m8n9wxba.js +0 -2
- package/dist/chunk-ndv44bgs.js +0 -2
- package/dist/chunk-nssdvec7.js +0 -2
- package/dist/chunk-pkfwxp9n.js +0 -2
- package/dist/chunk-qtgejdvq.js +0 -2
- package/dist/chunk-rdy49a05.js +0 -2
- package/dist/chunk-rx4hz615.js +0 -2
- package/dist/chunk-sb0j0v59.js +0 -2
- package/dist/chunk-shf0hd05.js +0 -2
- package/dist/chunk-t1g1sp2z.js +0 -2
- package/dist/chunk-vdh825gt.js +0 -2
- package/dist/chunk-vhfwnvmc.js +0 -40
- package/dist/chunk-vm2cbysz.js +0 -2
- package/dist/chunk-wzymzex7.js +0 -2
- package/dist/chunk-xey01yna.js +0 -2
- package/dist/chunk-xmd8wp8x.js +0 -2
- package/dist/chunk-xmwd2xm6.js +0 -2
- package/dist/chunk-yw3cqy43.js +0 -2
- package/dist/chunk-zpf9he2x.js +0 -2
package/dist/safe-evaluator.js
CHANGED
|
@@ -26,7 +26,62 @@ const _ALLOWED_GLOBALS = new Set([
|
|
|
26
26
|
"JSON",
|
|
27
27
|
"Number",
|
|
28
28
|
"Boolean"
|
|
29
|
-
]), NEW_OPERATOR_PATTERN = /\bnew\s+/, SAFE_CTOR_PARAM = "__stx_safe_ctors",
|
|
29
|
+
]), NEW_OPERATOR_PATTERN = /\bnew\s+/, SAFE_CTOR_PARAM = "__stx_safe_ctors", BLOCKED_GLOBAL_NAMES = [
|
|
30
|
+
"Bun",
|
|
31
|
+
"Deno",
|
|
32
|
+
"Buffer",
|
|
33
|
+
"fetch",
|
|
34
|
+
"atob",
|
|
35
|
+
"btoa",
|
|
36
|
+
"console",
|
|
37
|
+
"Response",
|
|
38
|
+
"Request",
|
|
39
|
+
"Headers",
|
|
40
|
+
"WebAssembly",
|
|
41
|
+
"structuredClone",
|
|
42
|
+
"queueMicrotask",
|
|
43
|
+
"crypto",
|
|
44
|
+
"performance",
|
|
45
|
+
"navigator",
|
|
46
|
+
"Worker",
|
|
47
|
+
"WebSocket",
|
|
48
|
+
"BroadcastChannel",
|
|
49
|
+
"EventSource",
|
|
50
|
+
"XMLHttpRequest",
|
|
51
|
+
"localStorage",
|
|
52
|
+
"sessionStorage"
|
|
53
|
+
], SHADOWED_GLOBAL_NAMES = [
|
|
54
|
+
...BLOCKED_GLOBAL_NAMES,
|
|
55
|
+
"Function",
|
|
56
|
+
"setTimeout",
|
|
57
|
+
"setInterval",
|
|
58
|
+
"setImmediate",
|
|
59
|
+
"process",
|
|
60
|
+
"require",
|
|
61
|
+
"exports",
|
|
62
|
+
"module",
|
|
63
|
+
"window",
|
|
64
|
+
"document",
|
|
65
|
+
"global",
|
|
66
|
+
"globalThis",
|
|
67
|
+
"Reflect",
|
|
68
|
+
"Proxy",
|
|
69
|
+
"Symbol",
|
|
70
|
+
"WeakMap",
|
|
71
|
+
"WeakSet",
|
|
72
|
+
"WeakRef",
|
|
73
|
+
"FinalizationRegistry"
|
|
74
|
+
], SHADOWED_GLOBAL_VALUES = SHADOWED_GLOBAL_NAMES.map(() => {
|
|
75
|
+
return;
|
|
76
|
+
}), SAFE_OBJECT = Object.freeze(Object.assign(Object.create(null), {
|
|
77
|
+
keys: Object.keys,
|
|
78
|
+
values: Object.values,
|
|
79
|
+
entries: Object.entries,
|
|
80
|
+
fromEntries: Object.fromEntries,
|
|
81
|
+
assign: Object.assign,
|
|
82
|
+
hasOwn: Object.hasOwn,
|
|
83
|
+
is: Object.is
|
|
84
|
+
})), DANGEROUS_PATTERNS = [
|
|
30
85
|
/\b(eval|Function|setTimeout|setInterval|setImmediate)\b/,
|
|
31
86
|
/\b(process|require|import|exports|module)\b/,
|
|
32
87
|
/\b(window|document|global|globalThis)\b/,
|
|
@@ -39,8 +94,10 @@ const _ALLOWED_GLOBALS = new Set([
|
|
|
39
94
|
/\.(bind|call|apply)\s*\(/,
|
|
40
95
|
NEW_OPERATOR_PATTERN,
|
|
41
96
|
/\bdelete\s+/,
|
|
42
|
-
/\bthis\b
|
|
97
|
+
/\bthis\b/,
|
|
98
|
+
/\\u(?:\{[\dA-Fa-f]+\}|[\dA-Fa-f]{4})/
|
|
43
99
|
], DANGEROUS_IDENTIFIERS = new Set([
|
|
100
|
+
...BLOCKED_GLOBAL_NAMES,
|
|
44
101
|
"eval",
|
|
45
102
|
"Function",
|
|
46
103
|
"setTimeout",
|
|
@@ -73,7 +130,7 @@ const _ALLOWED_GLOBALS = new Set([
|
|
|
73
130
|
"__proto__",
|
|
74
131
|
"constructor",
|
|
75
132
|
"prototype"
|
|
76
|
-
])
|
|
133
|
+
]);
|
|
77
134
|
function stripStringLiteralsWithMap(expr) {
|
|
78
135
|
let result = "";
|
|
79
136
|
const map = [];
|
|
@@ -192,31 +249,43 @@ function assertNoUnsafeIdentifierTokens(strippedExpression, originalExpression)
|
|
|
192
249
|
throw new UnsafeExpressionError(`matched /.${identifier}/; property ${identifier}`, originalExpression);
|
|
193
250
|
}
|
|
194
251
|
}
|
|
195
|
-
function
|
|
196
|
-
const
|
|
252
|
+
function assertSafeBracketAccess(expression, allowDynamicIdentifiers = !0) {
|
|
253
|
+
const bracketAccessRe = /(?:[$\w)\].]|\?\.)\s*\[([^\]]*)\]/g, dynamicKeys = new Set;
|
|
197
254
|
let match;
|
|
198
|
-
while ((match =
|
|
199
|
-
const
|
|
200
|
-
if (
|
|
255
|
+
while ((match = bracketAccessRe.exec(expression)) !== null) {
|
|
256
|
+
const bracketOffset = match.index + match[0].indexOf("["), beforeBracket = expression.slice(0, bracketOffset);
|
|
257
|
+
if (/(?:^|[^$\w])(?:let|const|var)\s*$/.test(beforeBracket))
|
|
258
|
+
continue;
|
|
259
|
+
const keySource = match[1].trim(), singleQuoted = /^'(?:[^'\\]|\\.)*'$/.test(keySource), doubleQuoted = /^"(?:[^"\\]|\\.)*"$/.test(keySource);
|
|
260
|
+
if (/^\d+$/.test(keySource))
|
|
201
261
|
continue;
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
262
|
+
if (singleQuoted || doubleQuoted) {
|
|
263
|
+
const key = keySource.slice(1, -1);
|
|
264
|
+
if (DANGEROUS_BRACKET_KEYS.has(key))
|
|
265
|
+
throw new UnsafeExpressionError(`bracket key ${key}`, expression);
|
|
266
|
+
if (!currentConfig.allowBracketNotation)
|
|
267
|
+
throw new UnsafeExpressionError("bracket notation with a string key; enable with configureSafeEvaluator({ allowBracketNotation: true })", expression, `Bracket notation with strings not allowed: ${expression}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);
|
|
268
|
+
continue;
|
|
269
|
+
}
|
|
270
|
+
if (allowDynamicIdentifiers && /^[$A-Z_a-z][$\w]*$/.test(keySource)) {
|
|
271
|
+
dynamicKeys.add(keySource);
|
|
272
|
+
continue;
|
|
273
|
+
}
|
|
274
|
+
throw new UnsafeExpressionError("dynamic bracket notation is not allowed", expression);
|
|
205
275
|
}
|
|
276
|
+
return [...dynamicKeys];
|
|
206
277
|
}
|
|
207
278
|
function prepareExpression(expression) {
|
|
208
279
|
const trimmed = expression.trim(), stripped = stripStringLiterals(trimmed);
|
|
209
280
|
assertNoUnsafeIdentifierTokens(stripped, trimmed);
|
|
210
|
-
|
|
281
|
+
const dynamicKeys = assertSafeBracketAccess(trimmed);
|
|
211
282
|
for (const pattern of DANGEROUS_PATTERNS) {
|
|
212
283
|
if (pattern === NEW_OPERATOR_PATTERN)
|
|
213
284
|
continue;
|
|
214
285
|
if (pattern.test(stripped))
|
|
215
286
|
throw new UnsafeExpressionError(`matched /${pattern.source}/`, trimmed);
|
|
216
287
|
}
|
|
217
|
-
|
|
218
|
-
throw new UnsafeExpressionError("bracket notation with a string key; enable with configureSafeEvaluator({ allowBracketNotation: true })", trimmed, `Bracket notation with strings not allowed: ${trimmed}. Enable with configureSafeEvaluator({ allowBracketNotation: true })`);
|
|
219
|
-
return rewriteSafeConstructors(trimmed);
|
|
288
|
+
return { ...rewriteSafeConstructors(trimmed), dynamicKeys };
|
|
220
289
|
}
|
|
221
290
|
export function sanitizeExpression(expression) {
|
|
222
291
|
prepareExpression(expression);
|
|
@@ -231,6 +300,7 @@ export function createSafeContext(context) {
|
|
|
231
300
|
safeContext.Number = Number;
|
|
232
301
|
safeContext.Boolean = Boolean;
|
|
233
302
|
safeContext.Array = Array;
|
|
303
|
+
safeContext.Object = SAFE_OBJECT;
|
|
234
304
|
safeContext.parseInt = Number.parseInt;
|
|
235
305
|
safeContext.parseFloat = Number.parseFloat;
|
|
236
306
|
safeContext.isNaN = Number.isNaN;
|
|
@@ -293,8 +363,12 @@ export function getExpressionSafetyReason(expression) {
|
|
|
293
363
|
}
|
|
294
364
|
export function safeEvaluateCondition(expression, context) {
|
|
295
365
|
try {
|
|
296
|
-
const
|
|
297
|
-
|
|
366
|
+
const safeContext = createSafeContext(context), keys = Object.keys(safeContext), values = Object.values(safeContext);
|
|
367
|
+
let readMissingIdentifier = !1;
|
|
368
|
+
const result = createSafeFunction(expression, keys, () => {
|
|
369
|
+
readMissingIdentifier = !0;
|
|
370
|
+
})(...values);
|
|
371
|
+
return !readMissingIdentifier && Boolean(result);
|
|
298
372
|
} catch {
|
|
299
373
|
return !1;
|
|
300
374
|
}
|
|
@@ -391,12 +465,12 @@ const VALID_PARAM_IDENT = /^[A-Za-z_$][\w$]*$/;
|
|
|
391
465
|
export function isUsableParamName(name) {
|
|
392
466
|
return VALID_PARAM_IDENT.test(name) && !RESERVED_PARAM_NAMES.has(name);
|
|
393
467
|
}
|
|
394
|
-
export function createSafeFunction(expression, contextKeys) {
|
|
395
|
-
const { source: sanitizedExpr, usesSafeConstructors } = prepareExpression(expression), validEntries = [];
|
|
468
|
+
export function createSafeFunction(expression, contextKeys, onMissingIdentifier) {
|
|
469
|
+
const { source: sanitizedExpr, usesSafeConstructors, dynamicKeys } = prepareExpression(expression), validEntries = [];
|
|
396
470
|
for (let i = 0;i < contextKeys.length; i++) {
|
|
397
471
|
if (!isUsableParamName(contextKeys[i]))
|
|
398
472
|
continue;
|
|
399
|
-
if (contextKeys[i] === SAFE_CTOR_PARAM)
|
|
473
|
+
if (contextKeys[i] === SAFE_CTOR_PARAM || contextKeys[i] === "Object" || DANGEROUS_IDENTIFIERS.has(contextKeys[i]))
|
|
400
474
|
continue;
|
|
401
475
|
validEntries.push({ key: contextKeys[i], index: i });
|
|
402
476
|
}
|
|
@@ -413,16 +487,34 @@ catch (e) {
|
|
|
413
487
|
throw e;
|
|
414
488
|
}
|
|
415
489
|
`;
|
|
416
|
-
return bindProjection(usesSafeConstructors ? (extraParams) => {
|
|
417
|
-
const compiled = compileFunctionBody([SAFE_CTOR_PARAM, ...filteredKeys, ...extraParams], body);
|
|
418
|
-
return (...args) => compiled(SAFE_CONSTRUCTORS, ...args);
|
|
419
|
-
} : (extraParams) =>
|
|
490
|
+
return guardDynamicKeys(bindProjection(usesSafeConstructors ? (extraParams) => {
|
|
491
|
+
const compiled = compileFunctionBody([SAFE_CTOR_PARAM, "Object", ...SHADOWED_GLOBAL_NAMES, ...filteredKeys, ...extraParams], body);
|
|
492
|
+
return (...args) => compiled(SAFE_CONSTRUCTORS, SAFE_OBJECT, ...SHADOWED_GLOBAL_VALUES, ...args);
|
|
493
|
+
} : (extraParams) => {
|
|
494
|
+
const compiled = compileFunctionBody(["Object", ...SHADOWED_GLOBAL_NAMES, ...filteredKeys, ...extraParams], body);
|
|
495
|
+
return (...args) => compiled(SAFE_OBJECT, ...SHADOWED_GLOBAL_VALUES, ...args);
|
|
496
|
+
}, filteredKeys, contextKeys, validEntries, validIndices, onMissingIdentifier), contextKeys, dynamicKeys);
|
|
497
|
+
}
|
|
498
|
+
function guardDynamicKeys(evaluate, contextKeys, dynamicKeys) {
|
|
499
|
+
if (dynamicKeys.length === 0)
|
|
500
|
+
return evaluate;
|
|
501
|
+
const keyIndices = dynamicKeys.map((key) => contextKeys.indexOf(key));
|
|
502
|
+
return (...args) => {
|
|
503
|
+
for (const index of keyIndices) {
|
|
504
|
+
if (index < 0)
|
|
505
|
+
continue;
|
|
506
|
+
const key = args[index];
|
|
507
|
+
if (typeof key === "string" && DANGEROUS_BRACKET_KEYS.has(key))
|
|
508
|
+
return;
|
|
509
|
+
}
|
|
510
|
+
return evaluate(...args);
|
|
511
|
+
};
|
|
420
512
|
}
|
|
421
|
-
function bindProjection(buildFunc, filteredKeys, contextKeys, validEntries, validIndices) {
|
|
513
|
+
function bindProjection(buildFunc, filteredKeys, contextKeys, validEntries, validIndices, onMissingIdentifier) {
|
|
422
514
|
let func = buildFunc([]);
|
|
423
515
|
const alreadyCanonical = validEntries.every((entry, index) => entry.index === index);
|
|
424
516
|
if (filteredKeys.length === contextKeys.length && alreadyCanonical)
|
|
425
|
-
return wrapWithMissingIdentifierRetry(func, filteredKeys, buildFunc);
|
|
517
|
+
return wrapWithMissingIdentifierRetry(func, filteredKeys, buildFunc, void 0, onMissingIdentifier);
|
|
426
518
|
return wrapWithMissingIdentifierRetry((...args) => {
|
|
427
519
|
const projected = Array(validIndices.length);
|
|
428
520
|
for (let i = 0;i < validIndices.length; i++)
|
|
@@ -430,9 +522,9 @@ function bindProjection(buildFunc, filteredKeys, contextKeys, validEntries, vali
|
|
|
430
522
|
return func(...projected);
|
|
431
523
|
}, filteredKeys, buildFunc, (extra) => {
|
|
432
524
|
func = buildFunc(extra);
|
|
433
|
-
});
|
|
525
|
+
}, onMissingIdentifier);
|
|
434
526
|
}
|
|
435
|
-
function wrapWithMissingIdentifierRetry(initialFunc, filteredKeys, buildFunc, onRebuild) {
|
|
527
|
+
function wrapWithMissingIdentifierRetry(initialFunc, filteredKeys, buildFunc, onRebuild, onMissingIdentifier) {
|
|
436
528
|
const MAX_RETRIES = 8, missingRe = /^(\w+) is not defined$/;
|
|
437
529
|
let func = initialFunc;
|
|
438
530
|
const extraParams = [], knownNames = new Set(filteredKeys);
|
|
@@ -445,8 +537,9 @@ function wrapWithMissingIdentifierRetry(initialFunc, filteredKeys, buildFunc, on
|
|
|
445
537
|
if (!(e instanceof ReferenceError) || !match)
|
|
446
538
|
return;
|
|
447
539
|
const missingName = match[1];
|
|
448
|
-
if (knownNames.has(missingName) || RESERVED_PARAM_NAMES.has(missingName))
|
|
540
|
+
if (knownNames.has(missingName) || RESERVED_PARAM_NAMES.has(missingName) || DANGEROUS_IDENTIFIERS.has(missingName))
|
|
449
541
|
return;
|
|
542
|
+
onMissingIdentifier?.(missingName);
|
|
450
543
|
knownNames.add(missingName);
|
|
451
544
|
extraParams.push(missingName);
|
|
452
545
|
if (onRebuild)
|
|
@@ -464,53 +557,64 @@ export function safeEvaluateCode(code, context) {
|
|
|
464
557
|
return;
|
|
465
558
|
if (code.length > MAX_SAFE_EVAL_CODE_LENGTH)
|
|
466
559
|
throw Error(`safeEvaluateCode: input exceeds ${MAX_SAFE_EVAL_CODE_LENGTH} chars`);
|
|
560
|
+
const stripped = stripStringLiterals(code);
|
|
561
|
+
assertNoUnsafeIdentifierTokens(stripped, code);
|
|
562
|
+
assertSafeBracketAccess(code, !1);
|
|
467
563
|
for (const pattern of DANGEROUS_PATTERNS)
|
|
468
|
-
if (pattern.test(
|
|
564
|
+
if (pattern.test(stripped))
|
|
469
565
|
throw Error("Potentially unsafe code detected");
|
|
470
|
-
const safeContext = createSafeContext(context), keys = Object.keys(safeContext).filter(isUsableParamName), values = keys.map((key) => safeContext[key]);
|
|
471
|
-
return Function(...keys, `
|
|
566
|
+
const safeContext = createSafeContext(context), keys = Object.keys(safeContext).filter((key) => key !== "Object" && isUsableParamName(key) && !DANGEROUS_IDENTIFIERS.has(key)), values = keys.map((key) => safeContext[key]);
|
|
567
|
+
return Function("Object", ...SHADOWED_GLOBAL_NAMES, ...keys, `
|
|
472
568
|
'use strict';
|
|
473
569
|
${code}
|
|
474
|
-
`)(...values);
|
|
570
|
+
`)(SAFE_OBJECT, ...SHADOWED_GLOBAL_VALUES, ...values);
|
|
475
571
|
} catch {
|
|
476
572
|
return;
|
|
477
573
|
}
|
|
478
574
|
}
|
|
479
575
|
export function isForExpressionSafe(expression) {
|
|
480
|
-
const trimmed = expression.trim()
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
/\
|
|
484
|
-
/\brequire\s*\(/i,
|
|
485
|
-
/\bprocess\b/i,
|
|
486
|
-
/\b__proto__\b/i,
|
|
487
|
-
/\bconstructor\s*[.(]/i,
|
|
488
|
-
/\bglobalThis\b/i,
|
|
489
|
-
/\bwindow\b/i,
|
|
490
|
-
/\bdocument\b/i,
|
|
491
|
-
/\bfetch\s*\(/i,
|
|
492
|
-
/\bBun\b/i,
|
|
493
|
-
/\bDeno\b/i,
|
|
494
|
-
/\bconsole\b/i,
|
|
495
|
-
/\bthis\b/i,
|
|
496
|
-
/\bReflect\b/i,
|
|
497
|
-
/\bProxy\b/i,
|
|
498
|
-
/\bprototype\b/i,
|
|
499
|
-
/\.(bind|call|apply)\s*\(/i
|
|
500
|
-
];
|
|
501
|
-
for (const pattern of forDangerousPatterns)
|
|
502
|
-
if (pattern.test(trimmed))
|
|
576
|
+
const trimmed = expression.trim();
|
|
577
|
+
try {
|
|
578
|
+
const stripped = stripStringLiterals(trimmed);
|
|
579
|
+
if (/\b(?:eval|function|import|require|process|globalthis|window|document|fetch|bun|deno|buffer|console|reflect|proxy|prototype|constructor|this)\b/i.test(stripped))
|
|
503
580
|
return !1;
|
|
581
|
+
assertNoUnsafeIdentifierTokens(stripped, trimmed);
|
|
582
|
+
assertSafeBracketAccess(trimmed);
|
|
583
|
+
for (const pattern of DANGEROUS_PATTERNS)
|
|
584
|
+
if (pattern.test(stripped))
|
|
585
|
+
return !1;
|
|
586
|
+
} catch {
|
|
587
|
+
return !1;
|
|
588
|
+
}
|
|
504
589
|
return !0;
|
|
505
590
|
}
|
|
506
591
|
export function createSafeLoopFunction(loopType, expression, body, contextKeys, maxIterations = 1000) {
|
|
507
592
|
if (!isForExpressionSafe(expression))
|
|
508
593
|
throw Error(`Unsafe expression in @${loopType}: ${expression}`);
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
})
|
|
512
|
-
|
|
513
|
-
|
|
594
|
+
if (!Number.isSafeInteger(maxIterations) || maxIterations <= 0)
|
|
595
|
+
throw RangeError("maxIterations must be a positive safe integer");
|
|
596
|
+
const dynamicKeys = new Set(assertSafeBracketAccess(expression)), processedBody = body.replace(/`/g, "\\`").replace(/\$\{/g, "\\${").replace(/\{\{([^}]+)\}\}/g, (_match, expr) => {
|
|
597
|
+
const { source, dynamicKeys: bodyDynamicKeys } = prepareExpression(expr);
|
|
598
|
+
for (const key of bodyDynamicKeys)
|
|
599
|
+
dynamicKeys.add(key);
|
|
600
|
+
return `\${${source}}`;
|
|
601
|
+
}), validEntries = [], seen = new Set;
|
|
602
|
+
for (let i = 0;i < contextKeys.length; i++) {
|
|
603
|
+
const key = contextKeys[i];
|
|
604
|
+
if (!isUsableParamName(key) || DANGEROUS_IDENTIFIERS.has(key) || key === SAFE_CTOR_PARAM || key === "Object" || key === "__stx_warn" || seen.has(key))
|
|
605
|
+
continue;
|
|
606
|
+
seen.add(key);
|
|
607
|
+
validEntries.push({ key, index: i });
|
|
608
|
+
}
|
|
609
|
+
const filteredKeys = validEntries.map((entry) => entry.key), projectAndBind = (compiled) => {
|
|
610
|
+
const guarded = guardDynamicKeys((...args) => {
|
|
611
|
+
const projected = validEntries.map((entry) => args[entry.index]), warn = (...message) => console.warn(...message);
|
|
612
|
+
return compiled(SAFE_CONSTRUCTORS, SAFE_OBJECT, ...SHADOWED_GLOBAL_VALUES, warn, ...projected);
|
|
613
|
+
}, contextKeys, [...dynamicKeys]);
|
|
614
|
+
return (...args) => String(guarded(...args) ?? "");
|
|
615
|
+
};
|
|
616
|
+
if (loopType === "for") {
|
|
617
|
+
const compiled = Function(SAFE_CTOR_PARAM, "Object", ...SHADOWED_GLOBAL_NAMES, "__stx_warn", ...filteredKeys, `
|
|
514
618
|
'use strict';
|
|
515
619
|
let result = '';
|
|
516
620
|
for (${expression}) {
|
|
@@ -519,8 +623,9 @@ export function createSafeLoopFunction(loopType, expression, body, contextKeys,
|
|
|
519
623
|
return result;
|
|
520
624
|
// eslint-disable-next-line pickier/no-unused-vars
|
|
521
625
|
`);
|
|
522
|
-
|
|
523
|
-
|
|
626
|
+
return projectAndBind(compiled);
|
|
627
|
+
} else {
|
|
628
|
+
const compiled = Function(SAFE_CTOR_PARAM, "Object", ...SHADOWED_GLOBAL_NAMES, "__stx_warn", ...filteredKeys, `
|
|
524
629
|
'use strict';
|
|
525
630
|
let result = '';
|
|
526
631
|
let __safeCounter = 0;
|
|
@@ -534,11 +639,11 @@ export function createSafeLoopFunction(loopType, expression, body, contextKeys,
|
|
|
534
639
|
// made pages render half a list with no breadcrumb.
|
|
535
640
|
if (__safeCounter >= __maxIterations) {
|
|
536
641
|
result += '<!-- [Loop Error]: Maximum iterations exceeded -->';
|
|
537
|
-
|
|
538
|
-
console.warn('[stx] @while loop hit max iterations (' + __maxIterations + '); template output was truncated. Raise via createSafeForLoop(..., maxIterations) if intentional.');
|
|
539
|
-
}
|
|
642
|
+
__stx_warn('[stx] @while loop hit max iterations (' + __maxIterations + '); template output was truncated. Raise via createSafeForLoop(..., maxIterations) if intentional.');
|
|
540
643
|
}
|
|
541
644
|
return result;
|
|
542
645
|
// eslint-disable-next-line pickier/no-unused-vars
|
|
543
646
|
`);
|
|
647
|
+
return projectAndBind(compiled);
|
|
648
|
+
}
|
|
544
649
|
}
|
package/dist/ssg.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-azb58ven.js";import"./chunk-
|
|
2
|
+
import"./chunk-azb58ven.js";import"./chunk-a5kaw8sc.js";import"./chunk-ec8k75ep.js";import{nt,rt,st,ot,it,at}from"./chunk-kvmg6r89.js";import"./chunk-r4199q6x.js";import"./chunk-6v1gwdbv.js";import{f,ze,N,K,n,o}from"./chunk-hmehxwzj.js";import"./chunk-j2erwdgt.js";import{sr}from"./chunk-jmvp99ay.js";import"./chunk-e124cgb6.js";import"./chunk-q04fdq91.js";import"./chunk-1xgs9gd5.js";import"./chunk-dyreg5df.js";import"./chunk-ssthwjpr.js";import{ae,yt,bt}from"./chunk-6wktqt18.js";import{No,Lo,jo}from"./chunk-wk85dz07.js";import{mt,Qt,en}from"./chunk-hpeg9erh.js";import"./chunk-1b50m7e7.js";import{a}from"./chunk-4cmqjmqr.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
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 wt{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]}
|
|
@@ -41,7 +41,7 @@ ${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();bt();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-
|
|
44
|
+
</rss>`}async function zt(t={}){let i=Date.now();bt();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-kg8rbkcf.js");try{D=m(await u(process.cwd()))}catch{}}let{prepareImageDelivery:p}=await import("./chunk-f8cs6j3n.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-kg8rbkcf.js");await u('<div class="bg-black"></div>')}catch{}nt();let xt=s?.routeMiddleware?.dir||"middleware";await st(process.cwd(),xt);let H=rt();if(H.length>0)console.log(`Loaded ${H.length} middleware: ${H.join(", ")}`);let vt=s?.routeMiddleware?.global||[];jo(s?.layoutsDir,a(process.cwd()));let V=N(".",{pagesDir:e.pagesDir,pagesDirs:s?._layerPageDirs});console.log(`Found ${V.length} routes`);let _=[];for(let u of V){let m=await Ot(u);for(let v of m)_.push({route:u,url:v.url,params:v.params,props:v.props,revalidate:v.revalidate??e.revalidate})}l.totalPages=_.length,console.log(`Generating ${l.totalPages} pages...`);let A=[],X=[];for(let u=0;u<_.length;u+=e.concurrency)X.push(_.slice(u,u+e.concurrency));for(let u of X)await Promise.all(u.map(async(m)=>{let{route:v,url:d,params:L,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=[...vt,...$t];if(tt.length>0){let C=ot(d,L,F||{}),O=it(C,null,void 0,{isServer:!0}),E=await at(tt,O);if(E.redirect){let R=typeof E.redirect==="string"?E.redirect:E.redirect.path||E.redirect,U=Vt(String(R),d),T=Kt(d,e);await x.promises.mkdir(g.dirname(T),{recursive:!0}),await Bun.write(T,U),l.successCount++,l.pages.push({route:d,outputPath:T,size:Buffer.byteLength(U),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
47
|
`)({params:L})){console.warn(`Validation failed for ${d}, skipping...`);return}}catch{}let k=null,ct=!1;if(e.cache){if(k=B.get(d,v.filePath),k)ct=!0,l.cachedCount++}if(!k){let C=await St(v,L,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:
|
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.545",
|
|
5
5
|
"description": "A performant UI Framework. Powered by Bun.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -123,12 +123,12 @@
|
|
|
123
123
|
"dependencies": {
|
|
124
124
|
"@stacksjs/ts-css": "^0.3.11",
|
|
125
125
|
"@stacksjs/clapp": "^0.2.16",
|
|
126
|
-
"@stacksjs/desktop": "0.2.
|
|
127
|
-
"@stacksjs/sanitizer": "0.2.
|
|
126
|
+
"@stacksjs/desktop": "0.2.545",
|
|
127
|
+
"@stacksjs/sanitizer": "0.2.545",
|
|
128
128
|
"@stacksjs/ts-i18n": "^0.1.11",
|
|
129
|
-
"bun-plugin-stx": "0.2.
|
|
129
|
+
"bun-plugin-stx": "0.2.545",
|
|
130
130
|
"bunfig": "^0.15.19",
|
|
131
|
-
"stx-router": "0.2.
|
|
131
|
+
"stx-router": "0.2.545",
|
|
132
132
|
"ts-broadcasting": "^0.0.11",
|
|
133
133
|
"ts-images": "^0.2.22",
|
|
134
134
|
"ts-syntax-highlighter": "^0.2.1"
|
package/dist/chunk-08emfsq3.js
DELETED
package/dist/chunk-12v4d123.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{pl,fl,gl,ml,ca,hl,yl,bl,wl,vl,xl,Sl}from"./chunk-p8qr0q85.js";export{xl as Broadcast,Sl as BroadcastServer,ca as broadcast,wl as broadcastPresence,bl as broadcastPrivate,vl as channel,pl as getBroadcastServer,ml as loadChannels,fl as startBroadcasting,gl as stopBroadcasting,hl as toUser,yl as toUsers};
|
package/dist/chunk-2a4szpje.js
DELETED
package/dist/chunk-2j0h8m7g.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{zn,rc,Dd,sc,Md,oc,Hn,b,Ct,be,ic,ns,ac,Nd,G,cc,Ld,x,jd}from"./chunk-vfcwvqvd.js";import"./chunk-bczcm7jk.js";import"./chunk-bpr4bkde.js";import"./chunk-x607yxrc.js";import"./chunk-dyegyt6m.js";import"./chunk-v9vvzdag.js";import"./chunk-tkvp3rz0.js";import"./chunk-y18yvcjb.js";import"./chunk-vhfwnvmc.js";import"./chunk-6v1gwdbv.js";import"./chunk-d7zterbp.js";import"./chunk-2bvk0qyd.js";import"./chunk-1xgs9gd5.js";export{cc as applyFilters,Md as clearCustomFilters,ic as clientLoopScopes,zn as defaultFilters,b as escapeHtml,Ct as escapeHtmlValue,x as evaluateExpression,oc as findMustacheEnd,sc as getAllFilters,ac as interpolateScriptAttributes,ns as interpolateScriptExpressions,Nd as interpolateScriptsInTemplate,G as processExpressions,rc as registerFilter,Dd as registerFilters,Hn as replaceInterpolations,Ld as resetRejectedExpressionWarnings,jd as unescapeHtml,be as usesSignalsInScript};
|
package/dist/chunk-3bwvaxk7.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{kl}from"./chunk-r2sy59wb.js";import"./chunk-vfcwvqvd.js";import"./chunk-bczcm7jk.js";import"./chunk-bpr4bkde.js";import"./chunk-x607yxrc.js";import"./chunk-dyegyt6m.js";import"./chunk-v9vvzdag.js";import"./chunk-tkvp3rz0.js";import"./chunk-y18yvcjb.js";import"./chunk-vhfwnvmc.js";import"./chunk-6v1gwdbv.js";import"./chunk-d7zterbp.js";import"./chunk-2bvk0qyd.js";import"./chunk-1xgs9gd5.js";export{kl as buildApp};
|
package/dist/chunk-3j4rze3n.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Zd,Ac,we,mi,Qd,ys,bs,ws}from"./chunk-vfcwvqvd.js";import"./chunk-bczcm7jk.js";import"./chunk-bpr4bkde.js";import"./chunk-x607yxrc.js";import"./chunk-dyegyt6m.js";import"./chunk-v9vvzdag.js";import"./chunk-tkvp3rz0.js";import"./chunk-y18yvcjb.js";import"./chunk-vhfwnvmc.js";import"./chunk-6v1gwdbv.js";import"./chunk-d7zterbp.js";import"./chunk-2bvk0qyd.js";import"./chunk-1xgs9gd5.js";export{Qd as clearOnceStore,mi as onceStore,we as partialsCache,ys as processIncludes,bs as processStackPushDirectives,ws as processStackReplacements,Zd as resetUnscopedSignalWarnings,Ac as topLevelElements};
|
package/dist/chunk-4hyhr5r7.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ms,cu,lu,Di,ge,Hc,ar,du,uu,pu,fu,gu,mu,hu,yu,bu}from"./chunk-y18yvcjb.js";import"./chunk-vhfwnvmc.js";export{mu as applyHead,du as definePageMeta,Ms as getHead,cu as getPageMeta,ge as mergeHeadConfigs,hu as processHeadDirective,bu as processMetaDirective,yu as processTitleDirective,gu as renderBodyAttrs,pu as renderHead,fu as renderHtmlAttrs,lu as resetHead,ar as seoMetaToHeadConfig,Di as useHead,uu as usePageTitle,Hc as useSeoMeta,uu as useTitle};
|
package/dist/chunk-4q7ge545.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{id,ad}from"./chunk-sgh6zsmc.js";import"./chunk-p15j9fzt.js";import"./chunk-3zqq3f2b.js";import"./chunk-azb58ven.js";import"./chunk-vfcwvqvd.js";import"./chunk-bczcm7jk.js";import"./chunk-bpr4bkde.js";import"./chunk-x607yxrc.js";import"./chunk-dyegyt6m.js";import"./chunk-v9vvzdag.js";import"./chunk-tkvp3rz0.js";import"./chunk-y18yvcjb.js";import"./chunk-vhfwnvmc.js";import"./chunk-6v1gwdbv.js";import"./chunk-d7zterbp.js";import"./chunk-2bvk0qyd.js";import"./chunk-1xgs9gd5.js";export{ad as clearStoreCache,id as getStoreScript};
|
package/dist/chunk-4qts8zk7.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{_a,Ta,$a,Ra,Aa,Pa,Ia,Oa,Da,Ma,Nl}from"./chunk-8m1y1kyr.js";export{_a as createIslandRegistry,Nl as default,Ma as generateIslandManifest,$a as generatePartialHydrationCSS,Pa as hydrateAll,Aa as hydrateByStrategy,Ra as hydrateIsland,Ia as isHydrated,Oa as onHydrated,Ta as processPartialHydrationDirectives,Da as processStaticDirectives};
|
package/dist/chunk-4y2av4ev.js
DELETED
package/dist/chunk-5gq8m2m7.js
DELETED
package/dist/chunk-5rmc52h6.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{d,ms,pi,fi,Pc,Ic,Oc,Dc,Mc,Nc,qe,L,Ge,Lc,Jn,jc,yi,Bc,Ke,r,Yn,bi,g,te,eu}from"./chunk-vfcwvqvd.js";import"./chunk-bczcm7jk.js";import"./chunk-bpr4bkde.js";import"./chunk-x607yxrc.js";import"./chunk-dyegyt6m.js";import"./chunk-v9vvzdag.js";import"./chunk-tkvp3rz0.js";import"./chunk-y18yvcjb.js";import"./chunk-vhfwnvmc.js";import"./chunk-6v1gwdbv.js";import"./chunk-d7zterbp.js";import"./chunk-2bvk0qyd.js";import"./chunk-1xgs9gd5.js";export{te as clearComponentCache,Bc as componentClientSignalNames,ms as convertToCommonJS,g as createDetailedErrorMessage,Mc as extractDirectiveNames,pi as extractScriptFromTemplate,d as extractVariables,r as fileExists,eu as getComponentCacheStats,Ic as getPositionInfo,L as getSharedTranspiler,bi as getSourceLineInfo,Dc as hasDirectives,fi as hasVariables,jc as isHydrateTrigger,Nc as isJavaScriptScript,Ke as renderComponentWithSlot,Yn as resolveTemplatePath,Lc as scopeOnRootElement,qe as shouldTranspileTypeScript,yi as slotContentHasExpressions,Ge as transpileTypeScript,Jn as userComponentFileExists,Oc as validateDirective,Pc as validateTemplate};
|
package/dist/chunk-69v9cn6n.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Br,Bl,Fl}from"./chunk-wav410fm.js";import"./chunk-p15j9fzt.js";import"./chunk-3zqq3f2b.js";import"./chunk-azb58ven.js";import"./chunk-vfcwvqvd.js";import"./chunk-bczcm7jk.js";import"./chunk-bpr4bkde.js";import"./chunk-x607yxrc.js";import"./chunk-dyegyt6m.js";import"./chunk-v9vvzdag.js";import"./chunk-tkvp3rz0.js";import"./chunk-y18yvcjb.js";import"./chunk-vhfwnvmc.js";import"./chunk-6v1gwdbv.js";import"./chunk-d7zterbp.js";import"./chunk-2bvk0qyd.js";import"./chunk-1xgs9gd5.js";export{Fl as clearComposableCache,Bl as getComposableScript,Br as listComposableModules};
|
package/dist/chunk-6sd4zdtg.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Rr,Ar,Pr,ga,ma,ha,wo,ya,ba}from"./chunk-vjdj0ex3.js";export{Rr as ImageProcessorCache,wo as applyTransformations,ga as clearImageCache,ya as generateResponsiveVariants,ba as generateSrcset,Ar as getCachedImageResult,ha as optimizeImage,ma as processImage,Pr as setCachedImageResult};
|
package/dist/chunk-6tnh3cyq.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ji,so,Yi,Zi,oo,Qi,ea,ta,na,io,ra,il}from"./chunk-2kvbg3t5.js";import{yo,la}from"./chunk-hvpzy98g.js";import{j,B,F,jt,Y,oe,On,Ie,ft,Bt,Ft,zt,z,Ht,Ut,Dn}from"./chunk-ty1v368m.js";import{Fa}from"./chunk-9a73re8k.js";import"./chunk-tqnh98j7.js";export{B as DEFAULT_FORMATS,F as DEFAULT_QUALITY,j as DEFAULT_WIDTHS,Dn as ImageProcessingError,Zi as clearImageCache,oo as createImageDirective,la as createImageHandler,ea as createImagePlugin,il as defaultImageConfig,Ut as formatSize,io as generateImageManifest,ft as generateSizes,Ie as generateSrcSet,Bt as getFallbackVariant,On as getImageMetadata,z as getMimeType,Ht as getTotalSize,Ft as groupVariantsByFormat,yo as handleImageRequest,Qi as imageDirective,Y as isImageBackendAvailable,zt as isImageFile,jt as isSharpAvailable,na as optimizeDirectory,ta as optimizeImage,so as parseImageComponent,oe as processImage,Yi as processImageComponents,Ji as renderImageComponent,Fa as rewriteImagesWithSiblings,ra as writeImageManifest};
|
package/dist/chunk-6va8wt88.js
DELETED
package/dist/chunk-9a111pet.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{u,l}from"./chunk-vhfwnvmc.js";import{b}from"./chunk-vfcwvqvd.js";function y(t,o){let i=1,r=o,e="<template",n="</template";while(r<t.length&&i>0){let s=t.indexOf("<",r);if(s===-1)break;if(r=s,t.startsWith(e,r)&&(r+e.length>=t.length||/[\s>\/]/.test(t[r+e.length]))){i++,r+=e.length;continue}if(t.startsWith(n,r)){let a=t.indexOf(">",r+n.length);if(a!==-1){if(i--,i===0)return a+1;r=a+1;continue}}r++}return i===0?r:-1}var w=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function x(t,o){let i=null;for(let r=o;r<t.length;r++){let e=t[r];if(i){if(e==="\\"){r++;continue}if(e===i)i=null;continue}if(e==='"'||e==="'"){i=e;continue}if(e===">")return r+1}return-1}function N(t,o,i){let r=o.toLowerCase(),e=1,n=i;while(n<t.length){let s=t.indexOf("<",n);if(s===-1)return-1;if(t.startsWith("<!--",s)){let m=t.indexOf("-->",s+4);n=m===-1?t.length:m+3;continue}let a=x(t,s+1);if(a===-1)return-1;let g=t.slice(s,a),f=g.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(f&&f[2].toLowerCase()===r){if(f[1]==="/"){if(e--,e===0)return a}else if(!/\/\s*>$/.test(g))e++}n=a}return-1}function A(t){let o=[],i=[],r=/\bslot\s*=\s*(?:"([^"]+)"|'([^']+)')/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let c=t.indexOf("-->",n+4);e=c===-1?t.length:c+3;continue}let s=x(t,n+1);if(s===-1)break;let a=t.slice(n,s),g=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!g){e=s;continue}let f=g[2].toLowerCase();if(g[1]==="/"){let c=i.lastIndexOf(f);if(c!==-1)i.splice(c);e=s;continue}let m=/\/\s*>$/.test(a),d=i.length===0?a.match(r):null;if(d){let c=d[1]||d[2],p=a.replace(r,"").replace(/\s+(?=\/?>$)/,"").replace(/\s{2,}/g," "),h=m||w.has(f)?-1:N(t,f,s);if(h===-1)o.push({start:n,end:s,slotName:c,element:p}),e=s;else o.push({start:n,end:h,slotName:c,element:p+t.slice(s,h)}),e=h;continue}if(!m&&!w.has(f)){if(i.push(f),f==="script"||f==="style"){let c=t.toLowerCase().indexOf(`</${f}>`,s);if(c!==-1){e=c;continue}}}e=s}return o}function O(t){let o=[],i=[],r=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let c=t.indexOf("-->",n+4);e=c===-1?t.length:c+3;continue}let s=x(t,n+1);if(s===-1)break;let a=t.slice(n,s),g=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!g){e=s;continue}let f=g[1]==="/",m=g[2].toLowerCase();if(f){let c=i.lastIndexOf(m);if(c!==-1)i.splice(c);e=s;continue}if(m==="template"&&i.length===0){let c=a.match(r);if(c){let p=y(t,s);if(p!==-1){let h=c[1]||c[2]||c[3];o.push({start:n,end:p,slotName:h,content:t.slice(s,p-11).trim(),propsBinding:c[4]||void 0}),e=p;continue}}}if(!/\/\s*>$/.test(a)&&!w.has(m)){if(i.push(m),m==="script"||m==="style"){let c=t.toLowerCase().indexOf(`</${m}>`,s);if(c!==-1){e=c;continue}}}e=s}return o}function ua(t){let o={default:"",named:new Map},i=t,r=O(t);for(let n of r)o.named.set(n.slotName,{name:n.slotName,content:n.content,propsBinding:n.propsBinding});r.sort((n,s)=>s.start-n.start);for(let n of r)i=i.slice(0,n.start)+i.slice(n.end);let e=A(i);for(let n of e){let s=o.named.get(n.slotName);if(s)s.content+=n.element;else o.named.set(n.slotName,{name:n.slotName,content:n.element})}for(let n=e.length-1;n>=0;n--){let s=e[n];i=i.slice(0,s.start)+i.slice(s.end)}return o.default=i.trim(),o}function El(t){let o=t.match(/name\s*=\s*["']([^"']+)["']/),i=o?o[1]:"",r={},e=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,n;while((n=e.exec(t))!==null)r[n[1]]=n[2];let s=t.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),a=s?s[1].trim():"";return{name:i,props:r,defaultContent:a}}async function pa(t,o,i,r){if(!t)return i;let e=t.content;if(t.propsBinding&&Object.keys(o).length>0){let n=t.propsBinding.trim(),s={...r};if(n.startsWith("{")&&n.endsWith("}")){let a=n.slice(1,-1).split(",").map((g)=>g.trim()).filter(Boolean);for(let g of a){let[f,m]=g.split(":").map((c)=>c.trim()),d=m||f;if(o[f]!==void 0)s[d]=o[f]}}else s[n]=o;e=C(e,s)}return e}function C(t,o){return t.replace(/\{\{\s*([^}]+)\s*\}\}/g,(i,r)=>{try{let e=r.trim(),n=k(e,o);return b(String(n??""))}catch{return`{{ ${r} }}`}})}function k(t,o){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(t)){let r=t.split("."),e=o;for(let n of r)if(e&&typeof e==="object"&&n in e)e=e[n];else return;return e}let i=t.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(i){let[,r,e,n]=i,s=o[r],a=parseInt(n,10);if(typeof s==="number")switch(e){case"+":return s+a;case"-":return s-a;case"*":return s*a;case"/":return s/a}}try{if(!u(t))return;return l(t,Object.keys(o))(...Object.values(o))}catch{return}}async function fa(t,o,i){let r=t;r=await M(r,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(s,a,g,f)=>{let m=o.named.get(a),d=f?.trim()||"",c=g||"",p={},h=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,S;while((S=h.exec(c))!==null){let E=S[1],R=S[2];p[E]=k(R,i)}return await pa(m,p,d,i)});let n=/<slot\b((?:"[^"]*"|'[^']*'|[^>"'])*?)\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return r=r.replace(n,(s,a,g)=>{if(/\bname\s*=/.test(a||""))return s;let f=g?.trim()||"";return o.default||f}),r}async function M(t,o,i){let r=[],e=[];t.replace(o,(a,...g)=>{let f=g[g.length-2];return e.push({match:a,index:f}),r.push(i(a,...g.slice(0,-2))),a});let n=await Promise.all(r),s=t;for(let a=e.length-1;a>=0;a--){let{match:g,index:f}=e[a];s=s.slice(0,f)+n[a]+s.slice(f+g.length)}return s}function _l(t){let o=ua(t);return{defaultSlot:o.default,namedSlots:o.named}}async function Tl(t,o,i,r){return await fa(t,{default:o,named:i},r)}
|
|
3
|
-
export{ua,El,pa,fa,_l,Tl};
|
package/dist/chunk-9e1hftmd.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{De,Xt,cd}from"./chunk-h51g1ydb.js";import{U,Mn,Jt,Fr,zr,Nn,ld,dd,ud,Yt,Zt,Hr,Ln,pd}from"./chunk-vb4xxpa6.js";import"./chunk-d7zterbp.js";export{Fr as batch,cd as default,Mn as derived,Jt as effect,De as generateSignalsRuntime,Xt as generateSignalsRuntimeDev,Zt as isDerived,Yt as isSignal,Nn as onDestroy,zr as onMount,Ln as peek,ud as pendingLifecycleCounts,dd as runDestroyCallbacks,ld as runMountCallbacks,U as state,Hr as untrack,pd as useOptimistic};
|
package/dist/chunk-9etv5vzp.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ae,Ja,Uo,yt,bt,Pd,Vo,wt,tn,Ya,Za,Qa,ec,vt,tc}from"./chunk-p15j9fzt.js";import"./chunk-3zqq3f2b.js";import"./chunk-azb58ven.js";import"./chunk-vfcwvqvd.js";import"./chunk-bczcm7jk.js";import"./chunk-bpr4bkde.js";import"./chunk-x607yxrc.js";import"./chunk-dyegyt6m.js";import"./chunk-v9vvzdag.js";import"./chunk-tkvp3rz0.js";import"./chunk-y18yvcjb.js";import"./chunk-vhfwnvmc.js";import"./chunk-6v1gwdbv.js";import"./chunk-d7zterbp.js";import"./chunk-2bvk0qyd.js";import"./chunk-1xgs9gd5.js";export{tn as MODULE_SPECIFIER_PREFIX,vt as bundleClientScript,bt as clearBundleFailures,ae as clientBundleDependencies,yt as getBundleFailures,wt as hasUserImports,Za as normalizeRegistrySpecifiers,ec as queueClientBundleBuild,Uo as recordBundleFailure,Ya as registryIdForPath,Vo as resolveBundlerFallback,Qa as rewriteRegistryImports,Pd as setBundlerFallbackMode,Ja as shouldLogBundlerDiagnostics,tc as tempBuildName};
|
package/dist/chunk-9skdekv5.js
DELETED
package/dist/chunk-c2cdv6rh.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{sa,ao,al,oa,ia,cl,ll}from"./chunk-c2ys6ezs.js";import"./chunk-wav410fm.js";import"./chunk-p15j9fzt.js";import"./chunk-3zqq3f2b.js";import"./chunk-azb58ven.js";import{Ve,yc}from"./chunk-vfcwvqvd.js";import"./chunk-bczcm7jk.js";import"./chunk-bpr4bkde.js";import"./chunk-x607yxrc.js";import"./chunk-dyegyt6m.js";import"./chunk-v9vvzdag.js";import"./chunk-tkvp3rz0.js";import"./chunk-y18yvcjb.js";import"./chunk-vhfwnvmc.js";import"./chunk-6v1gwdbv.js";import"./chunk-d7zterbp.js";import"./chunk-2bvk0qyd.js";import"./chunk-1xgs9gd5.js";export{sa as buildVirtualSource,Ve as extractScriptBlocks,yc as extractTemplateExpressions,oa as findRuntimeTypeDeclarations,ia as findStxModuleDeclarations,ll as formatTypecheckDiagnostics,al as sourcePathFor,cl as typecheckStxFiles,ao as virtualPathFor};
|
package/dist/chunk-cp4dr9ch.js
DELETED
package/dist/chunk-d576yrbj.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{qd,Zo,Gd,Qo,pc,fc,Et,an,Kd,gc,mc,hc,f}from"./chunk-vfcwvqvd.js";import"./chunk-bczcm7jk.js";import"./chunk-bpr4bkde.js";import"./chunk-x607yxrc.js";import"./chunk-dyegyt6m.js";import"./chunk-v9vvzdag.js";import"./chunk-tkvp3rz0.js";import"./chunk-y18yvcjb.js";import"./chunk-vhfwnvmc.js";import"./chunk-6v1gwdbv.js";import"./chunk-d7zterbp.js";import"./chunk-2bvk0qyd.js";import"./chunk-1xgs9gd5.js";export{Et as buildCss,gc as extractClassNames,fc as fingerprintConfig,mc as generateCss,Kd as getCachedCSS,qd as getCssServeAsset,f as injectCss,Zo as loadCssEngine,Qo as loadCssEngineConfig,an as rebuildCss,Gd as resetCssCache,pc as resolveUserCssConfig,hc as withLinkedModuleBundles};
|
package/dist/chunk-dw5hrb3n.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{q,Yr,Zr,nc,St,qo,Qr,Go,Od,Be,es,ye}from"./chunk-vfcwvqvd.js";import"./chunk-bczcm7jk.js";import"./chunk-bpr4bkde.js";import{Ci,s}from"./chunk-7wfh2hqy.js";import"./chunk-x607yxrc.js";import"./chunk-dyegyt6m.js";import"./chunk-v9vvzdag.js";import"./chunk-tkvp3rz0.js";import"./chunk-y18yvcjb.js";import"./chunk-vhfwnvmc.js";import"./chunk-6v1gwdbv.js";import"./chunk-d7zterbp.js";import"./chunk-2bvk0qyd.js";import"./chunk-1xgs9gd5.js";export{q as BROWSER_CORE_IMPORTS,nc as STX_AUTO_IMPORTS,Yr as extractAndStripCssImports,Be as extractBridgeData,Ci as findInterpolationEnd,Go as generateAutoImportDestructuring,Od as generateBrowserAutoImportDestructuring,es as generateServerDataBridge,St as injectBrowserCoreAutoImports,ye as processClientScript,Qr as referencesName,Zr as renderVendorStyleTags,s as stripCommentsAndLiterals,qo as transformAutoImports};
|
package/dist/chunk-ev51qyw1.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{xt,Gr,Kr,Xr,Id,Jr}from"./chunk-3zqq3f2b.js";import"./chunk-x607yxrc.js";import"./chunk-v9vvzdag.js";import"./chunk-2bvk0qyd.js";export{Kr as buildServerApi,Id as createServerApi,xt as discoverServerApi,Gr as generateApiTypes,Jr as isServerApiSource,Xr as productionApiDispatcher};
|
package/dist/chunk-f1fyvqz0.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{nl}from"./chunk-aqra6vsk.js";import"./chunk-vfcwvqvd.js";import"./chunk-bczcm7jk.js";import"./chunk-bpr4bkde.js";import"./chunk-x607yxrc.js";import"./chunk-dyegyt6m.js";import"./chunk-v9vvzdag.js";import"./chunk-tkvp3rz0.js";import"./chunk-y18yvcjb.js";import"./chunk-vhfwnvmc.js";import"./chunk-6v1gwdbv.js";import"./chunk-d7zterbp.js";import"./chunk-2bvk0qyd.js";import"./chunk-1xgs9gd5.js";export{nl as startInteractive};
|
package/dist/chunk-frw35d2v.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{xr,no,Rn,Sr,kr,Mt,pt,ro,An,Pn,Cr,Er,sl,ol,Ae}from"./chunk-zzphh8g9.js";export{Ae as DeployError,no as calculateSha1,Rn as collectDeployFiles,Pn as createDefaultNetlifyConfig,Sr as createFileManifest,xr as createNetlifyClient,sl as deploy,An as detectProjectConfig,kr as filterRequiredFiles,Mt as formatSize,ro as generateNetlifyToml,pt as getTotalSize,Er as hasNetlifyConfig,ol as initNetlify,Cr as writeNetlifyConfig};
|
package/dist/chunk-fzn7k9kn.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Tt,Sc,kc,Cc,Ec,_c,d,Tc,ms,$c,pi,fi}from"./chunk-vfcwvqvd.js";import"./chunk-bczcm7jk.js";import"./chunk-bpr4bkde.js";import"./chunk-x607yxrc.js";import"./chunk-dyegyt6m.js";import"./chunk-v9vvzdag.js";import"./chunk-tkvp3rz0.js";import"./chunk-y18yvcjb.js";import"./chunk-vhfwnvmc.js";import"./chunk-6v1gwdbv.js";import"./chunk-d7zterbp.js";import"./chunk-2bvk0qyd.js";import"./chunk-1xgs9gd5.js";export{Tt as STX_ENGINE_BINDING_NAMES,ms as convertToCommonJS,pi as extractScriptFromTemplate,d as extractVariables,fi as hasVariables,Tc as isCompleteImport,_c as isMissingBindingFailure,Cc as isModuleResolutionFailure,Ec as isSyntaxFailure,$c as splitDeclaration,Sc as stripTypeScript,kc as withoutStxReferrer};
|
package/dist/chunk-gsm1y1kb.js
DELETED
package/dist/chunk-h1kssqxk.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{je,lc,Bd,Fd,zd,Hd,dc,uc,Ud,Vd,Yo,Wd,sn,on,Un}from"./chunk-vfcwvqvd.js";import"./chunk-bczcm7jk.js";import"./chunk-bpr4bkde.js";import"./chunk-x607yxrc.js";import"./chunk-dyegyt6m.js";import"./chunk-v9vvzdag.js";import"./chunk-tkvp3rz0.js";import"./chunk-y18yvcjb.js";import"./chunk-vhfwnvmc.js";import"./chunk-6v1gwdbv.js";import"./chunk-d7zterbp.js";import"./chunk-2bvk0qyd.js";import"./chunk-1xgs9gd5.js";export{Hd as __setSignalsGeneratorsForTest,je as cacheEngineFingerprint,on as cacheTemplate,sn as checkCache,Wd as clearDevCaches,uc as getCachedRouterScript,dc as getCachedSignalsRuntime,Ud as getServeClientAsset,Yo as getServeModuleBundle,Un as hashFilePath,Fd as invalidateFileCache,zd as invalidateFileCacheByDir,Bd as readFileCached,Vd as registerServeModuleBundle,lc as templateCache};
|
package/dist/chunk-h4crv0by.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ir,Or,Dr,wa,Mr,Nr,va,Lr,jr,vo,xa}from"./chunk-ngxqydsg.js";export{Ir as VideoProcessorCache,vo as analyzeVideo,wa as clearVideoCache,jr as generateDASHManifest,Lr as generateHLSManifest,Mr as generatePoster,va as generateSpriteSheet,Nr as generateThumbnails,Or as getCachedVideoResult,xa as processVideo,Dr as setCachedVideoResult};
|