@stacksjs/stx 0.2.354 → 0.2.356
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-0c49cy69.js +2 -0
- package/dist/chunk-0chkqvs1.js +2 -0
- package/dist/chunk-0d6qgbks.js +2 -0
- package/dist/{chunk-84bhnp6p.js → chunk-0dj2gne3.js} +2 -2
- package/dist/{chunk-57atgbyq.js → chunk-0knxnyq6.js} +1 -1
- package/dist/{chunk-m6dstr44.js → chunk-0smr2xjs.js} +2 -2
- package/dist/{chunk-e4g8wz6t.js → chunk-0t1yyn1d.js} +1 -1
- package/dist/{chunk-xvh1k1a4.js → chunk-19m7hed6.js} +1 -1
- package/dist/{chunk-vhta1be7.js → chunk-1nnza3m6.js} +1 -1
- package/dist/chunk-284kattb.js +2 -0
- package/dist/{chunk-n5657hm3.js → chunk-2gtwha4k.js} +1 -1
- package/dist/{chunk-f5veee11.js → chunk-2s3wvns6.js} +1 -1
- package/dist/chunk-2x3zy811.js +2 -0
- package/dist/chunk-38mpg3kn.js +2 -0
- package/dist/chunk-3eya6sbk.js +2 -0
- package/dist/chunk-3f782ywp.js +2 -0
- package/dist/{chunk-mmnf2pac.js → chunk-3kd0zn9c.js} +2 -2
- package/dist/{chunk-avye7h5s.js → chunk-3kyydhzt.js} +1 -1
- package/dist/{chunk-msq8xvhp.js → chunk-3ssjb8cx.js} +309 -312
- package/dist/{chunk-6r3aavbv.js → chunk-3y8vvkar.js} +2 -2
- package/dist/chunk-4ce5ma6a.js +20 -0
- package/dist/{chunk-8cc4vdkh.js → chunk-4gtsf1xw.js} +1 -1
- package/dist/chunk-4mkqzhfh.js +2 -0
- package/dist/{chunk-xj6bcwqa.js → chunk-5270fyk7.js} +1 -1
- package/dist/{chunk-a1knndrh.js → chunk-57kxjr4t.js} +10 -10
- package/dist/chunk-596cftgk.js +2 -0
- package/dist/{chunk-8bxtvsgm.js → chunk-634gaa9d.js} +1 -1
- package/dist/{chunk-pwh8pbks.js → chunk-6gsgayq3.js} +1 -1
- package/dist/{chunk-a8ghkfh6.js → chunk-6qhatdte.js} +2 -2
- package/dist/{chunk-6zrg2mmc.js → chunk-6yfccnr7.js} +2 -2
- package/dist/{chunk-z23sc9p4.js → chunk-79fj9zem.js} +2 -2
- package/dist/{chunk-2ver2s2y.js → chunk-7hb89n3z.js} +1 -1
- package/dist/{chunk-05zfez2g.js → chunk-7jcntsp4.js} +1 -1
- package/dist/{chunk-nf7k53ap.js → chunk-7kw3grq5.js} +1 -1
- package/dist/chunk-7nf8azjh.js +2 -0
- package/dist/{chunk-g5mhck0r.js → chunk-801bg5d8.js} +2 -2
- package/dist/chunk-8wgsjh65.js +2 -0
- package/dist/{chunk-34f8c48f.js → chunk-8xjasa91.js} +1 -1
- package/dist/{chunk-w5j9tbsk.js → chunk-94dz7hrj.js} +1 -1
- package/dist/{chunk-6h3r8v55.js → chunk-9qdn9y72.js} +1 -1
- package/dist/chunk-a6x0czvr.js +2 -0
- package/dist/{chunk-72x62kch.js → chunk-aa8015mk.js} +1 -1
- package/dist/{chunk-64n10kpa.js → chunk-aacfyyya.js} +1 -1
- package/dist/chunk-abtxpqna.js +2 -0
- package/dist/{chunk-c30qnb6z.js → chunk-apbr1kb1.js} +2 -2
- package/dist/{chunk-nm60wh6r.js → chunk-awyyskad.js} +1 -1
- package/dist/{chunk-ppzz953j.js → chunk-b8ywrx2w.js} +1 -1
- package/dist/{chunk-18018jkn.js → chunk-bcpjhcpn.js} +1 -1
- package/dist/{chunk-kw9cgyfc.js → chunk-c17ybabd.js} +1 -1
- package/dist/chunk-c4rpdtvw.js +2 -0
- package/dist/{chunk-zk6ghjnj.js → chunk-c79nfdyj.js} +1 -1
- package/dist/chunk-cgs5xpsn.js +2 -0
- package/dist/{chunk-avwywzsj.js → chunk-czj6nq0b.js} +2 -2
- package/dist/{chunk-9kmhwbwy.js → chunk-czypgdc1.js} +1 -1
- package/dist/{chunk-epqd3eah.js → chunk-degz74nv.js} +2 -2
- package/dist/chunk-dpyc7pht.js +2 -0
- package/dist/{chunk-hay8nwv3.js → chunk-dtdwjpvf.js} +2 -2
- package/dist/{chunk-dsztk2kp.js → chunk-e48050x3.js} +1 -1
- package/dist/{chunk-3nx7z086.js → chunk-ec8jsqgm.js} +3 -3
- package/dist/{chunk-86c461ca.js → chunk-eg8k598q.js} +1 -1
- package/dist/{chunk-bgrkxzr7.js → chunk-ej8mv2k6.js} +1 -1
- package/dist/{chunk-y2f41kaq.js → chunk-ejwfnttb.js} +1 -1
- package/dist/{chunk-ejqpq0wc.js → chunk-emjmshj8.js} +1 -1
- package/dist/{chunk-59906baj.js → chunk-ep034wt0.js} +1 -1
- package/dist/{chunk-njx93b4z.js → chunk-ez003q74.js} +1 -1
- package/dist/{chunk-ws0282jr.js → chunk-f11z7q5g.js} +1 -1
- package/dist/chunk-f3eb1f6z.js +2 -0
- package/dist/{chunk-1z1efvtw.js → chunk-fqq5k9ve.js} +1 -1
- package/dist/{chunk-c0n802j1.js → chunk-frp9fc7j.js} +1 -1
- package/dist/chunk-fzq2n865.js +2 -0
- package/dist/{chunk-g6czgcg4.js → chunk-g1vxsvqv.js} +1 -1
- package/dist/chunk-g3cmkyk2.js +2 -0
- package/dist/{chunk-7r9vgzg4.js → chunk-g7bpkpd4.js} +1 -1
- package/dist/{chunk-at622hg0.js → chunk-gn2qc03b.js} +1 -1
- package/dist/chunk-gxgrzeeh.js +2 -0
- package/dist/{chunk-a9w1ds4w.js → chunk-h99qxgbr.js} +1 -1
- package/dist/{chunk-dgv43ccd.js → chunk-hcf8399w.js} +1 -1
- package/dist/{chunk-hbkjzx1h.js → chunk-hh0aaxxy.js} +1 -1
- package/dist/{chunk-tc4pj651.js → chunk-hkrzv980.js} +2 -2
- package/dist/{chunk-7qp3zphs.js → chunk-hy79zwyy.js} +2 -2
- package/dist/chunk-j6kec9kp.js +2 -0
- package/dist/{chunk-e631svvs.js → chunk-j8wycqve.js} +1 -1
- package/dist/chunk-jmdxn2mq.js +2 -0
- package/dist/chunk-jwmact5f.js +2 -0
- package/dist/{chunk-g7msqva8.js → chunk-jy451jg5.js} +3 -3
- package/dist/{chunk-a959m68j.js → chunk-k33778kc.js} +1 -1
- package/dist/{chunk-wvc7t11n.js → chunk-kaet6r9w.js} +1 -1
- package/dist/chunk-kdmkk0rb.js +2 -0
- package/dist/{chunk-9e20mgwc.js → chunk-kjd9hbg4.js} +3 -3
- package/dist/{chunk-8m0g0h4x.js → chunk-krt45cqy.js} +2 -2
- package/dist/{chunk-2wb3pgp4.js → chunk-kyyt9xhs.js} +1 -1
- package/dist/{chunk-0k1mtwby.js → chunk-mdbj7sq8.js} +1 -1
- package/dist/{chunk-d86q27j8.js → chunk-mere396d.js} +1 -1
- package/dist/{chunk-1c9453w0.js → chunk-ms25gb16.js} +1 -1
- package/dist/{chunk-ym3r8ktq.js → chunk-n0d7nwhd.js} +1 -1
- package/dist/{chunk-7h9fajgs.js → chunk-n1y0hjk1.js} +2 -2
- package/dist/{chunk-bk1zb1xp.js → chunk-n5tpqzcb.js} +1 -1
- package/dist/{chunk-b5hank5e.js → chunk-nybn003d.js} +2 -2
- package/dist/chunk-p1426yar.js +2 -0
- package/dist/chunk-p78b80dp.js +2 -0
- package/dist/chunk-pr3hz3ec.js +2 -0
- package/dist/{chunk-gtqbvt3a.js → chunk-q4kgqqed.js} +2 -2
- package/dist/{chunk-san1eq0r.js → chunk-qbz6yn8c.js} +2 -2
- package/dist/{chunk-fvsefztj.js → chunk-qjvny3wf.js} +1 -1
- package/dist/{chunk-v0e259x2.js → chunk-qnptmtqh.js} +1 -1
- package/dist/{chunk-msywnv5n.js → chunk-qrvey4wk.js} +2 -2
- package/dist/{chunk-7we3xfde.js → chunk-ra1s4s6b.js} +1 -1
- package/dist/{chunk-62nz9v8t.js → chunk-rbfm5sjt.js} +2 -2
- package/dist/{chunk-99b5tfxc.js → chunk-rcbt11p8.js} +1 -1
- package/dist/{chunk-9nrgjtah.js → chunk-rtfwn4cm.js} +1 -1
- package/dist/chunk-rydb5n5b.js +2 -0
- package/dist/{chunk-6k5a03pw.js → chunk-s5dwatkj.js} +2 -2
- package/dist/chunk-sa6cgj9h.js +2 -0
- package/dist/chunk-skdfq4hq.js +2 -0
- package/dist/{chunk-ngjkzaj7.js → chunk-t23kccpz.js} +3 -3
- package/dist/{chunk-89mqnh67.js → chunk-tf16jtj4.js} +1 -1
- package/dist/{chunk-swvm1wgn.js → chunk-trva71am.js} +2 -2
- package/dist/{chunk-rwwfzkz4.js → chunk-tv04k7gq.js} +1 -1
- package/dist/{chunk-5wbdbcvf.js → chunk-v1qm7p7t.js} +2 -2
- package/dist/chunk-w1a8dwgx.js +2 -0
- package/dist/{chunk-y6xzr30x.js → chunk-wkyt4j9e.js} +1 -1
- package/dist/{chunk-p3p4d6g1.js → chunk-wz4fnsat.js} +2 -2
- package/dist/chunk-x131a0jq.js +2 -0
- package/dist/{chunk-f5cw54q3.js → chunk-x21hdhjw.js} +1 -1
- package/dist/chunk-x5b8az2h.js +2 -0
- package/dist/chunk-xk782v5z.js +2 -0
- package/dist/{chunk-qsbjtp60.js → chunk-y4nzmkea.js} +1 -1
- package/dist/{chunk-sqvqwd0p.js → chunk-y4zddt5r.js} +1 -1
- package/dist/{chunk-vgfd9582.js → chunk-ya5m5vbn.js} +1 -1
- package/dist/{chunk-1vb2rj09.js → chunk-yg0qm73a.js} +2 -2
- package/dist/{chunk-8y1ve8tc.js → chunk-ykevda74.js} +2 -2
- package/dist/chunk-ynj1y0qm.js +2 -0
- package/dist/{chunk-v6e35j4g.js → chunk-z50ex86m.js} +1 -1
- package/dist/chunk-z8gccz1q.js +2 -0
- package/dist/{chunk-wj21f1e0.js → chunk-zxfejz72.js} +1 -1
- package/dist/chunk-zxnf0c9x.js +2 -0
- package/dist/cli.js +14 -14
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/database.js +1 -1
- package/dist/engine-bindings.d.ts +35 -0
- package/dist/engine-bindings.js +55 -0
- package/dist/pwa.js +2 -2
- package/dist/ssg.js +2 -2
- package/dist/stx-module-imports.d.ts +24 -0
- package/dist/stx-module-imports.js +57 -0
- package/dist/stx-module.d.ts +154 -0
- package/dist/stx-virtual-ts.d.ts +74 -1
- package/dist/stx-virtual-ts.js +81 -21
- package/dist/typecheck.d.ts +13 -0
- package/dist/typecheck.js +31 -25
- package/dist/variable-extractor.d.ts +2 -22
- package/dist/variable-extractor.js +3 -55
- package/dist/visual-testing.js +1 -1
- package/package.json +7 -6
- package/stx-module.d.ts +154 -0
- package/dist/chunk-04x3vny9.js +0 -19
- package/dist/chunk-1apnswz7.js +0 -2
- package/dist/chunk-1qvf8ase.js +0 -2
- package/dist/chunk-1vt1h19d.js +0 -2
- package/dist/chunk-32x78na8.js +0 -2
- package/dist/chunk-3z4d7kmp.js +0 -2
- package/dist/chunk-4b2vsawv.js +0 -2
- package/dist/chunk-616fn77w.js +0 -2
- package/dist/chunk-70zk8tj2.js +0 -2
- package/dist/chunk-86q2h34b.js +0 -2
- package/dist/chunk-88e14er7.js +0 -2
- package/dist/chunk-8yydz0hk.js +0 -2
- package/dist/chunk-a7yxvxke.js +0 -2
- package/dist/chunk-aanwshk6.js +0 -2
- package/dist/chunk-ahfj7dc7.js +0 -2
- package/dist/chunk-bed5f4bp.js +0 -2
- package/dist/chunk-dxkjvajv.js +0 -2
- package/dist/chunk-e7np0h2q.js +0 -2
- package/dist/chunk-erb294sv.js +0 -2
- package/dist/chunk-evfr2zgg.js +0 -2
- package/dist/chunk-f85f75jh.js +0 -2
- package/dist/chunk-gsc2vds7.js +0 -2
- package/dist/chunk-h5jt4mxx.js +0 -2
- package/dist/chunk-hke0k33t.js +0 -2
- package/dist/chunk-hysq9e9t.js +0 -2
- package/dist/chunk-kq30wqp6.js +0 -2
- package/dist/chunk-m2j5skez.js +0 -2
- package/dist/chunk-ntzzhw3w.js +0 -2
- package/dist/chunk-px0bs815.js +0 -2
- package/dist/chunk-qw92p9za.js +0 -2
- package/dist/chunk-rjwnw5hj.js +0 -2
- package/dist/chunk-tmr3xq5d.js +0 -2
- package/dist/chunk-tpk6wm38.js +0 -2
- package/dist/chunk-vw4b7g24.js +0 -2
- package/dist/chunk-x054qzma.js +0 -2
- package/dist/chunk-x2n1x19t.js +0 -2
- package/dist/chunk-zks9ft7n.js +0 -2
- package/dist/chunk-zkxnarrh.js +0 -2
- package/dist/chunk-zp14ksx1.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Rw as O}from"./chunk-emjmshj8.js";import{mkdir as b,writeFile as T}from"fs/promises";import{join as q}from"path";var E="https://api.iconify.design";async function k(){let G=await fetch(`${E}/collections`);if(!G.ok)throw Error(`Failed to fetch collections: ${G.statusText}`);return await G.json()}async function P(G,z){try{let Z=O.resolve("@iconify/json"),X=`${`${Z.substring(0,Z.lastIndexOf("/node_modules/@iconify/json/"))}/node_modules/@iconify/json`}/json/${G}.json`,Q=Bun.file(X);if(await Q.exists()){let $=await Q.json();if(z&&z.length>0){let B={};for(let S of z)if($.icons[S])B[S]=$.icons[S];return{...$,icons:B}}return $}}catch{}let M=z&&z.length>0?`${E}/${G}.json?icons=${z.join(",")}`:`${E}/${G}.json`,U=await fetch(M);if(!U.ok)throw Error(`Failed to fetch icons for ${G}: ${U.statusText}`);return await U.json()}function j(G,z=24,M=24){return{body:G.body,width:G.width||z,height:G.height||M,viewBox:`0 0 ${G.width||z} ${G.height||M}`}}function F(G,z){let M=V(G);return`import type { IconData } from '@stacksjs/iconify-core'
|
|
3
3
|
|
|
4
4
|
export const ${M}: IconData = ${JSON.stringify(z,null,2)}
|
|
5
5
|
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ii as a,Ji as b}from"./chunk-dtdwjpvf.js";import"./chunk-ra1s4s6b.js";import"./chunk-degz74nv.js";import"./chunk-t23kccpz.js";import"./chunk-qjvny3wf.js";import"./chunk-3ssjb8cx.js";import"./chunk-ykevda74.js";import"./chunk-ez003q74.js";import"./chunk-kyyt9xhs.js";import"./chunk-tf16jtj4.js";import"./chunk-19m7hed6.js";import"./chunk-kjd9hbg4.js";import"./chunk-ejwfnttb.js";import"./chunk-5270fyk7.js";import"./chunk-q4kgqqed.js";import"./chunk-1nnza3m6.js";import"./chunk-hkrzv980.js";import"./chunk-qbz6yn8c.js";import"./chunk-czj6nq0b.js";import"./chunk-zxfejz72.js";import"./chunk-mere396d.js";import"./chunk-aa8015mk.js";import"./chunk-trva71am.js";import"./chunk-rtfwn4cm.js";import"./chunk-emjmshj8.js";export{a as getStoreScript,b as clearStoreCache};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
3
|
-
export{Q as
|
|
2
|
+
import{xg as I}from"./chunk-0knxnyq6.js";import{wr as H}from"./chunk-3ssjb8cx.js";import{Rw as G}from"./chunk-emjmshj8.js";import L from"path";async function Q(k={}){let J=performance.now(),A=k.root||process.cwd(),j=await H(A),B=k.ssr?.routeRules??j.routeRules??{};if(I(B),!j.ssr&&Object.keys(B).length)throw Error("routeRules require ssr: true and the production server; flat SSG output cannot apply request/cache policies");if(!j.ssr&&(k.ssr?.serverApi??j.serverApi))throw Error("serverApi requires ssr: true; flat SSG output cannot execute API endpoints");let q=j.ssr?"ssr":"ssg";console.log(`[stx build] Mode: ${q.toUpperCase()}${j.ssr?" (ssr: true in stx.config.ts)":" (default \u2014 ssr is false)"}`);let D,E;if(q==="ssg"){let{generateStaticSite:z}=await import("./ssg.js");D=await z({pagesDir:L.join(j.root||".",j.pagesDir||j.build?.pagesDir||"pages"),publicDir:j.publicDir||j.build?.publicDir||"public",outputDir:j.build?.outputDir||"dist",generate404:j.build?.generate404??!0,minify:j.build?.minify??!0,cleanOutput:j.build?.cleanOutput??!0,router:j.router,...k.ssg})}else{let{buildForProduction:z}=await import("./chunk-jwmact5f.js");E=await z({root:A,outputDir:".output",debug:k.debug,...k.ssr})}let K=Math.round(performance.now()-J);return{mode:q,ssg:D,ssr:E,duration:K}}
|
|
3
|
+
export{Q as Ve};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Kj as b,Lj as c,Mj as d,Nj as e,Oj as f,Pj as g,Qj as h,Rj as i,Sj as j,Tj as k,Uj as l,Vj as m,Wj as n,Xj as o}from"./chunk-3kd0zn9c.js";import{ul as a}from"./chunk-qjvny3wf.js";import"./chunk-3ssjb8cx.js";import"./chunk-ykevda74.js";import"./chunk-ez003q74.js";import"./chunk-kyyt9xhs.js";import"./chunk-tf16jtj4.js";import"./chunk-19m7hed6.js";import"./chunk-kjd9hbg4.js";import"./chunk-ejwfnttb.js";import"./chunk-5270fyk7.js";import"./chunk-q4kgqqed.js";import"./chunk-1nnza3m6.js";import"./chunk-hkrzv980.js";import"./chunk-qbz6yn8c.js";import"./chunk-czj6nq0b.js";import"./chunk-zxfejz72.js";import"./chunk-mere396d.js";import"./chunk-aa8015mk.js";import"./chunk-trva71am.js";import"./chunk-rtfwn4cm.js";import"./chunk-emjmshj8.js";export{b as templateCache,j as registerServeModuleBundle,c as readFileCached,e as invalidateFileCacheByDir,d as invalidateFileCache,o as hashFilePath,k as getServeModuleBundle,i as getServeClientAsset,g as getCachedSignalsRuntime,h as getCachedRouterScript,l as clearDevCaches,m as checkCache,n as cacheTemplate,a as cacheEngineFingerprint,f as __setSignalsGeneratorsForTest};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Ht as a,It as b,Jt as c,Kt as d,Lt as e,Mt as f,Nt as g}from"./chunk-1nnza3m6.js";import"./chunk-emjmshj8.js";export{a as withRuntimeConfig,c as useServerRuntimeConfig,d as useRuntimeConfig,f as runtimeConfigTag,e as resolveRuntimeConfig,g as injectRuntimeConfig,b as currentRuntimeConfig};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{li as a,mi as b,ni as c,oi as d,pi as e,qi as f}from"./chunk-y4nzmkea.js";import"./chunk-emjmshj8.js";export{c as processTransitionDirectives,f as processTransitionAttributes,b as performLeave,a as performEnter,e as generateTransitionRuntime,d as generateTransitionCSS};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$e as
|
|
2
|
+
import{$e as b,_e as a,af as c,bf as d,cf as e,df as f,ef as g,ff as h,gf as i,hf as j,if as k,jf as l,kf as m,lf as n,mf as o}from"./chunk-n0d7nwhd.js";import"./chunk-emjmshj8.js";export{k as writeNetlifyConfig,n as initNetlify,l as hasNetlifyConfig,g as getTotalSize,h as generateNetlifyToml,f as formatSize,e as filterRequiredFiles,i as detectProjectConfig,m as deploy,a as createNetlifyClient,d as createFileManifest,j as createDefaultNetlifyConfig,c as collectDeployFiles,b as calculateSha1,o as DeployError};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{am as c,dm as d,em as e,fm as f,gm as g,hm as h,im as i,jm as j,km as k,lm as l,mm as m,nm as n}from"./chunk-3ssjb8cx.js";import"./chunk-ykevda74.js";import"./chunk-ez003q74.js";import{os as a,ps as b}from"./chunk-kyyt9xhs.js";import"./chunk-tf16jtj4.js";import"./chunk-19m7hed6.js";import"./chunk-kjd9hbg4.js";import"./chunk-ejwfnttb.js";import"./chunk-5270fyk7.js";import"./chunk-q4kgqqed.js";import"./chunk-1nnza3m6.js";import"./chunk-hkrzv980.js";import"./chunk-qbz6yn8c.js";import"./chunk-czj6nq0b.js";import"./chunk-zxfejz72.js";import"./chunk-mere396d.js";import"./chunk-aa8015mk.js";import"./chunk-trva71am.js";import"./chunk-rtfwn4cm.js";import"./chunk-emjmshj8.js";export{h as transformAutoImports,b as stripCommentsAndLiterals,e as renderVendorStyleTags,i as referencesName,n as processClientScript,g as injectBrowserCoreAutoImports,m as generateServerDataBridge,k as generateBrowserAutoImportDestructuring,j as generateAutoImportDestructuring,a as findInterpolationEnd,l as extractBridgeData,d as extractAndStripCssImports,f as STX_AUTO_IMPORTS,c as BROWSER_CORE_IMPORTS};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import F from"fs";import y from"path";var U=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useModel)\s*(?:<[^<>()]*>)?\s*\(/,g=/(?:^|\n)\s*(?:import|export)\s+(?:[^'"]*?\sfrom\s+)?['"](\.[^'"]*)['"]/g,D=["",".ts",".tsx",".js",".jsx",".mts",".mjs","/index.ts","/index.js"],H=3;function k(j,q){let J=y.resolve(y.dirname(q),j);for(let Q of D){let z=J+Q;try{if(F.statSync(z).isFile())return z}catch{}}return null}function K(j,q,J=0,Q=new Set){if(!q||J>=H)return!1;for(let z of j.matchAll(g)){let Z=k(z[1],q);if(!Z||Q.has(Z))continue;Q.add(Z);let $;try{$=F.readFileSync(Z,"utf8")}catch{continue}if(U.test($))return!0;if(K($,Z,J+1,Q))return!0}return!1}var Y=["batch","clearServerData","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","useDocumentVisibility","useEventListener","useFetch","useFocus","useHead","useId","useInterval","useLocalStorage","useMediaQuery","useModel","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"],d=["onMount","onDestroy"];function p(j="const",q=[],J){let Q=q.length?Y.filter((z)=>!q.includes(z)):Y;if(J!==void 0)Q=Q.filter((z)=>{let Z=z.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(^|[^\\w$])${Z}(?![\\w$])`).test(J)});return`${j} { ${Q.join(", ")} } = window.stx;`}var x=["defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","withDefaults"],T={useServerData:{category:"server-only",reason:"loads and serializes request-scoped data from <script server>; clients consume it through a keyed useFetch/useAsyncData."},redirect:{category:"server-only",reason:"returns an HTTP Response for <script server>/edge/build; use navigate() on the client."},useAsyncData:{category:"browser-composable",reason:"inlined on demand from src/composables when a script references it; reachable, not a bare global."},Teleport:{category:"compile-time-directive",reason:"template tag resolved by processTeleportDirectives; not a script callable."},StxModalBuiltin:{category:"builtin-component",reason:"builtin component used as a template tag; drive open/close from the modal store."},StxToastBuiltin:{category:"builtin-component",reason:"builtin component used as a template tag; push toasts via the toast store."},useForm:{category:"browser-composable",reason:"reactive form primitive; lives in src/composables/use-form.ts and is inlined on demand when a <script client> references it (#1846)."},defineForm:{category:"browser-composable",reason:"deprecated alias of useForm, kept for a minor (#1843). Same delivery path \u2014 inlined on demand from src/composables/use-form.ts."},validateFields:{category:"isomorphic-import",reason:"pure validation helper; import it directly, not auto-delivered to <script client> (per client-api-delivery.test.ts)."},validateField:{category:"isomorphic-import",reason:"singular pure validation helper; same explicit-import boundary as validateFields."}},O=Y.filter((j)=>!x.includes(j));function P(j){if(!j)return!1;return O.some((q)=>new RegExp(`\\b${q}\\s*(?:<[^>]*>)?\\s*\\(`).test(j))}var C=[/@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/],u=/\s@[a-z][\w.:-]*\s*=/i;function _(j,q){if(!j)return!1;let J=X(j);return G(J,q)}function G(j,q){if(C.some((J)=>J.test(j)))return!0;if(P(j))return!0;return M(j,q)}function M(j,q){if(!q)return!1;for(let J of j.matchAll(/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script\s*>/gi))if(K(J[1],q))return!0;return!1}function E(j,q){if(!j)return!1;let J=X(j);return u.test(J)||G(J,q)}var b=["if","else-if","elseif","else","for","show","key","text","html","model","ref"];function c(j){return b.includes(j.toLowerCase())}var V=["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"],f=["x-init","x-transition","x-effect","x-on"],r=[...V,...f];function h(){return`{${V.map((j)=>`'${j}':1`).join(",")}}`}var L=["class","style","text","html","show","model","if","ref"];function o(){return`{${L.map((j)=>j==="if"?"'if':1":`${j}:1`).join(",")}}`}var B=["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","keydown","keyup","keypress","input","change","submit","focus","blur","scroll","resize","touchstart","touchend","touchmove","contextmenu","wheel","pointerdown","pointerup","pointermove"];function i(){return`/^(${B.join("|")})/`}function s(j){return B.some((q)=>j===q||j.startsWith(`${q}.`))}var S=65536,v=4,w=new Map;function m(){w.clear()}function X(j){if(!j)return j;if(!j.includes("<!--")&&!/<(?:pre|code)\b/i.test(j))return j;let q=j.length>=S;if(q){let z=w.get(j);if(z!==void 0)return z}let J=(z)=>z.replace(/(<[^>]*>)|([^<]+)/g,(Z,$,W)=>$??" ".repeat(W.length)),Q=j.replace(/(<pre\b[^>]*>)([\s\S]*?)(<\/pre>)/gi,(z,Z,$,W)=>Z+J($)+W).replace(/(<code\b[^>]*>)([\s\S]*?)(<\/code>)/gi,(z,Z,$,W)=>Z+J($)+W).replace(/<!--[\s\S]*?-->/g,(z)=>" ".repeat(z.length));if(q){while(w.size>=v){let z=w.keys().next();if(z.done)break;w.delete(z.value)}w.set(j,Q)}return Q}
|
|
3
|
-
export{K as
|
|
3
|
+
export{K as yv,Y as zv,d as Av,p as Bv,x as Cv,T as Dv,O as Ev,P as Fv,_ as Gv,E as Hv,b as Iv,c as Jv,V as Kv,f as Lv,r as Mv,h as Nv,L as Ov,o as Pv,B as Qv,i as Rv,s as Sv,m as Tv,X as Uv};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$g as
|
|
2
|
+
import{$g as b,_g as a,ah as c,bh as d,ch as e,dh as f,eh as g,fh as h,gh as i,hh as j,ih as k}from"./chunk-n1y0hjk1.js";import"./chunk-bcpjhcpn.js";import"./chunk-emjmshj8.js";export{c as setCachedVideoResult,k as processVideo,b as getCachedVideoResult,f as generateThumbnails,g as generateSpriteSheet,e as generatePoster,h as generateHLSManifest,i as generateDASHManifest,d as clearVideoCache,j as analyzeVideo,a as VideoProcessorCache};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{no as a,oo as b,po as c,qo as d,ro as e,so as f,to as g,uo as h,vo as i,wo as j,xo as k,yo as l,zo as m}from"./chunk-3ssjb8cx.js";import"./chunk-ykevda74.js";import"./chunk-ez003q74.js";import"./chunk-kyyt9xhs.js";import"./chunk-tf16jtj4.js";import"./chunk-19m7hed6.js";import"./chunk-kjd9hbg4.js";import"./chunk-ejwfnttb.js";import"./chunk-5270fyk7.js";import"./chunk-q4kgqqed.js";import"./chunk-1nnza3m6.js";import"./chunk-hkrzv980.js";import"./chunk-qbz6yn8c.js";import"./chunk-czj6nq0b.js";import"./chunk-zxfejz72.js";import"./chunk-mere396d.js";import"./chunk-aa8015mk.js";import"./chunk-trva71am.js";import"./chunk-rtfwn4cm.js";import"./chunk-emjmshj8.js";export{m as stripStxRuntimeImports,b as scanScriptTags,l as rewriteStxImportSpecifiers,j as processSignals,h as processScriptSetup,f as preEvalLiteralReactiveIfs,c as parseLoopExpression,d as hasSignalsSyntax,k as findMarkupIndexOutsideScripts,i as extractExports,g as convertSignalLoopsToAttributes,e as convertSignalDirectivesToAttributes,a as clearScriptScanCache};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Ow as W,Pw as k,Qw as G}from"./chunk-emjmshj8.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({
|
|
@@ -1191,4 +1191,4 @@ if ('serviceWorker' in navigator) {
|
|
|
1191
1191
|
});
|
|
1192
1192
|
}
|
|
1193
1193
|
</script>`}function Vj(){return'<link rel="manifest" href="/manifest.json">'}function Aj(j){return`<meta name="theme-color" content="${N(j)}">`}function N(j){return j.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}
|
|
1194
|
-
export{U as
|
|
1194
|
+
export{U as Lk,J as Mk,E as Nk,F as Ok,w as Pk,z as Qk,y as Rk,qj as Sk,H as Tk,I as Uk,Lj as Vk,Uj as Wk,Vj as Xk,Aj as Yk};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{ds as Q}from"./chunk-ykevda74.js";import"./chunk-ez003q74.js";import{rt as R}from"./chunk-ejwfnttb.js";import"./chunk-czj6nq0b.js";import"./chunk-emjmshj8.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,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Ai as e,wi as a,xi as b,yi as c,zi as d}from"./chunk-c79nfdyj.js";import"./chunk-emjmshj8.js";export{a as processAsyncDirectives,c as isAsyncComponent,e as generateAsyncComponentRuntime,d as generateAsyncComponentCSS,b as defineAsyncComponent};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import{createHash as Y}from"crypto";import{readFile as M,stat as w}from"fs/promises";async function G(q){try{let z=await M(q);return Y("sha256").update(z).digest("hex").slice(0,16)}catch{return""}}function u(q){return Y("sha256").update(q).digest("hex").slice(0,16)}function $(q){return Y("sha256").update(q).digest("hex").slice(0,16)}function X(q,z){let B=JSON.stringify(z,Object.keys(z).sort());return`${$(q)}-${$(B)}`}async function Z(q){try{return(await w(q)).mtimeMs}catch{return 0}}async function b(q){try{return await w(q),!0}catch{return!1}}import{mkdir as S,readFile as V,writeFile as E,readdir as A,rm as _,stat as j}from"fs/promises";import{join as U,dirname as x}from"path";var R=new Map,W={enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500};async function F(q){try{await S(q,{recursive:!0})}catch{}}function K(q,z,B){return U(q,B,`${z}.json`)}async function v(q,z,B){if((Date.now()-q.createdAt)/86400000>B)return!1;if(await Z(z)!==q.srcMtime)return!1;return!0}async function g(q,z,B,J=W){if(!J.enabled)return null;let I=X(q,z),L=R.get(I);if(L){if(await v(L,q,J.maxAge))return L.lastAccessedAt=Date.now(),L.data;R.delete(I)}let Q=K(J.directory,I,B);if(await b(Q))try{let N=await V(Q,"utf-8"),O=JSON.parse(N);if(await v(O,q,J.maxAge))return O.lastAccessedAt=Date.now(),R.set(I,O),O.data}catch{}return null}async function l(q,z,B,J,I=W){if(!I.enabled)return;let L=X(q,z),Q=await G(q),N=await Z(q),O={key:L,src:q,srcHash:Q,srcMtime:N,optionsHash:X("",z),data:B,createdAt:Date.now(),lastAccessedAt:Date.now()};R.set(L,O);let T=K(I.directory,L,J);try{await F(x(T)),await E(T,JSON.stringify(O,null,2))}catch(H){console.warn(`[stx-media] Failed to write cache: ${H}`)}}async function m(q,z=W){if(q==="all")R.clear();else R.clear();let B=q==="all"?["image","video"]:[q];for(let J of B){let I=U(z.directory,J);try{await _(I,{recursive:!0,force:!0})}catch{}}}async function y(q=W){let z={memoryEntries:R.size,diskEntries:{image:0,video:0},totalSizeMB:0};for(let B of["image","video"]){let J=U(q.directory,B);try{let I=await A(J);z.diskEntries[B]=I.length;for(let L of I){let Q=U(J,L),N=await j(Q);z.totalSizeMB+=N.size/1048576}}catch{}}return z}async function f(q=W){let z=0,B=q.maxAge*24*60*60*1000;for(let J of["image","video"]){let I=U(q.directory,J);try{let L=await A(I);for(let Q of L){let N=U(I,Q);try{let O=await V(N,"utf-8"),T=JSON.parse(O);if(Date.now()-T.createdAt>B)await _(N),R.delete(T.key),z++}catch{await _(N).catch(()=>{}),z++}}}catch{}}return z}
|
|
3
|
-
export{G as
|
|
3
|
+
export{G as jh,u as kh,$ as lh,X as mh,Z as nh,b as oh,g as ph,l as qh,m as rh,y as sh,f as th};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{a as N,c as R,e as W,g as j,i as H,k as J}from"./chunk-0y46fbkx.js";import{l as k,m as w,n as B}from"./chunk-q9n5swx7.js";import"./chunk-
|
|
2
|
+
import{a as N,c as R,e as W,g as j,i as H,k as J}from"./chunk-0y46fbkx.js";import{l as k,m as w,n as B}from"./chunk-q9n5swx7.js";import"./chunk-emjmshj8.js";import E from"fs";import K from"path";var V=[];function _(U){V=[];for(let A of U.storyFiles)if(V.push({text:A.fileName.toLowerCase(),original:A.fileName,type:"story",storyId:A.id}),V.push({text:A.relativePath.toLowerCase(),original:A.relativePath,type:"story",storyId:A.id}),A.story)for(let z of A.story.variants)V.push({text:z.title.toLowerCase(),original:z.title,type:"story",storyId:A.id,variantId:z.id})}function $(){return JSON.stringify(V)}async function O(U={}){let A=Date.now();N();let z=await k({mode:"build"});if(!z.config.enabled){W("Story feature is disabled in config.");return}let P=await H(z);w(z,P);let Y=J(z.config,P);B(z,Y),R(P.length);let X=U.outDir??z.config.outDir,Q=K.resolve(z.root,X);await E.promises.mkdir(Q,{recursive:!0}),console.log(` Building to ${X}...`);let M=F(z);await E.promises.writeFile(K.join(Q,"index.html"),M);let v={files:P.map((G)=>({id:G.id,fileName:G.fileName,relativePath:G.relativePath,treePath:G.treePath})),tree:Y};await E.promises.writeFile(K.join(Q,"stories.json"),JSON.stringify(v,null,2));let L={theme:z.config.theme,responsivePresets:z.config.responsivePresets,backgroundPresets:z.config.backgroundPresets};await E.promises.writeFile(K.join(Q,"config.json"),JSON.stringify(L,null,2));let Z=K.join(Q,"stories");await E.promises.mkdir(Z,{recursive:!0});for(let G of P){let g=await E.promises.readFile(G.path,"utf-8");await E.promises.writeFile(K.join(Z,`${G.id}.stx`),g)}_(z);let T=$();await E.promises.writeFile(K.join(Q,"search-index.json"),T);let C=Date.now()-A;j(P.length,X,C)}function F(U){let{theme:A}=U.config,z=A.title||"STX Story";return`<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8">
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ur as a,vr as b,wr as c,xr as d,yr as e,zr as f}from"./chunk-3ssjb8cx.js";import"./chunk-ykevda74.js";import"./chunk-ez003q74.js";import"./chunk-kyyt9xhs.js";import"./chunk-tf16jtj4.js";import"./chunk-19m7hed6.js";import"./chunk-kjd9hbg4.js";import"./chunk-ejwfnttb.js";import"./chunk-5270fyk7.js";import"./chunk-q4kgqqed.js";import"./chunk-1nnza3m6.js";import"./chunk-hkrzv980.js";import"./chunk-qbz6yn8c.js";import"./chunk-czj6nq0b.js";import"./chunk-zxfejz72.js";import"./chunk-mere396d.js";import"./chunk-aa8015mk.js";import"./chunk-trva71am.js";import"./chunk-rtfwn4cm.js";import"./chunk-emjmshj8.js";export{f as validateConfig,b as resolveStxDirectories,c as loadStxConfig,e as defineStxConfig,a as defaultConfig,d as config};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{go as b,ho as c,io as d}from"./chunk-3ssjb8cx.js";import"./chunk-ykevda74.js";import"./chunk-ez003q74.js";import"./chunk-kyyt9xhs.js";import"./chunk-tf16jtj4.js";import"./chunk-19m7hed6.js";import"./chunk-kjd9hbg4.js";import"./chunk-ejwfnttb.js";import"./chunk-5270fyk7.js";import"./chunk-q4kgqqed.js";import"./chunk-1nnza3m6.js";import"./chunk-hkrzv980.js";import"./chunk-qbz6yn8c.js";import{qv as a}from"./chunk-czj6nq0b.js";import"./chunk-zxfejz72.js";import"./chunk-mere396d.js";import"./chunk-aa8015mk.js";import"./chunk-trva71am.js";import"./chunk-rtfwn4cm.js";import"./chunk-emjmshj8.js";export{b as rendersAsElement,c as processESImports,d as processComponents,a as freeIdentifiers};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Rw as z}from"./chunk-emjmshj8.js";var Vq={1001:{message:"Unclosed directive: {{directive}}",help:"Make sure to close the directive with the appropriate end tag"},1002:{message:"Unclosed expression at position {{position}}",help:"Check for missing closing braces }}"},1003:{message:"Invalid directive syntax: {{directive}}",help:"Review the directive documentation for correct syntax"},1004:{message:"Malformed expression: {{expression}}",help:"Check for syntax errors in your expression"},1005:{message:"Unexpected token: {{token}}",help:"Remove or fix the unexpected token"},1101:{message:"Undefined variable: {{variable}}",help:"Make sure the variable is defined in the template context"},1102:{message:"Type error: {{details}}",help:"Check that you are using the correct types"},1103:{message:"Evaluation error: {{details}}",help:"Review the expression for errors"},1104:{message:"Infinite loop detected in {{location}}",help:"Check your loop conditions"},1105:{message:"Circular reference detected: {{path}}",help:"Remove the circular dependency"},1201:{message:"Unsafe expression blocked: {{expression}}",help:"This expression contains potentially dangerous code"},1202:{message:"Path traversal attempt blocked: {{path}}",help:"Use only relative paths within allowed directories"},1203:{message:"Potential XSS attempt blocked",help:"Sanitize user input before rendering"},1204:{message:"Code injection attempt blocked: {{code}}",help:"Avoid executing dynamic code"},1205:{message:"Prohibited DOM API usage: {{api}}",help:"Use STX.useRefs(), STX.useRef(), STX.el() and other STX helpers instead of direct DOM manipulation"},1301:{message:"File not found: {{path}}",help:"Check that the file exists and the path is correct"},1302:{message:"Error reading file: {{path}}",help:"Check file permissions and encoding"},1303:{message:"Invalid file path: {{path}}",help:"Use a valid file path"},1304:{message:"Permission denied: {{path}}",help:"Check file permissions"},1401:{message:"Invalid configuration: {{details}}",help:"Review your stx.config.ts file"},1402:{message:"Missing required configuration: {{key}}",help:"Add the required configuration option"},1403:{message:"Deprecated configuration: {{key}}",help:"Update to the new configuration format"},1501:{message:"Component not found: {{name}}",help:"Check that the component exists in your components directory"},1502:{message:"Invalid props for component {{name}}: {{details}}",help:"Check the component prop requirements"},1503:{message:"Error rendering component {{name}}: {{details}}",help:"Check the component template for errors"},1601:{message:"Filter not found: {{filter}}",help:"Register the filter or check the filter name"},1602:{message:"Invalid arguments for filter {{filter}}: {{details}}",help:"Check the filter documentation for correct arguments"},1603:{message:"Expression evaluation timed out",help:"Simplify the expression or increase the timeout"}},L={},u="en";function Gq(q){u=q}function Bq(){return u}function Hq(q){L={...L,...q}}function Wq(){L={}}function f(q,J={}){let Q=L[q]||Vq[q]||{message:`Unknown error (code: ${q})`},Z=Q.message,$=Q.help;for(let[X,V]of Object.entries(J)){let Y=`{{${X}}}`;if(Z=Z.replace(new RegExp(Y,"g"),V),$)$=$.replace(new RegExp(Y,"g"),V)}return{message:Z,help:$}}function Mq(q,J={}){let{message:Q,help:Z}=f(q,J);return Z?`${Q}
|
|
3
3
|
Help: ${Z}`:Q}var w={UNCLOSED_DIRECTIVE:1001,UNCLOSED_EXPRESSION:1002,INVALID_DIRECTIVE_SYNTAX:1003,MALFORMED_EXPRESSION:1004,UNEXPECTED_TOKEN:1005,UNDEFINED_VARIABLE:1101,TYPE_ERROR:1102,EVALUATION_ERROR:1103,INFINITE_LOOP:1104,CIRCULAR_REFERENCE:1105,UNSAFE_EXPRESSION:1201,PATH_TRAVERSAL:1202,XSS_ATTEMPT:1203,CODE_INJECTION:1204,DOM_API_VIOLATION:1205,FILE_NOT_FOUND:1301,FILE_READ_ERROR:1302,INVALID_FILE_PATH:1303,PERMISSION_DENIED:1304,INVALID_CONFIG:1401,MISSING_REQUIRED_CONFIG:1402,DEPRECATED_CONFIG:1403,COMPONENT_NOT_FOUND:1501,INVALID_PROPS:1502,COMPONENT_RENDER_ERROR:1503,FILTER_NOT_FOUND:1601,INVALID_FILTER_ARGS:1602,EXPRESSION_TIMEOUT:1603};function S(q){for(let[J,Q]of Object.entries(w))if(Q===q)return J;return}function Iq(){return!1}function k(){return!Iq()||process.env.STX_DEBUG==="true"}function aq(){return!1}import wq from"path";var x={showRelativePaths:!1,enableAutoRecovery:k(),logRecoveryWarnings:!0},D={...x};function Fq(q){D={...D,...q}}function _(){return{...D}}function jq(){D={...x}}function N(q){if(!D.showRelativePaths||!q)return q;let J=D.baseDir||process.cwd();try{let Q=wq.relative(J,q);return Q.startsWith("..")?q:Q}catch{return q}}class U extends Error{code;filePath;line;column;context;numericCode;constructor(q,J,Q,Z,$,X,V){super(q);this.code=J;this.filePath=Q;this.line=Z;this.column=$;this.context=X;if(this.name="StxError",this.numericCode=V||w.EVALUATION_ERROR,this.filePath)this.filePath=N(this.filePath)}}class m extends U{constructor(q,J,Q,Z,$,X){super(q,"stx_SYNTAX_ERROR",J,Q,Z,$,X||w.INVALID_DIRECTIVE_SYNTAX);this.name="StxSyntaxError"}}class c extends U{constructor(q,J,Q,Z,$,X){super(q,"stx_RUNTIME_ERROR",J,Q,Z,$,X||w.EVALUATION_ERROR);this.name="StxRuntimeError"}}class d extends U{constructor(q,J,Q,Z,$,X){super(q,"stx_SECURITY_ERROR",J,Q,Z,$,X||w.UNSAFE_EXPRESSION);this.name="StxSecurityError"}}class p extends U{constructor(q,J,Q,Z,$,X){super(q,"stx_FILE_ERROR",J,Q,Z,$,X||w.FILE_NOT_FOUND);this.name="StxFileError"}}class l extends U{isFatal=!0;constructor(q,J,Q,Z,$,X){super(q,"stx_VALIDATION_ERROR",J,Q,Z,$,X||w.DOM_API_VIOLATION);this.name="StxValidationError"}}function P(q){let{type:J,message:Q,code:Z,filePath:$,line:X,column:V,template:Y,offset:B,snippet:G,suggestion:H,format:W="text"}=q,M=X,I=V;if(!M&&Y&&B!==void 0){let y=s(Y,B);M=y.line,I=y.column}let j=$?N($):void 0,Yq=Z?S(Z):void 0,K={type:J,code:Z,codeName:Yq,message:Q,filePath:j,line:M,column:I,snippet:G,suggestion:H,timestamp:new Date().toISOString()},O;switch(W){case"html":O=Dq(K);break;case"json":O=JSON.stringify(K,null,2);break;case"console":O=Kq(K,Y,B);break;case"text":default:O=Uq(K,Y,B);break}return{formatted:O,data:K}}function Uq(q,J,Q){let Z=[],$=q.code?` [${q.codeName||q.code}]`:"";if(Z.push(`[${q.type} Error${$}]`),q.filePath){let X=q.filePath;if(q.line){if(X+=`:${q.line}`,q.column)X+=`:${q.column}`}Z.push(`at ${X}`)}if(Z.push(`
|
|
4
4
|
${q.message}`),J&&q.line){let X=Oq(J,q.line,2);if(X)Z.push(`
|
|
5
5
|
${X}`)}if(q.snippet)Z.push(`
|
|
@@ -44,4 +44,4 @@ catch (e) {
|
|
|
44
44
|
throw e;
|
|
45
45
|
}
|
|
46
46
|
`;return nq(Z?(G)=>{let H=a([b,...X,...G],Y);return(...W)=>H($q,...W)}:(G)=>a([...X,...G],Y),X,J,$,V)}function nq(q,J,Q,Z,$){let X=q([]),V=Z.every((B,G)=>B.index===G);if(J.length===Q.length&&V)return t(X,J,q);return t((...B)=>{let G=Array($.length);for(let H=0;H<$.length;H++)G[H]=B[$[H]];return X(...G)},J,q,(B)=>{X=q(B)})}function t(q,J,Q,Z){let X=/^(\w+) is not defined$/,V=q,Y=[],B=new Set(J);return(...G)=>{for(let H=0;H<=8;H++)try{return V(...G)}catch(W){let M=W instanceof Error?W.message:"",I=X.exec(M);if(!(W instanceof ReferenceError)||!I)return;let j=I[1];if(B.has(j)||Xq.has(j))return;if(B.add(j),Y.push(j),Z)Z(Y);else V=Q(Y)}return}}function LJ(q){let J=q.trim(),Q=[/\beval\s*\(/i,/\bFunction\s*\(/i,/\bimport\s*\(/i,/\brequire\s*\(/i,/\bprocess\b/i,/\b__proto__\b/i,/\bconstructor\s*[.(]/i,/\bglobalThis\b/i,/\bwindow\b/i,/\bdocument\b/i,/\bfetch\s*\(/i,/\bBun\b/i,/\bDeno\b/i,/\bconsole\b/i,/\bthis\b/i,/\bReflect\b/i,/\bProxy\b/i,/\bprototype\b/i,/\.(bind|call|apply)\s*\(/i];for(let Z of Q)if(Z.test(J))return!1;return!0}
|
|
47
|
-
export{Gq as
|
|
47
|
+
export{Gq as Bu,Bq as Cu,Hq as Du,Wq as Eu,f as Fu,Mq as Gu,w as Hu,S as Iu,Iq as Ju,k as Ku,aq as Lu,Fq as Mu,_ as Nu,jq as Ou,N as Pu,U as Qu,m as Ru,c as Su,d as Tu,p as Uu,l as Vu,P as Wu,zq as Xu,Lq as Yu,_q as Zu,Nq as _u,Tq as $u,Aq as av,C as bv,Rq as cv,bq as dv,v as ev,T as fv,Pq as gv,Cq as hv,gq as iv,r as jv,KJ as kv,cq as lv,dq as mv,pq as nv,OJ as ov,kJ as pv,zJ as qv,sq as rv,rq as sv,LJ as tv};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-emjmshj8.js";var Z=0;function $(){return`eb-${++Z}-${Date.now().toString(36)}`}var U=/<!--stx-render-failed:([a-z-]+)-->/g;function w(q){return q.replace(U,"")}function O(q,z={},J){let j=/@errorBoundary(?:\s*\(([^)]*)\))?\s*([\s\S]*?)@fallback\s*([\s\S]*?)@enderrorBoundary/gi;return q.replace(j,(Q,P,T,W)=>{let X=$(),Y=C(P||"");return G(X,T.trim(),W.trim(),Y)})}function C(q){let z={},J=/(\w+)\s*:\s*(?:'([^']*)'|"([^"]*)"|(\w+))/g,j;while((j=J.exec(q))!==null){let Q=j[1],P=j[2]||j[3]||j[4];switch(Q){case"id":z.id=P;break;case"logErrors":z.logErrors=P==="true";break}}return z}function G(q,z,J,j){let Q=j.logErrors!==!1,P=U.test(z);U.lastIndex=0;let T=P?` <div class="stx-error-boundary-fallback" data-boundary-fallback="${q}">
|
|
3
3
|
${J}
|
|
4
4
|
</div>`:` <div class="stx-error-boundary-content" data-boundary-content="${q}">
|
|
5
5
|
${w(z)}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{tl as QJ}from"./chunk-t23kccpz.js";import{ul as WJ}from"./chunk-qjvny3wf.js";import{bm as GJ,wr as XJ,xr as qJ}from"./chunk-3ssjb8cx.js";import{ps as ZJ,qs as $J}from"./chunk-kyyt9xhs.js";import{Js as YJ,Ns as u}from"./chunk-kjd9hbg4.js";import{rt as c}from"./chunk-ejwfnttb.js";import X from"path";import O from"fs";function UJ(J){if(!J||typeof J!=="object")return!1;let K=J;return typeof K.message==="string"&&(K.name==="BuildMessage"||K.name==="ResolveMessage"||("position"in K))}function LJ(J){if(J&&typeof J==="object"&&Array.isArray(J.errors))return J.errors;return[J]}function b(J,K){let $=[];for(let W of LJ(J)){if(UJ(W)){let Y=W.position||void 0;$.push({file:K||Y?.file,line:Y?.line,column:Y?.column,message:W.message??"",lineText:Y?.lineText});continue}$.push({file:K,message:W instanceof Error?W.message:String(W)})}return $}function t(J,K){return b(J,K).map(($)=>{let W=$.file?`${$.file}${$.line?`:${$.line}${$.column?`:${$.column}`:""}`:""}`:"",Y=$.lineText?`
|
|
3
3
|
${$.lineText.trim()}`:"";return W?`${W}: ${$.message}${Y}`:`${$.message}${Y}`}).join(`
|
|
4
4
|
`)}var TJ=9;function P(J,K,$){return/^(?:(?:stx|ui)\.config\.[cm]?[jt]s|runtime-config-(?:server|loader)\.[cm]?[jt]s)$/.test(X.basename(J))||QJ(J,K,$)}var HJ=1,zJ=new Map,f=600,AJ=100,g=new Map;async function MJ(J){let K=g.get(J)??0;if(K>0&&K<AJ){g.set(J,K+1);return}g.set(J,1);try{let $=(await O.promises.readdir(J)).filter((z)=>z.endsWith(".js"));if($.length<=f)return;let Y=(await Promise.all($.map(async(z)=>{try{return{name:z,at:(await O.promises.stat(X.join(J,z))).mtimeMs}}catch{return null}}))).filter((z)=>z!==null);Y.sort((z,H)=>H.at-z.at);for(let z of Y.slice(f)){let H=z.name.slice(0,-3);await O.promises.rm(X.join(J,`${H}.js`),{force:!0}),await O.promises.rm(X.join(J,`${H}.deps.json`),{force:!0})}x("pruned bundle cache to",f,"entries")}catch{}}function nJ(J){return zJ.get(J)??[]}function h(J,K){if(J)zJ.set(J,K)}function CJ(J=process.env){return J.STX_DEBUG==="true"||J.STX_DEBUG==="1"}function x(...J){if(CJ())console.log("[stx:bundler]",...J)}var n=[];function r(J,K,$){n.push({filePath:J||"<inline>",message:K,details:$})}function oJ(){return n.slice()}function lJ(){n.length=0}var p;function dJ(J){p=J}function a(){if(p)return p;try{let J=qJ.strict;return typeof J==="object"&&J!==null?J.bundlerFallback??"warn":"warn"}catch{return"warn"}}var e=[/^stx$/,/^@stacksjs\/stx$/,/^@stores$/,/^stx\/stores$/,/^@composables$/];function sJ(J){let K=/^[ \t]*import[ \t]+(?!type(?:[ \t]|{))[\s\S]*?\s+from\s+['"]([^'"]+)['"][ \t]*;?/gm,$;while(($=K.exec(J))!==null){let Y=$[1];if(!e.some((H)=>H.test(Y)))return x("detected user import:",Y),!0}let W=/^[ \t]*import[ \t]+['"]([^'"]+)['"]/gm;while(($=W.exec(J))!==null){let Y=$[1];if(/\.css(?:\?.*)?$/.test(Y))continue;if(!e.some((H)=>H.test(Y)))return x("detected side-effect import:",Y),!0}return!1}var v="stx-module:",xJ=/\.(?:[cm]?[jt]sx?|json)$/i;function IJ(J,K){return X.relative(J,K).split(X.sep).join("/")}function _J(J,K){if(K.size===0)return J;return J.replace(/^([ \t]*import\s+(?:[^;"']*?\s+from\s+)?)(["'])([^"']+)\2/gm,($,W,Y,z)=>{let H=K.get(z);return H&&!z.startsWith(v)?`${W}${Y}${H}${Y}`:$})}function NJ(J,K){let $=0,W=(z)=>{let H=`__stxMod${$++}`,j=JSON.stringify(z);return K.push(`var ${H} = globalThis.__stxModules && globalThis.__stxModules[${j}];`,`if (${H} === undefined) throw new Error("[stx] module " + ${JSON.stringify(j)} + " is not registered on this page (#1957)");`),H},Y=(z,H)=>{for(let j of z.split(",")){let T=j.trim();if(!T)continue;let Q=T.match(/^("(?:[^"\\]|\\.)*"|[\w$]+)(?:\s+as\s+([\w$]+))?$/);if(!Q)continue;let Z=Q[1].startsWith('"')?JSON.parse(Q[1]):Q[1],G=Q[2]??Z;K.push(`var ${G} = ${H}[${JSON.stringify(Z)}];`)}};return J=J.replace(/^[ \t]*import\s+([^;"']*?)\s+from\s+["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(z,H,j)=>{let T=j.slice(v.length),Q=W(T),Z=H.trim(),G=Z.match(/^([\w$]+)\s*(?:,\s*|$)/);if(G&&!Z.startsWith("{")&&!Z.startsWith("*"))K.push(`var ${G[1]} = ${Q}.default;`),Z=Z.slice(G[0].length).trim();let q=Z.match(/^\*\s*as\s+([\w$]+)$/);if(q)K.push(`var ${q[1]} = ${Q};`);else if(Z.startsWith("{"))Y(Z.replace(/^\{|\}$/g,""),Q);return""}),J=J.replace(/^[ \t]*import\s+["'](stx-module:[^"']+)["'];?[ \t]*$/gm,(z,H)=>{return W(H.slice(v.length)),""}),J}function JJ(J){let K=[J,`${J}.ts`,`${J}.tsx`,`${J}.js`,`${J}.mjs`,`${J}.jsx`,X.join(J,"index.ts"),X.join(J,"index.tsx"),X.join(J,"index.js"),X.join(J,"index.mjs")];for(let $ of K)try{if(O.existsSync($)&&O.statSync($,{throwIfNoEntry:!1})?.isFile())return $}catch{}return}function SJ(J,K,$,W,Y,z=new Map,H){let j=(Q,Z,G)=>{if(P(Z,J,H))return null;if(!Y||Q!==$||!xJ.test(Z))return null;try{if(!O.statSync(Z,{throwIfNoEntry:!1})?.isFile())return null}catch{return null}W.add(Z);let q=`${v}${IJ(process.cwd(),Z)}`;return z.set(G,q),{path:q,external:!0}},T=(Q,Z)=>{let G=Q===$?K:X.dirname(Q),q=X.resolve(G,Z);return JJ(q)??q};return{name:"stx-client-bundle",setup(Q){if(Q.onResolve({filter:/^(stx|@stacksjs\/stx)$/},(Z)=>({path:Z.path,external:!0})),Q.onResolve({filter:/^(@stores|@composables|stx\/stores)$/},(Z)=>({path:Z.path,external:!0})),Q.onResolve({filter:/^\//},(Z)=>{let G=JJ(Z.path);if(G){let q=j(Z.importer,G,Z.path);if(q)return q;if(G!==$)W.add(G);return{path:G}}return{path:Z.path,external:!0}}),Q.onResolve({filter:/^\.\.?\//},(Z)=>{let G=T(Z.importer,Z.path),q=j(Z.importer,G,Z.path);if(q)return q;return W.add(G),{path:G}}),Q.onResolve({filter:/^[@~]\//},(Z)=>{let G=X.resolve(J,Z.path.slice(2)),q=[G,`${G}.ts`,`${G}.tsx`,`${G}.js`,`${G}.mjs`,`${G}.jsx`,X.join(G,"index.ts"),X.join(G,"index.tsx"),X.join(G,"index.js"),X.join(G,"index.mjs")];for(let w of q)if(O.existsSync(w)&&O.statSync(w,{throwIfNoEntry:!1})?.isFile()){let y=j(Z.importer,w,Z.path);if(y)return y;return x(`resolved ${Z.path[0]}/ import:`,Z.path,"\u2192",w),W.add(w),{path:w}}return console.warn(`[stx:bundler] could not resolve ${Z.path[0]}/ import:`,Z.path),{path:G}}),Y)Q.onResolve({filter:/^(?!node:|bun:)(?:@[\w.-]+\/)?[\w.-]/},(Z)=>{if(Z.importer!==$)return;let G=`${v}npm:${Z.path}`;return z.set(Z.path,G),{path:G,external:!0}});Q.onLoad({filter:/\.(?:[cm]?[jt]sx?|json)$/},(Z)=>{if(P(Z.path,J,H))throw Error(`Server-only API source cannot be imported by a client script: ${Z.path}`);let G=X.extname(Z.path).toLowerCase(),q=G===".json"?"json":G===".tsx"?"tsx":G===".jsx"?"jsx":G===".ts"||G===".mts"||G===".cts"?"ts":"js";if(Z.path!==$)W.add(Z.path);return{contents:O.readFileSync(Z.path,"utf8"),loader:q}})}}}var m=new Map,D=YJ(64),KJ=Symbol.for("stx.client-bundle-build-queue");function yJ(J){let K=globalThis,W=(K[KJ]??Promise.resolve()).then(J,J);return K[KJ]=W.then(()=>{return},()=>{return}),W}async function iJ(J,K,$={}){let W=$.projectRoot||process.cwd(),Y=(await XJ(W)).serverApi,z=$.minify??!1,H=$.externalizeUserModules??!0,j=$.cacheDir||c(W,"bundle-cache"),T=new Bun.CryptoHasher("md5");T.update(`${TJ}\x00${WJ()}\x00${JSON.stringify(Y??!1)}\x00${H?"registry":"inline"}\x00${J}\x00${K}`);let Q=T.digest("hex").slice(0,12),Z=X.join(j,`${Q}.js`),G=D.get(Z);if(G){if(u(G.files)&&G.files.every((A)=>!P(A.path,W,Y))){x("memo hit:",Q);let A=G.files.map((M)=>M.path);return h(K,A),$.collectInputs?.push(...A),G.code}D.delete(Z),x("memo invalidated by dep change:",Q)}let q=X.join(j,`${Q}.deps.json`),w=Bun.file(Z);if(await w.exists()){let A=Bun.file(q),M=!1,U=null;if(await A.exists())try{let N=JSON.parse(await A.text());if(N.metadataVersion!==HJ||!Array.isArray(N.files))M=!1;else U=N.files,M=!0;if(U&&(!u(U)||U.some((B)=>P(B.path,W,Y))))M=!1}catch{M=!1}if(M){if(x("cache hit:",Q),U)h(K,U.map((B)=>B.path)),$.collectInputs?.push(...U.map((B)=>B.path));let N=await w.text();if(U)D.set(Z,{code:N,files:U});return N}x("cache invalidated by dep change:",Q)}let y=m.get(Q);if(y){let A=await y;if($.collectInputs)$.collectInputs.push(...(D.get(Z)?.files??[]).map((M)=>M.path));return A}let I=yJ(()=>FJ(J,K,{projectRoot:W,minify:z,cacheDir:j,hash:Q,cachePath:Z,depsPath:q,collectInputs:$.collectInputs,externalizeUserModules:H,serverApi:Y}));m.set(Q,I);try{return await I}finally{m.delete(Q)}}var BJ=0;function RJ(J){return`${J}-${process.pid}-${++BJ}`}async function FJ(J,K,$){let{projectRoot:W,minify:Y,cacheDir:z,hash:H,cachePath:j,depsPath:T,externalizeUserModules:Q}=$,Z=c(W,"bundle-tmp"),G=RJ(H),q=X.join(Z,`${G}.ts`),w=X.join(Z,"out",G);O.mkdirSync(Z,{recursive:!0}),O.mkdirSync(w,{recursive:!0});let y=X.dirname(K),I=new Set,A=/^[ \t]*(export\s+)?(?:const|let|var)\s+(?:\{([^}]+)\}|(\w+))/gm,M=/^[ \t]*(export\s+)?(?:async\s+)?function\s+(\w+)/gm,U=ZJ(J),{depths:N,balanced:B}=$J(U),o=(L)=>!B||N[L]===0,C;while((C=A.exec(U))!==null){if(C[1])continue;if(!o(C.index))continue;if(C[2])C[2].split(",").forEach((L)=>{let k=DJ(L);if(k)I.add(k)});else if(C[3])I.add(C[3])}while((C=M.exec(U))!==null){if(C[1])continue;if(!o(C.index))continue;I.add(C[2])}let VJ=I.size>0?`
|
|
5
5
|
export { ${[...I].join(", ")} }`:"";await Bun.write(q,J+VJ),x("bundling:",H,"from:",X.basename(K));let l=new Set,d=new Map;try{let L=await Bun.build({entrypoints:[q],outdir:w,target:"browser",format:"esm",minify:Y,plugins:[SJ(W,y,q,l,Q,d,$.serverApi)],define:{"process.env.NODE_ENV":Y?'"production"':'"development"',...GJ()},root:W});if(!L.success){let S=L.logs.filter((R)=>R.level==="error").map((R)=>R.message).join(", ")||`Unable to bundle ${X.basename(K)}`,F=b(L.logs,K||void 0);if(console.warn("[stx:bundler] build failed:",S),r(K||"",S,F),a()==="error")throw Error(S);return J}let k="";for(let V of L.outputs){k=await V.text();break}let _=[];for(let V of k.matchAll(/^\s*export\s*\{([^}]*)\}\s*;?\s*$/gm))for(let S of V[1].split(",")){let F=S.trim().match(/^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/);if(F){_.push([F[2],F[1]]);continue}let R=S.trim();if(/^[A-Za-z_$][\w$]*$/.test(R))_.push([R,R])}let s=[];k=NJ(_J(k,d),s);let kJ=k.match(/^\s*import\s+[^;]+;?\s*$/gm)||[];k=k.replace(/^\s*import\s+[^;]+;?\s*$/gm,"").replace(/^\s*export\s*\{[^}]*\}\s*;?\s*$/gm,"").replace(/^\s*export\s+default\s+.*$/gm,"").trim();let i=`__stxBundle_${H}`,jJ=_.map(([V,S])=>`${JSON.stringify(V)}: ${S}`).join(", "),OJ=_.map(([V])=>`var ${V} = undefined;`).join(`
|
|
@@ -14,4 +14,4 @@ ${k}
|
|
|
14
14
|
return { ${jJ} };
|
|
15
15
|
})();
|
|
16
16
|
${wJ}`.trim(),x("bundled:",H,"output:",k.length,"bytes"),I.size>0&&_.length===0)return console.warn(`[stx:bundler] dropped every binding for ${X.basename(K)} (${H}); serving the unbundled source and not caching this result`),J;O.mkdirSync(z,{recursive:!0}),await Bun.write(j,k);let E=Array.from(l).map((V)=>{try{return{path:V,mtimeMs:O.statSync(V).mtimeMs}}catch{return null}}).filter((V)=>V!==null);return await Bun.write(T,JSON.stringify({metadataVersion:HJ,files:E})),h(K,E.map((V)=>V.path)),$.collectInputs?.push(...E.map((V)=>V.path)),D.set(j,{code:k,files:E}),await MJ(z),k}catch(L){let k=b(L,K||void 0),_=t(L,K||void 0);if(console.warn(`[stx:bundler] error: ${_}`),r(K||"",_,k),a()==="error")throw L;return J}finally{try{O.rmSync(q,{force:!0}),O.rmSync(w,{recursive:!0,force:!0})}catch{}}}function DJ(J){let K=J.trim();if(!K)return null;let $=K.indexOf("=");if($!==-1)K=K.slice(0,$).trim();let W=K.indexOf(":");if(W!==-1)K=K.slice(W+1).trim();if(K.startsWith("..."))K=K.slice(3).trim();return/^[A-Za-z_$][\w$]*$/.test(K)?K:null}
|
|
17
|
-
export{t as
|
|
17
|
+
export{t as Zk,nJ as _k,CJ as $k,r as al,oJ as bl,lJ as cl,dJ as dl,a as el,sJ as fl,v as gl,IJ as hl,_J as il,NJ as jl,yJ as kl,iJ as ll,RJ as ml};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Ki as O,Li as w,Mi as Z}from"./chunk-ra1s4s6b.js";import{_k as R,fl as U,ll as T}from"./chunk-degz74nv.js";import{bm as M,eq as k,wr as C,zo as W}from"./chunk-3ssjb8cx.js";import{uv as E,vv as L}from"./chunk-zxfejz72.js";import{zv as B}from"./chunk-aa8015mk.js";import $ from"path";var Y=new Map;function b(Q,z){for(let J of Q.matchAll(/\b(?:const|let|var|function|class)\s+([A-Z_a-z$][\w$]*)/g))if(J[1])z.add(J[1]);for(let J of Q.matchAll(/\b(?:const|let|var)\s*\{([^{}]*)\}\s*=/g))for(let H of(J[1]??"").split(",")){let K=((H.includes(":")?H.split(":").pop():H)??"").replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(K))z.add(K)}for(let J of Q.matchAll(/\b(?:const|let|var)\s*\[([^\]]*)\]\s*=/g))for(let H of(J[1]??"").split(",")){let V=H.replace(/=.*$/s,"").replace(/^\s*\.\.\./,"").trim();if(/^[A-Z_a-z$][\w$]*$/.test(V))z.add(V)}}async function l(Q){let z;if(Q)z=$.resolve(Q);else{let q=await C();z=$.resolve(q.root||process.cwd(),q.storesDir||"stores")}let J=new Bun.Glob("*.ts"),H=[];try{for await(let q of J.scan({cwd:z,absolute:!0})){let y=$.basename(q,".ts");if(["index","types"].includes(y))continue;if(q.includes(".d.ts"))continue;H.push(q)}}catch{return Z(Y,z,"",""),null}let V=()=>[...new Set([...H,...H.flatMap((q)=>R(q))])],K=O(V()),P=w(Y,z,K);if(P!==void 0)return P||null;if(H.length===0)return Z(Y,z,K,""),null;let A=[];for(let q of H){let y=await Bun.file(q).text();A.push({file:q,hasUseStore:/useStore\s*\(/.test(y)})}A.sort((q,y)=>{if(q.hasUseStore===y.hasUseStore)return 0;return q.hasUseStore?1:-1});let N=A.map((q)=>q.file),G=[],X=new Set,F=k({loader:"ts",target:"browser",define:M()});for(let q of N)try{let y=await Bun.file(q).text(),I=$.basename(q,".ts");if(b(y,X),U(y))y=await T(y,q,{projectRoot:process.cwd(),externalizeUserModules:!1});y=W(y),y=E(y),y=L(y),y=y.replace(/^export\s+(default\s+)?/gm,""),y=F.transformSync(y),G.push(`// Store: ${I}
|
|
3
3
|
${y.trim()}`)}catch(y){console.warn(`[stx] Failed to load store ${q}:`,y)}if(G.length===0)return Z(Y,z,K,""),null;let j=G.join(`
|
|
4
4
|
|
|
5
5
|
`),x=`;(function(){
|
|
@@ -8,4 +8,4 @@ ${B.filter((q)=>!X.has(q)&&new RegExp(`\\b${q}\\b`).test(j)).map((q)=>`var ${q}
|
|
|
8
8
|
`)}
|
|
9
9
|
${j}
|
|
10
10
|
})();`;return K=O(V()),Z(Y,z,K,x),x}function a(){Y.clear()}
|
|
11
|
-
export{l as
|
|
11
|
+
export{l as Ii,a as Ji};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Ch as a,Dh as b,Eh as c,Fh as d,Gh as e,Hh as f,Ih as g}from"./chunk-g7bpkpd4.js";import"./chunk-emjmshj8.js";export{d as useVirtualList,b as processVirtualListDirectives,f as processVirtualGridDirectives,e as processInfiniteListDirectives,c as generateVirtualListCSS,g as default,a as createVirtualList};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Ao as x,Io as k,Kp as w,Tl as A,Ul as b,_n as M,an as T,bn as y,lm as B,mo as R,nm as F,ur as P}from"./chunk-3ssjb8cx.js";import{Rw as v}from"./chunk-emjmshj8.js";function j(K){return K.endsWith(".md")||K.endsWith(".markdown")}function C(K){let z=[];_(/<pre\b[^>]*>[\s\S]*?<\/pre>/gi);let G=[...z];_(/<code\b[^>]*>[\s\S]*?<\/code>/gi,G);function _(J,Y){let $;while(($=J.exec(K))!==null){let q=$.index,N=q+$[0].length;if(Y?.some((X)=>q>=X.start&&N<=X.end))continue;z.push({start:q,end:N})}}if(z.length===0)return K;z.sort((J,Y)=>J.start-Y.start);let U="",Q=0;for(let J of z){if(J.start<Q)continue;U+=K.slice(Q,J.start),U+=`@raw${K.slice(J.start,J.end)}@endraw`,Q=J.end}return U+=K.slice(Q),U}async function D(K,z={}){let{data:G,content:_}=A(K),Q=await(z.renderer??((J)=>b(J)))(_);return{html:C(Q),frontmatter:G??{}}}import{dirname as f,resolve as H}from"path";function S(K){let z=K,G=M(K);if(G)z=G.content.trim();let _=/<script\b([^>]*)>([\s\S]*?)<\/script>/gi,U=[],Q=[],J=[],Y=(N)=>/\b(?:state|derived|effect|batch)\s*(?:<[^<>()]*>)?\s*\(/.test(N),$;while(($=_.exec(K))!==null){let N=$[1],X=$[2],E=$[0],Z=N.includes("server");if(Y(X))J.push(E);else if(Z)Q.push(X);else U.push(E)}let q=z;{let N=/<script\b(?![^>]*\b(?:client|type\s*=\s*["']module["']|src\s*=))[^>]*>/gi,X,E=[];while((X=N.exec(q))!==null){let Z=X.index+X[0].length,L=q.indexOf("</script>",Z);if(L===-1)continue;E.push({start:X.index,end:L+9}),N.lastIndex=L+9}for(let Z=E.length-1;Z>=0;Z--)q=q.substring(0,E[Z].start)+q.substring(E[Z].end)}for(let N of U)q=q.replace(N,"");return{templateContent:q,serverScripts:Q,clientScripts:U,signalsScripts:J}}function g(K,z){return`<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8">
|
|
@@ -14,5 +14,5 @@ ${Q.join(`
|
|
|
14
14
|
`)}`}else{if(G.processClientScripts!==!1&&Q.length>0){let N=Y.__stx_event_bindings||[],X=B(Y),Z=(await Promise.all(Q.map(async(I)=>{let W=I.match(/<script\b[^>]*>([\s\S]*?)<\/script>/);if(!W)return I;return await F(W[1],{eventBindings:N,templateContent:q,serverData:X,filePath:z})}))).join(`
|
|
15
15
|
`);if(q.match(/(<\/body>)/i))q=q.replace(/(<\/body>)/i,`${Z}
|
|
16
16
|
$1`);else q+=`
|
|
17
|
-
${Z}`}q=await R(q)}if(G.wrapInDocument){if(!q.trim().toLowerCase().startsWith("<!doctype")&&!q.trim().toLowerCase().startsWith("<html"))q=g(q,G.title)}if(G.injectCSS)try{let{injectCss:N}=await import("./chunk-
|
|
18
|
-
export{j as
|
|
17
|
+
${Z}`}q=await R(q)}if(G.wrapInDocument){if(!q.trim().toLowerCase().startsWith("<!doctype")&&!q.trim().toLowerCase().startsWith("<html"))q=g(q,G.title)}if(G.injectCSS)try{let{injectCss:N}=await import("./chunk-3kyydhzt.js");q=await N(q)}catch{}return q}
|
|
18
|
+
export{j as pk,C as qk,D as rk,o as sk,r as tk,V as uk};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Rg as a,Sg as b,Tg as c,Ug as d,Vg as e,Wg as f,Xg as g,Yg as h,Zg as i}from"./chunk-tv04k7gq.js";import"./chunk-bcpjhcpn.js";import"./chunk-emjmshj8.js";export{c as setCachedImageResult,e as processImage,f as optimizeImage,b as getCachedImageResult,i as generateSrcset,h as generateResponsiveVariants,d as clearImageCache,g as applyTransformations,a as ImageProcessorCache};
|
|
@@ -348,4 +348,4 @@ else {
|
|
|
348
348
|
console.log('[stx] Keep-alive runtime initialized');
|
|
349
349
|
})();
|
|
350
350
|
`}function Z(f){if(typeof document<"u")document.addEventListener("stx:activated",(j)=>{f(j.detail)})}function _(f){if(typeof document<"u")document.addEventListener("stx:deactivated",(j)=>{f(j.detail)})}
|
|
351
|
-
export{Q as
|
|
351
|
+
export{Q as Bi,T as Ci,W as Di,X as Ei,Y as Fi,Z as Gi,_ as Hi};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import C from"path";var G=".stx",K="STX_DIR",J=null;function O(j){J=j?.trim()||null}function H(){return process.env[K]?.trim()||J||G}function Q(j=process.cwd(),...q){let B=H();return C.isAbsolute(B)?C.join(B,...q):C.join(j,B,...q)}function W(j){if(!j||C.isAbsolute(j))return j;let q=j.replace(/\\/g,"/");if(q!==G&&!q.startsWith(`${G}/`))return j;let B=q.slice(G.length+1);return B?C.join(H(),B):H()}
|
|
3
|
-
export{G as
|
|
3
|
+
export{G as nt,K as ot,O as pt,H as qt,Q as rt,W as st};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
var{defineProperty:e,getOwnPropertyNames:g,getOwnPropertyDescriptor:h}=Object,i=Object.prototype.hasOwnProperty;function j(a){return this[a]}var m=(a)=>{var b=(f??=new WeakMap).get(a),c;if(b)return b;if(b=e({},"__esModule",{value:!0}),a&&typeof a==="object"||typeof a==="function"){for(var d of g(a))if(!i.call(b,d))e(b,d,{get:j.bind(a,d),enumerable:!(c=h(a,d))||c.enumerable})}return f.set(a,b),b},f;var k=(a)=>a;function l(a,b){this[a]=k.bind(null,b)}var n=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0,configurable:!0,set:l.bind(b,c)})};var o=(a,b)=>()=>(a&&(b=a(a=0)),b);var p=import.meta.require;
|
|
3
|
-
export{m as
|
|
3
|
+
export{m as Ow,n as Pw,o as Qw,p as Rw};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{l as a,m as b,n as c}from"./chunk-q9n5swx7.js";import"./chunk-
|
|
2
|
+
import{l as a,m as b,n as c}from"./chunk-q9n5swx7.js";import"./chunk-emjmshj8.js";export{c as updateContextTree,b as updateContextStoryFiles,a as createContext};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import{existsSync as U,statSync as V}from"fs";import z from"path";var W=/[*?[\]{}]/;function X(D){return W.test(D)}async function $(D,E={}){let H=E.cwd??process.cwd(),N=E.recursive!==!1,Q=E.ignorePaths??[],J=globalThis.Bun.Glob,K=new Set,F=(j)=>{if(j.includes(`${z.sep}node_modules${z.sep}`)||j.includes(`${z.sep}dist${z.sep}`))return;if(Q.some((q)=>q&&j.includes(z.normalize(q))))return;K.add(j)},R=async(j)=>{try{for await(let q of new J(j).scan({cwd:H,absolute:!0}))F(q)}catch{}};for(let j of D){if(!j)continue;if(X(j)){await R(j);continue}let q=z.resolve(H,j);if(!U(q))continue;if(V(q).isDirectory()){for await(let T of new J(N?"**/*.stx":"*.stx").scan({cwd:q,absolute:!0}))F(T);continue}F(q)}return[...K].sort()}
|
|
3
|
-
export{X as
|
|
3
|
+
export{X as ms,$ as ns};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-
|
|
2
|
+
import"./chunk-emjmshj8.js";import v from"fs";import H from"path";import{gzipSync as z}from"zlib";import{createHash as g}from"crypto";var D={".js":"js",".mjs":"js",".cjs":"js",".ts":"js",".jsx":"js",".tsx":"js",".css":"css",".scss":"css",".sass":"css",".less":"css",".html":"html",".htm":"html",".png":"image",".jpg":"image",".jpeg":"image",".gif":"image",".svg":"image",".webp":"image",".avif":"image",".ico":"image",".woff":"font",".woff2":"font",".ttf":"font",".eot":"font",".otf":"font"},b=[/node_modules/,/vendor/,/bower_components/,/\.min\./],B=[/index\.(js|ts|html)$/,/main\.(js|ts)$/,/app\.(js|ts)$/,/entry\.(js|ts)$/];async function L(X,Z={}){let{includeSourceMaps:Q=!1,parseImports:$=!0,detectDuplicates:U=!0,topModulesCount:K=20}=Z;if(!v.existsSync(X))throw Error(`Build directory not found: ${X}`);if(!v.statSync(X).isDirectory())throw Error(`Not a directory: ${X}`);let q=await k(X,Q),J=[],F=[];for(let A of q)try{let O=await f(A,X,$);J.push(O)}catch(O){F.push(`Failed to process ${A}: ${O}`)}let Y=c(J,X),V=J.reduce((A,O)=>A+O.size,0),_=J.reduce((A,O)=>A+O.gzipSize,0),w=m(J),G=U?p(J):[],C=[...J].sort((A,O)=>O.size-A.size).slice(0,K);return{timestamp:Date.now(),buildDir:H.resolve(X),chunks:Y,totalSize:V,totalGzipSize:_,moduleCount:J.length,duplicates:G,byType:w,largestModules:C,warnings:F}}async function k(X,Z){let Q=[];async function $(U){let K=await v.promises.readdir(U,{withFileTypes:!0});for(let j of K){let q=H.join(U,j.name);if(j.isDirectory()){if(!j.name.startsWith(".")&&j.name!=="node_modules")await $(q)}else if(j.isFile()){if(!Z&&j.name.endsWith(".map"))continue;Q.push(q)}}}return await $(X),Q}async function f(X,Z,Q){let $=await v.promises.readFile(X),U=H.relative(Z,X),K=H.extname(X).toLowerCase(),j=$.length,q=y($),J=h($,K),F=g("md5").update($).digest("hex").slice(0,8),Y=D[K]||"other",V=[];if(Q&&Y==="js")V.push(...d($.toString("utf-8")));return{id:U,path:U,size:j,gzipSize:q,parsedSize:J,extension:K,type:Y,imports:V,importedBy:[],hash:F}}function y(X){try{let Z=z(X,{level:9}).length;return Math.min(Z,X.length)}catch{return X.length}}function h(X,Z){if(Z.includes(".min.")||X.length<1000)return X.length;let $=D[Z];if($==="js")return Math.round(X.length*0.6);if($==="css")return Math.round(X.length*0.7);return X.length}function d(X){let Z=[],Q=/import\s+(?:[\w*{}\s,]+\s+from\s+)?['"]([^'"]+)['"]/g,$;while(($=Q.exec(X))!==null)Z.push($[1]);let U=/import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;while(($=U.exec(X))!==null)Z.push($[1]);let K=/require\s*\(\s*['"]([^'"]+)['"]\s*\)/g;while(($=K.exec(X))!==null)Z.push($[1]);return[...new Set(Z)]}function c(X,Z){let Q=new Map;for(let U of X){let K=U.path.split(H.sep),j;if(K.length===1)j=H.basename(U.path,U.extension);else j=K[0];let q=Q.get(j)||[];q.push(U),Q.set(j,q)}let $=[];for(let[U,K]of Q){let j=K.reduce((Y,V)=>Y+V.size,0),q=K.reduce((Y,V)=>Y+V.gzipSize,0),J=K.some((Y)=>B.some((V)=>V.test(Y.path))),F=K.some((Y)=>b.some((V)=>V.test(Y.path)));$.push({name:U,files:K.map((Y)=>Y.path),modules:K,size:j,gzipSize:q,isEntry:J,isVendor:F})}return $.sort((U,K)=>K.size-U.size)}function m(X){let Z={js:{count:0,size:0,gzipSize:0},css:{count:0,size:0,gzipSize:0},html:{count:0,size:0,gzipSize:0},image:{count:0,size:0,gzipSize:0},font:{count:0,size:0,gzipSize:0},other:{count:0,size:0,gzipSize:0}};for(let Q of X)Z[Q.type].count++,Z[Q.type].size+=Q.size,Z[Q.type].gzipSize+=Q.gzipSize;return Z}function p(X){let Z=new Map;for(let $ of X){let U=Z.get($.hash)||[];U.push($),Z.set($.hash,U)}let Q=[];for(let[,$]of Z)if($.length>1){let U=$[0];Q.push({path:U.path,count:$.length,wastedBytes:U.size*($.length-1),locations:$.map((K)=>K.path)})}return Q.sort(($,U)=>U.wastedBytes-$.wastedBytes)}function W(X){if(X<1024)return`${X} B`;if(X<1048576)return`${(X/1024).toFixed(2)} KB`;return`${(X/1048576).toFixed(2)} MB`}function I(X){let Z=X.match(/^([\d.]+)\s*(B|KB|MB|GB)?$/i);if(!Z)return 0;let Q=Number.parseFloat(Z[1]);switch((Z[2]||"B").toUpperCase()){case"KB":return Q*1024;case"MB":return Q*1024*1024;case"GB":return Q*1024*1024*1024;default:return Q}}function E(X,Z){if(Z===0)return"0%";return`${(X/Z*100).toFixed(1)}%`}function R(X,Z){switch(Z.format){case"json":return u(X,Z);case"markdown":return l(X,Z);case"text":default:return r(X,Z)}}function u(X,Z){let Q=N(X,Z);return JSON.stringify({timestamp:X.timestamp,buildDir:X.buildDir,summary:{totalSize:X.totalSize,totalSizeFormatted:W(X.totalSize),totalGzipSize:X.totalGzipSize,totalGzipSizeFormatted:W(X.totalGzipSize),moduleCount:X.moduleCount,chunkCount:X.chunks.length,duplicateCount:X.duplicates.length},byType:Object.fromEntries(Object.entries(X.byType).map(([$,U])=>[$,{...U,sizeFormatted:W(U.size),gzipSizeFormatted:W(U.gzipSize)}])),chunks:X.chunks.map(($)=>({name:$.name,size:$.size,sizeFormatted:W($.size),gzipSize:$.gzipSize,gzipSizeFormatted:W($.gzipSize),moduleCount:$.modules.length,isEntry:$.isEntry,isVendor:$.isVendor})),largestModules:X.largestModules.slice(0,Z.topModules||10).map(($)=>({path:$.path,size:$.size,sizeFormatted:W($.size),gzipSize:$.gzipSize,gzipSizeFormatted:W($.gzipSize),type:$.type})),duplicates:X.duplicates,analysis:Q,warnings:X.warnings},null,2)}function r(X,Z){let Q=[],$=Z.showGzip!==!1;if(Q.push(""),Q.push("Bundle Analysis Report"),Q.push("\u2550".repeat(50)),Q.push(""),Q.push("Summary"),Q.push("\u2500".repeat(50)),$)Q.push(`Total Size: ${W(X.totalSize)} (${W(X.totalGzipSize)} gzip)`);else Q.push(`Total Size: ${W(X.totalSize)}`);if(Q.push(`Modules: ${X.moduleCount}`),Q.push(`Chunks: ${X.chunks.length}`),X.duplicates.length>0)Q.push(`Duplicates: ${X.duplicates.length}`);if(Q.push(""),Z.threshold&&X.totalSize>Z.threshold)Q.push(`\u26A0\uFE0F Bundle exceeds threshold of ${W(Z.threshold)}!`),Q.push("");Q.push("Size by Type"),Q.push("\u2500".repeat(50));let U=["js","css","html","image","font","other"];for(let j of U){let q=X.byType[j];if(q.count>0){let J=E(q.size,X.totalSize),F=$?` (${W(q.gzipSize)} gzip)`:"";Q.push(` ${j.padEnd(8)} ${W(q.size).padStart(12)}${F} ${J.padStart(6)} (${q.count} files)`)}}Q.push(""),Q.push("Chunks"),Q.push("\u2500".repeat(50));for(let j of X.chunks.slice(0,10)){let q=[];if(j.isEntry)q.push("entry");if(j.isVendor)q.push("vendor");let J=q.length>0?` [${q.join(", ")}]`:"",F=$?` (${W(j.gzipSize)} gzip)`:"";Q.push(` ${j.name.padEnd(20)} ${W(j.size).padStart(12)}${F}${J}`)}if(X.chunks.length>10)Q.push(` ... and ${X.chunks.length-10} more chunks`);Q.push("");let K=Z.topModules||10;Q.push(`Largest Modules (Top ${K})`),Q.push("\u2500".repeat(50));for(let j=0;j<Math.min(K,X.largestModules.length);j++){let q=X.largestModules[j],J=$?` (${W(q.gzipSize)} gzip)`:"";Q.push(` ${(j+1).toString().padStart(2)}. ${q.path}`),Q.push(` ${W(q.size)}${J}`)}if(Q.push(""),X.duplicates.length>0){Q.push("Duplicate Modules"),Q.push("\u2500".repeat(50));for(let j of X.duplicates.slice(0,5))Q.push(` ${j.path}`),Q.push(` ${j.count} copies, wasting ${W(j.wastedBytes)}`);if(X.duplicates.length>5)Q.push(` ... and ${X.duplicates.length-5} more duplicates`);Q.push("")}if(Z.recommendations!==!1){let j=N(X,Z);if(j.recommendations.length>0){Q.push("Recommendations"),Q.push("\u2500".repeat(50));for(let q of j.recommendations.slice(0,5)){let J=q.impact==="high"?"\u26A1":q.impact==="medium"?"\uD83D\uDCCA":"\uD83D\uDCA1";Q.push(` ${J} ${q.title}`),Q.push(` ${q.description}`)}Q.push("")}}if(X.warnings.length>0){Q.push("Warnings"),Q.push("\u2500".repeat(50));for(let j of X.warnings)Q.push(` \u26A0\uFE0F ${j}`);Q.push("")}return Q.join(`
|
|
3
3
|
`)}function l(X,Z){let Q=[],$=Z.showGzip!==!1;if(Q.push("# Bundle Analysis Report"),Q.push(""),Q.push(`Generated: ${new Date(X.timestamp).toISOString()}`),Q.push(""),Q.push("## Summary"),Q.push(""),Q.push("| Metric | Value |"),Q.push("|--------|-------|"),Q.push(`| Total Size | ${W(X.totalSize)} |`),$)Q.push(`| Gzip Size | ${W(X.totalGzipSize)} |`);Q.push(`| Modules | ${X.moduleCount} |`),Q.push(`| Chunks | ${X.chunks.length} |`),Q.push(`| Duplicates | ${X.duplicates.length} |`),Q.push(""),Q.push("## Size by Type"),Q.push(""),Q.push("| Type | Size | Gzip | % | Files |"),Q.push("|------|------|------|---|-------|");let U=["js","css","html","image","font","other"];for(let j of U){let q=X.byType[j];if(q.count>0)Q.push(`| ${j} | ${W(q.size)} | ${W(q.gzipSize)} | ${E(q.size,X.totalSize)} | ${q.count} |`)}Q.push(""),Q.push("## Chunks"),Q.push(""),Q.push("| Name | Size | Gzip | Modules | Type |"),Q.push("|------|------|------|---------|------|");for(let j of X.chunks.slice(0,15)){let q=j.isEntry?"Entry":j.isVendor?"Vendor":"-";Q.push(`| ${j.name} | ${W(j.size)} | ${W(j.gzipSize)} | ${j.modules.length} | ${q} |`)}Q.push("");let K=Z.topModules||10;Q.push(`## Largest Modules (Top ${K})`),Q.push(""),Q.push("| # | Path | Size | Gzip |"),Q.push("|---|------|------|------|");for(let j=0;j<Math.min(K,X.largestModules.length);j++){let q=X.largestModules[j];Q.push(`| ${j+1} | \`${q.path}\` | ${W(q.size)} | ${W(q.gzipSize)} |`)}if(Q.push(""),X.duplicates.length>0){Q.push("## Duplicates"),Q.push(""),Q.push("| Path | Copies | Wasted |"),Q.push("|------|--------|--------|");for(let j of X.duplicates.slice(0,10))Q.push(`| \`${j.path}\` | ${j.count} | ${W(j.wastedBytes)} |`);Q.push("")}if(Z.recommendations!==!1){let j=N(X,Z);if(j.recommendations.length>0){Q.push("## Recommendations"),Q.push("");for(let q of j.recommendations)Q.push(`### ${q.title}`),Q.push(""),Q.push(q.description),Q.push(""),Q.push(`- **Impact:** ${q.impact}`),Q.push(`- **Effort:** ${q.effort}`),Q.push("")}}return Q.join(`
|
|
4
4
|
`)}function N(X,Z){let Q=[],$=[];if(Z.threshold&&X.totalSize>Z.threshold)Q.push({severity:"error",message:`Bundle size (${W(X.totalSize)}) exceeds threshold (${W(Z.threshold)})`});if(X.totalSize>1048576)Q.push({severity:"warning",message:`Bundle is over 1MB (${W(X.totalSize)})`,details:"Large bundles can significantly impact load time"});if(X.duplicates.length>0){let q=X.duplicates.reduce((J,F)=>J+F.wastedBytes,0);Q.push({severity:"warning",message:`${X.duplicates.length} duplicate modules found, wasting ${W(q)}`}),$.push({title:"Remove Duplicate Modules",description:"Consider using import aliases or ensuring consistent package versions to eliminate duplicates.",impact:"medium",effort:"low"})}if(X.byType.js.size/X.totalSize>0.8&&X.totalSize>512000)$.push({title:"Code Splitting",description:"Over 80% of your bundle is JavaScript. Consider splitting code by route or feature.",impact:"high",effort:"medium"});let K=X.largestModules.filter((q)=>q.size>102400);if(K.length>0){Q.push({severity:"info",message:`${K.length} modules are over 100KB`});for(let q of K){if(q.path.includes("lodash")&&!q.path.includes("lodash-es"))$.push({title:"Use lodash-es instead of lodash",description:"lodash-es supports tree-shaking and can significantly reduce bundle size.",impact:"high",effort:"low"});if(q.path.includes("moment"))$.push({title:"Replace moment.js",description:"Consider using date-fns or dayjs for smaller date handling libraries.",impact:"high",effort:"medium"})}}if(X.byType.image.size>512000)$.push({title:"Optimize Images",description:`Images account for ${W(X.byType.image.size)}. Consider using WebP/AVIF formats and responsive images.`,impact:"high",effort:"low"});let j=100;if(X.totalSize>1048576)j-=20;else if(X.totalSize>512000)j-=10;if(j-=Math.min(20,X.duplicates.length*2),j-=Math.min(15,K.length*3),Z.threshold&&X.totalSize>Z.threshold)j-=25;return{score:Math.max(0,j),issues:Q,recommendations:$}}var i={lodash:{alternative:"lodash-es or individual imports",savings:"~70%"},moment:{alternative:"date-fns or dayjs",savings:"~90%"},"chart.js":{alternative:"chart.js with tree-shaking",savings:"~50%"},"highlight.js":{alternative:"Selective language imports",savings:"~80%"},fontawesome:{alternative:"Individual icon imports",savings:"~90%"},"material-ui":{alternative:"Named imports from @mui/*",savings:"~60%"}};function n(X){for(let[Z,Q]of Object.entries(i))if(X.includes(Z))return{title:`Optimize ${Z}`,description:`Consider using ${Q.alternative}. Potential savings: ${Q.savings}`,impact:"high",effort:"low"};return null}var o={default:{js:"#f7df1e",css:"#264de4",html:"#e34c26",image:"#4caf50",font:"#9c27b0",other:"#607d8b",vendor:"#ff5722"},pastel:{js:"#fff3b0",css:"#b0d4ff",html:"#ffb0b0",image:"#b0ffb0",font:"#e0b0ff",other:"#d0d0d0",vendor:"#ffcfb0"},monochrome:{js:"#333333",css:"#555555",html:"#777777",image:"#999999",font:"#bbbbbb",other:"#dddddd",vendor:"#444444"}};function x(X,Z={}){let{title:Q="Bundle Analysis",gzip:$=!0,colorScheme:U="default"}=Z,K=o[U],j=a(X),q=JSON.stringify(j);return`<!DOCTYPE html>
|
|
5
5
|
<html lang="en">
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Ro as a,So as b,To as c,Uo as d,Vo as e,Wo as f,Xo as g}from"./chunk-3ssjb8cx.js";import"./chunk-ykevda74.js";import"./chunk-ez003q74.js";import"./chunk-kyyt9xhs.js";import"./chunk-tf16jtj4.js";import"./chunk-19m7hed6.js";import"./chunk-kjd9hbg4.js";import"./chunk-ejwfnttb.js";import"./chunk-5270fyk7.js";import"./chunk-q4kgqqed.js";import"./chunk-1nnza3m6.js";import"./chunk-hkrzv980.js";import"./chunk-qbz6yn8c.js";import"./chunk-czj6nq0b.js";import"./chunk-zxfejz72.js";import"./chunk-mere396d.js";import"./chunk-aa8015mk.js";import"./chunk-trva71am.js";import"./chunk-rtfwn4cm.js";import"./chunk-emjmshj8.js";export{a as resetUnscopedSignalWarnings,g as processStackReplacements,f as processStackPushDirectives,e as processIncludes,b as partialsCache,c as onceStore,d as clearOnceStore};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import G from"path";var L=new Set([".jpg",".jpeg",".png",".gif"]),O=[{ext:".avif",mime:"image/avif"},{ext:".webp",mime:"image/webp"}];async function M(j,z){let H=z.formats??O;if(!z.publicDir)return j;let C=N(j),J=[],Y=/<img\b[^>]*?>/gi,K=[],Q;while((Q=Y.exec(j))!==null){let q=Q[0],y=q.match(/\bsrc=["']([^"']+)["']/i);if(!y)continue;if(_(Q.index,C))continue;K.push({idx:Q.index,length:q.length,src:y[1],raw:q})}if(K.length===0)return j;let Z=await Promise.all(K.map(async(q)=>{let y=await X(q.src,z.publicDir,H);return{match:q,sources:y}}));for(let{match:q,sources:y}of Z){if(y.length===0)continue;let I=`<picture>${y.map(($)=>`<source type="${$.mime}" srcset="${w($.url)}">`).join("")}${q.raw}</picture>`;J.push({start:q.idx,end:q.idx+q.length,replacement:I})}if(J.length===0)return j;let V="",W=0;for(let q of J)V+=j.slice(W,q.start),V+=q.replacement,W=q.end;return V+=j.slice(W),V}async function X(j,z,H){if(!F(j))return[];let C=G.extname(j).toLowerCase();if(!L.has(C))return[];if(!j.startsWith("/"))return[];let J=G.join(z,j.slice(1)),Y=G.dirname(J),K=G.basename(J,C),Q=G.resolve(Y),Z=G.resolve(z);if(!Q.startsWith(Z))return[];let V=G.posix.dirname(j),W=H.map(async(y)=>{let k=G.join(Y,`${K}${y.ext}`);if(!await Bun.file(k).exists())return null;return{url:G.posix.join(V,`${K}${y.ext}`),mime:y.mime}});return(await Promise.all(W)).filter((y)=>y!==null)}function F(j){if(!j)return!1;if(j.startsWith("http://")||j.startsWith("https://"))return!1;if(j.startsWith("//"))return!1;if(j.startsWith("data:"))return!1;return!0}function N(j){let z=[],H=/<picture\b[^>]*>[\s\S]*?<\/picture>/gi,C;while((C=H.exec(j))!==null)z.push([C.index,C.index+C[0].length]);return z}function _(j,z){for(let[H,C]of z)if(j>=H&&j<C)return!0;return!1}function w(j){return j.replace(/&/g,"&").replace(/"/g,""")}
|
|
3
|
-
export{M as
|
|
3
|
+
export{M as ei};
|
|
@@ -213,4 +213,4 @@ function w(Z,M){let{itemHeight:K,containerHeight:P,overscan:F=3,keyProperty:$="i
|
|
|
213
213
|
})();
|
|
214
214
|
</script>
|
|
215
215
|
`})}var v={createVirtualList:w,processVirtualListDirectives:C,processInfiniteListDirectives:E,processVirtualGridDirectives:f,generateVirtualListCSS:b,useVirtualList:L};
|
|
216
|
-
export{w as
|
|
216
|
+
export{w as Ch,C as Dh,b as Eh,L as Fh,E as Gh,f as Hh,v as Ih};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Au as p,lu as a,mu as b,nu as c,ou as d,pu as e,qu as f,ru as g,su as h,tu as i,uu as j,vu as k,wu as l,xu as m,yu as n,zu as o}from"./chunk-qbz6yn8c.js";import"./chunk-czj6nq0b.js";import"./chunk-emjmshj8.js";export{i as useTitle,f as useSeoMeta,i as usePageTitle,d as useHead,g as seoMetaToHeadConfig,c as resetHead,k as renderHtmlAttrs,j as renderHead,l as renderBodyAttrs,o as processTitleDirective,p as processMetaDirective,n as processHeadDirective,e as mergeHeadConfigs,b as getPageMeta,a as getHead,h as definePageMeta,m as applyHead};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{ps as _}from"./chunk-kyyt9xhs.js";import"./chunk-emjmshj8.js";function W(j,G,H=240){return j.slice(G,G+H)}var v=[{rule:"route-params",pattern:/\blocation\s*\.\s*pathname\s*\.\s*(?:match|split)\s*\(/g,primitive:"useRoute() / useRouteParams() / useRouteParam(name)",why:"parsing the URL by hand re-implements the router and does not update on SPA navigation"},{rule:"alert",pattern:/(?<![.#\w$])(?:(?:window|globalThis)\s*\.\s*)?alert\s*\(/g,primitive:"stxAlert(message)",why:"themed, focus-trapped and non-blocking \u2014 but `await` it if the code after it "+"depended on the native dialog blocking until dismissal",reject:(j)=>/\b(?:async\s+)?function\s+alert\s*\(/.test(j)||/\b(?:const|let|var)\s+alert\s*=/.test(j)},{rule:"search-params",pattern:/new\s+URLSearchParams\s*\(/g,primitive:"useSearchParams()",why:"reactive, and writes back through the router instead of history.replaceState",reject:(j,G)=>{let H=j.indexOf("(",G);if(H===-1)return!0;let Q=j.slice(H+1,j.indexOf(")",H)+1);return!/\b(?:location|search|href|url)\b/i.test(Q)}},{rule:"navigate",pattern:/\blocation\s*\.\s*(?:assign|replace)\s*\(|\blocation\s*\.\s*href\s*=/g,primitive:"navigate(path) / goBack()",why:"a full document load throws away every store and the scroll position; navigate() is an SPA transition",reject:(j,G)=>/^[^\n]*?(?:['"`]\s*)?(?:mailto:|tel:|sms:|https?:\/\/|\/\/)/.test(W(j,G,160))},{rule:"fetch",pattern:/new\s+AbortController\s*\(/g,primitive:"useFetch(url) / useAsyncData(key, fn)",why:"cancellation, loading and error state are already wired; hand-rolling them is where the races live"},{rule:"polling",pattern:/setInterval\s*\(/g,primitive:"useEventSource() / useSSE() / useWebSocket() / useChannel()",why:"polling burns requests and lags; the push primitives are delivered",reject:(j,G)=>!/\bfetch\s*\(|\$fetch\b|useFetch\b|\.get\s*\(|axios\b/.test(W(j,G))},{rule:"debounce",pattern:/\bclearTimeout\s*\(/g,primitive:"useDebounce(fn, ms) / useThrottle(fn, ms)",why:"a hand-held timer handle per call site is the usual source of stale-result bugs",requires:(j)=>/setTimeout\s*\(/.test(j)},{rule:"click-outside",pattern:/document\s*\.\s*addEventListener\s*\(\s*['"](?:click|mousedown|pointerdown)['"]/g,primitive:"useClickOutside(ref, fn)",why:"the document-level listener plus the blur race is exactly what this composable exists to remove"},{rule:"focus",pattern:/\.\s*(?:getElementById|querySelector)\s*\([^)]*\)\s*(?:\?\.)?\s*\.?focus\s*\(/g,primitive:"useFocus(ref) with x-ref",why:"a query by id breaks under nested scopes and SPA navigation; a ref does not"},{rule:"clipboard",pattern:/navigator\s*\.\s*(?:clipboard|share)\b/g,primitive:"useClipboard() / useShare()",why:"permission state, the copied flag and the unsupported-browser fallback are already handled"},{rule:"watch",pattern:/\beffect\s*\(\s*\(\s*\)\s*=>\s*\{[^}]*\bvoid\s+\w+\s*\(\s*\)/g,primitive:"watch(source, cb) / watchMultiple([...], cb)",why:"the `void a(); void b()` dance is a manual dependency list; watch takes one directly"}],U=["confirm","tooltip",...v.map((j)=>j.rule)];function N(j,G){let H=1;for(let Q=0;Q<G;Q++)if(j[Q]===`
|
|
3
3
|
`)H++;return H}function P(j,G){let H=j.lastIndexOf(`
|
|
4
4
|
`,G)+1,Q=j.indexOf(`
|
|
5
5
|
`,G);return j.slice(H,Q===-1?j.length:Q).trim().slice(0,120)}function q(j,G){let H=j.slice(0,G),Q=H.lastIndexOf("function"),X=H.lastIndexOf("=>"),M=Math.max(Q,X);if(M===-1)return!1;let z=j.slice(Math.max(0,M-120),M);return/\basync\b[^;{}]*$/.test(z)}function L(j){return/\b(?:async\s+)?function\s+confirm\s*\(/.test(j)||/\b(?:const|let|var)\s+confirm\s*=/.test(j)||/\bimport\s*\{[^}]*\bconfirm\b[^}]*\}/.test(j)}function O(j,G,H){if(L(j))return j;let Q=/(^|[^\w$.])(?:(?:window|globalThis)\s*\.\s*)?confirm\s*\(/g,X=F(j),M="",z=0,Y;while((Y=Q.exec(X))!==null){let Z=Y.index+Y[1].length,$=N(j,Z),J=P(j,Z);if(/stxConfirm\s*\($/.test(j.slice(0,Z+8)))continue;let D=q(j,Z);if(H.push({file:G,line:$,rule:"confirm",applied:D,snippet:J,reason:D?void 0:"stxConfirm() returns a Promise and native confirm() is synchronous, so this needs `await` inside an async function. Rewriting it here would make the condition always true."}),D)M+=j.slice(z,Z)+"await stxConfirm(",z=Z+(Y[0].length-Y[1].length)}return M+j.slice(z)}function w(j,G,H){let Q=/(<[a-z][\w-]*\b[^>]*?)\stitle=(["'])(.*?)\2/gis,X=C(j),M="",z=0,Y;while((Y=Q.exec(X))!==null){let[Z,$,J,D]=Y,K=N(j,Y.index),B=P(j,Y.index),V=$.match(/^<([A-Za-z][\w-]*)/)?.[1]??"";if(/^[A-Z]/.test(V)){H.push({file:G,line:K,rule:"tooltip",applied:!1,snippet:B,reason:`\`title\` on <${V}> is a component prop, not an HTML attribute \u2014 `+"adding x-tooltip here would put a tooltip on a component and may duplicate text it already renders."});continue}if(/\bx-tooltip[=\s]/.test($)||D.trim()===""){H.push({file:G,line:K,rule:"tooltip",applied:!1,snippet:B,reason:/\bx-tooltip[=\s]/.test($)?"already has x-tooltip":"empty title"});continue}H.push({file:G,line:K,rule:"tooltip",applied:!0,snippet:B}),M+=j.slice(z,Y.index)+`${$} x-tooltip=${J}${D}${J} title=${J}${D}${J}`,z=Y.index+Z.length}return M+j.slice(z)}function C(j){return j.replace(/<!--[\s\S]*?-->/g,(G)=>G.replace(/[^\n]/g," ")).replace(/\{\{--[\s\S]*?--\}\}/g,(G)=>G.replace(/[^\n]/g," "))}function E(j){let G=(H)=>H.replace(/[^\n]/g," ");return j.replace(/\/\*[\s\S]*?\*\//g,G).replace(/\/\/[^\n]*/g,G)}function F(j,G=!1){let H=C(j);return(G?E(H):_(H)).replace(/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi,(X,M)=>/\bclient\b/i.test(M)?X:X.replace(/[^\n]/g," "))}function S(j,G,H,Q){let X=F(j),M=F(j,!0);for(let z of v){if(!H.includes(z.rule))continue;if(z.requires&&!z.requires(j))continue;z.pattern.lastIndex=0;let Y,Z=/['"]/.test(z.pattern.source)?M:X;z.pattern.lastIndex=0;while((Y=z.pattern.exec(Z))!==null){if(z.reject?.(j,Y.index))continue;Q.push({file:G,line:N(j,Y.index),rule:z.rule,applied:!1,snippet:P(j,Y.index),reason:`${z.primitive} \u2014 ${z.why}`})}}}function k(j,G={}){let H=G.rules??U,Q=G.file??"<source>",X=[];S(j,Q,H,X);let M=j;if(H.includes("confirm"))M=O(M,Q,X);if(H.includes("tooltip"))M=w(M,Q,X);X.sort((Z,$)=>Z.line-$.line);let z=new Set,Y=X.filter((Z)=>{let $=`${Z.rule}:${Z.line}`;if(z.has($))return!1;return z.add($),!0});return{code:M,findings:Y}}var I=new Set(["confirm","tooltip"]);function A(j,G){if(j.length===0)return"No hand-rolled equivalents found.";let H=j.filter((z)=>z.applied),Q=j.filter((z)=>!z.applied&&I.has(z.rule)),X=j.filter((z)=>!z.applied&&!I.has(z.rule)),M=[];if(H.length>0){M.push(G?`Rewrote ${H.length} site(s):`:`Would rewrite ${H.length} site(s) (pass --fix):`);for(let z of H)M.push(` ${z.file}:${z.line} [${z.rule}] ${z.snippet}`)}if(Q.length>0){M.push("",`Needs a human \u2014 ${Q.length} site(s):`);for(let z of Q)M.push(` ${z.file}:${z.line} [${z.rule}] ${z.snippet}
|