@stacksjs/stx 0.2.502 → 0.2.504
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-0eptxhzy.js +2 -0
- package/dist/{chunk-4ssg2hn4.js → chunk-0gp4sj0v.js} +1 -1
- package/dist/chunk-0kj3qs23.js +2 -0
- package/dist/{chunk-m9nr12a1.js → chunk-0np4t9ka.js} +120 -120
- package/dist/{chunk-qmcmjdy7.js → chunk-133ggr0t.js} +7 -7
- package/dist/{chunk-8qdvhbv7.js → chunk-17fan751.js} +5 -5
- package/dist/chunk-18pxh9sv.js +2 -0
- package/dist/{chunk-b90y5phw.js → chunk-2242bx8y.js} +65 -65
- package/dist/{chunk-vs0ebfg5.js → chunk-2abv46yw.js} +1 -1
- package/dist/{chunk-7cbtcdqw.js → chunk-2etevws0.js} +2 -2
- package/dist/chunk-2h4bf7m4.js +2 -0
- package/dist/{chunk-z9fz5dby.js → chunk-2j04bc8c.js} +2 -2
- package/dist/chunk-37hm4er5.js +2 -0
- package/dist/{chunk-25m2wqsd.js → chunk-38mtn4ce.js} +3 -3
- package/dist/chunk-3c9t71pc.js +2 -0
- package/dist/{chunk-1mrn5s5z.js → chunk-3kxh9rsp.js} +1 -1
- package/dist/{chunk-vg9dyc4y.js → chunk-3y8ykqpx.js} +1 -1
- package/dist/{chunk-jwjggr91.js → chunk-3ynfz6h8.js} +2 -2
- package/dist/{chunk-0egg3666.js → chunk-49p5j9ab.js} +4 -4
- package/dist/{chunk-rhrv2j36.js → chunk-4hz4g5ym.js} +2 -2
- package/dist/{chunk-ckrpk6ak.js → chunk-5c1qesrs.js} +1 -1
- package/dist/{chunk-b77v56fz.js → chunk-5cyz97t4.js} +7 -7
- package/dist/{chunk-tdetcthb.js → chunk-5kq996qy.js} +1 -1
- package/dist/chunk-5q27xq7w.js +2 -0
- package/dist/{chunk-802qf0vz.js → chunk-5q9rmcp7.js} +1 -1
- package/dist/chunk-5yrn6whx.js +2 -0
- package/dist/chunk-667d6fz8.js +2 -0
- package/dist/{chunk-1erc0vrb.js → chunk-6k4f583z.js} +2 -2
- package/dist/{chunk-40jd0b4h.js → chunk-78yx6xxn.js} +1 -1
- package/dist/{chunk-2pph3dh0.js → chunk-798epzq5.js} +1 -1
- package/dist/chunk-7dmrxhq7.js +2 -0
- package/dist/{chunk-yvt8zszz.js → chunk-81byredt.js} +1 -1
- package/dist/{chunk-qhnpc3ac.js → chunk-88xqy2b9.js} +22 -22
- package/dist/{chunk-cp7hph6f.js → chunk-8xpyzcq2.js} +1 -1
- package/dist/chunk-9836wtag.js +2 -0
- package/dist/chunk-9kt6g57t.js +2 -0
- package/dist/{chunk-81t6zr3m.js → chunk-a5c75hxe.js} +2 -2
- package/dist/{chunk-93sr9q8g.js → chunk-a771dfsg.js} +1 -1
- package/dist/{chunk-h0sd5cda.js → chunk-amd52bnv.js} +5 -5
- package/dist/{chunk-szry3s17.js → chunk-azza6dcr.js} +3 -3
- package/dist/chunk-b3nz1qmj.js +2 -0
- package/dist/chunk-bcgfg3x0.js +2 -0
- package/dist/{chunk-gvkfydq5.js → chunk-bt51kf9z.js} +1 -1
- package/dist/{chunk-2kyfaa0p.js → chunk-c322rrge.js} +2 -2
- package/dist/chunk-cctb8fnj.js +2 -0
- package/dist/chunk-cpj9b887.js +2 -0
- package/dist/{chunk-bv7bsdfe.js → chunk-czmw5xsd.js} +2 -2
- package/dist/chunk-d161ndyz.js +2 -0
- package/dist/chunk-d5x1t498.js +2 -0
- package/dist/{chunk-b5mcvm6y.js → chunk-dn9fxpwt.js} +6 -6
- package/dist/chunk-dne8n6h3.js +3 -0
- package/dist/{chunk-tvag2s5a.js → chunk-eacd5755.js} +1 -1
- package/dist/{chunk-8fb1mqw1.js → chunk-ej46bkaw.js} +1 -1
- package/dist/chunk-f6n6nrdq.js +2 -0
- package/dist/{chunk-4mrgy3ve.js → chunk-fd6abk20.js} +4 -4
- package/dist/{chunk-1v86h5vn.js → chunk-fesb4h31.js} +2 -2
- package/dist/chunk-fgvdq014.js +2 -0
- package/dist/{chunk-1hpttjgq.js → chunk-fh5rp6wb.js} +1 -1
- package/dist/{chunk-vp827ah7.js → chunk-g7wgpys2.js} +4 -4
- package/dist/{chunk-33snwgdy.js → chunk-gxs2p0y7.js} +3 -3
- package/dist/{chunk-z6nm6rf1.js → chunk-h6z4s5p3.js} +1 -1
- package/dist/chunk-hzjk2027.js +2 -0
- package/dist/{chunk-z9tvn738.js → chunk-jcmgj8kk.js} +1 -1
- package/dist/{chunk-zqxqdns1.js → chunk-jt842kx3.js} +1 -1
- package/dist/chunk-jtwx2xte.js +2 -0
- package/dist/chunk-k0zadypg.js +2 -0
- package/dist/{chunk-dve4q9tg.js → chunk-kbhm1wqt.js} +3 -3
- package/dist/{chunk-258qj7pt.js → chunk-km9g9drp.js} +1 -1
- package/dist/chunk-kr5ap3qn.js +2 -0
- package/dist/{chunk-t61vdbje.js → chunk-ktvr45qg.js} +6 -6
- package/dist/chunk-kxt6xb4j.js +2 -0
- package/dist/chunk-kxvtyh05.js +2 -0
- package/dist/chunk-mba6khev.js +2 -0
- package/dist/{chunk-vtn0gmen.js → chunk-mfcdbqvd.js} +8 -8
- package/dist/{chunk-298s08st.js → chunk-n34kagea.js} +2 -2
- package/dist/{chunk-c8psbk2e.js → chunk-p4gbvge6.js} +1 -1
- package/dist/chunk-pykeaf4h.js +2 -0
- package/dist/chunk-qcj12mtw.js +2 -0
- package/dist/chunk-qky9zfvx.js +2 -0
- package/dist/{chunk-4c1afy15.js → chunk-qv57r0fa.js} +1 -1
- package/dist/chunk-rnnead1w.js +2 -0
- package/dist/chunk-rrvfgmqb.js +2 -0
- package/dist/chunk-s4c8vf27.js +2 -0
- package/dist/chunk-srhgfsz3.js +2 -0
- package/dist/{chunk-stvqwzen.js → chunk-szkqmwjg.js} +2 -2
- package/dist/chunk-t1x0x5sw.js +2 -0
- package/dist/{chunk-hqvdm4h9.js → chunk-t77pz252.js} +1 -1
- package/dist/chunk-t7djn7zd.js +2 -0
- package/dist/{chunk-tse7jzmz.js → chunk-tf239jvd.js} +1 -1
- package/dist/{chunk-gzt3ghgq.js → chunk-tkagcknf.js} +2 -2
- package/dist/chunk-txd6fq1x.js +2 -0
- package/dist/{chunk-f0prq6yw.js → chunk-vc1m5fr9.js} +1 -1
- package/dist/{chunk-jbvg29t0.js → chunk-vftdacyb.js} +1 -1
- package/dist/{chunk-hktvv0hd.js → chunk-vtxzaj1h.js} +2 -2
- package/dist/chunk-w78v0xek.js +45 -0
- package/dist/chunk-wrghqec5.js +2 -0
- package/dist/{chunk-xfxrh6vx.js → chunk-wy36z6qp.js} +1 -1
- package/dist/{chunk-d19vgjjt.js → chunk-x81vcxzs.js} +2 -2
- package/dist/{chunk-15w4adyd.js → chunk-x96ardq0.js} +1 -1
- package/dist/{chunk-rmavqxd8.js → chunk-xd4zvm4x.js} +2 -2
- package/dist/{chunk-x8mp9yvn.js → chunk-xemsypk7.js} +4 -4
- package/dist/{chunk-v7vkqg8f.js → chunk-xsc9zbaj.js} +2 -2
- package/dist/{chunk-71bbv43t.js → chunk-xx2pk2ay.js} +3 -3
- package/dist/{chunk-74j18qk0.js → chunk-y8h823cb.js} +28 -28
- package/dist/{chunk-3mynjdqr.js → chunk-ygetbydb.js} +3 -3
- package/dist/chunk-yn2d8x8m.js +3 -0
- package/dist/{chunk-mq7vvaf4.js → chunk-ywv2838m.js} +1 -1
- package/dist/cli.js +44 -44
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/native/bridge/protocol.d.ts +3 -0
- package/dist/native/cli.d.ts +1 -0
- package/dist/native/cli.js +7 -2
- package/dist/native/compiler/bundle.d.ts +1 -0
- package/dist/native/compiler/bundle.js +27 -7
- package/dist/native/compiler/html-to-ir.js +12 -0
- package/dist/native/compiler/icons.d.ts +20 -0
- package/dist/native/compiler/icons.js +20 -0
- package/dist/native/runtime/craft-bridge.js +9 -1
- package/dist/native/runtime/craft.d.ts +2 -0
- package/dist/native/runtime/native-host.js +8 -0
- package/dist/native/runtime/shared-screen.d.ts +21 -0
- package/dist/native/runtime/shared-screen.js +43 -0
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +2 -2
- package/package.json +5 -5
- package/dist/chunk-0adrp7qd.js +0 -2
- package/dist/chunk-0vdxchfw.js +0 -2
- package/dist/chunk-2gr5zcm3.js +0 -2
- package/dist/chunk-2wvezjd5.js +0 -33
- package/dist/chunk-379nn8yc.js +0 -2
- package/dist/chunk-3vqabd10.js +0 -2
- package/dist/chunk-490f2x2r.js +0 -2
- package/dist/chunk-4j2ej7er.js +0 -2
- package/dist/chunk-4rmdngzw.js +0 -2
- package/dist/chunk-52saa2nj.js +0 -2
- package/dist/chunk-69dc3tyz.js +0 -2
- package/dist/chunk-6v3p6cx1.js +0 -2
- package/dist/chunk-78vfptph.js +0 -2
- package/dist/chunk-7e6sxdp6.js +0 -2
- package/dist/chunk-7wxmsv41.js +0 -2
- package/dist/chunk-9mh1qq3g.js +0 -2
- package/dist/chunk-b0bgprzs.js +0 -2
- package/dist/chunk-c7cajwd2.js +0 -2
- package/dist/chunk-cg8hg6cs.js +0 -3
- package/dist/chunk-en0atzsp.js +0 -2
- package/dist/chunk-fxppbahx.js +0 -2
- package/dist/chunk-hhj1txvj.js +0 -2
- package/dist/chunk-j2q2pp0x.js +0 -2
- package/dist/chunk-jbj6xh7f.js +0 -3
- package/dist/chunk-jh385m2w.js +0 -2
- package/dist/chunk-kxg9q64a.js +0 -2
- package/dist/chunk-mdfrm5hv.js +0 -2
- package/dist/chunk-nfffn3s0.js +0 -2
- package/dist/chunk-nw7qvyek.js +0 -2
- package/dist/chunk-ny64ezsj.js +0 -2
- package/dist/chunk-qjba655t.js +0 -2
- package/dist/chunk-qjxxd4a0.js +0 -2
- package/dist/chunk-qsy7phd4.js +0 -2
- package/dist/chunk-rfq1jfhf.js +0 -2
- package/dist/chunk-rr41gk8b.js +0 -2
- package/dist/chunk-snyq0jj6.js +0 -2
- package/dist/chunk-sybzayv3.js +0 -2
- package/dist/chunk-v8m2khkq.js +0 -2
- package/dist/chunk-vbhykx9z.js +0 -2
- package/dist/chunk-xk2mwk61.js +0 -2
- package/dist/chunk-zbzmfqmk.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{al}from"./chunk-5kq996qy.js";import"./chunk-mfcdbqvd.js";import"./chunk-38mtn4ce.js";import"./chunk-fd6abk20.js";import"./chunk-0np4t9ka.js";import"./chunk-azza6dcr.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-a5c75hxe.js";import"./chunk-6k4f583z.js";import"./chunk-133ggr0t.js";import"./chunk-5cyz97t4.js";import"./chunk-798epzq5.js";import"./chunk-d4k4nyj0.js";import"./chunk-xsc9zbaj.js";import"./chunk-xd4zvm4x.js";import"./chunk-e6y6s7q8.js";export{al as buildForProduction};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{en,ae}from"./chunk-2hc5mbw8.js";import{m,tn,w,Ne,o,R}from"./chunk-
|
|
2
|
+
import{en,ae}from"./chunk-2hc5mbw8.js";import{m,tn,w,Ne,o,R}from"./chunk-0np4t9ka.js";import{Xr}from"./chunk-fd6abk20.js";import{s,ve}from"./chunk-xemsypk7.js";import{a}from"./chunk-dne8n6h3.js";import h from"path";import v from"fs";var pe=10;function V(e,n,i){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(h.basename(e))||Xr(e,n,i)}var ne=1,re=new Map,W=600,fe=100,P=new Map;async function me(e){let n=P.get(e)??0;if(n>0&&n<fe){P.set(e,n+1);return}P.set(e,1);try{let i=(await v.promises.readdir(e)).filter((u)=>u.endsWith(".js"));if(i.length<=W)return;let g=(await Promise.all(i.map(async(u)=>{try{return{name:u,at:(await v.promises.stat(h.join(e,u))).mtimeMs}}catch{return null}}))).filter((u)=>u!==null);g.sort((u,l)=>l.at-u.at);for(let u of g.slice(W)){let l=u.name.slice(0,-3);await v.promises.rm(h.join(e,`${l}.js`),{force:!0}),await v.promises.rm(h.join(e,`${l}.deps.json`),{force:!0})}I("pruned bundle cache to",W,"entries")}catch{}}function ie(e){return re.get(e)??[]}function X(e,n){if(e)re.set(e,n)}function qa(e=process.env){return e.STX_DEBUG==="true"||e.STX_DEBUG==="1"}function I(...e){if(qa())console.log("[stx:bundler]",...e)}var Z=[];function Fo(e,n,i){Z.push({filePath:e||"<inline>",message:n,details:i})}function mt(){return Z.slice()}function ht(){Z.length=0}var q;function _d(e){q=e}function zo(){if(q)return q;try{let e=R.strict;return typeof e==="object"&&e!==null?e.bundlerFallback??"warn":"warn"}catch{return"warn"}}var H=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function yt(e){let n=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,i;while((i=n.exec(e))!==null){let g=i[1];if(!H.some((l)=>l.test(g)))return I("detected user import:",g),!0}let c=/^[ \t]*import[ \t]*['"]([^'"]+)['"]/gm;while((i=c.exec(e))!==null){let g=i[1];if(/\.css(?:\?.*)?$/.test(g))continue;if(!H.some((l)=>l.test(g)))return I("detected side-effect import:",g),!0}return!1}var Qt="stx-module:",ge=/\.(?:[cm]?[jt]sx?|json)$/i;function Ka(e,n){return h.relative(e,n).split(h.sep).join("/")}function Xa(e,n){if(n.size===0)return e;return e.replace(/^([ \t]*import(?:(?:\s+|(?=[{*]))[^;"']*?\s*from\s*|\s*))(["'])([^"']+)\2/gm,(i,c,g,u)=>{let l=n.get(u);return l&&!u.startsWith(Qt)?`${c}${g}${l}${g}`:i})}function Ga(e,n){let i=0,c=(u)=>{let l=`__stxMod${i++}`,S=JSON.stringify(u);return n.push(`var ${l} = globalThis.__stxModules && globalThis.__stxModules[${S}];`,`if (${l} === undefined) throw new Error("[stx] module " + ${JSON.stringify(S)} + " is not registered on this page (#1957)");`),l},g=(u,l)=>{for(let S of u.split(",")){let M=S.trim();if(!M)continue;let f=M.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!f)continue;let t=f[1].startsWith('"')?JSON.parse(f[1]):f[1],r=f[2]??t;n.push(`var ${r} = ${l}[${JSON.stringify(t)}];`)}};return e=e.replace(/^[ \t]*import(?:\s+|(?=[{*]))([^;"']+?)\s*from\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(u,l,S)=>{let M=S.slice(Qt.length),f=c(M),t=l.trim(),r=t.match(/^([\w$]+)\s*(?:,\s*|$)/);if(r&&!t.startsWith("{")&&!t.startsWith("*"))n.push(`var ${r[1]} = ${f}.default;`),t=t.slice(r[0].length).trim();let d=t.match(/^\*\s*as\s+([\w$]+)$/);if(d)n.push(`var ${d[1]} = ${f};`);else if(t.startsWith("{"))g(t.replace(/^\{|\}$/g,""),f);return""}),e=e.replace(/^[ \t]*import\s*["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(u,l)=>(c(l.slice(Qt.length)),"")),e}function ee(e){let n=[e,`${e}.ts`,`${e}.tsx`,`${e}.js`,`${e}.mjs`,`${e}.jsx`,h.join(e,"index.ts"),h.join(e,"index.tsx"),h.join(e,"index.js"),h.join(e,"index.mjs")];for(let i of n)try{if(v.existsSync(i)&&v.statSync(i,{throwIfNoEntry:!1})?.isFile())return i}catch{}return}function he(e,n,i,c,g,u=new Map,l){let S=(f,t,r)=>{if(V(t,e,l))return null;if(!g||f!==i||!ge.test(t))return null;try{if(!v.statSync(t,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}c.add(t);let d=`${Qt}${Ka(process.cwd(),t)}`;return u.set(r,d),{path:d,external:!0}},M=(f,t)=>{let r=f===i?n:h.dirname(f),d=h.resolve(r,t);return ee(d)??d};return{name:"stx-client-bundle",setup(f){if(f.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(t)=>({path:t.path,external:!0})),f.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(t)=>({path:t.path,external:!0})),f.onResolve({filter:/^\//},(t)=>{let r=ee(t.path);if(r){let d=S(t.importer,r,t.path);if(d)return d;if(r!==i)c.add(r);return{path:r}}return{path:t.path,external:!0}}),f.onResolve({filter:/^\.\.?\//},(t)=>{let r=M(t.importer,t.path),d=S(t.importer,r,t.path);if(d)return d;return c.add(r),{path:r}}),f.onResolve({filter:/^[@~]\//},(t)=>{let r=h.resolve(e,t.path.slice(2)),d=[r,`${r}.ts`,`${r}.tsx`,`${r}.js`,`${r}.mjs`,`${r}.jsx`,h.join(r,"index.ts"),h.join(r,"index.tsx"),h.join(r,"index.js"),h.join(r,"index.mjs")];for(let E of d)if(v.existsSync(E)&&v.statSync(E,{throwIfNoEntry:!1})?.isFile()){let C=S(t.importer,E,t.path);if(C)return C;return I(`resolved ${t.path[0]}/ import:`,t.path,"\u2192",E),c.add(E),{path:E}}return console.warn(`[stx:bundler] could not resolve ${t.path[0]}/ import:`,t.path),{path:r}}),g)f.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(t)=>{if(t.importer!==i)return;let r=`${Qt}npm:${t.path}`;return u.set(t.path,r),{path:r,external:!0}});f.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(t)=>{if(V(t.path,e,l))throw Error(`Server-only API source cannot be imported by a client script: ${t.path}`);let r=h.extname(t.path).toLowerCase(),d=r===".json"?"json":r===".tsx"?"tsx":r===".jsx"?"jsx":r===".ts"||r===".mts"||r===".cts"?"ts":"js";if(t.path!==i)c.add(t.path);return{contents:v.readFileSync(t.path,"utf8"),loader:d}})}}}var G=new Map,L=m(64),te=Symbol.for("stx.client-bundle-build-queue");function Ja(e){let n=globalThis,c=(n[te]??Promise.resolve()).then(e,e);return n[te]=c.then(()=>{return},()=>{return}),c}async function bt(e,n,i={}){let c=i.projectRoot||process.cwd(),g=(await o(c)).serverApi,u=i.minify??!1,l=i.externalizeUserModules??!0,S=i.expose?.length?[...new Set(i.expose)].sort():void 0,M=i.cacheDir||a(c,"bundle-cache"),f=new Bun.CryptoHasher("md5");f.update(`${pe}\x00${Ne()}\x00${JSON.stringify(g??!1)}\x00${l?"registry":"inline"}\x00${S?S.join(","):"*"}\x00${e}\x00${n}`);let t=f.digest("hex").slice(0,12),r=h.join(M,`${t}.js`),d=L.get(r);if(d){if(tn(d.files)&&d.files.every((A)=>!V(A.path,c,g))){I("memo hit:",t);let A=d.files.map((B)=>B.path);return X(n,A),i.collectInputs?.push(...A),d.code}L.delete(r),I("memo invalidated by dep change:",t)}let E=h.join(M,`${t}.deps.json`),C=Bun.file(r);if(await C.exists()){let A=Bun.file(E),B=!1,N=null;if(await A.exists())try{let O=JSON.parse(await A.text());if(O.metadataVersion!==ne||!Array.isArray(O.files))B=!1;else N=O.files,B=!0;if(N&&(!tn(N)||N.some((D)=>V(D.path,c,g))))B=!1}catch{B=!1}if(B){if(I("cache hit:",t),N)X(n,N.map((D)=>D.path)),i.collectInputs?.push(...N.map((D)=>D.path));let O=await C.text();if(N)L.set(r,{code:O,files:N});return O}I("cache invalidated by dep change:",t)}let _=G.get(t);if(_){let A=await _;if(i.collectInputs)i.collectInputs.push(...(L.get(r)?.files??[]).map((B)=>B.path));return A}let z=Ja(()=>$e(e,n,{projectRoot:c,minify:u,cacheDir:M,hash:t,cachePath:r,depsPath:E,collectInputs:i.collectInputs,externalizeUserModules:l,serverApi:g,expose:S,throwOnFailure:i.throwOnFailure}));G.set(t,z);try{return await z}finally{G.delete(t)}}var xe=0;function Ya(e){return`${e}-${process.pid}-${++xe}`}async function $e(e,n,i){let{projectRoot:c,minify:g,cacheDir:u,hash:l,cachePath:S,depsPath:M,externalizeUserModules:f}=i,t=a(c,"bundle-tmp"),r=Ya(l),d=h.join(t,`${r}.ts`),E=h.join(t,"out",r);v.mkdirSync(t,{recursive:!0}),v.mkdirSync(E,{recursive:!0});let C=h.dirname(n),_=new Set,z=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,A=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,B=s(e),{depths:N,balanced:O}=ve(B),D=(j)=>!O||N[j]===0,y;while((y=z.exec(B))!==null){if(y[1])continue;if(!D(y.index))continue;if(y[2])y[2].split(",").forEach((j)=>{let p=we(j);if(p)_.add(p)});else if(y[3])_.add(y[3])}while((y=A.exec(B))!==null){if(y[1])continue;if(!D(y.index))continue;_.add(y[2])}let se=/^[ \t]*import[ \t]+(?!type\b)(?:(\w+)\s*(?:,\s*)?)?(?:\*\s+as\s+(\w+)|\{([^}]+)\})?\s+from\b/gm;while((y=se.exec(B))!==null){if(!D(y.index))continue;let j=/^\s*['"]([^'"]+)['"]/.exec(e.slice(y.index+y[0].length))?.[1];if(j&&H.some((p)=>p.test(j)))continue;if(y[1])_.add(y[1]);if(y[2])_.add(y[2]);for(let p of(y[3]??"").split(",")){let b=p.trim();if(!b||/^type\s/.test(b))continue;let U=/\bas\s+(\w+)\s*$/.exec(b)?.[1]??/^\w+$/.exec(b)?.[0];if(U)_.add(U)}}for(let j of B.matchAll(/\bexport\s*\{([^}]+)\}/g))for(let p of j[1].split(",")){let b=/\bas\s+(\w+)\s*$/.exec(p)?.[1]??/^\s*(\w+)\s*$/.exec(p)?.[1];if(b)_.delete(b)}let oe=_.size>0?`
|
|
3
3
|
export { ${[..._].join(", ")} }`:"";await Bun.write(d,e+oe),I("bundling:",l,"from:",h.basename(n));let Y=new Set,Q=new Map;try{let j=await Bun.build({entrypoints:[d],outdir:E,target:"browser",format:"esm",minify:g?{whitespace:!1,identifiers:!0,syntax:!0}:!1,plugins:[he(c,C,d,Y,f,Q,i.serverApi)],define:{"process.env.NODE_ENV":g?'"production"':'"development"',...w()},root:c});if(!j.success){let F=j.logs.filter((T)=>T.level==="error").map((T)=>T.message).join(", ")||`Unable to bundle ${h.basename(n)}`,k=en(j.logs,n||void 0);if(console.warn("[stx:bundler] build failed:",F),Fo(n||"",F,k),i.throwOnFailure||zo()==="error")throw Error(F);return e}let p="";for(let x of j.outputs){p=await x.text();break}let b=[];for(let x of p.matchAll(/^\s*export\s*\{([^}]*)\}\s*;?\s*$/gm))for(let F of x[1].split(",")){let k=F.trim().match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(k){b.push([k[2],k[1]]);continue}let T=F.trim();if(/^[A-Za-z_$][\w$]*$/.test(T))b.push([T,T])}if(i.expose){let x=new Set(i.expose);for(let F=b.length-1;F>=0;F--)if(!x.has(b[F][0]))b.splice(F,1)}let U=[];p=Ga(Xa(p,Q),U);let le=p.match(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm)||[];if(p=p.replace(/^\s*import(?:\s+|(?=["'{*]))[^;]+;?\s*$/gm,"").replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim(),g&&p)try{p=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(p)}catch{}let K=`__stxBundle_${l}`,ce=b.map(([x,F])=>`${JSON.stringify(x)}: ${F}`).join(", "),ue=b.map(([x])=>`var ${x} = undefined;`).join(`
|
|
4
4
|
`),de=b.map(([x])=>`${x} = ${K}[${JSON.stringify(x)}];`).join(`
|
|
5
5
|
`);if(p=`${le.join(`
|
|
@@ -11,5 +11,5 @@ ${U.join(`
|
|
|
11
11
|
${p}
|
|
12
12
|
return { ${ce} };
|
|
13
13
|
})();
|
|
14
|
-
${de}`.trim(),I("bundled:",l,"output:",p.length,"bytes"),_.size>0&&b.length===0)return console.warn(`[stx:bundler] dropped every binding for ${h.basename(n)} (${l}); serving the unbundled source and not caching this result`),e;v.mkdirSync(u,{recursive:!0}),await Bun.write(S,p);let J=Array.from(Y).map((x)=>{try{return{path:x,mtimeMs:v.statSync(x).mtimeMs}}catch{return null}}).filter((x)=>x!==null);return await Bun.write(M,JSON.stringify({metadataVersion:ne,files:J})),X(n,J.map((x)=>x.path)),i.collectInputs?.push(...J.map((x)=>x.path)),L.set(S,{code:p,files:J}),await me(u),p}catch(j){let p=en(j,n||void 0),b=ae(j,n||void 0);if(console.warn(`[stx:bundler] error: ${b}`),Fo(n||"",b,p),i.throwOnFailure||zo()==="error")throw j;return e}finally{try{v.rmSync(d,{force:!0}),v.rmSync(E,{recursive:!0,force:!0})}catch{}}}function
|
|
15
|
-
export{ie,qa,Fo,mt,ht,
|
|
14
|
+
${de}`.trim(),I("bundled:",l,"output:",p.length,"bytes"),_.size>0&&b.length===0)return console.warn(`[stx:bundler] dropped every binding for ${h.basename(n)} (${l}); serving the unbundled source and not caching this result`),e;v.mkdirSync(u,{recursive:!0}),await Bun.write(S,p);let J=Array.from(Y).map((x)=>{try{return{path:x,mtimeMs:v.statSync(x).mtimeMs}}catch{return null}}).filter((x)=>x!==null);return await Bun.write(M,JSON.stringify({metadataVersion:ne,files:J})),X(n,J.map((x)=>x.path)),i.collectInputs?.push(...J.map((x)=>x.path)),L.set(S,{code:p,files:J}),await me(u),p}catch(j){let p=en(j,n||void 0),b=ae(j,n||void 0);if(console.warn(`[stx:bundler] error: ${b}`),Fo(n||"",b,p),i.throwOnFailure||zo()==="error")throw j;return e}finally{try{v.rmSync(d,{force:!0}),v.rmSync(E,{recursive:!0,force:!0})}catch{}}}function we(e){let n=e.trim();if(!n)return null;let i=n.indexOf("=");if(i!==-1)n=n.slice(0,i).trim();let c=n.indexOf(":");if(c!==-1)n=n.slice(c+1).trim();if(n.startsWith("..."))n=n.slice(3).trim();return/^[A-Za-z_$][\w$]*$/.test(n)?n:null}
|
|
15
|
+
export{ie,qa,Fo,mt,ht,_d,zo,yt,Qt,Ka,Xa,Ga,Ja,bt,Ya};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Bs,Fs,Qe,G,xn,lr,Sn,ur,
|
|
2
|
+
import{Bs,Fs,Qe,G,xn,lr,Sn,dr,ur,Bc,Fc,zc,kn,Hc,Vc,Uc,Wc,Fi,zi,Hi,zs,Vi,qc,et,tt,nt,rt,st,ot,Ce,Kc}from"./chunk-xd4zvm4x.js";export{Sn as Router,Uc as abortNavigation,lr as bracketPathToRegex,et as clearMiddleware,zi as createClientCookieManager,st as createMiddlewareContext,rt as createRouteLocation,Fi as createServerCookieManager,Hi as createStorageManager,Wc as defineMiddleware,Fc as defineRoute,zc as defineRoutes,dr as findErrorPage,ur as formatRoutes,Fs as generateRouteManifest,Bs as generateRouteTypes,Vi as getMiddleware,tt as getMiddlewareNames,Ce as getRouterScript,Kc as getRouterScriptDev,qc as hasMiddleware,Qe as isFileRequestPath,nt as loadMiddlewareFromDirectory,xn as matchRoute,Vc as navigateTo,G as patternToRegex,zs as registerMiddleware,Hc as resetRoutes,kn as route,ot as runMiddleware,Bc as setAppUrl};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ne,oc,Md,Nd,Ld,jd,ic,ac,Bd,Fd,Ko,zd,nn,rn,zn}from"./chunk-0np4t9ka.js";import"./chunk-azza6dcr.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-a5c75hxe.js";import"./chunk-6k4f583z.js";import"./chunk-133ggr0t.js";import"./chunk-5cyz97t4.js";import"./chunk-798epzq5.js";import"./chunk-d4k4nyj0.js";import"./chunk-xsc9zbaj.js";import"./chunk-xd4zvm4x.js";import"./chunk-e6y6s7q8.js";export{jd as __setSignalsGeneratorsForTest,Ne as cacheEngineFingerprint,rn as cacheTemplate,nn as checkCache,zd as clearDevCaches,ac as getCachedRouterScript,ic as getCachedSignalsRuntime,Bd as getServeClientAsset,Ko as getServeModuleBundle,zn as hashFilePath,Nd as invalidateFileCache,Ld as invalidateFileCacheByDir,Md as readFileCached,Fd as registerServeModuleBundle,oc as templateCache};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{d}from"./chunk-yn2d8x8m.js";import{mkdir as w,writeFile as h}from"fs/promises";import{join as l}from"path";var f="https://api.iconify.design";async function D(){let e=await fetch(`${f}/collections`);if(!e.ok)throw Error(`Failed to fetch collections: ${e.statusText}`);return await e.json()}async function P(e,t){try{let c=d.resolve("@iconify/json"),r=`${`${c.substring(0,c.lastIndexOf("/node_modules/@iconify/json/"))}/node_modules/@iconify/json`}/json/${e}.json`,s=Bun.file(r);if(await s.exists()){let a=await s.json();if(t&&t.length>0){let p={};for(let y of t)if(a.icons[y])p[y]=a.icons[y];return{...a,icons:p}}return a}}catch{}let n=t&&t.length>0?`${f}/${e}.json?icons=${t.join(",")}`:`${f}/${e}.json`,i=await fetch(n);if(!i.ok)throw Error(`Failed to fetch icons for ${e}: ${i.statusText}`);return await i.json()}function F(e,t=24,n=24){return{body:e.body,width:e.width||t,height:e.height||n,viewBox:`0 0 ${e.width||t} ${e.height||n}`}}function T(e,t){let n=u(e);return`import type { IconData } from '@stacksjs/iconify-core'
|
|
3
3
|
|
|
4
4
|
export const ${n}: IconData = ${JSON.stringify(t,null,2)}
|
|
5
5
|
|
|
@@ -44,7 +44,7 @@ const svg = \`<svg xmlns="http://www.w3.org/2000/svg" width="\${iconWidth}" heig
|
|
|
44
44
|
|
|
45
45
|
{!! svg !!}
|
|
46
46
|
`}function _(e){let t=new Set;return`// Icon data exports
|
|
47
|
-
${e.map((i)=>{let o=
|
|
47
|
+
${e.map((i)=>{let o=u(i);if(t.has(o)){let r=i.replace(/[^a-zA-Z0-9]/g,"_");if(/^[0-9]/.test(r))r=`_${r}`;o=r;let s=2;while(t.has(o))o=`${r}_${s}`,s++}return t.add(o),`export { default as ${o} } from './${i}.js'`}).join(`
|
|
48
48
|
`)}
|
|
49
49
|
|
|
50
50
|
export * from './types.js'
|
|
@@ -155,7 +155,7 @@ ${t.license?.url?`License: ${t.license.url}`:""}
|
|
|
155
155
|
|
|
156
156
|
- Icons: ${t.author?.name||"Iconify"}${t.author?.url?` (${t.author.url})`:""}
|
|
157
157
|
- Iconify: https://iconify.design/
|
|
158
|
-
`}function M(e,t,n){let i=n.length,c=n.slice(0,5).map(
|
|
158
|
+
`}function M(e,t,n){let i=n.length,c=n.slice(0,5).map(u),o=c.map((s)=>`${s.charAt(0).toUpperCase()}${s.slice(1)}Icon`),r=n.map((s)=>`- \`${u(s)}\``).join(`
|
|
159
159
|
`);return`# ${t.name}
|
|
160
160
|
|
|
161
161
|
> ${t.name} icons for stx from Iconify
|
|
@@ -338,14 +338,14 @@ You can also use the \`size\` property as a shorthand for setting both width and
|
|
|
338
338
|
You can also control icon size via CSS:
|
|
339
339
|
|
|
340
340
|
\`\`\`css
|
|
341
|
-
.${
|
|
341
|
+
.${u(e)}-icon {
|
|
342
342
|
width: 1em;
|
|
343
343
|
height: 1em;
|
|
344
344
|
}
|
|
345
345
|
\`\`\`
|
|
346
346
|
|
|
347
347
|
\`\`\`html
|
|
348
|
-
<${o[0]||"DraftsIcon"} class="${
|
|
348
|
+
<${o[0]||"DraftsIcon"} class="${u(e)}-icon" />
|
|
349
349
|
\`\`\`
|
|
350
350
|
|
|
351
351
|
## Available Icons
|
|
@@ -502,4 +502,4 @@ ${t.license?.url?`See [license details](${t.license.url}) for more information.`
|
|
|
502
502
|
- [Iconify documentation](https://iconify.design/docs/)
|
|
503
503
|
- [stx iconify integration guide](../../docs/iconify.md)
|
|
504
504
|
`}async function G(e,t,n,i){console.log(`
|
|
505
|
-
\uD83D\uDCE6 Generating package for ${e}...`);let o=(await D())[e];if(!o)throw Error(`Collection ${e} not found`);console.log(` Collection: ${o.name}`),console.log(` Total icons: ${o.total}`);let r=await P(e,n),s=Object.keys(r.icons);console.log(` Generating ${s.length} icons...`);let a=l(t,`iconify-${e}`),
|
|
505
|
+
\uD83D\uDCE6 Generating package for ${e}...`);let o=(await D())[e];if(!o)throw Error(`Collection ${e} not found`);console.log(` Collection: ${o.name}`),console.log(` Total icons: ${o.total}`);let r=await P(e,n),s=Object.keys(r.icons);console.log(` Generating ${s.length} icons...`);let a=l(t,`iconify-${e}`),p=l(a,"src");await w(p,{recursive:!0});let y=r.width||24,b=r.height||24;for(let m of s){let g=r.icons[m],I=F(g,y,b),z=T(m,I);await h(l(p,`${m}.ts`),z);let k=A(m,I);await h(l(p,`${m}-icon.stx`),k)}let v=_(s);await h(l(p,"index.ts"),v);let C=E(e);await h(l(p,"types.ts"),C);let S=N(e,o,s.length);await h(l(a,"package.json"),S);let x=U(e);await h(l(a,"build.ts"),x);let j=R(e,o,s.length);if(await h(l(a,"README.md"),j),i){let m=l(i,`iconify-${e}.md`),g=M(e,o,s);await w(i,{recursive:!0}),await h(m,g),console.log(` \u2713 Generated documentation in ${m}`)}console.log(` \u2713 Generated ${s.length} icons in ${a}`)}var B=new Set(["break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","false","finally","for","function","if","import","in","instanceof","new","null","return","super","switch","this","throw","true","try","typeof","var","void","while","with","let","static","yield","implements","interface","package","private","protected","public","await","eval","arguments"]);function u(e){let t=e.replace(/-([a-z0-9])/g,(n)=>n[1].toUpperCase());if(t=t.replace(/[^a-zA-Z0-9_$]/g,"_"),/^[0-9]/.test(t))t=`_${t}`;if(B.has(t))t=`${t}_`;return t}function W(e){let t=u(e);return t.charAt(0).toUpperCase()+t.slice(1)}export{D as fetchCollections,G as generatePackage};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{on,gc,as}from"./chunk-0np4t9ka.js";import"./chunk-azza6dcr.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-a5c75hxe.js";import"./chunk-6k4f583z.js";import"./chunk-133ggr0t.js";import"./chunk-5cyz97t4.js";import{Se}from"./chunk-798epzq5.js";import"./chunk-d4k4nyj0.js";import"./chunk-xsc9zbaj.js";import"./chunk-xd4zvm4x.js";import"./chunk-e6y6s7q8.js";export{Se as freeIdentifiers,as as processComponents,gc as processESImports,on as rendersAsElement};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Hd,Xo,Vd,Go,cc,lc,kt,sn,Ud,dc,uc,pc,f}from"./chunk-0np4t9ka.js";import"./chunk-azza6dcr.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-a5c75hxe.js";import"./chunk-6k4f583z.js";import"./chunk-133ggr0t.js";import"./chunk-5cyz97t4.js";import"./chunk-798epzq5.js";import"./chunk-d4k4nyj0.js";import"./chunk-xsc9zbaj.js";import"./chunk-xd4zvm4x.js";import"./chunk-e6y6s7q8.js";export{kt as buildCss,dc as extractClassNames,lc as fingerprintConfig,uc as generateCss,Ud as getCachedCSS,Hd as getCssServeAsset,f as injectCss,Xo as loadCssEngine,Go as loadCssEngineConfig,sn as rebuildCss,Vd as resetCssCache,cc as resolveUserCssConfig,pc as withLinkedModuleBundles};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Tt}from"./chunk-
|
|
2
|
+
import{Tt}from"./chunk-5cyz97t4.js";import{qo,Qr,Y,je,St,x,Fe,ze,Kn,u}from"./chunk-0np4t9ka.js";import{O}from"./chunk-vtxzaj1h.js";import v from"path";var D=/\b(?:state|derived|effect|batch|ref|reactive|computed|watch|watchEffect)\s*(?:<[^>]*>)?\s*\(/;function F(t,n,e){let r={fullTag:e,content:n,attrs:t};if(/\bserver\b/.test(t))return{...r,type:"server"};if(/\bdata-stx-scoped\b/.test(t))return{...r,type:"client"};if(D.test(n))return{...r,type:"signals"};if(/\bclient\b/.test(t)||/\btype\s*=\s*["']module["']/.test(t)||/\bsrc\s*=/.test(t))return{...r,type:"client"};return{...r,type:"server"}}var H=/^<script\b([^>]*)>([\s\S]*)<\/script\s*>$/i;function io(t){let n=[],e=[],r=[],o=0;while(o<t.length){let s=t.indexOf("<",o);if(s===-1)break;let a=je(t,s);if(a>s){o=a;continue}let i=Y(t,s);if(i>s){let c=t.slice(s,i),f=H.exec(c);if(f){let l=F(f[1],f[2],c);switch(l.type){case"signals":n.push(l);break;case"client":e.push(l);break;case"server":r.push(l);break}}o=i;continue}o=s+(t.startsWith("<!--",s)?4:1)}return{signals:n,client:e,server:r}}var L=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function V(t){let n=[],e=/<!--[\s\S]*?(?:-->|$)|<(script|style|textarea|title|template)\b[^>]*>[\s\S]*?<\/\1\s*>/gi,r;while((r=e.exec(t))!==null)n.push({start:r.index,end:r.index+r[0].length});return n}function P(t,n){return n.some((e)=>t>=e.start&&t<e.end)}function B(t){let n=(t||"").trim();if(!n)return null;if(/[\s>+~,:]/.test(n))return null;let e={},r=n,o=r.match(/^[a-z][\w-]*/i);if(o)e.tag=o[0].toLowerCase(),r=r.slice(o[0].length);while(r.length>0){let s=r.match(/^\[([\w-]+)(?:=(["']?)([^\]"']*)\2)?\]/);if(s){if(e.attr=s[1],s[3]!==void 0&&s[3]!=="")e.attrValue=s[3];r=r.slice(s[0].length);continue}let a=r.match(/^#([\w-]+)/);if(a){e.id=a[1],r=r.slice(a[0].length);continue}let i=r.match(/^\.([\w-]+)/);if(i){e.className=i[1],r=r.slice(i[0].length);continue}return null}if(!e.tag&&!e.attr&&!e.id&&!e.className)return null;return e}function q(t,n){if(n.attr){if(!(n.attrValue===void 0?new RegExp(`\\b${n.attr}(?=[\\s=>/]|$)`,"i"):new RegExp(`\\b${n.attr}\\s*=\\s*(["'])\\s*${n.attrValue}\\s*\\1`,"i")).test(t))return!1}if(n.id){if(!new RegExp(`\\bid\\s*=\\s*(["'])\\s*${n.id}\\s*\\1`,"i").test(t))return!1}if(n.className){let e=t.match(/\bclass\s*=\s*(["'])([\s\S]*?)\1/i);if(!e)return!1;if(!e[2].split(/\s+/).includes(n.className))return!1}return!0}function T(t,n="main"){let e=B(n);if(!e)return null;let r=/<([a-z][\w-]*)\b([^>]*)>/gi,o=V(t),s;while((s=r.exec(t))!==null){if(P(s.index,o))continue;let a=s[1].toLowerCase(),i=s[2]||"";if(i.trimEnd().endsWith("/")||L.has(a))continue;if(e.tag&&e.tag!==a)continue;if(!q(i,e))continue;let c=s[0],f=s.index+c.length,l=new RegExp(`<(/?)${a}\\b([^>]*)>`,"gi");l.lastIndex=f;let g=1,d;while((d=l.exec(t))!==null){if(P(d.index,o))continue;let h=d[1]==="/";if(!h&&(d[2]||"").trimEnd().endsWith("/"))continue;if(g+=h?-1:1,g===0)return{openTag:c,openIndex:s.index,start:f,end:d.index,tagName:a}}return null}return null}var Ae="private, no-store";function ao(t){return t.replace(/&#(\d+);/g,(n,e)=>M(Number(e),n)).replace(/&#x([0-9a-f]+);/gi,(n,e)=>M(Number.parseInt(e,16),n)).replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&")}function M(t,n){if(!Number.isInteger(t)||t<0||t>1114111)return n;try{return String.fromCodePoint(t)}catch{return n}}function ne(t){return t.headers.get("X-STX-Router")==="true"}function z(t,n){if(!t)return n;return t.split(",").some((r)=>r.trim().toLowerCase()===n.toLowerCase())?t:`${t}, ${n}`}function _(t){return{Vary:z(t,"X-STX-Router")}}var G="stx-page-head:",U=/<!--stx-page-head:([A-Za-z0-9+/=]+)-->\n?/,A={dev:null,prod:null};function W(){let t=O()?"dev":"prod",n=A[t];if(n!==null)return n;try{let e=import.meta.require("./chunk-km9g9drp.js"),r=t==="dev"&&typeof e.getRouterScriptDev==="function"?e.getRouterScriptDev:e.getRouterScript;A[t]=`<script>${r()}</script>`}catch{A[t]=""}return A[t]}async function co(t,n){if(n===!1)return null;if(n&&typeof n==="string"){let r=v.resolve(t,n);if(await Bun.file(r).exists())return r;return null}let e=v.join(t,"app.stx");if(await Bun.file(e).exists())return e;return null}async function Cr(t,n){try{let e=await Bun.file(t).text(),r=e,o=e.match(/<template\b[^>]*>([\s\S]*?)<\/template>/i);if(o)r=o[1].trim();let s=io(e),a=[...s.client.map((m)=>m.fullTag),...s.signals.map((m)=>m.fullTag)],i=[],c=/<style\b[^>]*>([\s\S]*?)<\/style>/gi,f;while((f=c.exec(e))!==null)i.push(f[0]);let l=r;for(let m of s.server)l=l.replace(m.fullTag,"");for(let m of s.client)l=l.replace(m.fullTag,"");l=l.replace(/<style\b[^>]*>[\s\S]*?<\/style>/gi,"");let g="<!--__STX_PAGE_SLOT__-->";if(l=l.replace(/<slot\s*\/>/gi,g).replace(/<slot\s*>\s*<\/slot>/gi,g),!l.includes(g))return console.warn(`[stx] Shell ${t} has no <slot /> \u2014 pages won't be injected`),null;let{processDirectives:d,extractVariables:h,defaultConfig:S,loadStxConfig:b}=await import("./chunk-pykeaf4h.js"),R=await b(),p={__filename:t,__dirname:v.dirname(t)};for(let m of a){let C=m.match(/<script\b[^>]*>([\s\S]*?)<\/script>/i);if(C&&!m.includes("client")&&!m.includes('type="module"'))await h(C[1],p,t)}let y=await d(l,p,t,{...S,...R,...n},new Set),w=y.indexOf(g);if(w===-1)return console.warn("[stx] Shell slot placeholder lost during processing"),null;return{beforeSlot:y.substring(0,w),afterSlot:y.substring(w+g.length),filePath:t,shellScripts:a,shellStyles:i}}catch(e){return console.error(`[stx] Error processing shell ${t}:`,e),null}}function An(t,n,e){let r,o="",s=n.match(U);if(s){n=n.replace(s[0],"");try{let l=Buffer.from(s[1],"base64").toString("utf8"),g=l.match(/<title[^>]*>([\s\S]*?)<\/title>/i);if(g)r=g[1].trim();o=l.replace(/<title[^>]*>[\s\S]*?<\/title>/i,"").trim()}catch{}}let a=e||r||"stx App",i=W(),c="<script>window.__stxRouterConfig={container:'[data-stx-content]'};</script>";return`<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8">
|
|
@@ -18,13 +18,13 @@ ${t.shellScripts.filter((l)=>!l.includes("server")).join(`
|
|
|
18
18
|
${c}
|
|
19
19
|
${i}
|
|
20
20
|
</body>
|
|
21
|
-
</html>`}function me(t,n={}){let e=t.trim();if(!Tt(e))return t;let r=[],o=e.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(o){let c=o[1],
|
|
22
|
-
`),"utf8").toString("base64")}-->`)}let s=e.match(/<body\b[^>]*>/i),a=e.lastIndexOf("</body>");if(s&&a!==-1){let c=s.index+s[0].length,
|
|
21
|
+
</html>`}function me(t,n={}){let e=t.trim();if(!Tt(e))return t;let r=[],o=e.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(o){let c=o[1],f=/<style\b[^>]*>[\s\S]*?<\/style>/gi,l;while((l=f.exec(c))!==null)r.push(l[0]);let g=c.match(/<script\b[^>]*data-stx-server-data[^>]*>[\s\S]*?<\/script>/i);if(g)r.push(g[0]);let d=c.match(/<script\b[^>]*data-stx-runtime-config[^>]*>[\s\S]*?<\/script>/i);if(d)r.push(d[0])}if(n.preserveHead&&o){let c=[],f=/<title\b[^>]*>[\s\S]*?<\/title>|<meta\b[^>]*>|<link\b[^>]*>/gi,l;while((l=f.exec(o[1]))!==null){if(/<meta\b[^>]*(?:\bcharset|name="viewport")/i.test(l[0]))continue;c.push(l[0])}if(c.length>0)r.unshift(`<!--${G}${Buffer.from(c.join(`
|
|
22
|
+
`),"utf8").toString("base64")}-->`)}let s=e.match(/<body\b[^>]*>/i),a=e.lastIndexOf("</body>");if(s&&a!==-1){let c=s.index+s[0].length,f=e.slice(c,a).trim();if(r.length>0)return r.join(`
|
|
23
23
|
`)+`
|
|
24
|
-
`+
|
|
25
|
-
`));return i=i.replace(/<body\b[^>]*>/i,""),i=i.replace(/<\/body\s*>/i,""),i.trim()}var N=/^<script\b[^>]*\sdata-stx-(?:owner|instance)(?=[\s=/>])/i;function X(t,n,e,r){if(!N.test(n))return!1;let o=n.slice(0,n.indexOf(">")+1),s=/\sdata-stx-owner="([^"]+)"/i.exec(o)?.[1];if(!s)return!0;let a=`data-stx-scope="${s}"`;for(let i=t.indexOf(a);i!==-1;i=t.indexOf(a,i+a.length))if(i>=e&&i<r)return!1;return!0}function lo(t){return ne(t)}function re(t,n="main"){let e=t.trim(),r=[],o=[],s=e.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(s){let b=s[1],R=/<style\b[^>]*>[\s\S]*?<\/style>/gi,
|
|
24
|
+
`+f;return f}let i=e;if(i=i.replace(/<!DOCTYPE\b[^>]*>/i,""),i=i.replace(/<html\b[^>]*>/i,""),i=i.replace(/<\/html\s*>/i,""),o)i=i.replace(/<head\b[^>]*>[\s\S]*?<\/head>/i,r.join(`
|
|
25
|
+
`));return i=i.replace(/<body\b[^>]*>/i,""),i=i.replace(/<\/body\s*>/i,""),i.trim()}var N=/^<script\b[^>]*\sdata-stx-(?:owner|instance)(?=[\s=/>])/i;function X(t,n,e,r){if(!N.test(n))return!1;let o=n.slice(0,n.indexOf(">")+1),s=/\sdata-stx-owner="([^"]+)"/i.exec(o)?.[1];if(!s)return!0;let a=`data-stx-scope="${s}"`;for(let i=t.indexOf(a);i!==-1;i=t.indexOf(a,i+a.length))if(i>=e&&i<r)return!1;return!0}function lo(t){return ne(t)}function re(t,n="main"){let e=t.trim(),r=[],o=[],s=e.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i);if(s){let b=s[1],R=/<style\b[^>]*>[\s\S]*?<\/style>/gi,p;while((p=R.exec(b))!==null)r.push(p[0]);let y=/<script\b[^>]*data-stx-(?:route-params|server-data|scoped|component-factories)[^>]*>[\s\S]*?<\/script>/gi;while((p=y.exec(b))!==null){if(N.test(p[0])||p[0].includes("__stx_early_mounts")||/^<script\b[^>]*\bdata-stx-runtime(?=[\s=>])/i.test(p[0]))continue;o.push(p[0])}}let a=T(e,n);if(!a)return me(t);let{tagName:i,start:c,end:f}=a,l=e.slice(c,f).trim(),g=[],d=e.match(/<body\b[^>]*>/i),h=e.lastIndexOf("</body>");if(d&&d.index!==void 0&&h!==-1){let R=[[d.index+d[0].length,a.openIndex],[f+`</${i}>`.length,h]],p=/<script\b[^>]*>[\s\S]*?<\/script>/gi;for(let[y,w]of R){if(y>=w)continue;let m=e.slice(y,w),C;p.lastIndex=0;while((C=p.exec(m))!==null){if(X(e,C[0],c,f))continue;g.push(C[0])}}}let S=[];if(r.length>0)S.push(r.join(`
|
|
26
26
|
`));if(o.length>0)S.push(o.join(`
|
|
27
|
-
`));if(
|
|
27
|
+
`));if(g.length>0)S.push(g.join(`
|
|
28
28
|
`));return S.push(l),S.join(`
|
|
29
|
-
`)}function E(t,n,e={}){let r=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`;if(e.maxAge!==void 0)r+=`; Max-Age=${e.maxAge}`;if(e.expires)r+=`; Expires=${e.expires.toUTCString()}`;if(e.path)r+=`; Path=${e.path}`;if(e.domain)r+=`; Domain=${e.domain}`;if(e.secure)r+="; Secure";if(e.httpOnly)r+="; HttpOnly";if(e.sameSite)r+=`; SameSite=${e.sameSite}`;return r}async function J(t){let n=t.headers.get("content-type")||"",e={},r=(o,s)=>{let a=e[o];if(a===void 0)e[o]=s;else if(Array.isArray(a))a.push(s);else e[o]=[a,s]};if(n.includes("multipart/form-data")){let o=await t.formData();for(let[s,a]of o.entries())if(typeof a==="string")r(s,a);return e}if(n.includes("application/x-www-form-urlencoded")){for(let[o,s]of new URLSearchParams(await t.text()).entries())r(o,s);return e}return e}function
|
|
30
|
-
export{io,Ae,ao,ne,_,co,Cr,An,me,lo,re,uo,po,fo
|
|
29
|
+
`)}function E(t,n,e={}){let r=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`;if(e.maxAge!==void 0)r+=`; Max-Age=${e.maxAge}`;if(e.expires)r+=`; Expires=${e.expires.toUTCString()}`;if(e.path)r+=`; Path=${e.path}`;if(e.domain)r+=`; Domain=${e.domain}`;if(e.secure)r+="; Secure";if(e.httpOnly)r+="; HttpOnly";if(e.sameSite)r+=`; SameSite=${e.sameSite}`;return r}async function J(t){let n=t.headers.get("content-type")||"",e={},r=(o,s)=>{let a=e[o];if(a===void 0)e[o]=s;else if(Array.isArray(a))a.push(s);else e[o]=[a,s]};if(n.includes("multipart/form-data")){let o=await t.formData();for(let[s,a]of o.entries())if(typeof a==="string")r(s,a);return e}if(n.includes("application/x-www-form-urlencoded")){for(let[o,s]of new URLSearchParams(await t.text()).entries())r(o,s);return e}return e}function Er(t){if(!t)return!1;let n=t.toUpperCase();return n!=="GET"&&n!=="HEAD"}async function I(t,n={}){let e=n.request,r=n.method??e?.method;if(!e||!Er(r))return{ran:!1};if(typeof t.action!=="function")return{ran:!1};let o={};try{o=await J(e)}catch{}let s=await t.action({request:e,form:o,params:n.params??{},query:t.query??{},cookies:n.cookies??{}});if(s&&typeof s==="object"){let a=s,i=K(a.cookies),c=a.redirect;if(typeof c==="string"&&c)return{redirect:c,ran:!0,...i.length>0?{cookies:i}:{}};let{cookies:f,redirect:l,...g}=a;if(Object.assign(t,g),i.length>0)return{ran:!0,cookies:i}}return{ran:!0}}function K(t){if(!t||typeof t!=="object"||Array.isArray(t))return[];let n=[];for(let[e,r]of Object.entries(t)){if(!e)continue;if(typeof r==="string"){n.push(E(e,r));continue}if(r&&typeof r==="object"){let o=r;if(typeof o.value!=="string")continue;n.push(E(e,o.value,o))}}return n}function go(t,n=[],e){let r=new Headers({Location:t,"Cache-Control":"no-store"});for(let o of n)r.append("Set-Cookie",o);for(let[o,s]of Object.entries(e??{}))if(o.toLowerCase()!=="location")r.set(o,s);return new Response(null,{status:303,headers:r})}import k from"fs";import j from"path";function uo(t,n,e){return{version:1,buildTime:new Date().toISOString(),routes:t,assets:n,outputDir:e}}function po(t,n){let e=j.join(n,"manifest.json");k.writeFileSync(e,JSON.stringify(t,null,2))}function fo(t){let n=j.join(t,"manifest.json");if(!k.existsSync(n))return null;try{let e=k.readFileSync(n,"utf-8"),r=JSON.parse(e);if(r.version!==1)return console.warn(`[stx] Manifest version mismatch: expected 1, got ${r.version}`),null;return r}catch(e){return console.warn("[stx] Failed to load manifest:",e),null}}async function Ot(t,n={}){let{html:e,context:r,redirect:o,cookies:s}=await Z(t,n),a=Fe(r),i=ze(r);if(o)return{html:e,redirect:o,cookies:s,status:a,headers:i};let{extractStreamBoundaries:c}=await import("./chunk-37hm4er5.js"),f=c(r),l=t.streamTemplates;if(l&&Object.keys(l).length>0){let{processDirectives:g}=await import("./chunk-wrghqec5.js"),{defaultConfig:d}=await import("./chunk-hzjk2027.js"),h=r.streamBoundaries||{},S={...d,autoShell:!1},b=Object.keys(l).map((p)=>({id:p,render:async()=>{let y=typeof h[p]==="function"?await h[p]():void 0;return g(l[p],{...r,$boundary:y},t.sourceFile,S,new Set)}})),R=new Set(b.map((p)=>p.id));f=[...(f||[]).filter((p)=>!R.has(p.id)),...b]}return{html:e,boundaries:f&&f.length>0?f:void 0,cookies:s,status:a,headers:i}}async function Z(t,n){let e={__filename:t.sourceFile,__dirname:t.sourceFile.replace(/[/\\][^/\\]+$/,""),...n};if(!t.hasServerScripts&&!Qr(t.html))return{html:t.html,context:e};for(let a of t.serverScriptContent)try{await u(a,e,t.sourceFile)}catch(i){if(n.__stx_strict_hydration)throw i;console.warn(`[stx] Server script error in ${t.sourceFile}:`,i)}let r=await I(e,{request:n.request,method:n.method,params:n.params??{},cookies:n.cookies??{}}),o=(a)=>{let i=a.replace(/<script\b[^>]*\bdata-stx-server-data\b[^>]*>[\s\S]*?<\/script>/gi,""),c=Kn(e);if(!c)return i;let f=i.indexOf("</head>");return f<0?c+i:i.slice(0,f)+c+i.slice(f)};if(r.redirect)return{html:t.html,context:e,redirect:r.redirect,cookies:r.cookies};if(!Qr(t.html))return{html:o(t.html),context:e,cookies:r.cookies};let s=new Map;for(let[a,i]of Object.entries(t.placeholders))if(i.expression)try{let c=x(i.expression,e);if(i.type==="raw")s.set(a,c!==void 0&&c!==null?String(c):"");else s.set(a,c!==void 0&&c!==null?St(String(c)):"")}catch(c){if(n.__stx_strict_hydration)throw c;s.set(a,"")}return{html:o(qo(t.html,s)),context:e,cookies:r.cookies}}
|
|
30
|
+
export{io,Ae,ao,ne,_,co,Cr,An,me,lo,re,uo,po,fo,Er,go,Ot};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import I from"fs";import u from"path";import V from"os";import x from"crypto";import{generatePlaceholder as C,processImage as D}from"ts-images";var j=[320,640,768,1024,1280,1536,1920],B=["webp","jpeg"],F=80,O=[".jpg",".jpeg",".png",".webp",".avif",".gif",".svg"],L={webp:"image/webp",avif:"image/avif",jpeg:"image/jpeg",png:"image/png"},w=null,v=!1;async function p(){if(v)return w;v=!0;try{let t=await import("sharp");return w=t.default||t,w}catch{return null}}async function Nt(){return await p()!==null}async function J(){return!0}async function se(t,e={}){let{widths:a=j,formats:r=B,quality:n=F,fit:i="cover",placeholder:m="none",outputDir:o=".stx/images",baseUrl:b="/images"}=e,h,g;if(typeof t==="string"){if(g=t,!await Bun.file(t).exists())throw new In(`Image not found: ${t}`,"NOT_FOUND");h=await Bun.file(t).arrayBuffer().then((s)=>Buffer.from(s))}else g="buffer-input",h=t;let y=x.createHash("sha256").update(h).digest("hex").slice(0,12),k=await Pn(h),{width:c,height:S}=k,P=c/S;await I.promises.mkdir(o,{recursive:!0});let E=[],R=u.basename(g,u.extname(g)),l=a.filter((s)=>s<=c);if(!l.includes(c)&&c<=Math.max(...a))l.push(c);l.sort((s,f)=>s-f);for(let s of l){let f=Math.round(s/P);for(let d of r){let U=`${R}-${s}w-${y}.${d}`,A=u.join(o,U),T=`${b}/${U}`,q=await ia(h,{width:s,height:f,format:d,quality:n,fit:i});await Bun.write(A,q),E.push({path:A,url:T,width:s,height:f,format:d,size:q.length})}}let M;if(m!=="none")M=await _(h,m);return{src:g,variants:E,placeholder:M,width:c,height:S,aspectRatio:P,hash:y}}async function Pn(t){let e=typeof t==="string"?Buffer.from(await Bun.file(t).arrayBuffer()):t,a=await p();if(a){let n=await a(e).metadata();return{width:n.width||0,height:n.height||0,format:n.format||"unknown",hasAlpha:n.hasAlpha}}return N(e)}function N(t){if(t[0]===137&&t[1]===80&&t[2]===78&&t[3]===71){let e=t.readUInt32BE(16),a=t.readUInt32BE(20);return{width:e,height:a,format:"png",hasAlpha:!0}}if(t[0]===255&&t[1]===216){let e=2;while(e<t.length){if(t[e]!==255)break;let a=t[e+1];if(a>=192&&a<=207&&a!==196&&a!==200&&a!==204){let n=t.readUInt16BE(e+5);return{width:t.readUInt16BE(e+7),height:n,format:"jpeg",hasAlpha:!1}}let r=t.readUInt16BE(e+2);e+=2+r}}if(t.toString("utf8",0,4)==="RIFF"&&t.toString("utf8",8,12)==="WEBP"){let e=t.toString("utf8",12,16);if(e==="VP8 "){let a=t.readUInt16LE(26)&16383,r=t.readUInt16LE(28)&16383;return{width:a,height:r,format:"webp",hasAlpha:!1}}if(e==="VP8L"){let a=t.readUInt32LE(21),r=(a&16383)+1,n=(a>>14&16383)+1;return{width:r,height:n,format:"webp",hasAlpha:!0}}}if(t.toString("utf8",0,3)==="GIF"){let e=t.readUInt16LE(6),a=t.readUInt16LE(8);return{width:e,height:a,format:"gif",hasAlpha:!0}}throw new In("Unable to parse image dimensions","PARSE_ERROR")}async function ia(t,e){let a=await p();if(a){let n=a(t).resize(e.width,e.height,{fit:e.fit});switch(e.format){case"webp":n=n.webp({quality:e.quality});break;case"avif":n=n.avif({quality:e.quality});break;case"jpeg":n=n.jpeg({quality:e.quality});break;case"png":n=n.png({quality:e.quality});break}return n.toBuffer()}let r=u.join(V.tmpdir(),`stx-img-${x.randomBytes(8).toString("hex")}.${e.format}`);try{return await D({input:t,output:r,format:e.format,quality:e.quality,resize:{width:e.width,height:e.height,fit:e.fit}}),Buffer.from(await Bun.file(r).arrayBuffer())}finally{await I.promises.unlink(r).catch(()=>{})}}async function _(t,e){let a=await p();if(e==="blur"&&a){let m=(await a(t).resize(20).blur(10).toBuffer()).toString("base64"),o=await Pn(t);return`data:${L[o.format]||"image/jpeg"};base64,${m}`}if(e==="dominant-color"&&a){let{dominant:i}=await a(t).resize(1,1).toBuffer().then(async(m)=>{let o=await a(m).metadata();return{dominant:{r:128,g:128,b:128}}}).catch(()=>({dominant:{r:128,g:128,b:128}}));return`rgb(${i.r}, ${i.g}, ${i.b})`}let r=await Pn(t),n=u.join(V.tmpdir(),`stx-ph-${x.randomBytes(8).toString("hex")}.${r.format==="unknown"?"bin":r.format}`);try{await Bun.write(n,t);let i=e==="blur"?"blur":e==="thumbhash"?"thumbhash":"dominant-color",o=await C(n,{strategy:i,width:i==="thumbhash"?void 0:32});if(e==="dominant-color"&&o.dominantColor)return o.dominantColor;if(o.dataURL)return o.dataURL;return"rgb(128, 128, 128)"}catch{return"rgb(128, 128, 128)"}finally{await I.promises.unlink(n).catch(()=>{})}}function Pe(t,e){return(e?t.filter((r)=>r.format===e):t).sort((r,n)=>r.width-n.width).map((r)=>`${r.url} ${r.width}w`).join(", ")}function
|
|
3
|
-
export{j,B,F,Nt,J,se,Pn,ia,Pe,
|
|
2
|
+
import I from"fs";import u from"path";import V from"os";import x from"crypto";import{generatePlaceholder as C,processImage as D}from"ts-images";var j=[320,640,768,1024,1280,1536,1920],B=["webp","jpeg"],F=80,O=[".jpg",".jpeg",".png",".webp",".avif",".gif",".svg"],L={webp:"image/webp",avif:"image/avif",jpeg:"image/jpeg",png:"image/png"},w=null,v=!1;async function p(){if(v)return w;v=!0;try{let t=await import("sharp");return w=t.default||t,w}catch{return null}}async function Nt(){return await p()!==null}async function J(){return!0}async function se(t,e={}){let{widths:a=j,formats:r=B,quality:n=F,fit:i="cover",placeholder:m="none",outputDir:o=".stx/images",baseUrl:b="/images"}=e,h,g;if(typeof t==="string"){if(g=t,!await Bun.file(t).exists())throw new In(`Image not found: ${t}`,"NOT_FOUND");h=await Bun.file(t).arrayBuffer().then((s)=>Buffer.from(s))}else g="buffer-input",h=t;let y=x.createHash("sha256").update(h).digest("hex").slice(0,12),k=await Pn(h),{width:c,height:S}=k,P=c/S;await I.promises.mkdir(o,{recursive:!0});let E=[],R=u.basename(g,u.extname(g)),l=a.filter((s)=>s<=c);if(!l.includes(c)&&c<=Math.max(...a))l.push(c);l.sort((s,f)=>s-f);for(let s of l){let f=Math.round(s/P);for(let d of r){let U=`${R}-${s}w-${y}.${d}`,A=u.join(o,U),T=`${b}/${U}`,q=await ia(h,{width:s,height:f,format:d,quality:n,fit:i});await Bun.write(A,q),E.push({path:A,url:T,width:s,height:f,format:d,size:q.length})}}let M;if(m!=="none")M=await _(h,m);return{src:g,variants:E,placeholder:M,width:c,height:S,aspectRatio:P,hash:y}}async function Pn(t){let e=typeof t==="string"?Buffer.from(await Bun.file(t).arrayBuffer()):t,a=await p();if(a){let n=await a(e).metadata();return{width:n.width||0,height:n.height||0,format:n.format||"unknown",hasAlpha:n.hasAlpha}}return N(e)}function N(t){if(t[0]===137&&t[1]===80&&t[2]===78&&t[3]===71){let e=t.readUInt32BE(16),a=t.readUInt32BE(20);return{width:e,height:a,format:"png",hasAlpha:!0}}if(t[0]===255&&t[1]===216){let e=2;while(e<t.length){if(t[e]!==255)break;let a=t[e+1];if(a>=192&&a<=207&&a!==196&&a!==200&&a!==204){let n=t.readUInt16BE(e+5);return{width:t.readUInt16BE(e+7),height:n,format:"jpeg",hasAlpha:!1}}let r=t.readUInt16BE(e+2);e+=2+r}}if(t.toString("utf8",0,4)==="RIFF"&&t.toString("utf8",8,12)==="WEBP"){let e=t.toString("utf8",12,16);if(e==="VP8 "){let a=t.readUInt16LE(26)&16383,r=t.readUInt16LE(28)&16383;return{width:a,height:r,format:"webp",hasAlpha:!1}}if(e==="VP8L"){let a=t.readUInt32LE(21),r=(a&16383)+1,n=(a>>14&16383)+1;return{width:r,height:n,format:"webp",hasAlpha:!0}}}if(t.toString("utf8",0,3)==="GIF"){let e=t.readUInt16LE(6),a=t.readUInt16LE(8);return{width:e,height:a,format:"gif",hasAlpha:!0}}throw new In("Unable to parse image dimensions","PARSE_ERROR")}async function ia(t,e){let a=await p();if(a){let n=a(t).resize(e.width,e.height,{fit:e.fit});switch(e.format){case"webp":n=n.webp({quality:e.quality});break;case"avif":n=n.avif({quality:e.quality});break;case"jpeg":n=n.jpeg({quality:e.quality});break;case"png":n=n.png({quality:e.quality});break}return n.toBuffer()}let r=u.join(V.tmpdir(),`stx-img-${x.randomBytes(8).toString("hex")}.${e.format}`);try{return await D({input:t,output:r,format:e.format,quality:e.quality,resize:{width:e.width,height:e.height,fit:e.fit}}),Buffer.from(await Bun.file(r).arrayBuffer())}finally{await I.promises.unlink(r).catch(()=>{})}}async function _(t,e){let a=await p();if(e==="blur"&&a){let m=(await a(t).resize(20).blur(10).toBuffer()).toString("base64"),o=await Pn(t);return`data:${L[o.format]||"image/jpeg"};base64,${m}`}if(e==="dominant-color"&&a){let{dominant:i}=await a(t).resize(1,1).toBuffer().then(async(m)=>{let o=await a(m).metadata();return{dominant:{r:128,g:128,b:128}}}).catch(()=>({dominant:{r:128,g:128,b:128}}));return`rgb(${i.r}, ${i.g}, ${i.b})`}let r=await Pn(t),n=u.join(V.tmpdir(),`stx-ph-${x.randomBytes(8).toString("hex")}.${r.format==="unknown"?"bin":r.format}`);try{await Bun.write(n,t);let i=e==="blur"?"blur":e==="thumbhash"?"thumbhash":"dominant-color",o=await C(n,{strategy:i,width:i==="thumbhash"?void 0:32});if(e==="dominant-color"&&o.dominantColor)return o.dominantColor;if(o.dataURL)return o.dataURL;return"rgb(128, 128, 128)"}catch{return"rgb(128, 128, 128)"}finally{await I.promises.unlink(n).catch(()=>{})}}function Pe(t,e){return(e?t.filter((r)=>r.format===e):t).sort((r,n)=>r.width-n.width).map((r)=>`${r.url} ${r.width}w`).join(", ")}function ut(t){if(!t||Object.keys(t).length===0)return"100vw";return Object.entries(t).sort((a,r)=>{let n=Number.parseInt(a[0].replace(/\D/g,""))||0;return(Number.parseInt(r[0].replace(/\D/g,""))||0)-n}).map(([a,r])=>`(max-width: ${a}) ${r}`).join(", ")+", 100vw"}function Lt(t){let e=t.filter((r)=>r.format==="jpeg");if(e.length===0)return t[Math.floor(t.length/2)];let a=e.sort((r,n)=>r.width-n.width);return a[Math.floor(a.length/2)]}function jt(t){let e=new Map;for(let a of t){let r=e.get(a.format)||[];r.push(a),e.set(a.format,r)}return e}function Bt(t){let e=u.extname(t).toLowerCase();return O.includes(e)}function z(t){return L[t]||"application/octet-stream"}function Ft(t){return t.reduce((e,a)=>e+a.size,0)}function zt(t){if(t<1024)return`${t} B`;if(t<1048576)return`${(t/1024).toFixed(1)} KB`;return`${(t/1048576).toFixed(2)} MB`}class In extends Error{code;constructor(t,e){super(t);this.name="ImageProcessingError",this.code=e}}
|
|
3
|
+
export{j,B,F,Nt,J,se,Pn,ia,Pe,ut,Lt,jt,Bt,z,Ft,zt,In};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{$e,_e,Te}from"./chunk-czmw5xsd.js";import{it,at,Ee,Ws,ct,lt}from"./chunk-c322rrge.js";import o from"fs";import i from"path";var c=[];function m(a){c=[];for(let e of a.storyFiles)if(c.push({text:e.fileName.toLowerCase(),original:e.fileName,type:"story",storyId:e.id}),c.push({text:e.relativePath.toLowerCase(),original:e.relativePath,type:"story",storyId:e.id}),e.story)for(let t of e.story.variants)c.push({text:t.title.toLowerCase(),original:t.title,type:"story",storyId:e.id,variantId:t.id})}function f(){return JSON.stringify(c)}async function F(a={}){let e=Date.now();it();let t=await $e({mode:"build"});if(!t.config.enabled){Ee("Story feature is disabled in config.");return}let n=await ct(t);_e(t,n);let l=lt(t.config,n);Te(t,l),at(n.length);let d=a.outDir??t.config.outDir,s=i.resolve(t.root,d);await o.promises.mkdir(s,{recursive:!0}),console.log(` Building to ${d}...`);let g=v(t);await o.promises.writeFile(i.join(s,"index.html"),g);let y={files:n.map((r)=>({id:r.id,fileName:r.fileName,relativePath:r.relativePath,treePath:r.treePath})),tree:l};await o.promises.writeFile(i.join(s,"stories.json"),JSON.stringify(y,null,2));let u={theme:t.config.theme,responsivePresets:t.config.responsivePresets,backgroundPresets:t.config.backgroundPresets};await o.promises.writeFile(i.join(s,"config.json"),JSON.stringify(u,null,2));let p=i.join(s,"stories");await o.promises.mkdir(p,{recursive:!0});for(let r of n){let b=await o.promises.readFile(r.path,"utf-8");await o.promises.writeFile(i.join(p,`${r.id}.stx`),b)}m(t);let h=f();await o.promises.writeFile(i.join(s,"search-index.json"),h);let x=Date.now()-e;Ws(n.length,d,x)}function v(a){let{theme:e}=a.config,t=e.title||"STX Story";return`<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8">
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ui,Wi}from"./chunk-2242bx8y.js";import"./chunk-78yx6xxn.js";import"./chunk-a771dfsg.js";import"./chunk-49p5j9ab.js";import"./chunk-2j04bc8c.js";import"./chunk-jt842kx3.js";import"./chunk-01rz8h7x.js";import"./chunk-5kq996qy.js";import{io}from"./chunk-mfcdbqvd.js";import"./chunk-4hz4g5ym.js";import"./chunk-jcmgj8kk.js";import"./chunk-szkqmwjg.js";import"./chunk-ej46bkaw.js";import"./chunk-n34kagea.js";import"./chunk-0gp4sj0v.js";import"./chunk-3y8ykqpx.js";import"./chunk-zv0vgamy.js";import"./chunk-fesb4h31.js";import"./chunk-g7wgpys2.js";import"./chunk-ygetbydb.js";import"./chunk-8xpyzcq2.js";import"./chunk-67actssw.js";import"./chunk-x96ardq0.js";import"./chunk-h6q8jafh.js";import"./chunk-3s9s1mdt.js";import"./chunk-s9mq9x2k.js";import"./chunk-1c407nky.js";import"./chunk-xx2pk2ay.js";import"./chunk-gxs2p0y7.js";import"./chunk-38mtn4ce.js";import"./chunk-dn9fxpwt.js";import"./chunk-17fan751.js";import"./chunk-er7y8hk9.js";import"./chunk-kbhm1wqt.js";import"./chunk-fd6abk20.js";import"./chunk-2hc5mbw8.js";import{he,nn,rn,K,u,n,Jn,I,o,le}from"./chunk-0np4t9ka.js";import"./chunk-azza6dcr.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-a5c75hxe.js";import"./chunk-6k4f583z.js";import"./chunk-133ggr0t.js";import"./chunk-5cyz97t4.js";import"./chunk-798epzq5.js";import"./chunk-d4k4nyj0.js";import"./chunk-xsc9zbaj.js";import"./chunk-xd4zvm4x.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,u as extractVariables,K as injectRouterScript,o as loadStxConfig,he as processClientScript,n as processDirectives,le as readMarkdownFile};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ds,su,ou,Ai,fe,jc,or,iu,au,cu,lu,du,uu,pu,fu,gu}from"./chunk-5cyz97t4.js";import"./chunk-798epzq5.js";export{uu as applyHead,iu as definePageMeta,Ds as getHead,su as getPageMeta,fe as mergeHeadConfigs,pu as processHeadDirective,gu as processMetaDirective,fu as processTitleDirective,du as renderBodyAttrs,cu as renderHead,lu as renderHtmlAttrs,ou as resetHead,or as seoMetaToHeadConfig,Ai as useHead,au as usePageTitle,jc as useSeoMeta,au as useTitle};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{_r,Tr,Rr,da,ua,pa,yo,fa,ga}from"./chunk-3y8ykqpx.js";export{_r as ImageProcessorCache,yo as applyTransformations,da as clearImageCache,fa as generateResponsiveVariants,ga as generateSrcset,Tr as getCachedImageResult,pa as optimizeImage,ua as processImage,Rr as setCachedImageResult};
|
|
@@ -825,5 +825,5 @@ self.addEventListener('message', (event) => {
|
|
|
825
825
|
event.waitUntil(registerFormSync(event.data.payload));
|
|
826
826
|
}
|
|
827
827
|
});
|
|
828
|
-
`}function Oe(e){return e.pwa?.serviceWorker?.fileName||"sw.js"}function Bo(e){return e.pwa?.enabled===!0&&e.pwa?.serviceWorker?.useWorkbox===!0}function Wa(e,a){if(!e.pwa?.enabled)return"";if(Bo(e)){let{generateWorkboxServiceWorker:t}=import.meta.require("./chunk-
|
|
828
|
+
`}function Oe(e){return e.pwa?.serviceWorker?.fileName||"sw.js"}function Bo(e){return e.pwa?.enabled===!0&&e.pwa?.serviceWorker?.useWorkbox===!0}function Wa(e,a){if(!e.pwa?.enabled)return"";if(Bo(e)){let{generateWorkboxServiceWorker:t}=import.meta.require("./chunk-t77pz252.js");return t(e,a)}return Ln(e,a)}
|
|
829
829
|
export{Ln,Oe,Bo,Wa};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ea,oo,rl,ta,na,sl,ol}from"./chunk-jt842kx3.js";import"./chunk-x96ardq0.js";import"./chunk-kbhm1wqt.js";import"./chunk-fd6abk20.js";import"./chunk-2hc5mbw8.js";import{He,fc}from"./chunk-0np4t9ka.js";import"./chunk-azza6dcr.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-a5c75hxe.js";import"./chunk-6k4f583z.js";import"./chunk-133ggr0t.js";import"./chunk-5cyz97t4.js";import"./chunk-798epzq5.js";import"./chunk-d4k4nyj0.js";import"./chunk-xsc9zbaj.js";import"./chunk-xd4zvm4x.js";import"./chunk-e6y6s7q8.js";export{ea as buildVirtualSource,He as extractScriptBlocks,fc as extractTemplateExpressions,ta as findRuntimeTypeDeclarations,na as findStxModuleDeclarations,ol as formatTypecheckDiagnostics,rl as sourcePathFor,sl as typecheckStxFiles,oo as virtualPathFor};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Lr,Ml,Nl}from"./chunk-x96ardq0.js";import"./chunk-kbhm1wqt.js";import"./chunk-fd6abk20.js";import"./chunk-2hc5mbw8.js";import"./chunk-0np4t9ka.js";import"./chunk-azza6dcr.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-a5c75hxe.js";import"./chunk-6k4f583z.js";import"./chunk-133ggr0t.js";import"./chunk-5cyz97t4.js";import"./chunk-798epzq5.js";import"./chunk-d4k4nyj0.js";import"./chunk-xsc9zbaj.js";import"./chunk-xd4zvm4x.js";import"./chunk-e6y6s7q8.js";export{Nl as clearComposableCache,Ml as getComposableScript,Lr as listComposableModules};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Et,bc,vc,wc,xc,Sc,u,kc,ps,Cc,ci,li}from"./chunk-0np4t9ka.js";import"./chunk-azza6dcr.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-a5c75hxe.js";import"./chunk-6k4f583z.js";import"./chunk-133ggr0t.js";import"./chunk-5cyz97t4.js";import"./chunk-798epzq5.js";import"./chunk-d4k4nyj0.js";import"./chunk-xsc9zbaj.js";import"./chunk-xd4zvm4x.js";import"./chunk-e6y6s7q8.js";export{Et as STX_ENGINE_BINDING_NAMES,ps as convertToCommonJS,ci as extractScriptFromTemplate,u as extractVariables,li as hasVariables,kc as isCompleteImport,Sc as isMissingBindingFailure,wc as isModuleResolutionFailure,xc as isSyntaxFailure,Cc as splitDeclaration,bc as stripTypeScript,vc as withoutStxReferrer};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{o}from"./chunk-
|
|
3
|
-
export{
|
|
2
|
+
import{o}from"./chunk-0np4t9ka.js";import{$r}from"./chunk-2etevws0.js";import p from"path";async function vl(t={}){let d=performance.now(),s=t.root||process.cwd(),e=await o(s),u=t.ssr?.routeRules??e.routeRules??{};if($r(u),!e.ssr&&Object.keys(u).length)throw Error("routeRules require ssr: true and the production server; flat SSG output cannot apply request/cache policies");if(!e.ssr&&(t.ssr?.serverApi??e.serverApi))throw Error("serverApi requires ssr: true; flat SSG output cannot execute API endpoints");let r=e.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${r.toUpperCase()}${e.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let n,l;if(r==="ssg"){let{generateStaticSite:i}=await import("./ssg.js");n=await i({pagesDir:p.join(e.root||".",e.pagesDir||e.build?.pagesDir||"pages"),publicDir:e.publicDir||e.build?.publicDir||"public",outputDir:e.build?.outputDir||"dist",generate404:e.build?.generate404??!0,minify:e.build?.minify??!0,cleanOutput:e.build?.cleanOutput??!0,router:e.router,...t.ssg})}else{let{buildForProduction:i}=await import("./chunk-k0zadypg.js");l=await i({root:s,outputDir:".output",debug:t.debug,...t.ssr})}let a=Math.round(performance.now()-d);return{mode:r,ssg:n,ssr:l,duration:a}}
|
|
3
|
+
export{vl};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{xt,gs,di,Ec}from"./chunk-0np4t9ka.js";import"./chunk-azza6dcr.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-a5c75hxe.js";import"./chunk-6k4f583z.js";import"./chunk-133ggr0t.js";import"./chunk-5cyz97t4.js";import"./chunk-798epzq5.js";import"./chunk-d4k4nyj0.js";import"./chunk-xsc9zbaj.js";import"./chunk-xd4zvm4x.js";import"./chunk-e6y6s7q8.js";export{Ec as declareBareLoopHead,xt as parseLoopBinding,di as processLoops,gs as reportDeferredLoopWarnings};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{oe,gt}from"./chunk-hkjqqx92.js";import{ge}from"./chunk-
|
|
2
|
+
import{oe,gt}from"./chunk-hkjqqx92.js";import{ge}from"./chunk-vtxzaj1h.js";function m(e){let t={"cache-first":{className:"CacheFirst",importFrom:"workbox-strategies"},"network-first":{className:"NetworkFirst",importFrom:"workbox-strategies"},"stale-while-revalidate":{className:"StaleWhileRevalidate",importFrom:"workbox-strategies"},"network-only":{className:"NetworkOnly",importFrom:"workbox-strategies"},"cache-only":{className:"CacheOnly",importFrom:"workbox-strategies"}};return t[e]||t["network-first"]}function g(e){return m(e).className}function d(e){let t=e.pwa;if(!t?.enabled)return"";let r=t.routes||[],n=t.cacheStorage,c=[];for(let a of r){let i=g(a.strategy),s=[];if(a.maxAgeSeconds||a.maxEntries||n?.maxEntries){let o=a.maxEntries||n?.maxEntries||100,u=a.maxAgeSeconds||(n?.maxAge?n.maxAge*24*60*60:void 0);s.push(`new ExpirationPlugin({
|
|
3
3
|
maxEntries: ${o},
|
|
4
4
|
${u?`maxAgeSeconds: ${u},`:""}
|
|
5
5
|
purgeOnQuotaError: true,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{xo,Ia,Wt,Dl,Da,Oa,Ma,Ol}from"./chunk-
|
|
2
|
+
import{xo,Ia,Wt,Dl,Da,Oa,Ma,Ol}from"./chunk-8xpyzcq2.js";export{Wt as Validator,Ia as defineForm,Da as processErrorDirective,Oa as processErrorsDirective,Ol as processFormValidationDirectives,Ma as processHasErrorsDirective,xo as useForm,Dl as v};
|
|
@@ -4,5 +4,5 @@ var Hr=new Map([["craft-button",{name:"Button",zigType:"craft.Button",props:[{na
|
|
|
4
4
|
`)}function v(e,t){let r=" ".repeat(t),n=[];for(let[a,l]of Object.entries(e.props))if(l.type==="literal"){let p=typeof l.value==="string"?`"${l.value}"`:String(l.value);n.push(`${a}: ${p}`)}let i=n.length>0?`{ ${n.join(", ")} }`:"{}",o=e.children.map((a)=>a.type==="text"?`"${a.props.text?.type==="literal"?a.props.text.value:""}"`:v(a,t+1)),s=o.length>0?`,
|
|
5
5
|
${r} [${o.join(`,
|
|
6
6
|
${r} `)}]`:"";return`Craft.create("${e.zigType}", ${i}${s})`}function H(e,t,r){if(t.target==="universal"){let n=[];n.push("// Universal entry point"),n.push("");for(let[i,o]of r)n.push(`// --- ${i.toUpperCase()} ---`),n.push(`#if ${i.toUpperCase()}`),n.push(o),n.push("#endif"),n.push("");return n.join(`
|
|
7
|
-
`)}return r.get(t.target)||u(e,t)}function _(e,t,r){let n=[];function i(o){n.push({name:o.zigType,hash:x(JSON.stringify(o.props)),props:Object.keys(o.props),events:Array.from(o.events.keys()),slots:[],isNative:o.zigType.startsWith("craft.")});for(let s of o.children)i(s)}return i(t),{version:"1.0.0",components:n,entry:e.id,assets:[],styles:e.styles}}function B(e,t){return JSON.stringify({version:3,file:"output.zig",sources:["input.stx"],mappings:""})}var F=0;function T(){return`id_${++F}`}function x(e){let t=0;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);t=(t<<5)-t+n,t=t&t}return Math.abs(t).toString(36)}function J(e){return e.charAt(0).toUpperCase()+e.slice(1)}function U(e){let t=[],r=/<script[^>]*>([\s\S]*?)<\/script>/gi,n;while((n=r.exec(e))!==null)t.push(n[1]);return t}function Z(e){let t=[],r=/<style[^>]*>([\s\S]*?)<\/style>/gi,n;while((n=r.exec(e))!==null)t.push(n[1]);return t}function f(e){let t=e.type==="component"?1:0;if(e.children)for(let r of e.children)t+=f(r);return t}function d(e){let t=e.zigType.startsWith("craft.")?1:0;for(let r of e.children)t+=d(r);return t}function Po(e){return{start:async()=>{console.log("[craft-compiler] Hot reload server started")},stop:async()=>{console.log("[craft-compiler] Hot reload server stopped")},notifyChange:(t)=>{console.log(`[craft-compiler] File changed: ${t}`)}}}var K={compileToNative:Ao,createHotReloadServer:Po,NATIVE_COMPONENTS:Hr}
|
|
8
|
-
export{Hr,Ao,Po
|
|
7
|
+
`)}return r.get(t.target)||u(e,t)}function _(e,t,r){let n=[];function i(o){n.push({name:o.zigType,hash:x(JSON.stringify(o.props)),props:Object.keys(o.props),events:Array.from(o.events.keys()),slots:[],isNative:o.zigType.startsWith("craft.")});for(let s of o.children)i(s)}return i(t),{version:"1.0.0",components:n,entry:e.id,assets:[],styles:e.styles}}function B(e,t){return JSON.stringify({version:3,file:"output.zig",sources:["input.stx"],mappings:""})}var F=0;function T(){return`id_${++F}`}function x(e){let t=0;for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);t=(t<<5)-t+n,t=t&t}return Math.abs(t).toString(36)}function J(e){return e.charAt(0).toUpperCase()+e.slice(1)}function U(e){let t=[],r=/<script[^>]*>([\s\S]*?)<\/script>/gi,n;while((n=r.exec(e))!==null)t.push(n[1]);return t}function Z(e){let t=[],r=/<style[^>]*>([\s\S]*?)<\/style>/gi,n;while((n=r.exec(e))!==null)t.push(n[1]);return t}function f(e){let t=e.type==="component"?1:0;if(e.children)for(let r of e.children)t+=f(r);return t}function d(e){let t=e.zigType.startsWith("craft.")?1:0;for(let r of e.children)t+=d(r);return t}function Po(e){return{start:async()=>{console.log("[craft-compiler] Hot reload server started")},stop:async()=>{console.log("[craft-compiler] Hot reload server stopped")},notifyChange:(t)=>{console.log(`[craft-compiler] File changed: ${t}`)}}}var K={compileToNative:Ao,createHotReloadServer:Po,NATIVE_COMPONENTS:Hr},$d=K;
|
|
8
|
+
export{Hr,Ao,Po,$d};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{nd,rd}from"./chunk-gxs2p0y7.js";import"./chunk-kbhm1wqt.js";import"./chunk-fd6abk20.js";import"./chunk-2hc5mbw8.js";import"./chunk-0np4t9ka.js";import"./chunk-azza6dcr.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-a5c75hxe.js";import"./chunk-6k4f583z.js";import"./chunk-133ggr0t.js";import"./chunk-5cyz97t4.js";import"./chunk-798epzq5.js";import"./chunk-d4k4nyj0.js";import"./chunk-xsc9zbaj.js";import"./chunk-xd4zvm4x.js";import"./chunk-e6y6s7q8.js";export{rd as clearStoreCache,nd as getStoreScript};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{mo,oa}from"./chunk-
|
|
2
|
+
import{mo,oa}from"./chunk-jcmgj8kk.js";import"./chunk-n34kagea.js";export{oa as createImageHandler,mo as handleImageRequest};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Oe}from"./chunk-
|
|
2
|
+
import{Oe}from"./chunk-qv57r0fa.js";function Nn(e){let n=e.pwa;if(!n?.enabled)return"";let r=n.manifest,t=n.icons?.outputDir?`/${n.icons.outputDir}`:"/pwa-icons",o=Oe(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,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
function ge(){let{NODE_ENV:o}=process.env;return o==="production"}function O(){let{STX_DEBUG:o}=process.env;return!ge()||o==="true"}function
|
|
3
|
-
export{ge,O,
|
|
2
|
+
function ge(){let{NODE_ENV:o}=process.env;return o==="production"}function O(){let{STX_DEBUG:o}=process.env;return!ge()||o==="true"}function vn(){let{NODE_ENV:o}=process.env;return o==="test"}
|
|
3
|
+
export{ge,O,vn};
|