@stacksjs/stx 0.2.665 → 0.2.668
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-028ee6q5.js +2 -0
- package/dist/{chunk-tx6p6jnk.js → chunk-02gn092e.js} +1 -1
- package/dist/chunk-02ymqwmj.js +2 -0
- package/dist/{chunk-2q50h7zv.js → chunk-060298px.js} +5 -5
- package/dist/{chunk-zpc06ysq.js → chunk-0hemydnd.js} +1 -1
- package/dist/chunk-1e79xcc8.js +2 -0
- package/dist/chunk-1pnp91wx.js +2 -0
- package/dist/{chunk-2h8ea0we.js → chunk-1sr6c0nk.js} +2 -2
- package/dist/chunk-280p4q7a.js +2 -0
- package/dist/{chunk-hb08vrbb.js → chunk-2dp7hyv7.js} +21 -21
- package/dist/chunk-2ecgyqam.js +2 -0
- package/dist/{chunk-38b3w1y4.js → chunk-2hxwds8c.js} +1 -1
- package/dist/{chunk-x34scshq.js → chunk-2zzc7006.js} +2 -2
- package/dist/{chunk-wpm58d6p.js → chunk-30nes8ne.js} +2 -2
- package/dist/{chunk-d3vgtr0t.js → chunk-3641xvaw.js} +1 -1
- package/dist/{chunk-zaaeneq6.js → chunk-365vg0eg.js} +2 -2
- package/dist/{chunk-2qbvsvwc.js → chunk-3850m7ab.js} +6 -6
- package/dist/{chunk-ewcrsyr7.js → chunk-3hxd5td3.js} +2 -2
- package/dist/chunk-3n9vaxnt.js +2 -0
- package/dist/{chunk-pxqh758g.js → chunk-3y41efsf.js} +64 -15
- package/dist/chunk-41cvkdcm.js +3 -0
- package/dist/{chunk-s3dyzxwx.js → chunk-493x6e71.js} +4 -4
- package/dist/{chunk-jrf01hfv.js → chunk-4c183zem.js} +1 -1
- package/dist/{chunk-nm8yr8a9.js → chunk-4m1hye28.js} +1 -1
- package/dist/{chunk-v5916r3j.js → chunk-4teqcbw0.js} +5 -5
- package/dist/chunk-5zgrvj4b.js +2 -0
- package/dist/{chunk-cg3mvq4h.js → chunk-61n06wra.js} +6 -6
- package/dist/{chunk-pmwb5kaf.js → chunk-65b6cy92.js} +2 -2
- package/dist/{chunk-zjsyw63k.js → chunk-6by8f7n9.js} +9 -9
- package/dist/{chunk-vjw3qrqj.js → chunk-6tngeb4b.js} +1 -1
- package/dist/{chunk-bgra36az.js → chunk-6z2sdfac.js} +1 -1
- package/dist/{chunk-yq021b3r.js → chunk-7d4z944r.js} +3 -3
- package/dist/{chunk-rjh2jwxx.js → chunk-7met6yva.js} +8 -8
- package/dist/{chunk-2jh21f1n.js → chunk-89jbdtgw.js} +1 -1
- package/dist/chunk-8kskjg62.js +2 -0
- package/dist/{chunk-q1svy1nf.js → chunk-9edksf8x.js} +1 -1
- package/dist/{chunk-1z1632np.js → chunk-9k2wz3k1.js} +41 -41
- package/dist/{chunk-577ntqeg.js → chunk-9vaz5f9j.js} +1 -1
- package/dist/chunk-avph47dc.js +2 -0
- package/dist/{chunk-mrrrngzd.js → chunk-b4pcw34n.js} +1 -1
- package/dist/chunk-b7e07ybq.js +3 -0
- package/dist/{chunk-0jhdrgpr.js → chunk-b823zxq6.js} +2 -2
- package/dist/{chunk-c9k40352.js → chunk-bdg0fydw.js} +1 -1
- package/dist/{chunk-szyqxcfj.js → chunk-bnn7pd62.js} +2 -2
- package/dist/chunk-c3dk9pkf.js +2 -0
- package/dist/chunk-c4qebqmk.js +2 -0
- package/dist/chunk-ca6vx6vg.js +2 -0
- package/dist/{chunk-dra341c0.js → chunk-cba7953e.js} +15 -15
- package/dist/{chunk-p2mrba1n.js → chunk-cyq1jcg2.js} +107 -107
- package/dist/{chunk-w2zceynt.js → chunk-dpvxe52r.js} +1 -1
- package/dist/{chunk-pc48mjkc.js → chunk-dtjybwtz.js} +4 -4
- package/dist/{chunk-nf9bykvg.js → chunk-dy5j389v.js} +5 -5
- package/dist/{chunk-np1k9vsr.js → chunk-e1fetwbr.js} +1 -1
- package/dist/chunk-e4vpr36s.js +2 -0
- package/dist/{chunk-11zp67ds.js → chunk-e8gcqp8w.js} +4 -4
- package/dist/{chunk-yh0wb4n1.js → chunk-ecqrkyg8.js} +2 -2
- package/dist/chunk-fb93n9ts.js +2 -0
- package/dist/chunk-fmkcc7g1.js +2 -0
- package/dist/{chunk-edvmtk21.js → chunk-fpz59dhz.js} +5 -5
- package/dist/{chunk-een2wqah.js → chunk-fvtwec1r.js} +1 -1
- package/dist/{chunk-t9mfztcs.js → chunk-fzqj1mjz.js} +3 -3
- package/dist/chunk-gkmpr64n.js +2 -0
- package/dist/chunk-heh151bn.js +2 -0
- package/dist/chunk-hj0raner.js +2 -0
- package/dist/chunk-hkqhpckf.js +2 -0
- package/dist/{chunk-0g4pr7ww.js → chunk-hm9jt1p9.js} +9 -9
- package/dist/{chunk-5w2jy5r9.js → chunk-hvf2e7pr.js} +2 -2
- package/dist/chunk-hx9cn2s4.js +2 -0
- package/dist/{chunk-2f1bk3bg.js → chunk-k5mez1vx.js} +1 -1
- package/dist/{chunk-r7kmsq3n.js → chunk-ka8befem.js} +1 -1
- package/dist/{chunk-b6xv8jh9.js → chunk-kpeep7gq.js} +1 -1
- package/dist/{chunk-v2x9vzgw.js → chunk-md2jn67b.js} +2 -2
- package/dist/chunk-n7a33e3v.js +2 -0
- package/dist/{chunk-d3bsfd10.js → chunk-npa7gze7.js} +2 -2
- package/dist/{chunk-8nryyqb5.js → chunk-p472crv1.js} +1 -1
- package/dist/{chunk-4yf1w261.js → chunk-pn1ehs6a.js} +2 -2
- package/dist/{chunk-7rta163c.js → chunk-pxdww4rb.js} +2 -2
- package/dist/{chunk-eqrkhc18.js → chunk-qjtpxsyx.js} +2 -2
- package/dist/{chunk-gf3bxnpq.js → chunk-qxmyaajq.js} +1 -1
- package/dist/chunk-r7cenpxp.js +2 -0
- package/dist/{chunk-fzxyq6k5.js → chunk-rcefnd1g.js} +61 -61
- package/dist/chunk-s5w3t7xw.js +2 -0
- package/dist/{chunk-43gr8ggc.js → chunk-sme31jbj.js} +2 -2
- package/dist/chunk-sz6xdz4h.js +2 -0
- package/dist/{chunk-f2z8s2h9.js → chunk-t01c62y5.js} +2 -2
- package/dist/{chunk-jh3r0qp7.js → chunk-t7jxkrbx.js} +1 -1
- package/dist/{chunk-jkvr7e91.js → chunk-tp4eqfxq.js} +2 -2
- package/dist/{chunk-7ae140wv.js → chunk-tq0bgaae.js} +1 -1
- package/dist/chunk-tw0wc95k.js +2 -0
- package/dist/chunk-v0091n1g.js +2 -0
- package/dist/{chunk-qzy8ypk4.js → chunk-vdjj4vrp.js} +40 -40
- package/dist/{chunk-gf4e5xtr.js → chunk-vfba7nz5.js} +27 -27
- package/dist/{chunk-awe50wee.js → chunk-vg9bz5zs.js} +1 -1
- package/dist/chunk-vryzt0p0.js +2 -0
- package/dist/{chunk-8dcemd4a.js → chunk-w6x8m0tz.js} +1 -1
- package/dist/chunk-wesafj4a.js +2 -0
- package/dist/chunk-x986xz7h.js +2 -0
- package/dist/{chunk-xv43szx0.js → chunk-xqp4hstk.js} +1 -1
- package/dist/{chunk-c1dkh0es.js → chunk-yfvm7q6t.js} +3 -3
- package/dist/chunk-ynh1ppa6.js +2 -0
- package/dist/{chunk-eecgcj41.js → chunk-yscr04dv.js} +1 -1
- package/dist/{chunk-a1p327a7.js → chunk-zcz97ber.js} +9 -9
- package/dist/chunk-zdgsj39g.js +2 -0
- package/dist/{chunk-5z1n02nd.js → chunk-zwkc8yge.js} +37 -37
- package/dist/cli.js +36 -36
- package/dist/client/signals-for-runtime.js +51 -2
- package/dist/client/signals-process-element-runtime.js +1 -1
- package/dist/component-renderer.js +4 -2
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/native/compiler/headwind-to-style.js +24 -1
- package/dist/native/compiler/html-to-ir.js +25 -5
- package/dist/native/runtime/binding-tree.d.ts +1 -0
- package/dist/native/runtime/binding-tree.js +5 -0
- package/dist/native/runtime/craft-bridge.js +1 -0
- package/dist/native/runtime/craft.d.ts +1 -0
- package/dist/native/runtime/jsc-globals.d.ts +20 -0
- package/dist/native/runtime/jsc-globals.js +52 -0
- package/dist/native/testing.d.ts +0 -1
- package/dist/native/testing.js +31 -4
- package/dist/pwa.js +3 -3
- package/dist/signal-processing.js +1 -2
- package/dist/slot-scopes.js +10 -2
- package/dist/slots.d.ts +2 -2
- package/dist/slots.js +21 -5
- package/dist/ssg.js +5 -5
- package/dist/utils.js +1 -1
- package/package.json +5 -5
- package/dist/chunk-0eepx077.js +0 -2
- package/dist/chunk-0fhntp63.js +0 -2
- package/dist/chunk-2a4szpje.js +0 -3
- package/dist/chunk-3d39yer3.js +0 -2
- package/dist/chunk-4v9x7zz5.js +0 -2
- package/dist/chunk-5etmsv9z.js +0 -2
- package/dist/chunk-773frt6c.js +0 -2
- package/dist/chunk-8d2f2e42.js +0 -2
- package/dist/chunk-a2bw46t9.js +0 -2
- package/dist/chunk-d5pt75tp.js +0 -2
- package/dist/chunk-em3aepxz.js +0 -2
- package/dist/chunk-g53sg7e0.js +0 -2
- package/dist/chunk-gsw8g2ev.js +0 -2
- package/dist/chunk-gz90fqn8.js +0 -2
- package/dist/chunk-gzd7bmp5.js +0 -2
- package/dist/chunk-hcqyf26s.js +0 -2
- package/dist/chunk-hhmj9gpk.js +0 -2
- package/dist/chunk-k2byvram.js +0 -2
- package/dist/chunk-kph7cenp.js +0 -2
- package/dist/chunk-papqmch6.js +0 -2
- package/dist/chunk-qambfx8c.js +0 -2
- package/dist/chunk-stfqkgfv.js +0 -2
- package/dist/chunk-t34ds1e3.js +0 -2
- package/dist/chunk-t4cbrm81.js +0 -2
- package/dist/chunk-t60pt4gv.js +0 -2
- package/dist/chunk-t6yjxhn8.js +0 -2
- package/dist/chunk-w89mazpv.js +0 -2
- package/dist/chunk-wq2fq6b7.js +0 -2
- package/dist/chunk-wsp8sj9v.js +0 -3
- package/dist/chunk-x8knte1j.js +0 -2
- package/dist/chunk-y7xshkqn.js +0 -2
- package/dist/chunk-ypsym37h.js +0 -2
- package/dist/chunk-z58ybwsv.js +0 -2
- package/dist/chunk-zteaygxc.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{k}from"./chunk-
|
|
2
|
+
import{k}from"./chunk-vdjj4vrp.js";import{s}from"./chunk-rcefnd1g.js";import p from"fs";import g from"path";import*as y from"readline";var e={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m"},u={help:{description:"Show available commands",usage:"help [command]",handler:async(t,o)=>{if(t[0]&&u[t[0]]){let n=u[t[0]];console.log(`
|
|
3
3
|
${e.bold}${t[0]}${e.reset} - ${n.description}`),console.log(` Usage: ${e.cyan}${n.usage}${e.reset}
|
|
4
4
|
`)}else{console.log(`
|
|
5
5
|
${e.bold}Available Commands:${e.reset}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$u}from"./chunk-t7jxkrbx.js";import"./chunk-4teqcbw0.js";import"./chunk-sme31jbj.js";import"./chunk-fpz59dhz.js";import"./chunk-9k2wz3k1.js";import"./chunk-9edksf8x.js";import"./chunk-a3d0g4mr.js";import"./chunk-04kg16qs.js";import"./chunk-fzqj1mjz.js";import"./chunk-365vg0eg.js";import"./chunk-vdjj4vrp.js";import"./chunk-kpeep7gq.js";import"./chunk-1sr6c0nk.js";import"./chunk-2dp7hyv7.js";import"./chunk-ce6zddpf.js";import"./chunk-pxdww4rb.js";export{$u as startProductionServer};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import m from"path";var y=/__stxModules\["((?:[^"\\]|\\.)*)"\]/g;function I(...o){let r=new Set;for(let s of o){if(!s||!s.includes("__stxModules["))continue;for(let e of s.matchAll(y))try{r.add(JSON.parse(`"${e[1]}"`))}catch{}}return[...r].sort()}async function w(o,r={}){if(o.length===0)return null;let s=process.cwd(),e=[],a=[];o.forEach((t,c)=>{let i=t.startsWith("npm:")?t.slice(4):m.resolve(s,t),l=`__stxRegistered${c}`,p=JSON.stringify(t);e.push(`import * as ${l} from ${JSON.stringify(i)};`),a.push(`if (!globalThis.__stxModules[${p}]) globalThis.__stxModules[${p}] = ${l};`)});let d=[...e,"globalThis.__stxModules = globalThis.__stxModules || {};",...a].join(`
|
|
3
|
-
`),n;try{let{bundleClientScript:t}=await import("./chunk-
|
|
3
|
+
`),n;try{let{bundleClientScript:t}=await import("./chunk-ynh1ppa6.js");n=await t(d,m.join(s,".stx-module-registry.ts"),{projectRoot:s,minify:r.minify,externalizeUserModules:!1,collectInputs:r.collectInputs,throwOnFailure:!0})}catch(t){let{formatBuildFailure:c}=await import("./chunk-280p4q7a.js"),i=c(t);console.warn(`[stx] could not build the page module registry (#1957): ${i}`);let l=`[stx] the page module registry did not build, so ${o.join(", ")} cannot load (#1957): ${i}`;return`;console.error(${JSON.stringify(l)});`}let{transformAutoImports:f,generateAutoImportDestructuring:_}=await import("./chunk-c4qebqmk.js"),u=f(n),h=_(u.stxImports,u.browserImports),{transformStoreImports:x}=await import("./chunk-hvtzw1jh.js");n=x(u.code);let g=JSON.stringify(new Bun.CryptoHasher("md5").update(d).digest("hex").slice(0,12));return[";(function() {"," var __stxBundles = globalThis.__stxModuleBundles || (globalThis.__stxModuleBundles = {});",` if (__stxBundles[${g}]) return;`,` __stxBundles[${g}] = true;`,h,n,"})();"].join(`
|
|
4
4
|
`)}export{w as buildModuleRegistryScript,I as registeredModuleIdsIn};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Lc,Ju,jc,Bc,Yu,Zu}from"./chunk-41cvkdcm.js";import"./chunk-vdjj4vrp.js";import"./chunk-kpeep7gq.js";import"./chunk-1sr6c0nk.js";import"./chunk-2dp7hyv7.js";import"./chunk-ce6zddpf.js";import"./chunk-pxdww4rb.js";export{Zu as applySlots,Yu as extractSlotContent,Ju as parseSlotElement,Lc as parseSlots,Bc as processSlots,jc as renderSlot};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Zt,Gs,Ks,Xs,sp,Js}from"./chunk-sme31jbj.js";import"./chunk-04kg16qs.js";import"./chunk-365vg0eg.js";import"./chunk-1sr6c0nk.js";export{Ks as buildServerApi,sp as createServerApi,Zt as discoverServerApi,Gs as generateApiTypes,Js as isServerApiSource,Xs as productionApiDispatcher};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{jt}from"./chunk-
|
|
2
|
+
import{jt}from"./chunk-ecqrkyg8.js";function Cs(e){let n=e.pwa;if(!n?.enabled)return"";let r=n.manifest,t=n.icons?.outputDir?`/${n.icons.outputDir}`:"/pwa-icons",o=jt(e),i=`
|
|
3
3
|
<!-- stx PWA Meta Tags -->
|
|
4
4
|
<link rel="manifest" href="/manifest.json">
|
|
5
5
|
<meta name="theme-color" content="${a(r?.themeColor||"#000000")}">
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{existsSync as A,mkdtempSync as D,readdirSync as M,rmSync as b,statSync as g,writeFileSync as k}from"fs";import{constants as P,tmpdir as x}from"os";import{join as s}from"path";import t from"process";var _=/^stx-(?:.+-)?p(\d+)-\w{6}$/,v=".stx-keep",I=60000,N=["SIGINT","SIGTERM","SIGHUP"],i=new Set,y=new Set,c=!1,S=new Set;function p(e){try{b(e,{recursive:!0,force:!0})}catch{}}function R(){for(let e of i)p(e);i.clear(),f()}function E(){for(let e of i)p(e);i.clear()}function C(e){if(R(),t.listenerCount(e)===0)t.exit(128+(P.signals[e]??1))}var h=new Map(N.map((e)=>[e,()=>C(e)]));function G(){if(c)return;c=!0,t.on("exit",E);for(let[e,n]of h)try{t.on(e,n)}catch{}}function f(){if(!c)return;c=!1,t.off("exit",E);for(let[e,n]of h)t.off(e,n)}function K(e){try{return t.kill(e,0),!0}catch(n){return n.code==="EPERM"}}function O(e={}){let n=e.root??x(),r=e.isAlive??K,w=e.minAgeMs??I,T=e.now??Date.now(),a=[],u;try{u=M(n)}catch{return a}for(let d of u){let l=_.exec(d);if(!l)continue;let m=Number(l[1]);if(m===t.pid||r(m))continue;let o=s(n,d);try{if(!g(o).isDirectory())continue;if(T-g(o).mtimeMs<w)continue;if(A(s(o,v)))continue}catch{continue}p(o),a.push(o)}return a}function L(e){let n=e.replace(/^stx-/,"").replace(/-+$/,"");return n?`stx-${n}-p${t.pid}-`:`stx-p${t.pid}-`}function z(e=t.env){let n=e.STX_KEEP_TEMP?.trim().toLowerCase();return!!n&&n!=="0"&&n!=="false"}function
|
|
3
|
-
`)}catch{}if(y.add(e),i.delete(e),i.size===0)f()}async function Xi(e,n){let r=
|
|
4
|
-
export{
|
|
2
|
+
import{existsSync as A,mkdtempSync as D,readdirSync as M,rmSync as b,statSync as g,writeFileSync as k}from"fs";import{constants as P,tmpdir as x}from"os";import{join as s}from"path";import t from"process";var _=/^stx-(?:.+-)?p(\d+)-\w{6}$/,v=".stx-keep",I=60000,N=["SIGINT","SIGTERM","SIGHUP"],i=new Set,y=new Set,c=!1,S=new Set;function p(e){try{b(e,{recursive:!0,force:!0})}catch{}}function R(){for(let e of i)p(e);i.clear(),f()}function E(){for(let e of i)p(e);i.clear()}function C(e){if(R(),t.listenerCount(e)===0)t.exit(128+(P.signals[e]??1))}var h=new Map(N.map((e)=>[e,()=>C(e)]));function G(){if(c)return;c=!0,t.on("exit",E);for(let[e,n]of h)try{t.on(e,n)}catch{}}function f(){if(!c)return;c=!1,t.off("exit",E);for(let[e,n]of h)t.off(e,n)}function K(e){try{return t.kill(e,0),!0}catch(n){return n.code==="EPERM"}}function O(e={}){let n=e.root??x(),r=e.isAlive??K,w=e.minAgeMs??I,T=e.now??Date.now(),a=[],u;try{u=M(n)}catch{return a}for(let d of u){let l=_.exec(d);if(!l)continue;let m=Number(l[1]);if(m===t.pid||r(m))continue;let o=s(n,d);try{if(!g(o).isDirectory())continue;if(T-g(o).mtimeMs<w)continue;if(A(s(o,v)))continue}catch{continue}p(o),a.push(o)}return a}function L(e){let n=e.replace(/^stx-/,"").replace(/-+$/,"");return n?`stx-${n}-p${t.pid}-`:`stx-p${t.pid}-`}function z(e=t.env){let n=e.STX_KEEP_TEMP?.trim().toLowerCase();return!!n&&n!=="0"&&n!=="false"}function Ve(e="stx",n=x()){if(!S.has(n))S.add(n),O({root:n});let r=D(s(n,L(e)));if(z())return H(r),console.warn(`[stx] STX_KEEP_TEMP: keeping ${r}`),r;return G(),i.add(r),r}function Q(e){if(y.has(e))return;if(p(e),i.delete(e),i.size===0)f()}function H(e){try{k(s(e,v),`kept by pid ${t.pid}
|
|
3
|
+
`)}catch{}if(y.add(e),i.delete(e),i.size===0)f()}async function Xi(e,n){let r=Ve(e);try{return await n(r)}finally{Q(r)}}
|
|
4
|
+
export{Ve,Q,Xi};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ll,ul,Ce,dl,Qi,Gt,Kt,rp,ea,Xt,Fn,pl,fl,gl,qs,Jt,ml,Yt,hl}from"./chunk-zcz97ber.js";import"./chunk-sme31jbj.js";import"./chunk-md2jn67b.js";import"./chunk-9k2wz3k1.js";import"./chunk-9edksf8x.js";import"./chunk-a3d0g4mr.js";import"./chunk-04kg16qs.js";import"./chunk-fzqj1mjz.js";import"./chunk-365vg0eg.js";import"./chunk-vdjj4vrp.js";import"./chunk-kpeep7gq.js";import"./chunk-1sr6c0nk.js";import"./chunk-2dp7hyv7.js";import"./chunk-ce6zddpf.js";import"./chunk-pxdww4rb.js";export{Fn as MODULE_SPECIFIER_PREFIX,ll as bundleCacheDir,ul as bundleCacheEntryLimit,Yt as bundleClientScript,Kt as clearBundleFailures,Ce as clientBundleDependencies,Gt as getBundleFailures,Xt as hasUserImports,Jt as moduleSubstitutionKey,fl as normalizeRegistrySpecifiers,ml as queueClientBundleBuild,Qi as recordBundleFailure,pl as registryIdForPath,ea as resolveBundlerFallback,gl as rewriteRegistryImports,rp as setBundlerFallbackMode,dl as shouldLogBundlerDiagnostics,hl as tempBuildName,qs as withModuleSubstitutes};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{ft,On,Vd}from"./chunk-3y41efsf.js";import{oe,Nn,Ud,Dn,Hs,Pr,Ir,Wd,qd,Gd,Mn,Ln,Vs,Or,Kd}from"./chunk-wbzmr6a4.js";import"./chunk-pxdww4rb.js";export{Hs as batch,Vd as default,Nn as derived,Dn as effect,ft as generateSignalsRuntime,On as generateSignalsRuntimeDev,Ln as isDerived,Mn as isSignal,Ud as memo,Ir as onDestroy,Pr as onMount,Or as peek,Gd as pendingLifecycleCounts,qd as runDestroyCallbacks,Wd as runMountCallbacks,oe as state,Vs as untrack,Kd as useOptimistic};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{zn,Ce}from"./chunk-v2x9vzgw.js";import{L,y,rr,as,S}from"./chunk-qzy8ypk4.js";import{o,R}from"./chunk-1z1632np.js";import{Js}from"./chunk-43gr8ggc.js";import{Ye}from"./chunk-x34scshq.js";import{c}from"./chunk-zhf01af3.js";import{i,Qe}from"./chunk-eqrkhc18.js";import d from"path";import b from"fs";import{AsyncLocalStorage as gt}from"async_hooks";var ht=11;function X(t,e,n){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(d.basename(t))||Js(t,e,n)}var ot=2;function ll(t){let e=process.env.STX_BUNDLE_CACHE_DIR?.trim();return e?d.resolve(e):c(t,"bundle-cache")}function nt(t,e){let n=t;for(let r of xt(e))if(r!==d.sep)n=n.split(r).join("\x00root");return n}var st=new Map;function xt(t){let e=d.resolve(t),n=st.get(e);if(!n){let r=e;try{r=b.realpathSync(e)}catch{}n=[...new Set([e,r])].sort((u,m)=>m.length-u.length),st.set(e,n)}return n}function $t(t,e){try{let n=b.statSync(t),r=d.resolve(e),u=t.startsWith(`${r}${d.sep}`);return{path:u?d.relative(r,t):t,...u?{inRoot:!0}:{},mtimeMs:n.mtimeMs,size:n.size,hash:Bun.hash(b.readFileSync(t)).toString(36)}}catch{return null}}function at(t,e){return t.inRoot?d.join(d.resolve(e),t.path):t.path}function yt(t,e){for(let n of t){let r=at(n,e);try{let u=b.statSync(r);if(u.size!==n.size)return!1;if(u.mtimeMs!==n.mtimeMs&&Bun.hash(b.readFileSync(r)).toString(36)!==n.hash)return!1}catch{return!1}}return!0}var ct=new Map,bt=100;function ul(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 wt(t){let e=G.get(t)??0;if(e>0&&e<bt){G.set(t,e+1);return}G.set(t,1);try{let n=(await b.promises.readdir(t)).filter((l)=>l.endsWith(".js")),r=ul();if(n.length<=r)return;let m=(await Promise.all(n.map(async(l)=>{try{return{name:l,at:(await b.promises.stat(d.join(t,l))).mtimeMs}}catch{return null}}))).filter((l)=>l!==null);m.sort((l,w)=>w.at-l.at);for(let l of m.slice(r)){let w=l.name.slice(0,-3);await b.promises.rm(d.join(t,`${w}.js`),{force:!0}),await b.promises.rm(d.join(t,`${w}.deps.json`),{force:!0})}C("pruned bundle cache to",r,"entries")}catch{}}function _e(t){return ct.get(t)??[]}function q(t,e){if(t)ct.set(t,e)}function dl(t=process.env){return t.STX_DEBUG==="true"||t.STX_DEBUG==="1"}function C(...t){if(dl())console.log("[stx:bundler]",...t)}var Y=[];function Qi(t,e,n){Y.push({filePath:t||"<inline>",message:e,details:n})}function Gt(){return Y.slice()}function Kt(){Y.length=0}var Z;function rp(t){Z=t}function ea(){if(Z)return Z;try{let t=R.strict;return typeof t==="object"&&t!==null?t.bundlerFallback??"warn":"warn"}catch{return"warn"}}var Q=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function Xt(t){let e=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,n;while((n=e.exec(t))!==null){let u=n[1];if(!Q.some((l)=>l.test(u)))return C("detected user import:",u),!0}let r=/^[ \t]*import[ \t]*['"]([^'"]+)['"]/gm;while((n=r.exec(t))!==null){let u=n[1];if(/\.css(?:\?.*)?$/.test(u))continue;if(!Q.some((l)=>l.test(u)))return C("detected side-effect import:",u),!0}return!1}var Fn="stx-module:",St=/\.(?:[cm]?[jt]sx?|json)$/i;function pl(t,e){return d.relative(t,e).split(d.sep).join("/")}function fl(t,e){if(e.size===0)return t;return t.replace(/^([ \t]*import(?:(?:\s+|(?=[{*]))[^;"']*?\s*from\s*|\s*))(["'])([^"']+)\2/gm,(n,r,u,m)=>{let l=e.get(m);return l&&!m.startsWith(Fn)?`${r}${u}${l}${u}`:n})}function gl(t,e){let n=0,r=(m)=>{let l=`__stxMod${n++}`,w=JSON.stringify(m);return e.push(`var ${l} = globalThis.__stxModules && globalThis.__stxModules[${w}];`,`if (${l} === undefined) throw new Error("[stx] module " + ${JSON.stringify(w)} + " is not registered on this page (#1957)");`),l},u=(m,l)=>{for(let w of m.split(",")){let F=w.trim();if(!F)continue;let j=F.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!j)continue;let p=j[1].startsWith('"')?JSON.parse(j[1]):j[1],s=j[2]??p;e.push(`var ${s} = ${l}[${JSON.stringify(p)}];`)}};return t=t.replace(/^[ \t]*import(?:\s+|(?=[{*]))([^;"']+?)\s*from\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(m,l,w)=>{let F=w.slice(Fn.length),j=r(F),p=l.trim(),s=p.match(/^([\w$]+)\s*(?:,\s*|$)/);if(s&&!p.startsWith("{")&&!p.startsWith("*"))e.push(`var ${s[1]} = ${j}.default;`),p=p.slice(s[0].length).trim();let a=p.match(/^\*\s*as\s+([\w$]+)$/);if(a)e.push(`var ${a[1]} = ${j};`);else if(p.startsWith("{"))u(p.replace(/^\{|\}$/g,""),j);return""}),t=t.replace(/^[ \t]*import\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(m,l)=>(r(l.slice(Fn.length)),"")),t}function rt(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(b.existsSync(n)&&b.statSync(n,{throwIfNoEntry:!1})?.isFile())return n}catch{}return}var K=new gt;function qs(t,e){let n=new Bun.CryptoHasher("md5");for(let[r,u]of[...t].sort(([m],[l])=>m<l?-1:m>l?1:0))n.update(`${r}\x00${u}\x00`);return K.run({modules:t,key:n.digest("hex").slice(0,12)},e)}function Jt(){return K.getStore()?.key??""}function vt(t,e,n,r,u,m=new Map,l,w){let F=(p,s,a)=>{if(X(s,t,l))return null;if(!u||p!==n||!St.test(s))return null;try{if(!b.statSync(s,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}r.add(s);let h=`${Fn}${pl(process.cwd(),s)}`;return m.set(a,h),{path:h,external:!0}},j=(p,s)=>{let a=p===n?e:d.dirname(p),h=d.resolve(a,s);return rt(h)??h};return{name:"stx-client-bundle",setup(p){if(p.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(s)=>({path:s.path,external:!0})),p.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(s)=>({path:s.path,external:!0})),p.onResolve({filter:/^\//},(s)=>{let a=rt(s.path);if(a){let h=F(s.importer,a,s.path);if(h)return h;if(a!==n)r.add(a);return{path:a}}return{path:s.path,external:!0}}),p.onResolve({filter:/^\.\.?\//},(s)=>{let a=j(s.importer,s.path),h=F(s.importer,a,s.path);if(h)return h;return r.add(a),{path:a}}),p.onResolve({filter:/^[@~]\//},(s)=>{let a=d.resolve(t,s.path.slice(2)),h=[a,`${a}.ts`,`${a}.tsx`,`${a}.js`,`${a}.mjs`,`${a}.jsx`,d.join(a,"index.ts"),d.join(a,"index.tsx"),d.join(a,"index.js"),d.join(a,"index.mjs")];for(let I of h)if(b.existsSync(I)&&b.statSync(I,{throwIfNoEntry:!1})?.isFile()){let E=F(s.importer,I,s.path);if(E)return E;return C(`resolved ${s.path[0]}/ import:`,s.path,"\u2192",I),r.add(I),{path:I}}return console.warn(`[stx:bundler] could not resolve ${s.path[0]}/ import:`,s.path),{path:a}}),u)p.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(s)=>{if(s.importer!==n)return;let a=`${Fn}npm:${s.path}`;return m.set(s.path,a),{path:a,external:!0}});p.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(s)=>{if(X(s.path,t,l))throw Error(`Server-only API source cannot be imported by a client script: ${s.path}`);let a=d.extname(s.path).toLowerCase(),h=a===".json"?"json":a===".tsx"?"tsx":a===".jsx"?"jsx":a===".ts"||a===".mts"||a===".cts"?"ts":"js";if(s.path!==n)r.add(s.path);let I=w?.get(s.path);if(I!==void 0)return{contents:I,loader:"js"};return{contents:b.readFileSync(s.path,"utf8"),loader:h}})}}}var H=new Map,z=y(64),it=Symbol.for("stx.client-bundle-build-queue");function ml(t){let e=globalThis,r=(e[it]??Promise.resolve()).then(t,t);return e[it]=r.then(()=>{return},()=>{return}),r}async function Yt(t,e,n={}){let r=n.projectRoot||process.cwd(),u=(await o(r)).serverApi,m=n.minify??!1,l=n.externalizeUserModules??!0,w=n.expose?.length?[...new Set(n.expose)].sort():void 0,F=n.cacheDir||ll(r),j=K.getStore(),p=new Bun.CryptoHasher("md5");p.update(`${ht}\x00${Ye()}\x00${JSON.stringify(u??!1)}\x00${l?"registry":"inline"}\x00${w?w.join(","):"*"}\x00${m?"minified":"readable"}\x00${j?.key??""}\x00${nt(t,r)}\x00${nt(e,r)}`);let s=p.digest("hex").slice(0,12),a=d.join(F,`${s}.js`),h=z.get(a);if(h){if(as(h.files)&&h.files.every((M)=>!X(M.path,r,u))){C("memo hit:",s);let M=h.files.map((A)=>A.path);return q(e,M),n.collectInputs?.push(...M),h.code}z.delete(a),C("memo invalidated by dep change:",s)}let I=d.join(F,`${s}.deps.json`),E=Bun.file(a);if(await E.exists()){let M=Bun.file(I),A=!1,O=null;if(await M.exists())try{let D=JSON.parse(await M.text());if(D.metadataVersion===ot&&Array.isArray(D.files)&&yt(D.files,r))O=rr(D.files.map((g)=>at(g,r))),A=O.length===D.files.length&&!O.some((g)=>X(g.path,r,u))}catch{A=!1}if(A){if(C("cache hit:",s),O)q(e,O.map((T)=>T.path)),n.collectInputs?.push(...O.map((T)=>T.path));let D=await E.text(),g=new Date;if(b.promises.utimes(a,g,g).catch(()=>{}),O)z.set(a,{code:D,files:O});return D}C("cache invalidated by dep change:",s)}let P=H.get(s);if(P){let M=await P;if(n.collectInputs)n.collectInputs.push(...(z.get(a)?.files??[]).map((A)=>A.path));return M}let V=ml(()=>jt(t,e,{projectRoot:r,minify:m,cacheDir:F,hash:s,cachePath:a,depsPath:I,collectInputs:n.collectInputs,externalizeUserModules:l,serverApi:u,expose:w,throwOnFailure:n.throwOnFailure,substitutes:j?.modules}));H.set(s,V);try{return await V}finally{H.delete(s)}}var Bt=0;function hl(t){return`${t}-${process.pid}-${++Bt}`}async function jt(t,e,n){let{projectRoot:r,minify:u,cacheDir:m,hash:l,cachePath:w,depsPath:F,externalizeUserModules:j}=n,p=c(r,"bundle-tmp"),s=hl(l),a=d.join(p,`${s}.ts`),h=d.join(p,"out",s);b.mkdirSync(p,{recursive:!0}),b.mkdirSync(h,{recursive:!0});let I=d.dirname(e),E=new Set,P=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,V=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,M=i(t),{depths:A,balanced:O}=Qe(M),D=(B)=>!O||A[B]===0,g;while((g=P.exec(M))!==null){if(g[1])continue;if(!D(g.index))continue;if(g[2])g[2].split(",").forEach((B)=>{let f=Et(B);if(f)E.add(f)});else if(g[3])E.add(g[3])}while((g=V.exec(M))!==null){if(g[1])continue;if(!D(g.index))continue;E.add(g[2])}let T=/^[ \t]*import[ \t]+(?!type\b)(?:(\w+)\s*(?:,\s*)?)?(?:\*\s+as\s+(\w+)|\{([^}]+)\})?\s+from\b/gm;while((g=T.exec(M))!==null){if(!D(g.index))continue;let B=/^\s*['"]([^'"]+)['"]/.exec(t.slice(g.index+g[0].length))?.[1];if(B&&Q.some((f)=>f.test(B)))continue;if(g[1])E.add(g[1]);if(g[2])E.add(g[2]);for(let f of(g[3]??"").split(",")){let v=f.trim();if(!v||/^type\s/.test(v))continue;let U=/\bas\s+(\w+)\s*$/.exec(v)?.[1]??/^\w+$/.exec(v)?.[0];if(U)E.add(U)}}for(let B of M.matchAll(/\bexport\s*\{([^}]+)\}/g))for(let f of B[1].split(",")){let v=/\bas\s+(\w+)\s*$/.exec(f)?.[1]??/^\s*(\w+)\s*$/.exec(f)?.[1];if(v)E.delete(v)}let lt=E.size>0?`
|
|
3
|
-
export { ${[...E].join(", ")} }`:"";await Bun.write(a,t+
|
|
4
|
-
`),
|
|
5
|
-
`);if(f=`${
|
|
2
|
+
import{zn,Ee}from"./chunk-md2jn67b.js";import{L,y,rr,as,S}from"./chunk-vdjj4vrp.js";import{o,R}from"./chunk-9k2wz3k1.js";import{Js}from"./chunk-sme31jbj.js";import{Ze}from"./chunk-2zzc7006.js";import{c}from"./chunk-zhf01af3.js";import{i,et}from"./chunk-qjtpxsyx.js";import d from"path";import b from"fs";import{AsyncLocalStorage as ht}from"async_hooks";var xt=11;function X(t,e,n){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(d.basename(t))||Js(t,e,n)}var at=2;function ll(t){let e=process.env.STX_BUNDLE_CACHE_DIR?.trim();return e?d.resolve(e):c(t,"bundle-cache")}function st(t,e){let n=t;for(let r of $t(e))if(r!==d.sep)n=n.split(r).join("\x00root");return n}var rt=new Map;function $t(t){let e=d.resolve(t),n=rt.get(e);if(!n){let r=e;try{r=b.realpathSync(e)}catch{}n=[...new Set([e,r])].sort((u,m)=>m.length-u.length),rt.set(e,n)}return n}function yt(t,e){try{let n=b.statSync(t),r=d.resolve(e),u=t.startsWith(`${r}${d.sep}`);return{path:u?d.relative(r,t):t,...u?{inRoot:!0}:{},mtimeMs:n.mtimeMs,size:n.size,hash:Bun.hash(b.readFileSync(t)).toString(36)}}catch{return null}}function ct(t,e){return t.inRoot?d.join(d.resolve(e),t.path):t.path}function bt(t,e){for(let n of t){let r=ct(n,e);try{let u=b.statSync(r);if(u.size!==n.size)return!1;if(u.mtimeMs!==n.mtimeMs&&Bun.hash(b.readFileSync(r)).toString(36)!==n.hash)return!1}catch{return!1}}return!0}var lt=new Map,wt=100;function ul(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 St(t){let e=G.get(t)??0;if(e>0&&e<wt){G.set(t,e+1);return}G.set(t,1);try{let n=(await b.promises.readdir(t)).filter((l)=>l.endsWith(".js")),r=ul();if(n.length<=r)return;let m=(await Promise.all(n.map(async(l)=>{try{return{name:l,at:(await b.promises.stat(d.join(t,l))).mtimeMs}}catch{return null}}))).filter((l)=>l!==null);m.sort((l,w)=>w.at-l.at);for(let l of m.slice(r)){let w=l.name.slice(0,-3);await b.promises.rm(d.join(t,`${w}.js`),{force:!0}),await b.promises.rm(d.join(t,`${w}.deps.json`),{force:!0})}C("pruned bundle cache to",r,"entries")}catch{}}function Ce(t){return lt.get(t)??[]}function q(t,e){if(t)lt.set(t,e)}function dl(t=process.env){return t.STX_DEBUG==="true"||t.STX_DEBUG==="1"}function C(...t){if(dl())console.log("[stx:bundler]",...t)}var Y=[];function Qi(t,e,n){Y.push({filePath:t||"<inline>",message:e,details:n})}function Gt(){return Y.slice()}function Kt(){Y.length=0}var Z;function rp(t){Z=t}function ea(){if(Z)return Z;try{let t=R.strict;return typeof t==="object"&&t!==null?t.bundlerFallback??"warn":"warn"}catch{return"warn"}}var Q=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function Xt(t){let e=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,n;while((n=e.exec(t))!==null){let u=n[1];if(!Q.some((l)=>l.test(u)))return C("detected user import:",u),!0}let r=/^[ \t]*import[ \t]*['"]([^'"]+)['"]/gm;while((n=r.exec(t))!==null){let u=n[1];if(/\.css(?:\?.*)?$/.test(u))continue;if(!Q.some((l)=>l.test(u)))return C("detected side-effect import:",u),!0}return!1}var Fn="stx-module:",vt=/\.(?:[cm]?[jt]sx?|json)$/i;function pl(t,e){return d.relative(t,e).split(d.sep).join("/")}function fl(t,e){if(e.size===0)return t;return t.replace(/^([ \t]*import(?:(?:\s+|(?=[{*]))[^;"']*?\s*from\s*|\s*))(["'])([^"']+)\2/gm,(n,r,u,m)=>{let l=e.get(m);return l&&!m.startsWith(Fn)?`${r}${u}${l}${u}`:n})}function gl(t,e){let n=0,r=(m)=>{let l=`__stxMod${n++}`,w=JSON.stringify(m);return e.push(`var ${l} = globalThis.__stxModules && globalThis.__stxModules[${w}];`,`if (${l} === undefined) throw new Error("[stx] module " + ${JSON.stringify(w)} + " is not registered on this page (#1957)");`),l},u=(m,l)=>{for(let w of m.split(",")){let F=w.trim();if(!F)continue;let j=F.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!j)continue;let p=j[1].startsWith('"')?JSON.parse(j[1]):j[1],s=j[2]??p;e.push(`var ${s} = ${l}[${JSON.stringify(p)}];`)}};return t=t.replace(/^[ \t]*import(?:\s+|(?=[{*]))([^;"']+?)\s*from\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(m,l,w)=>{let F=w.slice(Fn.length),j=r(F),p=l.trim(),s=p.match(/^([\w$]+)\s*(?:,\s*|$)/);if(s&&!p.startsWith("{")&&!p.startsWith("*"))e.push(`var ${s[1]} = ${j}.default;`),p=p.slice(s[0].length).trim();let a=p.match(/^\*\s*as\s+([\w$]+)$/);if(a)e.push(`var ${a[1]} = ${j};`);else if(p.startsWith("{"))u(p.replace(/^\{|\}$/g,""),j);return""}),t=t.replace(/^[ \t]*import\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(m,l)=>(r(l.slice(Fn.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(b.existsSync(n)&&b.statSync(n,{throwIfNoEntry:!1})?.isFile())return n}catch{}return}var K=new ht;function qs(t,e){let n=new Bun.CryptoHasher("md5");for(let[r,u]of[...t].sort(([m],[l])=>m<l?-1:m>l?1:0))n.update(`${r}\x00${u}\x00`);return K.run({modules:t,key:n.digest("hex").slice(0,12)},e)}function Jt(){return K.getStore()?.key??""}function Bt(t,e,n,r,u,m=new Map,l,w){let F=(p,s,a)=>{if(X(s,t,l))return null;if(!u||p!==n||!vt.test(s))return null;try{if(!b.statSync(s,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}r.add(s);let h=`${Fn}${pl(process.cwd(),s)}`;return m.set(a,h),{path:h,external:!0}},j=(p,s)=>{let a=p===n?e:d.dirname(p),h=d.resolve(a,s);return it(h)??h};return{name:"stx-client-bundle",setup(p){if(p.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(s)=>({path:s.path,external:!0})),p.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(s)=>({path:s.path,external:!0})),p.onResolve({filter:/^\//},(s)=>{let a=it(s.path);if(a){let h=F(s.importer,a,s.path);if(h)return h;if(a!==n)r.add(a);return{path:a}}return{path:s.path,external:!0}}),p.onResolve({filter:/^\.\.?\//},(s)=>{let a=j(s.importer,s.path),h=F(s.importer,a,s.path);if(h)return h;return r.add(a),{path:a}}),p.onResolve({filter:/^[@~]\//},(s)=>{let a=d.resolve(t,s.path.slice(2)),h=[a,`${a}.ts`,`${a}.tsx`,`${a}.js`,`${a}.mjs`,`${a}.jsx`,d.join(a,"index.ts"),d.join(a,"index.tsx"),d.join(a,"index.js"),d.join(a,"index.mjs")];for(let I of h)if(b.existsSync(I)&&b.statSync(I,{throwIfNoEntry:!1})?.isFile()){let E=F(s.importer,I,s.path);if(E)return E;return C(`resolved ${s.path[0]}/ import:`,s.path,"\u2192",I),r.add(I),{path:I}}return console.warn(`[stx:bundler] could not resolve ${s.path[0]}/ import:`,s.path),{path:a}}),u)p.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(s)=>{if(s.importer!==n)return;let a=`${Fn}npm:${s.path}`;return m.set(s.path,a),{path:a,external:!0}});p.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(s)=>{if(X(s.path,t,l))throw Error(`Server-only API source cannot be imported by a client script: ${s.path}`);let a=d.extname(s.path).toLowerCase(),h=a===".json"?"json":a===".tsx"?"tsx":a===".jsx"?"jsx":a===".ts"||a===".mts"||a===".cts"?"ts":"js";if(s.path!==n)r.add(s.path);let I=w?.get(s.path);if(I!==void 0)return{contents:I,loader:"js"};return{contents:b.readFileSync(s.path,"utf8"),loader:h}})}}}var H=new Map,z=y(64),ot=Symbol.for("stx.client-bundle-build-queue");function ml(t){let e=globalThis,r=(e[ot]??Promise.resolve()).then(t,t);return e[ot]=r.then(()=>{return},()=>{return}),r}async function Yt(t,e,n={}){let r=n.projectRoot||process.cwd(),u=(await o(r)).serverApi,m=n.minify??!1,l=n.externalizeUserModules??!0,w=n.expose?.length?[...new Set(n.expose)].sort():void 0,F=n.cacheDir||ll(r),j=K.getStore(),p=new Bun.CryptoHasher("md5");p.update(`${xt}\x00${Ze()}\x00${JSON.stringify(u??!1)}\x00${l?"registry":"inline"}\x00${w?w.join(","):"*"}\x00${m?"minified":"readable"}\x00${j?.key??""}\x00${st(t,r)}\x00${st(e,r)}`);let s=p.digest("hex").slice(0,12),a=d.join(F,`${s}.js`),h=z.get(a);if(h){if(as(h.files)&&h.files.every((M)=>!X(M.path,r,u))){C("memo hit:",s);let M=h.files.map((A)=>A.path);return q(e,M),n.collectInputs?.push(...M),h.code}z.delete(a),C("memo invalidated by dep change:",s)}let I=d.join(F,`${s}.deps.json`),E=Bun.file(a);if(await E.exists()){let M=Bun.file(I),A=!1,O=null;if(await M.exists())try{let D=JSON.parse(await M.text());if(D.metadataVersion===at&&Array.isArray(D.files)&&bt(D.files,r))O=rr(D.files.map((g)=>ct(g,r))),A=O.length===D.files.length&&!O.some((g)=>X(g.path,r,u))}catch{A=!1}if(A){if(C("cache hit:",s),O)q(e,O.map((T)=>T.path)),n.collectInputs?.push(...O.map((T)=>T.path));let D=await E.text(),g=new Date;if(b.promises.utimes(a,g,g).catch(()=>{}),O)z.set(a,{code:D,files:O});return D}C("cache invalidated by dep change:",s)}let P=H.get(s);if(P){let M=await P;if(n.collectInputs)n.collectInputs.push(...(z.get(a)?.files??[]).map((A)=>A.path));return M}let V=ml(()=>Et(t,e,{projectRoot:r,minify:m,cacheDir:F,hash:s,cachePath:a,depsPath:I,collectInputs:n.collectInputs,externalizeUserModules:l,serverApi:u,expose:w,throwOnFailure:n.throwOnFailure,substitutes:j?.modules}));H.set(s,V);try{return await V}finally{H.delete(s)}}var jt=0;function hl(t){return`${t}-${process.pid}-${++jt}`}async function Et(t,e,n){let{projectRoot:r,minify:u,cacheDir:m,hash:l,cachePath:w,depsPath:F,externalizeUserModules:j}=n,p=c(r,"bundle-tmp"),s=hl(l),a=d.join(p,`${s}.ts`),h=d.join(p,"out",s);b.mkdirSync(p,{recursive:!0}),b.mkdirSync(h,{recursive:!0});let I=d.dirname(e),E=new Set,P=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,V=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,M=i(t),{depths:A,balanced:O}=et(M),D=(B)=>!O||A[B]===0,g;while((g=P.exec(M))!==null){if(g[1])continue;if(!D(g.index))continue;if(g[2])g[2].split(",").forEach((B)=>{let f=_t(B);if(f)E.add(f)});else if(g[3])E.add(g[3])}while((g=V.exec(M))!==null){if(g[1])continue;if(!D(g.index))continue;E.add(g[2])}let T=/^[ \t]*import[ \t]+(?!type\b)(?:(\w+)\s*(?:,\s*)?)?(?:\*\s+as\s+(\w+)|\{([^}]+)\})?\s+from\b/gm;while((g=T.exec(M))!==null){if(!D(g.index))continue;let B=/^\s*['"]([^'"]+)['"]/.exec(t.slice(g.index+g[0].length))?.[1];if(B&&Q.some((f)=>f.test(B)))continue;if(g[1])E.add(g[1]);if(g[2])E.add(g[2]);for(let f of(g[3]??"").split(",")){let v=f.trim();if(!v||/^type\s/.test(v))continue;let U=/\bas\s+(\w+)\s*$/.exec(v)?.[1]??/^\w+$/.exec(v)?.[0];if(U)E.add(U)}}for(let B of M.matchAll(/\bexport\s*\{([^}]+)\}/g))for(let f of B[1].split(",")){let v=/\bas\s+(\w+)\s*$/.exec(f)?.[1]??/^\s*(\w+)\s*$/.exec(f)?.[1];if(v)E.delete(v)}let ut=E.size>0?`
|
|
3
|
+
export { ${[...E].join(", ")} }`:"";await Bun.write(a,t+ut),C("bundling:",l,"from:",d.basename(e));let tt=new Set,nt=new Map;try{let B=await Bun.build({entrypoints:[a],outdir:h,target:"browser",format:"esm",minify:u?{whitespace:!1,identifiers:!0,syntax:!0}:!1,plugins:[Bt(r,I,a,tt,j,nt,n.serverApi,n.substitutes)],define:{"process.env.NODE_ENV":u?'"production"':'"development"',...S()},root:r});if(!B.success){let _=B.logs.filter((N)=>N.level==="error").map((N)=>N.message).join(", ")||`Unable to bundle ${d.basename(e)}`,k=zn(B.logs,e||void 0);if(console.warn("[stx:bundler] build failed:",_),Qi(e||"",_,k),n.throwOnFailure||ea()==="error")throw Error(_);return t}let f="";for(let x of B.outputs){f=await x.text();break}let v=[];for(let x of f.matchAll(/^\s*export\s*\{([^}]*)\}\s*;?\s*$/gm))for(let _ of x[1].split(",")){let k=_.trim().match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(k){v.push([k[2],k[1]]);continue}let N=_.trim();if(/^[A-Za-z_$][\w$]*$/.test(N))v.push([N,N])}if(n.expose){let x=new Set(n.expose);for(let _=v.length-1;_>=0;_--)if(!x.has(v[_][0]))v.splice(_,1)}let U=[];f=gl(fl(f,nt),U);let dt=f.match(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm)||[];if(f=f.replace(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm,"").replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim(),u&&f)try{f=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(f)}catch{}let J=`__stxBundle_${l}`,pt=new Set(L(t,!0).split(",").map((x)=>x.trim())),ft=v.map(([x,_])=>`get ${JSON.stringify(x)}() { return ${_} }${pt.has(x)?`, set ${JSON.stringify(x)}(__stxValue_${_}) { ${_} = __stxValue_${_} }`:""}`).join(", "),mt=v.map(([x])=>`var ${x} = undefined;`).join(`
|
|
4
|
+
`),gt=v.map(([x])=>`${x} = ${J}[${JSON.stringify(x)}];`).join(`
|
|
5
|
+
`);if(f=`${dt.join(`
|
|
6
6
|
`)}
|
|
7
|
-
${
|
|
7
|
+
${mt}
|
|
8
8
|
var ${J} = (function() {
|
|
9
9
|
${U.join(`
|
|
10
10
|
`)}
|
|
11
11
|
${f}
|
|
12
|
-
return { ${
|
|
12
|
+
return { ${ft} };
|
|
13
13
|
})();
|
|
14
|
-
${
|
|
14
|
+
${gt}
|
|
15
15
|
var __stxLiveBindings = typeof __stxLiveBindings === 'undefined' ? {} : __stxLiveBindings;
|
|
16
16
|
Object.keys(${J}).forEach(function(name) {
|
|
17
17
|
if (!Object.prototype.hasOwnProperty.call(__stxLiveBindings, name))
|
|
18
18
|
Object.defineProperty(__stxLiveBindings, name, Object.getOwnPropertyDescriptor(${J}, name));
|
|
19
|
-
});`.trim(),C("bundled:",l,"output:",f.length,"bytes"),E.size>0&&v.length===0)return console.warn(`[stx:bundler] dropped every binding for ${d.basename(e)} (${l}); serving the unbundled source and not caching this result`),t;b.mkdirSync(m,{recursive:!0}),await Bun.write(w,f);let W=rr(tt);return await Bun.write(F,JSON.stringify({metadataVersion:
|
|
20
|
-
export{ll,ul,
|
|
19
|
+
});`.trim(),C("bundled:",l,"output:",f.length,"bytes"),E.size>0&&v.length===0)return console.warn(`[stx:bundler] dropped every binding for ${d.basename(e)} (${l}); serving the unbundled source and not caching this result`),t;b.mkdirSync(m,{recursive:!0}),await Bun.write(w,f);let W=rr(tt);return await Bun.write(F,JSON.stringify({metadataVersion:at,files:W.map((x)=>yt(x.path,r)).filter((x)=>x!==null)})),q(e,W.map((x)=>x.path)),n.collectInputs?.push(...W.map((x)=>x.path)),z.set(w,{code:f,files:W}),await St(m),f}catch(B){let f=zn(B,e||void 0),v=Ee(B,e||void 0);if(console.warn(`[stx:bundler] error: ${v}`),Qi(e||"",v,f),n.throwOnFailure||ea()==="error")throw B;return t}finally{try{b.rmSync(a,{force:!0}),b.rmSync(h,{recursive:!0,force:!0})}catch{}}}function _t(t){let e=t.trim();if(!e)return null;let n=e.indexOf("=");if(n!==-1)e=e.slice(0,n).trim();let r=e.indexOf(":");if(r!==-1)e=e.slice(r+1).trim();if(e.startsWith("..."))e=e.slice(3).trim();return/^[A-Za-z_$][\w$]*$/.test(e)?e:null}
|
|
20
|
+
export{ll,ul,Ce,dl,Qi,Gt,Kt,rp,ea,Xt,Fn,pl,fl,gl,qs,Jt,ml,Yt,hl};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{fp,_l,oo,Fr,io,ao,zr,Hr,Vr,co,ia,Cl,ht}from"./chunk-060298px.js";import"./chunk-fpz59dhz.js";import"./chunk-p472crv1.js";import"./chunk-9k2wz3k1.js";import"./chunk-9edksf8x.js";import"./chunk-a3d0g4mr.js";import"./chunk-04kg16qs.js";import"./chunk-fzqj1mjz.js";import"./chunk-365vg0eg.js";import{L}from"./chunk-vdjj4vrp.js";import"./chunk-kpeep7gq.js";import"./chunk-1sr6c0nk.js";import"./chunk-2dp7hyv7.js";import"./chunk-ce6zddpf.js";import"./chunk-pxdww4rb.js";export{fp as clearScriptScanCache,zr as convertServerLoopAttributesToDirectives,io as convertSignalDirectivesToAttributes,Hr as convertSignalLoopsToAttributes,L as extractExports,ia as findMarkupIndexOutsideScripts,Fr as hasSignalsSyntax,oo as parseLoopExpression,ao as preEvalLiteralReactiveIfs,Vr as processScriptSetup,co as processSignals,Cl as rewriteStxImportSpecifiers,_l as scanScriptTags,ht as stripStxRuntimeImports};
|