@absolutejs/absolute 0.1.19 → 0.1.20

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
@@ -144,4 +144,4 @@ $RR=function(t,u,y){function v(n){this._p=null;n()}for(var w=$RC,p=$RM,q=new Map
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
145
  t,u,""),w.bind(null,t,u,"Resource failed to load"))};$RR("`),pG=x('$RR("'),H2=x('","'),w2=x('",'),W2=x('"'),D2=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("'),NL=x('$RX("'),iN=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>"),MN=!1,nN=!0,vL=[],tG=x('<style data-precedence="'),eG=x('" data-href="'),MY=x(" "),sN=x('">'),z2=x("</style>"),UY=x("["),M0=x(",["),HB=x(","),y$=x("]"),uI=0,UN=1,IN=2,oN=3,aN=/[<>\r\n]/g,JM=/["';,\r\n]/g,LN=Function.prototype.bind,rN=Symbol.for("react.client.reference"),LI={};Object.freeze(LI);var U0={},cI=null,BN={},q0={},CL=new Set,NN=new Set,pI=new Set,wB=new Set,f$=new Set,$N=new Set,JI=new Set,IY=new Set,WB=new Set,b$={enqueueSetState:function(M,I,N){var $=M._reactInternals;$.queue===null?L$(M,"setState"):($.queue.push(I),N!==void 0&&N!==null&&dI(N))},enqueueReplaceState:function(M,I,N){M=M._reactInternals,M.replace=!0,M.queue=[I],N!==void 0&&N!==null&&dI(N)},enqueueForceUpdate:function(M,I){M._reactInternals.queue===null?L$(M,"forceUpdate"):I!==void 0&&I!==null&&dI(I)}},LY={id:1,overflow:""},GN=Math.clz32?Math.clz32:l0,BY=Math.log,NY=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`."),YN=null,h$=typeof Object.is==="function"?Object.is:NG,GL=null,XN=null,ZN=null,tN=null,eN=null,TM=null,RN=!1,EN=!1,DB=0,AB=0,HN=-1,wN=0,zB=null,eM=null,VI=0,kM=!1,KB,WN={readContext:N$,use:function(M){if(M!==null&&typeof M==="object"){if(typeof M.then==="function")return Y$(M);if(M.$$typeof===cB)return N$(M)}throw Error("An unsupported type was passed to use(): "+String(M))},useContext:function(M){return KB="useContext",IL(),M._currentValue},useMemo:G$,useReducer:o0,useRef:function(M){GL=IL(),TM=B$();var I=TM.memoizedState;return I===null?(M={current:M},Object.seal(M),TM.memoizedState=M):I},useState:function(M){return KB="useState",o0($$,M)},useInsertionEffect:kB,useLayoutEffect:kB,useCallback:function(M,I){return G$(function(){return M},I)},useImperativeHandle:kB,useEffect:kB,useDebugValue:kB,useDeferredValue:function(M,I){return IL(),I!==void 0?I:M},useTransition:function(){return IL(),[!1,zY]},useId:function(){var M=XN.treeContext,I=M.overflow;M=M.id,M=(M&~(1<<32-GN(M)-1)).toString(32)+I;var N=qL;if(N===null)throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component.");return I=DB++,M="\xAB"+N.idPrefix+"R"+M,0<I&&(M+="H"+I.toString(32)),M+"\xBB"},useSyncExternalStore:function(M,I,N){if(N===void 0)throw Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");return N()},useOptimistic:function(M){return IL(),[M,pL]},useActionState:qB,useFormState:qB,useHostTransitionStatus:function(){return IL(),fN},useMemoCache:function(M){for(var I=Array(M),N=0;N<M;N++)I[N]=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}},QB=0,m$,d$,S$,u$,c$,U,L;H0.__reactDisabledLog=!0;var B,G,X=!1,E=new(typeof WeakMap==="function"?WeakMap:Map),D={"react-stack-bottom-frame":function(M,I,N){return M(I,N)}},z=D["react-stack-bottom-frame"].bind(D),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 LM=Date;J=function(){return LM.now()}}var t=4,l=0,i=1,RU=2,d=5,GM=14,PM=null,jU={},MU={},UU={},SM={},zI=!1,pU=!1,WM=!1;XB(),XB(),P6.prerender=function(M,I){return new Promise(function(N,$){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),W=W0(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(W,_)},cancel:function(_){W.destination=null,oL(W,_)}},{highWaterMark:0})};N(V)},void 0,void 0,$,I?I.onPostpone:void 0);if(I&&I.signal){var P=I.signal;if(P.aborted)oL(W,P.reason);else{var A=function(){oL(W,P.reason),P.removeEventListener("abort",A)};P.addEventListener("abort",A)}}D$(W)})},P6.renderToReadableStream=function(M,I){return new Promise(function(N,$){var Y,Z,w=new Promise(function(C,j){Z=C,Y=j}),W=I?I.onHeaders:void 0,P;W&&(P=function(C){W(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,N(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)}}D$(V)})},P6.version="19.1.0"})()});var t2=I$((x6)=>{var T6=Y0(a2(),1),j6=Y0(r2(),1),WY,wY;WY=T6,wY=j6;x6.version=WY.version;x6.renderToString=WY.renderToString;x6.renderToStaticMarkup=WY.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 W6}from"process";var{$:V2,build:D6,Glob:RY}=globalThis.Bun;import{readFile as X6,writeFile as Z6}from"fs/promises";var{Glob:R6}=globalThis.Bun;var l2=async(BM,_M)=>{let FM=new R6("*.html"),NM=[];for await(let IM of FM.scan({cwd:_M,absolute:!0}))NM.push(IM);for(let IM of NM){let $M=await X6(IM,"utf8");for(let[yM,YM]of Object.entries(BM)){let NU=yM.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),fM=new RegExp(`(<script[^>]+src=["'])(/?(?:.*\\/)?${NU})(?:\\.[^."'/]+)?(\\.js)(["'][^>]*>)`,"g");$M=$M.replace(fM,(H,O,S,F,x)=>{return`${O}${YM}${x}`})}await Z6(IM,$M,"utf8")}};var n2=async({buildDir:BM="build",assetsDir:_M,reactIndexDir:FM,javascriptDir:NM,typeScriptDir:IM,reactPagesDir:$M,htmlDir:yM,htmxDir:YM})=>{let NU=performance.now();console.log("Build Config",{buildDir:BM,assetsDir:_M,reactIndexDir:FM,javascriptDir:NM,typeScriptDir:IM,reactPagesDir:$M,htmlDir:yM,htmxDir:YM});let fM=w6(),H=tI(fM,BM),O=_M&&tI(fM,_M),S=FM&&tI(fM,FM),F=NM&&tI(fM,NM),x=IM&&tI(fM,IM),bU=$M&&tI(fM,$M),fI=yM&&tI(fM,yM),sU=YM&&tI(fM,YM);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:WU}=await D6({entrypoints:h0,format:"esm",naming:"[dir]/[name].[hash].[ext]",outdir:H}).catch((zM)=>{console.error("Build failed:",zM),W6(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=WU.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()-NU,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,_M)=>{await i2(_M,{force:!0,recursive:!0}),await ZY(_M);let FM=new RY("*.*"),NM=[];for await(let $M of FM.scan({cwd:BM}))NM.push($M);let IM=NM.map(async($M)=>{let yM=H6($M),[YM]=yM.split("."),NU=["import { hydrateRoot } from 'react-dom/client';",`import { ${YM} } from '../pages/${YM}';
146
146
  `,`hydrateRoot(document, <${YM} />);`].join(`
147
- `);return E6(tI(_M,`${YM}Index.tsx`),NU)});await Promise.all(IM)};var e2=Y0(t$(),1),M6=Y0(t2(),1),w4=async(BM,_M)=>{let FM=e2.createElement(BM),NM=await M6.renderToReadableStream(FM,{bootstrapModules:[_M]});return new Response(NM,{headers:{"Content-Type":"text/html"}})},W4=(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(),FM=Object.values(BM).flat().filter((NM)=>NM!==void 0).find((NM)=>NM.family==="IPv4"&&!NM.internal);if(FM)return FM.address;return console.warn("No IP address found, falling back to localhost"),"localhost"};var g2=I6.HOST??"localhost",DY=I6.PORT??p2,L6,q6=C6,B6=q6.includes("--host");if(B6)L6=U6(),g2="0.0.0.0";var _4=(BM)=>BM.listen({hostname:g2,port:DY,reusePort:!0},()=>{if(B6)console.log(`Server started on http://localhost:${DY}`),console.log(`Server started on network: http://${L6}:${DY}`);else console.log(`Server started on http://${g2}:${DY}`)});var V4=await n2({});export{l2 as updateScriptTags,_4 as networkingPlugin,w4 as handleReactPageRequest,W4 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};
147
+ `);return E6(tI(_M,`${YM}Index.tsx`),NU)});await Promise.all(IM)};var e2=Y0(t$(),1),M6=Y0(t2(),1),w4=async(BM,_M)=>{let FM=e2.createElement(BM),NM=await M6.renderToReadableStream(FM,{bootstrapModules:[_M]});return new Response(NM,{headers:{"Content-Type":"text/html"}})},W4=(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(),FM=Object.values(BM).flat().filter((NM)=>NM!==void 0).find((NM)=>NM.family==="IPv4"&&!NM.internal);if(FM)return FM.address;return console.warn("No IP address found, falling back to localhost"),"localhost"};var g2=I6.HOST??"localhost",DY=I6.PORT??p2,L6,q6=C6,B6=q6.includes("--host");if(B6)L6=U6(),g2="0.0.0.0";var _4=(BM)=>BM.listen({hostname:g2,port:DY},()=>{if(B6)console.log(`Server started on http://localhost:${DY}`),console.log(`Server started on network: http://${L6}:${DY}`);else console.log(`Server started on http://${g2}:${DY}`)});var V4=await n2({});export{l2 as updateScriptTags,_4 as networkingPlugin,w4 as handleReactPageRequest,W4 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};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@absolutejs/absolute",
3
- "version": "0.1.19",
3
+ "version": "0.1.20",
4
4
  "description": "A fullstack meta-framework for building web applications with TypeScript",
5
5
  "repository": {
6
6
  "type": "git",
@@ -20,16 +20,16 @@
20
20
  "dependencies": {
21
21
  "@elysiajs/static": "1.0.2",
22
22
  "elysia": "1.0.13",
23
- "react": "19.1.0",
24
- "react-dom": "19.1.0",
25
- "svelte": "4.2.15",
26
- "vue": "3.4.26"
23
+ "react-dom": "19.1.0"
27
24
  },
28
25
  "devDependencies": {
29
26
  "@types/bun": "1.1.1",
30
27
  "@types/react": "19.1.0",
31
28
  "@types/react-dom": "19.1.2",
32
29
  "@types/vue": "2.0.0",
33
- "typescript": "5.7.2"
30
+ "typescript": "5.7.2",
31
+ "react": "19.1.0",
32
+ "svelte": "4.2.15",
33
+ "vue": "3.4.26"
34
34
  }
35
35
  }
@@ -20,8 +20,7 @@ export const networkingPlugin = (app: Elysia) =>
20
20
  app.listen(
21
21
  {
22
22
  hostname: host,
23
- port: port,
24
- reusePort: true
23
+ port: port
25
24
  },
26
25
  () => {
27
26
  if (hostFlag) {