@stacksjs/stx 0.2.413 → 0.2.415
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/appearance-bootstrap.js +1 -1
- package/dist/binding-manifest.d.ts +1 -1
- package/dist/builtins/image-delivery.js +19 -11
- package/dist/bundle-analyzer.js +20 -20
- package/dist/chunk-020xyn9q.js +3 -0
- package/dist/chunk-04jhmfbz.js +2 -0
- package/dist/chunk-0pnj3zt2.js +2 -0
- package/dist/{chunk-bwjxk1dw.js → chunk-0zaess6f.js} +29 -29
- package/dist/chunk-1098mas0.js +2 -0
- package/dist/chunk-169n1vpx.js +12 -0
- package/dist/chunk-18vmfkcc.js +2 -0
- package/dist/chunk-1b6t12hd.js +2 -0
- package/dist/chunk-1xdzcy9d.js +14 -0
- package/dist/chunk-1zs30k3y.js +2 -0
- package/dist/chunk-2ce7f416.js +2 -0
- package/dist/chunk-340a824p.js +2 -0
- package/dist/chunk-393341w7.js +2 -0
- package/dist/chunk-39g1134q.js +2 -0
- package/dist/chunk-3efw27as.js +2785 -0
- package/dist/chunk-3kthfs03.js +3 -0
- package/dist/chunk-3qn1wcdg.js +2 -0
- package/dist/chunk-3s2vnqcf.js +2 -0
- package/dist/chunk-42wbs8vq.js +17 -0
- package/dist/chunk-4bjravgk.js +2 -0
- package/dist/chunk-5gsxpaqk.js +2 -0
- package/dist/{chunk-bwsxym3d.js → chunk-5qns2sdz.js} +17 -17
- package/dist/chunk-6cfa3g0r.js +2 -0
- package/dist/{chunk-bjar18jd.js → chunk-6h38kkjf.js} +46 -52
- package/dist/chunk-6hc5vz20.js +3 -0
- package/dist/chunk-6q6g76vg.js +499 -0
- package/dist/chunk-74j18qk0.js +930 -0
- package/dist/chunk-752hw7cd.js +4 -0
- package/dist/{chunk-kgd8kchy.js → chunk-765e1s44.js} +11 -76
- package/dist/chunk-7gkv67ky.js +4 -0
- package/dist/chunk-7z2ra0yf.js +2 -0
- package/dist/chunk-8eqrwj1k.js +20 -0
- package/dist/chunk-8nhshfz6.js +5 -0
- package/dist/chunk-92ps1xpk.js +2 -0
- package/dist/chunk-96k8s808.js +3 -0
- package/dist/chunk-9amp82bx.js +7 -0
- package/dist/chunk-9g27ybyr.js +3 -0
- package/dist/chunk-9p9qkbtg.js +3 -0
- package/dist/{chunk-xq1acw1r.js → chunk-9pt8fd2n.js} +13 -13
- package/dist/{chunk-24zher49.js → chunk-9vrja6vp.js} +4 -4
- package/dist/chunk-9xrbve19.js +2 -0
- package/dist/chunk-a688m6js.js +3 -0
- package/dist/chunk-ak1cgcah.js +5 -0
- package/dist/{chunk-4m7ajama.js → chunk-amd6ey3t.js} +14 -14
- package/dist/chunk-amtr3rmf.js +11 -0
- package/dist/chunk-atws6p5s.js +2 -0
- package/dist/chunk-b84h16er.js +61 -0
- package/dist/chunk-b98be3yp.js +32 -0
- package/dist/{chunk-hx998w7n.js → chunk-bay9s6rs.js} +13 -13
- package/dist/chunk-ce1sejr3.js +3 -0
- package/dist/chunk-cg8hg6cs.js +3 -0
- package/dist/{chunk-4f9zyfdw.js → chunk-czxt605c.js} +4 -5
- package/dist/chunk-dd8cja4h.js +2 -0
- package/dist/chunk-dgdm3hy3.js +2 -0
- package/dist/chunk-e9hs7kk6.js +12 -0
- package/dist/chunk-eed4fwps.js +3 -0
- package/dist/chunk-ej9j6k1q.js +3 -0
- package/dist/chunk-et0rr8c7.js +3 -0
- package/dist/chunk-f1sxycmv.js +2 -0
- package/dist/chunk-f46qsp4m.js +4 -0
- package/dist/chunk-fbcv4fes.js +2 -0
- package/dist/{chunk-bjcsc6wx.js → chunk-fh1qrp68.js} +21 -21
- package/dist/chunk-fjs0a8h7.js +2 -0
- package/dist/chunk-fpfzm238.js +2 -0
- package/dist/chunk-fr2txj8q.js +829 -0
- package/dist/{chunk-xssw417m.js → chunk-ft4p6d28.js} +14 -14
- package/dist/chunk-fyzajkrx.js +2 -0
- package/dist/chunk-fzapbw9p.js +3 -0
- package/dist/chunk-g03s93qr.js +3 -0
- package/dist/chunk-g186znp9.js +33 -0
- package/dist/chunk-gawrg4gb.js +216 -0
- package/dist/chunk-gc1drn2p.js +2 -0
- package/dist/chunk-gea5hf0v.js +2 -0
- package/dist/chunk-gqv3ta5d.js +2 -0
- package/dist/chunk-h6kp2m9r.js +2 -0
- package/dist/chunk-h6zsqb9r.js +3 -0
- package/dist/{chunk-2snqdnk9.js → chunk-h85hrwkq.js} +13 -13
- package/dist/chunk-hbxz85wy.js +2 -0
- package/dist/chunk-hepd9qgx.js +6 -0
- package/dist/chunk-hhnw2sn3.js +2 -0
- package/dist/chunk-hjg3ndgh.js +2 -0
- package/dist/chunk-hk1mj4tz.js +2 -0
- package/dist/{chunk-smcj3442.js → chunk-hkrmcbwy.js} +79 -79
- package/dist/chunk-hn9pkyv8.js +2 -0
- package/dist/chunk-hpgr4qgp.js +2 -0
- package/dist/chunk-hrbbbtbn.js +2 -0
- package/dist/chunk-j03revz2.js +8 -0
- package/dist/chunk-j9qcrwbg.js +2 -0
- package/dist/chunk-jk4njz0w.js +2 -0
- package/dist/chunk-jmabeqfq.js +2 -0
- package/dist/chunk-jnkrn913.js +4 -0
- package/dist/chunk-jp10q90g.js +2 -0
- package/dist/chunk-jt0n43mk.js +2 -0
- package/dist/chunk-kjbv8a3m.js +2 -0
- package/dist/chunk-m1vdghnx.js +2 -0
- package/dist/chunk-m4sk62wb.js +5 -0
- package/dist/chunk-md8rqn48.js +30 -0
- package/dist/chunk-mp6hy8g4.js +2 -0
- package/dist/chunk-nc8my58s.js +2 -0
- package/dist/chunk-ngc2wke4.js +3 -0
- package/dist/chunk-nn2vstke.js +2 -0
- package/dist/chunk-nppdrf0x.js +2 -0
- package/dist/chunk-p2v2a68k.js +2 -0
- package/dist/chunk-pazfr1a1.js +2 -0
- package/dist/{chunk-qn5srnj3.js → chunk-pbh4smw3.js} +16 -16
- package/dist/chunk-pdb5fw3r.js +2 -0
- package/dist/chunk-pdt69hpb.js +2 -0
- package/dist/chunk-pgzvyrv6.js +29 -0
- package/dist/chunk-px7fvbj6.js +3 -0
- package/dist/chunk-q6vrb2pe.js +2 -0
- package/dist/chunk-q7qchkvk.js +2 -0
- package/dist/chunk-q9bdh4s5.js +8 -0
- package/dist/chunk-qghxz7jm.js +194 -0
- package/dist/chunk-r3f9jcf7.js +5 -0
- package/dist/chunk-re8b5r9x.js +3 -0
- package/dist/chunk-s5xezjps.js +3 -0
- package/dist/chunk-sd321bn3.js +2 -0
- package/dist/chunk-shr559s7.js +3 -0
- package/dist/chunk-t4hzprsm.js +3 -0
- package/dist/chunk-t5pvq5mx.js +2 -0
- package/dist/{chunk-pv3d7sfn.js → chunk-t61vdbje.js} +89 -89
- package/dist/chunk-tafqyf2g.js +2033 -0
- package/dist/chunk-tfexmdkt.js +3 -0
- package/dist/chunk-thyt8ed8.js +6 -0
- package/dist/chunk-v91p6ekp.js +24 -0
- package/dist/chunk-vgvtnwxa.js +4 -0
- package/dist/chunk-w72qx0eb.js +2 -0
- package/dist/chunk-wfy1zq53.js +30 -0
- package/dist/chunk-wzx0164n.js +18 -0
- package/dist/chunk-x0q32ees.js +3 -0
- package/dist/chunk-xfp7k0v8.js +64 -0
- package/dist/chunk-xtvf6n6f.js +4 -0
- package/dist/chunk-xwzvfqcb.js +2 -0
- package/dist/chunk-y1cmjvk3.js +43 -0
- package/dist/chunk-y5310237.js +311 -0
- package/dist/chunk-ya0qecph.js +27 -0
- package/dist/chunk-yazk54jr.js +8 -0
- package/dist/chunk-ydjfar14.js +2 -0
- package/dist/chunk-ym95v4nc.js +3 -0
- package/dist/chunk-z0g9jvv0.js +40 -0
- package/dist/chunk-z23kaxq6.js +2 -0
- package/dist/chunk-z8xn5ta3.js +2 -0
- package/dist/{chunk-8sdhs0zk.js → chunk-zhxdpzga.js} +4 -4
- package/dist/cli.js +110 -110
- package/dist/craft-entry.js +7 -7
- package/dist/craft.js +7 -7
- package/dist/database.js +2 -2
- package/dist/image-optimization/component.js +4 -4
- package/dist/media/image/component.js +5 -5
- package/dist/media/protected/component.js +2 -2
- package/dist/media/video/index.js +4 -4
- package/dist/native/bridge/protocol.d.ts +325 -0
- package/dist/native/bridge/protocol.js +219 -0
- package/dist/native/cli.d.ts +24 -0
- package/dist/native/cli.js +52 -0
- package/dist/native/compiler/bundle.d.ts +41 -0
- package/dist/native/compiler/bundle.js +90 -0
- package/dist/native/compiler/client-script.d.ts +8 -0
- package/dist/native/compiler/client-script.js +31 -0
- package/dist/native/compiler/codegen.d.ts +10 -0
- package/dist/native/compiler/codegen.js +145 -0
- package/dist/native/compiler/headwind-to-style.d.ts +395 -0
- package/dist/native/compiler/headwind-to-style.js +1163 -0
- package/dist/native/compiler/html-to-ir.d.ts +41 -0
- package/dist/native/compiler/html-to-ir.js +411 -0
- package/dist/native/compiler/icons.d.ts +220 -0
- package/dist/native/compiler/icons.js +208 -0
- package/dist/native/compiler/ir.d.ts +234 -0
- package/dist/native/compiler/ir.js +15 -0
- package/dist/native/compiler/parser.d.ts +88 -0
- package/dist/native/compiler/parser.js +753 -0
- package/dist/native/compiler/render-screen.d.ts +26 -0
- package/dist/native/compiler/render-screen.js +31 -0
- package/dist/native/components/primitives.d.ts +291 -0
- package/dist/native/components/primitives.js +22 -0
- package/dist/native/hot-reload/client.d.ts +62 -0
- package/dist/native/hot-reload/client.js +324 -0
- package/dist/native/index.d.ts +90 -0
- package/dist/native/index.js +34 -0
- package/dist/native/primitives/ActivityIndicator.stx +5 -0
- package/dist/native/primitives/Button.stx +5 -0
- package/dist/native/primitives/DatePicker.stx +5 -0
- package/dist/native/primitives/FlatList.stx +5 -0
- package/dist/native/primitives/Image.stx +5 -0
- package/dist/native/primitives/ImageBackground.stx +5 -0
- package/dist/native/primitives/KeyboardAvoidingView.stx +5 -0
- package/dist/native/primitives/Modal.stx +5 -0
- package/dist/native/primitives/Picker.stx +5 -0
- package/dist/native/primitives/Pressable.stx +5 -0
- package/dist/native/primitives/RefreshControl.stx +5 -0
- package/dist/native/primitives/SafeAreaView.stx +5 -0
- package/dist/native/primitives/ScrollView.stx +5 -0
- package/dist/native/primitives/SectionList.stx +5 -0
- package/dist/native/primitives/Slider.stx +5 -0
- package/dist/native/primitives/StatusBar.stx +5 -0
- package/dist/native/primitives/Switch.stx +5 -0
- package/dist/native/primitives/Text.stx +5 -0
- package/dist/native/primitives/TextInput.stx +5 -0
- package/dist/native/primitives/TouchableHighlight.stx +5 -0
- package/dist/native/primitives/TouchableOpacity.stx +5 -0
- package/dist/native/primitives/View.stx +5 -0
- package/dist/native/runtime/craft.d.ts +75 -0
- package/dist/native/runtime/craft.js +0 -0
- package/dist/native/runtime/entry.d.ts +1 -0
- package/dist/native/runtime/entry.js +3 -0
- package/dist/native/runtime/index.d.ts +45 -0
- package/dist/native/runtime/index.js +165 -0
- package/dist/native/runtime/native-host.d.ts +33 -0
- package/dist/native/runtime/native-host.js +184 -0
- package/dist/native/runtime/screen.d.ts +43 -0
- package/dist/native/runtime/screen.js +808 -0
- package/dist/pwa/service-worker.js +1 -1
- package/dist/pwa/workbox.js +1 -1
- package/dist/pwa.js +8 -8
- package/dist/site-url.d.ts +1 -1
- package/dist/ssg.js +53 -53
- package/dist/visual-testing.js +42 -42
- package/dist/web-components/reactive-generator.js +2 -2
- package/package.json +9 -5
- package/dist/chunk-0btmm4m2.js +0 -147
- package/dist/chunk-0c2h69k2.js +0 -4
- package/dist/chunk-0d0qeqvv.js +0 -2
- package/dist/chunk-0psndabd.js +0 -2
- package/dist/chunk-0qv8yf53.js +0 -2
- package/dist/chunk-0vkxyvsd.js +0 -2
- package/dist/chunk-0we9nw1d.js +0 -3
- package/dist/chunk-0xqdmemy.js +0 -3
- package/dist/chunk-0y46fbkx.js +0 -3
- package/dist/chunk-158wqccn.js +0 -4422
- package/dist/chunk-1cyxbb8y.js +0 -16
- package/dist/chunk-1enwnh2a.js +0 -2
- package/dist/chunk-213pzm0d.js +0 -3
- package/dist/chunk-21hzqyja.js +0 -12
- package/dist/chunk-266t58b8.js +0 -5
- package/dist/chunk-27fgag95.js +0 -4
- package/dist/chunk-2a9n102n.js +0 -2
- package/dist/chunk-2eqzrczk.js +0 -2
- package/dist/chunk-2ke37m54.js +0 -14
- package/dist/chunk-35ds08e7.js +0 -3
- package/dist/chunk-3mtwkjcg.js +0 -2
- package/dist/chunk-4xr8zwkp.js +0 -2
- package/dist/chunk-58v77x2c.js +0 -2
- package/dist/chunk-5mhq8605.js +0 -2
- package/dist/chunk-5se8xt9e.js +0 -64
- package/dist/chunk-5zh0h080.js +0 -2
- package/dist/chunk-62435225.js +0 -2
- package/dist/chunk-6kdrncsx.js +0 -30
- package/dist/chunk-6n2rr3x7.js +0 -2
- package/dist/chunk-6xk87qf2.js +0 -30
- package/dist/chunk-72rwcbp6.js +0 -3
- package/dist/chunk-76w34xne.js +0 -3
- package/dist/chunk-7ekd7zj9.js +0 -2
- package/dist/chunk-7pr3wdd5.js +0 -3
- package/dist/chunk-7rxvafwc.js +0 -24
- package/dist/chunk-7tnwfa7w.js +0 -8
- package/dist/chunk-8c5je0wf.js +0 -2
- package/dist/chunk-8dz6nyvx.js +0 -2
- package/dist/chunk-98zj3fv2.js +0 -7
- package/dist/chunk-9e8t0twa.js +0 -3
- package/dist/chunk-9fqp72ze.js +0 -5
- package/dist/chunk-anydpa34.js +0 -3
- package/dist/chunk-ay6zjq8v.js +0 -3
- package/dist/chunk-az4v4ard.js +0 -3
- package/dist/chunk-ba5erggg.js +0 -2
- package/dist/chunk-bnagrdz6.js +0 -2
- package/dist/chunk-by8wghtf.js +0 -2
- package/dist/chunk-cd7h4q51.js +0 -2
- package/dist/chunk-cjmv8hgp.js +0 -33
- package/dist/chunk-cthf912y.js +0 -2
- package/dist/chunk-cxbpmwq5.js +0 -4
- package/dist/chunk-d3sy16qn.js +0 -2
- package/dist/chunk-dh6s7mrj.js +0 -1199
- package/dist/chunk-dm2nzg7a.js +0 -2
- package/dist/chunk-e2sgcnxc.js +0 -2
- package/dist/chunk-e3b7jj74.js +0 -2
- package/dist/chunk-ec4wq2sv.js +0 -6
- package/dist/chunk-ekzg97dn.js +0 -29
- package/dist/chunk-epjt342x.js +0 -2
- package/dist/chunk-eqe26g14.js +0 -18
- package/dist/chunk-ev0v1yma.js +0 -2
- package/dist/chunk-f53psr2y.js +0 -5
- package/dist/chunk-f8p69dsg.js +0 -3
- package/dist/chunk-f95drhdb.js +0 -194
- package/dist/chunk-ff5a6hvb.js +0 -17
- package/dist/chunk-fs5fy4h8.js +0 -2
- package/dist/chunk-fzsygce3.js +0 -2
- package/dist/chunk-g465x63k.js +0 -2
- package/dist/chunk-g708ekh1.js +0 -2
- package/dist/chunk-gcr9e83g.js +0 -11
- package/dist/chunk-gdmyrsr8.js +0 -4
- package/dist/chunk-gkms2ngq.js +0 -2
- package/dist/chunk-gnfywmgs.js +0 -7
- package/dist/chunk-hpf8kq7e.js +0 -2
- package/dist/chunk-j4x3faf8.js +0 -2
- package/dist/chunk-jkavtw9f.js +0 -2
- package/dist/chunk-kg1rdena.js +0 -3
- package/dist/chunk-km91wx0v.js +0 -2
- package/dist/chunk-kmsyvaex.js +0 -8
- package/dist/chunk-mrahwn5v.js +0 -8
- package/dist/chunk-nk3czvnk.js +0 -2
- package/dist/chunk-nmw4eewb.js +0 -2
- package/dist/chunk-nq5zxrk0.js +0 -4
- package/dist/chunk-ny67c03k.js +0 -3
- package/dist/chunk-p4wdxp2c.js +0 -2
- package/dist/chunk-pcxp4r9n.js +0 -3
- package/dist/chunk-pdyeaxc1.js +0 -2
- package/dist/chunk-pf06ded4.js +0 -2
- package/dist/chunk-pfs0gpzm.js +0 -2
- package/dist/chunk-pshdwq44.js +0 -2
- package/dist/chunk-pwgv84pn.js +0 -32
- package/dist/chunk-pwsnafp3.js +0 -4367
- package/dist/chunk-q9n5swx7.js +0 -3
- package/dist/chunk-qr346wnp.js +0 -2
- package/dist/chunk-r02hke04.js +0 -2
- package/dist/chunk-ranshpyc.js +0 -3
- package/dist/chunk-rn194bhp.js +0 -20
- package/dist/chunk-rn1hgyc8.js +0 -930
- package/dist/chunk-s7z5dp70.js +0 -43
- package/dist/chunk-s8jd13nb.js +0 -3
- package/dist/chunk-sn7exv0n.js +0 -2
- package/dist/chunk-t1tdjjht.js +0 -216
- package/dist/chunk-t6qx04s8.js +0 -499
- package/dist/chunk-t6y6gyps.js +0 -2
- package/dist/chunk-tjfs7cc3.js +0 -2
- package/dist/chunk-tkyrk66a.js +0 -3
- package/dist/chunk-tntv9hvq.js +0 -2
- package/dist/chunk-v3nwkveg.js +0 -12
- package/dist/chunk-vd4cb5xr.js +0 -2
- package/dist/chunk-vkhdce50.js +0 -2
- package/dist/chunk-w183av08.js +0 -2
- package/dist/chunk-w2m02njv.js +0 -2
- package/dist/chunk-wpjrcrs5.js +0 -2
- package/dist/chunk-wqmppf6b.js +0 -3
- package/dist/chunk-wtb9fxdy.js +0 -2
- package/dist/chunk-xmzygmcz.js +0 -3
- package/dist/chunk-xsng1mtq.js +0 -3
- package/dist/chunk-xxzefj4j.js +0 -2
- package/dist/chunk-yq8x8bxq.js +0 -47
- package/dist/chunk-ytma76qe.js +0 -3
- package/dist/chunk-yw1m115e.js +0 -2
- package/dist/chunk-z64a924m.js +0 -2
- package/dist/chunk-zcz9rs6p.js +0 -3
package/dist/chunk-t6qx04s8.js
DELETED
|
@@ -1,499 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import"./chunk-ay6zjq8v.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
|
-
`)}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
|
-
`)}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
|
-
<html lang="en">
|
|
6
|
-
<head>
|
|
7
|
-
<meta charset="UTF-8">
|
|
8
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
9
|
-
<title>${M(Q)}</title>
|
|
10
|
-
<style>
|
|
11
|
-
* {
|
|
12
|
-
box-sizing: border-box;
|
|
13
|
-
margin: 0;
|
|
14
|
-
padding: 0;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
body {
|
|
18
|
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
|
|
19
|
-
background: #1a1a2e;
|
|
20
|
-
color: #eee;
|
|
21
|
-
min-height: 100vh;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.header {
|
|
25
|
-
background: #16213e;
|
|
26
|
-
padding: 1rem 2rem;
|
|
27
|
-
display: flex;
|
|
28
|
-
justify-content: space-between;
|
|
29
|
-
align-items: center;
|
|
30
|
-
border-bottom: 1px solid #0f3460;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.header h1 {
|
|
34
|
-
font-size: 1.5rem;
|
|
35
|
-
font-weight: 500;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.stats {
|
|
39
|
-
display: flex;
|
|
40
|
-
gap: 2rem;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.stat {
|
|
44
|
-
text-align: center;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.stat-value {
|
|
48
|
-
font-size: 1.25rem;
|
|
49
|
-
font-weight: bold;
|
|
50
|
-
color: #e94560;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.stat-label {
|
|
54
|
-
font-size: 0.75rem;
|
|
55
|
-
color: #888;
|
|
56
|
-
text-transform: uppercase;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.controls {
|
|
60
|
-
background: #16213e;
|
|
61
|
-
padding: 0.75rem 2rem;
|
|
62
|
-
display: flex;
|
|
63
|
-
gap: 1rem;
|
|
64
|
-
align-items: center;
|
|
65
|
-
border-bottom: 1px solid #0f3460;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.controls label {
|
|
69
|
-
display: flex;
|
|
70
|
-
align-items: center;
|
|
71
|
-
gap: 0.5rem;
|
|
72
|
-
cursor: pointer;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.controls input[type="checkbox"] {
|
|
76
|
-
width: 1rem;
|
|
77
|
-
height: 1rem;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.search-box {
|
|
81
|
-
flex: 1;
|
|
82
|
-
max-width: 300px;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.search-box input {
|
|
86
|
-
width: 100%;
|
|
87
|
-
padding: 0.5rem 1rem;
|
|
88
|
-
border: 1px solid #0f3460;
|
|
89
|
-
border-radius: 4px;
|
|
90
|
-
background: #1a1a2e;
|
|
91
|
-
color: #eee;
|
|
92
|
-
font-size: 0.875rem;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.search-box input:focus {
|
|
96
|
-
outline: none;
|
|
97
|
-
border-color: #e94560;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.breadcrumb {
|
|
101
|
-
background: #16213e;
|
|
102
|
-
padding: 0.5rem 2rem;
|
|
103
|
-
display: flex;
|
|
104
|
-
gap: 0.5rem;
|
|
105
|
-
align-items: center;
|
|
106
|
-
font-size: 0.875rem;
|
|
107
|
-
border-bottom: 1px solid #0f3460;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.breadcrumb-item {
|
|
111
|
-
color: #888;
|
|
112
|
-
cursor: pointer;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.breadcrumb-item:hover {
|
|
116
|
-
color: #e94560;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
.breadcrumb-item.active {
|
|
120
|
-
color: #eee;
|
|
121
|
-
cursor: default;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.breadcrumb-sep {
|
|
125
|
-
color: #444;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
#treemap {
|
|
129
|
-
width: 100%;
|
|
130
|
-
height: calc(100vh - 180px);
|
|
131
|
-
min-height: 400px;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
.tooltip {
|
|
135
|
-
position: fixed;
|
|
136
|
-
background: #16213e;
|
|
137
|
-
border: 1px solid #0f3460;
|
|
138
|
-
border-radius: 4px;
|
|
139
|
-
padding: 0.75rem 1rem;
|
|
140
|
-
pointer-events: none;
|
|
141
|
-
z-index: 1000;
|
|
142
|
-
max-width: 400px;
|
|
143
|
-
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
.tooltip-title {
|
|
147
|
-
font-weight: bold;
|
|
148
|
-
margin-bottom: 0.5rem;
|
|
149
|
-
word-break: break-all;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
.tooltip-row {
|
|
153
|
-
display: flex;
|
|
154
|
-
justify-content: space-between;
|
|
155
|
-
gap: 2rem;
|
|
156
|
-
font-size: 0.875rem;
|
|
157
|
-
color: #888;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.tooltip-row span:last-child {
|
|
161
|
-
color: #eee;
|
|
162
|
-
font-weight: 500;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
.legend {
|
|
166
|
-
position: fixed;
|
|
167
|
-
bottom: 1rem;
|
|
168
|
-
right: 1rem;
|
|
169
|
-
background: #16213e;
|
|
170
|
-
border: 1px solid #0f3460;
|
|
171
|
-
border-radius: 4px;
|
|
172
|
-
padding: 0.75rem 1rem;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
.legend-title {
|
|
176
|
-
font-size: 0.75rem;
|
|
177
|
-
color: #888;
|
|
178
|
-
margin-bottom: 0.5rem;
|
|
179
|
-
text-transform: uppercase;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
.legend-item {
|
|
183
|
-
display: flex;
|
|
184
|
-
align-items: center;
|
|
185
|
-
gap: 0.5rem;
|
|
186
|
-
font-size: 0.75rem;
|
|
187
|
-
margin-bottom: 0.25rem;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
.legend-color {
|
|
191
|
-
width: 12px;
|
|
192
|
-
height: 12px;
|
|
193
|
-
border-radius: 2px;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.node {
|
|
197
|
-
cursor: pointer;
|
|
198
|
-
transition: opacity 0.2s;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
.node:hover {
|
|
202
|
-
opacity: 0.8;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
.node-label {
|
|
206
|
-
font-size: 11px;
|
|
207
|
-
fill: #000;
|
|
208
|
-
pointer-events: none;
|
|
209
|
-
text-anchor: middle;
|
|
210
|
-
}
|
|
211
|
-
</style>
|
|
212
|
-
</head>
|
|
213
|
-
<body>
|
|
214
|
-
<div class="header">
|
|
215
|
-
<h1>${M(Q)}</h1>
|
|
216
|
-
<div class="stats">
|
|
217
|
-
<div class="stat">
|
|
218
|
-
<div class="stat-value" id="total-size">${W(X.totalSize)}</div>
|
|
219
|
-
<div class="stat-label">Total Size</div>
|
|
220
|
-
</div>
|
|
221
|
-
<div class="stat">
|
|
222
|
-
<div class="stat-value" id="gzip-size">${W(X.totalGzipSize)}</div>
|
|
223
|
-
<div class="stat-label">Gzip Size</div>
|
|
224
|
-
</div>
|
|
225
|
-
<div class="stat">
|
|
226
|
-
<div class="stat-value">${X.moduleCount}</div>
|
|
227
|
-
<div class="stat-label">Modules</div>
|
|
228
|
-
</div>
|
|
229
|
-
<div class="stat">
|
|
230
|
-
<div class="stat-value">${X.chunks.length}</div>
|
|
231
|
-
<div class="stat-label">Chunks</div>
|
|
232
|
-
</div>
|
|
233
|
-
</div>
|
|
234
|
-
</div>
|
|
235
|
-
|
|
236
|
-
<div class="controls">
|
|
237
|
-
<div class="search-box">
|
|
238
|
-
<input type="text" id="search" placeholder="Search modules...">
|
|
239
|
-
</div>
|
|
240
|
-
<label>
|
|
241
|
-
<input type="checkbox" id="show-gzip" ${$?"checked":""}>
|
|
242
|
-
Show Gzip Size
|
|
243
|
-
</label>
|
|
244
|
-
</div>
|
|
245
|
-
|
|
246
|
-
<div class="breadcrumb" id="breadcrumb">
|
|
247
|
-
<span class="breadcrumb-item active">root</span>
|
|
248
|
-
</div>
|
|
249
|
-
|
|
250
|
-
<div id="treemap"></div>
|
|
251
|
-
|
|
252
|
-
<div class="tooltip" id="tooltip" style="display: none;"></div>
|
|
253
|
-
|
|
254
|
-
<div class="legend">
|
|
255
|
-
<div class="legend-title">File Types</div>
|
|
256
|
-
<div class="legend-item">
|
|
257
|
-
<div class="legend-color" style="background: ${K.js}"></div>
|
|
258
|
-
<span>JavaScript</span>
|
|
259
|
-
</div>
|
|
260
|
-
<div class="legend-item">
|
|
261
|
-
<div class="legend-color" style="background: ${K.css}"></div>
|
|
262
|
-
<span>CSS</span>
|
|
263
|
-
</div>
|
|
264
|
-
<div class="legend-item">
|
|
265
|
-
<div class="legend-color" style="background: ${K.html}"></div>
|
|
266
|
-
<span>HTML</span>
|
|
267
|
-
</div>
|
|
268
|
-
<div class="legend-item">
|
|
269
|
-
<div class="legend-color" style="background: ${K.image}"></div>
|
|
270
|
-
<span>Images</span>
|
|
271
|
-
</div>
|
|
272
|
-
<div class="legend-item">
|
|
273
|
-
<div class="legend-color" style="background: ${K.font}"></div>
|
|
274
|
-
<span>Fonts</span>
|
|
275
|
-
</div>
|
|
276
|
-
<div class="legend-item">
|
|
277
|
-
<div class="legend-color" style="background: ${K.other}"></div>
|
|
278
|
-
<span>Other</span>
|
|
279
|
-
</div>
|
|
280
|
-
</div>
|
|
281
|
-
|
|
282
|
-
<script src="https://d3js.org/d3.v7.min.js"></script>
|
|
283
|
-
<script>
|
|
284
|
-
const data = ${q};
|
|
285
|
-
const colors = ${JSON.stringify(K)};
|
|
286
|
-
|
|
287
|
-
let showGzip = ${$};
|
|
288
|
-
let currentRoot = data;
|
|
289
|
-
let searchTerm = '';
|
|
290
|
-
|
|
291
|
-
const container = document.getElementById('treemap');
|
|
292
|
-
const tooltip = document.getElementById('tooltip');
|
|
293
|
-
const breadcrumb = document.getElementById('breadcrumb');
|
|
294
|
-
const searchInput = document.getElementById('search');
|
|
295
|
-
const showGzipCheckbox = document.getElementById('show-gzip');
|
|
296
|
-
|
|
297
|
-
function formatSize(bytes) {
|
|
298
|
-
if (bytes < 1024) return bytes + ' B';
|
|
299
|
-
if (bytes < 1024 * 1024) return (bytes / 1024).toFixed(2) + ' KB';
|
|
300
|
-
return (bytes / (1024 * 1024)).toFixed(2) + ' MB';
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
function getColor(d) {
|
|
304
|
-
if (d.data.type) {
|
|
305
|
-
return colors[d.data.type] || colors.other;
|
|
306
|
-
}
|
|
307
|
-
if (d.data.name.includes('node_modules') || d.data.name.includes('vendor')) {
|
|
308
|
-
return colors.vendor;
|
|
309
|
-
}
|
|
310
|
-
return colors.other;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
function getSizeValue(d) {
|
|
314
|
-
return showGzip ? d.data.gzipSize : d.data.size;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
function render() {
|
|
318
|
-
container.innerHTML = '';
|
|
319
|
-
|
|
320
|
-
const width = container.clientWidth;
|
|
321
|
-
const height = container.clientHeight;
|
|
322
|
-
|
|
323
|
-
const hierarchy = d3.hierarchy(currentRoot)
|
|
324
|
-
.sum(d => {
|
|
325
|
-
if (searchTerm && d.name && !d.name.toLowerCase().includes(searchTerm.toLowerCase())) {
|
|
326
|
-
return 0;
|
|
327
|
-
}
|
|
328
|
-
return d.children ? 0 : getSizeValue({ data: d });
|
|
329
|
-
})
|
|
330
|
-
.sort((a, b) => getSizeValue(b) - getSizeValue(a));
|
|
331
|
-
|
|
332
|
-
const treemap = d3.treemap()
|
|
333
|
-
.size([width, height])
|
|
334
|
-
.paddingOuter(3)
|
|
335
|
-
.paddingTop(19)
|
|
336
|
-
.paddingInner(1)
|
|
337
|
-
.round(true);
|
|
338
|
-
|
|
339
|
-
const root = treemap(hierarchy);
|
|
340
|
-
|
|
341
|
-
const svg = d3.select(container)
|
|
342
|
-
.append('svg')
|
|
343
|
-
.attr('width', width)
|
|
344
|
-
.attr('height', height);
|
|
345
|
-
|
|
346
|
-
const node = svg.selectAll('g')
|
|
347
|
-
.data(root.descendants().filter(d => d.depth > 0))
|
|
348
|
-
.join('g')
|
|
349
|
-
.attr('transform', d => \`translate(\${d.x0},\${d.y0})\`);
|
|
350
|
-
|
|
351
|
-
node.append('rect')
|
|
352
|
-
.attr('class', 'node')
|
|
353
|
-
.attr('width', d => Math.max(0, d.x1 - d.x0))
|
|
354
|
-
.attr('height', d => Math.max(0, d.y1 - d.y0))
|
|
355
|
-
.attr('fill', d => getColor(d))
|
|
356
|
-
.attr('stroke', '#1a1a2e')
|
|
357
|
-
.attr('stroke-width', 1)
|
|
358
|
-
.on('click', (event, d) => {
|
|
359
|
-
if (d.children) {
|
|
360
|
-
zoomIn(d.data);
|
|
361
|
-
}
|
|
362
|
-
})
|
|
363
|
-
.on('mouseover', (event, d) => showTooltip(event, d))
|
|
364
|
-
.on('mousemove', (event) => moveTooltip(event))
|
|
365
|
-
.on('mouseout', hideTooltip);
|
|
366
|
-
|
|
367
|
-
node.append('text')
|
|
368
|
-
.attr('class', 'node-label')
|
|
369
|
-
.attr('x', d => (d.x1 - d.x0) / 2)
|
|
370
|
-
.attr('y', d => (d.y1 - d.y0) / 2 + 4)
|
|
371
|
-
.text(d => {
|
|
372
|
-
const width = d.x1 - d.x0;
|
|
373
|
-
const height = d.y1 - d.y0;
|
|
374
|
-
if (width < 40 || height < 20) return '';
|
|
375
|
-
const name = d.data.name;
|
|
376
|
-
const maxLen = Math.floor(width / 7);
|
|
377
|
-
return name.length > maxLen ? name.slice(0, maxLen - 2) + '..' : name;
|
|
378
|
-
});
|
|
379
|
-
|
|
380
|
-
// Group headers
|
|
381
|
-
node.filter(d => d.children)
|
|
382
|
-
.append('text')
|
|
383
|
-
.attr('x', 4)
|
|
384
|
-
.attr('y', 14)
|
|
385
|
-
.attr('fill', '#000')
|
|
386
|
-
.attr('font-size', '12px')
|
|
387
|
-
.attr('font-weight', 'bold')
|
|
388
|
-
.text(d => {
|
|
389
|
-
const width = d.x1 - d.x0;
|
|
390
|
-
const name = d.data.name;
|
|
391
|
-
const maxLen = Math.floor(width / 7);
|
|
392
|
-
return name.length > maxLen ? name.slice(0, maxLen - 2) + '..' : name;
|
|
393
|
-
});
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
function showTooltip(event, d) {
|
|
397
|
-
const size = d.data.size || d.value;
|
|
398
|
-
const gzipSize = d.data.gzipSize || Math.round(size * 0.3);
|
|
399
|
-
const path = d.data.path || d.data.name;
|
|
400
|
-
|
|
401
|
-
tooltip.innerHTML = \`
|
|
402
|
-
<div class="tooltip-title">\${path}</div>
|
|
403
|
-
<div class="tooltip-row">
|
|
404
|
-
<span>Size</span>
|
|
405
|
-
<span>\${formatSize(size)}</span>
|
|
406
|
-
</div>
|
|
407
|
-
<div class="tooltip-row">
|
|
408
|
-
<span>Gzip</span>
|
|
409
|
-
<span>\${formatSize(gzipSize)}</span>
|
|
410
|
-
</div>
|
|
411
|
-
\${d.data.type ? \`<div class="tooltip-row"><span>Type</span><span>\${d.data.type}</span></div>\` : ''}
|
|
412
|
-
\${d.children ? \`<div class="tooltip-row"><span>Children</span><span>\${d.children.length}</span></div>\` : ''}
|
|
413
|
-
\`;
|
|
414
|
-
tooltip.style.display = 'block';
|
|
415
|
-
moveTooltip(event);
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
function moveTooltip(event) {
|
|
419
|
-
const x = event.clientX + 10;
|
|
420
|
-
const y = event.clientY + 10;
|
|
421
|
-
tooltip.style.left = x + 'px';
|
|
422
|
-
tooltip.style.top = y + 'px';
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
function hideTooltip() {
|
|
426
|
-
tooltip.style.display = 'none';
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
function zoomIn(node) {
|
|
430
|
-
currentRoot = node;
|
|
431
|
-
updateBreadcrumb();
|
|
432
|
-
render();
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
function zoomOut(index) {
|
|
436
|
-
let node = data;
|
|
437
|
-
const parts = getBreadcrumbParts();
|
|
438
|
-
for (let i = 1; i <= index; i++) {
|
|
439
|
-
const child = node.children?.find(c => c.name === parts[i]);
|
|
440
|
-
if (child) node = child;
|
|
441
|
-
}
|
|
442
|
-
currentRoot = node;
|
|
443
|
-
updateBreadcrumb();
|
|
444
|
-
render();
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
function getBreadcrumbParts() {
|
|
448
|
-
const parts = ['root'];
|
|
449
|
-
let node = currentRoot;
|
|
450
|
-
const path = [];
|
|
451
|
-
|
|
452
|
-
function findPath(current, target, currentPath) {
|
|
453
|
-
if (current === target) {
|
|
454
|
-
path.push(...currentPath);
|
|
455
|
-
return true;
|
|
456
|
-
}
|
|
457
|
-
if (current.children) {
|
|
458
|
-
for (const child of current.children) {
|
|
459
|
-
if (findPath(child, target, [...currentPath, child.name])) {
|
|
460
|
-
return true;
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
return false;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
if (currentRoot !== data) {
|
|
468
|
-
findPath(data, currentRoot, []);
|
|
469
|
-
parts.push(...path);
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
return parts;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
function updateBreadcrumb() {
|
|
476
|
-
const parts = getBreadcrumbParts();
|
|
477
|
-
breadcrumb.innerHTML = parts.map((part, i) => {
|
|
478
|
-
const isLast = i === parts.length - 1;
|
|
479
|
-
const sep = i > 0 ? '<span class="breadcrumb-sep">/</span>' : '';
|
|
480
|
-
return \`\${sep}<span class="breadcrumb-item \${isLast ? 'active' : ''}" onclick="zoomOut(\${i})">\${part}</span>\`;
|
|
481
|
-
}).join('');
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
searchInput.addEventListener('input', (e) => {
|
|
485
|
-
searchTerm = e.target.value;
|
|
486
|
-
render();
|
|
487
|
-
});
|
|
488
|
-
|
|
489
|
-
showGzipCheckbox.addEventListener('change', (e) => {
|
|
490
|
-
showGzip = e.target.checked;
|
|
491
|
-
render();
|
|
492
|
-
});
|
|
493
|
-
|
|
494
|
-
window.addEventListener('resize', render);
|
|
495
|
-
|
|
496
|
-
render();
|
|
497
|
-
</script>
|
|
498
|
-
</body>
|
|
499
|
-
</html>`}function a(X){let Z={name:"root",size:X.totalSize,gzipSize:X.totalGzipSize,children:[]};for(let Q of X.chunks){let $={name:Q.name,size:Q.size,gzipSize:Q.gzipSize,children:[]};for(let U of Q.modules)e($,U);Z.children.push($)}return Z}function e(X,Z){let Q=Z.path.split("/"),$=X;for(let K=0;K<Q.length-1;K++){let j=Q[K],q=$.children?.find((J)=>J.name===j);if(!q){if(q={name:j,size:0,gzipSize:0,children:[]},!$.children)$.children=[];$.children.push(q)}$=q}let U=Q[Q.length-1];if(!$.children)$.children=[];$.children.push({name:U,path:Z.path,size:Z.size,gzipSize:Z.gzipSize,type:Z.type}),s(X,Z.size,Z.gzipSize)}function s(X,Z,Q){}function M(X){return X.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function T(X){let Z=process.platform,Q=Z==="darwin"?"open":Z==="win32"?"start":"xdg-open";Bun.spawn([Q,X],{stdio:["ignore","ignore","ignore"]})}import P from"fs";import S from"path";async function CQ(X={}){let{directory:Z="dist",output:Q,format:$="html",open:U=!0,gzip:K=!0,threshold:j,recommendations:q=!0,topModules:J=20,parseImports:F=!0}=X,V=await L(Z,{parseImports:F,detectDuplicates:!0,topModulesCount:J}),_=j?typeof j==="string"?I(j):j:void 0,w=_?V.totalSize>_:!1,G,C;if($==="html"){let A={title:`Bundle Analysis - ${S.basename(S.resolve(Z))}`,gzip:K};if(G=x(V,A),C=Q||S.join(Z,"bundle-report.html"),await P.promises.writeFile(C,G),U)T(C)}else if(G=R(V,{format:$,threshold:_,recommendations:q,topModules:J,showGzip:K}),Q)C=Q,await P.promises.writeFile(C,G);return{stats:V,report:G,outputPath:C,exceedsThreshold:w}}async function GQ(X){let Z=await L(X,{parseImports:!1,detectDuplicates:!1,topModulesCount:0});return{totalSize:Z.totalSize,totalSizeFormatted:W(Z.totalSize),gzipSize:Z.totalGzipSize,gzipSizeFormatted:W(Z.totalGzipSize),moduleCount:Z.moduleCount,chunkCount:Z.chunks.length}}export{E as percentage,I as parseSize,T as openInBrowser,n as getModuleRecommendation,GQ as getBundleSummary,x as generateTreemap,R as generateReport,W as formatBytes,L as collectBundleStats,N as analyzeBundle,CQ as analyze};
|
package/dist/chunk-t6y6gyps.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ep as a,fp as b,gp as c,hp as d,ip as e,jp as f,kp as g}from"./chunk-pwsnafp3.js";import"./chunk-1cyxbb8y.js";import"./chunk-zcz9rs6p.js";import"./chunk-v3nwkveg.js";import"./chunk-9fqp72ze.js";import"./chunk-0btmm4m2.js";import"./chunk-pwgv84pn.js";import"./chunk-tkyrk66a.js";import"./chunk-ranshpyc.js";import"./chunk-98zj3fv2.js";import"./chunk-35ds08e7.js";import"./chunk-5se8xt9e.js";import"./chunk-gnfywmgs.js";import"./chunk-yq8x8bxq.js";import"./chunk-266t58b8.js";import"./chunk-nq5zxrk0.js";import"./chunk-az4v4ard.js";import"./chunk-4f9zyfdw.js";import"./chunk-xssw417m.js";import"./chunk-kg1rdena.js";import"./chunk-ay6zjq8v.js";export{a as resetUnscopedSignalWarnings,g as processStackReplacements,f as processStackPushDirectives,e as processIncludes,b as partialsCache,c as onceStore,d as clearOnceStore};
|
package/dist/chunk-tjfs7cc3.js
DELETED
package/dist/chunk-tkyrk66a.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
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 Ft,K as Gt,O as Ht,H as It,Q as Jt,W as Kt};
|
package/dist/chunk-tntv9hvq.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Mr as a,Nr as b,Or as c,Pr as d,Qr as e,Rr as f}from"./chunk-pwsnafp3.js";import"./chunk-1cyxbb8y.js";import"./chunk-zcz9rs6p.js";import"./chunk-v3nwkveg.js";import"./chunk-9fqp72ze.js";import"./chunk-0btmm4m2.js";import"./chunk-pwgv84pn.js";import"./chunk-tkyrk66a.js";import"./chunk-ranshpyc.js";import"./chunk-98zj3fv2.js";import"./chunk-35ds08e7.js";import"./chunk-5se8xt9e.js";import"./chunk-gnfywmgs.js";import"./chunk-yq8x8bxq.js";import"./chunk-266t58b8.js";import"./chunk-nq5zxrk0.js";import"./chunk-az4v4ard.js";import"./chunk-4f9zyfdw.js";import"./chunk-xssw417m.js";import"./chunk-kg1rdena.js";import"./chunk-ay6zjq8v.js";export{f as validateConfig,b as resolveStxDirectories,c as loadStxConfig,e as defineStxConfig,a as defaultConfig,d as config};
|
package/dist/chunk-v3nwkveg.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
function G(H,M){let j=H[M],J=M+1;while(J<H.length){if(H[J]==="\\"){J+=2;continue}if(H[J]===j)return J+1;J++}return H.length}function K(H,M){let j=M+1;while(j<H.length){if(H[j]==="\\"){j+=2;continue}if(H[j]==="`")return j+1;if(H[j]==="$"&&H[j+1]==="{"){if(j=F(H,j+2),j<H.length)j++;continue}j++}return H.length}function F(H,M){let j=1,J=M;while(J<H.length){let U=H[J];if(U==="\\"){J+=2;continue}if(U==='"'||U==="'"){J=G(H,J);continue}if(U==="`"){J=K(H,J);continue}if(U==="/"&&H[J+1]==="/"){while(J<H.length&&H[J]!==`
|
|
3
|
-
`)J++;continue}if(U==="/"&&H[J+1]==="*"){J+=2;while(J<H.length&&H.slice(J,J+2)!=="*/")J++;J+=2;continue}if(U==="{"){j++,J++;continue}if(U==="}"){if(j--,j===0)return J;J++;continue}J++}return H.length}var O=new Set(["return","typeof","instanceof","in","of","new","delete","void","throw","case","do","else","yield","await"]);function P(H,M){if(M)return O.has(M);return!(H===")"||H==="]"||H===z)}var z="\x00";function Q(H,M){let j=M+1,J=!1;while(j<H.length){let U=H[j];if(U===`
|
|
4
|
-
`)return-1;if(U==="\\"){j+=2;continue}if(U==="[")J=!0;else if(U==="]")J=!1;else if(U==="/"&&!J){j++;while(j<H.length&&/[a-z]/i.test(H[j]))j++;return j}j++}return-1}function X(H){let M="",j=0,J="",U="";while(j<H.length){let Z=H.slice(j,j+2);if(Z==="//"){while(j<H.length&&H[j]!==`
|
|
5
|
-
`)M+=" ",j++;continue}if(Z==="/*"){while(j<H.length&&H.slice(j,j+2)!=="*/")M+=H[j]===`
|
|
6
|
-
`?`
|
|
7
|
-
`:" ",j++;M+=" ",j+=2;continue}let V=H[j];if(V==='"'||V==="'"){let $=V;M+=" ",j++;while(j<H.length&&H[j]!==$){if(H[j]==="\\"){M+=" ",j+=2;continue}M+=H[j]===`
|
|
8
|
-
`?`
|
|
9
|
-
`:" ",j++}M+=" ",j++,J=z,U="";continue}if(V==="/"&&P(J,U)){let $=Q(H,j);if($!==-1){M+=`/${" ".repeat($-j-2)}/`,j=$,J=z,U="";continue}}if(V==="`"){M+=" ",j++;while(j<H.length&&H[j]!=="`"){if(H[j]==="\\"){M+=" ",j+=2;continue}if(H[j]==="$"&&H[j+1]==="{"){let $=j+2,B=F(H,$);if(M+=" ",M+=X(H.slice($,B)),B<H.length)M+=" ";j=B+1;continue}M+=H[j]===`
|
|
10
|
-
`?`
|
|
11
|
-
`:" ",j++}M+=" ",j++,J=z,U="";continue}if(M+=V,j++,/[\w$]/.test(V))U=/[\w$]/.test(J)?U+V:V,J=V;else if(!/\s/.test(V))J=V,U=""}return M}function Y(H){let M=new Uint16Array(H.length),j=0,J=!0;for(let U=0;U<H.length;U++){let Z=H[U];if(Z===")"||Z==="]"||Z==="}")if(j===0)J=!1;else j--;if(M[U]=j,Z==="("||Z==="["||Z==="{")j++}return{depths:M,balanced:J&&j===0}}
|
|
12
|
-
export{F as Gs,X as Hs,Y as Is};
|
package/dist/chunk-vd4cb5xr.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{$g as d,Yg as a,Zg as b,_g as c,ah as e,bh as f,ch as g,dh as h,eh as i}from"./chunk-dm2nzg7a.js";import"./chunk-pcxp4r9n.js";import"./chunk-ay6zjq8v.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};
|
package/dist/chunk-vkhdce50.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Aj as p,Bj as q,zj as o}from"./chunk-kgd8kchy.js";import{Hj as a,Ij as b,Jj as c,Kj as d,Lj as e,Mj as f,Nj as g,Oj as h,Pj as i,Qj as j,Rj as k,Sj as l,Tj as m,Uj as n}from"./chunk-9e8t0twa.js";import"./chunk-az4v4ard.js";import"./chunk-ay6zjq8v.js";export{n as useOptimistic,l as untrack,a as state,g as runMountCallbacks,h as runDestroyCallbacks,i as pendingLifecycleCounts,m as peek,e as onMount,f as onDestroy,j as isSignal,k as isDerived,p as generateSignalsRuntimeDev,o as generateSignalsRuntime,c as effect,b as derived,q as default,d as batch};
|
package/dist/chunk-w183av08.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Gg as a,Hg as b,Ig as c,Jg as d,Kg as e,Lg as f,Mg as g,Ng as h,Og as i,Pg as j,Qg as k,Rg as l}from"./chunk-xsng1mtq.js";import"./chunk-ay6zjq8v.js";export{g as toUsers,f as toUser,c as stopBroadcasting,b as startBroadcasting,d as loadChannels,a as getBroadcastServer,j as channel,h as broadcastPrivate,i as broadcastPresence,e as broadcast,l as BroadcastServer,k as Broadcast};
|
package/dist/chunk-w2m02njv.js
DELETED
package/dist/chunk-wpjrcrs5.js
DELETED
package/dist/chunk-wqmppf6b.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Eg as I}from"./chunk-ny67c03k.js";import{Or as H}from"./chunk-pwsnafp3.js";import{kx as G}from"./chunk-ay6zjq8v.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-pdyeaxc1.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 $e};
|
package/dist/chunk-wtb9fxdy.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{di as a,ei as b,fi as c,gi as d,hi as e,ii as f,ji as g,ki as h}from"./chunk-27fgag95.js";import"./chunk-9e8t0twa.js";import"./chunk-ay6zjq8v.js";export{d as v,a as useForm,g as processHasErrorsDirective,h as processFormValidationDirectives,f as processErrorsDirective,e as processErrorDirective,b as defineForm,c as Validator};
|
package/dist/chunk-xmzygmcz.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ag as YJ,Cg as jJ,hg as ZJ,jg as g,lg as A,sg as n,vg as GJ,yg as WJ}from"./chunk-6xk87qf2.js";import{Fg as $J}from"./chunk-ny67c03k.js";import{Cl as XJ}from"./chunk-ec4wq2sv.js";import{xo as h}from"./chunk-pwsnafp3.js";import{Ys as e}from"./chunk-pwgv84pn.js";import{$t as QJ,du as i,fu as p}from"./chunk-35ds08e7.js";import{Tw as l,Yw as VJ,qw as KJ}from"./chunk-4f9zyfdw.js";import{kx as DJ}from"./chunk-ay6zjq8v.js";import JJ from"fs";import k from"path";var{serve:wJ}=globalThis.Bun;VJ();import y from"zlib";import{promisify as a}from"util";var IJ=a(y.brotliCompress),OJ=a(y.gzip),UJ=["text/","application/json","application/javascript","application/xml","application/xhtml+xml","application/rss+xml","application/atom+xml","application/manifest+json","image/svg+xml"],BJ=["text/event-stream","multipart/x-mixed-replace"],_J=1024;function zJ(K){if(!K)return!1;let J=K.toLowerCase();if(BJ.some((G)=>J.startsWith(G)))return!1;return UJ.some((G)=>J.startsWith(G))}function FJ(K){let J=new Map;for(let G of K.split(",")){let[Z,...W]=G.trim().split(";"),O=Z.trim().toLowerCase();if(!O)continue;let U=1;for(let B of W){let w=/^\s*q\s*=\s*([\d.]+)\s*$/i.exec(B);if(!w)continue;let F=Number.parseFloat(w[1]);if(Number.isFinite(F))U=F}J.set(O,U)}return J}function LJ(K){if(!K)return null;let J=FJ(K),G=J.get("*"),Z=(W)=>J.get(W)??G??0;if(Z("br")>0)return"br";if(Z("gzip")>0)return"gzip";return null}async function t(K,J,G={}){if(J.headers.get("content-encoding"))return J;if(J.status===204||J.status===304||!J.body)return J;if(!zJ(J.headers.get("content-type")))return J;let Z=LJ(K.headers.get("accept-encoding"));if(!Z)return J;let W;try{W=new Uint8Array(await J.arrayBuffer())}catch{return J}let O=()=>new Response(W,{status:J.status,statusText:J.statusText,headers:s(J.headers)});if(W.length<(G.threshold??_J))return O();try{let U=Z==="br"?await IJ(W,{params:{[y.constants.BROTLI_PARAM_QUALITY]:G.quality??5,[y.constants.BROTLI_PARAM_SIZE_HINT]:W.length}}):await OJ(W);if(U.length>=W.length)return O();let B=s(J.headers);return B.set("Content-Encoding",Z),B.set("Content-Length",String(U.length)),new Response(U,{status:J.status,statusText:J.statusText,headers:B})}catch{return O()}}function s(K){let J=new Headers(K),G=J.get("Vary");if(!G)return J.set("Vary","Accept-Encoding"),J;if(!G.split(",").some((W)=>W.trim().toLowerCase()==="accept-encoding"))J.set("Vary",`${G}, Accept-Encoding`);return J}class d{now;entries=new e(1000,{maxBytes:33554432,sizeOf:(K)=>K.body.byteLength+JSON.stringify(K.headers).length*2});pending=new Map;generation=0;constructor(K=Date.now){this.now=K}invalidate(K){this.generation++,this.pending.clear();for(let J of Array.from(this.entries.keys()))if(K===void 0||this.entries.get(J)?.path===K)this.entries.delete(J)}async respond(K,J,G){let Z,W=async()=>{let X=Z??await G();return X.headers.set("Cache-Control","private, no-store"),X.headers.set("Vary",A(X.headers.get("Vary")).Vary),X};if(!J||K.method!=="GET"||K.headers.has("Cookie")||K.headers.has("Authorization")||K.headers.has("Range"))return W();let O=new URL(K.url),U=`${O.origin}${O.pathname}${O.search}|${g(K)?"fragment":"document"}`,B=this.entries.get(U),w=(X)=>{let T=new Headers(X.headers);return T.set("Cache-Control","private, no-store"),T.set("Age",String(Math.max(0,Math.floor((this.now()-X.created)/1000)))),new Response(X.body.slice(0),{headers:T})},F=B?(this.now()-B.created)/1000:1/0;if(B&&F<J.maxAge)return w(B);let S=this.generation,q=async()=>{let X=await G();Z=X;let T=(X.headers.get("Vary")??"").toLowerCase().split(",").map((L)=>L.trim()).filter(Boolean);if(X.status!==200||X.headers.has("Set-Cookie")||/(?:private|no-store|no-cache)/i.test(X.headers.get("Cache-Control")??"")||T.some((L)=>L!=="x-stx-router"&&L!=="accept-encoding"))return null;let M=await X.clone().arrayBuffer();if(M.byteLength>1048576)return null;X.headers.set("Vary",A(X.headers.get("Vary")).Vary);let Q={body:M,headers:Array.from(X.headers.entries()),created:this.now(),path:O.pathname};if(this.generation===S)this.entries.set(U,Q);return Q},H=this.pending.get(U);if(!H){if(this.pending.size>=1000)return W();H=q().finally(()=>{if(this.pending.get(U)===H)this.pending.delete(U)}),this.pending.set(U,H)}if(B&&F<J.maxAge+(J.swr??0))return H.catch(()=>{}),w(B);let x=await H;return x?w(x):W()}}var HJ={".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 uJ(K={}){let J=k.resolve(K.outputDir||".output"),G=K.port??3000,Z=GJ(J);if(!Z)console.error("[stx] No build manifest found. Run `stx build` first."),process.exit(1);console.log(`[stx] Production server loading ${Z.routes.length} routes...`);let W=$J(Z.routeRules),O=new d,U=XJ(J,Z.apiRoutes??[]),B=Bun.file(k.join(J,"server/runtime-config.json")),w=K.runtimeConfig??(await B.exists()?await B.json():void 0),F=w?i(w):void 0,S=new Map,q=new Map,H=new Map,x=new Map;for(let Q of Z.routes)try{let L=k.join(J,Q.compiledPath),Y=JSON.parse(await Bun.file(L).text());if(F)Y.html=p(Y.html,F);S.set(Q.pattern,Y),H.set(Q.pattern,l(Y.html)),x.set(Q.pattern,h(Y.html));let C=k.join(J,Q.fragmentPath);if(await Bun.file(C).exists()){let P=await Bun.file(C).text();q.set(Q.pattern,F?p(P,F):P)}}catch(L){console.warn(`[stx] Failed to load route ${Q.pattern}:`,L)}let X=new Map,T=[];for(let Q of Z.routes)if(Q.hasParams){let{regex:L,params:Y}=KJ(Q.pattern);T.push({regex:L,route:Q,paramNames:Y})}else X.set(Q.pattern,Q);let M=wJ({port:G,async fetch(Q){return t(Q,await QJ(F??i(),async()=>{let Y=new URL(Q.url).pathname;if(K.onRequest){let j=await K.onRequest(Q);if(j)return j}if(K.apiRouter){let j=await K.apiRouter.handleRequest(Q);if(j.status!==404)return j}if(K.apiRoutes?.[Y])return K.apiRoutes[Y](Q);let C=await U(Q);if(C)return C;if((Q.method==="GET"||Q.method==="HEAD")&&Y!=="/"){let j=k.resolve(J,"public"),_;try{_=decodeURIComponent(Y)}catch{_=Y}if(!_.includes("\x00")){let I=k.resolve(j,`.${_}`);if(I===j||I.startsWith(`${j}${k.sep}`))try{if(JJ.existsSync(I)&&JJ.statSync(I).isFile()){let z=k.extname(I).toLowerCase(),E=HJ[z]||"application/octet-stream",v=Y.startsWith("/__stx/")||/\.[0-9a-f]{8}\./.test(Y);return new Response(Bun.file(I),{headers:{"Content-Type":E,"Cache-Control":v?"public, max-age=31536000, immutable":"public, max-age=3600"}})}}catch{}}}let P=g(Q),D=null,o={};if(D=X.get(Y)||null,!D)for(let{regex:j,route:_,paramNames:I}of T){let $=Y.match(j);if($){D=_,I.forEach((z,E)=>{o[z]=$[E+1]});break}}if(!D){let j=X.get("/404")||null;if(j){let _=S.get(j.pattern);if(_)return new Response(_.html,{status:404,headers:{"Content-Type":"text/html"}})}return new Response("Not Found",{status:404})}let R=W(Y),r=Object.keys(R).length>0;return O.respond(Q,R.cache,async()=>{let j=S.get(D.pattern);if(P&&Q.method==="GET"&&j&&!j.hasServerScripts&&Object.keys(j.placeholders).length===0){let $=q.get(D.pattern);if($){let z=H.get(D.pattern);return new Response($,{status:j.status??200,headers:{"Content-Type":"text/html","X-STX-Fragment":"true",...x.has(D.pattern)?{"X-STX-Runtime":x.get(D.pattern)?"true":"false"}:{},...z?{"X-STX-Layout":z.layout,"X-STX-Layout-Group":z.group}:{},...A(),...R.cache?{}:{"Cache-Control":ZJ}}})}}let _=WJ(Q.method),I=S.get(D.pattern);if(!I){let $=X.get("/500")||null;if($){let z=S.get($.pattern);if(z)return new Response(z.html,{status:500,headers:{"Content-Type":"text/html"}})}return new Response("Internal Server Error",{status:500})}if(D.prerendered&&_)return new Response("Prerendered pages do not accept actions",{status:405,headers:{Allow:"GET, HEAD"}});if(!_&&!I.hasServerScripts&&Object.keys(I.placeholders).length===0)return new Response(I.html,{status:I.status??200,headers:{"Content-Type":"text/html",...A(),"Cache-Control":"public, max-age=60"}});try{let{html:$,boundaries:z,redirect:E,cookies:v,status:m,headers:c}=await jJ(I,{params:o,request:Q,method:Q.method,__stx_strict_hydration:r,__stx_runtime_config:F});if(E)return YJ(E,v,c);if(z&&z.length>0){let{renderStreamingPage:N,streamToResponse:u}=await import("./chunk-epjt342x.js"),b=new Headers({...A(),...c,"Cache-Control":"private, no-store"});for(let f of v??[])b.append("Set-Cookie",f);if(P&&!_){let f=l($);b.set("X-STX-Fragment","true"),b.set("X-STX-Runtime",h($)?"true":"false"),b.set("X-STX-Layout",f.layout),b.set("X-STX-Layout-Group",f.group)}return u(N(P&&!_?n($,Z.routerContainer||"main"):$,z,{timeoutMs:30000}),{status:m??I.status??200,headers:b})}let V=new Headers({"Content-Type":"text/html",...A(),...R.cache?{}:{"Cache-Control":"private, no-store"}});for(let N of v??[])V.append("Set-Cookie",N);for(let[N,u]of Object.entries(c??{}))V.set(N,u);if(V.set("Vary",A(V.get("Vary")).Vary),P&&!_){let N=l($);return V.set("X-STX-Fragment","true"),V.set("X-STX-Runtime",h($)?"true":"false"),V.set("X-STX-Layout",N.layout),V.set("X-STX-Layout-Group",N.group),new Response(n($,Z.routerContainer||"main"),{status:m??I.status??200,headers:V})}return new Response($,{status:m??I.status??200,headers:V})}catch($){if(console.error(`[stx] Hydration error for ${Y}:`,$),r)return new Response("Internal Server Error",{status:500});return new Response(I.html,{headers:{"Content-Type":"text/html"}})}})}))}});return console.log(`[stx] Production server running at http://localhost:${M.port}`),console.log(`[stx] Serving ${Z.routes.length} routes (${S.size} pre-loaded)`),{port:M.port,stop:()=>{O.invalidate(),M.stop()},invalidate:(Q)=>O.invalidate(Q)}}
|
|
3
|
-
export{zJ as af,LJ as bf,t as cf,uJ as df};
|
package/dist/chunk-xsng1mtq.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Broadcast as D,BroadcastServer as U}from"ts-broadcasting";import{channel as b}from"ts-broadcasting";import{Broadcast as N,BroadcastServer as p}from"ts-broadcasting";var z=null,H=[];function X(){return z}async function Y(j){if(z)return z;let k=j.driver??"bun",q=j.host??"0.0.0.0",G=j.port??6001,J=j.scheme??"ws",E={verbose:j.verbose??!1,driver:k,default:k,connections:{[k]:{driver:k,host:q,port:G,scheme:J}}};return z=new U(E),D.setServer(z),await z.start(),z}async function Z(){for(let j of H)clearInterval(j);if(H.length=0,!z)return;await z.stop(),z=null}async function $(j){let k=await import(j),q=k.default??k;if(typeof q!=="function")throw Error(`routes/channels.ts must export a default function, got ${typeof q}`);let G=0;return q({channel(E,A){if(G++,A.authorize&&z)z.channels.channel(E,A.authorize);if(A.interval&&A.data){let L=A.event??`${E}.updated`,M=A.data,Q=setInterval(async()=>{try{let T=await M();V(E,L,T)}catch{}},A.interval);H.push(Q)}}}),G}var K=!1;function F(){if(z)return!0;if(!K)K=!0,console.warn("[stx] broadcast() called before server started \u2014 messages will be sent once broadcasting is ready");return!1}function V(j,k,q){if(!F())return;D.send(j,k,q)}function x(j,k,q){if(!F())return;D.toUser(j,k,q)}function C(j,k,q){if(!F())return;D.toUsers(j,k,q)}function S(j,k,q){if(!F())return;D.send(`private-${j}`,k,q)}function w(j,k,q){if(!F())return;D.presence(j,k,q)}
|
|
3
|
-
export{X as Gg,Y as Hg,Z as Ig,$ as Jg,V as Kg,x as Lg,C as Mg,S as Ng,w as Og,b as Pg,N as Qg,p as Rg};
|
package/dist/chunk-xxzefj4j.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{ef as a,ff as b,gf as c,hf as d,if as e,jf as f,kf as g,lf as h,mf as i,nf as j,of as k,pf as l,qf as m,rf as n,sf as o}from"./chunk-6kdrncsx.js";import"./chunk-ay6zjq8v.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};
|