@stacksjs/stx 0.2.755 → 0.2.759
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-0dsykna3.js → chunk-00ns0516.js} +5 -5
- package/dist/chunk-055v5qz2.js +2 -0
- package/dist/{chunk-kjfzkac7.js → chunk-06zn167b.js} +7 -7
- package/dist/{chunk-024m1xmd.js → chunk-0dkd26t4.js} +5 -5
- package/dist/{chunk-gzbmfwxr.js → chunk-0e9xdrzx.js} +4 -4
- package/dist/chunk-0j7e56zm.js +2 -0
- package/dist/{chunk-8wbgq43c.js → chunk-0jn79fkt.js} +3 -3
- package/dist/chunk-0y44f9rk.js +2 -0
- package/dist/{chunk-d73hh5ar.js → chunk-11kejz35.js} +1 -1
- package/dist/{chunk-p33w8zst.js → chunk-1mfj2j5g.js} +3 -3
- package/dist/{chunk-vc4jww9y.js → chunk-2x112fxs.js} +13 -13
- package/dist/{chunk-6ywa41tr.js → chunk-3ajnrfa2.js} +2 -2
- package/dist/{chunk-3z38swhv.js → chunk-3cn9y08d.js} +7 -7
- package/dist/chunk-3h2yz805.js +2 -0
- package/dist/chunk-3jfes9b0.js +2 -0
- package/dist/{chunk-nsjkmpjf.js → chunk-3kfbs0mw.js} +1 -1
- package/dist/{chunk-z5kdmget.js → chunk-3nxe5xmy.js} +3 -3
- package/dist/{chunk-p2v0r96k.js → chunk-42hcspws.js} +2 -2
- package/dist/{chunk-0tgrqhkr.js → chunk-465resq9.js} +11 -11
- package/dist/{chunk-m0shnhth.js → chunk-4m8bexrn.js} +3 -3
- package/dist/{chunk-8wbcy0cn.js → chunk-4npabwne.js} +3 -3
- package/dist/{chunk-xrzghjvy.js → chunk-4s9kytdz.js} +2 -2
- package/dist/chunk-4tz00fkp.js +2 -0
- package/dist/{chunk-dvakr9p9.js → chunk-4zw118tn.js} +4 -4
- package/dist/chunk-52q8184e.js +2 -0
- package/dist/chunk-59ytzyp1.js +2 -0
- package/dist/chunk-5ffdtfwg.js +2 -0
- package/dist/{chunk-g223zsce.js → chunk-5ge5h2y3.js} +3 -3
- package/dist/chunk-5q551m4w.js +2 -0
- package/dist/{chunk-cb4ybh7g.js → chunk-5q9ss7ty.js} +4 -4
- package/dist/{chunk-txgd0sj1.js → chunk-6n195hvc.js} +5 -5
- package/dist/chunk-6xt3kvq1.js +2 -0
- package/dist/chunk-75r09rqt.js +2 -0
- package/dist/{chunk-90gx5qxn.js → chunk-76fcwbe1.js} +4 -4
- package/dist/chunk-79y41h1d.js +2 -0
- package/dist/{chunk-9r3ehqtx.js → chunk-7g9vd5fv.js} +2 -2
- package/dist/chunk-7h5d35bf.js +2 -0
- package/dist/{chunk-73b6sst8.js → chunk-7r7j7vwt.js} +3 -3
- package/dist/chunk-82ybmdqk.js +2 -0
- package/dist/{chunk-g22absm0.js → chunk-83ezv8yz.js} +2 -2
- package/dist/chunk-8frs2dtp.js +2 -0
- package/dist/chunk-8n2gj4q2.js +11 -0
- package/dist/chunk-8prq9t3b.js +2 -0
- package/dist/chunk-8sxngenk.js +2 -0
- package/dist/chunk-90er677t.js +2 -0
- package/dist/{chunk-bkkwdh13.js → chunk-93j4atq9.js} +2 -2
- package/dist/{chunk-1a2cwee1.js → chunk-9s1qnf90.js} +2 -2
- package/dist/{chunk-j3d9zknp.js → chunk-a5d888es.js} +6 -6
- package/dist/chunk-aakkjjgr.js +2 -0
- package/dist/chunk-abs1k04e.js +2 -0
- package/dist/{chunk-0vvb78yj.js → chunk-asp7ett1.js} +5 -5
- package/dist/{chunk-7mm5mvg0.js → chunk-b6g24qj0.js} +2 -2
- package/dist/{chunk-7djnbbeb.js → chunk-bsq9zg9j.js} +6 -6
- package/dist/{chunk-7ycf8a8d.js → chunk-c05r0rzw.js} +2 -2
- package/dist/{chunk-g45p4y4v.js → chunk-cehjp06v.js} +3 -3
- package/dist/chunk-cpep999n.js +2 -0
- package/dist/chunk-cvwn6mga.js +2 -0
- package/dist/chunk-davr7z73.js +2 -0
- package/dist/{chunk-vpa4xzz3.js → chunk-dh9aagwm.js} +1 -1
- package/dist/chunk-dqs4bgec.js +2 -0
- package/dist/chunk-e30kgg28.js +2 -0
- package/dist/chunk-e3fkq9gb.js +2 -0
- package/dist/chunk-eab8na0z.js +2 -0
- package/dist/chunk-exg7ry7b.js +2 -0
- package/dist/chunk-f4mmk2cx.js +2 -0
- package/dist/chunk-fhwn8j9p.js +2 -0
- package/dist/chunk-fj105fff.js +2 -0
- package/dist/{chunk-cmaxdd8d.js → chunk-fjxhga6w.js} +2 -2
- package/dist/{chunk-thr1m7k7.js → chunk-fpagqrd1.js} +22 -22
- package/dist/chunk-g387j1qv.js +2 -0
- package/dist/{chunk-zqmvhg37.js → chunk-geb6zyxg.js} +10 -10
- package/dist/chunk-gefpzry6.js +2 -0
- package/dist/chunk-ghzycypz.js +2 -0
- package/dist/{chunk-sj2a5twe.js → chunk-gs373714.js} +2 -2
- package/dist/{chunk-nzy4set0.js → chunk-gs6wc7sr.js} +5 -5
- package/dist/chunk-gvaee1w0.js +170 -0
- package/dist/{chunk-5q2tfrcw.js → chunk-gz38jt5j.js} +2 -2
- package/dist/{chunk-pydmzvpq.js → chunk-h692k9xn.js} +1 -1
- package/dist/{chunk-81ysx0tc.js → chunk-hk98vptc.js} +2 -2
- package/dist/{chunk-xzz36k99.js → chunk-hmae7ha6.js} +2 -2
- package/dist/{chunk-qxrsm48h.js → chunk-hmydy949.js} +5 -5
- package/dist/{chunk-7r5vhqtz.js → chunk-j04v4rgf.js} +4 -4
- package/dist/{chunk-1tmq09ch.js → chunk-j4snweyz.js} +3 -3
- package/dist/{chunk-d2vsw1j7.js → chunk-jb1dk0w7.js} +2 -2
- package/dist/{chunk-5evgz54v.js → chunk-jevd16gq.js} +30 -30
- package/dist/{chunk-41sq06t2.js → chunk-jt28zh50.js} +2 -2
- package/dist/chunk-k37472gm.js +2 -0
- package/dist/chunk-k3wnmpt3.js +2 -0
- package/dist/chunk-kfqdx75m.js +2 -0
- package/dist/{chunk-9q1kkfv1.js → chunk-kpr09x3g.js} +6 -6
- package/dist/{chunk-3ap06zzx.js → chunk-m00c7sh0.js} +1 -1
- package/dist/{chunk-8w0cwcvk.js → chunk-m5fjhrpd.js} +62 -62
- package/dist/{chunk-mpmx0n3q.js → chunk-mcynmrbe.js} +26 -26
- package/dist/chunk-mgx71bfg.js +2 -0
- package/dist/chunk-mmhbn7xt.js +2 -0
- package/dist/{chunk-0md73jp8.js → chunk-myynywry.js} +2 -2
- package/dist/chunk-mzcbfra0.js +2 -0
- package/dist/{chunk-j5p191zq.js → chunk-nv9dy71x.js} +7 -7
- package/dist/chunk-ny2qzraq.js +2 -0
- package/dist/{chunk-q0f28539.js → chunk-pes27snj.js} +2 -2
- package/dist/chunk-pg15tx9c.js +2 -0
- package/dist/chunk-ppc5s12t.js +2 -0
- package/dist/{chunk-0dt7ax79.js → chunk-prej5pk6.js} +2 -2
- package/dist/chunk-ptzzpf97.js +2 -0
- package/dist/{chunk-df8cbgf0.js → chunk-pwmkhs7z.js} +2 -2
- package/dist/chunk-qgsrxyh9.js +2 -0
- package/dist/chunk-qmxcs806.js +2 -0
- package/dist/chunk-qn4gt8sx.js +3 -0
- package/dist/chunk-qryg0hgn.js +2 -0
- package/dist/chunk-qt17792g.js +2 -0
- package/dist/{chunk-236bdf7y.js → chunk-qwds327k.js} +2 -2
- package/dist/{chunk-c3dphs36.js → chunk-qwsgc5rc.js} +1 -1
- package/dist/chunk-qz9fzz5k.js +2 -0
- package/dist/{chunk-5wcgg5t4.js → chunk-r4sawwmp.js} +1 -1
- package/dist/chunk-r5jytt0f.js +20 -0
- package/dist/chunk-rh90yh1c.js +2 -0
- package/dist/chunk-rvc0pb16.js +2 -0
- package/dist/{chunk-fxftc455.js → chunk-s4y26fk6.js} +2 -2
- package/dist/{chunk-v0s52tmv.js → chunk-sgm6tg8h.js} +2 -2
- package/dist/chunk-sj5t0tnv.js +2 -0
- package/dist/{chunk-yd2nj0rv.js → chunk-spjpdymh.js} +1 -1
- package/dist/{chunk-nmy72s6r.js → chunk-t4mpq6t0.js} +2 -2
- package/dist/{chunk-np8knskz.js → chunk-t5gabs4x.js} +1 -1
- package/dist/{chunk-4zta7ay1.js → chunk-t6qn1374.js} +2 -2
- package/dist/{chunk-4fc8zs15.js → chunk-tb56j1zt.js} +5 -5
- package/dist/chunk-tb6jcr2v.js +2 -0
- package/dist/chunk-v20cwjgz.js +17 -0
- package/dist/{chunk-k9m36nyw.js → chunk-v2egd4zh.js} +5 -5
- package/dist/{chunk-0fweckq5.js → chunk-vh1d5eqk.js} +6 -6
- package/dist/{chunk-fa3ygt8c.js → chunk-w8p1y4c0.js} +4 -4
- package/dist/{chunk-j2hm8v8b.js → chunk-wp9y6x33.js} +4 -4
- package/dist/{chunk-g5sctfwa.js → chunk-x1q2ape8.js} +10 -10
- package/dist/{chunk-x5sy0tym.js → chunk-x9haxcsj.js} +6 -6
- package/dist/chunk-xcq41ah8.js +2 -0
- package/dist/chunk-y3jbkk7a.js +2 -0
- package/dist/{chunk-fmxtnva8.js → chunk-yftw25sa.js} +2 -2
- package/dist/chunk-yme43vbp.js +2 -0
- package/dist/{chunk-m6w75sq2.js → chunk-yp6w740k.js} +2 -2
- package/dist/chunk-yv8jeqdn.js +2 -0
- package/dist/{chunk-k4dn3ry6.js → chunk-z8k3fx4r.js} +4 -4
- package/dist/chunk-zq7g0687.js +2 -0
- package/dist/{chunk-c85j39f7.js → chunk-ztdjdxjt.js} +3 -3
- package/dist/cli.js +19 -19
- package/dist/client-module-registry.d.ts +56 -0
- package/dist/client-module-registry.js +249 -9
- package/dist/client-script-bundler.d.ts +17 -0
- package/dist/client-script-bundler.js +58 -11
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/native/compiler/bundle.d.ts +1 -0
- package/dist/native/compiler/bundle.js +102 -11
- package/dist/native/compiler/render-screen.js +13 -6
- package/dist/native/compiler/setup-script.d.ts +1 -0
- package/dist/native/compiler/shared-scripts.d.ts +12 -0
- package/dist/native/compiler/shared-scripts.js +83 -0
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +4 -4
- package/dist/store-loader.d.ts +23 -0
- package/dist/store-loader.js +93 -19
- package/package.json +5 -5
- package/dist/chunk-1gan06yr.js +0 -2
- package/dist/chunk-1menbxwb.js +0 -2
- package/dist/chunk-1n2d3cy5.js +0 -2
- package/dist/chunk-2vc2pkyz.js +0 -2
- package/dist/chunk-33bp9m4c.js +0 -2
- package/dist/chunk-361yezje.js +0 -2
- package/dist/chunk-45cvagp1.js +0 -2
- package/dist/chunk-5f0wwwmw.js +0 -2
- package/dist/chunk-5h71xbzk.js +0 -2
- package/dist/chunk-5z9a1vzw.js +0 -2
- package/dist/chunk-67jf2e8x.js +0 -2
- package/dist/chunk-6b7je8dc.js +0 -2
- package/dist/chunk-6fxjs3ay.js +0 -3
- package/dist/chunk-6n5jnd97.js +0 -2
- package/dist/chunk-6wvnfdqq.js +0 -2
- package/dist/chunk-78jkbaz3.js +0 -2
- package/dist/chunk-7e9hfrtb.js +0 -2
- package/dist/chunk-7tc5fj96.js +0 -2
- package/dist/chunk-82q0fy52.js +0 -2
- package/dist/chunk-8q5ec4s1.js +0 -2
- package/dist/chunk-8ysk095d.js +0 -2
- package/dist/chunk-9vbrj55v.js +0 -2
- package/dist/chunk-bcefawtc.js +0 -2
- package/dist/chunk-bd6s91p9.js +0 -2
- package/dist/chunk-bhkqzz91.js +0 -2
- package/dist/chunk-bx1mjwhb.js +0 -2
- package/dist/chunk-dw0m259e.js +0 -2
- package/dist/chunk-dx4g2ec9.js +0 -2
- package/dist/chunk-evdskc25.js +0 -2
- package/dist/chunk-gppv6fez.js +0 -2
- package/dist/chunk-grjr8shp.js +0 -2
- package/dist/chunk-gz1w4cpp.js +0 -2
- package/dist/chunk-h0qtmmq3.js +0 -2
- package/dist/chunk-h6sewvt2.js +0 -20
- package/dist/chunk-hb34m4pp.js +0 -2
- package/dist/chunk-hwvtpx3p.js +0 -2
- package/dist/chunk-k3kav39s.js +0 -2
- package/dist/chunk-k46j2maz.js +0 -2
- package/dist/chunk-ka2f844k.js +0 -2
- package/dist/chunk-kh4dr6gd.js +0 -2
- package/dist/chunk-myd82d80.js +0 -2
- package/dist/chunk-nek0q523.js +0 -130
- package/dist/chunk-nvbjcgzd.js +0 -2
- package/dist/chunk-p13dxvaj.js +0 -2
- package/dist/chunk-pht5z7wa.js +0 -2
- package/dist/chunk-ppvdbstz.js +0 -11
- package/dist/chunk-pwdk7jbx.js +0 -2
- package/dist/chunk-qekyxjy6.js +0 -2
- package/dist/chunk-r10eadgn.js +0 -2
- package/dist/chunk-r8184e10.js +0 -2
- package/dist/chunk-rshaz0df.js +0 -4
- package/dist/chunk-tcrpa52j.js +0 -2
- package/dist/chunk-vp1p250v.js +0 -2
- package/dist/chunk-vqrg5j83.js +0 -2
- package/dist/chunk-vzdfq3b5.js +0 -2
- package/dist/chunk-wzh4ene8.js +0 -2
- package/dist/chunk-x5vwkccx.js +0 -2
- package/dist/chunk-x6cmj5sa.js +0 -2
- package/dist/chunk-xnrfz4c3.js +0 -2
- package/dist/chunk-yaabhcss.js +0 -2
- package/dist/chunk-yazqtmq4.js +0 -2
- package/dist/chunk-zygpvm1x.js +0 -2
- package/dist/chunk-zz247c1r.js +0 -2
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{_}from"./chunk-
|
|
2
|
+
import{_}from"./chunk-qwds327k.js";import{we,At,ti,ni,Cc,Ec,Tc,$c,Is,si,Rc,Ac,Pc,mn}from"./chunk-m5fjhrpd.js";import{a}from"./chunk-x1q2ape8.js";import{po}from"./chunk-4m8bexrn.js";import{l}from"./chunk-c05r0rzw.js";import{existsSync as M,readFileSync as K}from"fs";import h from"path";var ge=new Set(["module","exports","require","$bool","$num","window","document","console","confirm","alert","fetch"]),ee=mn.filter((e)=>!ge.has(e)).sort(),te=[..._].sort(),me=[...new Set([...ee,...te])].sort(),he=new Set(ee),be=new Set(te),ye=new Set(me),Y=/\bimport\s+(?!type[\s{])\{([^}]*)\}\s*from\s*(['"])stx\2/g;function xe(e,t){if(t==="server")return`'${e}' is not provided by 'stx' in a <script server> block. The engine binds only its own names there (defineProps, state, useHead, ...); any other name becomes \`await import('stx')\`, which does not resolve, so the whole script fails when the page renders. Import it from '@stacksjs/stx' instead.`;return`'${e}' is not provided by 'stx' in a client <script> block. The import is replaced by the window.stx runtime, which has no '${e}', so it is undefined in the browser.`}function ne(e,t){let s=[];for(let u of t){if(u.offset===void 0)continue;let i=u.kind==="server"?he:be;Y.lastIndex=0;for(let c of u.code.matchAll(Y)){let g=c.index+c[0].indexOf("{")+1;for(let m of c[1].matchAll(/[^,]+/g)){let x=m[0];if(/^\s*type\s/.test(x))continue;let y=/^\s*([A-Za-z_$][\w$]*)/.exec(x);if(!y)continue;let r=y[1];if(!ye.has(r)||i.has(r))continue;let f=u.offset+g+m.index+y[0].length-r.length,p=e.slice(0,f),k=p.split(`
|
|
3
3
|
`).length;s.push({line:k,column:f-(p.lastIndexOf(`
|
|
4
|
-
`)+1)+1,offset:f,length:r.length,name:r,kind:u.kind,message:xe(r,u.kind)})}}}return s}import v from"path";var Se="@stacksjs/stx-typescript-plugin";function ke(e,t){let s=v.resolve(e);for(;;){let u=v.join(s,"tsconfig.json");if(t(u))return u;let i=v.dirname(s);if(i===s)return;s=i}}function ie(e,t,s){let u=ke(e,s);if(!u)return;let i=new Set,c=(g)=>{if(i.has(g))return;i.add(g);let m=t(g);if(!m)return;let x=m.compilerOptions?.plugins;if(Array.isArray(x)){let r=x.find((p)=>p?.name===Se),f=Array.isArray(r?.libs)?r.libs.filter((p)=>typeof p==="string"):[];return r?{configPath:g,libs:f.map((p)=>v.resolve(v.dirname(g),p))}:null}let y=typeof m.extends==="string"?[m.extends]:Array.isArray(m.extends)?m.extends:[];for(let r of[...y].reverse()){if(typeof r!=="string"||!r.startsWith("."))continue;let f=v.resolve(v.dirname(g),r.endsWith(".json")?r:`${r}.json`),p=c(f);if(p!==void 0)return p}return};return c(u)??void 0}function
|
|
5
|
-
`.repeat(e.startLine-1):"",i=
|
|
4
|
+
`)+1)+1,offset:f,length:r.length,name:r,kind:u.kind,message:xe(r,u.kind)})}}}return s}import v from"path";var Se="@stacksjs/stx-typescript-plugin";function ke(e,t){let s=v.resolve(e);for(;;){let u=v.join(s,"tsconfig.json");if(t(u))return u;let i=v.dirname(s);if(i===s)return;s=i}}function ie(e,t,s){let u=ke(e,s);if(!u)return;let i=new Set,c=(g)=>{if(i.has(g))return;i.add(g);let m=t(g);if(!m)return;let x=m.compilerOptions?.plugins;if(Array.isArray(x)){let r=x.find((p)=>p?.name===Se),f=Array.isArray(r?.libs)?r.libs.filter((p)=>typeof p==="string"):[];return r?{configPath:g,libs:f.map((p)=>v.resolve(v.dirname(g),p))}:null}let y=typeof m.extends==="string"?[m.extends]:Array.isArray(m.extends)?m.extends:[];for(let r of[...y].reverse()){if(typeof r!=="string"||!r.startsWith("."))continue;let f=v.resolve(v.dirname(g),r.endsWith(".json")?r:`${r}.json`),p=c(f);if(p!==void 0)return p}return};return c(u)??void 0}function Rl(e,t="",s=""){let u=e.startLine>1?`
|
|
5
|
+
`.repeat(e.startLine-1):"",i=si(e)+ni(ti(e.code)),c=e.kind==="client"||e.kind==="plain"?Tc(t,e.code):"";return Is(`${u+i}
|
|
6
6
|
${c}
|
|
7
7
|
export {}
|
|
8
8
|
`,s)}var $e=new Set(["name","status","length","location","history","origin","closed","close","open","focus","blur","print","scroll","scrollTo","scrollBy","stop","top","parent","self","frames","event","external","menubar","toolbar"]);function ve(e){if(e.length===0)return"";let t=["// Generated \u2014 the composables the runtime publishes as bare globals."],s=new Set(_),u=[];for(let{file:i,names:c}of e){let g=JSON.stringify(i.replace(/\\/g,"/").replace(/\.ts$/,""));u.push(` export * from ${g}`);for(let m of c){if(s.has(m)||$e.has(m))continue;s.add(m),t.push(`declare const ${m}: typeof import(${g})[${JSON.stringify(m)}]`)}}return t.push("declare module '@composables' {",...u,"}"),t.join(`
|
|
9
|
-
`)}function
|
|
9
|
+
`)}function Qi(e,t,s){return`${e}.__stx_${t}${s}.ts`}function Mg(e){return e.replace(/\.__stx_(?:server|client|plain|template)\d+\.ts$/,"")}function Al(){return se("stx.d.ts")}function Pl(){return se("stx-module.d.ts")}function se(e){for(let t of[h.resolve(import.meta.dir,"..",e),h.resolve(import.meta.dir,"..","..",e)])if(M(t))return t;return null}var Te=/^(.*?)\((\d+),(\d+)\):\s+(error|warning)\s+TS(\d+):\s+(.*)$/;function De(e){return e>=1000&&e<2000}function re(e){let t="",s=!1,u=!1;for(let i=0;i<e.length;i++){let c=e[i];if(s){if(t+=c,u)u=!1;else if(c==="\\")u=!0;else if(c==='"')s=!1;continue}if(c==='"'){s=!0,t+=c;continue}if(c==="/"&&e[i+1]==="/"){while(i<e.length&&e[i]!==`
|
|
10
10
|
`)i++;t+=`
|
|
11
|
-
`;continue}if(c==="/"&&e[i+1]==="*"){i+=2;while(i<e.length&&!(e[i]==="*"&&e[i+1]==="/"))i++;i++;continue}t+=c}return t.replace(/,(\s*[}\]])/g,"$1")}function Ee(e){try{return JSON.parse(re(K(e,"utf8")))}catch{return}}function Oe(e){let t=h.resolve(e),s;for(;;){let r=h.join(t,"tsconfig.json");if(M(r)){s=r;break}let f=h.dirname(t);if(f===t)break;t=f}if(!s)return{};let u=new Set,i=s,c,g,m=s;while(i&&!u.has(i)){u.add(i);let r;try{r=JSON.parse(re(K(i,"utf8")))}catch{break}let f=r?.compilerOptions??{};if(!c&&f.paths&&typeof f.paths==="object")c=f.paths,m=i;if(!g&&typeof f.baseUrl==="string")g=h.resolve(h.dirname(i),f.baseUrl);if(c&&g)break;i=typeof r?.extends==="string"?h.resolve(h.dirname(i),r.extends.endsWith(".json")?r.extends:`${r.extends}.json`):void 0}if(!c)return{};let x=g??h.dirname(m),y={};for(let[r,f]of Object.entries(c)){if(!Array.isArray(f))continue;y[r]=f.map((p)=>typeof p==="string"&&!h.isAbsolute(p)?h.resolve(x,p):p)}return{paths:y}}async function
|
|
12
|
-
`);for(let d of ne(o,b))x.push({file:n,line:d.line,column:d.column,code:0,message:d.message,category:"error",blockKind:d.kind});if(s&&S){let d=b.filter((E)=>E.kind!=="server"),D=[...new Set(d.flatMap((E)
|
|
13
|
-
`),ve(await
|
|
11
|
+
`;continue}if(c==="/"&&e[i+1]==="*"){i+=2;while(i<e.length&&!(e[i]==="*"&&e[i+1]==="/"))i++;i++;continue}t+=c}return t.replace(/,(\s*[}\]])/g,"$1")}function Ee(e){try{return JSON.parse(re(K(e,"utf8")))}catch{return}}function Oe(e){let t=h.resolve(e),s;for(;;){let r=h.join(t,"tsconfig.json");if(M(r)){s=r;break}let f=h.dirname(t);if(f===t)break;t=f}if(!s)return{};let u=new Set,i=s,c,g,m=s;while(i&&!u.has(i)){u.add(i);let r;try{r=JSON.parse(re(K(i,"utf8")))}catch{break}let f=r?.compilerOptions??{};if(!c&&f.paths&&typeof f.paths==="object")c=f.paths,m=i;if(!g&&typeof f.baseUrl==="string")g=h.resolve(h.dirname(i),f.baseUrl);if(c&&g)break;i=typeof r?.extends==="string"?h.resolve(h.dirname(i),r.extends.endsWith(".json")?r.extends:`${r.extends}.json`):void 0}if(!c)return{};let x=g??h.dirname(m),y={};for(let[r,f]of Object.entries(c)){if(!Array.isArray(f))continue;y[r]=f.map((p)=>typeof p==="string"&&!h.isAbsolute(p)?h.resolve(x,p):p)}return{paths:y}}async function Lg(e,t={}){let s=t.client!==!1,u=t.server!==!1,i=t.templates!==!1,c=t.componentsDir??(i?(await a()).componentsDir:void 0),g=new Map,m=new Map,x=[],y=[],r=0,f=0,p=Al();for(let n of e){let o=await Bun.file(n).text(),b=At(o).filter((d)=>{if(d.kind==="server")return u;return s}),S=At(o).filter((d)=>d.kind==="server").map((d)=>d.code).join(`
|
|
12
|
+
`);for(let d of ne(o,b))x.push({file:n,line:d.line,column:d.column,code:0,message:d.message,category:"error",blockKind:d.kind});if(s&&S){let d=b.filter((E)=>E.kind!=="server"),D=[...new Set(d.flatMap((E)=>$c(S,E.code)))];if(D.length>0)m.set(n,{names:D,line:d[0].startLine,kind:d[0].kind})}let T=h.dirname(h.resolve(n)),w=i?Rc(o,{runtimeGlobals:!p,originDir:T,filePath:h.resolve(n),componentsDir:c}):null,R=w?[...w.lineMap.values()].filter((d)=>d.expression).length:0;if(b.length===0&&R===0)continue;if(y.push(n),r+=b.length,f+=R,b.forEach((d,D)=>{g.set(Qi(n,d.kind,D),{source:Rl(d,S,T),origin:n,kind:d.kind})}),w&&R>0)g.set(Qi(n,"template",0),{source:w.text,origin:n,kind:"template",virtual:w})}if(g.size===0)return{diagnostics:x,checkedFiles:y,blockCount:0,expressionCount:0};let k=(t.extraLibs??[]).map((n)=>h.resolve(n)),oe=ie(e.length>0?h.dirname(h.resolve(e[0])):process.cwd(),Ee,M);for(let n of oe?.libs??[])if(!k.includes(n)&&M(n))k.push(n);if(p)k.push(p);let G=p?Pl():null;if(G)k.push(G);let X=`${l()}/typecheck/__stx_globals.d.ts`,ce=["// Generated \u2014 the context serve.ts injects into <script server> blocks.",Cc(p?Ec(K(p,"utf8")):void 0),...p?[]:["declare const window: any",..._.map((n)=>`declare const ${n}: any`)],["// Generated \u2014 the names stx auto-imports from @stacksjs/browser.",...we.map((n)=>`declare const ${n}: any`)].join(`
|
|
13
|
+
`),ve(await po())].filter(Boolean).join(`
|
|
14
14
|
`),O=`${l()}/typecheck`;await Bun.$`rm -rf ${O}`.quiet().nothrow(),await Bun.$`mkdir -p ${O}`.quiet().nothrow(),await Bun.write(X,ce);let N=new Map,ae=0;for(let[n,o]of g){let b=`${ae++}_${n.replace(/[^\w.-]+/g,"_")}`;await Bun.write(`${O}/${b}`,o.source),N.set(b,o)}let le={target:"ESNext",module:"ESNext",moduleResolution:"bundler",strict:!0,noEmit:!0,skipLibCheck:!0,allowJs:!0,esModuleInterop:!0,resolveJsonModule:!0,lib:["ESNext","DOM","DOM.Iterable"],types:[],...Oe(e.length>0?h.dirname(h.resolve(e[0])):process.cwd()),...t.compilerOptions??{}},F=async(n,o)=>{let b=`${O}/tsconfig${o===1?"":`.${o}`}.json`;await Bun.write(b,JSON.stringify({compilerOptions:le,files:n.map((T)=>`${O}/${T}`).concat(X,...k)},null,2));let S=Bun.spawnSync(["bun","x","tsc","-p",b,"--pretty","false"],{stdout:"pipe",stderr:"pipe"});return{output:new TextDecoder().decode(S.stdout)+new TextDecoder().decode(S.stderr),exitCode:S.exitCode??0}},V=await F([...N.keys()],1),J=V.output,I=[],U=V.exitCode,W=0,ue=new Set(k.map((n)=>n.split("/").pop())),z=0,B=new Set,q=(n)=>{for(let o of n.replace(/\n[\t ]+([^\n]*)/g," $1").split(`
|
|
15
|
-
`)){let b=o.match(Te);if(!b)continue;if(W++,ue.has(b[1].split("/").pop()))z++;let[,S,T,w,R,d,D]=b,E=S.split("/").pop(),C=N.get(E);if(!C)continue;if(De(Number(d)))B.add(E);let A=Number(T),L=Number(w),Q;if(C.virtual){let P=
|
|
15
|
+
`)){let b=o.match(Te);if(!b)continue;if(W++,ue.has(b[1].split("/").pop()))z++;let[,S,T,w,R,d,D]=b,E=S.split("/").pop(),C=N.get(E);if(!C)continue;if(De(Number(d)))B.add(E);let A=Number(T),L=Number(w),Q;if(C.virtual){let P=Pc(C.virtual,A,L);if(!P?.expression)continue;if(Ac(P,Number(d)))continue;A=P.line,L=P.column,Q=P.expression.code.trim()}I.push({file:C.origin,line:A,column:L,code:Number(d),message:D,category:R==="error"?"error":"warning",blockKind:C.kind,expression:Q})}};q(J);let pe=W,de=z;if(B.size>0&&B.size<N.size){let n=[...N.keys()].filter((o)=>!B.has(o));q((await F(n,2)).output)}if(s)for(let[n,o]of m){if(o.names.length===0)continue;I.push({file:n,line:o.line,column:1,code:0,message:`${o.names.length===1?"1 value reaches":`${o.names.length} values reach`} this block on the implicit bridge and ${o.names.length===1?"is":"are"} untyped: ${o.names.join(", ")}. Declare them with defineClientPayload({ ${o.names.join(", ")} }) in the server block to have them checked.`,category:"warning",blockKind:o.kind})}I.push(...x);let H=new Set,j=I.filter((n)=>{let o=`${n.file}:${n.line}:${n.column}:${n.code}:${n.message}`;if(H.has(o))return!1;return H.add(o),!0});j.sort((n,o)=>n.file.localeCompare(o.file)||n.line-o.line||n.column-o.column);let Z=de>0&&j.length===0,fe=Z||U!==0&&pe===0?`${Z?"a file passed with --lib has errors of its own, so nothing in your code was checked":`tsc exited ${U} without reporting any diagnostic, so nothing was checked`}. `+"A syntax error in an ambient declaration file does this \u2014 skipLibCheck suppresses "+`SEMANTIC diagnostics only. tsc said:
|
|
16
16
|
${J.trim().split(`
|
|
17
17
|
`).slice(0,12).join(`
|
|
18
|
-
`)||"(no output)"}`:void 0;return{diagnostics:j,checkedFiles:y,blockCount:r,expressionCount:f,failure:fe}}function
|
|
18
|
+
`)||"(no output)"}`:void 0;return{diagnostics:j,checkedFiles:y,blockCount:r,expressionCount:f,failure:fe}}function jg(e){return e.map((t)=>{let s=t.blockKind==="template"?`[template: ${t.expression??""}]`:`[${t.blockKind==="plain"?"<script>":`<script ${t.blockKind}>`}]`;return`${t.file}:${t.line}:${t.column} ${t.category} TS${t.code} ${t.message} ${s}`}).join(`
|
|
19
19
|
`)}
|
|
20
|
-
export{
|
|
20
|
+
export{Rl,Qi,Mg,Al,Pl,Lg,jg};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{vl,wl}from"./chunk-mcynmrbe.js";import"./chunk-5ge5h2y3.js";import"./chunk-3ajnrfa2.js";import"./chunk-asp7ett1.js";import"./chunk-j04v4rgf.js";import"./chunk-geb6zyxg.js";import"./chunk-s4y26fk6.js";import"./chunk-yftw25sa.js";import"./chunk-00ns0516.js";import"./chunk-t6qn1374.js";import"./chunk-prej5pk6.js";import"./chunk-93j4atq9.js";import"./chunk-r4sawwmp.js";import"./chunk-gz38jt5j.js";import"./chunk-myynywry.js";import"./chunk-vh1d5eqk.js";import"./chunk-bsq9zg9j.js";import"./chunk-4npabwne.js";import"./chunk-hk98vptc.js";import"./chunk-a5d888es.js";import"./chunk-7g9vd5fv.js";import"./chunk-7r7j7vwt.js";import"./chunk-hmydy949.js";import"./chunk-gs6wc7sr.js";import"./chunk-w8p1y4c0.js";import"./chunk-tb56j1zt.js";import"./chunk-8n2gj4q2.js";import"./chunk-4m8bexrn.js";import"./chunk-76fcwbe1.js";import"./chunk-wp9y6x33.js";import"./chunk-pes27snj.js";import"./chunk-3nxe5xmy.js";import{Yt}from"./chunk-t5gabs4x.js";import"./chunk-r5jytt0f.js";import"./chunk-6n195hvc.js";import"./chunk-19safa6y.js";import{Re,i}from"./chunk-fpagqrd1.js";import"./chunk-x9haxcsj.js";import"./chunk-jt28zh50.js";import"./chunk-0jn79fkt.js";import"./chunk-nv9dy71x.js";import"./chunk-0e9xdrzx.js";import"./chunk-qn4gt8sx.js";import"./chunk-sgm6tg8h.js";import"./chunk-06zn167b.js";import{be}from"./chunk-0dkd26t4.js";import"./chunk-3kfbs0mw.js";import{ar,cr}from"./chunk-hmae7ha6.js";import{ms,j,a}from"./chunk-x1q2ape8.js";import"./chunk-1mfj2j5g.js";import"./chunk-yp6w740k.js";import"./chunk-5q9ss7ty.js";import"./chunk-3cn9y08d.js";import"./chunk-z8k3fx4r.js";import{m,Me}from"./chunk-m5fjhrpd.js";import"./chunk-b6g24qj0.js";import"./chunk-gs373714.js";import"./chunk-465resq9.js";import"./chunk-89h4snzd.js";import"./chunk-qwds327k.js";import"./chunk-dh9aagwm.js";import"./chunk-j4snweyz.js";export{ms as buildWebComponents,cr as cacheTemplate,ar as checkCache,Yt as classifyAllScripts,vl as createMiddleware,wl as createRoute,j as defaultConfig,m as extractVariables,be as injectRouterScript,a as loadStxConfig,Me as processClientScript,i as processDirectives,Re as readMarkdownFile};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ua,Ql,jn,om,eu,tu,nu,im}from"./chunk-4npabwne.js";import"./chunk-m5fjhrpd.js";import"./chunk-b6g24qj0.js";import"./chunk-gs373714.js";import"./chunk-465resq9.js";import"./chunk-89h4snzd.js";import"./chunk-qwds327k.js";export{jn as Validator,Ql as defineForm,eu as processErrorDirective,tu as processErrorsDirective,im as processFormValidationDirectives,nu as processHasErrorsDirective,ua as useForm,om as v};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{AsyncLocalStorage as R}from"async_hooks";var b=Symbol.for("stx.runtime-config.scope"),y=globalThis,m=y[b]??=new R;function Fe(n,f){return m.run(n,f)}function wn(){return m.getStore()}function
|
|
3
|
-
export{Fe,wn,
|
|
2
|
+
import{AsyncLocalStorage as R}from"async_hooks";var b=Symbol.for("stx.runtime-config.scope"),y=globalThis,m=y[b]??=new R;function Fe(n,f){return m.run(n,f)}function wn(){return m.getStore()}function Bs(){let n=m.getStore();if(!n)throw Error("useServerRuntimeConfig requires a server request or template render");return Object.freeze(Object.defineProperty({public:n.public},"private",{value:n.private}))}function mi(){return Bs().public}function O(n={},f=process.env){let s=new Set;function o(e,i){if(i===null)return e===null;if(Array.isArray(i))return Array.isArray(e)&&(!i.length||e.every((r)=>i.some((u)=>o(r,u))));if(typeof i==="object")return e!==null&&typeof e==="object"&&!Array.isArray(e)&&Object.entries(i).every(([r,u])=>Object.hasOwn(e,r)&&o(e[r],u));return typeof e===typeof i}function g(e,i){if(e&&typeof e==="object"&&!Array.isArray(e)){if(Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw TypeError(`Runtime config ${i.join(".")} must contain JSON values`);let t=Object.create(null);for(let[c,l]of Object.entries(e)){if(!/^[a-zA-Z][a-zA-Z0-9_]*$/.test(c)||["constructor","prototype","__proto__"].includes(c))throw TypeError(`Invalid runtime config key: ${c}`);t[c]=g(l,[...i,c])}return Object.freeze(t)}let r=`STX_RUNTIME_${i.map((t)=>t.replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase()).join("__")}`;if(s.has(r))throw TypeError(`Ambiguous runtime config environment key: ${r}`);s.add(r);let u=f[r],a=e;if(u!==void 0){try{a=typeof e==="string"?u:JSON.parse(u)}catch{throw TypeError(`Invalid runtime config override: ${r}`)}if(!o(a,e))throw TypeError(`Wrong runtime config override type: ${r}`)}function p(t){if(t===null||typeof t==="string"||typeof t==="boolean")return t;if(typeof t==="number"&&Number.isFinite(t))return t;if(Array.isArray(t))return Object.freeze(t.map(p));if(t&&typeof t==="object"&&(Object.getPrototypeOf(t)===Object.prototype||Object.getPrototypeOf(t)===null))return Object.freeze(Object.fromEntries(Object.entries(t).map(([c,l])=>[c,p(l)])));throw TypeError(`Runtime config ${i.join(".")} must contain JSON values`)}return p(a)}return Object.freeze({public:g(n.public??{},["public"]),private:g(n.private??{},["private"])})}function C(n){return`<script data-stx-scoped data-stx-runtime-config type="application/json">${JSON.stringify(n.public).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}</script>`}function Dt(n,f){let s=n.replace(/<script\b[^>]*\bdata-stx-runtime-config\b[^>]*>[\s\S]*?<\/script>/gi,""),o=/<head\b[^>]*>/i.exec(s),g=o?o.index+o[0].length:0;return s.slice(0,g)+C(f)+s.slice(g)}
|
|
3
|
+
export{Fe,wn,Bs,mi,O,Dt};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var c=0;function l(){return`suspense-${++c}-${Date.now().toString(36)}`}function
|
|
2
|
+
var c=0;function l(){return`suspense-${++c}-${Date.now().toString(36)}`}function Em(s,n={},t){let e=/@suspense(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@fallback\s*([\s\S]*?)@endsuspense/gi;return s.replace(e,(r,i,o,d)=>{let u=l(),a=p(i||"");return f(u,o.trim(),d.trim(),a)})}function p(s){let n={},t=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,e;while((e=t.exec(s))!==null){let r=e[1],i=e[2]||e[3],o=e[4];switch(r){case"id":n.id=i;break;case"timeout":n.timeout=o?parseInt(o,10):void 0;break}}return n}function f(s,n,t,e){let r=e.timeout||30000,i=e.id||s;return`
|
|
3
3
|
<div class="stx-suspense" data-suspense-id="${s}" data-custom-id="${i}" data-status="pending">
|
|
4
4
|
<div class="stx-suspense-fallback" data-suspense-fallback="${s}">
|
|
5
5
|
${t}
|
|
@@ -189,7 +189,7 @@ else {
|
|
|
189
189
|
}, 0);
|
|
190
190
|
})();
|
|
191
191
|
</script>
|
|
192
|
-
`}function
|
|
192
|
+
`}function Tm(s,n,t){return{id:s,fallback:t,content:n}}async function $m(s){let n=s.map((e)=>`
|
|
193
193
|
<div id="stx-ssr-suspense-${e.id}" class="stx-ssr-suspense">
|
|
194
194
|
${e.fallback}
|
|
195
195
|
</div>
|
|
@@ -214,7 +214,7 @@ else {
|
|
|
214
214
|
}
|
|
215
215
|
})();
|
|
216
216
|
</script>
|
|
217
|
-
`}}return{initial:n,streaming:t()}}function
|
|
217
|
+
`}}return{initial:n,streaming:t()}}function Rm(){return`
|
|
218
218
|
/* STX Suspense Styles */
|
|
219
219
|
.stx-suspense {
|
|
220
220
|
position: relative;
|
|
@@ -270,7 +270,7 @@ else {
|
|
|
270
270
|
background-size: 200% 100%;
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
|
-
`}function
|
|
273
|
+
`}function Am(){return`
|
|
274
274
|
// STX Suspense Runtime
|
|
275
275
|
(function() {
|
|
276
276
|
if (typeof window === 'undefined') return;
|
|
@@ -338,4 +338,4 @@ else {
|
|
|
338
338
|
console.log('[stx] Suspense runtime initialized');
|
|
339
339
|
})();
|
|
340
340
|
`}
|
|
341
|
-
export{
|
|
341
|
+
export{Em,Tm,$m,Rm,Am};
|