@stacksjs/stx 0.2.874 → 0.2.876
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-027meh1k.js +2 -0
- package/dist/{chunk-gbtbfg7e.js → chunk-0g2mg8cw.js} +3 -3
- package/dist/chunk-0hs633pt.js +2 -0
- package/dist/chunk-0j8zre1m.js +2 -0
- package/dist/{chunk-6mkn81pd.js → chunk-0sa9gqmc.js} +7 -7
- package/dist/chunk-0v02qms8.js +2 -0
- package/dist/chunk-0z9gttw0.js +2 -0
- package/dist/chunk-11dwmcpy.js +3 -0
- package/dist/{chunk-vxtx0khv.js → chunk-1a237qky.js} +9 -9
- package/dist/{chunk-c3kanj1m.js → chunk-1ehjzhnc.js} +3 -3
- package/dist/chunk-1gfg6qmr.js +2 -0
- package/dist/chunk-1kgnk6ds.js +2 -0
- package/dist/{chunk-6ftee542.js → chunk-1q5w3xav.js} +2 -2
- package/dist/chunk-1ztp5vkh.js +3 -0
- package/dist/{chunk-p1a1kbhz.js → chunk-2mt2zc5y.js} +8 -8
- package/dist/{chunk-kdmwy40c.js → chunk-2tcyfrvb.js} +2 -2
- package/dist/{chunk-01mwbg1r.js → chunk-2zaatnnh.js} +4 -4
- package/dist/chunk-32wvc376.js +2 -0
- package/dist/{chunk-b8z3vepm.js → chunk-3922g6sh.js} +9 -9
- package/dist/chunk-3k2d2jsn.js +2 -0
- package/dist/{chunk-v4xes880.js → chunk-3mz9bdf7.js} +3 -3
- package/dist/chunk-3te2y9qf.js +2 -0
- package/dist/{chunk-farh4p7f.js → chunk-3w7gacva.js} +2 -2
- package/dist/chunk-40330tm5.js +2 -0
- package/dist/chunk-447jc6zc.js +2 -0
- package/dist/{chunk-s584xnzx.js → chunk-4517hny7.js} +2 -2
- package/dist/chunk-4dk6k0ad.js +2 -0
- package/dist/chunk-4e48zkq0.js +2 -0
- package/dist/chunk-5ep7p8te.js +2 -0
- package/dist/chunk-5gx403te.js +1184 -0
- package/dist/{chunk-zt9j94ak.js → chunk-6kp4mg3h.js} +2 -2
- package/dist/chunk-6q9a5bph.js +2 -0
- package/dist/{chunk-n3jw3xpj.js → chunk-75v0yxeh.js} +2 -2
- package/dist/chunk-7ds9mx4c.js +2 -0
- package/dist/chunk-7njy024g.js +2 -0
- package/dist/{chunk-p219rr27.js → chunk-7rep2jqh.js} +14 -14
- package/dist/chunk-7tjewwmd.js +2 -0
- package/dist/chunk-85xabvtj.js +2 -0
- package/dist/chunk-880f8j99.js +2 -0
- package/dist/chunk-8f3dbthj.js +2 -0
- package/dist/{chunk-nack2xs5.js → chunk-976kgb3r.js} +5 -5
- package/dist/chunk-99e3mxnn.js +20 -0
- package/dist/chunk-9gv847nn.js +2 -0
- package/dist/chunk-9mz2n39m.js +2 -0
- package/dist/{chunk-55zq2ha8.js → chunk-ae8q4gze.js} +5 -5
- package/dist/{chunk-hev4t4d5.js → chunk-afxfkb60.js} +6 -6
- package/dist/{chunk-fr72bsqd.js → chunk-akthsg33.js} +11 -11
- package/dist/chunk-b1tcym2x.js +2 -0
- package/dist/{chunk-j1efsjsb.js → chunk-b4d4tjvx.js} +5 -5
- package/dist/{chunk-j89p53vx.js → chunk-bdh73gxd.js} +2 -2
- package/dist/{chunk-4068rmzv.js → chunk-bjjfr7qt.js} +2 -2
- package/dist/chunk-bspj1rf1.js +2 -0
- package/dist/chunk-bx3hpsxn.js +2 -0
- package/dist/chunk-byq488g4.js +2 -0
- package/dist/chunk-c4s25bm2.js +2 -0
- package/dist/{chunk-ttm0gvrc.js → chunk-cj44e8mw.js} +5 -5
- package/dist/chunk-csjqtzwc.js +2 -0
- package/dist/{chunk-2xc457bf.js → chunk-ctjxcaxq.js} +14 -14
- package/dist/{chunk-79mmzprp.js → chunk-cvbwxskc.js} +5 -5
- package/dist/{chunk-7j0qkye5.js → chunk-d3q0cg47.js} +2 -2
- package/dist/{chunk-b666d8m6.js → chunk-d6gqh2wv.js} +1 -1
- package/dist/{chunk-vvxcebpn.js → chunk-dbvsa5ya.js} +2 -2
- package/dist/{chunk-hr147ys5.js → chunk-df6vjs3p.js} +5 -5
- package/dist/chunk-df78j74w.js +4 -0
- package/dist/chunk-dgs3d367.js +2 -0
- package/dist/chunk-dmf6zcf4.js +2 -0
- package/dist/{chunk-a0dsp485.js → chunk-dv56x3g8.js} +10 -10
- package/dist/chunk-e2b2f502.js +2 -0
- package/dist/chunk-ec6mrad6.js +2 -0
- package/dist/{chunk-xdfmrv49.js → chunk-eecctzgp.js} +6 -6
- package/dist/{chunk-8hhhmscy.js → chunk-eknm4jrm.js} +2 -2
- package/dist/{chunk-4nb7egk0.js → chunk-esjr9qhe.js} +2 -2
- package/dist/{chunk-wk2rge05.js → chunk-f4vgagjb.js} +3 -3
- package/dist/chunk-fa57bncd.js +2 -0
- package/dist/{chunk-qjey0jk6.js → chunk-fdjx4vs3.js} +2 -2
- package/dist/{chunk-pqy58ps0.js → chunk-fh72k2ks.js} +6 -6
- package/dist/{chunk-zfrzdje6.js → chunk-ft6em3wm.js} +6 -6
- package/dist/{chunk-bv9dbf4m.js → chunk-fwbccyhw.js} +2 -2
- package/dist/{chunk-3z4p70t5.js → chunk-g15reb1h.js} +6 -6
- package/dist/chunk-g4eheg0t.js +24 -0
- package/dist/chunk-gfe1jrw9.js +2 -0
- package/dist/chunk-gn16yq49.js +2 -0
- package/dist/{chunk-qcxrcypb.js → chunk-gqtb53s8.js} +2 -2
- package/dist/chunk-gvs61tqn.js +2 -0
- package/dist/{chunk-gxan9w4e.js → chunk-h17pfbng.js} +2 -2
- package/dist/chunk-h2928108.js +2 -0
- package/dist/chunk-hat353vx.js +2 -0
- package/dist/{chunk-ykapdv6d.js → chunk-j0rqa9bk.js} +3 -3
- package/dist/chunk-jmjgj3nh.js +2 -0
- package/dist/chunk-jqtpzzz4.js +12 -0
- package/dist/{chunk-hmdkf6c6.js → chunk-jqxerj6k.js} +2 -2
- package/dist/{chunk-3z1mmar2.js → chunk-jt5tzddc.js} +2 -2
- package/dist/{chunk-n56x7jg8.js → chunk-jvy7z3hz.js} +1 -1
- package/dist/{chunk-c8jhskx8.js → chunk-k0t9ye9j.js} +38 -38
- package/dist/{chunk-q50x1gfd.js → chunk-k1ew643q.js} +2 -2
- package/dist/{chunk-pqgc8k6k.js → chunk-k9dne5by.js} +1 -1
- package/dist/chunk-kq8mffgf.js +2 -0
- package/dist/chunk-kx06jzdw.js +2 -0
- package/dist/{chunk-ysfeg3cn.js → chunk-kywe0f1v.js} +2 -2
- package/dist/{chunk-60yppcbb.js → chunk-kzc2tqzr.js} +2 -2
- package/dist/{chunk-9zrvh3pz.js → chunk-mce3g2wb.js} +2 -2
- package/dist/{chunk-0k11nsv1.js → chunk-mkwavsb3.js} +3 -3
- package/dist/{chunk-bbq79tap.js → chunk-mw0rb1sf.js} +4 -4
- package/dist/chunk-n5pvdrkb.js +2 -0
- package/dist/chunk-ne8q191s.js +2 -0
- package/dist/{chunk-tabkp672.js → chunk-nn6hvsxp.js} +1 -1
- package/dist/{chunk-e7s109j6.js → chunk-nnp6rf4c.js} +1 -1
- package/dist/chunk-np8wgbsa.js +3 -0
- package/dist/chunk-nthw4dca.js +2 -0
- package/dist/{chunk-tyvm49be.js → chunk-nv4c25zj.js} +3 -3
- package/dist/{chunk-dhbpbjt3.js → chunk-p5m1z6e1.js} +6 -6
- package/dist/{chunk-18a3vdnq.js → chunk-pk714ynv.js} +4 -4
- package/dist/{chunk-csymxc5a.js → chunk-pp99rmjm.js} +15 -15
- package/dist/chunk-pqmjeea6.js +2 -0
- package/dist/chunk-qggwr60r.js +2 -0
- package/dist/chunk-qm3v4qb7.js +2 -0
- package/dist/{chunk-40h07m5w.js → chunk-qnwd5bz4.js} +1 -1
- package/dist/chunk-qty0t69x.js +2 -0
- package/dist/{chunk-tnp2ta5q.js → chunk-r09kz9bf.js} +2 -2
- package/dist/{chunk-q1wxgw5s.js → chunk-r2bxjna3.js} +2 -2
- package/dist/chunk-rjv6885r.js +2 -0
- package/dist/chunk-rm5gbthk.js +2 -0
- package/dist/{chunk-6vgr5g6d.js → chunk-rzd9hyhv.js} +2 -2
- package/dist/{chunk-8tk8yf91.js → chunk-s7fhpkvf.js} +6 -6
- package/dist/{chunk-ew5cey88.js → chunk-saqzk45g.js} +1 -1
- package/dist/chunk-sgengtap.js +2 -0
- package/dist/{chunk-srgnevws.js → chunk-stn7p7f1.js} +2 -2
- package/dist/{chunk-wa3z5c8j.js → chunk-szp7ajfm.js} +4 -4
- package/dist/chunk-ts37jw3s.js +2 -0
- package/dist/{chunk-xakypz4t.js → chunk-ttjscvre.js} +3 -3
- package/dist/{chunk-cqhwzd9y.js → chunk-v0tdg16k.js} +5 -5
- package/dist/chunk-v4emesnw.js +2 -0
- package/dist/{chunk-bast33qy.js → chunk-vnkvnenn.js} +6 -6
- package/dist/{chunk-ymdw4fhd.js → chunk-vnrbjbrw.js} +2 -2
- package/dist/chunk-vxra53wq.js +2 -0
- package/dist/{chunk-w5nw8e2p.js → chunk-w8k9fz1w.js} +7 -7
- package/dist/{chunk-m131znxe.js → chunk-wm029dh0.js} +13 -13
- package/dist/{chunk-hhbt8grm.js → chunk-wp0qpa50.js} +4 -4
- package/dist/{chunk-01c16zw4.js → chunk-wzvdr4ta.js} +2 -2
- package/dist/{chunk-e2t7mk29.js → chunk-x2ftkaz3.js} +2 -2
- package/dist/{chunk-atpscb2m.js → chunk-x4jzhgdm.js} +2 -2
- package/dist/chunk-x76qvq1n.js +2 -0
- package/dist/chunk-x85z6dmw.js +2 -0
- package/dist/chunk-xkfe03y9.js +2 -0
- package/dist/{chunk-v37zmez0.js → chunk-xmws1gaf.js} +2 -2
- package/dist/{chunk-a8164hnf.js → chunk-xtaq95em.js} +1 -1
- package/dist/{chunk-5a0d3048.js → chunk-y2e2zm6y.js} +3 -3
- package/dist/chunk-y4hn1qh0.js +2 -0
- package/dist/{chunk-pywz8q4k.js → chunk-y75bds1g.js} +31 -31
- package/dist/chunk-yc8ggeh2.js +2 -0
- package/dist/{chunk-r0v2chpn.js → chunk-ydppkb8y.js} +2 -2
- package/dist/chunk-yfed67yc.js +2 -0
- package/dist/{chunk-7ayvybdy.js → chunk-ysfgabpf.js} +3 -3
- package/dist/{chunk-fd1bpv35.js → chunk-yxdhz4ps.js} +2 -2
- package/dist/{chunk-rw5492e2.js → chunk-zc8a2erc.js} +4 -4
- package/dist/chunk-zgds9nwv.js +1609 -0
- package/dist/{chunk-7cvbz4eq.js → chunk-zn6n075d.js} +3 -3
- package/dist/cli.js +22 -22
- package/dist/component-library.d.ts +31 -1
- package/dist/component-library.js +74 -54
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/inherited-context.d.ts +14 -0
- package/dist/inherited-context.js +102 -0
- package/dist/native-component-context.d.ts +10 -0
- package/dist/native-component-context.js +95 -0
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +12 -12
- package/dist/stx-virtual-ts.d.ts +14 -2
- package/dist/stx-virtual-ts.js +64 -34
- package/dist/typecheck.d.ts +5 -2
- package/dist/typecheck.js +29 -19
- package/package.json +5 -5
- package/dist/chunk-09jz09k9.js +0 -20
- package/dist/chunk-10h8v5d4.js +0 -2
- package/dist/chunk-19dsn6tp.js +0 -2
- package/dist/chunk-26vxgd2w.js +0 -2
- package/dist/chunk-277dpq3b.js +0 -2
- package/dist/chunk-2asyyky3.js +0 -2
- package/dist/chunk-2r9s38f6.js +0 -2
- package/dist/chunk-2xhwadvn.js +0 -2
- package/dist/chunk-46pxmpeb.js +0 -3
- package/dist/chunk-4es07dwb.js +0 -2
- package/dist/chunk-4pr29yrx.js +0 -2
- package/dist/chunk-4v70bs2q.js +0 -2
- package/dist/chunk-4ygesqbx.js +0 -2
- package/dist/chunk-54jx5hqh.js +0 -2
- package/dist/chunk-5nj2k8zf.js +0 -2
- package/dist/chunk-6pczzq5f.js +0 -2
- package/dist/chunk-73k579v7.js +0 -2
- package/dist/chunk-7c9pzpsw.js +0 -2
- package/dist/chunk-7etvn4dx.js +0 -2
- package/dist/chunk-7wqevtks.js +0 -2
- package/dist/chunk-93538x9s.js +0 -2
- package/dist/chunk-9fyw1xkh.js +0 -3
- package/dist/chunk-9waxasf6.js +0 -712
- package/dist/chunk-a5qxcz86.js +0 -4
- package/dist/chunk-asrzmw7w.js +0 -2
- package/dist/chunk-awmfyb3t.js +0 -2
- package/dist/chunk-ba91r7q9.js +0 -2
- package/dist/chunk-cvgbtmxp.js +0 -2
- package/dist/chunk-d0h18m2r.js +0 -2
- package/dist/chunk-d5zh2663.js +0 -2
- package/dist/chunk-djdganvr.js +0 -2
- package/dist/chunk-dmcmxf3a.js +0 -2
- package/dist/chunk-eczy00w6.js +0 -2
- package/dist/chunk-esb34a1r.js +0 -20
- package/dist/chunk-f4wezqh4.js +0 -2
- package/dist/chunk-f52b9hjv.js +0 -2
- package/dist/chunk-f8pp58kw.js +0 -2
- package/dist/chunk-g3tfct27.js +0 -2
- package/dist/chunk-g9m84nqk.js +0 -2
- package/dist/chunk-gc4bgven.js +0 -2
- package/dist/chunk-gvh45ddc.js +0 -2
- package/dist/chunk-gvz0kqkz.js +0 -2
- package/dist/chunk-h2qgqjkn.js +0 -2
- package/dist/chunk-hcaedzck.js +0 -2
- package/dist/chunk-j4zrq17p.js +0 -2
- package/dist/chunk-kz0txvqb.js +0 -2
- package/dist/chunk-m9cperj4.js +0 -2
- package/dist/chunk-me7cxs0e.js +0 -2
- package/dist/chunk-meqsd5bt.js +0 -2
- package/dist/chunk-p2kqsb5k.js +0 -2
- package/dist/chunk-pvrgv5cx.js +0 -2051
- package/dist/chunk-rqa92xm4.js +0 -2
- package/dist/chunk-s54e61xt.js +0 -2
- package/dist/chunk-s92j8k4z.js +0 -2
- package/dist/chunk-sw8ms82g.js +0 -2
- package/dist/chunk-swfvh1cz.js +0 -3
- package/dist/chunk-tp2ftck2.js +0 -2
- package/dist/chunk-vd679g2w.js +0 -2
- package/dist/chunk-vk98r75z.js +0 -2
- package/dist/chunk-vmq773pb.js +0 -2
- package/dist/chunk-vv65gsys.js +0 -2
- package/dist/chunk-w6ry02z8.js +0 -2
- package/dist/chunk-w8qr5414.js +0 -2
- package/dist/chunk-xjxcwrqs.js +0 -2
- package/dist/chunk-xye2mkbh.js +0 -2
- package/dist/chunk-ytzzth34.js +0 -2
- package/dist/chunk-yxpjj003.js +0 -2
- package/dist/chunk-z6c4c951.js +0 -2
- package/dist/chunk-z9xe3xkg.js +0 -12
- package/dist/chunk-zmfqx1b1.js +0 -2
- package/dist/chunk-zze8tw0h.js +0 -2
package/dist/typecheck.js
CHANGED
|
@@ -20,15 +20,17 @@ import {
|
|
|
20
20
|
interpolationScopeCode,
|
|
21
21
|
projectScriptInterpolations
|
|
22
22
|
} from "./stx-virtual-ts.js";
|
|
23
|
+
import { inheritedContextBindings, inheritedContextContract } from "./inherited-context.js";
|
|
24
|
+
import { nativeComponentContext } from "./native-component-context.js";
|
|
23
25
|
import { stxImportDiagnostics } from "./stx-module-imports.js";
|
|
24
26
|
import { findStxPluginEntry } from "./stx-plugin-config.js";
|
|
25
27
|
export {
|
|
26
28
|
extractScriptBlocks,
|
|
27
29
|
extractTemplateExpressions
|
|
28
30
|
} from "./stx-virtual-ts.js";
|
|
29
|
-
export function buildScriptVirtualFile(block, serverCode = "", originDir = "", interpolationScope = serverCode) {
|
|
31
|
+
export function buildScriptVirtualFile(block, serverCode = "", originDir = "", interpolationScope = serverCode, component) {
|
|
30
32
|
const leadingNewlines = block.startLine > 1 ? `
|
|
31
|
-
`.repeat(block.startLine - 1) : "", projection = projectScriptInterpolations(firstLinePadding(block) + block.code, interpolationScope), code = blankScriptDirectives(projection.code), payload = block.kind === "client" || block.kind === "plain" ? clientPayloadDeclarations(serverCode, block.code) : "", lines = (leadingNewlines + code).split(`
|
|
33
|
+
`.repeat(block.startLine - 1) : "", projection = projectScriptInterpolations(firstLinePadding(block) + block.code, interpolationScope), componentProjection = block.kind === "client" && component ? component.project(projection.code) : void 0, code = blankScriptDirectives(componentProjection?.code ?? projection.code), payload = block.kind === "client" || block.kind === "plain" ? clientPayloadDeclarations(serverCode, block.code) : "", lines = (leadingNewlines + code).split(`
|
|
32
34
|
`), sourceLineCount = lines.length, lineMap = new Map;
|
|
33
35
|
for (const declaration of projection.declarations)
|
|
34
36
|
for (const [index, text] of declaration.text.split(`
|
|
@@ -37,7 +39,11 @@ export function buildScriptVirtualFile(block, serverCode = "", originDir = "", i
|
|
|
37
39
|
if (declaration.origin)
|
|
38
40
|
lineMap.set(lines.length, { ...declaration.origin, line: block.startLine + declaration.origin.line - 1 + index, column: index === 0 ? declaration.origin.column : 1 });
|
|
39
41
|
}
|
|
40
|
-
lines.push(payload
|
|
42
|
+
lines.push(...payload.split(`
|
|
43
|
+
`), ...(component?.declarations ?? "").split(`
|
|
44
|
+
`), ...(block.kind === "server" ? inheritedContextBindings(block.code) : "").split(`
|
|
45
|
+
`));
|
|
46
|
+
lines.push("export {}", "");
|
|
41
47
|
const rewritten = rewriteRelativeSpecifiers(lines.join(`
|
|
42
48
|
`), originDir);
|
|
43
49
|
return {
|
|
@@ -45,7 +51,8 @@ export function buildScriptVirtualFile(block, serverCode = "", originDir = "", i
|
|
|
45
51
|
sourceLineCount,
|
|
46
52
|
lineMap,
|
|
47
53
|
scriptColumns: new Map([...projection.columns].map(([line, edits]) => [line + block.startLine - 1, edits])),
|
|
48
|
-
importColumns: rewritten.columns
|
|
54
|
+
importColumns: rewritten.columns,
|
|
55
|
+
componentColumns: componentProjection ? new Map([...componentProjection.columns].map(([line, edits]) => [line + block.startLine - 1, edits])) : void 0
|
|
49
56
|
};
|
|
50
57
|
}
|
|
51
58
|
export function buildVirtualSource(block, serverCode = "", originDir = "") {
|
|
@@ -212,16 +219,17 @@ function readProjectPathAliases(startDir) {
|
|
|
212
219
|
return { paths: absolute };
|
|
213
220
|
}
|
|
214
221
|
export async function typecheckStxFiles(files, options = {}) {
|
|
215
|
-
const checkClient = options.client !== !1, checkServer = options.server !== !1, checkTemplates = options.templates !== !1,
|
|
222
|
+
const checkClient = options.client !== !1, checkServer = options.server !== !1, checkTemplates = options.templates !== !1, templateConfig = checkTemplates ? await loadStxConfig() : void 0, componentsDir = options.componentsDir ?? templateConfig?.componentsDir, partialsDir = options.partialsDir ?? templateConfig?.partialsDir, layoutsDir = options.layoutsDir ?? templateConfig?.layoutsDir, sources = new Map(await Promise.all(files.map(async (file) => [file, await Bun.file(file).text()]))), inheritedContractsKnown = [...sources.values()].some((source) => inheritedContextContract(extractScriptBlocks(source).filter((block) => block.kind === "server").map((block) => block.code).join(`
|
|
223
|
+
`))), virtualFiles = new Map, scrapedByFile = new Map, importDiagnostics = [], checkedFiles = [];
|
|
216
224
|
let blockCount = 0, expressionCount = 0;
|
|
217
225
|
const runtimeTypes = findRuntimeTypeDeclarations();
|
|
218
226
|
for (const file of files) {
|
|
219
|
-
const source =
|
|
227
|
+
const source = sources.get(file), blocks = extractScriptBlocks(source).filter((b) => {
|
|
220
228
|
if (b.kind === "server")
|
|
221
229
|
return checkServer;
|
|
222
230
|
return checkClient;
|
|
223
231
|
}), serverCode = extractScriptBlocks(source).filter((block) => block.kind === "server").map((block) => block.code).join(`
|
|
224
|
-
`), interpolationScope = interpolationScopeCode(extractScriptBlocks(source));
|
|
232
|
+
`), interpolationScope = interpolationScopeCode(extractScriptBlocks(source)), component = nativeComponentContext(source);
|
|
225
233
|
for (const d of stxImportDiagnostics(source, blocks))
|
|
226
234
|
importDiagnostics.push({
|
|
227
235
|
file,
|
|
@@ -237,22 +245,23 @@ export async function typecheckStxFiles(files, options = {}) {
|
|
|
237
245
|
if (names.length > 0)
|
|
238
246
|
scrapedByFile.set(file, { names, line: clientBlocks[0].startLine, kind: clientBlocks[0].kind });
|
|
239
247
|
}
|
|
240
|
-
const originDir = path.dirname(path.resolve(file)), templateBuffer = checkTemplates ? buildVirtualTypeScript(source, { runtimeGlobals: !runtimeTypes, originDir, filePath: path.resolve(file), componentsDir }) : null, expressions = templateBuffer ? [...templateBuffer.lineMap.values()].filter((m) => m.expression).length : 0;
|
|
241
|
-
if (blocks.length === 0 && expressions === 0)
|
|
248
|
+
const originDir = path.dirname(path.resolve(file)), templateBuffer = checkTemplates ? buildVirtualTypeScript(source, { runtimeGlobals: !runtimeTypes, originDir, filePath: path.resolve(file), componentsDir, partialsDir, layoutsDir, inheritedContractsKnown }) : null, expressions = templateBuffer ? [...templateBuffer.lineMap.values()].filter((m) => m.expression).length : 0;
|
|
249
|
+
if (blocks.length === 0 && expressions === 0 && !component?.checks.length)
|
|
242
250
|
continue;
|
|
243
251
|
checkedFiles.push(file);
|
|
244
252
|
blockCount += blocks.length;
|
|
245
253
|
expressionCount += expressions;
|
|
254
|
+
if (component && checkClient && (blocks.some((block) => block.kind !== "server") || !checkTemplates && component.checks.length)) {
|
|
255
|
+
const virtual = buildVirtualTypeScript(source, { runtimeGlobals: !1, globals: !1, originDir, templateExpressions: !1, scriptKinds: ["client", "plain"], nativeChecks: !checkTemplates });
|
|
256
|
+
virtualFiles.set(virtualPathFor(file, "client", 0), { virtual, source: virtual.text, origin: file, kind: "client" });
|
|
257
|
+
}
|
|
246
258
|
blocks.forEach((block, i) => {
|
|
259
|
+
if (component && block.kind !== "server")
|
|
260
|
+
return;
|
|
247
261
|
const virtual = buildScriptVirtualFile(block, serverCode, originDir, interpolationScope);
|
|
248
|
-
virtualFiles.set(virtualPathFor(file, block.kind, i), {
|
|
249
|
-
virtual,
|
|
250
|
-
source: virtual.text,
|
|
251
|
-
origin: file,
|
|
252
|
-
kind: block.kind
|
|
253
|
-
});
|
|
262
|
+
virtualFiles.set(virtualPathFor(file, block.kind, i), { virtual, source: virtual.text, origin: file, kind: block.kind });
|
|
254
263
|
});
|
|
255
|
-
if (templateBuffer && expressions > 0)
|
|
264
|
+
if (templateBuffer && (expressions > 0 || component?.checks.length))
|
|
256
265
|
virtualFiles.set(virtualPathFor(file, "template", 0), {
|
|
257
266
|
source: templateBuffer.text,
|
|
258
267
|
origin: file,
|
|
@@ -339,16 +348,17 @@ export async function typecheckStxFiles(files, options = {}) {
|
|
|
339
348
|
continue;
|
|
340
349
|
if (isSyntactic(Number(code)))
|
|
341
350
|
unparseable.add(written);
|
|
342
|
-
let line = Number(lineStr), column = Number(colStr), expression;
|
|
351
|
+
let line = Number(lineStr), column = Number(colStr), expression, blockKind = entry.kind;
|
|
343
352
|
if (entry.virtual) {
|
|
344
353
|
const at = resolvePosition(entry.virtual, line, column) ?? (entry.kind !== "template" && isSyntactic(Number(code)) ? resolvePosition(entry.virtual, entry.virtual.sourceLineCount, 1) : null);
|
|
345
|
-
if (!at || entry.kind === "template" && !at.expression)
|
|
354
|
+
if (!at || entry.kind === "template" && !at.expression && !at.diagnosticOrigin)
|
|
346
355
|
continue;
|
|
347
356
|
if (isTemplateArtefact(at, Number(code)))
|
|
348
357
|
continue;
|
|
349
358
|
line = at.line;
|
|
350
359
|
column = at.column;
|
|
351
360
|
expression = at.expression?.code.trim();
|
|
361
|
+
blockKind = at.diagnosticOrigin ?? blockKind;
|
|
352
362
|
}
|
|
353
363
|
diagnostics.push({
|
|
354
364
|
file: entry.origin,
|
|
@@ -357,7 +367,7 @@ export async function typecheckStxFiles(files, options = {}) {
|
|
|
357
367
|
code: Number(code),
|
|
358
368
|
message,
|
|
359
369
|
category: category === "error" ? "error" : "warning",
|
|
360
|
-
blockKind
|
|
370
|
+
blockKind,
|
|
361
371
|
expression
|
|
362
372
|
});
|
|
363
373
|
}
|
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.876",
|
|
5
5
|
"description": "A performant UI Framework. Powered by Bun.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -127,14 +127,14 @@
|
|
|
127
127
|
},
|
|
128
128
|
"dependencies": {
|
|
129
129
|
"@stacksjs/clapp": "^0.2.17",
|
|
130
|
-
"@stacksjs/desktop": "0.2.
|
|
131
|
-
"@stacksjs/sanitizer": "0.2.
|
|
130
|
+
"@stacksjs/desktop": "0.2.876",
|
|
131
|
+
"@stacksjs/sanitizer": "0.2.876",
|
|
132
132
|
"@stacksjs/ts-css": "^0.3.21",
|
|
133
133
|
"@stacksjs/ts-i18n": "^0.1.11",
|
|
134
134
|
"@types/dom-speech-recognition": "^0.0.12",
|
|
135
|
-
"bun-plugin-stx": "0.2.
|
|
135
|
+
"bun-plugin-stx": "0.2.876",
|
|
136
136
|
"bunfig": "^0.15.21",
|
|
137
|
-
"stx-router": "0.2.
|
|
137
|
+
"stx-router": "0.2.876",
|
|
138
138
|
"ts-broadcasting": "^0.0.13",
|
|
139
139
|
"ts-images": "^0.2.22",
|
|
140
140
|
"ts-syntax-highlighter": "^0.2.1"
|
package/dist/chunk-09jz09k9.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ar,Oe}from"./chunk-9zrvh3pz.js";import{K,S,Cr,Vs,T}from"./chunk-9waxasf6.js";import{a,M}from"./chunk-2xc457bf.js";import{Fo}from"./chunk-79mmzprp.js";import{at}from"./chunk-n3jw3xpj.js";import{l}from"./chunk-46pxmpeb.js";import{r,Y}from"./chunk-z9xe3xkg.js";import d from"path";import j from"fs";import{AsyncLocalStorage as lt}from"async_hooks";import{randomUUID as $t}from"crypto";var wt=11;function J(t,e,n){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(d.basename(t))||Fo(t,e,n)}var ct=2;function Nf(t){let e=process.env.STX_BUNDLE_CACHE_DIR?.trim();return e?d.resolve(e):l(t,"bundle-cache")}function st(t,e){let n=t;for(let i of St(e))if(i!==d.sep)n=n.split(i).join("\x00root");return n}var rt=new Map;function St(t){let e=d.resolve(t),n=rt.get(e);if(!n){let i=e;try{i=j.realpathSync(e)}catch{}n=[...new Set([e,i])].sort((c,p)=>p.length-c.length),rt.set(e,n)}return n}function vt(t,e){try{let n=j.statSync(t),i=d.resolve(e),c=t.startsWith(`${i}${d.sep}`);return{path:c?d.relative(i,t):t,...c?{inRoot:!0}:{},mtimeMs:n.mtimeMs,size:n.size,hash:Bun.hash(j.readFileSync(t)).toString(36)}}catch{return null}}function ut(t,e){return t.inRoot?d.join(d.resolve(e),t.path):t.path}function Bt(t,e){for(let n of t){let i=ut(n,e);try{let c=j.statSync(i);if(c.size!==n.size)return!1;if(c.mtimeMs!==n.mtimeMs&&Bun.hash(j.readFileSync(i)).toString(36)!==n.hash)return!1}catch{return!1}}return!0}var dt=new Map,jt=100;function Df(t=process.env){let e=Number(t.STX_BUNDLE_CACHE_LIMIT);return Number.isFinite(e)&&e>=1?Math.floor(e):2000}var G=new Map;async function Et(t){let e=G.get(t)??0;if(e>0&&e<jt){G.set(t,e+1);return}G.set(t,1);try{let n=(await j.promises.readdir(t)).filter((o)=>o.endsWith(".js")),i=Df();if(n.length<=i)return;let p=(await Promise.all(n.map(async(o)=>{try{return{name:o,at:(await j.promises.stat(d.join(t,o))).mtimeMs}}catch{return null}}))).filter((o)=>o!==null);p.sort((o,b)=>b.at-o.at);for(let o of p.slice(i)){let b=o.name.slice(0,-3);await j.promises.rm(d.join(t,`${b}.js`),{force:!0}),await j.promises.rm(d.join(t,`${b}.deps.json`),{force:!0})}N("pruned bundle cache to",i,"entries")}catch{}}function xe(t){return dt.get(t)??[]}function q(t,e){if(t)dt.set(t,e)}function Mf(t=process.env){return t.STX_DEBUG==="true"||t.STX_DEBUG==="1"}function N(...t){if(Mf())console.log("[stx:bundler]",...t)}var tt=[];function pc(t,e,n){tt.push({filePath:t||"<inline>",message:e,details:n})}function cn(){return tt.slice()}function ln(){tt.length=0}var Z;function Fh(t){Z=t}function fc(){if(Z)return Z;try{let t=M.strict;return typeof t==="object"&&t!==null?t.bundlerFallback??"warn":"warn"}catch{return"warn"}}var Q=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function un(t){let e=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,n;while((n=e.exec(t))!==null){let c=n[1];if(!Q.some((o)=>o.test(c)))return N("detected user import:",c),!0}let i=/^[ \t]*import[ \t]*['"]([^'"]+)['"]/gm;while((n=i.exec(t))!==null){let c=n[1];if(/\.css(?:\?.*)?$/.test(c))continue;if(!Q.some((o)=>o.test(c)))return N("detected side-effect import:",c),!0}return!1}var ir="stx-module:",_t=/\.(?:[cm]?[jt]sx?|json)$/i;function Lf(t,e){return d.relative(t,e).split(d.sep).join("/")}function jf(t,e){if(e.size===0)return t;return t.replace(/^([ \t]*import(?:(?:\s+|(?=[{*]))[^;"']*?\s*from\s*|\s*))(["'])([^"']+)\2/gm,(n,i,c,p)=>{let o=e.get(p);return o&&!p.startsWith(ir)?`${i}${c}${o}${c}`:n})}function Bf(t,e){let n=0,i=(p)=>{let o=`__stxMod${n++}`,b=JSON.stringify(p);return e.push(`var ${o} = globalThis.__stxModules && globalThis.__stxModules[${b}];`,`if (${o} === undefined) throw new Error("[stx] module " + ${JSON.stringify(b)} + " is not registered on this page (#1957)");`),o},c=(p,o)=>{for(let b of p.split(",")){let C=b.trim();if(!C)continue;let R=C.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!R)continue;let w=R[1].startsWith('"')?JSON.parse(R[1]):R[1],f=R[2]??w;e.push(`var ${f} = ${o}[${JSON.stringify(w)}];`)}};return t=t.replace(/^[ \t]*import(?:\s+|(?=[{*]))([^;"']+?)\s*from\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(p,o,b)=>{let C=b.slice(ir.length),R=i(C),w=o.trim(),f=w.match(/^([\w$]+)\s*(?:,\s*|$)/);if(f&&!w.startsWith("{")&&!w.startsWith("*"))e.push(`var ${f[1]} = ${R}.default;`),w=w.slice(f[0].length).trim();let v=w.match(/^\*\s*as\s+([\w$]+)$/);if(v)e.push(`var ${v[1]} = ${R};`);else if(w.startsWith("{"))c(w.replace(/^\{|\}$/g,""),R);return""}),t=t.replace(/^[ \t]*import\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(p,o)=>(i(o.slice(ir.length)),"")),t}function it(t){let e=[t,`${t}.ts`,`${t}.tsx`,`${t}.js`,`${t}.mjs`,`${t}.jsx`,d.join(t,"index.ts"),d.join(t,"index.tsx"),d.join(t,"index.js"),d.join(t,"index.mjs")];for(let n of e)try{if(j.existsSync(n)&&j.statSync(n,{throwIfNoEntry:!1})?.isFile())return n}catch{}return}var X=new lt;function ds(t,e){let n=new Bun.CryptoHasher("md5");for(let[i,c]of[...t].sort(([p],[o])=>p<o?-1:p>o?1:0))n.update(`${i}\x00${c}\x00`);return X.run({modules:t,key:n.digest("hex").slice(0,12)},e)}var pt=new lt;function Ff(t){return pt.run(!0,t)}function zf(){return pt.getStore()===!0}function gc(t){if(!zf())return;throw Error(`The client script of ${t} needs bundling, and it is being rendered inside a Bun.build loader, where Bun never finishes a second build. Make the page an entrypoint of the build (bun-plugin-stx renders entrypoints before the bundler starts), or render it once outside the build so its bundle is cached.`)}function dn(){return X.getStore()?.key??""}function ft(t,e,n,i,c,p,o=new Map,b,C,R){let w=new Map([[n,i],...R??[]]),f=(B)=>B!==void 0&&w.has(B),v=(B,s,u)=>{if(J(s,t,b))return null;if(!p||!f(B)||!_t.test(s))return null;try{if(!j.statSync(s,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}c.add(s);let E=`${ir}${Lf(process.cwd(),s)}`;return o.set(u,E),{path:E,external:!0}},y=(B,s)=>{let u=f(B)?e:d.dirname(B),E=d.resolve(u,s);return it(E)??E};return{name:"stx-client-bundle",setup(B){if(B.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(s)=>({path:s.path,external:!0})),B.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(s)=>({path:s.path,external:!0})),B.onResolve({filter:/^\//},(s)=>{if(f(s.path))return{path:s.path};let u=it(s.path);if(u){let E=v(s.importer,u,s.path);if(E)return E;if(!f(u))c.add(u);return{path:u}}return{path:s.path,external:!0}}),B.onResolve({filter:/^\.\.?\//},(s)=>{let u=y(s.importer,s.path),E=v(s.importer,u,s.path);if(E)return E;return c.add(u),{path:u}}),B.onResolve({filter:/^[@~]\//},(s)=>{let u=d.resolve(t,s.path.slice(2)),E=[u,`${u}.ts`,`${u}.tsx`,`${u}.js`,`${u}.mjs`,`${u}.jsx`,d.join(u,"index.ts"),d.join(u,"index.tsx"),d.join(u,"index.js"),d.join(u,"index.mjs")];for(let h of E)if(j.existsSync(h)&&j.statSync(h,{throwIfNoEntry:!1})?.isFile()){let D=v(s.importer,h,s.path);if(D)return D;return N(`resolved ${s.path[0]}/ import:`,s.path,"\u2192",h),c.add(h),{path:h}}return console.warn(`[stx:bundler] could not resolve ${s.path[0]}/ import:`,s.path),{path:u}}),p)B.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(s)=>{if(!f(s.importer))return;let u=`${ir}npm:${s.path}`;return o.set(s.path,u),{path:u,external:!0}});B.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(s)=>{if(w.has(s.path))return{contents:w.get(s.path),loader:"ts"};if(J(s.path,t,b))throw Error(`Server-only API source cannot be imported by a client script: ${s.path}`);let u=d.extname(s.path).toLowerCase(),E=u===".json"?"json":u===".tsx"?"tsx":u===".jsx"?"jsx":u===".ts"||u===".mts"||u===".cts"?"ts":"js";if(!f(s.path))c.add(s.path);let h=C?.get(s.path);if(h!==void 0)return{contents:h,loader:"js"};return{contents:j.readFileSync(s.path,"utf8"),loader:E}})}}}var H=new Map,z=S(64),ot=Symbol.for("stx.client-bundle-build-queue");function Hf(t){let e=globalThis,i=(e[ot]??Promise.resolve()).then(t,t);return e[ot]=i.then(()=>{return},()=>{return}),i}async function pn(t,e,n={}){let i=n.projectRoot||process.cwd(),c=(await a(i)).serverApi,p=n.minify??!1,o=n.externalizeUserModules??!0,b=n.expose?.length?[...new Set(n.expose)].sort():void 0,C=n.cacheDir||Nf(i),R=X.getStore(),w=new Bun.CryptoHasher("md5");w.update(`${wt}\x00${at()}\x00${JSON.stringify(c??!1)}\x00${o?"registry":"inline"}\x00${b?b.join(","):"*"}\x00${p?"minified":"readable"}\x00${R?.key??""}\x00${st(t,i)}\x00${st(e,i)}`);let f=w.digest("hex").slice(0,12),v=d.join(C,`${f}.js`),y=z.get(v);if(y){if(Vs(y.files)&&y.files.every((h)=>!J(h.path,i,c))){N("memo hit:",f);let h=y.files.map((D)=>D.path);return q(e,h),n.collectInputs?.push(...h),y.code}z.delete(v),N("memo invalidated by dep change:",f)}let B=d.join(C,`${f}.deps.json`),s=Bun.file(v);if(await s.exists()){let h=Bun.file(B),D=!1,k=null;if(await h.exists())try{let O=JSON.parse(await h.text());if(O.metadataVersion===ct&&Array.isArray(O.files)&&Bt(O.files,i))k=Cr(O.files.map((g)=>ut(g,i))),D=k.length===O.files.length&&!k.some((g)=>J(g.path,i,c))}catch{D=!1}if(D){if(N("cache hit:",f),k)q(e,k.map((U)=>U.path)),n.collectInputs?.push(...k.map((U)=>U.path));let O=await s.text(),g=new Date;if(j.promises.utimes(v,g,g).catch(()=>{}),k)z.set(v,{code:O,files:k});return O}N("cache invalidated by dep change:",f)}let u=H.get(f);if(u){let h=await u;if(n.collectInputs)n.collectInputs.push(...(z.get(v)?.files??[]).map((D)=>D.path));return h}gc(e);let E=Hf(()=>Mt(t,e,{projectRoot:i,minify:p,cacheDir:C,hash:f,cachePath:v,depsPath:B,collectInputs:n.collectInputs,externalizeUserModules:o,serverApi:c,expose:b,throwOnFailure:n.throwOnFailure,substitutes:R?.modules}));H.set(f,E);try{return await E}finally{H.delete(f)}}function mc(t){return`${t}-${process.pid}-${$t()}`}async function zh(t,e){let{projectRoot:n}=e,i=mc(new Bun.CryptoHasher("md5").update([...t.keys()].join("\x00")).digest("hex").slice(0,12)),c=d.join(l(n,"bundle-tmp"),"out",i);j.mkdirSync(c,{recursive:!0});let p=new Map,o=new Map,b=0;for(let[f,v]of t){let y=d.join(n,`.stx-split-${i}-${b++}.ts`);p.set(y,v),o.set(d.basename(y).replace(/\.ts$/,""),f)}let[C,R]=[...p][0],w=new Set;gc(e.filePath);try{let f=await Bun.build({entrypoints:[...p.keys()],outdir:c,target:"browser",format:"esm",splitting:!0,minify:!1,naming:{entry:"[name].js",chunk:"chunk-[hash].js"},plugins:[ft(n,d.dirname(e.filePath),C,R,w,!1,new Map,void 0,X.getStore()?.modules,p)],define:{"process.env.NODE_ENV":'"development"',...T()},root:n});if(!f.success)throw Error(f.logs.filter((y)=>y.level==="error").map((y)=>y.message).join(", ")||"Unable to bundle the entries");let v={entries:new Map,chunks:new Map};for(let y of f.outputs){let B=d.basename(y.path);if(y.kind==="entry-point"){let s=o.get(B.replace(/\.js$/,""));if(s!==void 0)v.entries.set(s,await y.text())}else if(y.kind==="chunk")v.chunks.set(B.replace(/\.js$/,""),await y.text())}return e.collectInputs?.push(...w),v}finally{try{j.rmSync(c,{recursive:!0,force:!0})}catch{}}}async function Mt(t,e,n){let{projectRoot:i,minify:c,cacheDir:p,hash:o,cachePath:b,depsPath:C,externalizeUserModules:R}=n,w=l(i,"bundle-tmp"),f=mc(o),v=d.join(i,`.stx-client-${f}.ts`),y=d.join(w,"out",f);j.mkdirSync(y,{recursive:!0});let B=d.dirname(e),s=new Set,u=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,E=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,h=r(t),{depths:D,balanced:k}=Y(h),O=(F)=>!k||D[F]===0,g;while((g=u.exec(h))!==null){if(g[1])continue;if(!O(g.index))continue;if(g[2])g[2].split(",").forEach((F)=>{let m=Rt(F);if(m)s.add(m)});else if(g[3])s.add(g[3])}while((g=E.exec(h))!==null){if(g[1])continue;if(!O(g.index))continue;s.add(g[2])}let U=/^[ \t]*import[ \t]+(?!type\b)(?:(\w+)\s*(?:,\s*)?)?(?:\*\s+as\s+(\w+)|\{([^}]+)\})?\s+from\b/gm;while((g=U.exec(h))!==null){if(!O(g.index))continue;let F=/^\s*['"]([^'"]+)['"]/.exec(t.slice(g.index+g[0].length))?.[1];if(F&&Q.some((m)=>m.test(F)))continue;if(g[1])s.add(g[1]);if(g[2])s.add(g[2]);for(let m of(g[3]??"").split(",")){let _=m.trim();if(!_||/^type\s/.test(_))continue;let L=/\bas\s+(\w+)\s*$/.exec(_)?.[1]??/^\w+$/.exec(_)?.[0];if(L)s.add(L)}}for(let F of h.matchAll(/\bexport\s*\{([^}]+)\}/g))for(let m of F[1].split(",")){let _=/\bas\s+(\w+)\s*$/.exec(m)?.[1]??/^\s*(\w+)\s*$/.exec(m)?.[1];if(_)s.delete(_)}let mt=s.size>0?`
|
|
3
|
-
export { ${[...s].join(", ")} }`:"";N("bundling:",o,"from:",d.basename(e));let et=new Set,nt=new Map;try{let F=await Bun.build({entrypoints:[v],outdir:y,target:"browser",format:"esm",minify:c?{whitespace:!1,identifiers:!0,syntax:!0}:!1,plugins:[ft(i,B,v,t+mt,et,R,nt,n.serverApi,n.substitutes)],define:{"process.env.NODE_ENV":c?'"production"':'"development"',...T()},root:i});if(!F.success){let I=F.logs.filter((A)=>A.level==="error").map((A)=>A.message).join(", ")||`Unable to bundle ${d.basename(e)}`,P=ar(F.logs,e||void 0);if(console.warn("[stx:bundler] build failed:",I),pc(e||"",I,P),n.throwOnFailure||fc()==="error")throw Error(I);return t}let m="";for(let x of F.outputs){m=await x.text();break}let _=[];for(let x of m.matchAll(/^\s*export\s*\{([^}]*)\}\s*;?\s*$/gm))for(let I of x[1].split(",")){let P=I.trim().match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(P){_.push([P[2],P[1]]);continue}let A=I.trim();if(/^[A-Za-z_$][\w$]*$/.test(A))_.push([A,A])}if(n.expose){let x=new Set(n.expose);for(let I=_.length-1;I>=0;I--)if(!x.has(_[I][0]))_.splice(I,1)}let L=[];m=Bf(jf(m,nt),L);let gt=m.match(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm)||[];if(m=m.replace(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm,"").replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim(),c&&m)try{m=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(m)}catch{}let V=`__stxBundle_${o}`,ht=new Set(K(t,!0).split(",").map((x)=>x.trim())),xt=_.map(([x,I])=>`get ${JSON.stringify(x)}() { return ${I} }${ht.has(x)?`, set ${JSON.stringify(x)}(__stxValue_${I}) { ${I} = __stxValue_${I} }`:""}`).join(", "),yt=_.map(([x])=>`var ${x} = undefined;`).join(`
|
|
4
|
-
`),bt=_.map(([x])=>`${x} = ${V}[${JSON.stringify(x)}];`).join(`
|
|
5
|
-
`);if(m=`${gt.join(`
|
|
6
|
-
`)}
|
|
7
|
-
${yt}
|
|
8
|
-
var ${V} = (function() {
|
|
9
|
-
${L.join(`
|
|
10
|
-
`)}
|
|
11
|
-
${m}
|
|
12
|
-
return { ${xt} };
|
|
13
|
-
})();
|
|
14
|
-
${bt}
|
|
15
|
-
var __stxLiveBindings = typeof __stxLiveBindings === 'undefined' ? {} : __stxLiveBindings;
|
|
16
|
-
Object.keys(${V}).forEach(function(name) {
|
|
17
|
-
if (!Object.prototype.hasOwnProperty.call(__stxLiveBindings, name))
|
|
18
|
-
Object.defineProperty(__stxLiveBindings, name, Object.getOwnPropertyDescriptor(${V}, name));
|
|
19
|
-
});`.trim(),N("bundled:",o,"output:",m.length,"bytes"),s.size>0&&_.length===0)return console.warn(`[stx:bundler] dropped every binding for ${d.basename(e)} (${o}); serving the unbundled source and not caching this result`),t;j.mkdirSync(p,{recursive:!0}),await Bun.write(b,m);let W=Cr(et);return await Bun.write(C,JSON.stringify({metadataVersion:ct,files:W.map((x)=>vt(x.path,i)).filter((x)=>x!==null)})),q(e,W.map((x)=>x.path)),n.collectInputs?.push(...W.map((x)=>x.path)),z.set(b,{code:m,files:W}),await Et(p),m}catch(F){let m=ar(F,e||void 0),_=Oe(F,e||void 0);if(console.warn(`[stx:bundler] error: ${_}`),pc(e||"",_,m),n.throwOnFailure||fc()==="error")throw F;return t}finally{try{j.rmSync(y,{recursive:!0,force:!0})}catch{}}}function Rt(t){let e=t.trim();if(!e)return null;let n=e.indexOf("=");if(n!==-1)e=e.slice(0,n).trim();let i=e.indexOf(":");if(i!==-1)e=e.slice(i+1).trim();if(e.startsWith("..."))e=e.slice(3).trim();return/^[A-Za-z_$][\w$]*$/.test(e)?e:null}
|
|
20
|
-
export{Nf,Df,xe,Mf,pc,cn,ln,Fh,fc,un,ir,Lf,jf,Bf,ds,Ff,zf,gc,dn,Hf,pn,mc,zh};
|
package/dist/chunk-10h8v5d4.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{tu,Im,nu,ru,Om,Nm}from"./chunk-kdmwy40c.js";import"./chunk-9waxasf6.js";import"./chunk-atpscb2m.js";import"./chunk-60yppcbb.js";import"./chunk-csymxc5a.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{Nm as applySlots,Om as extractSlotContent,Im as parseSlotElement,tu as parseSlots,ru as processSlots,nu as renderSlot};
|
package/dist/chunk-19dsn6tp.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ra,vu,Kn,Gm,xu,Su,ku,Jm}from"./chunk-0k11nsv1.js";import"./chunk-9waxasf6.js";import"./chunk-atpscb2m.js";import"./chunk-60yppcbb.js";import"./chunk-csymxc5a.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{Kn as Validator,vu as defineForm,xu as processErrorDirective,Su as processErrorsDirective,Jm as processFormValidationDirectives,ku as processHasErrorsDirective,Ra as useForm,Gm as v};
|
package/dist/chunk-26vxgd2w.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Eo,Eh,Th}from"./chunk-wa3z5c8j.js";import"./chunk-09jz09k9.js";import"./chunk-79mmzprp.js";import"./chunk-9zrvh3pz.js";import"./chunk-p1a1kbhz.js";import"./chunk-w5nw8e2p.js";import"./chunk-a8164hnf.js";import"./chunk-2xc457bf.js";import"./chunk-xakypz4t.js";import"./chunk-tnp2ta5q.js";import"./chunk-rw5492e2.js";import"./chunk-6mkn81pd.js";import"./chunk-hhbt8grm.js";import"./chunk-9waxasf6.js";import"./chunk-atpscb2m.js";import"./chunk-60yppcbb.js";import"./chunk-csymxc5a.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{Th as clearComposableCache,Eh as getComposableScript,Eo as listComposableModules};
|
package/dist/chunk-277dpq3b.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{La,ja,Ba,Fa,Bh}from"./chunk-p219rr27.js";import"./chunk-pywz8q4k.js";import"./chunk-hr147ys5.js";import"./chunk-wk2rge05.js";import"./chunk-c8jhskx8.js";import"./chunk-a0dsp485.js";import"./chunk-fr72bsqd.js";import"./chunk-q1wxgw5s.js";import"./chunk-b8z3vepm.js";import"./chunk-swfvh1cz.js";import"./chunk-c3kanj1m.js";import"./chunk-vvxcebpn.js";import"./chunk-p1a1kbhz.js";import"./chunk-w5nw8e2p.js";import"./chunk-a8164hnf.js";import"./chunk-zt9j94ak.js";import"./chunk-2xc457bf.js";import"./chunk-xakypz4t.js";import"./chunk-tnp2ta5q.js";import"./chunk-rw5492e2.js";import"./chunk-6mkn81pd.js";import"./chunk-hhbt8grm.js";import"./chunk-9waxasf6.js";import"./chunk-atpscb2m.js";import"./chunk-60yppcbb.js";import"./chunk-csymxc5a.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{La as buildNative,Bh as default,ja as findCraftBinary,Fa as getAvailableFormats,Ba as getAvailableTargets};
|
package/dist/chunk-2asyyky3.js
DELETED
package/dist/chunk-2r9s38f6.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{eg,Qh,ey,ty,ny,tg,ng,ry,sy,ni,oy,hr,yr,Es}from"./chunk-zt9j94ak.js";import{at}from"./chunk-n3jw3xpj.js";import"./chunk-9waxasf6.js";import"./chunk-atpscb2m.js";import"./chunk-60yppcbb.js";import"./chunk-csymxc5a.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{ny as __setSignalsGeneratorsForTest,at as cacheEngineFingerprint,yr as cacheTemplate,hr as checkCache,oy as clearDevCaches,ng as getCachedRouterScript,tg as getCachedSignalsRuntime,ry as getServeClientAsset,ni as getServeModuleBundle,Es as hashFilePath,ey as invalidateFileCache,ty as invalidateFileCacheByDir,Qh as readFileCached,sy as registerServeModuleBundle,eg as templateCache};
|
package/dist/chunk-2xhwadvn.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ya,mm,ba,hm,Yl,Zl,ym,bm}from"./chunk-esb34a1r.js";import"./chunk-wa3z5c8j.js";import"./chunk-09jz09k9.js";import"./chunk-79mmzprp.js";import"./chunk-9zrvh3pz.js";import"./chunk-p1a1kbhz.js";import"./chunk-w5nw8e2p.js";import"./chunk-a8164hnf.js";import"./chunk-2xc457bf.js";import"./chunk-xakypz4t.js";import"./chunk-tnp2ta5q.js";import"./chunk-rw5492e2.js";import"./chunk-6mkn81pd.js";import"./chunk-hhbt8grm.js";import{lt,gg}from"./chunk-9waxasf6.js";import"./chunk-atpscb2m.js";import"./chunk-60yppcbb.js";import"./chunk-csymxc5a.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{ya as buildScriptVirtualFile,mm as buildVirtualSource,lt as extractScriptBlocks,gg as extractTemplateExpressions,Yl as findRuntimeTypeDeclarations,Zl as findStxModuleDeclarations,bm as formatTypecheckDiagnostics,hm as sourcePathFor,ym as typecheckStxFiles,ba as virtualPathFor};
|
package/dist/chunk-46pxmpeb.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import i from"path";var yn=".stx",o="STX_DIR",e=null;function zc(t){e=t?.trim()||null}function Sr(){return process.env[o]?.trim()||e||yn}function l(t=process.cwd(),...n){let r=Sr();return i.isAbsolute(r)?i.join(r,...n):i.join(t,r,...n)}function kr(t){if(!t||i.isAbsolute(t))return t;let n=t.replace(/\\/g,"/");if(n!==yn&&!n.startsWith(`${yn}/`))return t;let r=n.slice(yn.length+1);return r?i.join(Sr(),r):Sr()}
|
|
3
|
-
export{yn,zc,Sr,l,kr};
|
package/dist/chunk-4es07dwb.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Xi,Gi,Ji,Qg,Yi,Zi,em,Qi,ea,jl,tm}from"./chunk-7cvbz4eq.js";export{Xi as VideoProcessorCache,jl as analyzeVideo,Qg as clearVideoCache,ea as generateDASHManifest,Qi as generateHLSManifest,Yi as generatePoster,em as generateSpriteSheet,Zi as generateThumbnails,Gi as getCachedVideoResult,tm as processVideo,Ji as setCachedVideoResult};
|
package/dist/chunk-4pr29yrx.js
DELETED
package/dist/chunk-4v70bs2q.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ji,vy,xy,kl,Xe,Lg,so,Sy,ky,_y,Cy,Ey,Ty,$y,Ry,Ay}from"./chunk-csymxc5a.js";export{Ty as applyHead,Sy as definePageMeta,ji as getHead,vy as getPageMeta,Xe as mergeHeadConfigs,$y as processHeadDirective,Ay as processMetaDirective,Ry as processTitleDirective,Ey as renderBodyAttrs,_y as renderHead,Cy as renderHtmlAttrs,xy as resetHead,so as seoMetaToHeadConfig,kl as useHead,ky as usePageTitle,Lg as useSeoMeta,ky as useTitle};
|
package/dist/chunk-4ygesqbx.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{h,_i,ol,il,_g,Cg,Eg,Tg,$g,Js,Rg,Ve,re,Ue,Ag,Ir,Pg,ll,ul,Ti,We,s,_n,dl,y,we,gy}from"./chunk-9waxasf6.js";import"./chunk-atpscb2m.js";import"./chunk-60yppcbb.js";import"./chunk-csymxc5a.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{ul as SIGNAL_COMPOSABLE_CALL,we as clearComponentCache,Ti as componentClientSignalNames,_i as convertToCommonJS,y as createDetailedErrorMessage,$g as extractDirectiveNames,ol as extractScriptFromTemplate,h as extractVariables,s as fileExists,gy as getComponentCacheStats,Cg as getPositionInfo,re as getSharedTranspiler,dl as getSourceLineInfo,Tg as hasDirectives,il as hasVariables,Pg as isHydrateTrigger,Rg as isJavaScriptScript,We as renderComponentWithSlot,_n as resolveTemplatePath,Ag as scopeOnRootElement,Js as scopeSequenceKey,Ve as shouldTranspileTypeScript,ll as slotContentHasExpressions,Ue as transpileTypeScript,Ir as userComponentFileExists,Eg as validateDirective,_g as validateTemplate};
|
package/dist/chunk-54jx5hqh.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Jh,Yh,Gf,bs}from"./chunk-b8z3vepm.js";import"./chunk-swfvh1cz.js";import"./chunk-vvxcebpn.js";import"./chunk-a8164hnf.js";import{Ar}from"./chunk-9waxasf6.js";import"./chunk-atpscb2m.js";import"./chunk-60yppcbb.js";import{ut}from"./chunk-csymxc5a.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{ut as freeIdentifiers,bs as processComponents,Gf as processESImports,Ar as rendersAsElement,Jh as resetMarginStackWarnings,Yh as resetTemplateLoopWarnings};
|
package/dist/chunk-5nj2k8zf.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Vl,ga,Ul,Wl,ma,ql,Kl,Xl,Gl,ha,Jl,gm}from"./chunk-bbq79tap.js";import{Ca,eu}from"./chunk-s584xnzx.js";import{ie,ae,ce,zn,ve,Ie,es,vt,tn,Hn,Vn,Un,le,Wn,qn,ts}from"./chunk-q50x1gfd.js";import{ou}from"./chunk-ysfeg3cn.js";import"./chunk-wk2rge05.js";export{ae as DEFAULT_FORMATS,ce as DEFAULT_QUALITY,ie as DEFAULT_WIDTHS,ts as ImageProcessingError,Wl as clearImageCache,ma as createImageDirective,eu as createImageHandler,Kl as createImagePlugin,gm as defaultImageConfig,qn as formatSize,ha as generateImageManifest,tn as generateSizes,vt as generateSrcSet,Hn as getFallbackVariant,es as getImageMetadata,le as getMimeType,Wn as getTotalSize,Vn as groupVariantsByFormat,Ca as handleImageRequest,ql as imageDirective,ve as isImageBackendAvailable,Un as isImageFile,zn as isSharpAvailable,Gl as optimizeDirectory,Xl as optimizeImage,ga as parseImageComponent,Ie as processImage,Ul as processImageComponents,Vl as renderImageComponent,ou as rewriteImagesWithSiblings,Jl as writeImageManifest};
|
package/dist/chunk-6pczzq5f.js
DELETED
package/dist/chunk-73k579v7.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{uu,du,pu,fu,gu,mu,hu,yu,bu,wu,Xm}from"./chunk-8tk8yf91.js";export{uu as createIslandRegistry,Xm as default,wu as generateIslandManifest,pu as generatePartialHydrationCSS,mu as hydrateAll,gu as hydrateByStrategy,fu as hydrateIsland,hu as isHydrated,yu as onHydrated,du as processPartialHydrationDirectives,bu as processStaticDirectives};
|
package/dist/chunk-7c9pzpsw.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Zh,vs,Yo,xs,fr,Zo,Qo,Zf,Ss,ks,_s,ei,xc,Qf,Ct}from"./chunk-p1a1kbhz.js";import"./chunk-w5nw8e2p.js";import"./chunk-a8164hnf.js";import"./chunk-2xc457bf.js";import"./chunk-xakypz4t.js";import"./chunk-tnp2ta5q.js";import"./chunk-rw5492e2.js";import"./chunk-6mkn81pd.js";import"./chunk-hhbt8grm.js";import{K}from"./chunk-9waxasf6.js";import"./chunk-atpscb2m.js";import"./chunk-60yppcbb.js";import"./chunk-csymxc5a.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{Zf as bindLoopInterpolations,Zh as clearScriptScanCache,Ss as convertServerLoopAttributesToDirectives,Zo as convertSignalDirectivesToAttributes,ks as convertSignalLoopsToAttributes,fr as extractClientSignalNames,K as extractExports,xc as findMarkupIndexOutsideScripts,xs as hasSignalsSyntax,Yo as parseLoopExpression,Qo as preEvalLiteralReactiveIfs,_s as processScriptSetup,ei as processSignals,Qf as rewriteStxImportSpecifiers,vs as scanScriptTags,Ct as stripStxRuntimeImports};
|
package/dist/chunk-7etvn4dx.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{dm}from"./chunk-gxan9w4e.js";import"./chunk-vxtx0khv.js";import"./chunk-tabkp672.js";import"./chunk-79mmzprp.js";import"./chunk-swfvh1cz.js";import"./chunk-w5nw8e2p.js";import"./chunk-2xc457bf.js";import"./chunk-xakypz4t.js";import"./chunk-tnp2ta5q.js";import"./chunk-rw5492e2.js";import"./chunk-6mkn81pd.js";import"./chunk-hhbt8grm.js";import"./chunk-9waxasf6.js";import"./chunk-atpscb2m.js";import"./chunk-60yppcbb.js";import"./chunk-csymxc5a.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{dm as startProductionServer};
|
package/dist/chunk-7wqevtks.js
DELETED
package/dist/chunk-93538x9s.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ws,Jf,Ko,Yf}from"./chunk-c3kanj1m.js";import"./chunk-vvxcebpn.js";import"./chunk-p1a1kbhz.js";import"./chunk-w5nw8e2p.js";import"./chunk-a8164hnf.js";import"./chunk-2xc457bf.js";import"./chunk-xakypz4t.js";import"./chunk-tnp2ta5q.js";import"./chunk-rw5492e2.js";import"./chunk-6mkn81pd.js";import"./chunk-hhbt8grm.js";import{jt}from"./chunk-9waxasf6.js";import"./chunk-atpscb2m.js";import"./chunk-60yppcbb.js";import"./chunk-csymxc5a.js";import"./chunk-farh4p7f.js";import"./chunk-qjey0jk6.js";export{Yf as declareBareLoopHead,jt as parseLoopBinding,Jf as processLoops,Ko as processLoopsAsync,ws as reportDeferredLoopWarnings};
|
package/dist/chunk-9fyw1xkh.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
function A(){let{NODE_ENV:n}=process.env;return n==="production"}function Q(){let{STX_DEBUG:n}=process.env;return!A()||n==="true"}function Pn(){let{NODE_ENV:n}=process.env;return n==="test"}function Bi(n,t){return t??(n==="compile"||A())}function In(n){if(!n)return n;try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(n).trim()}catch{return n}}
|
|
3
|
-
export{A,Q,Pn,Bi,In};
|