@stacksjs/stx 0.2.482 → 0.2.484
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-4ebwk9cw.js → chunk-01rz8h7x.js} +2 -2
- package/dist/{chunk-tr25zcf1.js → chunk-0egg3666.js} +9 -9
- package/dist/chunk-0fad6jf4.js +2 -0
- package/dist/chunk-0jfrzq0r.js +2 -0
- package/dist/{chunk-1m9v96z5.js → chunk-0ma6yhg9.js} +6 -6
- package/dist/{chunk-49h8ke5d.js → chunk-0ttq5enq.js} +1 -1
- package/dist/chunk-0vdxchfw.js +2 -0
- package/dist/{chunk-cgf2a166.js → chunk-1c407nky.js} +5 -5
- package/dist/{chunk-99kt56fn.js → chunk-1erc0vrb.js} +2 -2
- package/dist/chunk-1hpttjgq.js +2 -0
- package/dist/chunk-1mrn5s5z.js +2 -0
- package/dist/{chunk-v5rgebzz.js → chunk-1v86h5vn.js} +5 -5
- package/dist/chunk-1yckkva7.js +2 -0
- package/dist/{chunk-44dk5bb5.js → chunk-24jeywdh.js} +41 -41
- package/dist/chunk-258qj7pt.js +2 -0
- package/dist/{chunk-1z26g0cf.js → chunk-25m2wqsd.js} +6 -6
- package/dist/{chunk-28s5x7wv.js → chunk-298s08st.js} +2 -2
- package/dist/{chunk-eg5djbse.js → chunk-2cybh8dh.js} +2 -2
- package/dist/chunk-2fb4yx25.js +4 -0
- package/dist/chunk-2grygc4b.js +2 -0
- package/dist/{chunk-hq97tyb6.js → chunk-2hbygqzj.js} +2 -2
- package/dist/{chunk-8scw1bes.js → chunk-2hc5mbw8.js} +2 -2
- package/dist/{chunk-zpcxx4pp.js → chunk-2kyfaa0p.js} +2 -2
- package/dist/{chunk-ab7vh24b.js → chunk-2pph3dh0.js} +6 -6
- package/dist/{chunk-cd6hz56r.js → chunk-34154wz1.js} +5 -5
- package/dist/chunk-368zt1db.js +2 -0
- package/dist/{chunk-sarr8kz1.js → chunk-3mynjdqr.js} +6 -6
- package/dist/{chunk-5t5ahhjp.js → chunk-3s9s1mdt.js} +3 -3
- package/dist/chunk-3vqabd10.js +2 -0
- package/dist/chunk-490f2x2r.js +2 -0
- package/dist/chunk-4b5hg8y1.js +2 -0
- package/dist/{chunk-33h9ggbz.js → chunk-4c1afy15.js} +4 -4
- package/dist/{chunk-tfexmdkt.js → chunk-4drgbkga.js} +2 -2
- package/dist/chunk-4j2ej7er.js +2 -0
- package/dist/chunk-4k65naeg.js +2 -0
- package/dist/{chunk-cgszdc9m.js → chunk-4snv0gm8.js} +4 -4
- package/dist/chunk-5cd0jbt4.js +2 -0
- package/dist/{chunk-b1kdmkk8.js → chunk-5f7qy42x.js} +247 -266
- package/dist/{chunk-vvs75dse.js → chunk-67actssw.js} +2 -2
- package/dist/chunk-69dc3tyz.js +2 -0
- package/dist/chunk-6ejfx4qw.js +2 -0
- package/dist/{chunk-7ejq9n1v.js → chunk-71bbv43t.js} +4 -4
- package/dist/{chunk-7grtpdw5.js → chunk-7cbtcdqw.js} +2 -2
- package/dist/chunk-7wxmsv41.js +2 -0
- package/dist/{chunk-ah4qyrnn.js → chunk-802qf0vz.js} +1 -1
- package/dist/chunk-8b71njp8.js +30 -0
- package/dist/{chunk-2542vq5p.js → chunk-8fb1mqw1.js} +1 -1
- package/dist/{chunk-f4v80grv.js → chunk-8j8egh39.js} +3 -3
- package/dist/{chunk-6vn4pa76.js → chunk-93wkn776.js} +1 -1
- package/dist/chunk-9ds5dn6f.js +2 -0
- package/dist/chunk-9mywx2x0.js +2 -0
- package/dist/chunk-9s3tf3m3.js +2 -0
- package/dist/{chunk-jxrnagej.js → chunk-aabzyk88.js} +5 -5
- package/dist/chunk-ah4ww997.js +2 -0
- package/dist/chunk-avq5209p.js +2 -0
- package/dist/chunk-b0bgprzs.js +2 -0
- package/dist/chunk-b77v56fz.js +24 -0
- package/dist/{chunk-rycvcgkc.js → chunk-baprpeby.js} +3 -3
- package/dist/{chunk-bvhr055w.js → chunk-bv7bsdfe.js} +2 -2
- package/dist/{chunk-wkc34drs.js → chunk-c57j92td.js} +2 -2
- package/dist/chunk-c7cajwd2.js +2 -0
- package/dist/{chunk-8rx2v7zj.js → chunk-c8psbk2e.js} +1 -1
- package/dist/chunk-ckrpk6ak.js +2 -0
- package/dist/{chunk-3fjpg8kb.js → chunk-cp7hph6f.js} +3 -3
- package/dist/{chunk-80hpdc22.js → chunk-d19vgjjt.js} +2 -2
- package/dist/{chunk-pf0d8y9n.js → chunk-d4k4nyj0.js} +2 -2
- package/dist/{chunk-04qmr675.js → chunk-e62nw7zk.js} +2 -2
- package/dist/{chunk-pcq6vphz.js → chunk-e6y6s7q8.js} +2 -2
- package/dist/chunk-egax8990.js +2 -0
- package/dist/chunk-en0atzsp.js +2 -0
- package/dist/{chunk-2gmbxp60.js → chunk-er7y8hk9.js} +3 -3
- package/dist/chunk-ezvy497d.js +2 -0
- package/dist/chunk-f0prq6yw.js +2 -0
- package/dist/chunk-ftdabyt6.js +2 -0
- package/dist/chunk-g7ey7mtw.js +3 -0
- package/dist/chunk-g7jcpd5j.js +2 -0
- package/dist/chunk-gty89j8s.js +2 -0
- package/dist/{chunk-t7s0pdtw.js → chunk-gzt3ghgq.js} +3 -3
- package/dist/{chunk-3pv6f998.js → chunk-h6q8jafh.js} +2 -2
- package/dist/chunk-hem4ak5x.js +2 -0
- package/dist/{chunk-kp5tv8jx.js → chunk-hkjqqx92.js} +3 -3
- package/dist/{chunk-29pn79t5.js → chunk-hktvv0hd.js} +2 -2
- package/dist/chunk-hmyyq2hh.js +2 -0
- package/dist/{chunk-j2zgh5yk.js → chunk-hqvdm4h9.js} +2 -2
- package/dist/chunk-hsywkvng.js +2 -0
- package/dist/chunk-j2q2pp0x.js +2 -0
- package/dist/chunk-jbj6xh7f.js +3 -0
- package/dist/{chunk-33gkx5z1.js → chunk-jbvg29t0.js} +7 -7
- package/dist/chunk-jd9c46cc.js +2 -0
- package/dist/{chunk-kzzjk2mx.js → chunk-jva1bbpw.js} +10 -10
- package/dist/{chunk-27kb6nrb.js → chunk-jwjggr91.js} +2 -2
- package/dist/chunk-kkn0m1eg.js +2 -0
- package/dist/{chunk-j4afmryj.js → chunk-kp4mzspk.js} +4 -4
- package/dist/chunk-njpxfd44.js +2 -0
- package/dist/{chunk-7kjkmvrn.js → chunk-nr7qak48.js} +2 -2
- package/dist/{chunk-q9996m6n.js → chunk-nxxmhrd0.js} +2 -2
- package/dist/chunk-p5bwcppv.js +2 -0
- package/dist/chunk-p5pna1sn.js +2 -0
- package/dist/chunk-p6trwjap.js +2 -0
- package/dist/{chunk-8emc4aq5.js → chunk-qk5j55r0.js} +5 -5
- package/dist/chunk-qmcmjdy7.js +65 -0
- package/dist/{chunk-91jyax19.js → chunk-qv3rrz9a.js} +11 -11
- package/dist/chunk-rbsn2vf5.js +2 -0
- package/dist/chunk-rcn6m3cj.js +2 -0
- package/dist/chunk-rd2w20hg.js +2 -0
- package/dist/{chunk-5x9ftmve.js → chunk-rhrv2j36.js} +2 -2
- package/dist/{chunk-9ztdvnkk.js → chunk-rmavqxd8.js} +4 -4
- package/dist/chunk-rn2w32kh.js +2 -0
- package/dist/{chunk-q8pn42an.js → chunk-rn4cppcj.js} +4 -4
- package/dist/chunk-rt71qxdq.js +2 -0
- package/dist/chunk-s6v5p03w.js +2 -0
- package/dist/{chunk-k4shjm8n.js → chunk-s9mq9x2k.js} +5 -5
- package/dist/chunk-svywp38a.js +2 -0
- package/dist/chunk-sybzayv3.js +2 -0
- package/dist/{chunk-8adstrk5.js → chunk-szry3s17.js} +3 -3
- package/dist/chunk-tse7jzmz.js +2 -0
- package/dist/chunk-tvag2s5a.js +2 -0
- package/dist/{chunk-01nx6zcw.js → chunk-v7vkqg8f.js} +2 -2
- package/dist/chunk-vbhykx9z.js +2 -0
- package/dist/{chunk-se55qe2x.js → chunk-vg9dyc4y.js} +1 -1
- package/dist/{chunk-zkg0rbmp.js → chunk-vp827ah7.js} +6 -6
- package/dist/chunk-vr0fb0x1.js +2 -0
- package/dist/{chunk-bqx3dqv1.js → chunk-vs0ebfg5.js} +1 -1
- package/dist/chunk-vwybce48.js +2 -0
- package/dist/chunk-vzxkwr23.js +2 -0
- package/dist/{chunk-ak95401g.js → chunk-x8mp9yvn.js} +3 -3
- package/dist/{chunk-b8p9y1kv.js → chunk-xevnx24r.js} +2 -2
- package/dist/chunk-xfxrh6vx.js +2 -0
- package/dist/{chunk-960axmf7.js → chunk-yhv65tpd.js} +2 -2
- package/dist/chunk-yxgfw906.js +2 -0
- package/dist/chunk-z6nm6rf1.js +2 -0
- package/dist/{chunk-cxbp2m66.js → chunk-z9fz5dby.js} +5 -5
- package/dist/{chunk-gkj42zq7.js → chunk-z9tvn738.js} +2 -2
- package/dist/{chunk-abts223v.js → chunk-zkjp87ak.js} +3 -3
- package/dist/{chunk-w6n2j62h.js → chunk-zv0vgamy.js} +3 -3
- package/dist/cli.js +20 -20
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/document-shell.d.ts +11 -0
- package/dist/document-shell.js +11 -3
- package/dist/head.js +2 -1
- package/dist/native/bridge/protocol.d.ts +2 -1
- package/dist/native/bridge/protocol.js +9 -1
- package/dist/native/runtime/craft-bridge.js +24 -3
- package/dist/native/runtime/craft.d.ts +9 -0
- package/dist/pwa.js +3 -3
- package/dist/seo.d.ts +16 -0
- package/dist/seo.js +9 -6
- package/dist/ssg.js +13 -13
- package/package.json +5 -5
- package/dist/chunk-0e1rga0j.js +0 -2
- package/dist/chunk-0jp07cjs.js +0 -2
- package/dist/chunk-1kkyg54v.js +0 -2
- package/dist/chunk-2njt4vbe.js +0 -2
- package/dist/chunk-3aw80qrg.js +0 -2
- package/dist/chunk-3gbjppvg.js +0 -2
- package/dist/chunk-3nq94g1b.js +0 -2
- package/dist/chunk-4aw47rmg.js +0 -2
- package/dist/chunk-50vq8k55.js +0 -2
- package/dist/chunk-5fvzzqa3.js +0 -2
- package/dist/chunk-5pjsc9zv.js +0 -3
- package/dist/chunk-5sb7gw66.js +0 -2
- package/dist/chunk-5y4qxmaw.js +0 -2
- package/dist/chunk-7mh0fnrq.js +0 -2
- package/dist/chunk-8mxjd1ge.js +0 -2
- package/dist/chunk-8xvrcwtk.js +0 -2
- package/dist/chunk-969np51a.js +0 -2
- package/dist/chunk-9kzk7zyy.js +0 -2
- package/dist/chunk-9vqz2m13.js +0 -2
- package/dist/chunk-ap9nnv9z.js +0 -2
- package/dist/chunk-bw0gkfb3.js +0 -2
- package/dist/chunk-d20gxzk9.js +0 -2
- package/dist/chunk-db2sy0f3.js +0 -2
- package/dist/chunk-dbj4sn74.js +0 -2
- package/dist/chunk-dts9z53c.js +0 -2
- package/dist/chunk-ecr642nj.js +0 -2
- package/dist/chunk-eev60q15.js +0 -2
- package/dist/chunk-ep7hz9af.js +0 -2
- package/dist/chunk-fe5xht52.js +0 -2
- package/dist/chunk-fqhewm3t.js +0 -2
- package/dist/chunk-gzbzfndm.js +0 -2
- package/dist/chunk-hgcvtfnz.js +0 -2
- package/dist/chunk-j338fs8k.js +0 -2
- package/dist/chunk-jbmwm6k4.js +0 -2
- package/dist/chunk-jvdren00.js +0 -2
- package/dist/chunk-k7t0rmzy.js +0 -2
- package/dist/chunk-k84qkm21.js +0 -2
- package/dist/chunk-kd7m4d0g.js +0 -2
- package/dist/chunk-kk5cyjfs.js +0 -3
- package/dist/chunk-kmf7yh91.js +0 -2
- package/dist/chunk-m5dgc757.js +0 -2
- package/dist/chunk-m8w4hve0.js +0 -2
- package/dist/chunk-mhwptrvm.js +0 -2
- package/dist/chunk-mmh37ywa.js +0 -2
- package/dist/chunk-ms5aj58v.js +0 -2
- package/dist/chunk-n454sydr.js +0 -2
- package/dist/chunk-pd5r4j8r.js +0 -2
- package/dist/chunk-pe9bvwqn.js +0 -30
- package/dist/chunk-pt566gqb.js +0 -2
- package/dist/chunk-q4wpzj1f.js +0 -2
- package/dist/chunk-qtsymvxx.js +0 -2
- package/dist/chunk-r54tkwpc.js +0 -2
- package/dist/chunk-ra321t5d.js +0 -2
- package/dist/chunk-s10r6hxp.js +0 -64
- package/dist/chunk-sqjdb265.js +0 -2
- package/dist/chunk-st1s30tn.js +0 -2
- package/dist/chunk-tbef3yyk.js +0 -5
- package/dist/chunk-v7ahbhbd.js +0 -2
- package/dist/chunk-v9t3z8nm.js +0 -2
- package/dist/chunk-vcs1fx8e.js +0 -2
- package/dist/chunk-w0vrmvh7.js +0 -2
- package/dist/chunk-w28c9st3.js +0 -2
- package/dist/chunk-x73mzzm8.js +0 -2
- package/dist/chunk-xnjcmhs5.js +0 -4
- package/dist/chunk-yed9c66h.js +0 -2
- package/dist/chunk-zb5p05v4.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var{WebView:p}=globalThis.Bun;import{existsSync as y,mkdirSync as b,readdirSync as v,statSync as S}from"fs";import l from"path";var h=16384;function M(e){if(/^https?:\/\//.test(e)||e.startsWith("file://"))return e;return`file://${l.resolve(e)}`}function g(e,n,t,o){return new Promise((s)=>{let i=!1,r,m,c=()=>{if(!i){if(i=!0,clearTimeout(m),r)clearTimeout(r);e.onNavigated=void 0,s()}};m=setTimeout(c,o),e.onNavigated=()=>{if(!i)r=setTimeout(c,t)};try{let u=e.navigate(n);if(u&&typeof u.catch==="function")u.catch(c)}catch{c()}})}async function w(e,n,t){let o=`!!document.querySelector(${JSON.stringify(n)})`,s=Date.now()+t;while(Date.now()<s){try{if(await e.evaluate(o))return}catch{}await new Promise((i)=>setTimeout(i,100))}}async function T(e){try{let n=await e.evaluate("Math.ceil(Math.max(document.documentElement.scrollHeight, document.documentElement.offsetHeight, document.body ? document.body.scrollHeight : 0, document.body ? document.body.offsetHeight : 0))");return typeof n==="number"&&Number.isFinite(n)&&n>0?Math.min(n,h):0}catch{return 0}}async function
|
|
3
|
-
export{
|
|
2
|
+
var{WebView:p}=globalThis.Bun;import{existsSync as y,mkdirSync as b,readdirSync as v,statSync as S}from"fs";import l from"path";var h=16384;function M(e){if(/^https?:\/\//.test(e)||e.startsWith("file://"))return e;return`file://${l.resolve(e)}`}function g(e,n,t,o){return new Promise((s)=>{let i=!1,r,m,c=()=>{if(!i){if(i=!0,clearTimeout(m),r)clearTimeout(r);e.onNavigated=void 0,s()}};m=setTimeout(c,o),e.onNavigated=()=>{if(!i)r=setTimeout(c,t)};try{let u=e.navigate(n);if(u&&typeof u.catch==="function")u.catch(c)}catch{c()}})}async function w(e,n,t){let o=`!!document.querySelector(${JSON.stringify(n)})`,s=Date.now()+t;while(Date.now()<s){try{if(await e.evaluate(o))return}catch{}await new Promise((i)=>setTimeout(i,100))}}async function T(e){try{let n=await e.evaluate("Math.ceil(Math.max(document.documentElement.scrollHeight, document.documentElement.offsetHeight, document.body ? document.body.scrollHeight : 0, document.body ? document.body.offsetHeight : 0))");return typeof n==="number"&&Number.isFinite(n)&&n>0?Math.min(n,h):0}catch{return 0}}async function ra(e,n,t={}){let o=Math.min(t.width??1440,h),s=Math.min(t.height??2200,h),i=t.waitMs??800,r=t.timeoutMs??15000,m=t.format??"png",c=M(e),u=(f)=>new p({width:o,height:f,headless:!0,...t.backend?{backend:t.backend}:{}}),a=u(s);try{if(await g(a,c,i,r),t.waitSelector)await w(a,t.waitSelector,r);if(t.fullPage){let d=await T(a);if(d>s){if(a.close(),a=u(d),await g(a,c,i,r),t.waitSelector)await w(a,t.waitSelector,r)}}let f=await a.screenshot({encoding:"buffer",format:m});b(l.dirname(l.resolve(n)),{recursive:!0}),await Bun.write(n,f)}finally{a.close()}if(!y(n))throw Error(`Screenshot was not produced for ${e}`);return{input:e,output:n,bytes:S(n).size}}async function il(e,n,t={}){b(n,{recursive:!0});let o;if(!/^https?:\/\//.test(e)&&y(e)&&S(e).isDirectory())o=v(e).filter((r)=>r.endsWith(".html")).map((r)=>l.join(e,r));else o=[e];let s=t.format??"png",i=[];for(let r of o){let m=/^https?:\/\//.test(r)?new URL(r).pathname.replace(/\W+/g,"-").replace(/^-|-$/g,"")||"index":l.basename(r).replace(/\.html?$/,"");i.push(await ra(r,l.join(n,`${m}.${s}`),t))}return i}
|
|
3
|
+
export{ra,il};
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import S from"fs";import _ from"path";function
|
|
2
|
+
import S from"fs";import _ from"path";function wr(e){let{token:t,baseUrl:i="https://api.netlify.com/api/v1"}=e;async function s(n,r,l={}){let p=`${i}${r}`,f={Authorization:`Bearer ${t}`,"User-Agent":"stx-deploy/1.0"},u;if(l.rawBody)f["Content-Type"]=l.contentType||"application/octet-stream",u=l.rawBody;else if(l.body)f["Content-Type"]="application/json",u=JSON.stringify(l.body);let o=await fetch(p,{method:n,headers:f,body:u});if(!o.ok){let g=Error(`Netlify API error: ${o.status} ${o.statusText}`);g.status=o.status;try{let b=await o.json();g.message=b.message||g.message,g.code=b.code,g.details=b}catch{}throw g}let a=await o.text();if(!a)return{};return JSON.parse(a)}return{async getSite(n){return s("GET",`/sites/${n}`)},async listSites(){return s("GET","/sites")},async createSite(n){let r={};if(n)r.name=n;return s("POST","/sites",{body:r})},async createDeploy(n,r){let l={files:r.files,draft:r.draft??!0,async:r.async??!0};if(r.title)l.title=r.title;if(r.branch)l.branch=r.branch;if(r.functions)l.functions=r.functions;return s("POST",`/sites/${n}/deploys`,{body:l})},async uploadFile(n,r,l){let p=r.startsWith("/")?r.slice(1):r;await s("PUT",`/deploys/${n}/files/${p}`,{rawBody:l,contentType:"application/octet-stream"})},async uploadFiles(n,r){let p=[...r],f=async()=>{while(p.length>0){let o=p.shift();if(o)await this.uploadFile(n,o.path,o.content)}},u=Array.from({length:Math.min(5,r.length)},()=>f());await Promise.all(u)},async getDeploy(n){return s("GET",`/deploys/${n}`)},async waitForDeploy(n,r={}){let{timeout:l=300000,pollInterval:p=2000,onProgress:f}=r,u=Date.now();while(!0){let o=await this.getDeploy(n);if(f)f(o);if(o.state==="ready")return o;if(o.state==="error"){let a=Error(`Deploy failed: ${o.error_message||"Unknown error"}`);throw a.status=500,a.details=o,a}if(Date.now()-u>l){let a=Error(`Deploy timed out after ${l}ms`);throw a.status=408,a.details=o,a}await new Promise((a)=>setTimeout(a,p))}},async lockDeploy(n){return s("POST",`/deploys/${n}/lock`)},async unlockDeploy(n){return s("POST",`/deploys/${n}/unlock`)}}}async function eo(e){let t=await crypto.subtle.digest("SHA-1",e);return Array.from(new Uint8Array(t)).map((s)=>s.toString(16).padStart(2,"0")).join("")}async function _n(e,t={}){let{ignore:i=["node_modules",".git",".env*","*.map"]}=t,s=[],n=new Bun.Glob("**/*");for await(let r of n.scan({cwd:e,onlyFiles:!0,dot:!1})){if(i.some((a)=>{if(a.includes("*"))return new RegExp(`^${a.replace(/\*/g,".*")}$`).test(r);return r.includes(a)}))continue;let p=`${e}/${r}`,u=await Bun.file(p).arrayBuffer(),o=await eo(u);s.push({path:r,content:new Uint8Array(u),sha1:o})}return s}function vr(e){let t={};for(let i of e)t[`/${i.path}`]=i.sha1;return t}function xr(e,t){let i=new Set(t.map((s)=>s.startsWith("/")?s.slice(1):s));return e.filter((s)=>i.has(s.path))}function Dt(e){if(e<1024)return`${e} B`;if(e<1048576)return`${(e/1024).toFixed(1)} KB`;if(e<1073741824)return`${(e/1048576).toFixed(1)} MB`;return`${(e/1073741824).toFixed(1)} GB`}function ut(e){return e.reduce((t,i)=>t+i.content.byteLength,0)}import m from"fs";import y from"path";function to(e){let t=[];if(t.push("[build]"),t.push(` command = "${d(e.build.command)}"`),t.push(` publish = "${d(e.build.publish)}"`),e.build.functions)t.push(` functions = "${d(e.build.functions)}"`);if(e.build.edge_functions)t.push(` edge_functions = "${d(e.build.edge_functions)}"`);if(e.build.environment&&Object.keys(e.build.environment).length>0){t.push(""),t.push("[build.environment]");for(let[i,s]of Object.entries(e.build.environment))t.push(` ${i} = "${d(s)}"`)}if(e.functions){if(t.push(""),t.push("[functions]"),e.functions.directory)t.push(` directory = "${d(e.functions.directory)}"`);if(e.functions.node_bundler)t.push(` node_bundler = "${e.functions.node_bundler}"`);if(e.functions.external_node_modules&&e.functions.external_node_modules.length>0)t.push(` external_node_modules = [${e.functions.external_node_modules.map((i)=>`"${i}"`).join(", ")}]`)}if(e.edge_functions&&e.edge_functions.length>0){t.push("");for(let i of e.edge_functions)t.push("[[edge_functions]]"),t.push(` function = "${d(i.function)}"`),t.push(` path = "${d(i.path)}"`)}if(e.redirects&&e.redirects.length>0){t.push("");for(let i of e.redirects){if(t.push("[[redirects]]"),t.push(` from = "${d(i.from)}"`),t.push(` to = "${d(i.to)}"`),i.status!==void 0)t.push(` status = ${i.status}`);if(i.force!==void 0)t.push(` force = ${i.force}`);if(i.conditions&&Object.keys(i.conditions).length>0){t.push(" [redirects.conditions]");for(let[s,n]of Object.entries(i.conditions))t.push(` ${s} = "${d(n)}"`)}}}if(e.headers&&e.headers.length>0){t.push("");for(let i of e.headers){t.push("[[headers]]"),t.push(` for = "${d(i.for)}"`),t.push(" [headers.values]");for(let[s,n]of Object.entries(i.values))t.push(` ${s} = "${d(n)}"`)}}if(e.plugins&&e.plugins.length>0){t.push("");for(let i of e.plugins)if(t.push("[[plugins]]"),t.push(` package = "${d(i.package)}"`),i.inputs&&Object.keys(i.inputs).length>0){t.push(" [plugins.inputs]");for(let[s,n]of Object.entries(i.inputs))if(typeof n==="string")t.push(` ${s} = "${d(n)}"`);else if(typeof n==="boolean"||typeof n==="number")t.push(` ${s} = ${n}`)}}if(e.context&&Object.keys(e.context).length>0)for(let[i,s]of Object.entries(e.context)){if(t.push(""),t.push(`[context.${i}]`),s.command)t.push(` command = "${d(s.command)}"`);if(s.publish)t.push(` publish = "${d(s.publish)}"`);if(s.environment&&Object.keys(s.environment).length>0){t.push(` [context.${i}.environment]`);for(let[n,r]of Object.entries(s.environment))t.push(` ${n} = "${d(r)}"`)}}return t.join(`
|
|
3
3
|
`)+`
|
|
4
|
-
`}function d(e){return e.replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}async function
|
|
4
|
+
`}function d(e){return e.replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}async function Tn(e){let t={framework:"stx",buildCommand:"bun run build",outputDir:"dist"},i=y.join(e,"package.json");if(await Bun.file(i).exists())try{let u=JSON.parse(await Bun.file(i).text());if(u.scripts?.build)t.buildCommand="bun run build";let o={...u.dependencies,...u.devDependencies};if(o["@stacksjs/stx"]||o.stx)t.framework="stx"}catch{}let s=y.join(e,"stx.config.ts"),n=y.join(e,".config","stx.config.ts");if(await Bun.file(s).exists()||await Bun.file(n).exists())t.framework="stx";let r=["dist","build","out","public",".output"];for(let u of r){let o=y.join(e,u);if(m.existsSync(o)&&m.statSync(o).isDirectory()){t.outputDir=u;break}}let l=["functions","netlify/functions","api"];for(let u of l){let o=y.join(e,u);if(m.existsSync(o)&&m.statSync(o).isDirectory()){t.functionsDir=u;break}}let p=y.join(e,"netlify","edge-functions");if(m.existsSync(p))t.edgeFunctionsDir="netlify/edge-functions";let f=y.join(e,t.outputDir||"dist");if(m.existsSync(f)){let u=m.existsSync(y.join(f,"index.html")),o=m.readdirSync(f).filter((a)=>a.endsWith(".html"));t.isSPA=u&&o.length===1}return t}function Rn(e={}){let t={build:{command:e.buildCommand||"bun run build",publish:e.outputDir||"dist"}};if(e.functionsDir)t.build.functions=e.functionsDir,t.functions={directory:e.functionsDir,node_bundler:"esbuild"};if(e.edgeFunctionsDir)t.build.edge_functions=e.edgeFunctionsDir;if(t.headers=[{for:"/*",values:{"X-Frame-Options":"DENY","X-Content-Type-Options":"nosniff","X-XSS-Protection":"1; mode=block","Referrer-Policy":"strict-origin-when-cross-origin"}},{for:"/assets/*",values:{"Cache-Control":"public, max-age=31536000, immutable"}}],e.isSPA!==!1)t.redirects=[{from:"/*",to:"/index.html",status:200}];return t.context={production:{environment:{NODE_ENV:"production"}},"deploy-preview":{environment:{NODE_ENV:"development"}}},t}async function Sr(e,t){let i=await Tn(e),s=t||Rn(i),n=to(s),r=y.join(e,"netlify.toml");return await Bun.write(r,n),r}function kr(e){return m.existsSync(y.join(e,"netlify.toml"))}async function el(e={}){let t=Date.now(),i=[],s=e.cwd||process.cwd(),n=(c)=>{i.push(c)},r=(c)=>{if(e.onProgress)e.onProgress(c)},l=_.resolve(s,e.directory||"dist"),p=e.token||process.env.NETLIFY_AUTH_TOKEN,f=e.siteId||process.env.NETLIFY_SITE_ID;if(!p)throw new Re(`No Netlify auth token found.
|
|
5
5
|
|
|
6
6
|
To deploy to Netlify:
|
|
7
7
|
1. Create account at https://app.netlify.com
|
|
8
8
|
2. Get token at https://app.netlify.com/user/applications#personal-access-tokens
|
|
9
9
|
3. Set NETLIFY_AUTH_TOKEN environment variable
|
|
10
10
|
|
|
11
|
-
export NETLIFY_AUTH_TOKEN=your_token_here`,"NO_TOKEN");if(!f)throw new
|
|
11
|
+
export NETLIFY_AUTH_TOKEN=your_token_here`,"NO_TOKEN");if(!f)throw new Re(`No Netlify site ID found.
|
|
12
12
|
|
|
13
13
|
Either:
|
|
14
14
|
1. Set NETLIFY_SITE_ID environment variable
|
|
15
15
|
2. Pass --site-id option
|
|
16
16
|
3. Run \`stx deploy --init\` to set up
|
|
17
17
|
|
|
18
|
-
Find your site ID at: https://app.netlify.com/sites/YOUR_SITE/settings/general`,"NO_SITE_ID");if(!S.existsSync(l))throw new
|
|
18
|
+
Find your site ID at: https://app.netlify.com/sites/YOUR_SITE/settings/general`,"NO_SITE_ID");if(!S.existsSync(l))throw new Re(`Build directory not found: ${l}
|
|
19
19
|
|
|
20
|
-
Run \`stx build\` first or specify a different directory with --directory`,"NO_BUILD_DIR");if(!(S.readdirSync(l).length>0))throw new
|
|
20
|
+
Run \`stx build\` first or specify a different directory with --directory`,"NO_BUILD_DIR");if(!(S.readdirSync(l).length>0))throw new Re(`Build directory is empty: ${l}
|
|
21
21
|
|
|
22
|
-
Run \`stx build\` to generate files`,"EMPTY_BUILD_DIR");if(e.dryRun){r({stage:"collect",message:"Collecting files..."});let c=await
|
|
22
|
+
Run \`stx build\` to generate files`,"EMPTY_BUILD_DIR");if(e.dryRun){r({stage:"collect",message:"Collecting files..."});let c=await _n(l),w=ut(c);return n(`Would deploy ${c.length} files (${Dt(w)})`),n(`From: ${l}`),n(`To: Site ${f}`),n(`Mode: ${e.production?"production":"draft"}`),{success:!0,url:`https://${f}.netlify.app (dry-run)`,deployId:"dry-run",logs:i,duration:Date.now()-t,filesUploaded:c.length,totalSize:w}}let o=wr({token:p});r({stage:"collect",message:"Verifying site..."});try{let c=await o.getSite(f);n(`Deploying to: ${c.name} (${c.url})`)}catch(c){if(c.status===404)throw new Re(`Site not found: ${f}
|
|
23
23
|
|
|
24
|
-
Check your site ID or create a new site at https://app.netlify.com`,"SITE_NOT_FOUND");throw c}r({stage:"collect",message:"Collecting files..."});let a=await
|
|
24
|
+
Check your site ID or create a new site at https://app.netlify.com`,"SITE_NOT_FOUND");throw c}r({stage:"collect",message:"Collecting files..."});let a=await _n(l),g=ut(a);if(n(`Found ${a.length} files (${Dt(g)})`),a.length===0)throw new Re(`No files found in ${l}`,"NO_FILES");let b=vr(a);r({stage:"upload",message:"Creating deploy...",percent:0});let D=await o.createDeploy(f,{title:e.message||"Deploy from stx CLI",draft:!e.production,files:b});n(`Created deploy: ${D.id}`);let h=xr(a,D.required||[]);if(n(`Uploading ${h.length} files...`),h.length>0){let c=0,w=ut(h);for(let x of h){await o.uploadFile(D.id,x.path,x.content),c++;let C=Math.round(c/h.length*100);r({stage:"upload",message:`Uploading: ${x.path}`,percent:C,details:{uploaded:c,total:h.length}})}n(`Uploaded ${Dt(w)}`)}else n("All files already on CDN (no upload needed)");r({stage:"process",message:"Processing deploy..."});let N=await o.waitForDeploy(D.id,{onProgress:(c)=>{r({stage:"process",message:`Status: ${c.state}`,details:c})}}),P=Date.now()-t;if(r({stage:"done",message:"Deploy complete!"}),n(`Deploy complete in ${(P/1000).toFixed(1)}s`),n(`URL: ${N.deploy_ssl_url}`),e.production)n(`Site: ${N.ssl_url}`);if(e.open){let c=e.production?N.ssl_url:N.deploy_ssl_url;I(c)}return{success:!0,url:N.deploy_ssl_url,siteUrl:e.production?N.ssl_url:void 0,deployId:N.id,logs:i,duration:P,filesUploaded:h.length,totalSize:ut(h)}}async function tl(e={}){let t=e.directory||process.cwd(),i;if(kr(t))i=_.join(t,"netlify.toml");else{let s=await Tn(t);i=await Sr(t,Rn(s))}if(e.siteId){let s=_.join(t,".env.local"),n="";if(await Bun.file(s).exists()){if(n=await Bun.file(s).text(),n=n.split(`
|
|
25
25
|
`).filter((r)=>!r.startsWith("NETLIFY_SITE_ID=")).join(`
|
|
26
26
|
`),n&&!n.endsWith(`
|
|
27
27
|
`))n+=`
|
|
28
28
|
`}n+=`NETLIFY_SITE_ID=${e.siteId}
|
|
29
|
-
`,await Bun.write(s,n)}return{configPath:i,siteId:e.siteId}}class
|
|
30
|
-
export{
|
|
29
|
+
`,await Bun.write(s,n)}return{configPath:i,siteId:e.siteId}}class Re extends Error{code;constructor(e,t){super(e);this.name="DeployError",this.code=t}}function I(e){let t=process.platform,i=t==="darwin"?"open":t==="win32"?"start":"xdg-open";Bun.spawn([i,e],{stdio:["ignore","ignore","ignore"]})}
|
|
30
|
+
export{wr,eo,_n,vr,xr,Dt,ut,to,Tn,Rn,Sr,kr,el,tl,Re};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ui,Wi}from"./chunk-24jeywdh.js";import"./chunk-baprpeby.js";import"./chunk-nr7qak48.js";import"./chunk-0egg3666.js";import"./chunk-z9fz5dby.js";import"./chunk-jva1bbpw.js";import"./chunk-01rz8h7x.js";import"./chunk-yhv65tpd.js";import{io}from"./chunk-8b71njp8.js";import"./chunk-rhrv2j36.js";import"./chunk-z9tvn738.js";import"./chunk-2hbygqzj.js";import"./chunk-8fb1mqw1.js";import"./chunk-298s08st.js";import"./chunk-2cybh8dh.js";import"./chunk-vg9dyc4y.js";import"./chunk-zv0vgamy.js";import"./chunk-1v86h5vn.js";import"./chunk-vp827ah7.js";import"./chunk-3mynjdqr.js";import"./chunk-cp7hph6f.js";import"./chunk-67actssw.js";import"./chunk-zkjp87ak.js";import"./chunk-h6q8jafh.js";import"./chunk-3s9s1mdt.js";import"./chunk-s9mq9x2k.js";import"./chunk-1c407nky.js";import"./chunk-71bbv43t.js";import"./chunk-8j8egh39.js";import"./chunk-25m2wqsd.js";import"./chunk-0ma6yhg9.js";import"./chunk-aabzyk88.js";import"./chunk-er7y8hk9.js";import"./chunk-rn4cppcj.js";import"./chunk-34154wz1.js";import"./chunk-2hc5mbw8.js";import{he,nn,rn,K,d,n,Jn,I,o,le}from"./chunk-5f7qy42x.js";import"./chunk-szry3s17.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-nxxmhrd0.js";import"./chunk-1erc0vrb.js";import"./chunk-qmcmjdy7.js";import"./chunk-b77v56fz.js";import"./chunk-2pph3dh0.js";import"./chunk-d4k4nyj0.js";import"./chunk-v7vkqg8f.js";import"./chunk-rmavqxd8.js";import"./chunk-e6y6s7q8.js";export{Jn as buildWebComponents,rn as cacheTemplate,nn as checkCache,io as classifyAllScripts,Ui as createMiddleware,Wi as createRoute,I as defaultConfig,d as extractVariables,K as injectRouterScript,o as loadStxConfig,he as processClientScript,n as processDirectives,le as readMarkdownFile};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{b,d,n,g,I}from"./chunk-
|
|
2
|
+
import{b,d,n,g,I}from"./chunk-5f7qy42x.js";import q from"path";var M={enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},T=/<!-- @section:([\w-]+) -->([\s\S]*?)<!-- @endsection:\1 -->/g;var O=/<!-- @suspense:([\w-]+) -->([\s\S]*?)<!-- @endsuspense:\1 -->/g;function z(e){let t=[],o=0,s;O.lastIndex=0;while((s=O.exec(e))!==null){if(s.index>o){let a=e.slice(o,s.index);if(a.trim())t.push({type:t.length===0?"shell":"content",content:a})}let r=s[1],i=s[2];t.push({type:"suspense",name:r,content:i}),o=s.index+s[0].length}if(o<e.length){let r=e.slice(o);if(r.trim())t.push({type:t.length===0?"shell":"content",content:r})}if(t.length===0)t.push({type:"shell",content:e});return t}async function lu(e,t={},o={}){let s={...I,...o,streaming:{...M,...o.streaming}},r=s.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),w=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),m=w?w[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:q.dirname(e)};if(m.trim())await d(m,y,e);let E=z(c),u=new Set;if(!E.some((h)=>h.type==="suspense")){let h=s.streaming?.strategy||"auto",S=new RegExp(T.source,"g");if(!(h!=="manual"&&S.test(c))){let p=await n(c,y,e,s,u);for(let x=0;x<p.length;x+=r)i.enqueue(p.slice(x,x+r)),await new Promise((f)=>setTimeout(f,0))}else{let p=[],x=new RegExp(T.source,"g"),f;while((f=x.exec(c))!==null)p.push({name:f[1],content:f[2],start:f.index,end:f.index+f[0].length});let v=0;for(let _ of p){if(_.start>v){let k=c.slice(v,_.start);if(k.trim()){let D=await n(k,y,e,s,u);i.enqueue(D),await new Promise((H)=>setTimeout(H,0))}}let C=await n(_.content,y,e,s,u);i.enqueue(C),await new Promise((k)=>setTimeout(k,0)),v=_.end}if(v<c.length){let _=c.slice(v);if(_.trim()){let C=await n(_,y,e,s,u);i.enqueue(C)}}}}else{let h=new Map;for(let l of E)if(l.type==="shell"||l.type==="content"){let p=await n(l.content,y,e,s,u);i.enqueue(p)}else if(l.type==="suspense"&&l.name){let p=`stx-suspense-${l.name}`;i.enqueue(`<div id="${p}" data-suspense="${l.name}" style="display:contents;">
|
|
3
3
|
<template data-suspense-fallback>Loading...</template>
|
|
4
4
|
</div>`),h.set(l.name,n(l.content,y,e,s,u))}i.enqueue(`
|
|
5
5
|
<script>
|
|
@@ -17,13 +17,13 @@ import{b,d,n,g,I}from"./chunk-b1kdmkk8.js";import q from"path";var M={enabled:!0
|
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
})();
|
|
20
|
-
</script>`);let S=Array.from(h.entries()).map(async([l,p])=>{i.enqueue(await
|
|
20
|
+
</script>`);let S=Array.from(h.entries()).map(async([l,p])=>{i.enqueue(await So(l,p))});await Promise.all(S)}i.close()}catch(a){i.error(a)}}})}async function So(e,t){try{let s=(await t).replace(/`/g,"\\`").replace(/<\/script>/gi,"<\\/script>");return`
|
|
21
21
|
<script>
|
|
22
22
|
window.__stxSuspense.resolve('${e}', \`${s}\`);
|
|
23
23
|
</script>`}catch(o){let s=o instanceof Error?o.message:String(o);return`
|
|
24
24
|
<script>
|
|
25
25
|
window.__stxSuspense.resolve('${e}', '<div class="stx-error">Error loading content: ${b(s)}</div>');
|
|
26
|
-
</script>`}}var
|
|
26
|
+
</script>`}}var La=`
|
|
27
27
|
<script>
|
|
28
28
|
(function(){
|
|
29
29
|
window.__stxSuspense = window.__stxSuspense || {
|
|
@@ -43,12 +43,12 @@ window.__stxSuspense.resolve('${e}', '<div class="stx-error">Error loading conte
|
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
})();
|
|
46
|
-
</script>`;function A(e,t,o){if(!t||t<=0)return e;let s,r=new Promise((i,a)=>{s=setTimeout(()=>a(Error(`streaming boundary "${o}" timed out after ${t}ms`)),t)});return Promise.race([e,r]).finally(()=>clearTimeout(s))}function
|
|
46
|
+
</script>`;function A(e,t,o){if(!t||t<=0)return e;let s,r=new Promise((i,a)=>{s=setTimeout(()=>a(Error(`streaming boundary "${o}" timed out after ${t}ms`)),t)});return Promise.race([e,r]).finally(()=>clearTimeout(s))}function uu(e,t=[],o={}){let s=o.timeoutMs??0;return new ReadableStream({async start(r){try{if(r.enqueue(e),t.length>0)r.enqueue(La),await Promise.all(t.map(async(i)=>{let a=A(i.render(),s,i.id);r.enqueue(await So(i.id,a))}));r.close()}catch(i){r.error(i)}}})}var B=/@stream\s*\(\s*['"]([^'"]+)['"]\s*\)([\s\S]*?)@endstream/gi;function du(e,t){return e.replace(B,(o,s,r)=>{let i=s.trim(),a=r.split(/@fallback/i),w=a[0].trim(),m=a.length>1?a.slice(1).join("@fallback").trim():"";if(!t.__streamTemplates)t.__streamTemplates={};return t.__streamTemplates[i]=w,`<div data-suspense="${i}">${m}</div>`})}function pu(e){let t=e?.streamBoundaries;if(!t||typeof t!=="object")return;let o=Object.entries(t).filter(([,s])=>typeof s==="function");return o.length>0?o.map(([s,r])=>({id:s,render:r})):void 0}async function fu(e,t={},o={}){let s={...I,...o,streaming:{...M,...o.streaming}},r=s.streaming?.bufferSize||16384;return new ReadableStream({async start(i){try{let a=await Bun.file(e).text(),w=a.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),m=w?w[1]:"",c=a.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),y={...t,__filename:e,__dirname:q.dirname(e)};if(m.trim())await d(m,y,e);let E=new Set,u=s.streaming?.strategy||"auto",R=new RegExp(T.source,"g");if(!(u!=="manual"&&R.test(c))){let S=await n(c,y,e,s,E);for(let l=0;l<S.length;l+=r)i.enqueue(S.slice(l,l+r))}else{let S=[],l=new RegExp(T.source,"g"),p;while((p=l.exec(c))!==null)S.push({name:p[1],content:p[2],start:p.index,end:p.index+p[0].length});let x=0;for(let f of S){if(f.start>x){let _=c.slice(x,f.start);if(_.trim()){let C=await n(_,y,e,s,E);i.enqueue(C)}}let v=await n(f.content,y,e,s,E);i.enqueue(v),x=f.end}if(x<c.length){let f=c.slice(x);if(f.trim()){let v=await n(f,y,e,s,E);i.enqueue(v)}}}i.close()}catch(a){i.error(a)}}})}async function gu(e,t={}){let o={...I,...t,streaming:{...M,...t.streaming}},s=await Bun.file(e).text(),r=s.match(/<script\b[^>]*\bserver\b[^>]*>([\s\S]*?)<\/script>/i),i=r?r[1]:"",a=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/gi,""),w=a,m={},c;T.lastIndex=0;while((c=T.exec(a))!==null){let u=c[1],R=c[2];m[u]=R}let y=a.replace(T,"");return{renderShell:async(u={})=>{let R={...u,__filename:e,__dirname:q.dirname(e)};return await d(i,R,e),n(y,R,e,o,new Set)},renderSection:async(u,R={})=>{try{if(!m[u])return`<div class="error-message">Section "${b(u)}" not found in template "${b(e)}"</div>`;let h={...R,__filename:e,__dirname:q.dirname(e)};await d(i,h,e);let S=new Set;return await n(m[u],h,e,o,S)}catch(h){let S=h instanceof Error?h.message:String(h);return g("Expression",S,e,m[u]||"",0,m[u]||"")}},getSections:()=>Object.keys(m),getTemplate:()=>w}}var ja={name:"suspense",hasEndTag:!0,handler:(e,t,o,s)=>{if(!t||t.length===0)throw Error("Suspense directive requires a name parameter");let r=t[0].replace(/['"`]/g,"");return`<!-- @suspense:${r} -->${e}<!-- @endsuspense:${r} -->`}},Ba={name:"island",hasEndTag:!0,handler:(e,t,o,s)=>{if(!t||t.length===0)throw Error("Island directive requires a name parameter");let r=t[0].replace(/['"`]/g,""),i=t[1]?t[1].replace(/['"`]/g,""):"lazy",a=`island-${r}-${Math.random().toString(36).substring(2,9)}`,w=e.match(/<script\s+props\s*>([\s\S]*?)<\/script>/i),m=w?w[1].trim():"",c=w?e.replace(w[0],""):e;return`<div data-island="${r}" data-island-id="${a}" data-priority="${i}">
|
|
47
47
|
${c}
|
|
48
48
|
<script type="application/json" data-island-props="${a}">
|
|
49
49
|
${m?`{${m}}`:"{}"}
|
|
50
50
|
</script>
|
|
51
|
-
</div>`}};function
|
|
51
|
+
</div>`}};function mu(e={}){let t=[];if(e.streaming?.enabled)t.push(ja);if(e.hydration?.enabled)t.push(Ba);return t}async function hu(e,t,o,s={}){return e}function yu(e,t={}){let o=new TextEncoder,s=e.pipeThrough(new TransformStream({transform(i,a){a.enqueue(o.encode(i))}})),r=new Headers(t.headers);if(!r.has("Content-Type"))r.set("Content-Type","text/html; charset=utf-8");if(!r.has("Transfer-Encoding"))r.set("Transfer-Encoding","chunked");if(!r.has("X-Content-Type-Options"))r.set("X-Content-Type-Options","nosniff");if(!r.has("X-Accel-Buffering"))r.set("X-Accel-Buffering","no");return new Response(s,{...t,headers:r})}function bu(e={mode:"full"}){let{mode:t,components:o={},dynamicImports:s=!0}=e,r=Object.entries(o).map(([i,a])=>`'${i}': ${s?`() => import('${a}')`:`require('${a}')`}`).join(`,
|
|
52
52
|
`);if(t==="loader")return`
|
|
53
53
|
(function() {
|
|
54
54
|
window.__stx = window.__stx || {};
|
|
@@ -191,4 +191,4 @@ else {
|
|
|
191
191
|
stx.hydrate();
|
|
192
192
|
}
|
|
193
193
|
})();`}
|
|
194
|
-
export{
|
|
194
|
+
export{lu,So,La,uu,du,pu,fu,gu,ja,Ba,mu,hu,yu,bu};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-v7vkqg8f.js";import"./chunk-d4k4nyj0.js";import{m,h,w,L}from"./chunk-5f7qy42x.js";import"./chunk-2pph3dh0.js";import"./chunk-c57j92td.js";import"./chunk-rmavqxd8.js";import"./chunk-b77v56fz.js";import"./chunk-qmcmjdy7.js";import"./chunk-kp4mzspk.js";import"./chunk-1erc0vrb.js";import"./chunk-nxxmhrd0.js";import"./chunk-e6y6s7q8.js";import"./chunk-szry3s17.js";import f from"path";var S=["applyOfflineUpdate","broadcast","cacheMedia","calculateDistance","canNotify","clearCookies","clearFetchCache","clearOfflineData","clearStorage","copyToClipboard","createShareableFile","defineForm","getBatteryLevel","getCookie","getCurrentPosition","getStorageKeys","getStorageSize","getVoices","hasBattery","hasCameraPermission","hasGeolocationPermission","hasMicrophonePermission","hasNotificationPermission","hasResizeObserver","hexToHsl","hexToRgb","isBroadcastChannelSupported","isCharging","isDeviceMotionSupported","isDeviceOrientationSupported","isEventSourceSupported","isEyeDropperSupported","isInFullscreen","isMutationObserverSupported","isPermissionGranted","isSpeechRecognitionSupported","isSpeechSynthesisSupported","isWakeLockSupported","isWebSocketSupported","notify","onOfflineUpdateReady","parseCookies","pickColor","prefetch","removeCookie","requestMediaPermissions","requestMotionPermission","requestNotificationPermission","requestOrientationPermission","setCookie","share","shareCurrentPage","shareFiles","shareText","shareURL","shareWithFallback","speak","stopSpeaking","toggleFullscreen","useAmbientSound","useAsyncData","useAttributeObserver","useAutoLogout","useAutoWakeLock","useBattery","useBreakpoint","useBreathPacer","useBroadcastChannel","useBroadcastStream","useChannel","useChildListObserver","useClipboard","useColorHistory","useConditionalWakeLock","useCookies","useCopySelection","useDeviceMotion","useDeviceOrientation","useElementSize","useElementTextSelection","useElementVisibility","useEventSource","useEyeDropper","useFavicon","useForm","useFullscreen","useGeolocation","useGeolocationWatch","useHotkey","useIdle","useIdleState","useInfiniteScroll","useIntersectionObserver","useIntersectionObserverMultiple","useIsDesktop","useIsMobile","useIsTablet","useKeyPressed","useKeySequence","useKeyboard","useLastActive","useLazyLoad","useMeta","useMouse","useMouseInElement","useMutationObserver","useNetwork","useNotification","useOnline","useOutbox","useParallax","usePermission","usePermissions","usePointer","usePost","useResizeObserver","useResizeObserverMultiple","useSSE","useScroll","useSelectionPopup","useShare","useSpeechRecognition","useSpeechSynthesis","useStorage","useTextObserver","useTextSelection","useTitle","useVisibility","useWakeLock","useWindowSize"],_=new Set(S);var l=new Map,x=m(64),y=new Set,O=0,R=new Set(S);function W(){l.clear(),x.clear()}function P(o){let n=new Map;for(let r of o){let a=f.basename(r);if(a.endsWith(".d.ts"))continue;let t=a.replace(/\.[jt]s$/,"");if(t==="index")continue;if(t===a)continue;let i=n.get(t);if(i&&!i.endsWith(".js"))continue;n.set(t,r)}return[...n.values()].sort()}function I(o,n){let r=n.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(?:^|[^\\w$.])(?:const|let|var|function|class)\\s+${r}\\b`).test(o)}function M(o){if(!o)return[];let n=h(o,O),r=x.get(n);if(r)return r.slice();let a=o.replace(/<script\b[^>]*\bdata-stx-runtime\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-framework-composables\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-stores\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-composables\b[^>]*>[\s\S]*?<\/script>/gi,""),t=[];for(let i of R){if(y.has(i))continue;let u=i.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");if(new RegExp(`(^|[^\\w$.])${u}\\s*\\(`).test(a))t.push(i)}return t.sort(),x.set(n,t),t.slice()}async function A(o,n){let r=M(o);if(r.length===0)return null;let a=n??f.join(import.meta.dir,"composables"),t=`${a}\x00${r.join(",")}`,i=l.get(t);if(i!==void 0)return i||null;let u=L({loader:"ts",target:"browser",define:w()}),C=new Set(r),d=[],g=new Set,p=[];try{let s=new Bun.Glob("*.{ts,js}");for await(let e of s.scan({cwd:a,absolute:!0}))p.push(e)}catch{return l.set(t,""),null}p=P(p);for(let s of p){let e;try{e=await Bun.file(s).text()}catch{continue}let b=[];try{b=u.scan(e).exports.filter((c)=>c!=="default")}catch{continue}if(!b.some((c)=>C.has(c)))continue;try{e=e.replace(/^import\s+.*from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^import\s+type\s+.*$/gm,""),e=e.replace(/^export\s+\*\s+(?:as\s+\w+\s+)?from\s*['"][^'"]+['"]\s*;?\s*$/gm,""),e=e.replace(/^export\s+(?:type\s+)?\{[\s\S]*?\}\s*(?:from\s*['"][^'"]+['"]\s*)?;?\s*$/gm,""),e=e.replace(/^export\s+default\s+/gm,""),e=e.replace(/^export\s+(?=(?:declare\s+)?(?:abstract\s+)?(?:async\s+)?(?:function|class|const|let|var|type|interface|enum)\b)/gm,""),d.push(`// ${f.basename(s).replace(/\.[jt]s$/,"")}
|
|
3
3
|
${u.transformSync(e).trim()}`);for(let c of b)g.add(c)}catch(c){console.warn(`[stx] framework composable ${f.basename(s)} could not be bundled:`,c)}}let v=r.filter((s)=>!g.has(s)&&!I(o,s));if(v.length>0)console.warn(`[stx] could not bundle ${v.join(", ")} from @stacksjs/stx/composables \u2014 `+"calls to them will throw ReferenceError in the browser. Import them explicitly so the bundler inlines them, or use a runtime equivalent from window.stx.");if(d.length===0)return l.set(t,""),null;let E=[...g].map((s)=>` try { if (!(${JSON.stringify(s)} in __s)) { __s[${JSON.stringify(s)}] = ${s}; if (!(${JSON.stringify(s)} in window)) window[${JSON.stringify(s)}] = ${s}; } } catch (e) {}`).join(`
|
|
4
4
|
`),k=`<script data-stx-framework-composables>
|
|
5
5
|
;(function(){
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{cl,ll,ul,dl,sa,pl,fl,gl,ml,hl,yl,bl}from"./chunk-rhrv2j36.js";export{yl as Broadcast,bl as BroadcastServer,sa as broadcast,ml as broadcastPresence,gl as broadcastPrivate,hl as channel,cl as getBroadcastServer,dl as loadChannels,ll as startBroadcasting,ul as stopBroadcasting,pl as toUser,fl as toUsers};
|
|
@@ -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 ql(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 Kl(s,n,t){return{id:s,fallback:t,content:n}}async function Xl(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 Gl(){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 Jl(){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{ql,Kl,Xl,Gl,Jl};
|
|
@@ -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 ue(n,f){return m.run(n,f)}function
|
|
3
|
-
export{ue,
|
|
2
|
+
import{AsyncLocalStorage as R}from"async_hooks";var b=Symbol.for("stx.runtime-config.scope"),y=globalThis,m=y[b]??=new R;function ue(n,f){return m.run(n,f)}function _t(){return m.getStore()}function Qn(){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 $s(){return Qn().public}function C(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 d(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 Xe(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)+d(f)+s.slice(g)}
|
|
3
|
+
export{ue,_t,Qn,$s,C,Xe};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{qi,no,Ki,Xi,ro,Gi,Ji,Yi,Zi,so,Qi,nl}from"./chunk-z9fz5dby.js";import{mo,oa}from"./chunk-z9tvn738.js";import{j,B,F,Nt,J,se,Pn,Pe,dt,Lt,jt,Bt,z,Ft,zt,In}from"./chunk-298s08st.js";import{Na}from"./chunk-67actssw.js";export{B as DEFAULT_FORMATS,F as DEFAULT_QUALITY,j as DEFAULT_WIDTHS,In as ImageProcessingError,Xi as clearImageCache,ro as createImageDirective,oa as createImageHandler,Ji as createImagePlugin,nl as defaultImageConfig,zt as formatSize,so as generateImageManifest,dt as generateSizes,Pe as generateSrcSet,Lt as getFallbackVariant,Pn as getImageMetadata,z as getMimeType,Ft as getTotalSize,jt as groupVariantsByFormat,mo as handleImageRequest,Gi as imageDirective,J as isImageBackendAvailable,Bt as isImageFile,Nt as isSharpAvailable,Zi as optimizeDirectory,Yi as optimizeImage,no as parseImageComponent,se as processImage,Ki as processImageComponents,qi as renderImageComponent,Na as rewriteImagesWithSiblings,Qi as writeImageManifest};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var d=0;function l(){return`keep-alive-${++d}-${Date.now().toString(36)}`}function
|
|
2
|
+
var d=0;function l(){return`keep-alive-${++d}-${Date.now().toString(36)}`}function Cl(e,t={},n){let i=/@keepAlive(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@endkeepAlive/gi;return e.replace(i,(a,c,o)=>{let s=l(),r=u(c||"");return p(s,o.trim(),r)})}function u(e){let t={max:10},n=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\d+)|(\w+))/g,i;while((i=n.exec(e))!==null){let a=i[1],c=i[2]||i[3],o=i[4];switch(a){case"max":t.max=o?parseInt(o,10):10;break;case"include":t.include=c;break;case"exclude":t.exclude=c;break;case"id":t.id=c;break}}return t}function p(e,t,n){let{max:i,include:a,exclude:c}=n,o=n.id||e;return`
|
|
3
3
|
<div class="stx-keep-alive" data-keep-alive-id="${e}" data-custom-id="${o}">
|
|
4
4
|
<div class="stx-keep-alive-content" data-keep-alive-content="${e}">
|
|
5
5
|
${t}
|
|
@@ -286,7 +286,7 @@ else {
|
|
|
286
286
|
});
|
|
287
287
|
})();
|
|
288
288
|
</script>
|
|
289
|
-
`}function
|
|
289
|
+
`}function $l(e={}){return{id:e.id||l(),cache:new Map,max:e.max||10,include:e.include?e.include.split(",").map((n)=>n.trim()):null,exclude:e.exclude?e.exclude.split(",").map((n)=>n.trim()):null}}function El(e,t){if(t.exclude&&t.exclude.includes(e))return!1;if(t.include&&!t.include.includes(e))return!1;return!0}function _l(){return`
|
|
290
290
|
/* STX Keep-Alive Styles */
|
|
291
291
|
.stx-keep-alive {
|
|
292
292
|
position: relative;
|
|
@@ -311,7 +311,7 @@ else {
|
|
|
311
311
|
.stx-keep-alive-content > [data-activated] {
|
|
312
312
|
opacity: 1;
|
|
313
313
|
}
|
|
314
|
-
`}function
|
|
314
|
+
`}function Tl(){return`
|
|
315
315
|
// STX Keep-Alive Runtime
|
|
316
316
|
(function() {
|
|
317
317
|
if (typeof window === 'undefined') return;
|
|
@@ -347,5 +347,5 @@ else {
|
|
|
347
347
|
|
|
348
348
|
console.log('[stx] Keep-alive runtime initialized');
|
|
349
349
|
})();
|
|
350
|
-
`}function
|
|
351
|
-
export{
|
|
350
|
+
`}function Rl(e){if(typeof document<"u")document.addEventListener("stx:activated",(t)=>{e(t.detail)})}function Al(e){if(typeof document<"u")document.addEventListener("stx:deactivated",(t)=>{e(t.detail)})}
|
|
351
|
+
export{Cl,$l,El,_l,Tl,Rl,Al};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Bn,Qa,Au,ec,Pu,tc,Fn,b,St,ye,nc,es,rc,Iu,q,sc,Du,x,Ou}from"./chunk-5f7qy42x.js";import"./chunk-szry3s17.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-nxxmhrd0.js";import"./chunk-1erc0vrb.js";import"./chunk-qmcmjdy7.js";import"./chunk-b77v56fz.js";import"./chunk-2pph3dh0.js";import"./chunk-d4k4nyj0.js";import"./chunk-v7vkqg8f.js";import"./chunk-rmavqxd8.js";import"./chunk-e6y6s7q8.js";export{sc as applyFilters,Pu as clearCustomFilters,nc as clientLoopScopes,Bn as defaultFilters,b as escapeHtml,St as escapeHtmlValue,x as evaluateExpression,tc as findMustacheEnd,ec as getAllFilters,rc as interpolateScriptAttributes,es as interpolateScriptExpressions,Iu as interpolateScriptsInTemplate,q as processExpressions,Qa as registerFilter,Au as registerFilters,Fn as replaceInterpolations,Du as resetRejectedExpressionWarnings,Ou as unescapeHtml,ye as usesSignalsInScript};
|