@stacksjs/stx 0.2.527 → 0.2.529
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-hqvdm4h9.js → chunk-07abr1v4.js} +1 -1
- package/dist/chunk-0fna7gd0.js +2 -0
- package/dist/chunk-0ksq0e6s.js +2 -0
- package/dist/{chunk-4c1afy15.js → chunk-0rt5ec7a.js} +2 -2
- package/dist/{chunk-365ktg70.js → chunk-0ytm2ecf.js} +6 -6
- package/dist/chunk-16k8mkwm.js +2 -0
- package/dist/{chunk-yexnqmz3.js → chunk-1c7v7pqv.js} +2 -2
- package/dist/{chunk-802qf0vz.js → chunk-1e7g79x4.js} +1 -1
- package/dist/chunk-1n8d0htz.js +2 -0
- package/dist/chunk-1q4yn31s.js +2 -0
- package/dist/{chunk-8xpyzcq2.js → chunk-1s7qdv2h.js} +3 -3
- package/dist/{chunk-er7y8hk9.js → chunk-1v6yyvxf.js} +2 -2
- package/dist/chunk-1wp8qb5f.js +2 -0
- package/dist/{chunk-jcmgj8kk.js → chunk-21rm5kv6.js} +2 -2
- package/dist/{chunk-kp4mzspk.js → chunk-299xbyhn.js} +4 -4
- package/dist/chunk-2bwhc8ea.js +2 -0
- package/dist/{chunk-3y8ykqpx.js → chunk-2m5mx0x8.js} +1 -1
- package/dist/chunk-2p0dbz34.js +2 -0
- package/dist/{chunk-01rz8h7x.js → chunk-2twfqcxm.js} +2 -2
- package/dist/{chunk-dne8n6h3.js → chunk-2y82wf9d.js} +2 -2
- package/dist/{chunk-8fb1mqw1.js → chunk-346zc43s.js} +1 -1
- package/dist/{chunk-3s9s1mdt.js → chunk-35j1evvy.js} +3 -3
- package/dist/{chunk-bqz4wenr.js → chunk-3cn7973z.js} +1 -1
- package/dist/chunk-3j02tj5n.js +2 -0
- package/dist/{chunk-eacd5755.js → chunk-3j9de8yh.js} +1 -1
- package/dist/chunk-3v2bf157.js +2 -0
- package/dist/chunk-4dm3fj16.js +2 -0
- package/dist/chunk-4mmz9xxh.js +2837 -0
- package/dist/{chunk-fxxrrq9n.js → chunk-58jyc7kp.js} +3 -3
- package/dist/{chunk-dqe0cvyp.js → chunk-5ew3rq40.js} +1 -1
- package/dist/{chunk-yxdyh23k.js → chunk-5tyes97j.js} +2 -2
- package/dist/{chunk-04h0z6z9.js → chunk-5zk6kyjt.js} +2 -2
- package/dist/chunk-62s4jb6m.js +2 -0
- package/dist/{chunk-jbvg29t0.js → chunk-6k7spr38.js} +5 -5
- package/dist/{chunk-g6c8d3f5.js → chunk-6rdnzn77.js} +4 -4
- package/dist/{chunk-e62nw7zk.js → chunk-6t0rq51y.js} +2 -2
- package/dist/chunk-7c1ntx2e.js +2 -0
- package/dist/{chunk-hjxfg4bv.js → chunk-7mg0cybn.js} +9 -9
- package/dist/{chunk-gynes6rm.js → chunk-7p0zerfj.js} +8 -8
- package/dist/{chunk-9z1hxkxe.js → chunk-7rz4fy4y.js} +4 -4
- package/dist/chunk-84p3bcpx.js +2 -0
- package/dist/{chunk-ygetbydb.js → chunk-869wyw0j.js} +6 -6
- package/dist/chunk-8a4mndgc.js +2 -0
- package/dist/chunk-8dbnvypv.js +2 -0
- package/dist/{chunk-gbfap7rv.js → chunk-8m3k43d3.js} +6 -6
- package/dist/{chunk-c57j92td.js → chunk-9mjy16pw.js} +2 -2
- package/dist/chunk-9x9bp5w8.js +2 -0
- package/dist/chunk-ad0czgpa.js +2 -0
- package/dist/chunk-axjzqh7v.js +2 -0
- package/dist/{chunk-e5hqhzbx.js → chunk-baxwjmj3.js} +2 -2
- package/dist/{chunk-bb4agtjs.js → chunk-bs2e3g25.js} +2 -2
- package/dist/{chunk-tkagcknf.js → chunk-csbft3wz.js} +2 -2
- package/dist/{chunk-67actssw.js → chunk-d8ramz4s.js} +2 -2
- package/dist/chunk-dvph69ej.js +2 -0
- package/dist/chunk-dzt3bvvn.js +2 -0
- package/dist/chunk-e1c9gypy.js +2 -0
- package/dist/chunk-e9f55nee.js +2 -0
- package/dist/chunk-eadr1eph.js +2 -0
- package/dist/chunk-eh3nvr2g.js +2 -0
- package/dist/{chunk-x81vcxzs.js → chunk-f1n4e4jy.js} +2 -2
- package/dist/{chunk-2bv5g3rf.js → chunk-f3y397xy.js} +6 -6
- package/dist/{chunk-s9mq9x2k.js → chunk-f5pmyxtn.js} +5 -5
- package/dist/chunk-fanmabb0.js +2 -0
- package/dist/chunk-fdcrrpgn.js +2 -0
- package/dist/chunk-fjd5ka6v.js +2 -0
- package/dist/{chunk-2j04bc8c.js → chunk-fk45zc1b.js} +4 -4
- package/dist/chunk-fq5xecrx.js +2 -0
- package/dist/chunk-gaz311xs.js +2 -0
- package/dist/{chunk-hktvv0hd.js → chunk-ggb57j6c.js} +2 -2
- package/dist/{chunk-h6q8jafh.js → chunk-hbwmmt91.js} +2 -2
- package/dist/chunk-hmk2x1t8.js +2 -0
- package/dist/chunk-hnn0pdz1.js +2 -0
- package/dist/chunk-j00h4d3w.js +2 -0
- package/dist/chunk-j1tbfabt.js +2 -0
- package/dist/chunk-jagpqt9y.js +2 -0
- package/dist/chunk-jh6nh2m0.js +2 -0
- package/dist/{chunk-n34kagea.js → chunk-jj8ssn0d.js} +2 -2
- package/dist/chunk-jkd0c82m.js +2 -0
- package/dist/{chunk-4dgbr7mm.js → chunk-jwgzj5at.js} +3 -3
- package/dist/chunk-jwx0h9qb.js +2 -0
- package/dist/{chunk-2h25j8se.js → chunk-k3tq1k4m.js} +3 -3
- package/dist/chunk-k4p80n25.js +2 -0
- package/dist/{chunk-1aw9qbdf.js → chunk-kpns3659.js} +167 -18
- package/dist/chunk-m2wzrk3d.js +2 -0
- package/dist/chunk-n26xx6x5.js +2 -0
- package/dist/chunk-n6rzr34r.js +2 -0
- package/dist/{chunk-1c407nky.js → chunk-p8c5g5n2.js} +5 -5
- package/dist/chunk-pkwed7dt.js +2 -0
- package/dist/chunk-pqwx5hw8.js +2 -0
- package/dist/chunk-qap3fwv8.js +2 -0
- package/dist/{chunk-qt6f70d8.js → chunk-raqbqt1r.js} +57 -15
- package/dist/{chunk-v9yx1kva.js → chunk-s1evrkrv.js} +2 -2
- package/dist/{chunk-1835r718.js → chunk-smn7sssc.js} +2 -2
- package/dist/{chunk-qrntkbfy.js → chunk-tn7nvmah.js} +1 -1
- package/dist/{chunk-vp827ah7.js → chunk-v2zxxjqn.js} +5 -5
- package/dist/chunk-v70hfs6d.js +2 -0
- package/dist/{chunk-bq7a2bn4.js → chunk-vbv5jqkz.js} +5 -5
- package/dist/chunk-vrdg365w.js +2 -0
- package/dist/chunk-w5kx0qzg.js +2 -0
- package/dist/{chunk-zv0vgamy.js → chunk-wn5zjs5m.js} +2 -2
- package/dist/chunk-wpm4emgb.js +2 -0
- package/dist/{chunk-3ynfz6h8.js → chunk-wqxdx2td.js} +2 -2
- package/dist/chunk-wsjrvxs9.js +33 -0
- package/dist/{chunk-nfsx6bjj.js → chunk-ww68p1kb.js} +1 -1
- package/dist/{chunk-xx2pk2ay.js → chunk-x1tzt7yc.js} +4 -4
- package/dist/chunk-xgmqes1s.js +2 -0
- package/dist/{chunk-gte0wmh8.js → chunk-xpvvne6r.js} +5 -5
- package/dist/{chunk-fesb4h31.js → chunk-y0c1srgj.js} +5 -5
- package/dist/chunk-y4b60ke0.js +2 -0
- package/dist/{chunk-5hmpecme.js → chunk-ycxz2exz.js} +3 -3
- package/dist/{chunk-4hz4g5ym.js → chunk-yh3p86qa.js} +2 -2
- package/dist/chunk-yqh6dny3.js +2 -0
- package/dist/{chunk-s691cnew.js → chunk-yy19rrw6.js} +1 -1
- package/dist/{chunk-d0k39nsg.js → chunk-yyb5se8j.js} +3 -3
- package/dist/chunk-zc8cz12e.js +2 -0
- package/dist/{chunk-vzedh4wk.js → chunk-ze832cpr.js} +7 -7
- package/dist/{chunk-x8mp9yvn.js → chunk-zw029e7n.js} +3 -3
- package/dist/cli.js +13 -13
- package/dist/client-parameter-bindings.d.ts +14 -0
- package/dist/client-parameter-bindings.js +75 -5
- package/dist/client-script.js +26 -0
- package/dist/composable-loader.js +32 -2
- package/dist/composables/use-router.js +4 -3
- package/dist/craft-entry.js +2 -2
- package/dist/craft.js +2 -2
- package/dist/includes.js +5 -3
- package/dist/pwa.js +3 -3
- package/dist/runtime-injection.js +6 -0
- package/dist/signals.js +50 -8
- package/dist/ssg.js +3 -3
- package/dist/types/config-types.d.ts +13 -0
- package/package.json +5 -5
- package/dist/chunk-0eptxhzy.js +0 -2
- package/dist/chunk-1mkyksne.js +0 -2
- package/dist/chunk-1zz2n4ks.js +0 -2
- package/dist/chunk-2bx2ara9.js +0 -2
- package/dist/chunk-38x0j2tz.js +0 -2
- package/dist/chunk-3c9t71pc.js +0 -2
- package/dist/chunk-3kxh9rsp.js +0 -2
- package/dist/chunk-3vqabd10.js +0 -2
- package/dist/chunk-490f2x2r.js +0 -2
- package/dist/chunk-4k65naeg.js +0 -2
- package/dist/chunk-5c1qesrs.js +0 -2
- package/dist/chunk-5j0fm4jy.js +0 -2837
- package/dist/chunk-7kc1kvqj.js +0 -33
- package/dist/chunk-7sbp7fh9.js +0 -2
- package/dist/chunk-9c86wgnk.js +0 -2
- package/dist/chunk-9jvdqjjb.js +0 -2
- package/dist/chunk-9pvectyv.js +0 -2
- package/dist/chunk-9s3tf3m3.js +0 -2
- package/dist/chunk-arjd987g.js +0 -2
- package/dist/chunk-avq5209p.js +0 -2
- package/dist/chunk-azt3h9fz.js +0 -2
- package/dist/chunk-b0bgprzs.js +0 -2
- package/dist/chunk-b42pdbmp.js +0 -2
- package/dist/chunk-bdr76feh.js +0 -2
- package/dist/chunk-c08wyf6x.js +0 -2
- package/dist/chunk-cdzf37ck.js +0 -2
- package/dist/chunk-cwnqjdys.js +0 -2
- package/dist/chunk-cxdcb0m5.js +0 -2
- package/dist/chunk-d81rv3bn.js +0 -2
- package/dist/chunk-fh5rp6wb.js +0 -2
- package/dist/chunk-fq7h8s3y.js +0 -2
- package/dist/chunk-gmpm0mw2.js +0 -2
- package/dist/chunk-gty89j8s.js +0 -2
- package/dist/chunk-hfns8btd.js +0 -2
- package/dist/chunk-hmyyq2hh.js +0 -2
- package/dist/chunk-j49qp4z7.js +0 -2
- package/dist/chunk-kkn0m1eg.js +0 -2
- package/dist/chunk-kxvtyh05.js +0 -2
- package/dist/chunk-mcx90969.js +0 -2
- package/dist/chunk-n1mww6x2.js +0 -2
- package/dist/chunk-n5z38q4m.js +0 -2
- package/dist/chunk-n7xgf1v9.js +0 -2
- package/dist/chunk-njpxfd44.js +0 -2
- package/dist/chunk-p5pna1sn.js +0 -2
- package/dist/chunk-qky9zfvx.js +0 -2
- package/dist/chunk-rn2w32kh.js +0 -2
- package/dist/chunk-rv50x1hm.js +0 -2
- package/dist/chunk-s9w4f0pb.js +0 -2
- package/dist/chunk-sy5s02tw.js +0 -2
- package/dist/chunk-tf239jvd.js +0 -2
- package/dist/chunk-vc1m5fr9.js +0 -2
- package/dist/chunk-vck6xky6.js +0 -2
- package/dist/chunk-vhhcdk5q.js +0 -2
- package/dist/chunk-vww5a3k9.js +0 -2
- package/dist/chunk-z6nm6rf1.js +0 -2
package/dist/ssg.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"./chunk-2hc5mbw8.js";import"./chunk-
|
|
2
|
+
import"./chunk-2hc5mbw8.js";import"./chunk-0ytm2ecf.js";import"./chunk-9mjy16pw.js";import{et,tt,nt,rt,st,ot}from"./chunk-kpns3659.js";import"./chunk-5tyes97j.js";import"./chunk-ba88n1j7.js";import{f,Be,N,K,n,o}from"./chunk-4mmz9xxh.js";import"./chunk-7p0zerfj.js";import{nr}from"./chunk-8m3k43d3.js";import"./chunk-6k4f583z.js";import"./chunk-yy19rrw6.js";import"./chunk-e6y6s7q8.js";import"./chunk-299xbyhn.js";import"./chunk-6rdnzn77.js";import{ie,mt,ht}from"./chunk-ycxz2exz.js";import{Oo,Do,Mo}from"./chunk-1v6yyvxf.js";import{ft,Yt,Zt}from"./chunk-g7ey7mtw.js";import"./chunk-58jyc7kp.js";import{a}from"./chunk-2y82wf9d.js";import x from"fs";import g from"path";import{createHash as Dt}from"crypto";function Rt(t){try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(t).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return t}}var kt=/<script\s+type="stx\/island"\s+data-stx-island="([^"]+)"([^>]*)>([\s\S]*?)<\/script>/g;function Ct(t){return Bun.hash(t).toString(16)}function ut(t,i={}){if(!t.includes('type="stx/island"'))return{html:t,chunks:[]};let s=new Map,r=t.replace(kt,(e,l,w,y)=>{let h=y.trim();if(!h)return e;if(/\bdata-stx-src=/.test(w))return e;if(i.minify)h=Rt(h);let S=Ct(h);if(!s.has(S))s.set(S,h);let P=i.integrity?` data-stx-integrity="sha384-${Dt("sha384").update(h).digest("base64")}"`:"";return`<script type="stx/island" data-stx-island="${l}" data-stx-src="/_stx/islands/${S}.js"${P}${w}></script>`}),c=Array.from(s,([e,l])=>({hash:e,code:l}));return{html:r,chunks:c}}var Et=new Set(["visible","idle"]);function dt(t){if(!t.includes("data-stx-src="))return t;let i=new Map,s=/data-stx-scope="([^"]+)"[^>]*?stx-hydrate="([^"]+)"/g,r;while((r=s.exec(t))!==null)i.set(r[1],r[2]);let c=new Set,e=/data-stx-island="([^"]+)"[^>]*?data-stx-src="([^"]+)"/g,l;while((l=e.exec(t))!==null)if(Et.has(i.get(l[1])||""))c.add(l[2]);let w=t.lastIndexOf("</head>");if(c.size===0||w===-1)return t;let y=Array.from(c).filter((h)=>!t.includes(`rel="prefetch" href="${h}"`)).map((h)=>`<link rel="prefetch" href="${h}" as="script">`).join("");if(!y)return t;return t.slice(0,w)+y+t.slice(w)}var It=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function q(t){let i=t.trim();if(!i)return null;let s=/^https?:\/\//i.test(i)?i:`https://${i}`;try{return new URL(s).origin+new URL(s).pathname.replace(/\/$/,"")}catch{return null}}function Bt(t){for(let i of It){let s=t[i];if(!s)continue;let r=q(s);if(r)return{url:r,source:"env",via:i}}return null}function gt(t){if(!t||typeof t!=="object")return null;let i=t,s=i.site?.url??i.url??i.app?.url;return typeof s==="string"?q(s):null}async function jt(t){let{existsSync:i}=await import("fs"),s=await import("path");for(let r of["site.config.ts","site.config.js",".config/site.config.ts"]){let c=s.resolve(t,r);if(!i(c))continue;try{let e=await import(c),l=gt(e.default??e);if(l)return l}catch{}}return null}async function pt(t={}){let i=t.cwd??process.cwd(),s=t.env??process.env;if(t.explicit){let l=q(t.explicit);if(l)return{url:l,source:"option"}}let r=gt(t.stxConfig);if(r)return{url:r,source:"stx.config",via:"site.url"};let c=await jt(i);if(c)return{url:c,source:"site.config",via:"url"};let e=Bt(s);if(e)return e;return{url:"http://localhost",source:"fallback"}}function wt(){return["No site URL configured \u2014 sitemap.xml and robots.txt will point at http://localhost."," Set one in stx.config.ts (site: { url: 'https://example.com' }), in site.config.ts,"," via --domain, or with SITE_URL in the build environment."].join(`
|
|
3
3
|
`)}class yt{cacheDir;cache=new Map;loaded=!1;salt;constructor(t,i=""){this.cacheDir=t,this.salt=i}async load(){if(this.loaded)return;let t=g.join(this.cacheDir,"build-cache.json");if(await Bun.file(t).exists())try{let i=JSON.parse(await Bun.file(t).text());for(let[s,r]of Object.entries(i))this.cache.set(s,r)}catch{}this.loaded=!0}async save(){await x.promises.mkdir(this.cacheDir,{recursive:!0});let t=g.join(this.cacheDir,"build-cache.json"),i={};for(let[s,r]of this.cache)i[s]=r;await Bun.write(t,JSON.stringify(i))}getHash(t,i){let s=x.statSync(t),r=`${this.salt}|${t}:${s.mtimeMs}`;for(let e of i)if(x.existsSync(e)){let l=x.statSync(e);r+=`:${e}:${l.mtimeMs}`}let c=0;for(let e=0;e<r.length;e++){let l=r.charCodeAt(e);c=(c<<5)-c+l,c=c&c}return Math.abs(c).toString(36)}get(t,i){let s=this.cache.get(t);if(!s)return null;let r=this.getHash(i,s.dependencies??[]);if(s.hash!==r)return this.cache.delete(t),null;return s.html}set(t,i,s,r){let c=this.getHash(i,s);this.cache.set(t,{hash:c,html:r,generatedAt:Date.now(),dependencies:s})}}class St{cacheDir;constructor(t){this.cacheDir=t}getFilePath(t){let i=t.replace(/[^a-zA-Z0-9]/g,"_")+".json";return g.join(this.cacheDir,"isr",i)}async get(t){let i=this.getFilePath(t);if(!await Bun.file(i).exists())return null;try{return JSON.parse(await Bun.file(i).text())}catch{return null}}async set(t,i){let s=this.getFilePath(t);await x.promises.mkdir(g.dirname(s),{recursive:!0}),await Bun.write(s,JSON.stringify(i))}async invalidate(t){let i=this.getFilePath(t);if(await Bun.file(i).exists())await x.promises.unlink(i)}async invalidatePattern(t){let i=g.join(this.cacheDir,"isr");if(!x.existsSync(i))return;let s=await x.promises.readdir(i);for(let r of s){let c=r.replace(/_/g,"/").replace(".json","");if(t.test(c))await x.promises.unlink(g.join(i,r))}}async needsRevalidation(t){let i=await this.get(t);if(!i)return!0;return Date.now()>i.revalidateAfter}}async function Ft(t){try{let s=(await Bun.file(t).text()).match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!s)return null;let r=s[1];if(!r.includes("getStaticPaths"))return null;let c=r.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticPaths\s*\([^)]*\)\s*\{([\s\S]*?)\n[\t ]*\}/);if(!c)return null;return await Function(`
|
|
4
4
|
return (async function getStaticPaths() {
|
|
5
5
|
${c[1]}
|
|
@@ -41,7 +41,7 @@ ${t.map((r)=>{let c=new URL(r.loc,i).href,e=` <url>
|
|
|
41
41
|
${s.join(`
|
|
42
42
|
`)}
|
|
43
43
|
</channel>
|
|
44
|
-
</rss>`}async function zt(t={}){let i=Date.now();ht();let s=await o(process.cwd()),r=s.build||{},c=await pt({explicit:t.domain||r.domain,stxConfig:s});if(c.source==="fallback"&&(t.sitemap??r.sitemap??!0))console.warn(wt());let e={router:t.router??s?.router??{},pagesDir:t.pagesDir||r.pagesDir||"pages",outputDir:t.outputDir||r.outputDir||"dist",baseUrl:t.baseUrl||r.baseUrl||"/",domain:c.url,revalidate:t.revalidate??r.revalidate??!1,sitemap:t.sitemap??r.sitemap??!0,sitemapExclude:t.sitemapExclude||r.sitemapExclude||[],robots:t.robots??r.robots??!0,rss:t.rss??r.rss??!1,concurrency:t.concurrency||r.concurrency||10,cache:t.cache??r.cache??!0,cacheDir:t.cacheDir||r.cacheDir||a(process.cwd(),"ssg-cache"),contentLoaders:t.contentLoaders||[],hooks:t.hooks||{},minify:t.minify??r.minify??!0,generate404:t.generate404??r.generate404??!0,publicDir:t.publicDir||r.publicDir||"public",trailingSlash:t.trailingSlash??r.trailingSlash??!1,cleanOutput:t.cleanOutput??r.cleanOutput??!0,cacheSalt:t.cacheSalt??"",partialsDir:t.partialsDir||s?.partialsDir||"",componentsDir:t.componentsDir||s?.componentsDir||"",failOnIncludeError:t.failOnIncludeError??!0,failOnServerScriptError:t.failOnServerScriptError??!0,chunkIslands:t.chunkIslands===!0,prefetchIslands:t.prefetchIslands===!0,integrityIslands:t.integrityIslands===!0},l={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},w=new Set,y=0,h={},S={};await e.hooks.onBuildStart?.();try{if(e.cleanOutput&&x.existsSync(e.outputDir))await x.promises.rm(e.outputDir,{recursive:!0});await x.promises.mkdir(e.outputDir,{recursive:!0});let D=e.cacheSalt;if(!D){let{resolveUserCssConfig:u,fingerprintConfig:m}=await import("./chunk-
|
|
44
|
+
</rss>`}async function zt(t={}){let i=Date.now();ht();let s=await o(process.cwd()),r=s.build||{},c=await pt({explicit:t.domain||r.domain,stxConfig:s});if(c.source==="fallback"&&(t.sitemap??r.sitemap??!0))console.warn(wt());let e={router:t.router??s?.router??{},pagesDir:t.pagesDir||r.pagesDir||"pages",outputDir:t.outputDir||r.outputDir||"dist",baseUrl:t.baseUrl||r.baseUrl||"/",domain:c.url,revalidate:t.revalidate??r.revalidate??!1,sitemap:t.sitemap??r.sitemap??!0,sitemapExclude:t.sitemapExclude||r.sitemapExclude||[],robots:t.robots??r.robots??!0,rss:t.rss??r.rss??!1,concurrency:t.concurrency||r.concurrency||10,cache:t.cache??r.cache??!0,cacheDir:t.cacheDir||r.cacheDir||a(process.cwd(),"ssg-cache"),contentLoaders:t.contentLoaders||[],hooks:t.hooks||{},minify:t.minify??r.minify??!0,generate404:t.generate404??r.generate404??!0,publicDir:t.publicDir||r.publicDir||"public",trailingSlash:t.trailingSlash??r.trailingSlash??!1,cleanOutput:t.cleanOutput??r.cleanOutput??!0,cacheSalt:t.cacheSalt??"",partialsDir:t.partialsDir||s?.partialsDir||"",componentsDir:t.componentsDir||s?.componentsDir||"",failOnIncludeError:t.failOnIncludeError??!0,failOnServerScriptError:t.failOnServerScriptError??!0,chunkIslands:t.chunkIslands===!0,prefetchIslands:t.prefetchIslands===!0,integrityIslands:t.integrityIslands===!0},l={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},w=new Set,y=0,h={},S={};await e.hooks.onBuildStart?.();try{if(e.cleanOutput&&x.existsSync(e.outputDir))await x.promises.rm(e.outputDir,{recursive:!0});await x.promises.mkdir(e.outputDir,{recursive:!0});let D=e.cacheSalt;if(!D){let{resolveUserCssConfig:u,fingerprintConfig:m}=await import("./chunk-pqwx5hw8.js");try{D=m(await u(process.cwd()))}catch{}}let{prepareImageDelivery:p}=await import("./chunk-xgmqes1s.js"),b=await p(e.publicDir,e.outputDir);if(b.count>0)console.log(`Optimized ${b.count} image(s) for responsive delivery`),D=[D,b.fingerprint].filter(Boolean).join(":");let B=new yt(e.cacheDir,D);if(e.cache)await B.load();try{let{generateCss:u}=await import("./chunk-pqwx5hw8.js");await u('<div class="bg-black"></div>')}catch{}et();let vt=s?.routeMiddleware?.dir||"middleware";await nt(process.cwd(),vt);let H=tt();if(H.length>0)console.log(`Loaded ${H.length} middleware: ${H.join(", ")}`);let bt=s?.routeMiddleware?.global||[];Mo(s?.layoutsDir,a(process.cwd()));let V=N(".",{pagesDir:e.pagesDir,pagesDirs:s?._layerPageDirs});console.log(`Found ${V.length} routes`);let _=[];for(let u of V){let m=await Ot(u);for(let v of m)_.push({route:u,url:v.url,params:v.params,props:v.props,revalidate:v.revalidate??e.revalidate})}l.totalPages=_.length,console.log(`Generating ${l.totalPages} pages...`);let A=[],X=[];for(let u=0;u<_.length;u+=e.concurrency)X.push(_.slice(u,u+e.concurrency));for(let u of X)await Promise.all(u.map(async(m)=>{let{route:v,url:d,params:L,props:Pt,revalidate:Q}=m;try{await e.hooks.onPageStart?.(d);let j=await Bun.file(v.filePath).text(),F=Jt(j),$t=F?.middleware?Array.isArray(F.middleware)?F.middleware:[F.middleware]:[],it=[...bt,...$t];if(it.length>0){let C=rt(d,L,F||{}),O=st(C,null,void 0,{isServer:!0}),E=await ot(it,O);if(E.redirect){let R=typeof E.redirect==="string"?E.redirect:E.redirect.path||E.redirect,U=Vt(String(R),d),T=Kt(d,e);await x.promises.mkdir(g.dirname(T),{recursive:!0}),await Bun.write(T,U),l.successCount++,l.pages.push({route:d,outputPath:T,size:Buffer.byteLength(U),cached:!1}),A.push({loc:d,lastmod:new Date().toISOString()}),console.log(` \u21B3 ${d} \u2192 redirect to ${R}`);return}if(E.abort){let R=typeof E.abort==="string"?E.abort:E.abort?.error?.message||"aborted";console.warn(` \u21B3 ${d} \u2014 middleware aborted: ${R}`);return}}let at=j.match(/definePageMeta\s*\(\s*\{[\s\S]*?validate\s*:\s*((?:\([^)]*\)|[^,}])*(?:\{[\s\S]*?\})?)/m);if(at)try{if(!await Function("route",`
|
|
45
45
|
const validate = ${at[1]};
|
|
46
46
|
return validate(route);
|
|
47
47
|
`)({params:L})){console.warn(`Validation failed for ${d}, skipping...`);return}}catch{}let k=null,ct=!1;if(e.cache){if(k=B.get(d,v.filePath),k)ct=!0,l.cachedCount++}if(!k){let C=await xt(v,L,Pt,e,s);if(k=C.html,e.failOnIncludeError&&C.includeFailures.length>0)throw Error(`${C.includeFailures.length} include(s) failed to resolve, so this page would have shipped with an error banner where the markup should be:
|
|
@@ -73,7 +73,7 @@ ${u}`)}if(e.cache)await B.save();if(e.generate404){let u=g.join(e.pagesDir,"404.
|
|
|
73
73
|
<a href="/">Go home</a>
|
|
74
74
|
</div>
|
|
75
75
|
</body>
|
|
76
|
-
</html>`)}for(let u of[500]){let m=g.join(e.pagesDir,`${u}.stx`);if(await Bun.file(m).exists()){let v=new Set,d={...s,debug:!1,cache:!1},L=await n(await Bun.file(m).text(),{},m,d,v);await Bun.write(g.join(e.outputDir,`${u}.html`),L)}}let W=g.join(e.pagesDir,"error.stx");if(await Bun.file(W).exists()){let u=new Set,m={...s,debug:!1,cache:!1},v=await n(await Bun.file(W).text(),{},W,m,u);await Bun.write(g.join(e.outputDir,"error.html"),v)}if(e.sitemap&&A.length>0){let u=Gt(A,e.domain),m=g.join(e.outputDir,"sitemap.xml");await Bun.write(m,u),l.sitemapPath=m,console.log(`Generated sitemap.xml with ${A.length} URLs`)}if(e.robots!==!1){let u=typeof e.robots==="object"?e.robots:{},m=[...e.sitemapExclude.filter((d)=>typeof d==="string"),...u.disallow||[]],v=nr({rules:[{userAgent:u.userAgent||"*",allow:u.allow||["/"],...m.length>0?{disallow:m}:{}}],...u.sitemap!==!1&&l.sitemapPath?{sitemap:new URL("/sitemap.xml",e.domain).href}:{}});await Bun.write(g.join(e.outputDir,"robots.txt"),v),console.log("Generated robots.txt")}if(e.rss){let u=typeof e.rss==="object"?e.rss:{title:"Site Feed",description:"Latest updates",link:e.domain},m=[];if(u.getItems)m=await u.getItems();let v=Nt(u,m),d=g.join(e.outputDir,"rss.xml");await Bun.write(d,v),l.rssPath=d,console.log(`Generated rss.xml with ${m.length} items`)}let G=
|
|
76
|
+
</html>`)}for(let u of[500]){let m=g.join(e.pagesDir,`${u}.stx`);if(await Bun.file(m).exists()){let v=new Set,d={...s,debug:!1,cache:!1},L=await n(await Bun.file(m).text(),{},m,d,v);await Bun.write(g.join(e.outputDir,`${u}.html`),L)}}let W=g.join(e.pagesDir,"error.stx");if(await Bun.file(W).exists()){let u=new Set,m={...s,debug:!1,cache:!1},v=await n(await Bun.file(W).text(),{},W,m,u);await Bun.write(g.join(e.outputDir,"error.html"),v)}if(e.sitemap&&A.length>0){let u=Gt(A,e.domain),m=g.join(e.outputDir,"sitemap.xml");await Bun.write(m,u),l.sitemapPath=m,console.log(`Generated sitemap.xml with ${A.length} URLs`)}if(e.robots!==!1){let u=typeof e.robots==="object"?e.robots:{},m=[...e.sitemapExclude.filter((d)=>typeof d==="string"),...u.disallow||[]],v=nr({rules:[{userAgent:u.userAgent||"*",allow:u.allow||["/"],...m.length>0?{disallow:m}:{}}],...u.sitemap!==!1&&l.sitemapPath?{sitemap:new URL("/sitemap.xml",e.domain).href}:{}});await Bun.write(g.join(e.outputDir,"robots.txt"),v),console.log("Generated robots.txt")}if(e.rss){let u=typeof e.rss==="object"?e.rss:{title:"Site Feed",description:"Latest updates",link:e.domain},m=[];if(u.getItems)m=await u.getItems();let v=Nt(u,m),d=g.join(e.outputDir,"rss.xml");await Bun.write(d,v),l.rssPath=d,console.log(`Generated rss.xml with ${m.length} items`)}let G=Oo(e.outputDir);if(G.assets>0)console.log(`Externalized ${G.assets} asset(s) from ${G.pages} page(s) (${(G.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);let z=Do(e.outputDir);if(z.assets>0)console.log(`Externalized ${z.assets} repeated asset(s) from ${z.pages} page(s) (${(z.bytesInlined/1024).toFixed(1)}KB removed from HTML)`);if(e.publicDir&&x.existsSync(e.publicDir))await J(e.publicDir,e.outputDir),console.log(`Copied public assets from ${e.publicDir}`);let Z=Zt();if(Z)await J(Z,g.join(e.outputDir,Yt)),console.log(`Copied assets from ${ft}`)}catch(D){throw await e.hooks.onError?.(D),D}if(l.buildTime=Date.now()-i,w.size>0){l.islandChunks={count:w.size,totalBytes:y};let D={generatedChunks:w.size,totalBytes:y,chunks:h,pages:S};await Bun.write(g.join(e.outputDir,"_stx","islands-manifest.json"),JSON.stringify(D,null,2))}await e.hooks.onBuildEnd?.(l);let P=l.islandChunks?`
|
|
77
77
|
Island chunks: ${l.islandChunks.count} (${(l.islandChunks.totalBytes/1024).toFixed(1)} KB lifted out of inline HTML)`:"";return console.log(`
|
|
78
78
|
Build complete!
|
|
79
79
|
Total: ${l.totalPages} pages
|
|
@@ -996,6 +996,19 @@ export interface StxConfig {
|
|
|
996
996
|
* Progress-bar height including units (e.g. '2px', '3px'). Default: '2px'.
|
|
997
997
|
*/
|
|
998
998
|
progressHeight?: string;
|
|
999
|
+
/**
|
|
1000
|
+
* Fetch the pages of links as they scroll into view, so the first tap on
|
|
1001
|
+
* one is a swap. Their module bundles wait for an intent (a hover, a
|
|
1002
|
+
* touch) or the tap. Default: true.
|
|
1003
|
+
*/
|
|
1004
|
+
prefetchVisible?: boolean;
|
|
1005
|
+
/** At most this many links prefetched on sight per page. Default: 12. */
|
|
1006
|
+
prefetchVisibleMax?: number;
|
|
1007
|
+
/**
|
|
1008
|
+
* Fetch the fragment of the page the app was opened on once it is idle,
|
|
1009
|
+
* so Back to it is a swap rather than a round trip. Default: true.
|
|
1010
|
+
*/
|
|
1011
|
+
keepOpening?: boolean;
|
|
999
1012
|
};
|
|
1000
1013
|
/**
|
|
1001
1014
|
* Custom router instance (e.g. @stacksjs/bun-router) for API handling.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/stx",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.529",
|
|
5
5
|
"description": "A performant UI Framework. Powered by Bun.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -123,12 +123,12 @@
|
|
|
123
123
|
"dependencies": {
|
|
124
124
|
"@stacksjs/ts-css": "^0.3.11",
|
|
125
125
|
"@stacksjs/clapp": "^0.2.16",
|
|
126
|
-
"@stacksjs/desktop": "0.2.
|
|
127
|
-
"@stacksjs/sanitizer": "0.2.
|
|
126
|
+
"@stacksjs/desktop": "0.2.529",
|
|
127
|
+
"@stacksjs/sanitizer": "0.2.529",
|
|
128
128
|
"@stacksjs/ts-i18n": "^0.1.11",
|
|
129
|
-
"bun-plugin-stx": "0.2.
|
|
129
|
+
"bun-plugin-stx": "0.2.529",
|
|
130
130
|
"bunfig": "^0.15.19",
|
|
131
|
-
"stx-router": "0.2.
|
|
131
|
+
"stx-router": "0.2.529",
|
|
132
132
|
"ts-broadcasting": "^0.0.11",
|
|
133
133
|
"ts-images": "^0.2.22",
|
|
134
134
|
"ts-syntax-highlighter": "^0.2.1"
|
package/dist/chunk-0eptxhzy.js
DELETED
package/dist/chunk-1mkyksne.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{wr,eo,_n,vr,xr,Dt,dt,to,Tn,Rn,Sr,kr,el,tl,Re}from"./chunk-gte0wmh8.js";export{Re as DeployError,eo as calculateSha1,_n as collectDeployFiles,Rn as createDefaultNetlifyConfig,vr as createFileManifest,wr as createNetlifyClient,el as deploy,Tn as detectProjectConfig,xr as filterRequiredFiles,Dt as formatSize,to as generateNetlifyToml,dt as getTotalSize,kr as hasNetlifyConfig,tl as initNetlify,Sr as writeNetlifyConfig};
|
package/dist/chunk-1zz2n4ks.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{aa,xl,ca,la,Sl,kl}from"./chunk-v9yx1kva.js";import"./chunk-5j0fm4jy.js";import"./chunk-fxxrrq9n.js";import"./chunk-c57j92td.js";import"./chunk-kp4mzspk.js";import"./chunk-s691cnew.js";import"./chunk-6k4f583z.js";import"./chunk-gbfap7rv.js";import"./chunk-gynes6rm.js";import"./chunk-365ktg70.js";import"./chunk-ba88n1j7.js";import"./chunk-yxdyh23k.js";import"./chunk-1aw9qbdf.js";import"./chunk-e6y6s7q8.js";export{kl as applySlots,Sl as extractSlotContent,xl as parseSlotElement,aa as parseSlots,la as processSlots,ca as renderSlot};
|
package/dist/chunk-2bx2ara9.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{W,Gr,Jr,Za,vt,Ho,Yr,Vo,Rd,Le,Zr,he}from"./chunk-5j0fm4jy.js";import"./chunk-fxxrrq9n.js";import"./chunk-c57j92td.js";import{vi,s}from"./chunk-x8mp9yvn.js";import"./chunk-kp4mzspk.js";import"./chunk-s691cnew.js";import"./chunk-6k4f583z.js";import"./chunk-gbfap7rv.js";import"./chunk-gynes6rm.js";import"./chunk-365ktg70.js";import"./chunk-ba88n1j7.js";import"./chunk-yxdyh23k.js";import"./chunk-1aw9qbdf.js";import"./chunk-e6y6s7q8.js";export{W as BROWSER_CORE_IMPORTS,Za as STX_AUTO_IMPORTS,Gr as extractAndStripCssImports,Le as extractBridgeData,vi as findInterpolationEnd,Vo as generateAutoImportDestructuring,Rd as generateBrowserAutoImportDestructuring,Zr as generateServerDataBridge,vt as injectBrowserCoreAutoImports,he as processClientScript,Yr as referencesName,Jr as renderVendorStyleTags,s as stripCommentsAndLiterals,Ho as transformAutoImports};
|
package/dist/chunk-38x0j2tz.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ds,su,ou,Ai,fe,jc,or,iu,au,cu,lu,du,uu,pu,fu,gu}from"./chunk-gynes6rm.js";import"./chunk-365ktg70.js";export{uu as applyHead,iu as definePageMeta,Ds as getHead,su as getPageMeta,fe as mergeHeadConfigs,pu as processHeadDirective,gu as processMetaDirective,fu as processTitleDirective,du as renderBodyAttrs,cu as renderHead,lu as renderHtmlAttrs,ou as resetHead,or as seoMetaToHeadConfig,Ai as useHead,au as usePageTitle,jc as useSeoMeta,au as useTitle};
|
package/dist/chunk-3c9t71pc.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{cl,ll,dl,ul,sa,pl,fl,gl,ml,hl,yl,bl}from"./chunk-4hz4g5ym.js";export{yl as Broadcast,bl as BroadcastServer,sa as broadcast,ml as broadcastPresence,gl as broadcastPrivate,hl as channel,cl as getBroadcastServer,ul as loadChannels,ll as startBroadcasting,dl as stopBroadcasting,pl as toUser,fl as toUsers};
|
package/dist/chunk-3kxh9rsp.js
DELETED
package/dist/chunk-3vqabd10.js
DELETED
package/dist/chunk-490f2x2r.js
DELETED
package/dist/chunk-4k65naeg.js
DELETED
package/dist/chunk-5c1qesrs.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Sa,ka,Ca,Ea,$a,_a,Ta,Ra,Aa,Pa,Il}from"./chunk-ygetbydb.js";export{Sa as createIslandRegistry,Il as default,Pa as generateIslandManifest,Ca as generatePartialHydrationCSS,_a as hydrateAll,$a as hydrateByStrategy,Ea as hydrateIsland,Ta as isHydrated,Ra as onHydrated,ka as processPartialHydrationDirectives,Aa as processStaticDirectives};
|