@stacksjs/stx 0.2.210 → 0.2.211
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-7ry55nms.js → chunk-1306tswx.js} +1 -1
- package/dist/{chunk-1bq2xyax.js → chunk-1jeyh1e2.js} +1 -1
- package/dist/{chunk-kjr22neh.js → chunk-1nm2xrvq.js} +1 -1
- package/dist/{chunk-ycn1vnv2.js → chunk-1nnpwrqj.js} +1 -1
- package/dist/{chunk-syy7d9w2.js → chunk-1qkk4mrm.js} +1 -1
- package/dist/chunk-2bkqbmkn.js +2 -0
- package/dist/chunk-2kjp90p2.js +2 -0
- package/dist/chunk-2md83wew.js +2 -0
- package/dist/{chunk-mjt5e2jy.js → chunk-2me28xee.js} +1 -1
- package/dist/{chunk-jr5tp4ks.js → chunk-2w5d5tw1.js} +1 -1
- package/dist/chunk-2xeq5xnf.js +2 -0
- package/dist/chunk-3bgyqx5b.js +2 -0
- package/dist/{chunk-nye9brje.js → chunk-3fwn9edg.js} +1 -1
- package/dist/{chunk-zda3hvde.js → chunk-3twce5kp.js} +1 -1
- package/dist/{chunk-dtmwr674.js → chunk-3wd9kfyz.js} +1 -1
- package/dist/chunk-47mx5vng.js +2 -0
- package/dist/{chunk-wnaddtv3.js → chunk-47pge5gz.js} +1 -1
- package/dist/chunk-4vwxgmg0.js +2 -0
- package/dist/{chunk-x0ks1fer.js → chunk-53ajah3v.js} +1 -1
- package/dist/{chunk-e0bk1mqp.js → chunk-591jpt6f.js} +1 -1
- package/dist/chunk-5gb8d966.js +2 -0
- package/dist/{chunk-a2899x2t.js → chunk-5gr4vv7m.js} +1 -1
- package/dist/chunk-5ya35fex.js +2 -0
- package/dist/{chunk-whq99ytc.js → chunk-6ndvtzpk.js} +1 -1
- package/dist/{chunk-bmpkpgx2.js → chunk-6xd5p5v3.js} +10 -10
- package/dist/{chunk-x0zh76yv.js → chunk-6xg3j487.js} +1 -1
- package/dist/{chunk-h2wpnxrh.js → chunk-7mst8kqm.js} +1 -1
- package/dist/{chunk-r41nsgym.js → chunk-7zk48rd8.js} +1 -1
- package/dist/{chunk-44423f7c.js → chunk-81w2xqas.js} +1 -1
- package/dist/{chunk-n35c984x.js → chunk-85144680.js} +2 -2
- package/dist/{chunk-xp3fp266.js → chunk-8anh6d36.js} +1 -1
- package/dist/{chunk-n9eahkjg.js → chunk-8bmsw6gq.js} +85 -85
- package/dist/chunk-8xtvmwpr.js +2 -0
- package/dist/{chunk-ryjpp51z.js → chunk-96kpqgh3.js} +1 -1
- package/dist/{chunk-ygr11tgz.js → chunk-a2rj5ce0.js} +1 -1
- package/dist/{chunk-3nmpfsw5.js → chunk-aw9z3m10.js} +1 -1
- package/dist/chunk-ba18hn7n.js +2 -0
- package/dist/{chunk-cm0ykjs1.js → chunk-ba6v2wh0.js} +1 -1
- package/dist/{chunk-abpw3b39.js → chunk-bsr7yrxh.js} +1 -1
- package/dist/{chunk-5n0dt838.js → chunk-c0p9kf53.js} +1 -1
- package/dist/{chunk-5xpp3z95.js → chunk-c18nh1et.js} +1 -1
- package/dist/{chunk-dhpy0h9y.js → chunk-c7pvwvse.js} +1 -1
- package/dist/{chunk-vr3qtsj4.js → chunk-cqt6ry1e.js} +1 -1
- package/dist/{chunk-rs2fa3g1.js → chunk-cr7s8q08.js} +1 -1
- package/dist/{chunk-gcns5vw5.js → chunk-d12xfcjd.js} +1 -1
- package/dist/chunk-d9b00zcd.js +2 -0
- package/dist/{chunk-m0sd10cs.js → chunk-dt787jv4.js} +1 -1
- package/dist/chunk-evjs9zqm.js +2 -0
- package/dist/{chunk-wtengj6h.js → chunk-f6jm4hy3.js} +1 -1
- package/dist/chunk-f7fhjvbe.js +2 -0
- package/dist/{chunk-evxg9pe7.js → chunk-gyxe9fzm.js} +1 -1
- package/dist/chunk-hdg7t3zs.js +2 -0
- package/dist/{chunk-8src5smc.js → chunk-j0tfxbns.js} +2 -2
- package/dist/{chunk-nsjyn31z.js → chunk-j5vyt8wd.js} +1 -1
- package/dist/{chunk-gcnrdgrq.js → chunk-khrtzbxd.js} +1 -1
- package/dist/chunk-kjw1ha92.js +2 -0
- package/dist/chunk-kmgs48jy.js +2 -0
- package/dist/chunk-kregsntr.js +2 -0
- package/dist/{chunk-cbc56wpd.js → chunk-m2mhtpwy.js} +1 -1
- package/dist/chunk-mghyceb1.js +2 -0
- package/dist/chunk-mpt8ed9w.js +2 -0
- package/dist/{chunk-mkm91b6w.js → chunk-msjzqne1.js} +1 -1
- package/dist/{chunk-7w4c5w2b.js → chunk-ne8sygmy.js} +1 -1
- package/dist/{chunk-ndnc7k2n.js → chunk-p7qqbw2k.js} +1 -1
- package/dist/{chunk-xfp10a23.js → chunk-p8pyqr7p.js} +1 -1
- package/dist/{chunk-0ae6chzd.js → chunk-q4se9rtw.js} +1 -1
- package/dist/{chunk-jvqjh17y.js → chunk-qfsgw9by.js} +3 -3
- package/dist/{chunk-910sy8sk.js → chunk-qph3esct.js} +1 -1
- package/dist/chunk-r153ybwd.js +2 -0
- package/dist/{chunk-vydqh4xr.js → chunk-r5hnhtp1.js} +1 -1
- package/dist/{chunk-va9k88da.js → chunk-rczpw37w.js} +1 -1
- package/dist/{chunk-jpbk42j7.js → chunk-rg6v68ya.js} +1 -1
- package/dist/{chunk-1e25ksp6.js → chunk-s7dqawk0.js} +1 -1
- package/dist/{chunk-hb83d0qc.js → chunk-srdwsrnj.js} +1 -1
- package/dist/{chunk-jsndbe2q.js → chunk-td1cz8ms.js} +1 -1
- package/dist/{chunk-pw0rzgpv.js → chunk-trtm887x.js} +1 -1
- package/dist/{chunk-qz75kx6n.js → chunk-tryt2h85.js} +1 -1
- package/dist/{chunk-xm6kwq2r.js → chunk-v1v3fxq1.js} +2 -2
- package/dist/{chunk-4fe1ypxz.js → chunk-v5x6c698.js} +1 -1
- package/dist/chunk-vgr8kykv.js +2 -0
- package/dist/chunk-vhvfja74.js +2 -0
- package/dist/{chunk-vpwjr05r.js → chunk-vkpmnn26.js} +1 -1
- package/dist/{chunk-5gb0zjx0.js → chunk-vtqej9yr.js} +1 -1
- package/dist/{chunk-5s2y052b.js → chunk-w670sde5.js} +1 -1
- package/dist/{chunk-4pf61rcb.js → chunk-wbq7cp57.js} +1 -1
- package/dist/{chunk-nenge2m2.js → chunk-whxregkn.js} +1 -1
- package/dist/{chunk-12n9mz15.js → chunk-x2t441ge.js} +1 -1
- package/dist/{chunk-qpcwahse.js → chunk-x8b16v5q.js} +1 -1
- package/dist/{chunk-abzhv6v3.js → chunk-xcf62bdq.js} +1 -1
- package/dist/{chunk-q02jg1pk.js → chunk-xkd164zg.js} +1 -1
- package/dist/{chunk-e0460y7f.js → chunk-y2jr10y8.js} +1 -1
- package/dist/{chunk-9kf4q3ec.js → chunk-y8mg8dem.js} +1 -1
- package/dist/{chunk-5hpp0vzz.js → chunk-yk1smsev.js} +1 -1
- package/dist/{chunk-spn8e3b3.js → chunk-z0hkt5sk.js} +1 -1
- package/dist/{chunk-3952ykhb.js → chunk-z47tw39z.js} +2 -2
- package/dist/{chunk-nngpktr2.js → chunk-zj44h5kk.js} +1 -1
- package/dist/chunk-ztz7tdb0.js +2 -0
- package/dist/{chunk-1mhc4g86.js → chunk-zxb128xa.js} +1 -1
- package/dist/cli.js +14 -14
- package/dist/component-renderer.d.ts +22 -0
- package/dist/component-renderer.js +5 -2
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/database.js +1 -1
- package/dist/pwa.js +2 -2
- package/dist/ssg.js +2 -2
- package/dist/visual-testing.js +1 -1
- package/package.json +5 -5
- package/dist/chunk-00a028s3.js +0 -2
- package/dist/chunk-02n7khen.js +0 -2
- package/dist/chunk-0kdc3x7v.js +0 -2
- package/dist/chunk-2z6br22w.js +0 -2
- package/dist/chunk-3acgbcv6.js +0 -2
- package/dist/chunk-3vy1q9da.js +0 -2
- package/dist/chunk-5dxctm6h.js +0 -2
- package/dist/chunk-66081bkn.js +0 -2
- package/dist/chunk-6bxcjdp4.js +0 -2
- package/dist/chunk-8sx4vf6p.js +0 -2
- package/dist/chunk-bpvp21dd.js +0 -2
- package/dist/chunk-btgrvrxy.js +0 -2
- package/dist/chunk-ehfzp7xe.js +0 -2
- package/dist/chunk-g9kvpgha.js +0 -2
- package/dist/chunk-k03erdj7.js +0 -2
- package/dist/chunk-k25mqtht.js +0 -2
- package/dist/chunk-me5h5mkq.js +0 -2
- package/dist/chunk-mtr2f82n.js +0 -2
- package/dist/chunk-mz5hjxjv.js +0 -2
- package/dist/chunk-nd9d80gb.js +0 -2
- package/dist/chunk-sry9atvv.js +0 -2
- package/dist/chunk-t98920tc.js +0 -2
- package/dist/chunk-xz019t7t.js +0 -2
- package/dist/chunk-z21qzyh1.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Yr as Q}from"./chunk-j0tfxbns.js";import"./chunk-khrtzbxd.js";import{Ms as R}from"./chunk-m2mhtpwy.js";import"./chunk-trtm887x.js";import O from"fs";import U from"path";async function W(j,b={}){let q=Date.now(),z={total:0,passed:0,failed:0,new:0,failures:[],duration:0},K=b.snapshotDir||R(j.root,"story","snapshots");await O.promises.mkdir(K,{recursive:!0});let B=j.storyFiles;if(b.filter&&b.filter.length>0)B=B.filter((J)=>b.filter.some((G)=>J.fileName.toLowerCase().includes(G.toLowerCase())));for(let J of B)await X(J,K,b,z);return z.duration=Date.now()-q,z}async function X(j,b,q,z){let K=j.story;if(!K)return;for(let B of K.variants){z.total++;let J=U.join(b,`${j.id}-${B.id}.snap`),G=Y(B.source||""),L=await _(J);if(q.update||!L){let M={storyId:j.id,variantId:B.id,component:j.fileName,timestamp:Date.now(),hash:G};if(await O.promises.writeFile(J,JSON.stringify(M,null,2)),!L)z.new++;z.passed++}else try{let M=await O.promises.readFile(J,"utf-8"),N=JSON.parse(M);if(N.hash===G)z.passed++;else z.failed++,z.failures.push({storyId:j.id,variantId:B.id,component:j.fileName,message:"Snapshot mismatch",difference:Z(N.hash,G)})}catch(M){z.failed++,z.failures.push({storyId:j.id,variantId:B.id,component:j.fileName,message:`Error reading snapshot: ${M}`})}}}async function A(j,b={}){return(await W(j,{...b,update:!0})).total}function Y(j){let b=0;for(let q=0;q<j.length;q++){let z=j.charCodeAt(q);b=(b<<5)-b+z,b=b&b}return b.toString(16)}function Z(j,b){if(j===b)return 0;let q=Math.abs(Number.parseInt(j,16)-Number.parseInt(b,16));return Math.min(q/1e6,1)}async function _(j){try{return await O.promises.access(j),!0}catch{return!1}}function I(j){let b=[];if(b.push(""),b.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),b.push(" STX Story Visual Regression Tests"),b.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),b.push(""),j.failures.length>0){b.push(" \u274C Failures:"),b.push("");for(let q of j.failures){if(b.push(` \u2022 ${q.component} / ${q.variantId}`),b.push(` ${q.message}`),q.difference!==void 0)b.push(` Difference: ${(q.difference*100).toFixed(2)}%`);b.push("")}}if(b.push(" Summary:"),b.push(` Total: ${j.total}`),b.push(` Passed: ${j.passed} \u2713`),b.push(` Failed: ${j.failed} \u2717`),j.new>0)b.push(` New: ${j.new} \u26A1`);return b.push(` Time: ${j.duration}ms`),b.push(""),b.push("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501"),b.push(""),b.join(`
|
|
3
3
|
`)}async function S(j,b={}){let q=performance.now(),z=[],K=0,B=0;for(let G of j.storyFiles)try{let L=await Bun.file(G.path).text(),M=await Q(L,G.path);if(M.length>0){for(let N of M)z.push({storyId:G.id,variantId:"default",component:G.component,message:`A11y: ${N.message}`,expected:"No accessibility violations",actual:`${N.type}: ${N.message} (impact: ${N.impact})`});B++}else K++}catch(L){z.push({storyId:G.id,variantId:"default",component:G.component,message:`Failed to check a11y: ${L instanceof Error?L.message:String(L)}`,expected:"File readable for a11y check",actual:"File read error"}),B++}let J=performance.now()-q;return{total:j.storyFiles.length,passed:K,failed:B,new:0,failures:z,duration:J}}export{A as updateSnapshots,W as runVisualTests,S as runA11yTests,I as formatTestResults};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{nk as m}from"./chunk-
|
|
2
|
+
import{nk as m}from"./chunk-v1v3fxq1.js";import{iu as z}from"./chunk-trtm887x.js";import{existsSync as s,mkdirSync as T,copyFileSync as F,chmodSync as A}from"fs";import{join as Z,basename as Yq}from"path";import{spawn as j,execSync as Zq}from"child_process";import{tmpdir as c,homedir as P,platform as Lq}from"os";var Iq=`
|
|
3
3
|
<script>
|
|
4
4
|
(function() {
|
|
5
5
|
'use strict';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var j=["batch","computed","configureFetch","defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","defineStore","derived","effect","goBack","goForward","inject","invalidateRoute","isDerived","isSignal","navigate","nextTick","onBeforeMount","onBeforeUnmount","onDestroy","onMount","onMounted","onUnmounted","peek","provide","reactive","ref","refresh","registerStoresClient","setRouteParams","state","untrack","useAsync","useClickOutside","useColorMode","useCookie","useCounter","useDark","useDebounce","useDebouncedValue","useEventListener","useFetch","useFocus","useHead","useId","useInterval","useLocalStorage","useMediaQuery","useMutation","useOptimistic","usePreferredContrast","usePreferredDark","usePreferredLight","usePreferredReducedMotion","useQuery","useReactiveProp","useRef","useRoute","useRouteParam","useRouteParams","useScrollLock","useSearchParams","useSeoMeta","useSessionStorage","useSlots","useStore","useThrottle","useTimeout","useToggle","useWebSocket","watch","watchEffect","watchMultiple","withDefaults"],X=["onMount","onDestroy"];function B(z="const",F=[],J){let Z=F.length?j.filter((Q)=>!F.includes(Q)):j;if(J!==void 0)Z=Z.filter((Q)=>{let $=Q.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(^|[^\\w$])${$}(?![\\w$])`).test(J)});return`${z} { ${Z.join(", ")} } = window.stx;`}var W=["defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","withDefaults"];var Y=j.filter((z)=>!W.includes(z));function V(z){if(!z)return!1;return Y.some((F)=>new RegExp(`\\b${F}\\s*(?:<[^>]*>)?\\s*\\(`).test(z))}var P=[/@if\s*=/,/@for\s*=/,/@show\s*=/,/@model\s*=/,/@bind:/,/@class\s*=/,/@style\s*=/,/\bx-data\s*=/,/\bstate\s*(?:<[^>]*>)?\s*\(/,/\bderived\s*(?:<[^>]*>)?\s*\(/,/\beffect\s*(?:<[^>]*>)?\s*\(/,/\bref\s*(?:<[^>]*>)?\s*\(/,/\bcomputed\s*(?:<[^>]*>)?\s*\(/,/\breactive\s*(?:<[^>]*>)?\s*\(/,/\bwatch\s*(?:<[^>]*>)?\s*\(/,/\bwatchEffect\s*(?:<[^>]*>)?\s*\(/,/\s:[a-z][\w-]*\s*=\s*["']/i,/\s:(?:if|else-if|else|for|show|text|html|model)\s*=/,/data-stx(?:-auto)?(?![-\w])/,/data-stx-scoped/],C=/\s@[a-z][\w.:-]*\s*=/i;function G(z){if(!z)return!1;let F=K(z);if(P.some((J)=>J.test(F)))return!0;return V(F)}function D(z){if(!z)return!1;return C.test(K(z))||G(z)}var f=["if","else-if","elseif","else","for","show","key","text","html","model","ref"];function H(z){return f.includes(z.toLowerCase())}var q=["x-text","x-html","x-model","x-show","x-if","x-for","x-cloak","x-ref","x-data","x-bind","x-class","x-style","x-tooltip","x-tooltip-position"],U=["x-init","x-transition","x-effect","x-on"],w=[...q,...U];function M(){return`{${q.map((z)=>`'${z}':1`).join(",")}}`}function K(z){if(!z)return z;let F=(J)=>J.replace(/(<[^>]*>)|([^<]+)/g,(Z,Q,$)=>Q??" ".repeat($.length));return z.replace(/(<pre\b[^>]*>)([\s\S]*?)(<\/pre>)/gi,(J,Z,Q,$)=>Z+F(Q)+$).replace(/(<code\b[^>]*>)([\s\S]*?)(<\/code>)/gi,(J,Z,Q,$)=>Z+F(Q)+$).replace(/<!--[\s\S]*?-->/g,(J)=>" ".repeat(J.length))}
|
|
3
|
-
export{j as
|
|
3
|
+
export{j as et,X as ft,B as gt,V as ht,G as it,D as jt,H as kt,w as lt,M as mt};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{_t as y}from"./chunk-z47tw39z.js";import N from"fs";import B from"path";var Y="_stx";function L(M){return Bun.hash(M).toString(16).slice(0,8)}function T(M){let C=[],v=(q)=>{for(let g of N.readdirSync(q,{withFileTypes:!0})){let j=B.join(q,g.name);if(g.isDirectory())v(j);else if(g.isFile()&&j.endsWith(".html"))C.push(j)}};if(N.existsSync(M))v(M);return C}var S=[{pattern:/<script\b([^>]*\bdata-stx-runtime\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"runtime",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(M)=>`<script data-stx-runtime src="${M}"></script>`},{pattern:/<script\b([^>]*\bdata-stx-router\b[^>]*)>([\s\S]*?)<\/script>/gi,prefix:"router",extension:"js",contentType:"text/javascript; charset=utf-8",replace:(M)=>`<script data-stx-router src="${M}"></script>`},{pattern:/<style\b([^>]*\bdata-crosswind=(?:"generated"|'generated')[^>]*)>([\s\S]*?)<\/style>/gi,prefix:"crosswind",extension:"css",contentType:"text/css; charset=utf-8",replace:(M)=>`<link data-crosswind="generated" rel="stylesheet" href="${M}">`}];function _(M,C=`/${Y}`){let v=[],q=new Set,g=0,j=M;for(let G of S)j=j.replace(G.pattern,(R,K,W)=>{if(/\b(?:src|href)\s*=/.test(K)||!W.trim())return R;let Q=`${G.prefix}.${L(W)}.${G.extension}`;if(!q.has(Q))q.add(Q),v.push({filename:Q,contents:W,contentType:G.contentType});return g+=W.length,G.replace(`${C}/${Q}`)});return{html:j,assets:v,bytesInlined:g}}function a(M){let C={pages:0,assets:0,bytesInlined:0},v=B.join(M,Y),q=new Set;for(let g of T(M)){let j=N.readFileSync(g,"utf8"),{html:G,assets:R,bytesInlined:K}=_(j);if(G===j)continue;for(let W of R){if(q.has(W.filename))continue;q.add(W.filename),N.mkdirSync(v,{recursive:!0}),N.writeFileSync(B.join(v,W.filename),W.contents),C.assets++}N.writeFileSync(g,G),C.bytesInlined+=K,C.pages++}return C}import z from"fs";import P from"path";var I=1024,E=/<(script|style)\b([^>]*)>([\s\S]*?)<\/\1>/gi,d=new Set(["","module","text/javascript","application/javascript","module/javascript"]);function b(M){return Bun.hash(M).toString(16).slice(0,8)}function p(M){let C=[],v=(q)=>{for(let g of z.readdirSync(q,{withFileTypes:!0})){let j=P.join(q,g.name);if(g.isDirectory())v(j);else if(g.isFile()&&j.endsWith(".html"))C.push(j)}};if(z.existsSync(M))v(M);return C}function D(M,C){let v=M.match(new RegExp(`\\b${C}\\s*=\\s*("([^"]*)"|'([^']*)'|([^\\s>]+))`,"i"));if(!v)return;return v[2]??v[3]??v[4]??""}function m(M,C,v){if(v.length<I)return!1;if(/\b(?:src|href)\s*=/i.test(C))return!1;if(M.toLowerCase()==="script"){if(!d.has((D(C,"type")??"").trim().toLowerCase()))return!1;return!0}return!0}function o(M){let C=[];for(let v of M.matchAll(/<template\b[^>]*>[\s\S]*?<\/template>/gi))C.push([v.index,v.index+v[0].length]);return C}function s(M){let C={pages:0,assets:0,bytesInlined:0},v=p(M);if(v.length<2)return C;let q=new Map,g=new Map;for(let Q of v){let O=z.readFileSync(Q,"utf8");q.set(Q,O);let x=o(O);for(let U of O.matchAll(E)){let[w,V,J,$]=U;if(!m(V,J,$))continue;if(x.some(([A,k])=>U.index>=A&&U.index<k))continue;let H=`${V.toLowerCase()}\x00${$}`,X=g.get(H);if(X)X.push({file:Q,whole:w,tag:V,attrs:J,body:$});else g.set(H,[{file:Q,whole:w,tag:V,attrs:J,body:$}])}}let j=[...g.values()].filter((Q)=>new Set(Q.map((O)=>O.file)).size>1);if(j.length===0)return C;let G=P.join(M,Y),R=new Map(q),K=new Map,W=[];for(let Q of j){let{tag:O,body:x}=Q[0],U=O.toLowerCase()==="script",w=`${U?"chunk":"style"}.${b(x)}.${U?"js":"css"}`;W.push({filename:w,contents:x,contentType:U?"text/javascript; charset=utf-8":"text/css; charset=utf-8"});let V=`/${Y}/${w}`;for(let J of Q){let $=U?`<script${J.attrs} src="${V}"></script>`:`<link${J.attrs} rel="stylesheet" href="${V}">`,H=R.get(J.file),X=H.replace(J.whole,()=>$);if(X===H)continue;R.set(J.file,X),K.set(J.file,(K.get(J.file)??0)+J.body.length)}}z.mkdirSync(G,{recursive:!0});for(let Q of W)z.writeFileSync(P.join(G,Q.filename),Q.contents),C.assets++;for(let[Q,O]of R){if(O===q.get(Q))continue;z.writeFileSync(Q,O),C.pages++,C.bytesInlined+=K.get(Q)??0}return C}y();import Z from"fs";import F from"path";var h="layout-types.d.ts";function f(M){let C=[],v=(q,g)=>{let j;try{j=Z.readdirSync(q,{withFileTypes:!0})}catch{return}for(let G of j){if(G.name.startsWith("."))continue;let R=F.join(q,G.name);if(G.isDirectory())v(R,g?`${g}/${G.name}`:G.name);else if(G.isFile()&&G.name.endsWith(".stx")&&G.name!=="_layout.stx"){let K=G.name.slice(0,-4);C.push(g?`${g}/${K}`:K)}}};return v(M,""),C.sort()}function c(M){let C=["// Auto-generated by stx \u2014 do not edit.","//","// Makes `definePageMeta({ layout })` reject a name with no layout behind it.","// Include this file in your tsconfig (it lives in the stx state directory,","// `.stx/` by default) for the check to apply.",""];if(M.length===0)return C.push("// No layouts found \u2014 `layout` stays typed as `string`.","export {}",""),C.join(`
|
|
3
3
|
`);return C.push("declare module '@stacksjs/stx' {"," interface KnownLayouts {",...M.map((v)=>` '${v}': true`)," }","}","","export {}",""),C.join(`
|
|
4
4
|
`)}function HM(M,C){if(!M)return[];let v=F.isAbsolute(M)?M:F.resolve(process.cwd(),M),q=f(v),g=c(q),j=F.join(C,h);try{if(Z.existsSync(j)&&Z.readFileSync(j,"utf8")===g)return q;Z.mkdirSync(C,{recursive:!0}),Z.writeFileSync(j,g)}catch{}return q}
|
|
5
5
|
export{Y as qk,_ as rk,a as sk,s as tk,h as uk,f as vk,c as wk,HM as xk};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Tg as n}from"./chunk-5gb0zjx0.js";import{Mo as f,Xp as p,am as b,bm as S,km as k,rm as q}from"./chunk-n9eahkjg.js";import{Vt as c,Zt as XG,st as d}from"./chunk-3952ykhb.js";import{hu as T}from"./chunk-pw0rzgpv.js";import l from"fs";import F from"path";var{serve:ZG}=globalThis.Bun;function R(G,J,K={}){let Q=`${encodeURIComponent(G)}=${encodeURIComponent(J)}`;if(K.maxAge!==void 0)Q+=`; Max-Age=${K.maxAge}`;if(K.expires)Q+=`; Expires=${K.expires.toUTCString()}`;if(K.path)Q+=`; Path=${K.path}`;if(K.domain)Q+=`; Domain=${K.domain}`;if(K.secure)Q+="; Secure";if(K.httpOnly)Q+="; HttpOnly";if(K.sameSite)Q+=`; SameSite=${K.sameSite}`;return Q}async function i(G){let J=G.headers.get("content-type")||"",K={},Q=(X,Z)=>{let $=K[X];if($===void 0)K[X]=Z;else if(Array.isArray($))$.push(Z);else K[X]=[$,Z]};if(J.includes("multipart/form-data")){let X=await G.formData();for(let[Z,$]of X.entries())if(typeof $==="string")Q(Z,$);return K}if(J.includes("application/x-www-form-urlencoded")){for(let[X,Z]of new URLSearchParams(await G.text()).entries())Q(X,Z);return K}return K}function C(G){if(!G)return!1;let J=G.toUpperCase();return J!=="GET"&&J!=="HEAD"}async function y(G,J={}){let K=J.request,Q=J.method??K?.method;if(!K||!C(Q))return{ran:!1};if(typeof G.action!=="function")return{ran:!1};let X={};try{X=await i(K)}catch{}let Z=await G.action({request:K,form:X,params:J.params??{},query:G.query??{},cookies:J.cookies??{}});if(Z&&typeof Z==="object"){let $=Z,U=a($.cookies),I=$.redirect;if(typeof I==="string"&&I)return{redirect:I,ran:!0,...U.length>0?{cookies:U}:{}};let{cookies:V,redirect:A,...O}=$;if(Object.assign(G,O),U.length>0)return{ran:!0,cookies:U}}return{ran:!0}}function a(G){if(!G||typeof G!=="object"||Array.isArray(G))return[];let J=[];for(let[K,Q]of Object.entries(G)){if(!K)continue;if(typeof Q==="string"){J.push(R(K,Q));continue}if(Q&&typeof Q==="object"){let X=Q;if(typeof X.value!=="string")continue;J.push(R(K,X.value,X))}}return J}function v(G,J=[]){let K=new Headers({Location:G,"Cache-Control":"no-store"});for(let Q of J)K.append("Set-Cookie",Q);return new Response(null,{status:303,headers:K})}async function LG(G,J={}){return(await x(G,J)).html}async function g(G,J={}){let{html:K,context:Q,redirect:X,cookies:Z}=await x(G,J);if(X)return{html:K,redirect:X,cookies:Z};let{extractStreamBoundaries:$}=await import("./chunk-vpwjr05r.js"),U=$(Q),I=G.streamTemplates;if(I&&Object.keys(I).length>0){let{processDirectives:V}=await import("./chunk-3acgbcv6.js"),{defaultConfig:A}=await import("./chunk-z21qzyh1.js"),O=Q.streamBoundaries||{},D={...A,autoShell:!1},j=Object.keys(I).map((_)=>({id:_,render:async()=>{let M=typeof O[_]==="function"?await O[_]():void 0;return V(I[_],{...Q,$boundary:M},G.sourceFile,D,new Set)}})),N=new Set(j.map((_)=>_.id));U=[...(U||[]).filter((_)=>!N.has(_.id)),...j]}return{html:K,boundaries:U&&U.length>0?U:void 0,cookies:Z}}async function x(G,J){let K={__filename:G.sourceFile,__dirname:G.sourceFile.replace(/[/\\][^/\\]+$/,""),...J};if(!G.hasServerScripts&&!S(G.html))return{html:G.html,context:K};for(let Z of G.serverScriptContent)try{await f(Z,K,G.sourceFile)}catch($){console.warn(`[stx] Server script error in ${G.sourceFile}:`,$)}let Q=await y(K,{request:J.request,method:J.method,params:J.params??{},cookies:J.cookies??{}});if(Q.redirect)return{html:G.html,context:K,redirect:Q.redirect,cookies:Q.cookies};if(!S(G.html))return{html:G.html,context:K,cookies:Q.cookies};let X=new Map;for(let[Z,$]of Object.entries(G.placeholders))if($.expression)try{let U=q($.expression,K);if($.type==="raw")X.set(Z,U!==void 0&&U!==null?String(U):"");else X.set(Z,U!==void 0&&U!==null?k(String(U)):"")}catch{X.set(Z,"")}return{html:b(G.html,X),context:K,cookies:Q.cookies}}async function VG(G,J={}){if(!G.hasServerScripts&&!S(G.fragment))return G.fragment;let K={__filename:G.sourceFile,__dirname:G.sourceFile.replace(/[/\\][^/\\]+$/,""),...J};for(let X of G.serverScriptContent)try{await f(X,K,G.sourceFile)}catch(Z){console.warn(`[stx] Server script error in ${G.sourceFile}:`,Z)}if(!S(G.fragment))return G.fragment;let Q=new Map;for(let[X,Z]of Object.entries(G.placeholders))if(Z.expression)try{let $=q(Z.expression,K);if(Z.type==="raw")Q.set(X,$!==void 0&&$!==null?String($):"");else Q.set(X,$!==void 0&&$!==null?k(String($)):"")}catch{Q.set(X,"")}return b(G.fragment,Q)}XG();import E from"zlib";import{promisify as u}from"util";var s=u(E.brotliCompress),t=u(E.gzip),o=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],e=["text/event-stream","multipart/x-mixed-replace"],GG=1024;function JG(G){if(!G)return!1;let J=G.toLowerCase();if(e.some((K)=>J.startsWith(K)))return!1;return o.some((K)=>J.startsWith(K))}function KG(G){let J=new Map;for(let K of G.split(",")){let[Q,...X]=K.trim().split(";"),Z=Q.trim().toLowerCase();if(!Z)continue;let $=1;for(let U of X){let I=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(U);if(!I)continue;let V=Number.parseFloat(I[1]);if(Number.isFinite(V))$=V}J.set(Z,$)}return J}function QG(G){if(!G)return null;let J=KG(G),K=J.get("*"),Q=(X)=>J.get(X)??K??0;if(Q("br")>0)return"br";if(Q("gzip")>0)return"gzip";return null}async function m(G,J,K={}){if(J.headers.get("content-encoding"))return J;if(J.status===204||J.status===304||!J.body)return J;if(!JG(J.headers.get("content-type")))return J;let Q=QG(G.headers.get("accept-encoding"));if(!Q)return J;let X;try{X=new Uint8Array(await J.arrayBuffer())}catch{return J}let Z=()=>new Response(X,{status:J.status,statusText:J.statusText,headers:h(J.headers)});if(X.length<(K.threshold??GG))return Z();try{let $=Q==="br"?await s(X,{params:{[E.constants.BROTLI_PARAM_QUALITY]:K.quality??5,[E.constants.BROTLI_PARAM_SIZE_HINT]:X.length}}):await t(X);if($.length>=X.length)return Z();let U=h(J.headers);return U.set("Content-Encoding",Q),U.set("Content-Length",String($.length)),new Response($,{status:J.status,statusText:J.statusText,headers:U})}catch{return Z()}}function h(G){let J=new Headers(G),K=J.get("Vary");if(!K)return J.set("Vary","Accept-Encoding"),J;if(!K.split(",").some((X)=>X.trim().toLowerCase()==="accept-encoding"))J.set("Vary",`${K}, Accept-Encoding`);return J}var $G={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".json":"application/json",".html":"text/html",".txt":"text/plain",".xml":"application/xml",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".ico":"image/x-icon",".bmp":"image/bmp",".mp4":"video/mp4",".webm":"video/webm",".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/wav",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"};async function bG(G={}){let J=F.resolve(G.outputDir||".output"),K=G.port||3000,Q=n(J);if(!Q)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${Q.routes.length} routes...`);let X=new Map,Z=new Map,$=new Map,U=new Map;for(let O of Q.routes)try{let D=F.join(J,O.compiledPath),j=JSON.parse(await Bun.file(D).text());X.set(O.pattern,j),$.set(O.pattern,c(j.html)),U.set(O.pattern,p(j.html));let N=F.join(J,O.fragmentPath);if(await Bun.file(N).exists())Z.set(O.pattern,await Bun.file(N).text())}catch(D){console.warn(`[stx] Failed to load route ${O.pattern}:`,D)}let I=new Map,V=[];for(let O of Q.routes)if(O.hasParams){let{regex:D,params:j}=d(O.pattern);V.push({regex:D,route:O,paramNames:j})}else I.set(O.pattern,O);let A=ZG({port:K,async fetch(O){return m(O,await(async()=>{let j=new URL(O.url).pathname;if(G.onRequest){let W=await G.onRequest(O);if(W)return W}if(G.apiRoutes?.[j])return G.apiRoutes[j](O);if((O.method==="GET"||O.method==="HEAD")&&j!=="/"){let W=F.resolve(J,"public"),Y;try{Y=decodeURIComponent(j)}catch{Y=j}if(!Y.includes("\x00")){let L=F.resolve(W,`.${Y}`);if(L===W||L.startsWith(`${W}${F.sep}`))try{if(l.existsSync(L)&&l.statSync(L).isFile()){let w=F.extname(L).toLowerCase(),H=$G[w]||"application/octet-stream",P=j.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(j);return new Response(Bun.file(L),{headers:{"Content-Type":H,"Cache-Control":P?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let N=O.headers.get("X-STX-Router")==="true",_=null,M={};if(_=I.get(j)||null,!_)for(let{regex:W,route:Y,paramNames:L}of V){let B=j.match(W);if(B){_=Y,L.forEach((w,H)=>{M[w]=B[H+1]});break}}if(!_){let W=I.get("/404")||null;if(W){let Y=X.get(W.pattern);if(Y)return new Response(Y.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}if(N){let W=Z.get(_.pattern);if(W){let Y=$.get(_.pattern);return new Response(W,{headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...U.has(_.pattern)?{"X-STX-Runtime":U.get(_.pattern)?"true":"false"}:{},...Y?{"X-STX-Layout":Y.layout,"X-STX-Layout-Group":Y.group}:{},"Cache-Control":"no-cache"}})}}let r=C(O.method),z=X.get(_.pattern);if(!z){let W=I.get("/500")||null;if(W){let Y=X.get(W.pattern);if(Y)return new Response(Y.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(!r&&!z.hasServerScripts&&Object.keys(z.placeholders).length===0)return new Response(z.html,{headers:{"Content-Type":"text/html","Cache-Control":"public, max-age=60"}});try{let{html:W,boundaries:Y,redirect:L,cookies:B}=await g(z,{params:M,request:O,method:O.method});if(L)return v(L,B);if(Y&&Y.length>0){let{renderStreamingPage:H,streamToResponse:P}=await import("./chunk-vpwjr05r.js");return P(H(W,Y,{timeoutMs:30000}),{headers:{"Cache-Control":"no-cache"}})}let w=new Headers({"Content-Type":"text/html","Cache-Control":"no-cache"});for(let H of B??[])w.append("Set-Cookie",H);return new Response(W,{headers:w})}catch(W){return console.error(`[stx] Hydration error for ${j}:`,W),new Response(z.html,{headers:{"Content-Type":"text/html"}})}})())}});return console.log(`[stx] Production server running at http://localhost:${K}`),console.log(`[stx] Serving ${Q.routes.length} routes (${X.size} pre-loaded)`),{port:K,stop:()=>A.stop()}}
|
|
2
|
+
import{Tg as n}from"./chunk-vtqej9yr.js";import{No as f,Yp as p,am as b,bm as S,km as k,rm as q}from"./chunk-8bmsw6gq.js";import{Wt as c,_t as XG,tt as d}from"./chunk-z47tw39z.js";import{iu as T}from"./chunk-trtm887x.js";import l from"fs";import F from"path";var{serve:ZG}=globalThis.Bun;function R(G,J,K={}){let Q=`${encodeURIComponent(G)}=${encodeURIComponent(J)}`;if(K.maxAge!==void 0)Q+=`; Max-Age=${K.maxAge}`;if(K.expires)Q+=`; Expires=${K.expires.toUTCString()}`;if(K.path)Q+=`; Path=${K.path}`;if(K.domain)Q+=`; Domain=${K.domain}`;if(K.secure)Q+="; Secure";if(K.httpOnly)Q+="; HttpOnly";if(K.sameSite)Q+=`; SameSite=${K.sameSite}`;return Q}async function i(G){let J=G.headers.get("content-type")||"",K={},Q=(X,Z)=>{let $=K[X];if($===void 0)K[X]=Z;else if(Array.isArray($))$.push(Z);else K[X]=[$,Z]};if(J.includes("multipart/form-data")){let X=await G.formData();for(let[Z,$]of X.entries())if(typeof $==="string")Q(Z,$);return K}if(J.includes("application/x-www-form-urlencoded")){for(let[X,Z]of new URLSearchParams(await G.text()).entries())Q(X,Z);return K}return K}function C(G){if(!G)return!1;let J=G.toUpperCase();return J!=="GET"&&J!=="HEAD"}async function y(G,J={}){let K=J.request,Q=J.method??K?.method;if(!K||!C(Q))return{ran:!1};if(typeof G.action!=="function")return{ran:!1};let X={};try{X=await i(K)}catch{}let Z=await G.action({request:K,form:X,params:J.params??{},query:G.query??{},cookies:J.cookies??{}});if(Z&&typeof Z==="object"){let $=Z,U=a($.cookies),I=$.redirect;if(typeof I==="string"&&I)return{redirect:I,ran:!0,...U.length>0?{cookies:U}:{}};let{cookies:V,redirect:A,...O}=$;if(Object.assign(G,O),U.length>0)return{ran:!0,cookies:U}}return{ran:!0}}function a(G){if(!G||typeof G!=="object"||Array.isArray(G))return[];let J=[];for(let[K,Q]of Object.entries(G)){if(!K)continue;if(typeof Q==="string"){J.push(R(K,Q));continue}if(Q&&typeof Q==="object"){let X=Q;if(typeof X.value!=="string")continue;J.push(R(K,X.value,X))}}return J}function v(G,J=[]){let K=new Headers({Location:G,"Cache-Control":"no-store"});for(let Q of J)K.append("Set-Cookie",Q);return new Response(null,{status:303,headers:K})}async function LG(G,J={}){return(await x(G,J)).html}async function g(G,J={}){let{html:K,context:Q,redirect:X,cookies:Z}=await x(G,J);if(X)return{html:K,redirect:X,cookies:Z};let{extractStreamBoundaries:$}=await import("./chunk-vkpmnn26.js"),U=$(Q),I=G.streamTemplates;if(I&&Object.keys(I).length>0){let{processDirectives:V}=await import("./chunk-mghyceb1.js"),{defaultConfig:A}=await import("./chunk-evjs9zqm.js"),O=Q.streamBoundaries||{},D={...A,autoShell:!1},j=Object.keys(I).map((_)=>({id:_,render:async()=>{let M=typeof O[_]==="function"?await O[_]():void 0;return V(I[_],{...Q,$boundary:M},G.sourceFile,D,new Set)}})),N=new Set(j.map((_)=>_.id));U=[...(U||[]).filter((_)=>!N.has(_.id)),...j]}return{html:K,boundaries:U&&U.length>0?U:void 0,cookies:Z}}async function x(G,J){let K={__filename:G.sourceFile,__dirname:G.sourceFile.replace(/[/\\][^/\\]+$/,""),...J};if(!G.hasServerScripts&&!S(G.html))return{html:G.html,context:K};for(let Z of G.serverScriptContent)try{await f(Z,K,G.sourceFile)}catch($){console.warn(`[stx] Server script error in ${G.sourceFile}:`,$)}let Q=await y(K,{request:J.request,method:J.method,params:J.params??{},cookies:J.cookies??{}});if(Q.redirect)return{html:G.html,context:K,redirect:Q.redirect,cookies:Q.cookies};if(!S(G.html))return{html:G.html,context:K,cookies:Q.cookies};let X=new Map;for(let[Z,$]of Object.entries(G.placeholders))if($.expression)try{let U=q($.expression,K);if($.type==="raw")X.set(Z,U!==void 0&&U!==null?String(U):"");else X.set(Z,U!==void 0&&U!==null?k(String(U)):"")}catch{X.set(Z,"")}return{html:b(G.html,X),context:K,cookies:Q.cookies}}async function VG(G,J={}){if(!G.hasServerScripts&&!S(G.fragment))return G.fragment;let K={__filename:G.sourceFile,__dirname:G.sourceFile.replace(/[/\\][^/\\]+$/,""),...J};for(let X of G.serverScriptContent)try{await f(X,K,G.sourceFile)}catch(Z){console.warn(`[stx] Server script error in ${G.sourceFile}:`,Z)}if(!S(G.fragment))return G.fragment;let Q=new Map;for(let[X,Z]of Object.entries(G.placeholders))if(Z.expression)try{let $=q(Z.expression,K);if(Z.type==="raw")Q.set(X,$!==void 0&&$!==null?String($):"");else Q.set(X,$!==void 0&&$!==null?k(String($)):"")}catch{Q.set(X,"")}return b(G.fragment,Q)}XG();import E from"zlib";import{promisify as u}from"util";var s=u(E.brotliCompress),t=u(E.gzip),o=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],e=["text/event-stream","multipart/x-mixed-replace"],GG=1024;function JG(G){if(!G)return!1;let J=G.toLowerCase();if(e.some((K)=>J.startsWith(K)))return!1;return o.some((K)=>J.startsWith(K))}function KG(G){let J=new Map;for(let K of G.split(",")){let[Q,...X]=K.trim().split(";"),Z=Q.trim().toLowerCase();if(!Z)continue;let $=1;for(let U of X){let I=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(U);if(!I)continue;let V=Number.parseFloat(I[1]);if(Number.isFinite(V))$=V}J.set(Z,$)}return J}function QG(G){if(!G)return null;let J=KG(G),K=J.get("*"),Q=(X)=>J.get(X)??K??0;if(Q("br")>0)return"br";if(Q("gzip")>0)return"gzip";return null}async function m(G,J,K={}){if(J.headers.get("content-encoding"))return J;if(J.status===204||J.status===304||!J.body)return J;if(!JG(J.headers.get("content-type")))return J;let Q=QG(G.headers.get("accept-encoding"));if(!Q)return J;let X;try{X=new Uint8Array(await J.arrayBuffer())}catch{return J}let Z=()=>new Response(X,{status:J.status,statusText:J.statusText,headers:h(J.headers)});if(X.length<(K.threshold??GG))return Z();try{let $=Q==="br"?await s(X,{params:{[E.constants.BROTLI_PARAM_QUALITY]:K.quality??5,[E.constants.BROTLI_PARAM_SIZE_HINT]:X.length}}):await t(X);if($.length>=X.length)return Z();let U=h(J.headers);return U.set("Content-Encoding",Q),U.set("Content-Length",String($.length)),new Response($,{status:J.status,statusText:J.statusText,headers:U})}catch{return Z()}}function h(G){let J=new Headers(G),K=J.get("Vary");if(!K)return J.set("Vary","Accept-Encoding"),J;if(!K.split(",").some((X)=>X.trim().toLowerCase()==="accept-encoding"))J.set("Vary",`${K}, Accept-Encoding`);return J}var $G={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".json":"application/json",".html":"text/html",".txt":"text/plain",".xml":"application/xml",".pdf":"application/pdf",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".avif":"image/avif",".svg":"image/svg+xml",".ico":"image/x-icon",".bmp":"image/bmp",".mp4":"video/mp4",".webm":"video/webm",".ogg":"audio/ogg",".mp3":"audio/mpeg",".wav":"audio/wav",".woff":"font/woff",".woff2":"font/woff2",".ttf":"font/ttf",".otf":"font/otf",".eot":"application/vnd.ms-fontobject"};async function bG(G={}){let J=F.resolve(G.outputDir||".output"),K=G.port||3000,Q=n(J);if(!Q)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${Q.routes.length} routes...`);let X=new Map,Z=new Map,$=new Map,U=new Map;for(let O of Q.routes)try{let D=F.join(J,O.compiledPath),j=JSON.parse(await Bun.file(D).text());X.set(O.pattern,j),$.set(O.pattern,c(j.html)),U.set(O.pattern,p(j.html));let N=F.join(J,O.fragmentPath);if(await Bun.file(N).exists())Z.set(O.pattern,await Bun.file(N).text())}catch(D){console.warn(`[stx] Failed to load route ${O.pattern}:`,D)}let I=new Map,V=[];for(let O of Q.routes)if(O.hasParams){let{regex:D,params:j}=d(O.pattern);V.push({regex:D,route:O,paramNames:j})}else I.set(O.pattern,O);let A=ZG({port:K,async fetch(O){return m(O,await(async()=>{let j=new URL(O.url).pathname;if(G.onRequest){let W=await G.onRequest(O);if(W)return W}if(G.apiRoutes?.[j])return G.apiRoutes[j](O);if((O.method==="GET"||O.method==="HEAD")&&j!=="/"){let W=F.resolve(J,"public"),Y;try{Y=decodeURIComponent(j)}catch{Y=j}if(!Y.includes("\x00")){let L=F.resolve(W,`.${Y}`);if(L===W||L.startsWith(`${W}${F.sep}`))try{if(l.existsSync(L)&&l.statSync(L).isFile()){let w=F.extname(L).toLowerCase(),H=$G[w]||"application/octet-stream",P=j.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(j);return new Response(Bun.file(L),{headers:{"Content-Type":H,"Cache-Control":P?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let N=O.headers.get("X-STX-Router")==="true",_=null,M={};if(_=I.get(j)||null,!_)for(let{regex:W,route:Y,paramNames:L}of V){let B=j.match(W);if(B){_=Y,L.forEach((w,H)=>{M[w]=B[H+1]});break}}if(!_){let W=I.get("/404")||null;if(W){let Y=X.get(W.pattern);if(Y)return new Response(Y.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}if(N){let W=Z.get(_.pattern);if(W){let Y=$.get(_.pattern);return new Response(W,{headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...U.has(_.pattern)?{"X-STX-Runtime":U.get(_.pattern)?"true":"false"}:{},...Y?{"X-STX-Layout":Y.layout,"X-STX-Layout-Group":Y.group}:{},"Cache-Control":"no-cache"}})}}let r=C(O.method),z=X.get(_.pattern);if(!z){let W=I.get("/500")||null;if(W){let Y=X.get(W.pattern);if(Y)return new Response(Y.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(!r&&!z.hasServerScripts&&Object.keys(z.placeholders).length===0)return new Response(z.html,{headers:{"Content-Type":"text/html","Cache-Control":"public, max-age=60"}});try{let{html:W,boundaries:Y,redirect:L,cookies:B}=await g(z,{params:M,request:O,method:O.method});if(L)return v(L,B);if(Y&&Y.length>0){let{renderStreamingPage:H,streamToResponse:P}=await import("./chunk-vkpmnn26.js");return P(H(W,Y,{timeoutMs:30000}),{headers:{"Cache-Control":"no-cache"}})}let w=new Headers({"Content-Type":"text/html","Cache-Control":"no-cache"});for(let H of B??[])w.append("Set-Cookie",H);return new Response(W,{headers:w})}catch(W){return console.error(`[stx] Hydration error for ${j}:`,W),new Response(z.html,{headers:{"Content-Type":"text/html"}})}})())}});return console.log(`[stx] Production server running at http://localhost:${K}`),console.log(`[stx] Serving ${Q.routes.length} routes (${X.size} pre-loaded)`),{port:K,stop:()=>A.stop()}}
|
|
3
3
|
export{JG as gf,QG as hf,m as if,R as jf,i as kf,C as lf,y as mf,v as nf,LG as of,g as pf,VG as qf,bG as rf};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Jo as a,Ko as b,Lo as c,Mo as d,No as e,Oo as f,Po as g,Qo as h,Ro as i,So as j}from"./chunk-8bmsw6gq.js";import"./chunk-j0tfxbns.js";import"./chunk-khrtzbxd.js";import"./chunk-8anh6d36.js";import"./chunk-3fwn9edg.js";import"./chunk-qfsgw9by.js";import"./chunk-m2mhtpwy.js";import"./chunk-6xg3j487.js";import"./chunk-q4se9rtw.js";import"./chunk-1nm2xrvq.js";import"./chunk-z47tw39z.js";import"./chunk-3wd9kfyz.js";import"./chunk-trtm887x.js";export{b as stripTypeScript,h as splitDeclaration,c as isModuleResolutionFailure,d as isMissingBindingFailure,f as isCompleteImport,j as hasVariables,e as extractVariables,i as extractScriptFromTemplate,g as convertToCommonJS,a as STX_ENGINE_BINDING_NAMES};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$k as h,Uk as a,Vk as b,Wk as c,Xk as d,Yk as e,Zk as f,_k as g,al as i}from"./chunk-v5x6c698.js";import"./chunk-zgvga8rc.js";import"./chunk-8bmsw6gq.js";import"./chunk-j0tfxbns.js";import"./chunk-khrtzbxd.js";import"./chunk-8anh6d36.js";import"./chunk-3fwn9edg.js";import"./chunk-qfsgw9by.js";import"./chunk-m2mhtpwy.js";import"./chunk-6xg3j487.js";import"./chunk-q4se9rtw.js";import"./chunk-1nm2xrvq.js";import"./chunk-z47tw39z.js";import"./chunk-3wd9kfyz.js";import"./chunk-trtm887x.js";export{a as shouldLogBundlerDiagnostics,e as setBundlerFallbackMode,f as resolveBundlerFallback,b as recordBundleFailure,h as queueClientBundleBuild,g as hasUserImports,c as getBundleFailures,d as clearBundleFailures,i as bundleClientScript};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ui as a,Vi as b}from"./chunk-x2t441ge.js";import"./chunk-ht51fz7w.js";import"./chunk-8bmsw6gq.js";import"./chunk-j0tfxbns.js";import"./chunk-khrtzbxd.js";import"./chunk-8anh6d36.js";import"./chunk-3fwn9edg.js";import"./chunk-qfsgw9by.js";import"./chunk-m2mhtpwy.js";import"./chunk-6xg3j487.js";import"./chunk-q4se9rtw.js";import"./chunk-1nm2xrvq.js";import"./chunk-z47tw39z.js";import"./chunk-3wd9kfyz.js";import"./chunk-trtm887x.js";export{a as getStoreScript,b as clearStoreCache};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Tj as a,Uj as b,Vj as c,Wj as d}from"./chunk-hncp9gz6.js";import"./chunk-
|
|
2
|
+
import{Tj as a,Uj as b,Vj as c,Wj as d}from"./chunk-hncp9gz6.js";import"./chunk-trtm887x.js";export{d as default,c as createHotReloadServer,b as compileToNative,a as NATIVE_COMPONENTS};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Qh as a,Rh as b,Sh as c,Th as d,Uh as e}from"./chunk-w0ng9e1m.js";import"./chunk-
|
|
2
|
+
import{Qh as a,Rh as b,Sh as c,Th as d,Uh as e}from"./chunk-w0ng9e1m.js";import"./chunk-trtm887x.js";export{c as renderSSRSuspense,a as processSuspenseDirectives,e as generateSuspenseRuntime,d as generateSuspenseCSS,b as createSSRSuspense};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Wi as a,Xi as b,Yi as c}from"./chunk-xcf62bdq.js";import"./chunk-ht51fz7w.js";import"./chunk-8bmsw6gq.js";import"./chunk-j0tfxbns.js";import"./chunk-khrtzbxd.js";import"./chunk-8anh6d36.js";import"./chunk-3fwn9edg.js";import"./chunk-qfsgw9by.js";import"./chunk-m2mhtpwy.js";import"./chunk-6xg3j487.js";import"./chunk-q4se9rtw.js";import"./chunk-1nm2xrvq.js";import"./chunk-z47tw39z.js";import"./chunk-3wd9kfyz.js";import"./chunk-trtm887x.js";export{a as listComposableModules,b as getComposableScript,c as clearComposableCache};
|
|
@@ -144,4 +144,4 @@ var N=new Map,Q=new Map;function T(A){if(N.set(A.name,A),A.client)Q.set(A.name,A
|
|
|
144
144
|
console.log('[stx] Directive runtime initialized');
|
|
145
145
|
})();
|
|
146
146
|
`}function $(A){let B=/v-(\w+)(?::(\w+))?(?:\.([\w.]+))?="([^"]*)"/g;return A.replace(B,(C,F,H,L,J)=>{let E=(L?L.split("."):[]).reduce((M,S)=>{return M[S]=!0,M},{});return`data-stx-directive="${F}:${J}" data-stx-directive-arg="${H||""}" data-stx-directive-modifiers='${JSON.stringify(E)}'`})}
|
|
147
|
-
export{T as
|
|
147
|
+
export{T as js,V as ks,W as ls,X as ms,G as ns,Y as os,Z as ps,_ as qs,$ as rs};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-trtm887x.js";var Y=null,S=[],F=new WeakMap;function I(z){let K=z,B=new Set,G={get value(){if(Y){let H=F.get(G);if(!H)H=new Set,F.set(G,H);H.add(Y)}return K},set value(H){if(!Object.is(K,H)){K=H,B.forEach((J)=>J(H));let L=F.get(G);if(L)L.forEach((J)=>J())}},subscribe(H){return B.add(H),()=>B.delete(H)},peek(){return K}};return G}function W(z){return z!==null&&typeof z==="object"&&"value"in z&&"subscribe"in z&&"peek"in z}function P(z){return W(z)?z.value:z}function j(z){let K={};for(let B in z)if(Object.prototype.hasOwnProperty.call(z,B))K[B]=I(z[B]);return K}function D(z){return I(z)}function U(z){let K=typeof z==="function",B=K?z:z.get,G=K?void 0:z.set,H=K?Object.is:z.equals||Object.is,L,J=!0,Q=new Set,X=new Set,_=()=>{if(J=!0,X.size>0){let N=T.value;X.forEach(($)=>$(N))}};function Z(){Q.clear();let N=Y;Y=_,S.push(_);try{return B()}finally{S.pop(),Y=N}}let T={get value(){if(Y){let N=F.get(T);if(!N)N=new Set,F.set(T,N);N.add(Y)}if(J){let N=Z();if(!H(L,N))L=N;J=!1}return L},set value(N){if(G)G(N);else console.warn("Computed property is readonly")},subscribe(N){return X.add(N),()=>X.delete(N)},peek(){if(J)L=B(),J=!1;return L},invalidate(){J=!0},get dirty(){return J},get deps(){return Q}};return T}function x(z,K,B={}){let{immediate:G=!1,deep:H=!1,flush:L="pre",once:J=!1}=B,Q,X=!0,_=!1,Z=()=>{if(W(z))return H?q(z.value):z.value;return z()},T=()=>{if(!X||_)return;let M=Z();if(Q!==void 0&&Object.is(Q,M)&&!H)return;let A=()=>{if(K(M,Q),Q=H?q(M):M,J)$()};if(L==="sync")A();else if(L==="post")queueMicrotask(A);else Promise.resolve().then(A)},N=null;if(W(z))N=z.subscribe(()=>T());else N=U(z).subscribe(()=>T());if(G)Q=void 0,T();else Q=Z();let $=()=>{if(X=!1,N)N(),N=null};return $.pause=()=>{_=!0},$.resume=()=>{_=!1},$}function E(z,K,B={}){let{immediate:G=!1,once:H=!1}=B,L=z.map((T)=>W(T)?T.value:void 0),J=!0,Q=!1,X=()=>{if(!J||Q)return;let T=z.map((N)=>W(N)?N.value:void 0);if(K(T,L),L=[...T],H)Z()},_=z.map((T)=>{if(W(T))return T.subscribe(()=>X());return()=>{}});if(G)X();let Z=()=>{J=!1,_.forEach((T)=>T())};return Z.pause=()=>{Q=!0},Z.resume=()=>{Q=!1},Z}function y(z,K={}){let{flush:B="pre"}=K,G,H=!0,L=!1,J=()=>{if(!H||L)return;if(G)G();let X=Y;Y=J,S.push(J);try{G=z()}finally{S.pop(),Y=X}};if(B==="sync")J();else if(B==="post")queueMicrotask(J);else Promise.resolve().then(J);let Q=()=>{if(H=!1,G)G()};return Q.pause=()=>{L=!0},Q.resume=()=>{L=!1},Q}function C(z,K={},B){let G=/@computed\s*\(\s*(\w+)\s*,\s*(.+?)\s*\)/gi;return z.replace(G,(H,L,J)=>{try{let X=Function(...Object.keys(K),`return ${J}`)(...Object.values(K));return K[L]=X,`<!-- computed: ${L} = ${X} -->`}catch(Q){return`<!-- computed error: ${L} - ${Q} -->`}})}function R(z,K={},B){let G=/@watch\s*\(\s*(\w+)\s*\)\s*([\s\S]*?)@endwatch/gi;return z.replace(G,(H,L,J)=>{return`
|
|
3
3
|
<script data-watch="${`watch-${Math.random().toString(36).substring(2,9)}`}">
|
|
4
4
|
(function() {
|
|
5
5
|
// Watch implementation for ${L}
|
|
@@ -299,4 +299,4 @@ catch (error) {
|
|
|
299
299
|
}
|
|
300
300
|
})();
|
|
301
301
|
</script>`}var N={name:"pwa.installButton",handler:(j,z,k,E)=>{let q=k.__stx_options||{};return H(j,q)},hasEndTag:!0,description:"Renders a PWA install prompt button that appears when the app can be installed"},Q={name:"pwa.updatePrompt",handler:(j,z,k,E)=>{let q=k.__stx_options||{};return J(j,q)},hasEndTag:!0,description:"Renders a PWA update notification UI when a new version is available"},T={name:"pwa.offlineIndicator",handler:(j,z,k,E)=>{let q=k.__stx_options||{};return L(j,q)},hasEndTag:!0,description:"Renders an offline status indicator that shows when the user loses connection"},V={name:"pwa.pushSubscribe",handler:(j,z,k,E)=>{let q=k.__stx_options||{};return M(j,q)},hasEndTag:!0,description:"Renders a push notification subscription button"},X=[N,Q,T,V];function Z(j){return[...j,...X]}
|
|
302
|
-
export{N as
|
|
302
|
+
export{N as $t,Q as au,T as bu,V as cu,X as du,Z as eu};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ff as a}from"./chunk-r5hnhtp1.js";import"./chunk-8bmsw6gq.js";import"./chunk-j0tfxbns.js";import"./chunk-khrtzbxd.js";import"./chunk-8anh6d36.js";import"./chunk-3fwn9edg.js";import"./chunk-qfsgw9by.js";import"./chunk-m2mhtpwy.js";import"./chunk-6xg3j487.js";import"./chunk-q4se9rtw.js";import"./chunk-1nm2xrvq.js";import"./chunk-z47tw39z.js";import"./chunk-3wd9kfyz.js";import"./chunk-trtm887x.js";export{a as buildApp};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-trtm887x.js";function F(){return`<script data-stx-scoped data-stx-x-element-runtime data-stx-run="always">
|
|
3
3
|
(function() {
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{fu as W,gu as k,hu as G}from"./chunk-trtm887x.js";import A from"fs";import B from"path";function h(j){let q=0;for(let K=0;K<j.length;K++){let Q=j[K];q=(q<<5)-q+Q,q=q&q}return Math.abs(q).toString(16).padStart(8,"0")}function u(j,q){let K=B.basename(j);for(let Q of q)if(Q.startsWith("*.")){let Y=Q.slice(1);if(K.endsWith(Y))return!0}else if(Q.includes("*")){let Y=new RegExp(`^${Q.replace(/\*/g,".*")}$`);if(Y.test(K)||Y.test(j))return!0}else if(K===Q||j.includes(Q))return!0;return!1}function f(j,q,K){let Q=B.extname(j).toLowerCase(),Y=l[Q],X=(K.maxFileSizeKB||500)*1024;if(q>X)return!1;if(K.exclude&&u(j,K.exclude))return!1;if(K.include&&K.include.length>0){for(let Z of K.include)if(Z.startsWith("*.")){if(j.endsWith(Z.slice(1)))return!0}else if(j.includes(Z))return!0}if(Y&&K[Y]===!0)return!0;if(!Y)return!1;return!1}function T(j,q,K,Q){let Y=A.readdirSync(j,{withFileTypes:!0});for(let X of Y){let Z=B.join(j,X.name);if(X.isDirectory()){if(["node_modules",".git",".stx"].includes(X.name))continue;T(Z,q,K,Q)}else if(X.isFile()){let O=A.statSync(Z),_=B.relative(q,Z);if(f(_,O.size,K)){let $=A.readFileSync(Z),L=h($),V=`/${_.replace(/\\/g,"/")}`;Q.push({url:V,revision:L,size:O.size})}}}}function U(j,q){let K=q.pwa?.precache,Q=[];if(!K?.enabled)return{entries:[],totalSize:0,fileCount:0};if(!A.existsSync(j))return{entries:[],totalSize:0,fileCount:0};T(j,j,K,Q),Q.sort((X,Z)=>X.url.localeCompare(Z.url));let Y=Q.reduce((X,Z)=>X+Z.size,0);return{entries:Q,totalSize:Y,fileCount:Q.length}}function J(j){if(j.entries.length===0)return"[]";return`[
|
|
3
3
|
${j.entries.map((K)=>` { url: '${K.url}', revision: '${K.revision}' }`).join(`,
|
|
4
4
|
`)}
|
|
5
5
|
]`}function E(j){if(j<1024)return`${j} B`;if(j<1048576)return`${(j/1024).toFixed(1)} KB`;return`${(j/1048576).toFixed(2)} MB`}var l;var F=G(()=>{l={".html":"includeHtml",".htm":"includeHtml",".js":"includeJs",".mjs":"includeJs",".css":"includeCss",".png":"includeImages",".jpg":"includeImages",".jpeg":"includeImages",".gif":"includeImages",".webp":"includeImages",".svg":"includeImages",".ico":"includeImages",".woff":"includeFonts",".woff2":"includeFonts",".ttf":"includeFonts",".eot":"includeFonts",".otf":"includeFonts"}});function g(j){let q={"cache-first":{className:"CacheFirst",importFrom:"workbox-strategies"},"network-first":{className:"NetworkFirst",importFrom:"workbox-strategies"},"stale-while-revalidate":{className:"StaleWhileRevalidate",importFrom:"workbox-strategies"},"network-only":{className:"NetworkOnly",importFrom:"workbox-strategies"},"cache-only":{className:"CacheOnly",importFrom:"workbox-strategies"}};return q[j]||q["network-first"]}function R(j){return g(j).className}function M(j){let q=j.pwa;if(!q?.enabled)return"";let K=q.routes||[],Q=q.cacheStorage,Y=[];for(let X of K){let Z=R(X.strategy),O=[];if(X.maxAgeSeconds||X.maxEntries||Q?.maxEntries){let $=X.maxEntries||Q?.maxEntries||100,L=X.maxAgeSeconds||(Q?.maxAge?Q.maxAge*24*60*60:void 0);O.push(`new ExpirationPlugin({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Kl as Y,
|
|
2
|
+
import{Kl as Y,uq as x}from"./chunk-8bmsw6gq.js";import"./chunk-j0tfxbns.js";import"./chunk-khrtzbxd.js";import"./chunk-8anh6d36.js";import"./chunk-3fwn9edg.js";import"./chunk-qfsgw9by.js";import"./chunk-m2mhtpwy.js";import"./chunk-6xg3j487.js";import"./chunk-q4se9rtw.js";import"./chunk-1nm2xrvq.js";import"./chunk-z47tw39z.js";import"./chunk-3wd9kfyz.js";import"./chunk-trtm887x.js";import A from"path";var C=["broadcast","calculateDistance","canNotify","clearCookies","clearFetchCache","clearStorage","copyToClipboard","createShareableFile","defineForm","getBatteryLevel","getCookie","getCurrentPosition","getStorageKeys","getStorageSize","getVoices","hasBattery","hasCameraPermission","hasGeolocationPermission","hasMicrophonePermission","hasNotificationPermission","hasResizeObserver","hexToHsl","hexToRgb","isBroadcastChannelSupported","isCharging","isDeviceMotionSupported","isDeviceOrientationSupported","isEventSourceSupported","isEyeDropperSupported","isInFullscreen","isMutationObserverSupported","isPermissionGranted","isSpeechRecognitionSupported","isSpeechSynthesisSupported","isWakeLockSupported","isWebSocketSupported","notify","parseCookies","pickColor","prefetch","removeCookie","requestMediaPermissions","requestMotionPermission","requestNotificationPermission","requestOrientationPermission","setCookie","share","shareCurrentPage","shareFiles","shareText","shareURL","shareWithFallback","speak","stopSpeaking","toggleFullscreen","useAsyncData","useAttributeObserver","useAutoLogout","useAutoWakeLock","useBattery","useBreakpoint","useBroadcastChannel","useChannel","useChildListObserver","useClipboard","useColorHistory","useConditionalWakeLock","useCookies","useCopySelection","useDeviceMotion","useDeviceOrientation","useElementSize","useElementTextSelection","useElementVisibility","useEventSource","useEyeDropper","useFavicon","useForm","useFullscreen","useGeolocation","useGeolocationWatch","useHotkey","useIdle","useIdleState","useInfiniteScroll","useIntersectionObserver","useIntersectionObserverMultiple","useIsDesktop","useIsMobile","useIsTablet","useKeyPressed","useKeySequence","useKeyboard","useLastActive","useLazyLoad","useMeta","useMouse","useMouseInElement","useMutationObserver","useNetwork","useNotification","useOnline","useParallax","usePermission","usePermissions","usePointer","usePost","useResizeObserver","useResizeObserverMultiple","useSSE","useScroll","useSelectionPopup","useShare","useSpeechRecognition","useSpeechSynthesis","useStorage","useTextObserver","useTextSelection","useTitle","useVisibility","useWakeLock","useWindowSize"],y=new Set(C);var Z=new Map,I=new Set,P=new Set(C);function R(){Z.clear()}function D(G){let H=new Map;for(let z of G){let K=A.basename(z);if(K.endsWith(".d.ts"))continue;let J=K.replace(/\.[jt]s$/,"");if(J==="index")continue;if(J===K)continue;let X=H.get(J);if(X&&!X.endsWith(".js"))continue;H.set(J,z)}return[...H.values()].sort()}function L(G,H){let z=H.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(?:^|[^\\w$.])(?:const|let|var|function|class)\\s+${z}\\b`).test(G)}function k(G){if(!G)return[];let H=G.replace(/<script\b[^>]*\bdata-stx-runtime\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-framework-composables\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-stores\b[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<script\b[^>]*\bdata-stx-composables\b[^>]*>[\s\S]*?<\/script>/gi,""),z=[];for(let K of P){if(I.has(K))continue;let J=K.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");if(new RegExp(`(^|[^\\w$.])${J}\\s*\\(`).test(H))z.push(K)}return z.sort()}async function _(G,H){let z=k(G);if(z.length===0)return null;let K=H??A.join(import.meta.dir,"composables"),J=`${K}\x00${z.join(",")}`,X=Z.get(J);if(X!==void 0)return X||null;let T=x({loader:"ts",target:"browser",define:Y()}),B=new Set(z),F=[],w=new Set,$=[];try{let q=new Bun.Glob("*.{ts,js}");for await(let j of q.scan({cwd:K,absolute:!0}))$.push(j)}catch{return Z.set(J,""),null}$=D($);for(let q of $){let j;try{j=await Bun.file(q).text()}catch{continue}let W=[];try{W=T.scan(j).exports.filter((Q)=>Q!=="default")}catch{continue}if(!W.some((Q)=>B.has(Q)))continue;try{j=j.replace(/^import\s+.*from\s+['"][^'"]+['"]\s*;?\s*$/gm,""),j=j.replace(/^import\s+type\s+.*$/gm,""),j=j.replace(/^export\s+\*\s+(?:as\s+\w+\s+)?from\s*['"][^'"]+['"]\s*;?\s*$/gm,""),j=j.replace(/^export\s+(?:type\s+)?\{[\s\S]*?\}\s*(?:from\s*['"][^'"]+['"]\s*)?;?\s*$/gm,""),j=j.replace(/^export\s+default\s+/gm,""),j=j.replace(/^export\s+(?=(?:declare\s+)?(?:abstract\s+)?(?:async\s+)?(?:function|class|const|let|var|type|interface|enum)\b)/gm,""),F.push(`// ${A.basename(q).replace(/\.[jt]s$/,"")}
|
|
3
3
|
${T.transformSync(j).trim()}`);for(let Q of W)w.add(Q)}catch(Q){console.warn(`[stx] framework composable ${A.basename(q)} could not be bundled:`,Q)}}let U=z.filter((q)=>!w.has(q)&&!L(G,q));if(U.length>0)console.warn(`[stx] could not bundle ${U.join(", ")} from @stacksjs/stx/composables \u2014 `+"calls to them will throw ReferenceError in the browser. Import them explicitly so the bundler inlines them, or use a runtime equivalent from window.stx.");if(F.length===0)return Z.set(J,""),null;let M=[...w].map((q)=>` try { if (!(${JSON.stringify(q)} in __s)) { __s[${JSON.stringify(q)}] = ${q}; if (!(${JSON.stringify(q)} in window)) window[${JSON.stringify(q)}] = ${q}; } } catch (e) {}`).join(`
|
|
4
4
|
`),V=`<script data-stx-framework-composables>
|
|
5
5
|
;(function(){
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{rf as a}from"./chunk-1qkk4mrm.js";import"./chunk-vtqej9yr.js";import"./chunk-8bmsw6gq.js";import"./chunk-j0tfxbns.js";import"./chunk-khrtzbxd.js";import"./chunk-8anh6d36.js";import"./chunk-3fwn9edg.js";import"./chunk-qfsgw9by.js";import"./chunk-m2mhtpwy.js";import"./chunk-6xg3j487.js";import"./chunk-q4se9rtw.js";import"./chunk-1nm2xrvq.js";import"./chunk-z47tw39z.js";import"./chunk-3wd9kfyz.js";import"./chunk-trtm887x.js";export{a as startProductionServer};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{cf as a,df as b}from"./chunk-9xh78snm.js";import"./chunk-
|
|
2
|
+
import{cf as a,df as b}from"./chunk-9xh78snm.js";import"./chunk-trtm887x.js";export{b as captureScreenshots,a as captureScreenshot};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{gk as a,hk as b,ik as c,jk as d}from"./chunk-1jeyh1e2.js";import"./chunk-v1v3fxq1.js";import"./chunk-8bmsw6gq.js";import"./chunk-j0tfxbns.js";import"./chunk-khrtzbxd.js";import"./chunk-8anh6d36.js";import"./chunk-3fwn9edg.js";import"./chunk-qfsgw9by.js";import"./chunk-m2mhtpwy.js";import"./chunk-6xg3j487.js";import"./chunk-q4se9rtw.js";import"./chunk-1nm2xrvq.js";import"./chunk-z47tw39z.js";import"./chunk-3wd9kfyz.js";import"./chunk-trtm887x.js";export{b as getAvailableTargets,c as getAvailableFormats,d as default,a as buildNative};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Fj as K,Gj as N,Hj as O,Ij as P,Jj as Q,Kj as T,Oj as U,Pj as V,Qj as W,Rj as Y}from"./chunk-3es366z4.js";import{
|
|
2
|
+
import{Fj as K,Gj as N,Hj as O,Ij as P,Jj as Q,Kj as T,Oj as U,Pj as V,Qj as W,Rj as Y}from"./chunk-3es366z4.js";import{mt as J}from"./chunk-1nm2xrvq.js";function $(){let w=q(Z());try{let z=new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(w);return z=z.replace(/\}(var |let |const |function )/g,"};$1"),z}catch{return w}}function q(w){let E=[],z=0,I="console.log(";while(z<w.length){let F=w.indexOf(I,z);if(F===-1){E.push(w.slice(z));break}E.push(w.slice(z,F));let G=1,x=F+I.length;while(x<w.length&&G>0){let B=w[x];if(B==='"'||B==="'"||B==="`"){let _=B;x++;while(x<w.length&&w[x]!==_){if(w[x]==="\\")x++;x++}x++;continue}if(B==="(")G++;else if(B===")")G--;x++}E.push("0"),z=x}return E.join("")}function Z(){return`
|
|
3
3
|
// STX Signals Runtime (Development Build)
|
|
4
4
|
console.log('[stx] signals runtime loading');
|
|
5
5
|
// Pre-initialization shim: capture onMount/onDestroy calls made before the runtime IIFE runs
|