@stacksjs/stx 0.2.798 → 0.2.799
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-a3xqfyb6.js → chunk-00w4ccrz.js} +2 -2
- package/dist/{chunk-xskswvef.js → chunk-0y7h27ga.js} +4 -4
- package/dist/{chunk-9x62j5f0.js → chunk-116ajzvm.js} +46 -46
- package/dist/chunk-16htz6k0.js +18 -0
- package/dist/chunk-1ayk62gk.js +2 -0
- package/dist/chunk-1rwfgmmk.js +2 -0
- package/dist/{chunk-s0bx4gjh.js → chunk-24aq9yrk.js} +1 -1
- package/dist/chunk-2by8tphv.js +2 -0
- package/dist/chunk-2ehn5r6d.js +2 -0
- package/dist/chunk-2r3e3m9m.js +2 -0
- package/dist/{chunk-qm2wmqre.js → chunk-2xa05bav.js} +1 -1
- package/dist/{chunk-yv4dwdhc.js → chunk-2yb1rwmy.js} +1 -1
- package/dist/{chunk-7na8bets.js → chunk-3dgkdmj0.js} +1 -1
- package/dist/chunk-3qqjhb4e.js +2 -0
- package/dist/chunk-4p42q0wa.js +2 -0
- package/dist/{chunk-qef2vv0m.js → chunk-4rny8rf5.js} +2 -2
- package/dist/{chunk-9b6896tb.js → chunk-549end3k.js} +2 -2
- package/dist/{chunk-cy0mab8y.js → chunk-5fzvcr9v.js} +1 -1
- package/dist/{chunk-wp6bdac7.js → chunk-5pzcd5jh.js} +22 -22
- package/dist/{chunk-en0wry1c.js → chunk-600xzcs0.js} +10 -10
- package/dist/{chunk-8vqs94f3.js → chunk-6fq522rd.js} +1 -1
- package/dist/chunk-6gt07bzy.js +2 -0
- package/dist/chunk-6hrfmvkn.js +2 -0
- package/dist/{chunk-z1fb5k3h.js → chunk-6n5cbyes.js} +3 -3
- package/dist/chunk-77v7g18n.js +2 -0
- package/dist/{chunk-2z2bq2at.js → chunk-7svwyjxb.js} +7 -7
- package/dist/{chunk-jt0yn7ab.js → chunk-83myk906.js} +2 -2
- package/dist/chunk-87p1av24.js +2 -0
- package/dist/{chunk-ag8j9ec2.js → chunk-8adf5x29.js} +1 -1
- package/dist/{chunk-8bzq2z0m.js → chunk-8c81cgyb.js} +3 -3
- package/dist/{chunk-v9hm1xv6.js → chunk-8ey61ppd.js} +2 -2
- package/dist/chunk-8m0khhe5.js +2 -0
- package/dist/{chunk-e37g6ezw.js → chunk-8tb3cmhv.js} +45 -45
- package/dist/{chunk-zx8tnhfr.js → chunk-99aqp5ss.js} +2 -2
- package/dist/{chunk-hzps1xya.js → chunk-9d2cgsn2.js} +1 -1
- package/dist/{chunk-2ws2qe1k.js → chunk-9gwhs0gk.js} +2 -2
- package/dist/{chunk-3mby4nes.js → chunk-9hn0zpxj.js} +2 -2
- package/dist/{chunk-0gsq8gps.js → chunk-9kadf7pv.js} +1 -1
- package/dist/{chunk-9k6tza24.js → chunk-9y6vdjy5.js} +5 -5
- package/dist/chunk-a3vbwkjh.js +2 -0
- package/dist/{chunk-zsy145ac.js → chunk-b0ct7x3p.js} +3 -3
- package/dist/{chunk-z1aq59qj.js → chunk-b3xmheq9.js} +2 -2
- package/dist/{chunk-s3fmmm98.js → chunk-bbt09ebh.js} +2 -2
- package/dist/{chunk-hg9mwgnr.js → chunk-bfm5cedw.js} +1 -1
- package/dist/chunk-bj6ax0he.js +2 -0
- package/dist/{chunk-4sesw88b.js → chunk-bphwhfbd.js} +5 -5
- package/dist/{chunk-kj8dvzpc.js → chunk-brhas9mp.js} +2 -2
- package/dist/{chunk-xa36escd.js → chunk-bs8xype1.js} +3 -3
- package/dist/{chunk-p2a6dwj6.js → chunk-c1bsagbe.js} +2 -2
- package/dist/chunk-cas0vn5m.js +2 -0
- package/dist/chunk-cbx7qght.js +2 -0
- package/dist/{chunk-mj3hzy1e.js → chunk-cccf42yy.js} +3 -3
- package/dist/{chunk-zqsacq3r.js → chunk-cezw6q40.js} +1 -1
- package/dist/{chunk-q7q9e0gj.js → chunk-cm0f5aj3.js} +5 -5
- package/dist/chunk-cxpnkgvw.js +2 -0
- package/dist/chunk-d1c1qggs.js +2 -0
- package/dist/{chunk-91htcq62.js → chunk-d8rcba53.js} +2 -2
- package/dist/{chunk-7bxnjr3b.js → chunk-dq87xd5c.js} +35 -35
- package/dist/{chunk-w7681v48.js → chunk-dwydz68f.js} +1 -1
- package/dist/{chunk-b5ck6epd.js → chunk-e32pjcyd.js} +4 -4
- package/dist/chunk-enpx5t99.js +2 -0
- package/dist/{chunk-w58bnt44.js → chunk-fn3q1gtr.js} +3 -3
- package/dist/{chunk-20yz8bjp.js → chunk-gqjb1y7c.js} +2 -2
- package/dist/{chunk-yfdb3x3p.js → chunk-gv0bp9ve.js} +1 -1
- package/dist/{chunk-s14jcqdf.js → chunk-hcwjdpzv.js} +5 -5
- package/dist/chunk-hdsccfga.js +2 -0
- package/dist/{chunk-ef3w5thv.js → chunk-hrrrf46j.js} +2 -2
- package/dist/{chunk-810r5dk3.js → chunk-j0bbr6ee.js} +2 -2
- package/dist/{chunk-qjbpa1n4.js → chunk-j2v9f2dk.js} +2 -2
- package/dist/chunk-jn6g5n02.js +2 -0
- package/dist/chunk-js4t4825.js +2 -0
- package/dist/{chunk-eegb7f3t.js → chunk-jzxh4y5j.js} +4 -4
- package/dist/{chunk-a20wq8wf.js → chunk-krjd21ws.js} +2 -2
- package/dist/{chunk-dsnggn3g.js → chunk-kvz01wzc.js} +2 -2
- package/dist/{chunk-q3ma4khe.js → chunk-kyb43mnq.js} +2 -2
- package/dist/{chunk-aw6369cx.js → chunk-kydgndkt.js} +1 -1
- package/dist/chunk-mshnt7y9.js +3 -0
- package/dist/chunk-mt95md1e.js +2 -0
- package/dist/chunk-nbb9btn0.js +2 -0
- package/dist/chunk-nm20k22y.js +2 -0
- package/dist/chunk-nq4d91zm.js +2 -0
- package/dist/{chunk-0beyn8ak.js → chunk-nxdgvtgc.js} +5 -5
- package/dist/chunk-p5efqqtk.js +2 -0
- package/dist/chunk-pjs4q88m.js +2 -0
- package/dist/chunk-pm8d60n0.js +2 -0
- package/dist/chunk-ps9fcjyg.js +2 -0
- package/dist/{chunk-p1mghe1h.js → chunk-q3dsjk2b.js} +2 -2
- package/dist/chunk-q78jxqnr.js +2 -0
- package/dist/chunk-q8xw7yye.js +2 -0
- package/dist/{chunk-33devn0s.js → chunk-qkck7zx0.js} +1 -1
- package/dist/{chunk-zbv8e4rq.js → chunk-qkfdp97k.js} +1 -1
- package/dist/{chunk-a1ba9d2r.js → chunk-r32pqvpq.js} +3 -3
- package/dist/{chunk-5wwcgze3.js → chunk-r50b54a8.js} +2 -2
- package/dist/chunk-rd3pek52.js +2 -0
- package/dist/chunk-rxc1076r.js +2 -0
- package/dist/{chunk-x8ckxemg.js → chunk-s2vnydq0.js} +73 -73
- package/dist/{chunk-fp0ew9n4.js → chunk-s90m43sm.js} +4 -4
- package/dist/{chunk-3x598qjt.js → chunk-sbe6xr6h.js} +3 -3
- package/dist/{chunk-4v50nafp.js → chunk-se44tmvx.js} +14 -14
- package/dist/{chunk-trjhz9d9.js → chunk-sxee2rxz.js} +1 -1
- package/dist/{chunk-jeprxn45.js → chunk-t4gmj0nd.js} +4 -4
- package/dist/{chunk-6m4y5dh5.js → chunk-t5vjt37c.js} +4 -4
- package/dist/{chunk-z8wfvqbk.js → chunk-tb4wmzzd.js} +5 -5
- package/dist/chunk-tjn7htz7.js +2 -0
- package/dist/chunk-tkb335d7.js +2 -0
- package/dist/chunk-tx75gjzg.js +2 -0
- package/dist/{chunk-rbv6fxtx.js → chunk-v1xtm49w.js} +2 -2
- package/dist/chunk-w4jymx0v.js +2 -0
- package/dist/{chunk-89jn2jmf.js → chunk-w5dw3c8m.js} +3 -3
- package/dist/chunk-w5sbp9ry.js +2 -0
- package/dist/{chunk-hmt0vqhb.js → chunk-w9hpdka1.js} +1 -1
- package/dist/chunk-whq40bdm.js +2 -0
- package/dist/chunk-wkrep5sj.js +2 -0
- package/dist/{chunk-6b5zhtb3.js → chunk-x82zksaj.js} +2 -2
- package/dist/chunk-xgqyzkt2.js +2 -0
- package/dist/{chunk-r6d6jphq.js → chunk-xkrcte91.js} +33 -33
- package/dist/{chunk-jde0shn4.js → chunk-xystfx25.js} +2 -2
- package/dist/chunk-ys46rqxg.js +2 -0
- package/dist/chunk-z5650kd0.js +2 -0
- package/dist/chunk-zvfw1h3f.js +2 -0
- package/dist/cli.js +11 -11
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/dev-server/serve-css-assets.d.ts +5 -0
- package/dist/dev-server/serve-css-assets.js +60 -0
- package/dist/dev-server/ts-css.d.ts +1 -1
- package/dist/dev-server/ts-css.js +5 -20
- package/dist/info-plist.d.ts +4 -0
- package/dist/info-plist.js +42 -0
- package/dist/native-build.d.ts +3 -1
- package/dist/native-build.js +1 -18
- package/dist/pwa.js +3 -3
- package/dist/ssg.js +18 -18
- package/package.json +5 -5
- package/dist/chunk-0xnvjw7s.js +0 -2
- package/dist/chunk-1wyccmsr.js +0 -2
- package/dist/chunk-31qjy9xr.js +0 -2
- package/dist/chunk-33wpv2n1.js +0 -2
- package/dist/chunk-3p5gxc6t.js +0 -2
- package/dist/chunk-4hgz9dkv.js +0 -2
- package/dist/chunk-5kc9kjaa.js +0 -2
- package/dist/chunk-5xd53dwe.js +0 -2
- package/dist/chunk-5y6518h8.js +0 -2
- package/dist/chunk-5y77pe7b.js +0 -2
- package/dist/chunk-6a97a9wk.js +0 -2
- package/dist/chunk-6hre8cg4.js +0 -2
- package/dist/chunk-6pyweb05.js +0 -2
- package/dist/chunk-6tp7ys77.js +0 -2
- package/dist/chunk-6zxzr20d.js +0 -2
- package/dist/chunk-75ctpxr3.js +0 -2
- package/dist/chunk-7gw96jpj.js +0 -2
- package/dist/chunk-8k2n6abg.js +0 -2
- package/dist/chunk-9w33k6f7.js +0 -2
- package/dist/chunk-ak15dt1a.js +0 -2
- package/dist/chunk-b98743ja.js +0 -2
- package/dist/chunk-bskxswmn.js +0 -2
- package/dist/chunk-bv5h4etd.js +0 -2
- package/dist/chunk-c7x3bmvs.js +0 -2
- package/dist/chunk-camm2hcx.js +0 -2
- package/dist/chunk-cd2wda5c.js +0 -2
- package/dist/chunk-cv6pqg85.js +0 -2
- package/dist/chunk-d554f2fj.js +0 -2
- package/dist/chunk-e14v1q9c.js +0 -2
- package/dist/chunk-e3xw2bzh.js +0 -2
- package/dist/chunk-eeztqt6f.js +0 -2
- package/dist/chunk-eh528njb.js +0 -2
- package/dist/chunk-fyxkzs9c.js +0 -2
- package/dist/chunk-hb4jkdfr.js +0 -2
- package/dist/chunk-k8gpvg0w.js +0 -2
- package/dist/chunk-km8c0j9g.js +0 -2
- package/dist/chunk-nw0v655w.js +0 -18
- package/dist/chunk-pw89m3re.js +0 -2
- package/dist/chunk-rrketemm.js +0 -2
- package/dist/chunk-rwys552r.js +0 -3
- package/dist/chunk-s8s7b7rv.js +0 -2
- package/dist/chunk-sywqa4da.js +0 -2
- package/dist/chunk-txrbz95y.js +0 -2
- package/dist/chunk-w7wz670a.js +0 -2
- package/dist/chunk-xzgtdcbg.js +0 -2
- package/dist/chunk-z9a80qqg.js +0 -2
- package/dist/chunk-za5kx15m.js +0 -2
package/dist/craft-entry.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{So,va,xa}from"./chunk-
|
|
2
|
+
import{So,va,xa}from"./chunk-bbt09ebh.js";import"./chunk-sprgkk9j.js";import"./chunk-se44tmvx.js";import"./chunk-t65tn8ee.js";import"./chunk-2yxva96k.js";import"./chunk-5pzcd5jh.js";import"./chunk-akcyaxwv.js";import"./chunk-qkfdp97k.js";import"./chunk-9gwhs0gk.js";import"./chunk-j2v9f2dk.js";import"./chunk-116ajzvm.js";import"./chunk-dq87xd5c.js";import"./chunk-qpvwxppw.js";import"./chunk-v1xtm49w.js";import"./chunk-16htz6k0.js";import"./chunk-8tb3cmhv.js";import"./chunk-w5dw3c8m.js";import"./chunk-cm0f5aj3.js";import"./chunk-9y6vdjy5.js";import"./chunk-7svwyjxb.js";import"./chunk-c84pxd2k.js";import"./chunk-33vr7x2t.js";import{fu,Sa,yh,bh,ka,ko,Qr,_a,Ca,wh,vh,Ea,Ta,$a,Ra}from"./chunk-xkrcte91.js";import"./chunk-krjd21ws.js";import"./chunk-mshnt7y9.js";import"./chunk-2yb1rwmy.js";import"./chunk-jzxh4y5j.js";import"./chunk-kydgndkt.js";import"./chunk-9hn0zpxj.js";var m=new Map,d=new Map;function R(t,e){let n=e?.id||E(t),r=I(t),a=m.get(n);if(a&&a.hash===r)return a;let i=M(t),s=L(t),o=W(t),c=O(i),{staticParts:p,dynamicParts:l}=A(i),f=_(t),g={id:n,hash:r,tree:i,scripts:s,styles:o,staticParts:p,dynamicParts:l,dependencies:f,metadata:c};return m.set(n,g),g}async function Q(t,e={},n={}){let r=performance.now();if(n.cache){let o=`${t.id}:${JSON.stringify(e)}`,c=d.get(o);if(c&&Date.now()-c.timestamp<(n.cacheTTL||60000))return{html:c.html,styles:t.styles.join(`
|
|
3
3
|
`),scripts:t.scripts.join(`
|
|
4
4
|
`),metadata:{renderTime:0,cacheHit:!0,totalSize:c.html.length,componentCount:t.metadata.componentCount}}}let a;if(n.streaming)a=await H(t.tree,e);else a=h(t.tree,e);let i;if(n.hydrate){let o=j(a,t,e);a=o.html,i=o.data}if(n.minify)a=D(a);if(n.cache){let o=`${t.id}:${JSON.stringify(e)}`;d.set(o,{html:a,timestamp:Date.now()})}let s=performance.now()-r;return{html:a,styles:t.styles.join(`
|
|
5
5
|
`),scripts:t.scripts.join(`
|
|
6
6
|
`),hydrationData:i,metadata:{renderTime:s,cacheHit:!1,totalSize:a.length,componentCount:t.metadata.componentCount}}}function V(t,e){let n=[],r=[],a=[],i=new Map,s=[];return y(t.tree,(o,c)=>{if(o.type==="component"&&o.componentName){if(T(o.componentName))n.push(o.componentName)}if(o.type==="element"&&o.tag){let p=J(o);if(p)s.push(p);if(o.props){for(let[l,f]of Object.entries(o.props))if(l.startsWith("on")&&typeof f==="string"){let g=`handler_${i.size}`;i.set(g,f)}}}if(o.isStatic&&o.type==="element")r.push(b(o));else if(!o.isStatic&&o.type!=="text")a.push(o.tag||o.componentName||"unknown")}),{nativeComponents:n,staticHTML:r,dynamicParts:a,eventHandlers:i,nativeWidgets:s}}function Y(t,e={}){let n=R(t),r=P(n,e),a=new Map,i=[];return y(n.tree,(s)=>{if(s.type==="component"&&s.componentName){if(T(s.componentName)){i.push(s.componentName);let o=`<!--craft:${s.componentName}:${s.hydrationKey||"default"}-->`;a.set(s.hydrationKey||s.componentName,o)}}}),{staticHTML:r,dynamicPlaceholders:a,craftComponents:i}}function M(t){let e={type:"fragment",children:[]},n=e,r=[e],a=t,i=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);while(a.length>0){let s=a.match(/^<(@?[\w-]+)([^>]*)>/);if(s){let[p,l,f]=s,g=z(f),u=l.startsWith("@craft-"),C=u?l:l.toLowerCase(),S={type:u?"component":"element",tag:C,props:g,children:[],componentName:u?C.slice(1):void 0,isStatic:!v(f),hydrationKey:F()};if(n.children=n.children||[],n.children.push(S),!i.has(C)&&!f.endsWith("/"))r.push(S),n=S;a=a.slice(p.length);continue}let o=a.match(/^<\/(@?[\w-]+)>/);if(o){let[p,l]=o,g=l.startsWith("@craft-")?l:l.toLowerCase();while(r.length>1){let u=r.pop();if(n=r[r.length-1],u.tag===g)break}a=a.slice(p.length);continue}let c=a.match(/^[^<]+/);if(c){let p=c[0];if(p.trim()){let l={type:"text",text:p,isStatic:!v(p)};n.children=n.children||[],n.children.push(l)}a=a.slice(p.length);continue}a=a.slice(1)}return e}function z(t){let e={},n=/([\w-:@]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S+)))?/g,r;while((r=n.exec(t))!==null){let[,a,i,s,o]=r,c=i??s??o??!0;e[a]=c}return e}function y(t,e,n=[]){if(e(t,n),t.children)t.children.forEach((r,a)=>{y(r,e,[...n,`${a}`])})}function h(t,e){switch(t.type){case"text":return x(t.text||"",e);case"element":case"component":{let n=t.tag||"div",r=N(t.props||{},e),a=(t.children||[]).map((i)=>h(i,e)).join("");if(!t.children||t.children.length===0){if(["input","br","hr","img","meta","link"].includes(n))return`<${n}${r} />`}return`<${n}${r}>${a}</${n}>`}case"fragment":return(t.children||[]).map((n)=>h(n,e)).join("");case"slot":return`<!--slot:${t.slotName||"default"}-->`;default:return""}}function b(t){if(t.type==="text")return t.text||"";let e=t.tag||"div",n=N(t.props||{},{});return`<${e}${n}></${e}>`}function N(t,e){let n=[];for(let[r,a]of Object.entries(t))if(a===!0)n.push(` ${r}`);else if(a!==!1&&a!==null&&a!==void 0){let i=x(String(a),e);n.push(` ${r}="${k(i)}"`)}return n.join("")}async function H(t,e){return h(t,e)}function P(t,e){let n=[];return y(t.tree,(r)=>{if(r.isStatic)n.push(h(r,e))}),n.join("")}function j(t,e,n){let r={templateId:e.id,context:n,dynamicParts:Array.from(e.dynamicParts.entries())},a=`
|
|
7
7
|
<script data-craft-hydration>
|
|
8
8
|
window.__CRAFT_HYDRATION__ = ${JSON.stringify(r)};
|
|
9
|
-
</script>`;return{html:t+a,data:r}}function O(t){let e=!1,n=!1,r=!1,a=!1,i=0,s=0;function o(c,p){if(s=Math.max(s,p),c.type==="slot")e=!0;if(c.type==="component")i++;if(!c.isStatic)n=!0;if(c.props)for(let l of Object.keys(c.props)){if(l.startsWith("on"))r=!0;if(l==="@async"||l==="data-async")a=!0}if(c.children)c.children.forEach((l)=>o(l,p+1))}return o(t,0),{hasSlots:e,hasDynamicContent:n,hasEventHandlers:r,hasAsyncContent:a,componentCount:i,maxDepth:s,estimatedSize:JSON.stringify(t).length}}function A(t){let e=new Map,n=new Map;return y(t,(r,a)=>{let i=a.join(".");if(r.isStatic)e.set(i,b(r));else n.set(i,r.tag||r.componentName||"dynamic")}),{staticParts:e,dynamicParts:n}}function L(t){let e=[],n=/<script[^>]*>([\s\S]*?)<\/script>/gi,r;while((r=n.exec(t))!==null)e.push(r[1]);return e}function W(t){let e=[],n=/<style[^>]*>([\s\S]*?)<\/style>/gi,r;while((r=n.exec(t))!==null)e.push(r[1]);return e}function _(t){let e=[],n=/@include\s*\(\s*['"]([^'"]+)['"]/g,r;while((r=n.exec(t))!==null)e.push(r[1]);let a=/@component\s*\(\s*['"]([^'"]+)['"]/g;while((r=a.exec(t))!==null)e.push(r[1]);let i=/<@craft-[\w-]+/g;while((r=i.exec(t))!==null)e.push(r[0].slice(2));return[...new Set(e)]}function v(t){return/\{\{.*?\}\}|\{\!\!.*?\!\!\}/.test(t)}function x(t,e){let n=t.replace(/\{\{\s*(.+?)\s*\}\}/g,(r,a)=>{try{let i=w(a.trim(),e);return k(String(i??""))}catch{return""}});return n=n.replace(/\{!!\s*(.+?)\s*!!\}/g,(r,a)=>{try{let i=w(a.trim(),e);return String(i??"")}catch{return""}}),n}function w(t,e){if(/^[\w.]+$/.test(t)){let n=t.split("."),r=e;for(let a of n)if(r&&typeof r==="object"&&a in r)r=r[a];else return;return r}try{return Function(...Object.keys(e),`return ${t}`)(...Object.values(e))}catch{return}}function k(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function D(t){return t.replace(/\s+/g," ").replace(/>\s+</g,"><").replace(/\s+>/g,">").replace(/<\s+/g,"<").trim()}function E(t){let e=0;for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return`tpl_${Math.abs(e).toString(36)}`}function I(t){let e=0;for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return Math.abs(e).toString(36)}var K=0;function F(){return`h_${++K}`}function T(t){return["craft-button","craft-text-input","craft-textarea","craft-checkbox","craft-radio","craft-select","craft-slider","craft-toggle","craft-date-picker","craft-time-picker","craft-color-picker","craft-file-input","craft-modal","craft-alert","craft-toast","craft-progress","craft-spinner","craft-avatar","craft-badge","craft-card","craft-accordion","craft-tabs","craft-tooltip","craft-popover","craft-dropdown","craft-context-menu","craft-data-table","craft-virtual-list","craft-tree-view","craft-map","craft-chart","craft-video","craft-audio","craft-webview","craft-canvas","craft-image-viewer","craft-pdf-viewer","craft-code-editor","craft-rich-editor"].includes(t)}function J(t){let e=t.tag?.toLowerCase(),n=t.props?.type,r={button:{component:"craft-button",confidence:0.95,reason:"Native button provides better touch feedback"},"input:text":{component:"craft-text-input",confidence:0.9,reason:"Native text input has better keyboard handling"},"input:checkbox":{component:"craft-checkbox",confidence:0.95,reason:"Native checkbox follows platform conventions"},"input:range":{component:"craft-slider",confidence:0.9,reason:"Native slider provides smooth interaction"},"input:date":{component:"craft-date-picker",confidence:0.95,reason:"Native date picker provides platform-specific UI"},"input:time":{component:"craft-time-picker",confidence:0.95,reason:"Native time picker provides platform-specific UI"},"input:color":{component:"craft-color-picker",confidence:0.9,reason:"Native color picker provides platform-specific UI"},textarea:{component:"craft-textarea",confidence:0.85,reason:"Native textarea handles multiline input better"},select:{component:"craft-select",confidence:0.9,reason:"Native select provides platform dropdown UI"},progress:{component:"craft-progress",confidence:0.95,reason:"Native progress bar matches platform style"},video:{component:"craft-video",confidence:0.95,reason:"Native video provides hardware acceleration"},audio:{component:"craft-audio",confidence:0.95,reason:"Native audio provides system integration"},dialog:{component:"craft-modal",confidence:0.9,reason:"Native modal provides proper layering and focus"}},a=n?`${e}:${n}`:e,i=r[a||""]||r[e||""];if(i)return{htmlSelector:a||e||"",nativeComponent:i.component,confidence:i.confidence,reason:i.reason};return null}function U(){m.clear()}function q(){d.clear()}function B(){U(),q()}function G(){return{templateCacheSize:m.size,renderCacheSize:d.size,totalEntries:m.size+d.size}}export{fu as CRAFT_BRIDGE_SCRIPT,ko as CRAFT_COMPONENTS,_a as CRAFT_COMPONENT_RUNTIME,Qr as CRAFT_COMPONENT_STYLES,So as NATIVE_COMPONENTS,Ea as buildNative,B as clearAllCaches,q as clearRenderCache,U as clearTemplateCache,R as compileTemplate,va as compileToNative,xa as createHotReloadServer,Ta as findCraftBinary,Sa as generateCraftBridgeScript,V as generateCraftOptimizations,Ra as getAvailableFormats,$a as getAvailableTargets,
|
|
9
|
+
</script>`;return{html:t+a,data:r}}function O(t){let e=!1,n=!1,r=!1,a=!1,i=0,s=0;function o(c,p){if(s=Math.max(s,p),c.type==="slot")e=!0;if(c.type==="component")i++;if(!c.isStatic)n=!0;if(c.props)for(let l of Object.keys(c.props)){if(l.startsWith("on"))r=!0;if(l==="@async"||l==="data-async")a=!0}if(c.children)c.children.forEach((l)=>o(l,p+1))}return o(t,0),{hasSlots:e,hasDynamicContent:n,hasEventHandlers:r,hasAsyncContent:a,componentCount:i,maxDepth:s,estimatedSize:JSON.stringify(t).length}}function A(t){let e=new Map,n=new Map;return y(t,(r,a)=>{let i=a.join(".");if(r.isStatic)e.set(i,b(r));else n.set(i,r.tag||r.componentName||"dynamic")}),{staticParts:e,dynamicParts:n}}function L(t){let e=[],n=/<script[^>]*>([\s\S]*?)<\/script>/gi,r;while((r=n.exec(t))!==null)e.push(r[1]);return e}function W(t){let e=[],n=/<style[^>]*>([\s\S]*?)<\/style>/gi,r;while((r=n.exec(t))!==null)e.push(r[1]);return e}function _(t){let e=[],n=/@include\s*\(\s*['"]([^'"]+)['"]/g,r;while((r=n.exec(t))!==null)e.push(r[1]);let a=/@component\s*\(\s*['"]([^'"]+)['"]/g;while((r=a.exec(t))!==null)e.push(r[1]);let i=/<@craft-[\w-]+/g;while((r=i.exec(t))!==null)e.push(r[0].slice(2));return[...new Set(e)]}function v(t){return/\{\{.*?\}\}|\{\!\!.*?\!\!\}/.test(t)}function x(t,e){let n=t.replace(/\{\{\s*(.+?)\s*\}\}/g,(r,a)=>{try{let i=w(a.trim(),e);return k(String(i??""))}catch{return""}});return n=n.replace(/\{!!\s*(.+?)\s*!!\}/g,(r,a)=>{try{let i=w(a.trim(),e);return String(i??"")}catch{return""}}),n}function w(t,e){if(/^[\w.]+$/.test(t)){let n=t.split("."),r=e;for(let a of n)if(r&&typeof r==="object"&&a in r)r=r[a];else return;return r}try{return Function(...Object.keys(e),`return ${t}`)(...Object.values(e))}catch{return}}function k(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function D(t){return t.replace(/\s+/g," ").replace(/>\s+</g,"><").replace(/\s+>/g,">").replace(/<\s+/g,"<").trim()}function E(t){let e=0;for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return`tpl_${Math.abs(e).toString(36)}`}function I(t){let e=0;for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return Math.abs(e).toString(36)}var K=0;function F(){return`h_${++K}`}function T(t){return["craft-button","craft-text-input","craft-textarea","craft-checkbox","craft-radio","craft-select","craft-slider","craft-toggle","craft-date-picker","craft-time-picker","craft-color-picker","craft-file-input","craft-modal","craft-alert","craft-toast","craft-progress","craft-spinner","craft-avatar","craft-badge","craft-card","craft-accordion","craft-tabs","craft-tooltip","craft-popover","craft-dropdown","craft-context-menu","craft-data-table","craft-virtual-list","craft-tree-view","craft-map","craft-chart","craft-video","craft-audio","craft-webview","craft-canvas","craft-image-viewer","craft-pdf-viewer","craft-code-editor","craft-rich-editor"].includes(t)}function J(t){let e=t.tag?.toLowerCase(),n=t.props?.type,r={button:{component:"craft-button",confidence:0.95,reason:"Native button provides better touch feedback"},"input:text":{component:"craft-text-input",confidence:0.9,reason:"Native text input has better keyboard handling"},"input:checkbox":{component:"craft-checkbox",confidence:0.95,reason:"Native checkbox follows platform conventions"},"input:range":{component:"craft-slider",confidence:0.9,reason:"Native slider provides smooth interaction"},"input:date":{component:"craft-date-picker",confidence:0.95,reason:"Native date picker provides platform-specific UI"},"input:time":{component:"craft-time-picker",confidence:0.95,reason:"Native time picker provides platform-specific UI"},"input:color":{component:"craft-color-picker",confidence:0.9,reason:"Native color picker provides platform-specific UI"},textarea:{component:"craft-textarea",confidence:0.85,reason:"Native textarea handles multiline input better"},select:{component:"craft-select",confidence:0.9,reason:"Native select provides platform dropdown UI"},progress:{component:"craft-progress",confidence:0.95,reason:"Native progress bar matches platform style"},video:{component:"craft-video",confidence:0.95,reason:"Native video provides hardware acceleration"},audio:{component:"craft-audio",confidence:0.95,reason:"Native audio provides system integration"},dialog:{component:"craft-modal",confidence:0.9,reason:"Native modal provides proper layering and focus"}},a=n?`${e}:${n}`:e,i=r[a||""]||r[e||""];if(i)return{htmlSelector:a||e||"",nativeComponent:i.component,confidence:i.confidence,reason:i.reason};return null}function U(){m.clear()}function q(){d.clear()}function B(){U(),q()}function G(){return{templateCacheSize:m.size,renderCacheSize:d.size,totalEntries:m.size+d.size}}export{fu as CRAFT_BRIDGE_SCRIPT,ko as CRAFT_COMPONENTS,_a as CRAFT_COMPONENT_RUNTIME,Qr as CRAFT_COMPONENT_STYLES,So as NATIVE_COMPONENTS,Ea as buildNative,B as clearAllCaches,q as clearRenderCache,U as clearTemplateCache,R as compileTemplate,va as compileToNative,xa as createHotReloadServer,Ta as findCraftBinary,Sa as generateCraftBridgeScript,V as generateCraftOptimizations,Ra as getAvailableFormats,$a as getAvailableTargets,vh as getCraftComponents,G as getSSRCacheStats,ka as injectCraftBridge,yh as isCraftEnvironment,Y as prerenderForCraft,Ca as processCraftComponents,bh as processCraftDirective,wh as registerCraftComponent,Q as renderSSR};
|
package/dist/craft.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{So,va,xa}from"./chunk-
|
|
2
|
+
import{So,va,xa}from"./chunk-bbt09ebh.js";import"./chunk-sprgkk9j.js";import"./chunk-se44tmvx.js";import"./chunk-t65tn8ee.js";import"./chunk-2yxva96k.js";import"./chunk-5pzcd5jh.js";import"./chunk-akcyaxwv.js";import"./chunk-qkfdp97k.js";import"./chunk-9gwhs0gk.js";import"./chunk-j2v9f2dk.js";import"./chunk-116ajzvm.js";import"./chunk-dq87xd5c.js";import"./chunk-qpvwxppw.js";import"./chunk-v1xtm49w.js";import"./chunk-16htz6k0.js";import"./chunk-8tb3cmhv.js";import"./chunk-w5dw3c8m.js";import"./chunk-cm0f5aj3.js";import"./chunk-9y6vdjy5.js";import"./chunk-7svwyjxb.js";import"./chunk-c84pxd2k.js";import"./chunk-33vr7x2t.js";import{fu,Sa,yh,bh,ka,ko,Qr,_a,Ca,wh,vh,Ea,Ta,$a,Ra}from"./chunk-xkrcte91.js";import"./chunk-krjd21ws.js";import"./chunk-mshnt7y9.js";import"./chunk-2yb1rwmy.js";import"./chunk-jzxh4y5j.js";import"./chunk-kydgndkt.js";import"./chunk-9hn0zpxj.js";var m=new Map,d=new Map;function R(t,e){let n=e?.id||E(t),r=I(t),a=m.get(n);if(a&&a.hash===r)return a;let i=M(t),s=L(t),o=W(t),c=O(i),{staticParts:p,dynamicParts:l}=A(i),f=_(t),g={id:n,hash:r,tree:i,scripts:s,styles:o,staticParts:p,dynamicParts:l,dependencies:f,metadata:c};return m.set(n,g),g}async function Q(t,e={},n={}){let r=performance.now();if(n.cache){let o=`${t.id}:${JSON.stringify(e)}`,c=d.get(o);if(c&&Date.now()-c.timestamp<(n.cacheTTL||60000))return{html:c.html,styles:t.styles.join(`
|
|
3
3
|
`),scripts:t.scripts.join(`
|
|
4
4
|
`),metadata:{renderTime:0,cacheHit:!0,totalSize:c.html.length,componentCount:t.metadata.componentCount}}}let a;if(n.streaming)a=await H(t.tree,e);else a=h(t.tree,e);let i;if(n.hydrate){let o=j(a,t,e);a=o.html,i=o.data}if(n.minify)a=D(a);if(n.cache){let o=`${t.id}:${JSON.stringify(e)}`;d.set(o,{html:a,timestamp:Date.now()})}let s=performance.now()-r;return{html:a,styles:t.styles.join(`
|
|
5
5
|
`),scripts:t.scripts.join(`
|
|
6
6
|
`),hydrationData:i,metadata:{renderTime:s,cacheHit:!1,totalSize:a.length,componentCount:t.metadata.componentCount}}}function V(t,e){let n=[],r=[],a=[],i=new Map,s=[];return y(t.tree,(o,c)=>{if(o.type==="component"&&o.componentName){if(T(o.componentName))n.push(o.componentName)}if(o.type==="element"&&o.tag){let p=J(o);if(p)s.push(p);if(o.props){for(let[l,f]of Object.entries(o.props))if(l.startsWith("on")&&typeof f==="string"){let g=`handler_${i.size}`;i.set(g,f)}}}if(o.isStatic&&o.type==="element")r.push(b(o));else if(!o.isStatic&&o.type!=="text")a.push(o.tag||o.componentName||"unknown")}),{nativeComponents:n,staticHTML:r,dynamicParts:a,eventHandlers:i,nativeWidgets:s}}function Y(t,e={}){let n=R(t),r=P(n,e),a=new Map,i=[];return y(n.tree,(s)=>{if(s.type==="component"&&s.componentName){if(T(s.componentName)){i.push(s.componentName);let o=`<!--craft:${s.componentName}:${s.hydrationKey||"default"}-->`;a.set(s.hydrationKey||s.componentName,o)}}}),{staticHTML:r,dynamicPlaceholders:a,craftComponents:i}}function M(t){let e={type:"fragment",children:[]},n=e,r=[e],a=t,i=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);while(a.length>0){let s=a.match(/^<(@?[\w-]+)([^>]*)>/);if(s){let[p,l,f]=s,g=z(f),u=l.startsWith("@craft-"),C=u?l:l.toLowerCase(),S={type:u?"component":"element",tag:C,props:g,children:[],componentName:u?C.slice(1):void 0,isStatic:!v(f),hydrationKey:F()};if(n.children=n.children||[],n.children.push(S),!i.has(C)&&!f.endsWith("/"))r.push(S),n=S;a=a.slice(p.length);continue}let o=a.match(/^<\/(@?[\w-]+)>/);if(o){let[p,l]=o,g=l.startsWith("@craft-")?l:l.toLowerCase();while(r.length>1){let u=r.pop();if(n=r[r.length-1],u.tag===g)break}a=a.slice(p.length);continue}let c=a.match(/^[^<]+/);if(c){let p=c[0];if(p.trim()){let l={type:"text",text:p,isStatic:!v(p)};n.children=n.children||[],n.children.push(l)}a=a.slice(p.length);continue}a=a.slice(1)}return e}function z(t){let e={},n=/([\w-:@]+)(?:=(?:"([^"]*)"|'([^']*)'|(\S+)))?/g,r;while((r=n.exec(t))!==null){let[,a,i,s,o]=r,c=i??s??o??!0;e[a]=c}return e}function y(t,e,n=[]){if(e(t,n),t.children)t.children.forEach((r,a)=>{y(r,e,[...n,`${a}`])})}function h(t,e){switch(t.type){case"text":return x(t.text||"",e);case"element":case"component":{let n=t.tag||"div",r=N(t.props||{},e),a=(t.children||[]).map((i)=>h(i,e)).join("");if(!t.children||t.children.length===0){if(["input","br","hr","img","meta","link"].includes(n))return`<${n}${r} />`}return`<${n}${r}>${a}</${n}>`}case"fragment":return(t.children||[]).map((n)=>h(n,e)).join("");case"slot":return`<!--slot:${t.slotName||"default"}-->`;default:return""}}function b(t){if(t.type==="text")return t.text||"";let e=t.tag||"div",n=N(t.props||{},{});return`<${e}${n}></${e}>`}function N(t,e){let n=[];for(let[r,a]of Object.entries(t))if(a===!0)n.push(` ${r}`);else if(a!==!1&&a!==null&&a!==void 0){let i=x(String(a),e);n.push(` ${r}="${k(i)}"`)}return n.join("")}async function H(t,e){return h(t,e)}function P(t,e){let n=[];return y(t.tree,(r)=>{if(r.isStatic)n.push(h(r,e))}),n.join("")}function j(t,e,n){let r={templateId:e.id,context:n,dynamicParts:Array.from(e.dynamicParts.entries())},a=`
|
|
7
7
|
<script data-craft-hydration>
|
|
8
8
|
window.__CRAFT_HYDRATION__ = ${JSON.stringify(r)};
|
|
9
|
-
</script>`;return{html:t+a,data:r}}function O(t){let e=!1,n=!1,r=!1,a=!1,i=0,s=0;function o(c,p){if(s=Math.max(s,p),c.type==="slot")e=!0;if(c.type==="component")i++;if(!c.isStatic)n=!0;if(c.props)for(let l of Object.keys(c.props)){if(l.startsWith("on"))r=!0;if(l==="@async"||l==="data-async")a=!0}if(c.children)c.children.forEach((l)=>o(l,p+1))}return o(t,0),{hasSlots:e,hasDynamicContent:n,hasEventHandlers:r,hasAsyncContent:a,componentCount:i,maxDepth:s,estimatedSize:JSON.stringify(t).length}}function A(t){let e=new Map,n=new Map;return y(t,(r,a)=>{let i=a.join(".");if(r.isStatic)e.set(i,b(r));else n.set(i,r.tag||r.componentName||"dynamic")}),{staticParts:e,dynamicParts:n}}function L(t){let e=[],n=/<script[^>]*>([\s\S]*?)<\/script>/gi,r;while((r=n.exec(t))!==null)e.push(r[1]);return e}function W(t){let e=[],n=/<style[^>]*>([\s\S]*?)<\/style>/gi,r;while((r=n.exec(t))!==null)e.push(r[1]);return e}function _(t){let e=[],n=/@include\s*\(\s*['"]([^'"]+)['"]/g,r;while((r=n.exec(t))!==null)e.push(r[1]);let a=/@component\s*\(\s*['"]([^'"]+)['"]/g;while((r=a.exec(t))!==null)e.push(r[1]);let i=/<@craft-[\w-]+/g;while((r=i.exec(t))!==null)e.push(r[0].slice(2));return[...new Set(e)]}function v(t){return/\{\{.*?\}\}|\{\!\!.*?\!\!\}/.test(t)}function x(t,e){let n=t.replace(/\{\{\s*(.+?)\s*\}\}/g,(r,a)=>{try{let i=w(a.trim(),e);return k(String(i??""))}catch{return""}});return n=n.replace(/\{!!\s*(.+?)\s*!!\}/g,(r,a)=>{try{let i=w(a.trim(),e);return String(i??"")}catch{return""}}),n}function w(t,e){if(/^[\w.]+$/.test(t)){let n=t.split("."),r=e;for(let a of n)if(r&&typeof r==="object"&&a in r)r=r[a];else return;return r}try{return Function(...Object.keys(e),`return ${t}`)(...Object.values(e))}catch{return}}function k(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function D(t){return t.replace(/\s+/g," ").replace(/>\s+</g,"><").replace(/\s+>/g,">").replace(/<\s+/g,"<").trim()}function E(t){let e=0;for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return`tpl_${Math.abs(e).toString(36)}`}function I(t){let e=0;for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return Math.abs(e).toString(36)}var K=0;function F(){return`h_${++K}`}function T(t){return["craft-button","craft-text-input","craft-textarea","craft-checkbox","craft-radio","craft-select","craft-slider","craft-toggle","craft-date-picker","craft-time-picker","craft-color-picker","craft-file-input","craft-modal","craft-alert","craft-toast","craft-progress","craft-spinner","craft-avatar","craft-badge","craft-card","craft-accordion","craft-tabs","craft-tooltip","craft-popover","craft-dropdown","craft-context-menu","craft-data-table","craft-virtual-list","craft-tree-view","craft-map","craft-chart","craft-video","craft-audio","craft-webview","craft-canvas","craft-image-viewer","craft-pdf-viewer","craft-code-editor","craft-rich-editor"].includes(t)}function J(t){let e=t.tag?.toLowerCase(),n=t.props?.type,r={button:{component:"craft-button",confidence:0.95,reason:"Native button provides better touch feedback"},"input:text":{component:"craft-text-input",confidence:0.9,reason:"Native text input has better keyboard handling"},"input:checkbox":{component:"craft-checkbox",confidence:0.95,reason:"Native checkbox follows platform conventions"},"input:range":{component:"craft-slider",confidence:0.9,reason:"Native slider provides smooth interaction"},"input:date":{component:"craft-date-picker",confidence:0.95,reason:"Native date picker provides platform-specific UI"},"input:time":{component:"craft-time-picker",confidence:0.95,reason:"Native time picker provides platform-specific UI"},"input:color":{component:"craft-color-picker",confidence:0.9,reason:"Native color picker provides platform-specific UI"},textarea:{component:"craft-textarea",confidence:0.85,reason:"Native textarea handles multiline input better"},select:{component:"craft-select",confidence:0.9,reason:"Native select provides platform dropdown UI"},progress:{component:"craft-progress",confidence:0.95,reason:"Native progress bar matches platform style"},video:{component:"craft-video",confidence:0.95,reason:"Native video provides hardware acceleration"},audio:{component:"craft-audio",confidence:0.95,reason:"Native audio provides system integration"},dialog:{component:"craft-modal",confidence:0.9,reason:"Native modal provides proper layering and focus"}},a=n?`${e}:${n}`:e,i=r[a||""]||r[e||""];if(i)return{htmlSelector:a||e||"",nativeComponent:i.component,confidence:i.confidence,reason:i.reason};return null}function U(){m.clear()}function q(){d.clear()}function B(){U(),q()}function G(){return{templateCacheSize:m.size,renderCacheSize:d.size,totalEntries:m.size+d.size}}export{fu as CRAFT_BRIDGE_SCRIPT,ko as CRAFT_COMPONENTS,_a as CRAFT_COMPONENT_RUNTIME,Qr as CRAFT_COMPONENT_STYLES,So as NATIVE_COMPONENTS,Ea as buildNative,B as clearAllCaches,q as clearRenderCache,U as clearTemplateCache,R as compileTemplate,va as compileToNative,xa as createHotReloadServer,Ta as findCraftBinary,Sa as generateCraftBridgeScript,V as generateCraftOptimizations,Ra as getAvailableFormats,$a as getAvailableTargets,
|
|
9
|
+
</script>`;return{html:t+a,data:r}}function O(t){let e=!1,n=!1,r=!1,a=!1,i=0,s=0;function o(c,p){if(s=Math.max(s,p),c.type==="slot")e=!0;if(c.type==="component")i++;if(!c.isStatic)n=!0;if(c.props)for(let l of Object.keys(c.props)){if(l.startsWith("on"))r=!0;if(l==="@async"||l==="data-async")a=!0}if(c.children)c.children.forEach((l)=>o(l,p+1))}return o(t,0),{hasSlots:e,hasDynamicContent:n,hasEventHandlers:r,hasAsyncContent:a,componentCount:i,maxDepth:s,estimatedSize:JSON.stringify(t).length}}function A(t){let e=new Map,n=new Map;return y(t,(r,a)=>{let i=a.join(".");if(r.isStatic)e.set(i,b(r));else n.set(i,r.tag||r.componentName||"dynamic")}),{staticParts:e,dynamicParts:n}}function L(t){let e=[],n=/<script[^>]*>([\s\S]*?)<\/script>/gi,r;while((r=n.exec(t))!==null)e.push(r[1]);return e}function W(t){let e=[],n=/<style[^>]*>([\s\S]*?)<\/style>/gi,r;while((r=n.exec(t))!==null)e.push(r[1]);return e}function _(t){let e=[],n=/@include\s*\(\s*['"]([^'"]+)['"]/g,r;while((r=n.exec(t))!==null)e.push(r[1]);let a=/@component\s*\(\s*['"]([^'"]+)['"]/g;while((r=a.exec(t))!==null)e.push(r[1]);let i=/<@craft-[\w-]+/g;while((r=i.exec(t))!==null)e.push(r[0].slice(2));return[...new Set(e)]}function v(t){return/\{\{.*?\}\}|\{\!\!.*?\!\!\}/.test(t)}function x(t,e){let n=t.replace(/\{\{\s*(.+?)\s*\}\}/g,(r,a)=>{try{let i=w(a.trim(),e);return k(String(i??""))}catch{return""}});return n=n.replace(/\{!!\s*(.+?)\s*!!\}/g,(r,a)=>{try{let i=w(a.trim(),e);return String(i??"")}catch{return""}}),n}function w(t,e){if(/^[\w.]+$/.test(t)){let n=t.split("."),r=e;for(let a of n)if(r&&typeof r==="object"&&a in r)r=r[a];else return;return r}try{return Function(...Object.keys(e),`return ${t}`)(...Object.values(e))}catch{return}}function k(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function D(t){return t.replace(/\s+/g," ").replace(/>\s+</g,"><").replace(/\s+>/g,">").replace(/<\s+/g,"<").trim()}function E(t){let e=0;for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return`tpl_${Math.abs(e).toString(36)}`}function I(t){let e=0;for(let n=0;n<t.length;n++){let r=t.charCodeAt(n);e=(e<<5)-e+r,e=e&e}return Math.abs(e).toString(36)}var K=0;function F(){return`h_${++K}`}function T(t){return["craft-button","craft-text-input","craft-textarea","craft-checkbox","craft-radio","craft-select","craft-slider","craft-toggle","craft-date-picker","craft-time-picker","craft-color-picker","craft-file-input","craft-modal","craft-alert","craft-toast","craft-progress","craft-spinner","craft-avatar","craft-badge","craft-card","craft-accordion","craft-tabs","craft-tooltip","craft-popover","craft-dropdown","craft-context-menu","craft-data-table","craft-virtual-list","craft-tree-view","craft-map","craft-chart","craft-video","craft-audio","craft-webview","craft-canvas","craft-image-viewer","craft-pdf-viewer","craft-code-editor","craft-rich-editor"].includes(t)}function J(t){let e=t.tag?.toLowerCase(),n=t.props?.type,r={button:{component:"craft-button",confidence:0.95,reason:"Native button provides better touch feedback"},"input:text":{component:"craft-text-input",confidence:0.9,reason:"Native text input has better keyboard handling"},"input:checkbox":{component:"craft-checkbox",confidence:0.95,reason:"Native checkbox follows platform conventions"},"input:range":{component:"craft-slider",confidence:0.9,reason:"Native slider provides smooth interaction"},"input:date":{component:"craft-date-picker",confidence:0.95,reason:"Native date picker provides platform-specific UI"},"input:time":{component:"craft-time-picker",confidence:0.95,reason:"Native time picker provides platform-specific UI"},"input:color":{component:"craft-color-picker",confidence:0.9,reason:"Native color picker provides platform-specific UI"},textarea:{component:"craft-textarea",confidence:0.85,reason:"Native textarea handles multiline input better"},select:{component:"craft-select",confidence:0.9,reason:"Native select provides platform dropdown UI"},progress:{component:"craft-progress",confidence:0.95,reason:"Native progress bar matches platform style"},video:{component:"craft-video",confidence:0.95,reason:"Native video provides hardware acceleration"},audio:{component:"craft-audio",confidence:0.95,reason:"Native audio provides system integration"},dialog:{component:"craft-modal",confidence:0.9,reason:"Native modal provides proper layering and focus"}},a=n?`${e}:${n}`:e,i=r[a||""]||r[e||""];if(i)return{htmlSelector:a||e||"",nativeComponent:i.component,confidence:i.confidence,reason:i.reason};return null}function U(){m.clear()}function q(){d.clear()}function B(){U(),q()}function G(){return{templateCacheSize:m.size,renderCacheSize:d.size,totalEntries:m.size+d.size}}export{fu as CRAFT_BRIDGE_SCRIPT,ko as CRAFT_COMPONENTS,_a as CRAFT_COMPONENT_RUNTIME,Qr as CRAFT_COMPONENT_STYLES,So as NATIVE_COMPONENTS,Ea as buildNative,B as clearAllCaches,q as clearRenderCache,U as clearTemplateCache,R as compileTemplate,va as compileToNative,xa as createHotReloadServer,Ta as findCraftBinary,Sa as generateCraftBridgeScript,V as generateCraftOptimizations,Ra as getAvailableFormats,$a as getAvailableTargets,vh as getCraftComponents,G as getSSRCacheStats,ka as injectCraftBridge,yh as isCraftEnvironment,Y as prerenderForCraft,Ca as processCraftComponents,bh as processCraftDirective,wh as registerCraftComponent,Q as renderSSR};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Return a hash only after its bytes are durable; callers can otherwise inline. */
|
|
2
|
+
export declare function registerCssServeAsset(css: string): string | undefined;
|
|
3
|
+
/** Synchronous for existing callers; disk is read only on a memory miss. */
|
|
4
|
+
export declare function getCssServeAsset(hash: string): string | undefined;
|
|
5
|
+
export declare function clearCssServeAssets(): void;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { stateDir } from "../state-dir.js";
|
|
4
|
+
const LIMIT = 256, assets = new Map, hashOf = (css) => Bun.hash(css).toString(16).padStart(16, "0").slice(0, 16), fileFor = (hash) => stateDir(process.cwd(), "css-assets", `${hash}.css`);
|
|
5
|
+
function remember(file, css) {
|
|
6
|
+
assets.delete(file);
|
|
7
|
+
assets.set(file, css);
|
|
8
|
+
if (assets.size > LIMIT)
|
|
9
|
+
assets.delete(assets.keys().next().value);
|
|
10
|
+
}
|
|
11
|
+
export function registerCssServeAsset(css) {
|
|
12
|
+
const hash = hashOf(css), file = fileFor(hash);
|
|
13
|
+
if (assets.has(file)) {
|
|
14
|
+
remember(file, css);
|
|
15
|
+
return hash;
|
|
16
|
+
}
|
|
17
|
+
let temporary;
|
|
18
|
+
try {
|
|
19
|
+
let existing;
|
|
20
|
+
try {
|
|
21
|
+
existing = fs.readFileSync(file, "utf8");
|
|
22
|
+
} catch {}
|
|
23
|
+
if (existing !== css) {
|
|
24
|
+
fs.mkdirSync(path.dirname(file), { recursive: !0 });
|
|
25
|
+
temporary = `${file}.${process.pid}.${crypto.randomUUID()}.tmp`;
|
|
26
|
+
fs.writeFileSync(temporary, css, { flag: "wx" });
|
|
27
|
+
fs.renameSync(temporary, file);
|
|
28
|
+
}
|
|
29
|
+
remember(file, css);
|
|
30
|
+
return hash;
|
|
31
|
+
} catch {
|
|
32
|
+
return;
|
|
33
|
+
} finally {
|
|
34
|
+
if (temporary)
|
|
35
|
+
try {
|
|
36
|
+
fs.unlinkSync(temporary);
|
|
37
|
+
} catch {}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export function getCssServeAsset(hash) {
|
|
41
|
+
if (!/^[a-f0-9]{16}$/.test(hash))
|
|
42
|
+
return;
|
|
43
|
+
const file = fileFor(hash), cached = assets.get(file);
|
|
44
|
+
if (cached !== void 0) {
|
|
45
|
+
remember(file, cached);
|
|
46
|
+
return cached;
|
|
47
|
+
}
|
|
48
|
+
try {
|
|
49
|
+
const css = fs.readFileSync(file, "utf8");
|
|
50
|
+
if (hashOf(css) !== hash)
|
|
51
|
+
return;
|
|
52
|
+
remember(file, css);
|
|
53
|
+
return css;
|
|
54
|
+
} catch {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
export function clearCssServeAssets() {
|
|
59
|
+
assets.clear();
|
|
60
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export declare function getCssServeAsset(hash: string): string | undefined;
|
|
2
1
|
/**
|
|
3
2
|
* Lazily load the Css module
|
|
4
3
|
* Returns null if Css is not installed
|
|
@@ -99,3 +98,4 @@ declare interface CSSGenerator {
|
|
|
99
98
|
generate(className: string): void
|
|
100
99
|
toCSS(preflight: boolean, minify: boolean): string
|
|
101
100
|
}
|
|
101
|
+
export { getCssServeAsset } from './serve-css-assets';
|
|
@@ -7,6 +7,8 @@ import { stateDir } from "../state-dir.js";
|
|
|
7
7
|
import { dedupeScopedStyles, findDuplicateScopedStyleRanges } from "../style-scoping.js";
|
|
8
8
|
import { colors } from "./terminal-colors.js";
|
|
9
9
|
import { contentKey, renderMemo } from "../render-memo.js";
|
|
10
|
+
import { clearCssServeAssets, registerCssServeAsset } from "./serve-css-assets.js";
|
|
11
|
+
export { getCssServeAsset } from "./serve-css-assets.js";
|
|
10
12
|
let cssModule = null, cssEngineStamp = "";
|
|
11
13
|
function stampEngine(file) {
|
|
12
14
|
try {
|
|
@@ -17,7 +19,7 @@ function stampEngine(file) {
|
|
|
17
19
|
}
|
|
18
20
|
}
|
|
19
21
|
let cssLoadAttempted = !1, cachedConfig = null, cachedCSS = "", isBuilding = !1;
|
|
20
|
-
const MAX_CACHE = 256, cssByClassSet = new Map
|
|
22
|
+
const MAX_CACHE = 256, cssByClassSet = new Map;
|
|
21
23
|
let diskCacheRoot = null, configFingerprint = null;
|
|
22
24
|
const configByRoot = new Map, warnedRoleRoots = new Set;
|
|
23
25
|
function shortHash(input) {
|
|
@@ -30,23 +32,6 @@ function setLruCache(key, value) {
|
|
|
30
32
|
cssByClassSet.delete(cssByClassSet.keys().next().value);
|
|
31
33
|
cssByClassSet.set(key, value);
|
|
32
34
|
}
|
|
33
|
-
function registerServeCss(css) {
|
|
34
|
-
const hash = shortHash(css);
|
|
35
|
-
if (serveCssByHash.has(hash))
|
|
36
|
-
serveCssByHash.delete(hash);
|
|
37
|
-
else if (serveCssByHash.size >= MAX_CACHE)
|
|
38
|
-
serveCssByHash.delete(serveCssByHash.keys().next().value);
|
|
39
|
-
serveCssByHash.set(hash, css);
|
|
40
|
-
return hash;
|
|
41
|
-
}
|
|
42
|
-
export function getCssServeAsset(hash) {
|
|
43
|
-
const css = serveCssByHash.get(hash);
|
|
44
|
-
if (css === void 0)
|
|
45
|
-
return;
|
|
46
|
-
serveCssByHash.delete(hash);
|
|
47
|
-
serveCssByHash.set(hash, css);
|
|
48
|
-
return css;
|
|
49
|
-
}
|
|
50
35
|
async function readDiskCache(key, root = diskCacheRoot) {
|
|
51
36
|
if (!root)
|
|
52
37
|
return null;
|
|
@@ -182,7 +167,7 @@ export function resetCssCache() {
|
|
|
182
167
|
cachedConfig = null;
|
|
183
168
|
cachedCSS = "";
|
|
184
169
|
cssByClassSet.clear();
|
|
185
|
-
|
|
170
|
+
clearCssServeAssets();
|
|
186
171
|
configFingerprint = null;
|
|
187
172
|
configByRoot.clear();
|
|
188
173
|
}
|
|
@@ -435,7 +420,7 @@ export async function injectCss(htmlContent, appDir, serveMode = !1, dedupeRende
|
|
|
435
420
|
const css = await generateCss(htmlContent, appDir);
|
|
436
421
|
if (!css)
|
|
437
422
|
return dedupeRenderedScopedStyles ? dedupeScopedStyles(htmlContent) : htmlContent;
|
|
438
|
-
const
|
|
423
|
+
const serveHash = serveMode ? registerCssServeAsset(css) : void 0, assetTag = serveHash ? `<link data-css="generated" rel="stylesheet" href="/_stx/css.${serveHash}.css">` : `<style data-css="generated">
|
|
439
424
|
${css}
|
|
440
425
|
</style>`;
|
|
441
426
|
if (dedupeRenderedScopedStyles)
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Serialize an app's dictionary before its bundle is signed. Never splice raw XML. */
|
|
2
|
+
export declare function renderInfoPlist(entries: Readonly<Record<string, PlistValue>>): string;
|
|
3
|
+
/** Values supported by STX's Info.plist configuration (#2152). */
|
|
4
|
+
export type PlistValue = string | number | boolean | readonly PlistValue[] | { readonly [key: string]: PlistValue }
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const escapeXml = (value) => value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
2
|
+
export function renderInfoPlist(entries) {
|
|
3
|
+
const ancestors = new Set, render = (value, pad, location) => {
|
|
4
|
+
if (typeof value === "string")
|
|
5
|
+
return `${pad}<string>${escapeXml(value)}</string>`;
|
|
6
|
+
if (typeof value === "boolean")
|
|
7
|
+
return `${pad}<${value}/>`;
|
|
8
|
+
if (typeof value === "number") {
|
|
9
|
+
if (!Number.isFinite(value))
|
|
10
|
+
throw TypeError(`Non-finite Info.plist number at ${location}`);
|
|
11
|
+
const tag = Number.isSafeInteger(value) ? "integer" : "real";
|
|
12
|
+
return `${pad}<${tag}>${value}</${tag}>`;
|
|
13
|
+
}
|
|
14
|
+
if (value !== null && typeof value === "object") {
|
|
15
|
+
const array = Array.isArray(value);
|
|
16
|
+
if (!array && Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null)
|
|
17
|
+
throw TypeError(`Unsupported Info.plist value at ${location}`);
|
|
18
|
+
if (ancestors.has(value))
|
|
19
|
+
throw TypeError(`Cyclic Info.plist value at ${location}`);
|
|
20
|
+
ancestors.add(value);
|
|
21
|
+
try {
|
|
22
|
+
const tag = array ? "array" : "dict", indent = `${pad} `, children = array ? Array.from(value, (item, index) => render(item, indent, `${location}[${index}]`)) : Object.entries(value).map(([key, item]) => `${indent}<key>${escapeXml(key)}</key>
|
|
23
|
+
${render(item, indent, `${location}.${key}`)}`);
|
|
24
|
+
return children.length ? `${pad}<${tag}>
|
|
25
|
+
${children.join(`
|
|
26
|
+
`)}
|
|
27
|
+
${pad}</${tag}>` : `${pad}<${tag}/>`;
|
|
28
|
+
} finally {
|
|
29
|
+
ancestors.delete(value);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
throw TypeError(`Unsupported Info.plist value at ${location}`);
|
|
33
|
+
};
|
|
34
|
+
if (!entries || Array.isArray(entries) || typeof entries !== "object")
|
|
35
|
+
throw TypeError("Info.plist root must be a dictionary");
|
|
36
|
+
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
37
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
38
|
+
<plist version="1.0">
|
|
39
|
+
${render(entries, "", "infoPlist")}
|
|
40
|
+
</plist>
|
|
41
|
+
`;
|
|
42
|
+
}
|
package/dist/native-build.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { type MacOSSigningOptions } from './native-signing';
|
|
2
|
+
import { type PlistValue } from './info-plist';
|
|
3
|
+
export type { PlistValue } from './info-plist';
|
|
2
4
|
/**
|
|
3
5
|
* Build an stx template into a native application
|
|
4
6
|
*/
|
|
@@ -74,7 +76,7 @@ export declare interface NativeBuildConfig {
|
|
|
74
76
|
hideDockIcon?: boolean
|
|
75
77
|
menubarOnly?: boolean
|
|
76
78
|
trayPopover?: boolean
|
|
77
|
-
infoPlist?: Record<string,
|
|
79
|
+
infoPlist?: Record<string, PlistValue>
|
|
78
80
|
minimumSystemVersion?: string
|
|
79
81
|
category?: string
|
|
80
82
|
copyright?: string
|
package/dist/native-build.js
CHANGED
|
@@ -9,6 +9,7 @@ import { renderTemplate } from "./render.js";
|
|
|
9
9
|
import { loadStxConfig } from "./config.js";
|
|
10
10
|
import { createTempDir, removeTempDir } from "./temp-dir.js";
|
|
11
11
|
import { signMacOSBundle } from "./native-signing.js";
|
|
12
|
+
import { renderInfoPlist } from "./info-plist.js";
|
|
12
13
|
export async function buildNative(config) {
|
|
13
14
|
if (config.window?.cornerRadius !== void 0 && (!Number.isFinite(config.window.cornerRadius) || config.window.cornerRadius < 0 || config.window.cornerRadius > 128))
|
|
14
15
|
throw Error("Native window cornerRadius must be between 0 and 128");
|
|
@@ -296,24 +297,6 @@ ${stderr}`.match(/(\d+)\.(\d+)\.(\d+)/);
|
|
|
296
297
|
return !1;
|
|
297
298
|
}
|
|
298
299
|
}
|
|
299
|
-
function escapeXml(value) {
|
|
300
|
-
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
301
|
-
}
|
|
302
|
-
function renderInfoPlist(entries) {
|
|
303
|
-
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
304
|
-
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
305
|
-
<plist version="1.0">
|
|
306
|
-
<dict>
|
|
307
|
-
${Object.entries(entries).map(([key, value]) => {
|
|
308
|
-
const rendered = typeof value === "boolean" ? `<${value}/>` : typeof value === "number" ? `<integer>${value}</integer>` : `<string>${escapeXml(String(value))}</string>`;
|
|
309
|
-
return ` <key>${escapeXml(key)}</key>
|
|
310
|
-
${rendered}`;
|
|
311
|
-
}).join(`
|
|
312
|
-
`)}
|
|
313
|
-
</dict>
|
|
314
|
-
</plist>
|
|
315
|
-
`;
|
|
316
|
-
}
|
|
317
300
|
async function buildWindows(html, appName, appVersion, outputDir, format, config, craftPath) {
|
|
318
301
|
const appDir = join(outputDir, appName);
|
|
319
302
|
mkdirSync(appDir, { recursive: !0 });
|
package/dist/pwa.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{eo,Ht,Sl,
|
|
3
|
-
Icon generation requires the sharp package for image processing.`),e.success=!1,e}let g=await c.default(o).metadata();if(g.width&&g.width<512)e.warnings.push(`Source icon is ${g.width}x${g.height}. Recommend using at least 512x512 for best quality.`);for(let i of s){let d=u.join(a,`icon-${i}x${i}.png`);if(await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d),l){let x=u.join(a,`icon-${i}x${i}.webp`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).webp({quality:90}).toFile(x),e.generatedFiles.push(x)}}if(p){for(let d of S){let x=u.join(a,`apple-touch-icon-${d}x${d}.png`);await c.default(o).resize(d,d,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(x),e.generatedFiles.push(x)}let i=u.join(a,"apple-touch-icon.png");await c.default(o).resize(180,180,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(i),e.generatedFiles.push(i)}for(let i of P){let d=u.join(a,`favicon-${i}x${i}.png`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d)}let f=512,y=u.join(a,`icon-maskable-${f}x${f}.png`),m=Math.floor(f*0.1),k=f-m*2;await c.default(o).resize(k,k,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).extend({top:m,bottom:m,left:m,right:m,background:{r:255,g:255,b:255,alpha:1}}).png().toFile(y),e.generatedFiles.push(y)}catch(c){let h=c instanceof Error?c.message:String(c);e.errors.push(`Icon generation failed: ${h}`),e.success=!1}return e}function N(n){let t=n.sizes||v,e=n.outputDir?`/${n.outputDir}`:"/pwa-icons",r=n.generateWebP??!0,o=n.generateAppleIcons??!0,a=[];for(let s of t)if(a.push(`${e}/icon-${s}x${s}.png`),r)a.push(`${e}/icon-${s}x${s}.webp`);if(o){a.push(`${e}/apple-touch-icon.png`);for(let s of S)a.push(`${e}/apple-touch-icon-${s}x${s}.png`)}for(let s of P)a.push(`${e}/favicon-${s}x${s}.png`);return a.push(`${e}/icon-maskable-512x512.png`),a}async function I(){try{return await import("sharp"),!0}catch{return!1}}function A(n,t,e,r){let o=[],a=r.join(" ");for(let s of n)if(o.push({src:`${t}/icon-${s}x${s}.png`,sizes:`${s}x${s}`,type:"image/png",purpose:a}),e)o.push({src:`${t}/icon-${s}x${s}.webp`,sizes:`${s}x${s}`,type:"image/webp",purpose:a});return o}function C(n){return n.map((t)=>({name:t.name,short_name:t.shortName,description:t.description,url:t.url,icons:t.icons?.map((e)=>({src:e.src,sizes:e.sizes,type:e.type}))}))}function T(n){let t=n.pwa?.shareTarget;if(!t?.enabled)return;let e={action:t.action||"/share",method:t.method||"POST",enctype:t.enctype||"multipart/form-data",params:{title:t.params?.title||"title",text:t.params?.text||"text",url:t.params?.url||"url"}};if(t.acceptFiles&&t.acceptFiles.length>0)e.params.files=t.acceptFiles.map((r)=>({name:r.name,accept:r.accept}));return e}function H(n){let t=n.pwa?.fileHandlers;if(!t?.enabled||!t.accept)return;let e=[{action:t.action||"/",accept:t.accept,launch_type:t.launchType||"single-client"}];if(t.icons)e[0].icons=t.icons.map((r)=>({src:r.src,sizes:r.sizes,type:r.type}));return e}function W(n){let t=n.pwa?.protocolHandlers;if(!t||t.length===0)return;return t.map((e)=>({protocol:e.protocol,url:e.url}))}function j(n){let t=n.pwa;if(!t?.enabled||!t.manifest)return null;let{manifest:e,icons:r}=t,o=r?.sizes||[72,96,128,144,152,192,384,512],a=r?.outputDir?`/${r.outputDir}`:"/pwa-icons",s=r?.generateWebP??!0,l=r?.purpose||["any","maskable"],p={name:e.name,short_name:e.shortName||e.name,description:e.description,start_url:e.startUrl||"/",display:e.display||"standalone",display_override:e.displayOverride,orientation:e.orientation,theme_color:e.themeColor,background_color:e.backgroundColor,scope:e.scope||"/",lang:e.lang,dir:e.dir,id:e.id,categories:e.categories,icons:A(o,a,s,l)};if(e.shortcuts&&e.shortcuts.length>0)p.shortcuts=C(e.shortcuts);if(e.screenshots&&e.screenshots.length>0)p.screenshots=e.screenshots.map((f)=>({src:f.src,sizes:f.sizes,type:f.type,label:f.label,form_factor:f.platform}));let c=T(n);if(c)p.share_target=c;let h=H(n);if(h)p.file_handlers=h;let g=W(n);if(g)p.protocol_handlers=g;if(e.launchHandler)p.launch_handler={client_mode:e.launchHandler};if(e.handleLinks)p.handle_links=e.handleLinks;if(e.edgeSidePanel?.enabled)p.edge_side_panel={preferred_width:e.edgeSidePanel.preferredWidth};return p}function _(n){let t=j(n);if(!t)return"";let e=JSON.parse(JSON.stringify(t));return JSON.stringify(e,null,2)}function q(n,t){return{...t,...n,shortcuts:n.shortcuts||t.shortcuts,screenshots:n.screenshots||t.screenshots,categories:n.categories||t.categories}}function D(n){let t=[],e=n.pwa;if(!e?.enabled)return t;let r=e.manifest;if(!r)return t.push("PWA manifest configuration is missing"),t;if(!r.name)t.push("Manifest name is required");let o=["fullscreen","standalone","minimal-ui","browser"];if(r.display&&!o.includes(r.display))t.push(`Invalid display mode: ${r.display}. Must be one of: ${o.join(", ")}`);let a=["any","natural","landscape","landscape-primary","landscape-secondary","portrait","portrait-primary","portrait-secondary"];if(r.orientation&&!a.includes(r.orientation))t.push(`Invalid orientation: ${r.orientation}`);let s=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;if(r.themeColor&&!s.test(r.themeColor))t.push(`Invalid theme color: ${r.themeColor}. Must be a valid hex color.`);if(r.backgroundColor&&!s.test(r.backgroundColor))t.push(`Invalid background color: ${r.backgroundColor}. Must be a valid hex color.`);if(e.shareTarget?.enabled){if(!e.shareTarget.action)t.push("Share target action URL is required")}if(e.fileHandlers?.enabled){if(!e.fileHandlers.accept||Object.keys(e.fileHandlers.accept).length===0)t.push("File handlers must specify accepted MIME types")}if(e.protocolHandlers)for(let l of e.protocolHandlers){if(!l.protocol)t.push("Protocol handler missing protocol");if(!l.url||!l.url.includes("%s"))t.push(`Protocol handler URL must contain %s placeholder: ${l.protocol}`)}return t}import z from"path";async function F(n){let t=n.pwa?.offline;if(!t?.enabled)return"";if(t.page){let e=z.isAbsolute(t.page)?t.page:z.resolve(process.cwd(),t.page);if(await Bun.file(e).exists())try{let{processDirectives:r}=await import("./chunk-
|
|
2
|
+
import{eo,Ht,Sl,Cg}from"./chunk-83myk906.js";import{Qs,Ii,Sg,kg,_g}from"./chunk-t5vjt37c.js";import{wl,vl,xl,vg,xg}from"./chunk-d8rcba53.js";import{Ue,Tn,Oi}from"./chunk-y9bj3566.js";import{Eg,Tg,$g,Rg,to,dy}from"./chunk-gqjb1y7c.js";import B from"fs";import w from"path";import O from"fs";import u from"path";var v=[72,96,128,144,152,192,384,512],S=[120,152,167,180],P=[16,32];async function M(n,t){let e={success:!0,generatedFiles:[],errors:[],warnings:[]},r=n.pwa?.icons;if(!r?.src)return e.errors.push("No source icon specified in pwa.icons.src"),e.success=!1,e;let o=u.isAbsolute(r.src)?r.src:u.resolve(process.cwd(),r.src);if(!await Bun.file(o).exists())return e.errors.push(`Source icon not found: ${o}`),e.success=!1,e;let a=u.resolve(t,r.outputDir||"pwa-icons");try{O.mkdirSync(a,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${a}`),e.success=!1,e}let s=r.sizes||v,l=r.generateWebP??!0,p=r.generateAppleIcons??!0;try{let c;try{c=await import("sharp")}catch{return e.errors.push(`sharp is not installed. Install it with: bun add sharp
|
|
3
|
+
Icon generation requires the sharp package for image processing.`),e.success=!1,e}let g=await c.default(o).metadata();if(g.width&&g.width<512)e.warnings.push(`Source icon is ${g.width}x${g.height}. Recommend using at least 512x512 for best quality.`);for(let i of s){let d=u.join(a,`icon-${i}x${i}.png`);if(await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d),l){let x=u.join(a,`icon-${i}x${i}.webp`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).webp({quality:90}).toFile(x),e.generatedFiles.push(x)}}if(p){for(let d of S){let x=u.join(a,`apple-touch-icon-${d}x${d}.png`);await c.default(o).resize(d,d,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(x),e.generatedFiles.push(x)}let i=u.join(a,"apple-touch-icon.png");await c.default(o).resize(180,180,{fit:"contain",background:{r:255,g:255,b:255,alpha:1}}).png().toFile(i),e.generatedFiles.push(i)}for(let i of P){let d=u.join(a,`favicon-${i}x${i}.png`);await c.default(o).resize(i,i,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).png().toFile(d),e.generatedFiles.push(d)}let f=512,y=u.join(a,`icon-maskable-${f}x${f}.png`),m=Math.floor(f*0.1),k=f-m*2;await c.default(o).resize(k,k,{fit:"contain",background:{r:0,g:0,b:0,alpha:0}}).extend({top:m,bottom:m,left:m,right:m,background:{r:255,g:255,b:255,alpha:1}}).png().toFile(y),e.generatedFiles.push(y)}catch(c){let h=c instanceof Error?c.message:String(c);e.errors.push(`Icon generation failed: ${h}`),e.success=!1}return e}function N(n){let t=n.sizes||v,e=n.outputDir?`/${n.outputDir}`:"/pwa-icons",r=n.generateWebP??!0,o=n.generateAppleIcons??!0,a=[];for(let s of t)if(a.push(`${e}/icon-${s}x${s}.png`),r)a.push(`${e}/icon-${s}x${s}.webp`);if(o){a.push(`${e}/apple-touch-icon.png`);for(let s of S)a.push(`${e}/apple-touch-icon-${s}x${s}.png`)}for(let s of P)a.push(`${e}/favicon-${s}x${s}.png`);return a.push(`${e}/icon-maskable-512x512.png`),a}async function I(){try{return await import("sharp"),!0}catch{return!1}}function A(n,t,e,r){let o=[],a=r.join(" ");for(let s of n)if(o.push({src:`${t}/icon-${s}x${s}.png`,sizes:`${s}x${s}`,type:"image/png",purpose:a}),e)o.push({src:`${t}/icon-${s}x${s}.webp`,sizes:`${s}x${s}`,type:"image/webp",purpose:a});return o}function C(n){return n.map((t)=>({name:t.name,short_name:t.shortName,description:t.description,url:t.url,icons:t.icons?.map((e)=>({src:e.src,sizes:e.sizes,type:e.type}))}))}function T(n){let t=n.pwa?.shareTarget;if(!t?.enabled)return;let e={action:t.action||"/share",method:t.method||"POST",enctype:t.enctype||"multipart/form-data",params:{title:t.params?.title||"title",text:t.params?.text||"text",url:t.params?.url||"url"}};if(t.acceptFiles&&t.acceptFiles.length>0)e.params.files=t.acceptFiles.map((r)=>({name:r.name,accept:r.accept}));return e}function H(n){let t=n.pwa?.fileHandlers;if(!t?.enabled||!t.accept)return;let e=[{action:t.action||"/",accept:t.accept,launch_type:t.launchType||"single-client"}];if(t.icons)e[0].icons=t.icons.map((r)=>({src:r.src,sizes:r.sizes,type:r.type}));return e}function W(n){let t=n.pwa?.protocolHandlers;if(!t||t.length===0)return;return t.map((e)=>({protocol:e.protocol,url:e.url}))}function j(n){let t=n.pwa;if(!t?.enabled||!t.manifest)return null;let{manifest:e,icons:r}=t,o=r?.sizes||[72,96,128,144,152,192,384,512],a=r?.outputDir?`/${r.outputDir}`:"/pwa-icons",s=r?.generateWebP??!0,l=r?.purpose||["any","maskable"],p={name:e.name,short_name:e.shortName||e.name,description:e.description,start_url:e.startUrl||"/",display:e.display||"standalone",display_override:e.displayOverride,orientation:e.orientation,theme_color:e.themeColor,background_color:e.backgroundColor,scope:e.scope||"/",lang:e.lang,dir:e.dir,id:e.id,categories:e.categories,icons:A(o,a,s,l)};if(e.shortcuts&&e.shortcuts.length>0)p.shortcuts=C(e.shortcuts);if(e.screenshots&&e.screenshots.length>0)p.screenshots=e.screenshots.map((f)=>({src:f.src,sizes:f.sizes,type:f.type,label:f.label,form_factor:f.platform}));let c=T(n);if(c)p.share_target=c;let h=H(n);if(h)p.file_handlers=h;let g=W(n);if(g)p.protocol_handlers=g;if(e.launchHandler)p.launch_handler={client_mode:e.launchHandler};if(e.handleLinks)p.handle_links=e.handleLinks;if(e.edgeSidePanel?.enabled)p.edge_side_panel={preferred_width:e.edgeSidePanel.preferredWidth};return p}function _(n){let t=j(n);if(!t)return"";let e=JSON.parse(JSON.stringify(t));return JSON.stringify(e,null,2)}function q(n,t){return{...t,...n,shortcuts:n.shortcuts||t.shortcuts,screenshots:n.screenshots||t.screenshots,categories:n.categories||t.categories}}function D(n){let t=[],e=n.pwa;if(!e?.enabled)return t;let r=e.manifest;if(!r)return t.push("PWA manifest configuration is missing"),t;if(!r.name)t.push("Manifest name is required");let o=["fullscreen","standalone","minimal-ui","browser"];if(r.display&&!o.includes(r.display))t.push(`Invalid display mode: ${r.display}. Must be one of: ${o.join(", ")}`);let a=["any","natural","landscape","landscape-primary","landscape-secondary","portrait","portrait-primary","portrait-secondary"];if(r.orientation&&!a.includes(r.orientation))t.push(`Invalid orientation: ${r.orientation}`);let s=/^#([0-9A-Fa-f]{3}|[0-9A-Fa-f]{6})$/;if(r.themeColor&&!s.test(r.themeColor))t.push(`Invalid theme color: ${r.themeColor}. Must be a valid hex color.`);if(r.backgroundColor&&!s.test(r.backgroundColor))t.push(`Invalid background color: ${r.backgroundColor}. Must be a valid hex color.`);if(e.shareTarget?.enabled){if(!e.shareTarget.action)t.push("Share target action URL is required")}if(e.fileHandlers?.enabled){if(!e.fileHandlers.accept||Object.keys(e.fileHandlers.accept).length===0)t.push("File handlers must specify accepted MIME types")}if(e.protocolHandlers)for(let l of e.protocolHandlers){if(!l.protocol)t.push("Protocol handler missing protocol");if(!l.url||!l.url.includes("%s"))t.push(`Protocol handler URL must contain %s placeholder: ${l.protocol}`)}return t}import z from"path";async function F(n){let t=n.pwa?.offline;if(!t?.enabled)return"";if(t.page){let e=z.isAbsolute(t.page)?t.page:z.resolve(process.cwd(),t.page);if(await Bun.file(e).exists())try{let{processDirectives:r}=await import("./chunk-p5efqqtk.js"),o=await Bun.file(e).text();return await r(o,{},e,n,new Set)}catch(r){console.warn(`[PWA] Failed to process custom offline page: ${r}`)}else console.warn(`[PWA] Custom offline page not found: ${e}`)}return E(n)}function E(n){let t=n.pwa?.offline,e=n.pwa?.manifest,r=t?.fallbackTitle||"You are offline",o=t?.fallbackMessage||"Please check your internet connection and try again.",a=e?.themeColor||"#4f46e5",s=e?.shortName||e?.name||"App";return`<!DOCTYPE html>
|
|
4
4
|
<html lang="en">
|
|
5
5
|
<head>
|
|
6
6
|
<meta charset="UTF-8">
|
|
@@ -233,4 +233,4 @@ Icon generation requires the sharp package for image processing.`),e.success=!1,
|
|
|
233
233
|
}, 5000);
|
|
234
234
|
</script>
|
|
235
235
|
</body>
|
|
236
|
-
</html>`}function b(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}async function re(n,t){let e={success:!0,files:{icons:[]},errors:[],warnings:[]},r=n.pwa;if(!r?.enabled)return e;try{B.mkdirSync(t,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${t}`),e.success=!1,e}try{let a=_(n);if(a){let s=w.join(t,"manifest.json");await Bun.write(s,a),e.files.manifest=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate manifest.json: ${s}`),e.success=!1}if(r.icons?.src)if(await I()){let s=await M(n,t);if(e.files.icons=s.generatedFiles,e.warnings.push(...s.warnings),!s.success)e.errors.push(...s.errors),e.success=!1}else e.warnings.push("sharp is not installed. Skipping icon generation. Install with: bun add sharp");if(r.offline?.enabled)try{let a=await F(n);if(a){let s=w.join(t,"offline.html");await Bun.write(s,a),e.files.offlinePage=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate offline page: ${s}`),e.success=!1}let o;if(r.precache?.enabled){let a=Ue(t,n);o={fileCount:a.fileCount,totalSize:a.totalSize},e.precacheStats=o}try{let a=eo(n,t);if(a){let s=Ht(n),l=w.join(t,s);await Bun.write(l,a),e.files.serviceWorker=l}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate service worker: ${s}`),e.success=!1}return e}function ae(n,t){return Ii(n,t)}function se(n){return n.pwa?.enabled===!0}export{S as APPLE_TOUCH_ICON_SIZES,v as DEFAULT_ICON_SIZES,P as FAVICON_SIZES,vl as auditBuildOutput,wl as auditConfig,re as buildPwaAssets,xl as calculateAuditResult,
|
|
236
|
+
</html>`}function b(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}async function re(n,t){let e={success:!0,files:{icons:[]},errors:[],warnings:[]},r=n.pwa;if(!r?.enabled)return e;try{B.mkdirSync(t,{recursive:!0})}catch{return e.errors.push(`Failed to create output directory: ${t}`),e.success=!1,e}try{let a=_(n);if(a){let s=w.join(t,"manifest.json");await Bun.write(s,a),e.files.manifest=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate manifest.json: ${s}`),e.success=!1}if(r.icons?.src)if(await I()){let s=await M(n,t);if(e.files.icons=s.generatedFiles,e.warnings.push(...s.warnings),!s.success)e.errors.push(...s.errors),e.success=!1}else e.warnings.push("sharp is not installed. Skipping icon generation. Install with: bun add sharp");if(r.offline?.enabled)try{let a=await F(n);if(a){let s=w.join(t,"offline.html");await Bun.write(s,a),e.files.offlinePage=s}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate offline page: ${s}`),e.success=!1}let o;if(r.precache?.enabled){let a=Ue(t,n);o={fileCount:a.fileCount,totalSize:a.totalSize},e.precacheStats=o}try{let a=eo(n,t);if(a){let s=Ht(n),l=w.join(t,s);await Bun.write(l,a),e.files.serviceWorker=l}}catch(a){let s=a instanceof Error?a.message:String(a);e.errors.push(`Failed to generate service worker: ${s}`),e.success=!1}return e}function ae(n,t){return Ii(n,t)}function se(n){return n.pwa?.enabled===!0}export{S as APPLE_TOUCH_ICON_SIZES,v as DEFAULT_ICON_SIZES,P as FAVICON_SIZES,vl as auditBuildOutput,wl as auditConfig,re as buildPwaAssets,xl as calculateAuditResult,xg as formatAuditResult,Oi as formatSize,j as generateManifest,_ as generateManifestJson,kg as generateManifestLink,F as generateOfflinePage,Ue as generatePrecacheManifest,Tn as generatePrecacheManifestJs,M as generatePwaIcons,Qs as generatePwaTags,eo as generateServiceWorker,Cg as generateServiceWorkerAuto,Sg as generateSwRegistrationScript,_g as generateThemeColorMeta,N as getExpectedIconPaths,Ht as getServiceWorkerFileName,Ii as injectPwaTags,se as isPwaEnabled,I as isSharpAvailable,Sl as isWorkboxEnabled,q as mergeManifestConfig,ae as processPwaHtml,to as pwaDirectives,Eg as pwaInstallDirective,$g as pwaOfflineDirective,Rg as pwaPushDirective,Tg as pwaUpdateDirective,dy as registerPwaDirectives,vg as runPwaAudit,D as validateManifest};
|
package/dist/ssg.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-7sh9fa3q.js";import{w,rl}from"./chunk-
|
|
3
|
-
`)}function q(t){return async()=>({paths:await t(),fallback:!1})}var Ot;function Lt(t){let n=r(t),{depths:s}=ge(n),o=/\b(?:async\s+)?function\s+getStaticPaths\s*\(/g,
|
|
2
|
+
import"./chunk-7sh9fa3q.js";import{w,rl}from"./chunk-se44tmvx.js";import"./chunk-t65tn8ee.js";import"./chunk-2yxva96k.js";import{Rt,S}from"./chunk-5pzcd5jh.js";import"./chunk-akcyaxwv.js";import"./chunk-qkfdp97k.js";import"./chunk-9gwhs0gk.js";import{kt,_t,Ct,Et,Tt,$t}from"./chunk-j2v9f2dk.js";import{a}from"./chunk-116ajzvm.js";import{Ts}from"./chunk-dq87xd5c.js";import"./chunk-qpvwxppw.js";import"./chunk-nxdgvtgc.js";import{he,en,tn}from"./chunk-sbe6xr6h.js";import"./chunk-v1xtm49w.js";import{y}from"./chunk-16htz6k0.js";import{yt,i}from"./chunk-8tb3cmhv.js";import"./chunk-w5dw3c8m.js";import"./chunk-cm0f5aj3.js";import{gs}from"./chunk-9y6vdjy5.js";import"./chunk-7svwyjxb.js";import"./chunk-c84pxd2k.js";import{Za,Qa,ec}from"./chunk-gjf8cjdt.js";import{Zt,Yn,Zn}from"./chunk-ndjmt3vg.js";import{Qt}from"./chunk-2xa05bav.js";import"./chunk-mshnt7y9.js";import"./chunk-2yb1rwmy.js";import{K,we}from"./chunk-jzxh4y5j.js";import"./chunk-kydgndkt.js";import"./chunk-9hn0zpxj.js";import{c}from"./chunk-brhas9mp.js";import{r,ge}from"./chunk-b9d70mgr.js";import D from"fs";import f from"path";import{createHash as vt}from"crypto";function Pt(t){try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return t}}var Dt=/<script\s+type="stx\/island"\s+data-stx-island="([^"]+)"([^>]*)>([\s\S]*?)<\/script>/g;function It(t){return Bun.hash(t).toString(16)}function ot(t,n={}){if(!t.includes('type="stx/island"'))return{html:t,chunks:[]};let s=new Map,o=t.replace(Dt,(e,u,g,v)=>{let x=v.trim();if(!x)return e;if(/\bdata-stx-src=/.test(g))return e;if(n.minify)x=Pt(x);let p=It(x);if(!s.has(p))s.set(p,x);let P=n.integrity?` data-stx-integrity="sha384-${vt("sha384").update(x).digest("base64")}"`:"";return`<script type="stx/island" data-stx-island="${u}" data-stx-src="/_stx/islands/${p}.js"${P}${g}></script>`}),l=Array.from(s,([e,u])=>({hash:e,code:u}));return{html:o,chunks:l}}var Bt=new Set(["visible","idle"]);function ct(t){if(!t.includes("data-stx-src="))return t;let n=new Map,s=/data-stx-scope="([^"]+)"[^>]*?stx-hydrate="([^"]+)"/g,o;while((o=s.exec(t))!==null)n.set(o[1],o[2]);let l=new Set,e=/data-stx-island="([^"]+)"[^>]*?data-stx-src="([^"]+)"/g,u;while((u=e.exec(t))!==null)if(Bt.has(n.get(u[1])||""))l.add(u[2]);let g=/<\/head\s*>/iy,v=S(t,(p,P)=>(g.lastIndex=P,g.exec(p)?g.lastIndex:-1))[0]?.start??-1;if(l.size===0||v===-1)return t;let x=Array.from(l).filter((p)=>!t.includes(`rel="prefetch" href="${p}"`)).map((p)=>`<link rel="prefetch" href="${p}" as="script">`).join("");if(!x)return t;return t.slice(0,v)+x+t.slice(v)}var jt=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function X(t){let n=t.trim();if(!n)return null;let s=/^https?:\/\//i.test(n)?n:`https://${n}`;try{return new URL(s).origin+new URL(s).pathname.replace(/\/$/,"")}catch{return null}}function Ft(t){for(let n of jt){let s=t[n];if(!s)continue;let o=X(s);if(o)return{url:o,source:"env",via:n}}return null}function lt(t){if(!t||typeof t!=="object")return null;let n=t,s=n.site?.url??n.url??n.app?.url;return typeof s==="string"?X(s):null}async function At(t){let{existsSync:n}=await import("fs"),s=await import("path");for(let o of["site.config.ts","site.config.js",".config/site.config.ts"]){let l=s.resolve(t,o);if(!n(l))continue;try{let e=await import(l),u=lt(e.default??e);if(u)return u}catch{}}return null}async function ut(t={}){let n=t.cwd??process.cwd(),s=t.env??process.env;if(t.explicit){let u=X(t.explicit);if(u)return{url:u,source:"option"}}let o=lt(t.stxConfig);if(o)return{url:o,source:"stx.config",via:"site.url"};let l=await At(n);if(l)return{url:l,source:"site.config",via:"url"};let e=Ft(s);if(e)return e;return{url:"http://localhost",source:"fallback"}}function dt(){return["No site URL configured \u2014 sitemap.xml and robots.txt will point at http://localhost."," Set one in stx.config.ts (site: { url: 'https://example.com' }), in site.config.ts,"," via --domain, or with SITE_URL in the build environment."].join(`
|
|
3
|
+
`)}function q(t){return async()=>({paths:await t(),fallback:!1})}var Ot;function Lt(t){let n=r(t),{depths:s}=ge(n),o=/\b(?:async\s+)?function\s+getStaticPaths\s*\(/g,l;while((l=o.exec(n))!==null){if(s[l.index]!==0)continue;let u=w(n,"(",")",o.lastIndex-1),g=n.indexOf("{",u+1),v=w(n,"{","}",g);if(u<0||g<0||v<0)break;return t.slice(l.index,v+1)}let e=/\b(?:const|let|var)\s+getStaticPaths\s*=/g;while((l=e.exec(n))!==null){if(s[l.index]!==0)continue;let u=rl(n,e.lastIndex).endPos;return t.slice(e.lastIndex,u).trim()}throw SyntaxError("Could not extract getStaticPaths; use a top-level function or const declaration")}async function gt(t){let n="read";try{let s=await Bun.file(t).text();n="parse";let o=Qt(s),l=[...o.server,...o.client,...o.signals].filter((e)=>/(?:^|\s)server(?:\s|=|$)/i.test(r(e.attrs))).sort((e,u)=>s.indexOf(e.fullTag)-s.indexOf(u.fullTag));for(let e of l){if(!/\bgetStaticPaths\b/.test(r(e.content)))continue;let u=(Ot??=new Bun.Transpiler({loader:"ts",target:"bun"})).transformSync(e.content);if(!/\bgetStaticPaths\b/.test(r(u)))continue;let g=Lt(u);if(/\bdefineStaticPaths\b/.test(r(g))&&Rt(u,"defineStaticPaths"))throw SyntaxError("Cannot evaluate a module-local defineStaticPaths binding during isolated hook extraction");n="execute";let v=Function("defineStaticPaths",`return (${g})`)(q);if(typeof v!=="function")throw TypeError("getStaticPaths must be a function");let x=await v();n="result";let p=Array.isArray(x)?{paths:x}:x;if(!p||typeof p!=="object"||!("paths"in p)||!Array.isArray(p.paths))throw TypeError("getStaticPaths must return { paths: [...] } or an array of paths");for(let P of p.paths)if(!P||typeof P!=="object"||!P.params||typeof P.params!=="object"||Array.isArray(P.params))throw TypeError("Each getStaticPaths path must contain a params object");return{kind:"ok",value:p}}return{kind:"absent"}}catch(s){return{kind:"error",phase:n,error:s instanceof Error?s:Error(String(s))}}}class pt{cacheDir;cache=new Map;loaded=!1;salt;constructor(t,n=""){this.cacheDir=t,this.salt=n}async load(){if(this.loaded)return;let t=f.join(this.cacheDir,"build-cache.json");if(await Bun.file(t).exists())try{let n=JSON.parse(await Bun.file(t).text());for(let[s,o]of Object.entries(n))this.cache.set(s,o)}catch{}this.loaded=!0}async save(){await D.promises.mkdir(this.cacheDir,{recursive:!0});let t=f.join(this.cacheDir,"build-cache.json"),n={};for(let[s,o]of this.cache)n[s]=o;await Bun.write(t,JSON.stringify(n))}getHash(t,n){let s=D.statSync(t),o=`${this.salt}|${t}:${s.mtimeMs}`;for(let e of n)if(D.existsSync(e)){let u=D.statSync(e);o+=`:${e}:${u.mtimeMs}`}let l=0;for(let e=0;e<o.length;e++){let u=o.charCodeAt(e);l=(l<<5)-l+u,l=l&l}return Math.abs(l).toString(36)}get(t,n){let s=this.cache.get(t);if(!s)return null;let o=ft(n).some((u)=>D.existsSync(u)),l=[n,...s.dependencies??[]].some((u)=>u.endsWith(".stx")&&D.existsSync(u)&&gs(D.readFileSync(u,"utf8")).some((g)=>/\bserver\b/.test(g.attrs)));if(o||l)return this.cache.delete(t),null;let e=this.getHash(n,s.dependencies??[]);if(s.hash!==e)return this.cache.delete(t),null;return s.html}set(t,n,s,o){let l=this.getHash(n,s);this.cache.set(t,{hash:l,html:o,generatedAt:Date.now(),dependencies:s})}}class ht{cacheDir;constructor(t){this.cacheDir=t}getFilePath(t){let n=t.replace(/[^a-zA-Z0-9]/g,"_")+".json";return f.join(this.cacheDir,"isr",n)}async get(t){let n=this.getFilePath(t);if(!await Bun.file(n).exists())return null;try{return JSON.parse(await Bun.file(n).text())}catch{return null}}async set(t,n){let s=this.getFilePath(t);await D.promises.mkdir(f.dirname(s),{recursive:!0}),await Bun.write(s,JSON.stringify(n))}async invalidate(t){let n=this.getFilePath(t);if(await Bun.file(n).exists())await D.promises.unlink(n)}async invalidatePattern(t){let n=f.join(this.cacheDir,"isr");if(!D.existsSync(n))return;let s=await D.promises.readdir(n);for(let o of s){let l=o.replace(/_/g,"/").replace(".json","");if(t.test(l))await D.promises.unlink(f.join(n,o))}}async needsRevalidation(t){let n=await this.get(t);if(!n)return!0;return Date.now()>n.revalidateAfter}}async function Ut(t){let n=[];if(!t.isDynamic)n.push({url:t.pattern,params:{}});else{let s=await gt(t.filePath);if(s.kind==="error")throw Error(`getStaticPaths ${s.phase} failed for ${t.pattern} (${t.filePath}): ${s.error.message}`,{cause:s.error});if(s.kind==="absent")return console.warn(`Warning: Dynamic route ${t.pattern} (${t.filePath}) has no getStaticPaths`),n;let o=s.value;if(o.paths.length===0)return console.info(`getStaticPaths returned no paths for dynamic route ${t.pattern} (${t.filePath})`),n;for(let l of o.paths){let e=t.pattern;for(let[u,g]of Object.entries(l.params))e=e.replace(`:${u}`,g).replace(`:${u}*`,g);n.push({url:e,params:l.params,props:l.props,revalidate:l.revalidate})}}return n}function ft(t){return[t.replace(/\.stx$/,".data.ts"),t.replace(/\.stx$/,".data.js"),t+".data.ts",t+".data.js"]}async function Mt(t){for(let n of ft(t))if(await Bun.file(n).exists())try{let s=await import(n);if(typeof s.default==="function")return await s.default();else if(typeof s.default==="object")return s.default;else if(typeof s.getData==="function")return await s.getData();else{let{default:o,...l}=s;return l}}catch(s){console.error(`Error loading data file ${n}:`,s)}return null}async function Gt(t,n,s){let o=t.match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!o)return null;let l=o[1];if(!l.includes("getStaticProps"))return null;try{let e=l.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticProps\s*\([^)]*\)\s*\{([\s\S]*?)\n\}/);if(!e)return null;return await Function("params",`
|
|
4
4
|
return (async function getStaticProps() {
|
|
5
5
|
${e[1]}
|
|
6
6
|
})()
|
|
7
|
-
`)(n)}catch(e){return console.error(`Error executing getStaticProps in ${s}:`,e),null}}function Nt(t){return/(?:^|[^\w$.])(?:export\s+)?(?:async\s+)?function\s+action\s*\(/.test(t)||/(?:^|[^\w$.])(?:export\s+)?(?:const|let|var)\s+action\s*=/.test(t)}async function mt(t,n,s={},o,
|
|
7
|
+
`)(n)}catch(e){return console.error(`Error executing getStaticProps in ${s}:`,e),null}}function Nt(t){return/(?:^|[^\w$.])(?:export\s+)?(?:async\s+)?function\s+action\s*\(/.test(t)||/(?:^|[^\w$.])(?:export\s+)?(?:const|let|var)\s+action\s*=/.test(t)}async function mt(t,n,s={},o,l){let e=await Bun.file(t.filePath).text(),u=await Mt(t.filePath),g=await Gt(e,n,t.filePath),v={...u||{},...g||{},...s,params:n,$route:{path:t.pattern,params:n}},x=new Set,p=[],P=[],E={...l,minifyClient:!0,...o.partialsDir?{partialsDir:o.partialsDir}:{},...o.componentsDir?{componentsDir:o.componentsDir}:{},debug:!1,cache:!1,autoShell:!0,onIncludeError:(R)=>{p.push(`${f.relative(process.cwd(),R.templatePath)}: ${R.message}
|
|
8
8
|
resolved against partialsDir: ${R.partialsDir}`)},onServerScriptError:(R)=>{P.push(`${f.relative(process.cwd(),R.sourcePath)} (${R.kind}): ${R.message}`)}};if(Nt(e))console.warn(`Warning: ${t.pattern} exports a page action, which cannot run in a static build. Its form will submit to a file. Serve this route with the production server, or point the form's action at a route handler.`);let b=await i(e,v,t.filePath,E,x);for(let R of[t.filePath,...x])for(let T of he(R))x.add(T);if(Object.keys(n).length>0){let R=`<script>if(window.stx)window.stx._rp=${JSON.stringify(n)};else window.__stx_rp=${JSON.stringify(n)};</script>`;if(b.includes("</head>"))b=b.replace("</head>",`${R}
|
|
9
9
|
</head>`);else b=`${R}
|
|
10
|
-
${b}`}if(b=await we(b,{router:o.router}),b=await y(b),o.minify!==!1)return{html:Ht(b),dependencies:Array.from(x),includeFailures:p,serverScriptFailures:P};return{html:b,dependencies:Array.from(x),includeFailures:p,serverScriptFailures:P}}function Ht(t){let n=[],s=0,o=/(<script[^>]*>)([\s\S]*?)(<\/script>)/gi,
|
|
10
|
+
${b}`}if(b=await we(b,{router:o.router}),b=await y(b),o.minify!==!1)return{html:Ht(b),dependencies:Array.from(x),includeFailures:p,serverScriptFailures:P};return{html:b,dependencies:Array.from(x),includeFailures:p,serverScriptFailures:P}}function Ht(t){let n=[],s=0,o=/(<script[^>]*>)([\s\S]*?)(<\/script>)/gi,l;while((l=o.exec(t))!==null){let u=t.slice(s,l.index);n.push(u.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><"));let g=l[1],v=l[2],x=l[3];v=v.replace(/([^:"\\'`])\/\/(?!\/)(?![*!])([^\n]*)/g,"$1"),n.push(g+v+x),s=l.index+l[0].length}let e=t.slice(s);return n.push(e.replace(/<!--(?!\[if)[\s\S]*?-->/g,"").replace(/\s+/g," ").replace(/>\s+</g,"><")),n.join("").trim()}function zt(t){let n=0;for(let s=0;s<t.length;s++){let o=t.charCodeAt(s);n=(n<<5)-n+o,n=n&n}return`"${Math.abs(n).toString(36)}"`}function Wt(t,n,s,o){if(s?.sitemap===!1)return!0;if(/<meta[^>]+name=["']robots["'][^>]+content=["'][^"']*noindex/i.test(n))return!0;return o.some((l)=>{if(l instanceof RegExp)return l.test(t);return l.endsWith("/")?t===l.slice(0,-1)||t.startsWith(l):t===l})}function qt(t,n){return`<?xml version="1.0" encoding="UTF-8"?>
|
|
11
11
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
12
|
-
${t.map((o)=>{let
|
|
13
|
-
<loc>${F(
|
|
12
|
+
${t.map((o)=>{let l=new URL(o.loc,n).href,e=` <url>
|
|
13
|
+
<loc>${F(l)}</loc>`;if(o.lastmod)e+=`
|
|
14
14
|
<lastmod>${o.lastmod}</lastmod>`;if(o.changefreq)e+=`
|
|
15
15
|
<changefreq>${o.changefreq}</changefreq>`;if(o.priority!==void 0)e+=`
|
|
16
16
|
<priority>${o.priority}</priority>`;return e+=`
|
|
17
17
|
</url>`,e}).join(`
|
|
18
18
|
`)}
|
|
19
|
-
</urlset>`}function F(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Jt(t,n){let s=n.map((o)=>{let
|
|
20
|
-
<title>${F(o.title)}</title>`,
|
|
21
|
-
<link>${F(o.link)}</link>`,o.description)
|
|
22
|
-
<description>${F(o.description)}</description>`;if(o.pubDate)
|
|
23
|
-
<pubDate>${o.pubDate.toUTCString()}</pubDate>`;if(o.author)
|
|
24
|
-
<author>${F(o.author)}</author>`;if(o.categories)for(let e of o.categories)
|
|
25
|
-
<category>${F(e)}</category>`;if(o.guid)
|
|
26
|
-
<guid>${F(o.guid)}</guid>`;return
|
|
27
|
-
</item>`,
|
|
19
|
+
</urlset>`}function F(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Jt(t,n){let s=n.map((o)=>{let l=" <item>";if(l+=`
|
|
20
|
+
<title>${F(o.title)}</title>`,l+=`
|
|
21
|
+
<link>${F(o.link)}</link>`,o.description)l+=`
|
|
22
|
+
<description>${F(o.description)}</description>`;if(o.pubDate)l+=`
|
|
23
|
+
<pubDate>${o.pubDate.toUTCString()}</pubDate>`;if(o.author)l+=`
|
|
24
|
+
<author>${F(o.author)}</author>`;if(o.categories)for(let e of o.categories)l+=`
|
|
25
|
+
<category>${F(e)}</category>`;if(o.guid)l+=`
|
|
26
|
+
<guid>${F(o.guid)}</guid>`;return l+=`
|
|
27
|
+
</item>`,l});return`<?xml version="1.0" encoding="UTF-8"?>
|
|
28
28
|
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
|
29
29
|
<channel>
|
|
30
30
|
<title>${F(t.title)}</title>
|
|
@@ -37,7 +37,7 @@ ${t.map((o)=>{let c=new URL(o.loc,n).href,e=` <url>
|
|
|
37
37
|
${s.join(`
|
|
38
38
|
`)}
|
|
39
39
|
</channel>
|
|
40
|
-
</rss>`}async function Vt(t={}){let n=Date.now();tn();let s=await a(process.cwd()),o=s.build||{},
|
|
40
|
+
</rss>`}async function Vt(t={}){let n=Date.now();tn();let s=await a(process.cwd()),o=s.build||{},l=await ut({explicit:t.domain||o.domain,stxConfig:s});if(l.source==="fallback"&&(t.sitemap??o.sitemap??!0))console.warn(dt());let e={router:t.router??s?.router??{},pagesDir:t.pagesDir||o.pagesDir||"pages",outputDir:t.outputDir||o.outputDir||"dist",baseUrl:t.baseUrl||o.baseUrl||"/",domain:l.url,revalidate:t.revalidate??o.revalidate??!1,sitemap:t.sitemap??o.sitemap??!0,sitemapExclude:t.sitemapExclude||o.sitemapExclude||[],robots:t.robots??o.robots??!0,rss:t.rss??o.rss??!1,concurrency:t.concurrency||o.concurrency||10,cache:t.cache??o.cache??!0,cacheDir:t.cacheDir||o.cacheDir||c(process.cwd(),"ssg-cache"),contentLoaders:t.contentLoaders||[],hooks:t.hooks||{},minify:t.minify??o.minify??!0,generate404:t.generate404??o.generate404??!0,publicDir:t.publicDir||o.publicDir||"public",trailingSlash:t.trailingSlash??o.trailingSlash??!1,cleanOutput:t.cleanOutput??o.cleanOutput??!0,cacheSalt:t.cacheSalt??"",partialsDir:t.partialsDir||s?.partialsDir||"",componentsDir:t.componentsDir||s?.componentsDir||"",failOnIncludeError:t.failOnIncludeError??!0,failOnServerScriptError:t.failOnServerScriptError??!0,chunkIslands:t.chunkIslands===!0,prefetchIslands:t.prefetchIslands===!0,integrityIslands:t.integrityIslands===!0},u={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},g=new Set,v=0,x={},p={};await e.hooks.onBuildStart?.();try{if(e.cleanOutput&&D.existsSync(e.outputDir))await D.promises.rm(e.outputDir,{recursive:!0});await D.promises.mkdir(e.outputDir,{recursive:!0});let E=e.cacheSalt;if(!E){let{resolveUserCssConfig:d,fingerprintConfig:m}=await import("./chunk-rd3pek52.js");try{E=m(await d(process.cwd()))}catch{}}let{prepareImageDelivery:b}=await import("./chunk-24aq9yrk.js"),R=await b(e.publicDir,e.outputDir);if(R.count>0)console.log(`Optimized ${R.count} image(s) for responsive delivery`),E=[E,R.fingerprint].filter(Boolean).join(":");let T=new pt(e.cacheDir,E);if(e.cache)await T.load();try{let{generateCss:d}=await import("./chunk-rd3pek52.js");await d('<div class="bg-black"></div>')}catch{}kt();let wt=s?.routeMiddleware?.dir||"middleware";await Ct(process.cwd(),wt);let J=_t();if(J.length>0)console.log(`Loaded ${J.length} middleware: ${J.join(", ")}`);let St=s?.routeMiddleware?.global||[];ec(s?.layoutsDir,c(process.cwd()));let Z=K(".",{pagesDir:e.pagesDir,pagesDirs:s?._layerPageDirs});console.log(`Found ${Z.length} routes`);let M=[];for(let d of Z)try{let m=await Ut(d);for(let k of m)M.push({route:d,url:k.url,params:k.params,props:k.props,revalidate:k.revalidate??e.revalidate})}catch(m){let k=m instanceof Error?m:Error(String(m));u.failedCount++,u.errors.push({route:d.pattern,error:k}),await e.hooks.onError?.(k,d.pattern),console.error(`Error discovering paths for ${d.pattern}:`,k)}u.totalPages=M.length+u.failedCount,console.log(`Generating ${M.length} pages...`);let _=[],Q=[];for(let d=0;d<M.length;d+=e.concurrency)Q.push(M.slice(d,d+e.concurrency));for(let d of Q)await Promise.all(d.map(async(m)=>{let{route:k,url:h,params:G,props:xt,revalidate:rt}=m;try{await e.hooks.onPageStart?.(h);let A=await Bun.file(k.filePath).text(),O=Yt(A),bt=O?.middleware?Array.isArray(O.middleware)?O.middleware:[O.middleware]:[],nt=[...St,...bt];if(nt.length>0){let B=Et(h,G,O||{}),L=Tt(B,null,void 0,{isServer:!0}),j=await $t(nt,L);if(j.redirect){let C=typeof j.redirect==="string"?j.redirect:j.redirect.path||j.redirect,H=te(String(C),h),U=ee(h,e);await D.promises.mkdir(f.dirname(U),{recursive:!0}),await Bun.write(U,H),u.successCount++,u.pages.push({route:h,outputPath:U,size:Buffer.byteLength(H),cached:!1}),_.push({loc:h,lastmod:new Date().toISOString()}),console.log(` \u21B3 ${h} \u2192 redirect to ${C}`);return}if(j.abort){let C=typeof j.abort==="string"?j.abort:j.abort?.error?.message||"aborted";console.warn(` \u21B3 ${h} \u2014 middleware aborted: ${C}`);return}}let it=A.match(/definePageMeta\s*\(\s*\{[\s\S]*?validate\s*:\s*((?:\([^)]*\)|[^,}])*(?:\{[\s\S]*?\})?)/m);if(it)try{if(!await Function("route",`
|
|
41
41
|
const validate = ${it[1]};
|
|
42
42
|
return validate(route);
|
|
43
43
|
`)({params:G})){console.warn(`Validation failed for ${h}, skipping...`);return}}catch{}let I=null,st=!1;if(e.cache){if(I=T.get(h,k.filePath),I)st=!0,u.cachedCount++}if(!I){let B=await mt(k,G,xt,e,s);if(I=B.html,e.failOnIncludeError&&B.includeFailures.length>0)throw Error(`${B.includeFailures.length} include(s) failed to resolve, so this page would have shipped with an error banner where the markup should be:
|
|
@@ -77,8 +77,8 @@ Build complete!
|
|
|
77
77
|
Cached: ${u.cachedCount}
|
|
78
78
|
Failed: ${u.failedCount}
|
|
79
79
|
Time: ${u.buildTime}ms${P}
|
|
80
|
-
`),u}async function Y(t,n){await D.promises.mkdir(n,{recursive:!0});let s=await D.promises.readdir(t,{withFileTypes:!0});for(let o of s){let
|
|
81
|
-
`)){let P=p.indexOf(":");if(P>0){let E=p.slice(0,P).trim(),b=p.slice(P+1).trim();if(b==="true")b=!0;else if(b==="false")b=!1;else if(/^\d+$/.test(b))b=parseInt(b,10);else if(/^\d+\.\d+$/.test(b))b=parseFloat(b);else if(b.startsWith("[")&&b.endsWith("]"))b=b.slice(1,-1).split(",").map((R)=>R.trim().replace(/^['"]|['"]$/g,""));o[E]=b}}}let e=
|
|
80
|
+
`),u}async function Y(t,n){await D.promises.mkdir(n,{recursive:!0});let s=await D.promises.readdir(t,{withFileTypes:!0});for(let o of s){let l=f.join(t,o.name),e=f.join(n,o.name);if(o.isDirectory())await D.promises.mkdir(e,{recursive:!0}),await Y(l,e);else await D.promises.copyFile(l,e)}}function Kt(t={}){let n=t.cacheDir||c(process.cwd(),"ssg-cache"),s=new ht(n),o=t.revalidate||3600;return{async get(l){let e=await s.get(l);if(!e)return null;if(Date.now()>e.revalidateAfter)this.revalidate(l).catch(console.error);return{html:e.html,headers:{"Cache-Control":`public, max-age=${o}, stale-while-revalidate=${o*2}`,ETag:e.etag,"X-ISR-Generated":new Date(e.generatedAt).toISOString(),...e.headers}}},async revalidate(l){let u=K(".",{pagesDir:t.pagesDir||"pages"}).find((P)=>l.match(P.regex)!==null);if(!u){console.warn(`Route not found for revalidation: ${l}`);return}let g=l.match(u.regex),v={};if(g)u.params.forEach((P,E)=>{v[P]=g[E+1]});let x=await a(),{html:p}=await mt(u,v,{},t,x);await s.set(l,{html:p,generatedAt:Date.now(),revalidateAfter:Date.now()+o*1000,etag:zt(p)}),console.log(`Revalidated: ${l}`)},async invalidate(l){if(typeof l==="string")await s.invalidate(l);else await s.invalidatePattern(l)}}}function Xt(){return{name:"markdown",extensions:[".md",".mdx"],async load(t){let n=await Bun.file(t).text(),s=n.match(/^---\n([\s\S]*?)\n---/),o={},l=n;if(s){let x=s[1];l=n.slice(s[0].length).trim();for(let p of x.split(`
|
|
81
|
+
`)){let P=p.indexOf(":");if(P>0){let E=p.slice(0,P).trim(),b=p.slice(P+1).trim();if(b==="true")b=!0;else if(b==="false")b=!1;else if(/^\d+$/.test(b))b=parseInt(b,10);else if(/^\d+\.\d+$/.test(b))b=parseFloat(b);else if(b.startsWith("[")&&b.endsWith("]"))b=b.slice(1,-1).split(",").map((R)=>R.trim().replace(/^['"]|['"]$/g,""));o[E]=b}}}let e=l.replace(/^### (.*$)/gim,"<h3>$1</h3>").replace(/^## (.*$)/gim,"<h2>$1</h2>").replace(/^# (.*$)/gim,"<h1>$1</h1>").replace(/\*\*(.*)\*\*/gim,"<strong>$1</strong>").replace(/\*(.*)\*/gim,"<em>$1</em>").replace(/`([^`]+)`/gim,"<code>$1</code>").replace(/\[([^\]]+)\]\(([^)]+)\)/gim,'<a href="$2">$1</a>').replace(/\n/gim,"<br>"),u=[],g=/<h([1-6])>([^<]+)<\/h[1-6]>/gi,v;while((v=g.exec(e))!==null){let x=parseInt(v[1],10),p=v[2],P=p.toLowerCase().replace(/[^a-z0-9]+/g,"-");u.push({id:P,text:p,level:x})}return{content:e,data:o,toc:u}}}}function Yt(t){return yt(t)}function te(t,n){return`<!DOCTYPE html>
|
|
82
82
|
<html>
|
|
83
83
|
<head>
|
|
84
84
|
<meta charset="utf-8">
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/stx",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.799",
|
|
5
5
|
"description": "A performant UI Framework. Powered by Bun.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -128,12 +128,12 @@
|
|
|
128
128
|
"dependencies": {
|
|
129
129
|
"@stacksjs/ts-css": "^0.3.21",
|
|
130
130
|
"@stacksjs/clapp": "^0.2.16",
|
|
131
|
-
"@stacksjs/desktop": "0.2.
|
|
132
|
-
"@stacksjs/sanitizer": "0.2.
|
|
131
|
+
"@stacksjs/desktop": "0.2.799",
|
|
132
|
+
"@stacksjs/sanitizer": "0.2.799",
|
|
133
133
|
"@stacksjs/ts-i18n": "^0.1.11",
|
|
134
|
-
"bun-plugin-stx": "0.2.
|
|
134
|
+
"bun-plugin-stx": "0.2.799",
|
|
135
135
|
"bunfig": "^0.15.21",
|
|
136
|
-
"stx-router": "0.2.
|
|
136
|
+
"stx-router": "0.2.799",
|
|
137
137
|
"ts-broadcasting": "^0.0.11",
|
|
138
138
|
"ts-images": "^0.2.22",
|
|
139
139
|
"ts-syntax-highlighter": "^0.2.1"
|
package/dist/chunk-0xnvjw7s.js
DELETED