@stacksjs/stx 0.2.385 → 0.2.387
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-01kg06q3.js +2 -0
- package/dist/{chunk-x05ycjc4.js → chunk-1ap2e03s.js} +9 -9
- package/dist/{chunk-d5h4fq9g.js → chunk-24hbbff2.js} +1 -1
- package/dist/chunk-38x4y1ta.js +2 -0
- package/dist/{chunk-s8wvhby3.js → chunk-3fbwfbhz.js} +1 -1
- package/dist/{chunk-6tsepxj2.js → chunk-41qwdzyw.js} +1 -1
- package/dist/{chunk-9tsdve0c.js → chunk-49f69m4w.js} +1 -1
- package/dist/{chunk-74pnrjrh.js → chunk-4x12wc01.js} +1 -1
- package/dist/{chunk-5rxfqxw1.js → chunk-5qrmawx5.js} +1 -1
- package/dist/{chunk-x9xcmaef.js → chunk-673kgm6d.js} +1 -1
- package/dist/{chunk-tj7wpqnm.js → chunk-6pk7jhne.js} +1 -1
- package/dist/{chunk-3mvs006a.js → chunk-6t67gg3n.js} +1 -1
- package/dist/{chunk-51v42enn.js → chunk-71q6h7e1.js} +1 -1
- package/dist/{chunk-yx5ct9vx.js → chunk-80d8krzf.js} +1 -1
- package/dist/{chunk-y2zrdxg3.js → chunk-9jyxmz96.js} +1 -1
- package/dist/{chunk-7zwkhc9z.js → chunk-a92bgx96.js} +1 -1
- package/dist/{chunk-yswz2ze7.js → chunk-bmw0nh8s.js} +1 -1
- package/dist/{chunk-ndnk50mc.js → chunk-ca2cnhyc.js} +1 -1
- package/dist/{chunk-er75fpqj.js → chunk-cnqtf1x1.js} +1 -1
- package/dist/{chunk-6en9gsg5.js → chunk-cnyj0esg.js} +1 -1
- package/dist/{chunk-vsjx1fe3.js → chunk-d1h08ye9.js} +1 -1
- package/dist/{chunk-c30z8jtq.js → chunk-d7p7c3z1.js} +2 -2
- package/dist/{chunk-xvp7ye5d.js → chunk-dbyxxa3k.js} +1 -1
- package/dist/{chunk-pr1spkdp.js → chunk-dd3thzft.js} +1 -1
- package/dist/{chunk-2egh74rh.js → chunk-dmndr0m8.js} +1 -1
- package/dist/{chunk-7e31d2d9.js → chunk-dmxyr3rp.js} +1 -1
- package/dist/chunk-e4y4jk8q.js +2 -0
- package/dist/{chunk-trnwjst0.js → chunk-ecn09c05.js} +1 -1
- package/dist/{chunk-0k1g666f.js → chunk-erekjwxw.js} +1 -1
- package/dist/{chunk-hgwwpgkn.js → chunk-gq368mag.js} +1 -1
- package/dist/{chunk-rck90601.js → chunk-h0ab4meb.js} +1 -1
- package/dist/{chunk-2qqc4btz.js → chunk-hsdp2z03.js} +1 -1
- package/dist/{chunk-kmbt6knb.js → chunk-hsszctgd.js} +1 -1
- package/dist/{chunk-vj19hasp.js → chunk-hyta4f2q.js} +16 -16
- package/dist/{chunk-4wr5khha.js → chunk-j28h5r0n.js} +1 -1
- package/dist/{chunk-eexraz9d.js → chunk-nk8f4nk6.js} +2 -2
- package/dist/{chunk-hr42tde6.js → chunk-npnxzpz2.js} +1 -1
- package/dist/{chunk-0bsr2bc9.js → chunk-pg3phc81.js} +1 -1
- package/dist/{chunk-864b6wcd.js → chunk-pne4srgz.js} +2 -2
- package/dist/{chunk-xr9cxkxp.js → chunk-qh78pjn5.js} +1 -1
- package/dist/{chunk-k4f1jwfy.js → chunk-qtw36pgt.js} +1 -1
- package/dist/{chunk-2gtwsyyc.js → chunk-qxhbb45f.js} +1 -1
- package/dist/{chunk-gaghjpf3.js → chunk-s185k9a9.js} +1 -1
- package/dist/{chunk-dpk10wzg.js → chunk-sasjwk8p.js} +1 -1
- package/dist/{chunk-sr3f7gk2.js → chunk-tha798rm.js} +1 -1
- package/dist/{chunk-daqc7qct.js → chunk-vbfwtbw5.js} +1 -1
- package/dist/{chunk-dwk6afax.js → chunk-w0jw3zyh.js} +1 -1
- package/dist/{chunk-jz660eaa.js → chunk-y532q6hn.js} +1 -1
- package/dist/{chunk-x3j8w3g8.js → chunk-yccr87cs.js} +1 -1
- package/dist/{chunk-pefddsqn.js → chunk-ym38annb.js} +1 -1
- package/dist/{chunk-kddj8m3q.js → chunk-ytd1gggw.js} +2 -2
- package/dist/{chunk-4a8wet24.js → chunk-ytxd63t6.js} +105 -7
- package/dist/{chunk-wp8273q0.js → chunk-zsmw7b9c.js} +37 -14
- package/dist/cli.js +8 -8
- package/dist/composables/use-router.d.ts +2 -0
- package/dist/composables/use-router.js +1 -1
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/pwa.js +1 -1
- package/dist/signals.js +37 -14
- package/dist/ssg.js +2 -2
- package/package.json +5 -5
- package/dist/chunk-e686ewmg.js +0 -2
- package/dist/chunk-kf7mza0j.js +0 -2
- package/dist/chunk-xn3pwe6e.js +0 -2
package/dist/signals.js
CHANGED
|
@@ -1549,7 +1549,7 @@ else if (immediate) {
|
|
|
1549
1549
|
// Navigation API
|
|
1550
1550
|
// ==========================================================================
|
|
1551
1551
|
|
|
1552
|
-
// Second argument is an options object: { replace, reload }.
|
|
1552
|
+
// Second argument is an options object: { replace, reload, instant }.
|
|
1553
1553
|
//
|
|
1554
1554
|
// It used to be a bare forceReload boolean while the shipped declaration
|
|
1555
1555
|
// promised { replace?: boolean } \u2014 so the one call the type system invited,
|
|
@@ -1564,7 +1564,9 @@ else if (immediate) {
|
|
|
1564
1564
|
var replace = !!opts.replace;
|
|
1565
1565
|
var reload = !!(opts.reload || opts.forceReload);
|
|
1566
1566
|
if (!reload && window.stxRouter && typeof window.stxRouter.navigate === 'function') {
|
|
1567
|
-
|
|
1567
|
+
var routed = { replace: replace };
|
|
1568
|
+
if (opts.instant) routed.instant = true;
|
|
1569
|
+
window.stxRouter.navigate(url, routed);
|
|
1568
1570
|
return;
|
|
1569
1571
|
}
|
|
1570
1572
|
if (replace) window.location.replace(url);
|
|
@@ -5199,20 +5201,25 @@ else if (!value && isInserted) {
|
|
|
5199
5201
|
console.log('[stx] bindIf REMOVED, el.isConnected:', el.isConnected);
|
|
5200
5202
|
}
|
|
5201
5203
|
// Process the entire subtree when element is visible and not yet processed.
|
|
5202
|
-
//
|
|
5203
|
-
//
|
|
5204
|
-
//
|
|
5205
|
-
//
|
|
5206
|
-
//
|
|
5207
|
-
//
|
|
5204
|
+
// peek() keeps child effects from subscribing to this bindIf's tracked
|
|
5205
|
+
// signals. Use capturedComponentScope (not global componentScope) so
|
|
5206
|
+
// iteration variables from an enclosing for-loop remain in scope.
|
|
5207
|
+
// Process the element itself, not just children, so sibling directives
|
|
5208
|
+
// on the same element (e.g. text binding alongside if) fire too. The if
|
|
5209
|
+
// attribute was already removed, so no recursion.
|
|
5210
|
+
//
|
|
5211
|
+
// Synchronously when the branch is on the page, as the template and
|
|
5212
|
+
// if/else-chain branches already are. This pass used to wait for a
|
|
5213
|
+
// timer, so every :if (and each :for inside one) filled in a frame
|
|
5214
|
+
// after the rest of the page was bound: a screen opened from a tab bar
|
|
5215
|
+
// showed its sections arriving one after another.
|
|
5208
5216
|
if (value && isInserted && !childrenProcessed) {
|
|
5209
5217
|
childrenProcessed = true;
|
|
5210
|
-
// Until this
|
|
5211
|
-
//
|
|
5212
|
-
//
|
|
5213
|
-
// in a :if binds a macrotask after the synchronous stx:load audit (#1773).
|
|
5218
|
+
// Until this pass runs, the shown subtree still holds literal {{ }}.
|
|
5219
|
+
// Flag it so the hydration audit doesn't report those as a binding
|
|
5220
|
+
// miss when the pass is deferred (#1773).
|
|
5214
5221
|
el.__stx_if_pending = true;
|
|
5215
|
-
|
|
5222
|
+
var hydrateShownBranch = function() {
|
|
5216
5223
|
// Removed with its row, or hidden again, before this ran. Hydrating
|
|
5217
5224
|
// a detached element now creates effects nothing will dispose
|
|
5218
5225
|
// (#1954). Leave it unprocessed so the next show schedules the pass.
|
|
@@ -5242,7 +5249,11 @@ else if (!value && isInserted) {
|
|
|
5242
5249
|
el.querySelectorAll('[x-cloak]').forEach(function(c) { c.removeAttribute('x-cloak'); });
|
|
5243
5250
|
// Deferred bind complete \u2014 the audit may inspect this subtree now.
|
|
5244
5251
|
el.__stx_if_pending = false;
|
|
5245
|
-
}
|
|
5252
|
+
};
|
|
5253
|
+
// A branch shown while detached (inside content not on the page yet)
|
|
5254
|
+
// waits for a later turn, when it has been placed.
|
|
5255
|
+
if (el.isConnected) peek(hydrateShownBranch);
|
|
5256
|
+
else setTimeout(hydrateShownBranch, 0);
|
|
5246
5257
|
}
|
|
5247
5258
|
}
|
|
5248
5259
|
});
|
|
@@ -7199,6 +7210,7 @@ catch (e) {} }
|
|
|
7199
7210
|
_mountCallbacks: mountCallbacks,
|
|
7200
7211
|
_destroyCallbacks: destroyCallbacks,
|
|
7201
7212
|
_cleanupContainer: cleanupContainer,
|
|
7213
|
+
_flushLoad: flushStxLoad,
|
|
7202
7214
|
_registerSuspense: registerSuspense, // <Suspense> query registration (#1742)
|
|
7203
7215
|
_tg: { enter: tgEnter, leave: tgLeave, flip: tgFlip, snapshot: tgSnapshot }, // <TransitionGroup> helpers (#1742)
|
|
7204
7216
|
_scopes: {}, // Component-level scopes
|
|
@@ -8783,6 +8795,17 @@ catch (e) {
|
|
|
8783
8795
|
}
|
|
8784
8796
|
window.__stxLoadHandler = stxLoadHandler;
|
|
8785
8797
|
window.addEventListener('stx:load', stxLoadHandler);
|
|
8798
|
+
|
|
8799
|
+
// Run a pending stx:load now instead of after the debounce. The router's
|
|
8800
|
+
// instant navigation (a tab bar) reveals the new screen in a single frame
|
|
8801
|
+
// once the page is bound; waiting out the timer revealed it with its
|
|
8802
|
+
// {{ }} still unbound and filled it in a frame later.
|
|
8803
|
+
function flushStxLoad() {
|
|
8804
|
+
if (!_stxLoadTimer) return false;
|
|
8805
|
+
clearTimeout(_stxLoadTimer);
|
|
8806
|
+
_handleStxLoad();
|
|
8807
|
+
return true;
|
|
8808
|
+
}
|
|
8786
8809
|
function _handleStxLoad() {
|
|
8787
8810
|
_stxLoadTimer = null;
|
|
8788
8811
|
console.log('[stx:load] START. mountQueue:', mountQueue.length, '_latestSetup:', !!window.stx._latestSetup);
|
package/dist/ssg.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ck as wq,xk as Uq,yk as Iq}from"./chunk-
|
|
2
|
+
import{Ck as wq,xk as Uq,yk as Iq}from"./chunk-hsdp2z03.js";import{Dk as Eq,Ek as Tq,Fk as Dq}from"./chunk-frp9fc7j.js";import{_k as _q,bl as zq,cl as Aq}from"./chunk-9jyxmz96.js";import"./chunk-nk8f4nk6.js";import"./chunk-qjvny3wf.js";import{Np as C,Um as Oq,ko as l,no as Hq,zr as n}from"./chunk-hyta4f2q.js";import"./chunk-21ev9jk2.js";import"./chunk-p5ktexx3.js";import"./chunk-zn9v6jpb.js";import"./chunk-vbyxgwz5.js";import"./chunk-38ykv2gd.js";import{pt as Xq}from"./chunk-qh78pjn5.js";import{ut as d}from"./chunk-h3r7wcxk.js";import"./chunk-veky1cte.js";import"./chunk-5qrmawx5.js";import"./chunk-cwba6q7v.js";import{$t as Bq}from"./chunk-hyzjprnz.js";import"./chunk-wk6xx6zz.js";import"./chunk-ha0a1hpx.js";import"./chunk-zxfejz72.js";import"./chunk-25tfm9t5.js";import"./chunk-aa8015mk.js";import{Aw as Nq,vw as Yq,ww as Vq,xw as jq,yw as Gq,zw as Lq}from"./chunk-ytxd63t6.js";import"./chunk-rtfwn4cm.js";import"./chunk-efyskaw7.js";import{Vw as P}from"./chunk-wjbfget1.js";import X from"fs";import j from"path";import{createHash as xq}from"crypto";function yq(q){try{return new Bun.Transpiler({loader:"js",minifyWhitespace:!0}).transformSync(q).replace(/\}(var |let |const |function )/g,"};$1").trim()}catch{return q}}var Pq=/<script\s+type="stx\/island"\s+data-stx-island="([^"]+)"([^>]*)>([\s\S]*?)<\/script>/g;function Cq(q){return Bun.hash(q).toString(16)}function Qq(q,Z={}){if(!q.includes('type="stx/island"'))return{html:q,chunks:[]};let $=new Map,Q=q.replace(Pq,(J,W,_,z)=>{let L=z.trim();if(!L)return J;if(/\bdata-stx-src=/.test(_))return J;if(Z.minify)L=yq(L);let A=Cq(L);if(!$.has(A))$.set(A,L);let B=Z.integrity?` data-stx-integrity="sha384-${xq("sha384").update(L).digest("base64")}"`:"";return`<script type="stx/island" data-stx-island="${W}" data-stx-src="/_stx/islands/${A}.js"${B}${_}></script>`}),K=Array.from($,([J,W])=>({hash:J,code:W}));return{html:Q,chunks:K}}var gq=new Set(["visible","idle"]);function Zq(q){if(!q.includes("data-stx-src="))return q;let Z=new Map,$=/data-stx-scope="([^"]+)"[^>]*?stx-hydrate="([^"]+)"/g,Q;while((Q=$.exec(q))!==null)Z.set(Q[1],Q[2]);let K=new Set,J=/data-stx-island="([^"]+)"[^>]*?data-stx-src="([^"]+)"/g,W;while((W=J.exec(q))!==null)if(gq.has(Z.get(W[1])||""))K.add(W[2]);let _=q.lastIndexOf("</head>");if(K.size===0||_===-1)return q;let z=Array.from(K).filter((L)=>!q.includes(`rel="prefetch" href="${L}"`)).map((L)=>`<link rel="prefetch" href="${L}" as="script">`).join("");if(!z)return q;return q.slice(0,_)+z+q.slice(_)}var fq=["STX_SITE_URL","SITE_URL","URL","VERCEL_URL","CF_PAGES_URL"];function h(q){let Z=q.trim();if(!Z)return null;let $=/^https?:\/\//i.test(Z)?Z:`https://${Z}`;try{return new URL($).origin+new URL($).pathname.replace(/\/$/,"")}catch{return null}}function mq(q){for(let Z of fq){let $=q[Z];if(!$)continue;let Q=h($);if(Q)return{url:Q,source:"env",via:Z}}return null}function $q(q){if(!q||typeof q!=="object")return null;let Z=q,$=Z.site?.url??Z.url??Z.app?.url;return typeof $==="string"?h($):null}async function dq(q){let{existsSync:Z}=await import("fs"),$=await import("path");for(let Q of["site.config.ts","site.config.js",".config/site.config.ts"]){let K=$.resolve(q,Q);if(!Z(K))continue;try{let J=await import(K),W=$q(J.default??J);if(W)return W}catch{}}return null}async function Kq(q={}){let Z=q.cwd??process.cwd(),$=q.env??process.env;if(q.explicit){let W=h(q.explicit);if(W)return{url:W,source:"option"}}let Q=$q(q.stxConfig);if(Q)return{url:Q,source:"stx.config",via:"site.url"};let K=await dq(Z);if(K)return{url:K,source:"site.config",via:"url"};let J=mq($);if(J)return J;return{url:"http://localhost",source:"fallback"}}function Wq(){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 Fq{cacheDir;cache=new Map;loaded=!1;salt;constructor(q,Z=""){this.cacheDir=q,this.salt=Z}async load(){if(this.loaded)return;let q=j.join(this.cacheDir,"build-cache.json");if(await Bun.file(q).exists())try{let Z=JSON.parse(await Bun.file(q).text());for(let[$,Q]of Object.entries(Z))this.cache.set($,Q)}catch{}this.loaded=!0}async save(){await X.promises.mkdir(this.cacheDir,{recursive:!0});let q=j.join(this.cacheDir,"build-cache.json"),Z={};for(let[$,Q]of this.cache)Z[$]=Q;await Bun.write(q,JSON.stringify(Z))}getHash(q,Z){let $=X.statSync(q),Q=`${this.salt}|${q}:${$.mtimeMs}`;for(let J of Z)if(X.existsSync(J)){let W=X.statSync(J);Q+=`:${J}:${W.mtimeMs}`}let K=0;for(let J=0;J<Q.length;J++){let W=Q.charCodeAt(J);K=(K<<5)-K+W,K=K&K}return Math.abs(K).toString(36)}get(q,Z){let $=this.cache.get(q);if(!$)return null;let Q=this.getHash(Z,$.dependencies??[]);if($.hash!==Q)return this.cache.delete(q),null;return $.html}set(q,Z,$,Q){let K=this.getHash(Z,$);this.cache.set(q,{hash:K,html:Q,generatedAt:Date.now(),dependencies:$})}}class Rq{cacheDir;constructor(q){this.cacheDir=q}getFilePath(q){let Z=q.replace(/[^a-zA-Z0-9]/g,"_")+".json";return j.join(this.cacheDir,"isr",Z)}async get(q){let Z=this.getFilePath(q);if(!await Bun.file(Z).exists())return null;try{return JSON.parse(await Bun.file(Z).text())}catch{return null}}async set(q,Z){let $=this.getFilePath(q);await X.promises.mkdir(j.dirname($),{recursive:!0}),await Bun.write($,JSON.stringify(Z))}async invalidate(q){let Z=this.getFilePath(q);if(await Bun.file(Z).exists())await X.promises.unlink(Z)}async invalidatePattern(q){let Z=j.join(this.cacheDir,"isr");if(!X.existsSync(Z))return;let $=await X.promises.readdir(Z);for(let Q of $){let K=Q.replace(/_/g,"/").replace(".json","");if(q.test(K))await X.promises.unlink(j.join(Z,Q))}}async needsRevalidation(q){let Z=await this.get(q);if(!Z)return!0;return Date.now()>Z.revalidateAfter}}async function pq(q){try{let $=(await Bun.file(q).text()).match(/<script\s+server\b[^>]*>([\s\S]*?)<\/script>/i);if(!$)return null;let Q=$[1];if(!Q.includes("getStaticPaths"))return null;let K=Q.match(/(?:export\s+)?(?:async\s+)?function\s+getStaticPaths\s*\([^)]*\)\s*\{([\s\S]*?)\n[\t ]*\}/);if(!K)return null;return await Function(`
|
|
4
4
|
return (async function getStaticPaths() {
|
|
5
5
|
${K[1]}
|
|
@@ -41,7 +41,7 @@ ${q.map((Q)=>{let K=new URL(Q.loc,Z).href,J=` <url>
|
|
|
41
41
|
${$.join(`
|
|
42
42
|
`)}
|
|
43
43
|
</channel>
|
|
44
|
-
</rss>`}async function rq(q={}){let Z=Date.now();Aq();let $=await n(process.cwd()),Q=$.build||{},K=await Kq({explicit:q.domain||Q.domain,stxConfig:$});if(K.source==="fallback"&&(q.sitemap??Q.sitemap??!0))console.warn(Wq());let J={router:q.router??$?.router??{},pagesDir:q.pagesDir||Q.pagesDir||"pages",outputDir:q.outputDir||Q.outputDir||"dist",baseUrl:q.baseUrl||Q.baseUrl||"/",domain:K.url,revalidate:q.revalidate??Q.revalidate??!1,sitemap:q.sitemap??Q.sitemap??!0,sitemapExclude:q.sitemapExclude||Q.sitemapExclude||[],robots:q.robots??Q.robots??!0,rss:q.rss??Q.rss??!1,concurrency:q.concurrency||Q.concurrency||10,cache:q.cache??Q.cache??!0,cacheDir:q.cacheDir||Q.cacheDir||d(process.cwd(),"ssg-cache"),contentLoaders:q.contentLoaders||[],hooks:q.hooks||{},minify:q.minify??Q.minify??!0,generate404:q.generate404??Q.generate404??!0,publicDir:q.publicDir||Q.publicDir||"public",trailingSlash:q.trailingSlash??Q.trailingSlash??!1,cleanOutput:q.cleanOutput??Q.cleanOutput??!0,cacheSalt:q.cacheSalt??"",partialsDir:q.partialsDir||$?.partialsDir||"",componentsDir:q.componentsDir||$?.componentsDir||"",failOnIncludeError:q.failOnIncludeError??!0,failOnServerScriptError:q.failOnServerScriptError??!0,chunkIslands:q.chunkIslands===!0,prefetchIslands:q.prefetchIslands===!0,integrityIslands:q.integrityIslands===!0},W={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},_=new Set,z=0,L={},A={};await J.hooks.onBuildStart?.();try{if(J.cleanOutput&&X.existsSync(J.outputDir))await X.promises.rm(J.outputDir,{recursive:!0});await X.promises.mkdir(J.outputDir,{recursive:!0});let U=J.cacheSalt;if(!U){let{resolveUserCssConfig:Y,fingerprintConfig:N}=await import("./chunk-
|
|
44
|
+
</rss>`}async function rq(q={}){let Z=Date.now();Aq();let $=await n(process.cwd()),Q=$.build||{},K=await Kq({explicit:q.domain||Q.domain,stxConfig:$});if(K.source==="fallback"&&(q.sitemap??Q.sitemap??!0))console.warn(Wq());let J={router:q.router??$?.router??{},pagesDir:q.pagesDir||Q.pagesDir||"pages",outputDir:q.outputDir||Q.outputDir||"dist",baseUrl:q.baseUrl||Q.baseUrl||"/",domain:K.url,revalidate:q.revalidate??Q.revalidate??!1,sitemap:q.sitemap??Q.sitemap??!0,sitemapExclude:q.sitemapExclude||Q.sitemapExclude||[],robots:q.robots??Q.robots??!0,rss:q.rss??Q.rss??!1,concurrency:q.concurrency||Q.concurrency||10,cache:q.cache??Q.cache??!0,cacheDir:q.cacheDir||Q.cacheDir||d(process.cwd(),"ssg-cache"),contentLoaders:q.contentLoaders||[],hooks:q.hooks||{},minify:q.minify??Q.minify??!0,generate404:q.generate404??Q.generate404??!0,publicDir:q.publicDir||Q.publicDir||"public",trailingSlash:q.trailingSlash??Q.trailingSlash??!1,cleanOutput:q.cleanOutput??Q.cleanOutput??!0,cacheSalt:q.cacheSalt??"",partialsDir:q.partialsDir||$?.partialsDir||"",componentsDir:q.componentsDir||$?.componentsDir||"",failOnIncludeError:q.failOnIncludeError??!0,failOnServerScriptError:q.failOnServerScriptError??!0,chunkIslands:q.chunkIslands===!0,prefetchIslands:q.prefetchIslands===!0,integrityIslands:q.integrityIslands===!0},W={totalPages:0,successCount:0,failedCount:0,cachedCount:0,buildTime:0,pages:[],errors:[]},_=new Set,z=0,L={},A={};await J.hooks.onBuildStart?.();try{if(J.cleanOutput&&X.existsSync(J.outputDir))await X.promises.rm(J.outputDir,{recursive:!0});await X.promises.mkdir(J.outputDir,{recursive:!0});let U=J.cacheSalt;if(!U){let{resolveUserCssConfig:Y,fingerprintConfig:N}=await import("./chunk-yccr87cs.js");try{U=N(await Y(process.cwd()))}catch{}}let{prepareImageDelivery:G}=await import("./chunk-rww8skhq.js"),H=await G(J.publicDir,J.outputDir);if(H.count>0)console.log(`Optimized ${H.count} image(s) for responsive delivery`),U=[U,H.fingerprint].filter(Boolean).join(":");let F=new Fq(J.cacheDir,U);if(J.cache)await F.load();try{let{generateCss:Y}=await import("./chunk-yccr87cs.js");await Y('<div class="bg-black"></div>')}catch{}Yq();let kq=$?.routeMiddleware?.dir||"middleware";await jq(process.cwd(),kq);let p=Vq();if(p.length>0)console.log(`Loaded ${p.length} middleware: ${p.join(", ")}`);let bq=$?.routeMiddleware?.global||[];wq($?.layoutsDir,d(process.cwd()));let i=l(".",{pagesDir:J.pagesDir,pagesDirs:$?._layerPageDirs});console.log(`Found ${i.length} routes`);let g=[];for(let Y of i){let N=await uq(Y);for(let O of N)g.push({route:Y,url:O.url,params:O.params,props:O.props,revalidate:O.revalidate??J.revalidate})}W.totalPages=g.length,console.log(`Generating ${W.totalPages} pages...`);let S=[],s=[];for(let Y=0;Y<g.length;Y+=J.concurrency)s.push(g.slice(Y,Y+J.concurrency));for(let Y of s)await Promise.all(Y.map(async(N)=>{let{route:O,url:V,params:v,props:Sq,revalidate:r}=N;try{await J.hooks.onPageStart?.(V);let R=await Bun.file(O.filePath).text(),M=JJ(R),vq=M?.middleware?Array.isArray(M.middleware)?M.middleware:[M.middleware]:[],t=[...bq,...vq];if(t.length>0){let T=Gq(V,v,M||{}),k=Lq(T,null,void 0,{isServer:!0}),D=await Nq(t,k);if(D.redirect){let I=typeof D.redirect==="string"?D.redirect:D.redirect.path||D.redirect,y=QJ(String(I),V),b=ZJ(V,J);await X.promises.mkdir(j.dirname(b),{recursive:!0}),await Bun.write(b,y),W.successCount++,W.pages.push({route:V,outputPath:b,size:Buffer.byteLength(y),cached:!1}),S.push({loc:V,lastmod:new Date().toISOString()}),console.log(` \u21B3 ${V} \u2192 redirect to ${I}`);return}if(D.abort){let I=typeof D.abort==="string"?D.abort:D.abort?.error?.message||"aborted";console.warn(` \u21B3 ${V} \u2014 middleware aborted: ${I}`);return}}let e=R.match(/definePageMeta\s*\(\s*\{[\s\S]*?validate\s*:\s*((?:\([^)]*\)|[^,}])*(?:\{[\s\S]*?\})?)/m);if(e)try{if(!await Function("route",`
|
|
45
45
|
const validate = ${e[1]};
|
|
46
46
|
return validate(route);
|
|
47
47
|
`)({params:v})){console.warn(`Validation failed for ${V}, skipping...`);return}}catch{}let E=null,qq=!1;if(J.cache){if(E=F.get(V,O.filePath),E)qq=!0,W.cachedCount++}if(!E){let T=await Mq(O,v,Sq,J,$);if(E=T.html,J.failOnIncludeError&&T.includeFailures.length>0)throw Error(`${T.includeFailures.length} include(s) failed to resolve, so this page would have shipped with an error banner where the markup should be:
|
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.387",
|
|
5
5
|
"description": "A performant UI Framework. Powered by Bun.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -118,12 +118,12 @@
|
|
|
118
118
|
"dependencies": {
|
|
119
119
|
"@stacksjs/ts-css": "^0.3.2",
|
|
120
120
|
"@stacksjs/clapp": "^0.2.16",
|
|
121
|
-
"@stacksjs/desktop": "0.2.
|
|
122
|
-
"@stacksjs/sanitizer": "0.2.
|
|
121
|
+
"@stacksjs/desktop": "0.2.387",
|
|
122
|
+
"@stacksjs/sanitizer": "0.2.387",
|
|
123
123
|
"@stacksjs/ts-i18n": "^0.1.11",
|
|
124
|
-
"bun-plugin-stx": "0.2.
|
|
124
|
+
"bun-plugin-stx": "0.2.387",
|
|
125
125
|
"bunfig": "^0.15.19",
|
|
126
|
-
"stx-router": "0.2.
|
|
126
|
+
"stx-router": "0.2.387",
|
|
127
127
|
"ts-broadcasting": "^0.0.11",
|
|
128
128
|
"ts-images": "^0.2.22",
|
|
129
129
|
"ts-syntax-highlighter": "^0.2.1"
|
package/dist/chunk-e686ewmg.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ze as a}from"./chunk-daqc7qct.js";import"./chunk-c30z8jtq.js";import"./chunk-0knxnyq6.js";import"./chunk-eexraz9d.js";import"./chunk-vj19hasp.js";import"./chunk-21ev9jk2.js";import"./chunk-p5ktexx3.js";import"./chunk-zn9v6jpb.js";import"./chunk-vbyxgwz5.js";import"./chunk-38ykv2gd.js";import"./chunk-xr9cxkxp.js";import"./chunk-h3r7wcxk.js";import"./chunk-veky1cte.js";import"./chunk-5rxfqxw1.js";import"./chunk-cwba6q7v.js";import"./chunk-hyzjprnz.js";import"./chunk-wk6xx6zz.js";import"./chunk-ha0a1hpx.js";import"./chunk-zxfejz72.js";import"./chunk-25tfm9t5.js";import"./chunk-aa8015mk.js";import"./chunk-4a8wet24.js";import"./chunk-rtfwn4cm.js";import"./chunk-efyskaw7.js";import"./chunk-wjbfget1.js";export{a as startProductionServer};
|
package/dist/chunk-kf7mza0j.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Ve as a}from"./chunk-hgwwpgkn.js";import"./chunk-0knxnyq6.js";import"./chunk-vj19hasp.js";import"./chunk-21ev9jk2.js";import"./chunk-p5ktexx3.js";import"./chunk-zn9v6jpb.js";import"./chunk-vbyxgwz5.js";import"./chunk-38ykv2gd.js";import"./chunk-xr9cxkxp.js";import"./chunk-h3r7wcxk.js";import"./chunk-veky1cte.js";import"./chunk-5rxfqxw1.js";import"./chunk-cwba6q7v.js";import"./chunk-hyzjprnz.js";import"./chunk-wk6xx6zz.js";import"./chunk-ha0a1hpx.js";import"./chunk-zxfejz72.js";import"./chunk-25tfm9t5.js";import"./chunk-aa8015mk.js";import"./chunk-4a8wet24.js";import"./chunk-rtfwn4cm.js";import"./chunk-efyskaw7.js";import"./chunk-wjbfget1.js";export{a as buildApp};
|
package/dist/chunk-xn3pwe6e.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{Xf as a}from"./chunk-6en9gsg5.js";import"./chunk-c30z8jtq.js";import"./chunk-0knxnyq6.js";import"./chunk-wp8273q0.js";import"./chunk-y32dbdta.js";import"./chunk-frp9fc7j.js";import"./chunk-eexraz9d.js";import"./chunk-vj19hasp.js";import"./chunk-21ev9jk2.js";import"./chunk-p5ktexx3.js";import"./chunk-zn9v6jpb.js";import"./chunk-vbyxgwz5.js";import"./chunk-38ykv2gd.js";import"./chunk-xr9cxkxp.js";import"./chunk-h3r7wcxk.js";import"./chunk-veky1cte.js";import"./chunk-5rxfqxw1.js";import"./chunk-cwba6q7v.js";import"./chunk-hyzjprnz.js";import"./chunk-wk6xx6zz.js";import"./chunk-ha0a1hpx.js";import"./chunk-zxfejz72.js";import"./chunk-25tfm9t5.js";import"./chunk-aa8015mk.js";import"./chunk-4a8wet24.js";import"./chunk-rtfwn4cm.js";import"./chunk-efyskaw7.js";import"./chunk-wjbfget1.js";export{a as buildForProduction};
|