@stacksjs/stx 0.2.575 → 0.2.576
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-r86eygkr.js → chunk-181m21rg.js} +1 -1
- package/dist/{chunk-d2t06g71.js → chunk-1nbn56jw.js} +1 -1
- package/dist/{chunk-jh64t9r9.js → chunk-1w9ngqpv.js} +1 -1
- package/dist/{chunk-2v94vt23.js → chunk-1wkpxa58.js} +1 -1
- package/dist/{chunk-gzgffn5w.js → chunk-32gycb72.js} +1 -1
- package/dist/{chunk-143j8qgg.js → chunk-34fajf1n.js} +49 -48
- package/dist/chunk-3bj1w990.js +2 -0
- package/dist/{chunk-01f9w9y7.js → chunk-6q3yszw9.js} +1 -1
- package/dist/{chunk-fadkvwg0.js → chunk-6rfm6b1c.js} +1 -1
- package/dist/{chunk-5d4amjez.js → chunk-6ryab0yy.js} +1 -1
- package/dist/{chunk-ztmrrs04.js → chunk-6wz6f8d5.js} +2 -2
- package/dist/{chunk-ahym2dsj.js → chunk-7y73q42g.js} +1 -1
- package/dist/{chunk-qaxw0r5z.js → chunk-9dgygz8d.js} +1 -1
- package/dist/{chunk-79px3e4d.js → chunk-a51f04an.js} +1 -1
- package/dist/{chunk-s88fw3bj.js → chunk-aa52jhak.js} +1 -1
- package/dist/{chunk-3rfpm9ba.js → chunk-ambynnzb.js} +1 -1
- package/dist/{chunk-5xf91q8y.js → chunk-bbdg3sqq.js} +1 -1
- package/dist/{chunk-mxmd0hrk.js → chunk-bctjmaxg.js} +5 -5
- package/dist/{chunk-afte2g15.js → chunk-bmtsb5mr.js} +1 -1
- package/dist/{chunk-qtshc8t7.js → chunk-c8rd3573.js} +1 -1
- package/dist/{chunk-mh7ex807.js → chunk-d4b8cgvt.js} +1 -1
- package/dist/{chunk-b9w35cr8.js → chunk-f2y8bwdd.js} +1 -1
- package/dist/{chunk-gqwc0vsy.js → chunk-g9vtny6q.js} +1 -1
- package/dist/{chunk-aa874ytc.js → chunk-gjp2jxrp.js} +1 -1
- package/dist/{chunk-rwnssrsr.js → chunk-hwy3aw5v.js} +1 -1
- package/dist/{chunk-q148m77y.js → chunk-hyafyqy6.js} +1 -1
- package/dist/{chunk-7m0sz5sz.js → chunk-j4zyq2ap.js} +1 -1
- package/dist/{chunk-m923y6j2.js → chunk-j83ax407.js} +1 -1
- package/dist/{chunk-0c1dwxwc.js → chunk-je0cttam.js} +1 -1
- package/dist/{chunk-972zjftw.js → chunk-jgrtvs81.js} +2 -2
- package/dist/{chunk-9kxffk9k.js → chunk-mp99h8wh.js} +1 -1
- package/dist/{chunk-xgqnvtq9.js → chunk-n829xbbq.js} +1 -1
- package/dist/{chunk-1y3ejs6c.js → chunk-nd3qttxh.js} +1 -1
- package/dist/{chunk-2kkrgb5s.js → chunk-nn462qm9.js} +1 -1
- package/dist/{chunk-hmx4r4wx.js → chunk-nr07vxm2.js} +1 -1
- package/dist/{chunk-4wjwj4tn.js → chunk-pqkb1m5x.js} +2 -2
- package/dist/{chunk-b621akb3.js → chunk-r51vyhms.js} +1 -1
- package/dist/{chunk-bjzgseeg.js → chunk-sf7z2ar9.js} +1 -1
- package/dist/{chunk-g6tm9sqr.js → chunk-sw7mvg9p.js} +1 -1
- package/dist/chunk-tz40t18m.js +2 -0
- package/dist/{chunk-34k24ak1.js → chunk-v1k0bdsg.js} +1 -1
- package/dist/{chunk-yhjk24zc.js → chunk-vd10tty0.js} +1 -1
- package/dist/{chunk-7rzzdrps.js → chunk-vmetcczm.js} +1 -1
- package/dist/{chunk-f1q1kn5c.js → chunk-vnsby98n.js} +1 -1
- package/dist/{chunk-kjje5hr8.js → chunk-w6sa921x.js} +1 -1
- package/dist/{chunk-1z3brmc6.js → chunk-y120qq1a.js} +1 -1
- package/dist/chunk-zcw74jmk.js +2 -0
- package/dist/{chunk-fq2re71s.js → chunk-zxvndwaz.js} +1 -1
- package/dist/cli.js +7 -7
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/includes.js +10 -1
- package/dist/pwa.js +1 -1
- package/dist/ssg.js +2 -2
- package/package.json +5 -5
- package/dist/chunk-1mz8tqx6.js +0 -2
- package/dist/chunk-993yjvkd.js +0 -2
- package/dist/chunk-fvr9e8rk.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{K,ns,rs,ac,Ct,Jo,ss,Yo,jd,be,cn,we}from"./chunk-
|
|
2
|
+
import{K,ns,rs,ac,Ct,Jo,ss,Yo,jd,be,cn,we}from"./chunk-34fajf1n.js";import"./chunk-7j9m4d7x.js";import"./chunk-7hr63cp5.js";import{$i,s}from"./chunk-8efe5vpm.js";import"./chunk-550q827h.js";import"./chunk-1wkpxa58.js";import"./chunk-vde4mtfr.js";import"./chunk-x5xwe5nr.js";import"./chunk-tybk9hw9.js";import"./chunk-qfb34r6k.js";import"./chunk-4xvbc0mb.js";import"./chunk-haeb904b.js";import"./chunk-h72befy4.js";import"./chunk-1edvsndv.js";export{K as BROWSER_CORE_IMPORTS,ac as STX_AUTO_IMPORTS,ns as extractAndStripCssImports,be as extractBridgeData,$i as findInterpolationEnd,Yo as generateAutoImportDestructuring,jd as generateBrowserAutoImportDestructuring,cn as generateServerDataBridge,Ct as injectBrowserCoreAutoImports,we as processClientScript,ss as referencesName,rs as renderVendorStyleTags,s as stripCommentsAndLiterals,Jo as transformAutoImports};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{pn,Sc,gs}from"./chunk-
|
|
2
|
+
import{pn,Sc,gs}from"./chunk-34fajf1n.js";import"./chunk-7j9m4d7x.js";import"./chunk-7hr63cp5.js";import"./chunk-550q827h.js";import"./chunk-1wkpxa58.js";import"./chunk-vde4mtfr.js";import"./chunk-x5xwe5nr.js";import"./chunk-tybk9hw9.js";import{_e}from"./chunk-qfb34r6k.js";import"./chunk-4xvbc0mb.js";import"./chunk-haeb904b.js";import"./chunk-h72befy4.js";import"./chunk-1edvsndv.js";export{_e as freeIdentifiers,gs as processComponents,Sc as processESImports,pn as rendersAsElement};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{y}from"./chunk-haeb904b.js";import{K,We,ds,us,oi,ii,ai,ci,Yn,ps,li,di,ui,Rt,o}from"./chunk-
|
|
2
|
+
import{y}from"./chunk-haeb904b.js";import{K,We,ds,us,oi,ii,ai,ci,Yn,ps,li,di,ui,Rt,o}from"./chunk-34fajf1n.js";import{Vr}from"./chunk-bbdg3sqq.js";import{a}from"./chunk-hcsrj8z6.js";import{existsSync as M,readFileSync as G}from"fs";import h from"path";var me=new Set(["module","exports","require","$bool","$num","window","document","console","confirm","alert","fetch"]),te=Rt.filter((e)=>!me.has(e)).sort(),ne=[...y].sort(),he=[...new Set([...te,...ne])].sort(),be=new Set(te),ye=new Set(ne),xe=new Set(he),ee=/\bimport\s+(?!type[\s{])\{([^}]*)\}\s*from\s*(['"])stx\2/g;function Se(e,t){if(t==="server")return`'${e}' is not provided by 'stx' in a <script server> block. The engine binds only its own names there (defineProps, state, useHead, ...); any other name becomes \`await import('stx')\`, which does not resolve, so the whole script fails when the page renders. Import it from '@stacksjs/stx' instead.`;return`'${e}' is not provided by 'stx' in a client <script> block. The import is replaced by the window.stx runtime, which has no '${e}', so it is undefined in the browser.`}function ie(e,t){let s=[];for(let u of t){if(u.offset===void 0)continue;let i=u.kind==="server"?be:ye;ee.lastIndex=0;for(let l of u.code.matchAll(ee)){let g=l.index+l[0].indexOf("{")+1;for(let m of l[1].matchAll(/[^,]+/g)){let S=m[0];if(/^\s*type\s/.test(S))continue;let x=/^\s*([A-Za-z_$][\w$]*)/.exec(S);if(!x)continue;let r=x[1];if(!xe.has(r)||i.has(r))continue;let f=u.offset+g+m.index+x[0].length-r.length,p=e.slice(0,f),w=p.split(`
|
|
3
3
|
`).length;s.push({line:w,column:f-(p.lastIndexOf(`
|
|
4
4
|
`)+1)+1,offset:f,length:r.length,name:r,kind:u.kind,message:Se(r,u.kind)})}}}return s}import T from"path";var ke="@stacksjs/stx-typescript-plugin";function we(e,t){let s=T.resolve(e);for(;;){let u=T.join(s,"tsconfig.json");if(t(u))return u;let i=T.dirname(s);if(i===s)return;s=i}}function se(e,t,s){let u=we(e,s);if(!u)return;let i=new Set,l=(g)=>{if(i.has(g))return;i.add(g);let m=t(g);if(!m)return;let S=m.compilerOptions?.plugins;if(Array.isArray(S)){let r=S.find((p)=>p?.name===ke),f=Array.isArray(r?.libs)?r.libs.filter((p)=>typeof p==="string"):[];return r?{configPath:g,libs:f.map((p)=>T.resolve(T.dirname(g),p))}:null}let x=typeof m.extends==="string"?[m.extends]:Array.isArray(m.extends)?m.extends:[];for(let r of[...x].reverse()){if(typeof r!=="string"||!r.startsWith("."))continue;let f=T.resolve(T.dirname(g),r.endsWith(".json")?r:`${r}.json`),p=l(f);if(p!==void 0)return p}return};return l(u)??void 0}function la(e,t="",s=""){let u=e.startLine>1?`
|
|
5
5
|
`.repeat(e.startLine-1):"",i=ps(e)+us(ds(e.code)),l=e.kind==="client"||e.kind==="plain"?ai(t,e.code):"";return Yn(`${u+i}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Pt,C}from"./chunk-vde4mtfr.js";import m from"fs";import e from"path";async function hn(r,o,i){if(r.__stx_runtime_config)return;let n=Pt();if(n||i){r.__stx_runtime_config=n??C(i);return}let t=e.dirname(e.resolve(o));while(!0){if(["stx.config.ts","stx.config.js",".config/stx.config.ts",".config/stx.config.js"].some((f)=>m.existsSync(e.join(t,f)))){let{loadStxConfig:f}=await import("./chunk-
|
|
2
|
+
import{Pt,C}from"./chunk-vde4mtfr.js";import m from"fs";import e from"path";async function hn(r,o,i){if(r.__stx_runtime_config)return;let n=Pt();if(n||i){r.__stx_runtime_config=n??C(i);return}let t=e.dirname(e.resolve(o));while(!0){if(["stx.config.ts","stx.config.js",".config/stx.config.ts",".config/stx.config.js"].some((f)=>m.existsSync(e.join(t,f)))){let{loadStxConfig:f}=await import("./chunk-aa52jhak.js"),c=await f(t);if(c.runtimeConfig)r.__stx_runtime_config=C(c.runtimeConfig);return}let s=e.dirname(t);if(s===t)return;t=s}}async function Ps(r,o){function i(n){if(n===null)return"null";if(Array.isArray(n))return`Array<${n.length?[...new Set(n.map(i))].join(" | "):"unknown"}>`;if(typeof n==="object")return`{ ${Object.entries(n).map(([t,s])=>`readonly ${JSON.stringify(t)}: ${i(s)}`).join("; ")} }`;return typeof n}await Bun.write(e.join(r,".stx/runtime-config.d.ts"),`import '@stacksjs/stx/runtime-config'
|
|
3
3
|
declare module '@stacksjs/stx/runtime-config' { interface PublicRuntimeConfig ${i(o.public??{})} }
|
|
4
4
|
`),await Bun.write(e.join(r,".stx/runtime-config-server.d.ts"),`import '@stacksjs/stx/runtime-config-server'
|
|
5
5
|
declare module '@stacksjs/stx/runtime-config-server' { interface PrivateRuntimeConfig ${i(o.private??{})} }
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{p,c}from"./chunk-qfb34r6k.js";import{b}from"./chunk-
|
|
2
|
+
import{p,c}from"./chunk-qfb34r6k.js";import{b}from"./chunk-34fajf1n.js";function y(t,o){let i=1,r=o,e="<template",n="</template";while(r<t.length&&i>0){let s=t.indexOf("<",r);if(s===-1)break;if(r=s,t.startsWith(e,r)&&(r+e.length>=t.length||/[\s>\/]/.test(t[r+e.length]))){i++,r+=e.length;continue}if(t.startsWith(n,r)){let a=t.indexOf(">",r+n.length);if(a!==-1){if(i--,i===0)return a+1;r=a+1;continue}}r++}return i===0?r:-1}var w=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function x(t,o){let i=null;for(let r=o;r<t.length;r++){let e=t[r];if(i){if(e==="\\"){r++;continue}if(e===i)i=null;continue}if(e==='"'||e==="'"){i=e;continue}if(e===">")return r+1}return-1}function N(t,o,i){let r=o.toLowerCase(),e=1,n=i;while(n<t.length){let s=t.indexOf("<",n);if(s===-1)return-1;if(t.startsWith("<!--",s)){let g=t.indexOf("-->",s+4);n=g===-1?t.length:g+3;continue}let a=x(t,s+1);if(a===-1)return-1;let f=t.slice(s,a),u=f.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(u&&u[2].toLowerCase()===r){if(u[1]==="/"){if(e--,e===0)return a}else if(!/\/\s*>$/.test(f))e++}n=a}return-1}function A(t){let o=[],i=[],r=/\bslot\s*=\s*(?:"([^"]+)"|'([^']+)')/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=x(t,n+1);if(s===-1)break;let a=t.slice(n,s),f=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!f){e=s;continue}let u=f[2].toLowerCase();if(f[1]==="/"){let l=i.lastIndexOf(u);if(l!==-1)i.splice(l);e=s;continue}let g=/\/\s*>$/.test(a),d=i.length===0?a.match(r):null;if(d){let l=d[1]||d[2],m=a.replace(r,"").replace(/\s+(?=\/?>$)/,"").replace(/\s{2,}/g," "),h=g||w.has(u)?-1:N(t,u,s);if(h===-1)o.push({start:n,end:s,slotName:l,element:m}),e=s;else o.push({start:n,end:h,slotName:l,element:m+t.slice(s,h)}),e=h;continue}if(!g&&!w.has(u)){if(i.push(u),u==="script"||u==="style"){let l=t.toLowerCase().indexOf(`</${u}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function O(t){let o=[],i=[],r=/^<template\s+(?:#([a-zA-Z][\w-]*)|v-slot:([a-zA-Z][\w-]*)|slot="([a-zA-Z][\w-]*)")(?:\s*=\s*"([^"]*)")?[^>]*>$/i,e=0;while(e<t.length){let n=t.indexOf("<",e);if(n===-1)break;if(t.startsWith("<!--",n)){let l=t.indexOf("-->",n+4);e=l===-1?t.length:l+3;continue}let s=x(t,n+1);if(s===-1)break;let a=t.slice(n,s),f=a.match(/^<\s*(\/?)\s*([a-zA-Z][\w-]*)/);if(!f){e=s;continue}let u=f[1]==="/",g=f[2].toLowerCase();if(u){let l=i.lastIndexOf(g);if(l!==-1)i.splice(l);e=s;continue}if(g==="template"&&i.length===0){let l=a.match(r);if(l){let m=y(t,s);if(m!==-1){let h=l[1]||l[2]||l[3];o.push({start:n,end:m,slotName:h,content:t.slice(s,m-11).trim(),propsBinding:l[4]||void 0}),e=m;continue}}}if(!/\/\s*>$/.test(a)&&!w.has(g)){if(i.push(g),g==="script"||g==="style"){let l=t.toLowerCase().indexOf(`</${g}>`,s);if(l!==-1){e=l;continue}}}e=s}return o}function ha(t){let o={default:"",named:new Map},i=t,r=O(t);for(let n of r)o.named.set(n.slotName,{name:n.slotName,content:n.content,propsBinding:n.propsBinding});r.sort((n,s)=>s.start-n.start);for(let n of r)i=i.slice(0,n.start)+i.slice(n.end);let e=A(i);for(let n of e){let s=o.named.get(n.slotName);if(s)s.content+=n.element;else o.named.set(n.slotName,{name:n.slotName,content:n.element})}for(let n=e.length-1;n>=0;n--){let s=e[n];i=i.slice(0,s.start)+i.slice(s.end)}return o.default=i.trim(),o}function Rl(t){let o=t.match(/name\s*=\s*["']([^"']+)["']/),i=o?o[1]:"",r={},e=/:([a-zA-Z][\w-]*)\s*=\s*["']([^"']+)["']/g,n;while((n=e.exec(t))!==null)r[n[1]]=n[2];let s=t.match(/<slot[^>]*>([\s\S]*?)<\/slot>/i),a=s?s[1].trim():"";return{name:i,props:r,defaultContent:a}}async function ya(t,o,i,r){if(!t)return i;let e=t.content;if(t.propsBinding&&Object.keys(o).length>0){let n=t.propsBinding.trim(),s={...r};if(n.startsWith("{")&&n.endsWith("}")){let a=n.slice(1,-1).split(",").map((f)=>f.trim()).filter(Boolean);for(let f of a){let[u,g]=f.split(":").map((l)=>l.trim()),d=g||u;if(o[u]!==void 0)s[d]=o[u]}}else s[n]=o;e=C(e,s)}return e}function C(t,o){return t.replace(/\{\{\s*([^}]+)\s*\}\}/g,(i,r)=>{try{let e=r.trim(),n=k(e,o);return b(String(n??""))}catch{return`{{ ${r} }}`}})}function k(t,o){if(/^[a-zA-Z_$][\w$]*(\.[a-zA-Z_$][\w$]*)*$/.test(t)){let r=t.split("."),e=o;for(let n of r)if(e&&typeof e==="object"&&n in e)e=e[n];else return;return e}let i=t.match(/^([a-zA-Z_$][\w$]*)\s*([+\-*/])\s*(\d+)$/);if(i){let[,r,e,n]=i,s=o[r],a=parseInt(n,10);if(typeof s==="number")switch(e){case"+":return s+a;case"-":return s-a;case"*":return s*a;case"/":return s/a}}try{if(!p(t))return;return c(t,Object.keys(o))(...Object.values(o))}catch{return}}async function ba(t,o,i){let r=t;r=await M(r,/<slot\s+name\s*=\s*["']([^"']+)["']([^>]*?)(?:\/>|>([\s\S]*?)<\/slot>)/gi,async(s,a,f,u)=>{let g=o.named.get(a),d=u?.trim()||"",l=f||"",m={},h=/:([a-zA-Z_$][\w$-]*)\s*=\s*["']([^"']+)["']/g,S;while((S=h.exec(l))!==null){let E=S[1],R=S[2];m[E]=k(R,i)}return await ya(g,m,d,i)});let n=/<slot\b((?:"[^"]*"|'[^']*'|[^>"'])*?)\s*(?:\/>|>([\s\S]*?)<\/slot>)/gi;return r=r.replace(n,(s,a,f)=>{if(/\bname\s*=/.test(a||""))return s;let u=f?.trim()||"";return o.default||u}),r}async function M(t,o,i){let r=[],e=[];t.replace(o,(a,...f)=>{let u=f[f.length-2];return e.push({match:a,index:u}),r.push(i(a,...f.slice(0,-2))),a});let n=await Promise.all(r),s=t;for(let a=e.length-1;a>=0;a--){let{match:f,index:u}=e[a];s=s.slice(0,u)+n[a]+s.slice(u+f.length)}return s}function Al(t){let o=ha(t);return{defaultSlot:o.default,namedSlots:o.named}}async function Pl(t,o,i,r){return await ba(t,{default:o,named:i},r)}
|
|
3
3
|
export{ha,Rl,ya,ba,Al,Pl};
|