@absolutejs/absolute 0.1.16 → 0.1.17

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/index.js CHANGED
@@ -142,6 +142,6 @@ d;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(
142
142
  t,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("`),g$=x(`$RM=new Map;
143
143
  $RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map,r=document,g,b,h=r.querySelectorAll("link[data-precedence],style[data-precedence]"),x=[],k=0;b=h[k++];)"not all"===b.getAttribute("media")?x.push(b):("LINK"===b.tagName&&p.set(b.getAttribute("href"),b),q.set(b.dataset.precedence,g=b));b=0;h=[];var l,a;for(k=!0;;){if(k){var e=y[b++];if(!e){k=!1;b=0;continue}var c=!1,m=0;var d=e[m++];if(a=p.get(d)){var f=a._p;c=!0}else{a=r.createElement("link");a.href=
144
144
  d;a.rel="stylesheet";for(a.dataset.precedence=l=e[m++];f=e[m++];)a.setAttribute(f,e[m++]);f=a._p=new Promise(function(n,z){a.onload=v.bind(a,n);a.onerror=v.bind(a,z)});p.set(d,a)}d=a.getAttribute("media");!f||d&&!matchMedia(d).matches||h.push(f);if(c)continue}else{a=x[b++];if(!a)break;l=a.getAttribute("data-precedence");a.removeAttribute("media")}c=q.get(l)||g;c===g&&(g=a);q.set(l,a);c?c.parentNode.insertBefore(a,c.nextSibling):(c=r.head,c.insertBefore(a,c.firstChild))}Promise.all(h).then(w.bind(null,
145
- t,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("`),pG=x('$RR("'),H2=x('","'),w2=x('",'),D2=x('"'),W2=x(")</script>");x('<template data-rci="" data-bid="'),x('<template data-rri="" data-bid="'),x('" data-sid="'),x('" data-sty="');var A2=x('$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};;$RX("'),BL=x('$RX("'),iB=x('"'),$L=x(","),lG=x(")</script>");x('<template data-rxi="" data-bid="'),x('" data-dgst="'),x('" data-msg="'),x('" data-stck="'),x('" data-cstck="');var iG=/[<\u2028\u2029]/g,nG=/[&><\u2028\u2029]/g,sG=x('<style media="not all" data-precedence="'),oG=x('" data-href="'),aG=x('">'),rG=x("</style>"),MB=!1,nB=!0,vL=[],tG=x('<style data-precedence="'),eG=x('" data-href="'),MY=x(" "),sB=x('">'),z2=x("</style>"),UY=x("["),M0=x(",["),HN=x(","),y$=x("]"),uI=0,UB=1,IB=2,oB=3,aB=/[<>\r\n]/g,_M=/["';,\r\n]/g,LB=Function.prototype.bind,rB=Symbol.for("react.client.reference"),LI={};Object.freeze(LI);var U0={},cI=null,NB={},q0={},CL=new Set,BB=new Set,pI=new Set,wN=new Set,f$=new Set,$B=new Set,JI=new Set,IY=new Set,DN=new Set,b$={enqueueSetState:function(M,I,B){var $=M._reactInternals;$.queue===null?L$(M,"setState"):($.queue.push(I),B!==void 0&&B!==null&&dI(B))},enqueueReplaceState:function(M,I,B){M=M._reactInternals,M.replace=!0,M.queue=[I],B!==void 0&&B!==null&&dI(B)},enqueueForceUpdate:function(M,I){M._reactInternals.queue===null?L$(M,"forceUpdate"):I!==void 0&&I!==null&&dI(I)}},LY={id:1,overflow:""},GB=Math.clz32?Math.clz32:l0,NY=Math.log,BY=Math.LN2,I0=Error("Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`."),YB=null,h$=typeof Object.is==="function"?Object.is:BG,GL=null,XB=null,ZB=null,tB=null,eB=null,TM=null,RB=!1,EB=!1,WN=0,AN=0,HB=-1,wB=0,zN=null,eM=null,VI=0,kM=!1,KN,DB={readContext:B$,use:function(M){if(M!==null&&typeof M==="object"){if(typeof M.then==="function")return Y$(M);if(M.$$typeof===cN)return B$(M)}throw Error("An unsupported type was passed to use(): "+String(M))},useContext:function(M){return KN="useContext",IL(),M._currentValue},useMemo:G$,useReducer:o0,useRef:function(M){GL=IL(),TM=N$();var I=TM.memoizedState;return I===null?(M={current:M},Object.seal(M),TM.memoizedState=M):I},useState:function(M){return KN="useState",o0($$,M)},useInsertionEffect:kN,useLayoutEffect:kN,useCallback:function(M,I){return G$(function(){return M},I)},useImperativeHandle:kN,useEffect:kN,useDebugValue:kN,useDeferredValue:function(M,I){return IL(),I!==void 0?I:M},useTransition:function(){return IL(),[!1,zY]},useId:function(){var M=XB.treeContext,I=M.overflow;M=M.id,M=(M&~(1<<32-GB(M)-1)).toString(32)+I;var B=qL;if(B===null)throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component.");return I=WN++,M="\xAB"+B.idPrefix+"R"+M,0<I&&(M+="H"+I.toString(32)),M+"\xBB"},useSyncExternalStore:function(M,I,B){if(B===void 0)throw Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");return B()},useOptimistic:function(M){return IL(),[M,pL]},useActionState:qN,useFormState:qN,useHostTransitionStatus:function(){return IL(),fB},useMemoCache:function(M){for(var I=Array(M),B=0;B<M;B++)I[B]=QM;return I},useCacheRefresh:function(){return X$}},qL=null,jM=null,$Y={getCacheForType:function(){throw Error("Not implemented.")},getOwner:function(){return jM===null?null:jM.componentStack}},QN=0,m$,d$,S$,u$,c$,U,L;H0.__reactDisabledLog=!0;var N,G,X=!1,E=new(typeof WeakMap==="function"?WeakMap:Map),W={"react-stack-bottom-frame":function(M,I,B){return M(I,B)}},z=W["react-stack-bottom-frame"].bind(W),T={"react-stack-bottom-frame":function(M){return M.render()}},K=T["react-stack-bottom-frame"].bind(T),k={"react-stack-bottom-frame":function(M){var I=M._init;return I(M._payload)}},v=k["react-stack-bottom-frame"].bind(k),y=0;if(typeof performance==="object"&&typeof performance.now==="function")var b=performance,J=function(){return b.now()};else{var IM=Date;J=function(){return IM.now()}}var t=4,l=0,i=1,RU=2,d=5,NM=14,PM=null,jU={},MU={},UU={},SM={},zI=!1,pU=!1,DM=!1;XN(),XN(),P6.prerender=function(M,I){return new Promise(function(B,$){var Y=I?I.onHeaders:void 0,Z;Y&&(Z=function(V){Y(new Headers(V))});var w=oU(I?I.identifierPrefix:void 0,I?I.unstable_externalRuntimeSrc:void 0,I?I.bootstrapScriptContent:void 0,I?I.bootstrapScripts:void 0,I?I.bootstrapModules:void 0),D=D0(M,w,ML(w,void 0,I?I.unstable_externalRuntimeSrc:void 0,I?I.importMap:void 0,Z,I?I.maxHeadersLength:void 0),$U(I?I.namespaceURI:void 0),I?I.progressiveChunkSize:void 0,I?I.onError:void 0,function(){var V={prelude:new ReadableStream({type:"bytes",pull:function(_){GG(D,_)},cancel:function(_){D.destination=null,oL(D,_)}},{highWaterMark:0})};B(V)},void 0,void 0,$,I?I.onPostpone:void 0);if(I&&I.signal){var P=I.signal;if(P.aborted)oL(D,P.reason);else{var A=function(){oL(D,P.reason),P.removeEventListener("abort",A)};P.addEventListener("abort",A)}}W$(D)})},P6.renderToReadableStream=function(M,I){return new Promise(function(B,$){var Y,Z,w=new Promise(function(C,j){Z=C,Y=j}),D=I?I.onHeaders:void 0,P;D&&(P=function(C){D(new Headers(C))});var A=oU(I?I.identifierPrefix:void 0,I?I.unstable_externalRuntimeSrc:void 0,I?I.bootstrapScriptContent:void 0,I?I.bootstrapScripts:void 0,I?I.bootstrapModules:void 0),V=w0(M,A,ML(A,I?I.nonce:void 0,I?I.unstable_externalRuntimeSrc:void 0,I?I.importMap:void 0,P,I?I.maxHeadersLength:void 0),$U(I?I.namespaceURI:void 0),I?I.progressiveChunkSize:void 0,I?I.onError:void 0,Z,function(){var C=new ReadableStream({type:"bytes",pull:function(j){GG(V,j)},cancel:function(j){V.destination=null,oL(V,j)}},{highWaterMark:0});C.allReady=w,B(C)},function(C){w.catch(function(){}),$(C)},Y,I?I.onPostpone:void 0,I?I.formState:void 0);if(I&&I.signal){var _=I.signal;if(_.aborted)oL(V,_.reason);else{var q=function(){oL(V,_.reason),_.removeEventListener("abort",q)};_.addEventListener("abort",q)}}W$(V)})},P6.version="19.1.0"})()});var t2=I$((x6)=>{var T6=Y0(a2(),1),j6=Y0(r2(),1),DY,wY;DY=T6,wY=j6;x6.version=DY.version;x6.renderToString=DY.renderToString;x6.renderToStaticMarkup=DY.renderToStaticMarkup;x6.renderToReadableStream=wY.renderToReadableStream;if(wY.resume)x6.resume=wY.resume});var g6=60,F2=1000,J2=60000,y6=60,f6=24,b6=86400000,XY=2,p2=3000;import{rm as i2,mkdir as ZY,writeFile as E6}from"fs/promises";import{join as tI,basename as H6}from"path";import{cwd as w6,exit as D6}from"process";var{$:V2,build:W6,Glob:RY}=globalThis.Bun;import{readFile as X6,writeFile as Z6}from"fs/promises";var{Glob:R6}=globalThis.Bun;var l2=async(BM,JM)=>{let VM=new R6("*.html"),$M=[];for await(let LM of VM.scan({cwd:JM,absolute:!0}))$M.push(LM);for(let LM of $M){let GM=await X6(LM,"utf8");for(let[hM,XM]of Object.entries(BM)){let BU=hM.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),yM=new RegExp(`(<script[^>]+src=["'])(/?(?:.*\\/)?${BU})(?:\\.[^."'/]+)?(\\.js)(["'][^>]*>)`,"g");GM=GM.replace(yM,(H,O,S,F,x)=>{return`${O}${XM}${x}`})}await Z6(LM,GM,"utf8")}};var n2=async({buildDir:BM="build",assetsDir:JM,reactIndexDir:VM,javascriptDir:$M,typeScriptDir:LM,reactPagesDir:GM,htmlDir:hM,htmxDir:XM}={})=>{let BU=performance.now(),yM=w6(),H=tI(yM,BM),O=JM&&tI(yM,JM),S=VM&&tI(yM,VM),F=$M&&tI(yM,$M),x=LM&&tI(yM,LM),bU=GM&&tI(yM,GM),fI=hM&&tI(yM,hM),sU=XM&&tI(yM,XM);await i2(H,{force:!0,recursive:!0}),await ZY(H),bU&&S&&await A6(bU,S);let zL=new RY("*.{tsx,jsx}"),nM=[];for await(let zM of zL.scan({absolute:!0,cwd:S}))nM.push(zM);let X0=new RY("*.js"),c=[];for await(let zM of X0.scan({absolute:!0,cwd:F}))c.push(zM);let JU=new RY("*.ts"),xI=[];for await(let zM of JU.scan({absolute:!0,cwd:x}))xI.push(zM);let h0=nM.concat(c).concat(xI);if(h0.length===0)return console.warn("No entry points found, skipping build"),null;let{logs:KM,outputs:DU}=await W6({entrypoints:h0,format:"esm",naming:"[dir]/[name].[hash].[ext]",outdir:H}).catch((zM)=>{console.error("Build failed:",zM),D6(1)});if(KM.forEach((zM)=>{if(zM.level==="error")console.error(zM);else if(zM.level==="warning")console.warn(zM);else if(zM.level==="info"||zM.level==="debug")console.info(zM)}),O&&await V2`cp -R ${O} ${H}`,fI)await ZY(tI(H,"html")),await V2`cp -R ${fI} ${tI(H)}`;if(sU)await ZY(tI(H,"htmx")),await V2`cp -R ${sU} ${tI(H)}`;let eI=DU.reduce((zM,ML)=>{let oU=ML.path;if(oU.startsWith(H))oU=oU.slice(H.length);oU=oU.replace(/^\/+/,"");let hU=oU.split("/").pop();if(!hU)return zM;let p=`.${ML.hash}.`;if(!hU.includes(p))throw new Error(`Expected hash delimiter ${p} in ${hU}`);let[$U]=hU.split(p);return zM[$U]="/"+oU,zM},{});fI&&await l2(eI,fI);let u=performance.now()-BU,AM;if(u<F2)AM=`${u.toFixed(XY)}ms`;else if(u<J2)AM=`${(u/F2).toFixed(XY)}s`;else AM=`${(u/J2).toFixed(XY)}m`;return console.log(`Build completed in ${AM}`),eI},A6=async(BM,JM)=>{await i2(JM,{force:!0,recursive:!0}),await ZY(JM);let VM=new RY("*.*"),$M=[];for await(let GM of VM.scan({cwd:BM}))$M.push(GM);let LM=$M.map(async(GM)=>{let hM=H6(GM),[XM]=hM.split("."),BU=["import { hydrateRoot } from 'react-dom/client';",`import { ${XM} } from '../pages/${XM}';
145
+ t,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("`),pG=x('$RR("'),H2=x('","'),w2=x('",'),D2=x('"'),W2=x(")</script>");x('<template data-rci="" data-bid="'),x('<template data-rri="" data-bid="'),x('" data-sid="'),x('" data-sty="');var A2=x('$RX=function(b,c,d,e,f){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),f&&(a.cstck=f),b._reactRetry&&b._reactRetry())};;$RX("'),BL=x('$RX("'),iB=x('"'),$L=x(","),lG=x(")</script>");x('<template data-rxi="" data-bid="'),x('" data-dgst="'),x('" data-msg="'),x('" data-stck="'),x('" data-cstck="');var iG=/[<\u2028\u2029]/g,nG=/[&><\u2028\u2029]/g,sG=x('<style media="not all" data-precedence="'),oG=x('" data-href="'),aG=x('">'),rG=x("</style>"),MB=!1,nB=!0,vL=[],tG=x('<style data-precedence="'),eG=x('" data-href="'),MY=x(" "),sB=x('">'),z2=x("</style>"),UY=x("["),M0=x(",["),HN=x(","),y$=x("]"),uI=0,UB=1,IB=2,oB=3,aB=/[<>\r\n]/g,_M=/["';,\r\n]/g,LB=Function.prototype.bind,rB=Symbol.for("react.client.reference"),LI={};Object.freeze(LI);var U0={},cI=null,NB={},q0={},CL=new Set,BB=new Set,pI=new Set,wN=new Set,f$=new Set,$B=new Set,JI=new Set,IY=new Set,DN=new Set,b$={enqueueSetState:function(M,I,B){var $=M._reactInternals;$.queue===null?L$(M,"setState"):($.queue.push(I),B!==void 0&&B!==null&&dI(B))},enqueueReplaceState:function(M,I,B){M=M._reactInternals,M.replace=!0,M.queue=[I],B!==void 0&&B!==null&&dI(B)},enqueueForceUpdate:function(M,I){M._reactInternals.queue===null?L$(M,"forceUpdate"):I!==void 0&&I!==null&&dI(I)}},LY={id:1,overflow:""},GB=Math.clz32?Math.clz32:l0,NY=Math.log,BY=Math.LN2,I0=Error("Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`."),YB=null,h$=typeof Object.is==="function"?Object.is:BG,GL=null,XB=null,ZB=null,tB=null,eB=null,TM=null,RB=!1,EB=!1,WN=0,AN=0,HB=-1,wB=0,zN=null,eM=null,VI=0,kM=!1,KN,DB={readContext:B$,use:function(M){if(M!==null&&typeof M==="object"){if(typeof M.then==="function")return Y$(M);if(M.$$typeof===cN)return B$(M)}throw Error("An unsupported type was passed to use(): "+String(M))},useContext:function(M){return KN="useContext",IL(),M._currentValue},useMemo:G$,useReducer:o0,useRef:function(M){GL=IL(),TM=N$();var I=TM.memoizedState;return I===null?(M={current:M},Object.seal(M),TM.memoizedState=M):I},useState:function(M){return KN="useState",o0($$,M)},useInsertionEffect:kN,useLayoutEffect:kN,useCallback:function(M,I){return G$(function(){return M},I)},useImperativeHandle:kN,useEffect:kN,useDebugValue:kN,useDeferredValue:function(M,I){return IL(),I!==void 0?I:M},useTransition:function(){return IL(),[!1,zY]},useId:function(){var M=XB.treeContext,I=M.overflow;M=M.id,M=(M&~(1<<32-GB(M)-1)).toString(32)+I;var B=qL;if(B===null)throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component.");return I=WN++,M="\xAB"+B.idPrefix+"R"+M,0<I&&(M+="H"+I.toString(32)),M+"\xBB"},useSyncExternalStore:function(M,I,B){if(B===void 0)throw Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");return B()},useOptimistic:function(M){return IL(),[M,pL]},useActionState:qN,useFormState:qN,useHostTransitionStatus:function(){return IL(),fB},useMemoCache:function(M){for(var I=Array(M),B=0;B<M;B++)I[B]=QM;return I},useCacheRefresh:function(){return X$}},qL=null,jM=null,$Y={getCacheForType:function(){throw Error("Not implemented.")},getOwner:function(){return jM===null?null:jM.componentStack}},QN=0,m$,d$,S$,u$,c$,U,L;H0.__reactDisabledLog=!0;var N,G,X=!1,E=new(typeof WeakMap==="function"?WeakMap:Map),W={"react-stack-bottom-frame":function(M,I,B){return M(I,B)}},z=W["react-stack-bottom-frame"].bind(W),T={"react-stack-bottom-frame":function(M){return M.render()}},K=T["react-stack-bottom-frame"].bind(T),k={"react-stack-bottom-frame":function(M){var I=M._init;return I(M._payload)}},v=k["react-stack-bottom-frame"].bind(k),y=0;if(typeof performance==="object"&&typeof performance.now==="function")var b=performance,J=function(){return b.now()};else{var IM=Date;J=function(){return IM.now()}}var t=4,l=0,i=1,RU=2,d=5,NM=14,PM=null,jU={},MU={},UU={},SM={},zI=!1,pU=!1,DM=!1;XN(),XN(),P6.prerender=function(M,I){return new Promise(function(B,$){var Y=I?I.onHeaders:void 0,Z;Y&&(Z=function(V){Y(new Headers(V))});var w=oU(I?I.identifierPrefix:void 0,I?I.unstable_externalRuntimeSrc:void 0,I?I.bootstrapScriptContent:void 0,I?I.bootstrapScripts:void 0,I?I.bootstrapModules:void 0),D=D0(M,w,ML(w,void 0,I?I.unstable_externalRuntimeSrc:void 0,I?I.importMap:void 0,Z,I?I.maxHeadersLength:void 0),$U(I?I.namespaceURI:void 0),I?I.progressiveChunkSize:void 0,I?I.onError:void 0,function(){var V={prelude:new ReadableStream({type:"bytes",pull:function(_){GG(D,_)},cancel:function(_){D.destination=null,oL(D,_)}},{highWaterMark:0})};B(V)},void 0,void 0,$,I?I.onPostpone:void 0);if(I&&I.signal){var P=I.signal;if(P.aborted)oL(D,P.reason);else{var A=function(){oL(D,P.reason),P.removeEventListener("abort",A)};P.addEventListener("abort",A)}}W$(D)})},P6.renderToReadableStream=function(M,I){return new Promise(function(B,$){var Y,Z,w=new Promise(function(C,j){Z=C,Y=j}),D=I?I.onHeaders:void 0,P;D&&(P=function(C){D(new Headers(C))});var A=oU(I?I.identifierPrefix:void 0,I?I.unstable_externalRuntimeSrc:void 0,I?I.bootstrapScriptContent:void 0,I?I.bootstrapScripts:void 0,I?I.bootstrapModules:void 0),V=w0(M,A,ML(A,I?I.nonce:void 0,I?I.unstable_externalRuntimeSrc:void 0,I?I.importMap:void 0,P,I?I.maxHeadersLength:void 0),$U(I?I.namespaceURI:void 0),I?I.progressiveChunkSize:void 0,I?I.onError:void 0,Z,function(){var C=new ReadableStream({type:"bytes",pull:function(j){GG(V,j)},cancel:function(j){V.destination=null,oL(V,j)}},{highWaterMark:0});C.allReady=w,B(C)},function(C){w.catch(function(){}),$(C)},Y,I?I.onPostpone:void 0,I?I.formState:void 0);if(I&&I.signal){var _=I.signal;if(_.aborted)oL(V,_.reason);else{var q=function(){oL(V,_.reason),_.removeEventListener("abort",q)};_.addEventListener("abort",q)}}W$(V)})},P6.version="19.1.0"})()});var t2=I$((x6)=>{var T6=Y0(a2(),1),j6=Y0(r2(),1),DY,wY;DY=T6,wY=j6;x6.version=DY.version;x6.renderToString=DY.renderToString;x6.renderToStaticMarkup=DY.renderToStaticMarkup;x6.renderToReadableStream=wY.renderToReadableStream;if(wY.resume)x6.resume=wY.resume});var g6=60,F2=1000,J2=60000,y6=60,f6=24,b6=86400000,XY=2,p2=3000;import{rm as i2,mkdir as ZY,writeFile as E6}from"fs/promises";import{join as tI,basename as H6}from"path";import{cwd as w6,exit as D6}from"process";var{$:V2,build:W6,Glob:RY}=globalThis.Bun;import{readFile as X6,writeFile as Z6}from"fs/promises";var{Glob:R6}=globalThis.Bun;var l2=async(BM,JM)=>{let VM=new R6("*.html"),$M=[];for await(let LM of VM.scan({cwd:JM,absolute:!0}))$M.push(LM);for(let LM of $M){let GM=await X6(LM,"utf8");for(let[hM,XM]of Object.entries(BM)){let BU=hM.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),yM=new RegExp(`(<script[^>]+src=["'])(/?(?:.*\\/)?${BU})(?:\\.[^."'/]+)?(\\.js)(["'][^>]*>)`,"g");GM=GM.replace(yM,(H,O,S,F,x)=>{return`${O}${XM}${x}`})}await Z6(LM,GM,"utf8")}};var n2=async({buildDir:BM="build",assetsDir:JM,reactIndexDir:VM,javascriptDir:$M,typeScriptDir:LM,reactPagesDir:GM,htmlDir:hM,htmxDir:XM})=>{let BU=performance.now(),yM=w6(),H=tI(yM,BM),O=JM&&tI(yM,JM),S=VM&&tI(yM,VM),F=$M&&tI(yM,$M),x=LM&&tI(yM,LM),bU=GM&&tI(yM,GM),fI=hM&&tI(yM,hM),sU=XM&&tI(yM,XM);await i2(H,{force:!0,recursive:!0}),await ZY(H),bU&&S&&await A6(bU,S);let zL=new RY("*.{tsx,jsx}"),nM=[];for await(let zM of zL.scan({absolute:!0,cwd:S}))nM.push(zM);let X0=new RY("*.js"),c=[];for await(let zM of X0.scan({absolute:!0,cwd:F}))c.push(zM);let JU=new RY("*.ts"),xI=[];for await(let zM of JU.scan({absolute:!0,cwd:x}))xI.push(zM);let h0=nM.concat(c).concat(xI);if(h0.length===0)return console.warn("No entry points found, skipping build"),null;let{logs:KM,outputs:DU}=await W6({entrypoints:h0,format:"esm",naming:"[dir]/[name].[hash].[ext]",outdir:H}).catch((zM)=>{console.error("Build failed:",zM),D6(1)});if(KM.forEach((zM)=>{if(zM.level==="error")console.error(zM);else if(zM.level==="warning")console.warn(zM);else if(zM.level==="info"||zM.level==="debug")console.info(zM)}),O&&await V2`cp -R ${O} ${H}`,fI)await ZY(tI(H,"html")),await V2`cp -R ${fI} ${tI(H)}`;if(sU)await ZY(tI(H,"htmx")),await V2`cp -R ${sU} ${tI(H)}`;let eI=DU.reduce((zM,ML)=>{let oU=ML.path;if(oU.startsWith(H))oU=oU.slice(H.length);oU=oU.replace(/^\/+/,"");let hU=oU.split("/").pop();if(!hU)return zM;let p=`.${ML.hash}.`;if(!hU.includes(p))throw new Error(`Expected hash delimiter ${p} in ${hU}`);let[$U]=hU.split(p);return zM[$U]="/"+oU,zM},{});fI&&await l2(eI,fI);let u=performance.now()-BU,AM;if(u<F2)AM=`${u.toFixed(XY)}ms`;else if(u<J2)AM=`${(u/F2).toFixed(XY)}s`;else AM=`${(u/J2).toFixed(XY)}m`;return console.log(`Build completed in ${AM}`),eI},A6=async(BM,JM)=>{await i2(JM,{force:!0,recursive:!0}),await ZY(JM);let VM=new RY("*.*"),$M=[];for await(let GM of VM.scan({cwd:BM}))$M.push(GM);let LM=$M.map(async(GM)=>{let hM=H6(GM),[XM]=hM.split("."),BU=["import { hydrateRoot } from 'react-dom/client';",`import { ${XM} } from '../pages/${XM}';
146
146
  `,`hydrateRoot(document, <${XM} />);`].join(`
147
147
  `);return E6(tI(JM,`${XM}Index.tsx`),BU)});await Promise.all(LM)};var e2=Y0(t$(),1),M6=Y0(t2(),1),w4=async(BM,JM)=>{let VM=e2.createElement(BM),$M=await M6.renderToReadableStream(VM,{bootstrapModules:[JM]});return new Response($M,{headers:{"Content-Type":"text/html"}})},D4=(BM)=>Bun.file(BM);import{argv as C6}from"process";var{env:I6}=globalThis.Bun;import v6 from"os";var U6=()=>{let BM=v6.networkInterfaces(),VM=Object.values(BM).flat().filter(($M)=>$M!==void 0).find(($M)=>$M.family==="IPv4"&&!$M.internal);if(VM)return VM.address;return console.warn("No IP address found, falling back to localhost"),"localhost"};var g2=I6.HOST??"localhost",WY=I6.PORT??p2,L6,q6=C6,N6=q6.includes("--host");if(N6)L6=U6(),g2="0.0.0.0";var _4=(BM)=>BM.listen({hostname:g2,port:WY},()=>{if(N6)console.log(`Server started on http://localhost:${WY}`),console.log(`Server started on network: http://${L6}:${WY}`);else console.log(`Server started on http://${g2}:${WY}`)});var V4=await n2({});export{l2 as updateScriptTags,_4 as networkingPlugin,w4 as handleReactPageRequest,D4 as handleHTMLPageRequest,U6 as getLocalIPAddress,n2 as build,XY as TIME_PRECISION,g6 as SECONDS_IN_A_MINUTE,y6 as MINUTES_IN_AN_HOUR,F2 as MILLISECONDS_IN_A_SECOND,J2 as MILLISECONDS_IN_A_MINUTE,b6 as MILLISECONDS_IN_A_DAY,f6 as HOURS_IN_A_DAY,p2 as DEFAULT_PORT};
@@ -8,5 +8,5 @@ type BuildConfig = {
8
8
  htmlDir?: string;
9
9
  htmxDir?: string;
10
10
  };
11
- export declare const build: ({ buildDir, assetsDir, reactIndexDir, javascriptDir, typeScriptDir, reactPagesDir, htmlDir, htmxDir }?: BuildConfig) => Promise<Record<string, string> | null>;
11
+ export declare const build: ({ buildDir, assetsDir, reactIndexDir, javascriptDir, typeScriptDir, reactPagesDir, htmlDir, htmxDir }: BuildConfig) => Promise<Record<string, string> | null>;
12
12
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/absolute",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "description": "A fullstack meta-framework for building web applications with TypeScript",
5
5
  "repository": {
6
6
  "type": "git",
package/src/core/build.ts CHANGED
@@ -29,7 +29,7 @@ export const build = async ({
29
29
  reactPagesDir,
30
30
  htmlDir,
31
31
  htmxDir
32
- }: BuildConfig = {}) => {
32
+ }: BuildConfig) => {
33
33
  const start = performance.now();
34
34
 
35
35
  const projectRoot = cwd();