gemi 0.49.0 → 0.49.1

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.
@@ -1,5 +1,4 @@
1
1
  // @bun
2
- import{h as I,i as F}from"./chunk-x2ahg1k8.js";import"./chunk-ppt296ye.js";import{K as T,M as _}from"./chunk-twg652g2.js";import"./chunk-x5f4e2fp.js";import"./chunk-p5r0t9jh.js";import"./chunk-4z53shav.js";import"./chunk-m0earq80.js";import"./chunk-f18weffa.js";import{join as N}from"path";import{Duplex as q}from"stream";import{constants as P,createBrotliCompress as m,createGzip as h}from"zlib";var c=["br","gzip"],l=1024,o=5,d=19,p=6;function n($){if($===void 0)return 1;if(!/^\d+(\.\d{0,3})?$/.test($.trim()))return 1;let J=Number($.trim());return Number.isFinite(J)?Math.min(J,1):1}function i($){if($===null||$===void 0)return null;let J=new Map;for(let H of $.split(",")){let[z,...G]=H.split(";"),j=z.trim().toLowerCase();if(j==="")continue;let Q=1;for(let Y of G){let k=Y.indexOf("=");if(k===-1)continue;if(Y.slice(0,k).trim().toLowerCase()==="q"){Q=n(Y.slice(k+1));break}}J.set(j,Q)}return J}function t($,J=c){let H=i($);if(!H)return null;let z=H.get("*"),G=null,j=0;for(let Q of J){let Y=H.get(Q)??z??0;if(Y>j)G=Q,j=Y}return G}function a($,J){if(!$)return!1;return $.split(",").some((H)=>H.trim().toLowerCase().split("=")[0].trim()===J)}function s($,J){if($==="HEAD")return!1;if(!J.body)return!1;if(J.status<200||J.status===204||J.status===206||J.status===304)return!1;if(J.headers.has("Content-Range"))return!1;let H=J.headers.get("Content-Type");if(!H||!/^\s*text\/html\s*(;|$)/i.test(H))return!1;let z=J.headers.get("Content-Encoding");if(z&&z.trim().toLowerCase()!=="identity")return!1;if(a(J.headers.get("Cache-Control"),"no-transform"))return!1;let G=J.headers.get("Content-Length");if(G!==null&&Number(G)<l)return!1;return!0}function r($){let J=$==="br"?m({params:{[P.BROTLI_PARAM_QUALITY]:o,[P.BROTLI_PARAM_LGWIN]:d},flush:P.BROTLI_OPERATION_FLUSH}):h({level:p,flush:P.Z_SYNC_FLUSH});return q.toWeb(J)}function e($){let J=$.get("Vary");if(!J){$.set("Vary","Accept-Encoding");return}let H=J.split(",").map((z)=>z.trim().toLowerCase());if(H.includes("*")||H.includes("accept-encoding"))return;$.append("Vary","Accept-Encoding")}function D($,J){if(!s($.method,J))return J;let H=new Headers(J.headers);e(H);let z=t($.headers.get("Accept-Encoding"));if(!z)return new Response(J.body,{status:J.status,statusText:J.statusText,headers:H});let G;try{G=r(z)}catch{return new Response(J.body,{status:J.status,statusText:J.statusText,headers:H})}return H.set("Content-Encoding",z),H.delete("Content-Length"),new Response(J.body.pipeThrough(G),{status:J.status,statusText:J.statusText,headers:H})}function R($){let J=$.toString(),H=new Bun.CryptoHasher("sha1");return H.update(J),H.digest("hex")}if(!globalThis.URLPattern)globalThis.URLPattern=T;import{exists as JJ}from"fs/promises";var $J=process.env.GEMI_PROJECT_DIR??"",C=N(process.cwd(),$J),HJ=N(C,"app"),A=N(C,"dist");async function AJ($,J){let H=await import(`${A}/client/.vite/manifest.json`),z=await import(`${A}/server/.vite/manifest.json`);process.env.ROOT_DIR=C,process.env.APP_DIR=HJ,process.env.DIST_DIR=A;let G={},j={},Q={},Y={},k=(K,Z)=>`"${K}": () => import("${Z}")`,M=[];for(let K of["404",...$.getFlatComponentTree.call($)]){let Z=z[`app/views/${K}.tsx`];if(!Z?.file){console.log(`Server file not found for ${K}`),console.log(Z);let W=Object.keys(z),L=`app/views/${K}.tsx`;console.log(`${L} not found in server manifest`),console.log(W)}let X=await import(`${process.env.DIST_DIR}/server/${Z?.file}`);G[K]=X.default,j[K]=X.OpenGraph,Q[K]=X;let U=H[`app/views/${K}.tsx`];if(U?.css&&U?.css.length>0)Y[K]=U?.css;if(U)M.push(k(K,`/${U?.file}`))}let g=`{${M.join(",")}}`,w=H["app/client.tsx"]?.css??[],f=(await Promise.all(w.map((K)=>Bun.file(`${A}/client/${K}`).text()))).join(`
3
- `),v=new T({pathname:"/*.:filetype(png|txt|js|css|jpg|svg|jpeg|avif|webp|ico|ttf|map)"});async function u(K){let{pathname:Z}=new URL(K.url),X=Z.startsWith("/.well-known"),U=v.test({pathname:Z})||X,W=Z.startsWith("/api");if(U&&!W){let L=new URL(K.url),B=K.url.replace(L.origin,"").split("?")[0],O=`${A}/client${B.replace("/assets/assets","/assets")}`,b=await JJ(O);if(!b&&L.pathname.includes(".js"))return new Response(`if(caches){caches?.delete("${O}")}window.location.reload();export {}`,{headers:{"Content-Type":"application/javascript"}});if(!b){if(Z===_||Z.startsWith(`${_}/`))return new Response("Not found",{status:404});return await S(K,Z)}try{let x=Bun.file(O),y=R(x.lastModified);return new Response(x.stream(),{headers:{"Content-Type":x.type,"Cache-Control":"public, max-age=31536000, must-revalidate","Content-Length":String(x.size),ETag:y}})}catch(x){return $.onException?.(x),new Response("Not found",{status:404})}}return await S(K,Z)}async function S(K,Z){let X=$.fetch.bind($);try{let U=await X(K);if(U instanceof Response)return U;else{let W=[];return W.push({content:f}),await U({getStyles:async(B)=>{if(!B)return I([]);for(let O of B){let b=H[`app/views/${O}.tsx`];for(let x of b?.css??[]){let y=Bun.file(`${process.env.DIST_DIR}/client/${x}`);W.push({id:x,content:await y.text()})}}return I(W)},bootstrapModules:[`/${H["app/client.tsx"].file}`],loaders:g,viewImportMap:G,viewModules:Q,ogMap:j,cssManifest:Y})}}catch(U){if(console.error(U),Z.startsWith("/api"))return new Response(JSON.stringify({error:U.message}),{status:500,headers:{"Content-Type":"application/json"}});return $.onException?.(U),new Response(U.stack,{status:500})}}let E=(process.env.GEMI_COMPRESSION??"auto").toLowerCase()!=="off",V=Bun.serve({maxRequestBodySize:10737418240,fetch:async(K,Z)=>{if(!K.headers.get("x-forwarded-for")){let U=Z.requestIP(K);if(U)K.headers.set("x-forwarded-for",U.address)}let X=await J(K,u);return E?D(K,X):X},idleTimeout:Number(process.env.SERVER_IDLE_TIMEOUT??10),port:process.env.PORT||5173});return F({port:V.port,rootDir:C}),V}export{AJ as httpProd};
2
+ import{h as I,i as g}from"./chunk-s7mcrmas.js";import"./chunk-ppt296ye.js";import{K as P,M as _}from"./chunk-twg652g2.js";import"./chunk-x5f4e2fp.js";import"./chunk-p5r0t9jh.js";import"./chunk-4z53shav.js";import"./chunk-m0earq80.js";import"./chunk-f18weffa.js";import{join as N}from"path";import{Duplex as q}from"stream";import{constants as b,createBrotliCompress as m,createGzip as h}from"zlib";var c=["br","gzip"],l=1024,o=5,d=19,p=6;function n($){if($===void 0)return 1;if(!/^\d+(\.\d{0,3})?$/.test($.trim()))return 1;let J=Number($.trim());return Number.isFinite(J)?Math.min(J,1):1}function i($){if($===null||$===void 0)return null;let J=new Map;for(let H of $.split(",")){let[z,...G]=H.split(";"),j=z.trim().toLowerCase();if(j==="")continue;let Q=1;for(let Y of G){let k=Y.indexOf("=");if(k===-1)continue;if(Y.slice(0,k).trim().toLowerCase()==="q"){Q=n(Y.slice(k+1));break}}J.set(j,Q)}return J}function t($,J=c){let H=i($);if(!H)return null;let z=H.get("*"),G=null,j=0;for(let Q of J){let Y=H.get(Q)??z??0;if(Y>j)G=Q,j=Y}return G}function a($,J){if(!$)return!1;return $.split(",").some((H)=>H.trim().toLowerCase().split("=")[0].trim()===J)}function s($,J){if($==="HEAD")return!1;if(!J.body)return!1;if(J.status<200||J.status===204||J.status===206||J.status===304)return!1;if(J.headers.has("Content-Range"))return!1;let H=J.headers.get("Content-Type");if(!H||!/^\s*text\/html\s*(;|$)/i.test(H))return!1;let z=J.headers.get("Content-Encoding");if(z&&z.trim().toLowerCase()!=="identity")return!1;if(a(J.headers.get("Cache-Control"),"no-transform"))return!1;let G=J.headers.get("Content-Length");if(G!==null&&Number(G)<l)return!1;return!0}function r($){let J=$==="br"?m({params:{[b.BROTLI_PARAM_QUALITY]:o,[b.BROTLI_PARAM_LGWIN]:d},flush:b.BROTLI_OPERATION_FLUSH}):h({level:p,flush:b.Z_SYNC_FLUSH});return q.toWeb(J)}function e($){let J=$.get("Vary");if(!J){$.set("Vary","Accept-Encoding");return}let H=J.split(",").map((z)=>z.trim().toLowerCase());if(H.includes("*")||H.includes("accept-encoding"))return;$.append("Vary","Accept-Encoding")}function D($,J){if(!s($.method,J))return J;let H=new Headers(J.headers);e(H);let z=t($.headers.get("Accept-Encoding"));if(!z)return new Response(J.body,{status:J.status,statusText:J.statusText,headers:H});let G;try{G=r(z)}catch{return new Response(J.body,{status:J.status,statusText:J.statusText,headers:H})}return H.set("Content-Encoding",z),H.delete("Content-Length"),new Response(J.body.pipeThrough(G),{status:J.status,statusText:J.statusText,headers:H})}function R($){let J=$.toString(),H=new Bun.CryptoHasher("sha1");return H.update(J),H.digest("hex")}if(!globalThis.URLPattern)globalThis.URLPattern=P;import{exists as JJ}from"fs/promises";var $J=process.env.GEMI_PROJECT_DIR??"",T=N(process.cwd(),$J),HJ=N(T,"app"),A=N(T,"dist");async function AJ($,J){let H=await import(`${A}/client/.vite/manifest.json`),z=await import(`${A}/server/.vite/manifest.json`);process.env.ROOT_DIR=T,process.env.APP_DIR=HJ,process.env.DIST_DIR=A;let G={},j={},Q={},Y={},k=(K,Z)=>`"${K}": () => import("${Z}")`,S=[];for(let K of["404",...$.getFlatComponentTree.call($)]){let Z=z[`app/views/${K}.tsx`];if(!Z?.file){console.log(`Server file not found for ${K}`),console.log(Z);let W=Object.keys(z),L=`app/views/${K}.tsx`;console.log(`${L} not found in server manifest`),console.log(W)}let X=await import(`${process.env.DIST_DIR}/server/${Z?.file}`);G[K]=X.default,j[K]=X.OpenGraph,Q[K]=X;let U=H[`app/views/${K}.tsx`];if(U?.css&&U?.css.length>0)Y[K]=U?.css;if(U)S.push(k(K,`/${U?.file}`))}let F=`{${S.join(",")}}`,w=H["app/client.tsx"]?.css??[],f=await Promise.all(w.map(async(K)=>({id:K,content:await Bun.file(`${A}/client/${K}`).text()}))),v=new P({pathname:"/*.:filetype(png|txt|js|css|jpg|svg|jpeg|avif|webp|ico|ttf|map)"});async function u(K){let{pathname:Z}=new URL(K.url),X=Z.startsWith("/.well-known"),U=v.test({pathname:Z})||X,W=Z.startsWith("/api");if(U&&!W){let L=new URL(K.url),B=K.url.replace(L.origin,"").split("?")[0],O=`${A}/client${B.replace("/assets/assets","/assets")}`,C=await JJ(O);if(!C&&L.pathname.includes(".js"))return new Response(`if(caches){caches?.delete("${O}")}window.location.reload();export {}`,{headers:{"Content-Type":"application/javascript"}});if(!C){if(Z===_||Z.startsWith(`${_}/`))return new Response("Not found",{status:404});return await M(K,Z)}try{let x=Bun.file(O),y=R(x.lastModified);return new Response(x.stream(),{headers:{"Content-Type":x.type,"Cache-Control":"public, max-age=31536000, must-revalidate","Content-Length":String(x.size),ETag:y}})}catch(x){return $.onException?.(x),new Response("Not found",{status:404})}}return await M(K,Z)}async function M(K,Z){let X=$.fetch.bind($);try{let U=await X(K);if(U instanceof Response)return U;else{let W=[...f];return await U({getStyles:async(B)=>{if(!B)return I([]);for(let O of B){let C=H[`app/views/${O}.tsx`];for(let x of C?.css??[]){let y=Bun.file(`${process.env.DIST_DIR}/client/${x}`);W.push({id:x,content:await y.text()})}}return I(W)},bootstrapModules:[`/${H["app/client.tsx"].file}`],loaders:F,viewImportMap:G,viewModules:Q,ogMap:j,cssManifest:Y})}}catch(U){if(console.error(U),Z.startsWith("/api"))return new Response(JSON.stringify({error:U.message}),{status:500,headers:{"Content-Type":"application/json"}});return $.onException?.(U),new Response(U.stack,{status:500})}}let E=(process.env.GEMI_COMPRESSION??"auto").toLowerCase()!=="off",V=Bun.serve({maxRequestBodySize:10737418240,fetch:async(K,Z)=>{if(!K.headers.get("x-forwarded-for")){let U=Z.requestIP(K);if(U)K.headers.set("x-forwarded-for",U.address)}let X=await J(K,u);return E?D(K,X):X},idleTimeout:Number(process.env.SERVER_IDLE_TIMEOUT??10),port:process.env.PORT||5173});return g({port:V.port,rootDir:T}),V}export{AJ as httpProd};
4
3
 
5
- //# debugId=EDBA787B1460B4B764756E2164756E21
4
+ //# debugId=398BEA458536170764756E2164756E21
@@ -2,12 +2,12 @@
2
2
  "version": 3,
3
3
  "sources": ["../server/httpProd.ts", "../server/compression.ts", "../server/generateEtag.ts", "../../../node_modules/.bun/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/index.js"],
4
4
  "sourcesContent": [
5
- "import { join } from \"node:path\";\nimport { compressResponse } from \"./compression\";\nimport { generateETag } from \"./generateEtag\";\nimport { URLPattern } from \"urlpattern-polyfill\";\nimport { exists } from \"node:fs/promises\";\nimport { createStyles } from \"./styles\";\nimport type { App } from \"../app\";\nimport { Instrumentation } from \"./types\";\nimport { printStartupBanner } from \"./banner\";\nimport { RESERVED_ROUTE_PREFIX } from \"../services/router/ViewRouterServiceContainer\";\n\nconst projectDir = process.env.GEMI_PROJECT_DIR ?? \"\";\nconst rootDir = join(process.cwd(), projectDir);\n\nconst appDir = join(rootDir, \"app\");\nconst distDir = join(rootDir, \"dist\");\n\n// `app` is built by `Server.start` (from the kernel) and passed in — same as\n// `httpDev` — so prod and dev share one construction path. What differs here is\n// that views/styles are served from the built `dist/` manifests instead of\n// Vite's dev SSR graph.\nexport async function httpProd(app: App, instrumentation: Instrumentation) {\n const manifest = await import(`${distDir}/client/.vite/manifest.json`);\n const serverManifest = await import(`${distDir}/server/.vite/manifest.json`);\n\n process.env.ROOT_DIR = rootDir;\n process.env.APP_DIR = appDir;\n process.env.DIST_DIR = distDir;\n\n const viewImportMap = {};\n const ogMap = {};\n const viewModules = {};\n const cssManifest = {};\n const template = (viewName: string, path: string) => `\"${viewName}\": () => import(\"${path}\")`;\n const templates = [];\n\n for (const fileName of [\"404\", ...app.getFlatComponentTree.call(app)]) {\n const serverFile = serverManifest[`app/views/${fileName}.tsx`];\n if (!serverFile?.file) {\n console.log(`Server file not found for ${fileName}`);\n console.log(serverFile);\n const files = Object.keys(serverManifest);\n const path = `app/views/${fileName}.tsx`;\n console.log(`${path} not found in server manifest`);\n console.log(files);\n }\n const mod = await import(`${process.env.DIST_DIR}/server/${serverFile?.file}`);\n viewImportMap[fileName] = mod.default;\n ogMap[fileName] = mod.OpenGraph;\n // The whole module, so a streaming render can put the view's\n // `Loading`/`Error` exports into the shell it sends.\n viewModules[fileName] = mod;\n const clientFile = manifest[`app/views/${fileName}.tsx`];\n\n if (clientFile?.css && clientFile?.css.length > 0) {\n cssManifest[fileName] = clientFile?.css;\n }\n if (clientFile) {\n templates.push(template(fileName, `/${clientFile?.file}`));\n }\n }\n\n const loaders = `{${templates.join(\",\")}}`;\n\n // Vite's manifest `css` field is a `string[]` — a client entry can emit more\n // than one CSS chunk. Read and concatenate them all instead of interpolating\n // the array into a single path (which only works for a one-element array).\n const appCssFiles: string[] = manifest[\"app/client.tsx\"]?.css ?? [];\n const appCSSContent = (\n await Promise.all(appCssFiles.map((cssFile) => Bun.file(`${distDir}/client/${cssFile}`).text()))\n ).join(\"\\n\");\n\n const staticFilePattern = new URLPattern({\n pathname: \"/*.:filetype(png|txt|js|css|jpg|svg|jpeg|avif|webp|ico|ttf|map)\",\n });\n\n async function requestHandler(req: Request) {\n const { pathname } = new URL(req.url);\n\n const isWellKnownFile = pathname.startsWith(\"/.well-known\");\n const isFileRequest = staticFilePattern.test({ pathname }) || isWellKnownFile;\n\n const isApi = pathname.startsWith(\"/api\");\n\n if (isFileRequest && !isApi) {\n const url = new URL(req.url);\n const filePath = req.url.replace(url.origin, \"\").split(\"?\")[0];\n const distPath = `${distDir}/client${filePath.replace(\"/assets/assets\", \"/assets\")}`;\n const doesExist = await exists(distPath);\n\n if (!doesExist && url.pathname.includes(\".js\")) {\n return new Response(\n `if(caches){caches?.delete(\"${distPath}\")}window.location.reload();export {}`,\n {\n headers: { \"Content-Type\": \"application/javascript\" },\n },\n );\n }\n\n if (!doesExist) {\n // `/assets` is reserved for build output (the router rejects routes\n // there at boot), so a miss is a miss — 404 without paying for an SSR\n // render.\n if (\n pathname === RESERVED_ROUTE_PREFIX ||\n pathname.startsWith(`${RESERVED_ROUTE_PREFIX}/`)\n ) {\n return new Response(\"Not found\", { status: 404 });\n }\n\n // Anywhere else the pattern above matched on extension alone, so this\n // may well be an app route — a file route like\n // `this.file(() => Bun.file(...))` mounted at `/files/logo.svg` lands\n // here too. Hand it to the app rather than 404ing on its behalf.\n return await handleWithApp(req, pathname);\n }\n\n // `Bun.file(path).stream()` is lazy — a missing file only throws ENOENT\n // once the body is streamed, which is *after* this handler has returned,\n // so the `try/catch` below can't catch it (it surfaces as an unhandled\n // rejection with the response already committed as 200). Never build the\n // streaming Response without checking existence first.\n\n try {\n const file = Bun.file(distPath);\n\n const etag = generateETag(file.lastModified);\n return new Response(file.stream(), {\n headers: {\n \"Content-Type\": file.type,\n \"Cache-Control\": \"public, max-age=31536000, must-revalidate\",\n \"Content-Length\": String(file.size),\n ETag: etag,\n },\n });\n } catch (error) {\n app.onException?.(error);\n return new Response(\"Not found\", { status: 404 });\n }\n }\n\n return await handleWithApp(req, pathname);\n }\n\n async function handleWithApp(req: Request, pathname: string) {\n const handler = app.fetch.bind(app);\n\n try {\n const result = await handler(req);\n if (result instanceof Response) {\n return result;\n } else {\n const styles = [];\n\n styles.push({\n content: appCSSContent,\n });\n\n const getStyles = async (currentViews: string[]) => {\n if (!currentViews) {\n return createStyles([]);\n }\n for (const view of currentViews) {\n const clientFile = manifest[`app/views/${view}.tsx`];\n for (const cssFile of clientFile?.css ?? []) {\n const css = Bun.file(`${process.env.DIST_DIR}/client/${cssFile}`);\n styles.push({\n id: cssFile,\n content: await css.text(),\n });\n }\n }\n return createStyles(styles);\n };\n\n return await result({\n getStyles,\n bootstrapModules: [`/${manifest[\"app/client.tsx\"].file}`],\n loaders,\n viewImportMap,\n viewModules,\n ogMap,\n cssManifest,\n });\n }\n } catch (err) {\n console.error(err);\n if (pathname.startsWith(\"/api\")) {\n return new Response(JSON.stringify({ error: err.message }), {\n status: 500,\n headers: { \"Content-Type\": \"application/json\" },\n });\n }\n app.onException?.(err);\n return new Response(err.stack, { status: 500 });\n }\n }\n\n // Compression is on unless the deployment opts out — set `GEMI_COMPRESSION=off`\n // when a layer in front of the origin already compresses HTML and you would\n // rather not spend origin CPU on it.\n const compressionEnabled = (process.env.GEMI_COMPRESSION ?? \"auto\").toLowerCase() !== \"off\";\n\n const server = Bun.serve({\n maxRequestBodySize: 10 * 1024 * 1024 * 1024, // 10 GB\n fetch: async (req, server) => {\n if (!req.headers.get(\"x-forwarded-for\")) {\n // `requestIP` is null for closed/unix sockets — guard so it never\n // throws before the request is handled.\n const ip = server.requestIP(req);\n if (ip) req.headers.set(\"x-forwarded-for\", ip.address);\n }\n const res = await instrumentation(req, requestHandler);\n // Applied at the very edge, after instrumentation, so every HTML response\n // goes through the same negotiation — including the ones an app's\n // instrumentation produced itself. Anything that isn't HTML comes back\n // untouched.\n return compressionEnabled ? compressResponse(req, res) : res;\n },\n idleTimeout: Number(process.env.SERVER_IDLE_TIMEOUT ?? 10),\n port: process.env.PORT || 5173,\n });\n\n printStartupBanner({ port: server.port, rootDir });\n\n return server;\n}\n",
5
+ "import { join } from \"node:path\";\nimport { compressResponse } from \"./compression\";\nimport { generateETag } from \"./generateEtag\";\nimport { URLPattern } from \"urlpattern-polyfill\";\nimport { exists } from \"node:fs/promises\";\nimport { createStyles } from \"./styles\";\nimport type { App } from \"../app\";\nimport { Instrumentation } from \"./types\";\nimport { printStartupBanner } from \"./banner\";\nimport { RESERVED_ROUTE_PREFIX } from \"../services/router/ViewRouterServiceContainer\";\n\nconst projectDir = process.env.GEMI_PROJECT_DIR ?? \"\";\nconst rootDir = join(process.cwd(), projectDir);\n\nconst appDir = join(rootDir, \"app\");\nconst distDir = join(rootDir, \"dist\");\n\n// `app` is built by `Server.start` (from the kernel) and passed in — same as\n// `httpDev` — so prod and dev share one construction path. What differs here is\n// that views/styles are served from the built `dist/` manifests instead of\n// Vite's dev SSR graph.\nexport async function httpProd(app: App, instrumentation: Instrumentation) {\n const manifest = await import(`${distDir}/client/.vite/manifest.json`);\n const serverManifest = await import(`${distDir}/server/.vite/manifest.json`);\n\n process.env.ROOT_DIR = rootDir;\n process.env.APP_DIR = appDir;\n process.env.DIST_DIR = distDir;\n\n const viewImportMap = {};\n const ogMap = {};\n const viewModules = {};\n const cssManifest = {};\n const template = (viewName: string, path: string) => `\"${viewName}\": () => import(\"${path}\")`;\n const templates = [];\n\n for (const fileName of [\"404\", ...app.getFlatComponentTree.call(app)]) {\n const serverFile = serverManifest[`app/views/${fileName}.tsx`];\n if (!serverFile?.file) {\n console.log(`Server file not found for ${fileName}`);\n console.log(serverFile);\n const files = Object.keys(serverManifest);\n const path = `app/views/${fileName}.tsx`;\n console.log(`${path} not found in server manifest`);\n console.log(files);\n }\n const mod = await import(`${process.env.DIST_DIR}/server/${serverFile?.file}`);\n viewImportMap[fileName] = mod.default;\n ogMap[fileName] = mod.OpenGraph;\n // The whole module, so a streaming render can put the view's\n // `Loading`/`Error` exports into the shell it sends.\n viewModules[fileName] = mod;\n const clientFile = manifest[`app/views/${fileName}.tsx`];\n\n if (clientFile?.css && clientFile?.css.length > 0) {\n cssManifest[fileName] = clientFile?.css;\n }\n if (clientFile) {\n templates.push(template(fileName, `/${clientFile?.file}`));\n }\n }\n\n const loaders = `{${templates.join(\",\")}}`;\n\n // Vite's manifest `css` field is a `string[]` — a client entry can emit more\n // than one CSS chunk. Read them all instead of interpolating the array into a\n // single path (which only works for a one-element array), and keep them as\n // one entry per file rather than a concatenated blob: each needs its own\n // stable id for React to hoist it into `<head>` (#328), and that id is what\n // dedupes it against a route's own CSS.\n const appCssFiles: string[] = manifest[\"app/client.tsx\"]?.css ?? [];\n const appStyles = await Promise.all(\n appCssFiles.map(async (cssFile) => ({\n id: cssFile,\n content: await Bun.file(`${distDir}/client/${cssFile}`).text(),\n })),\n );\n\n const staticFilePattern = new URLPattern({\n pathname: \"/*.:filetype(png|txt|js|css|jpg|svg|jpeg|avif|webp|ico|ttf|map)\",\n });\n\n async function requestHandler(req: Request) {\n const { pathname } = new URL(req.url);\n\n const isWellKnownFile = pathname.startsWith(\"/.well-known\");\n const isFileRequest = staticFilePattern.test({ pathname }) || isWellKnownFile;\n\n const isApi = pathname.startsWith(\"/api\");\n\n if (isFileRequest && !isApi) {\n const url = new URL(req.url);\n const filePath = req.url.replace(url.origin, \"\").split(\"?\")[0];\n const distPath = `${distDir}/client${filePath.replace(\"/assets/assets\", \"/assets\")}`;\n const doesExist = await exists(distPath);\n\n if (!doesExist && url.pathname.includes(\".js\")) {\n return new Response(\n `if(caches){caches?.delete(\"${distPath}\")}window.location.reload();export {}`,\n {\n headers: { \"Content-Type\": \"application/javascript\" },\n },\n );\n }\n\n if (!doesExist) {\n // `/assets` is reserved for build output (the router rejects routes\n // there at boot), so a miss is a miss — 404 without paying for an SSR\n // render.\n if (\n pathname === RESERVED_ROUTE_PREFIX ||\n pathname.startsWith(`${RESERVED_ROUTE_PREFIX}/`)\n ) {\n return new Response(\"Not found\", { status: 404 });\n }\n\n // Anywhere else the pattern above matched on extension alone, so this\n // may well be an app route — a file route like\n // `this.file(() => Bun.file(...))` mounted at `/files/logo.svg` lands\n // here too. Hand it to the app rather than 404ing on its behalf.\n return await handleWithApp(req, pathname);\n }\n\n // `Bun.file(path).stream()` is lazy — a missing file only throws ENOENT\n // once the body is streamed, which is *after* this handler has returned,\n // so the `try/catch` below can't catch it (it surfaces as an unhandled\n // rejection with the response already committed as 200). Never build the\n // streaming Response without checking existence first.\n\n try {\n const file = Bun.file(distPath);\n\n const etag = generateETag(file.lastModified);\n return new Response(file.stream(), {\n headers: {\n \"Content-Type\": file.type,\n \"Cache-Control\": \"public, max-age=31536000, must-revalidate\",\n \"Content-Length\": String(file.size),\n ETag: etag,\n },\n });\n } catch (error) {\n app.onException?.(error);\n return new Response(\"Not found\", { status: 404 });\n }\n }\n\n return await handleWithApp(req, pathname);\n }\n\n async function handleWithApp(req: Request, pathname: string) {\n const handler = app.fetch.bind(app);\n\n try {\n const result = await handler(req);\n if (result instanceof Response) {\n return result;\n } else {\n const styles = [...appStyles];\n\n const getStyles = async (currentViews: string[]) => {\n if (!currentViews) {\n return createStyles([]);\n }\n for (const view of currentViews) {\n const clientFile = manifest[`app/views/${view}.tsx`];\n for (const cssFile of clientFile?.css ?? []) {\n const css = Bun.file(`${process.env.DIST_DIR}/client/${cssFile}`);\n styles.push({\n id: cssFile,\n content: await css.text(),\n });\n }\n }\n return createStyles(styles);\n };\n\n return await result({\n getStyles,\n bootstrapModules: [`/${manifest[\"app/client.tsx\"].file}`],\n loaders,\n viewImportMap,\n viewModules,\n ogMap,\n cssManifest,\n });\n }\n } catch (err) {\n console.error(err);\n if (pathname.startsWith(\"/api\")) {\n return new Response(JSON.stringify({ error: err.message }), {\n status: 500,\n headers: { \"Content-Type\": \"application/json\" },\n });\n }\n app.onException?.(err);\n return new Response(err.stack, { status: 500 });\n }\n }\n\n // Compression is on unless the deployment opts out — set `GEMI_COMPRESSION=off`\n // when a layer in front of the origin already compresses HTML and you would\n // rather not spend origin CPU on it.\n const compressionEnabled = (process.env.GEMI_COMPRESSION ?? \"auto\").toLowerCase() !== \"off\";\n\n const server = Bun.serve({\n maxRequestBodySize: 10 * 1024 * 1024 * 1024, // 10 GB\n fetch: async (req, server) => {\n if (!req.headers.get(\"x-forwarded-for\")) {\n // `requestIP` is null for closed/unix sockets — guard so it never\n // throws before the request is handled.\n const ip = server.requestIP(req);\n if (ip) req.headers.set(\"x-forwarded-for\", ip.address);\n }\n const res = await instrumentation(req, requestHandler);\n // Applied at the very edge, after instrumentation, so every HTML response\n // goes through the same negotiation — including the ones an app's\n // instrumentation produced itself. Anything that isn't HTML comes back\n // untouched.\n return compressionEnabled ? compressResponse(req, res) : res;\n },\n idleTimeout: Number(process.env.SERVER_IDLE_TIMEOUT ?? 10),\n port: process.env.PORT || 5173,\n });\n\n printStartupBanner({ port: server.port, rootDir });\n\n return server;\n}\n",
6
6
  "/**\n * Transport-level compression for SSR HTML responses.\n *\n * This lives in the runtime rather than in an app, because every gemi app\n * serves the same shape of response: a streamed `text/html` document whose\n * bulk is critical CSS, markup and the `window.__GEMI_DATA__` hydration\n * payload. Compressing it here means the win is portable across deployments —\n * it does not depend on a CDN being configured to compress on the origin's\n * behalf — and it also cuts origin→edge bandwidth, which edge compression\n * cannot.\n *\n * Compression stays strictly at the transport layer: what the client decodes\n * is byte-for-byte the HTML React rendered, so hydration is unaffected.\n *\n * Deliberately dependency-free apart from `node:zlib`/`node:stream` so it can\n * be unit tested without booting a server.\n */\n\nimport { Duplex } from \"node:stream\";\nimport { constants, createBrotliCompress, createGzip } from \"node:zlib\";\n\n/** The content codings we can produce, in the order we prefer them. */\nexport type ContentEncoding = \"br\" | \"gzip\";\n\n/**\n * Server preference, used to break q-value ties. Brotli comes first: at the\n * quality we use it is both smaller *and* no more expensive than gzip on a\n * representative SSR document (~177 kB → 28.0 kB in ~2.0 ms, versus 31.6 kB in\n * ~2.0 ms for gzip).\n */\nconst SERVER_PREFERENCE: ContentEncoding[] = [\"br\", \"gzip\"];\n\n/**\n * Below this, an encoded body plus its framing overhead is not worth the CPU.\n * Only applied when the response declares a `Content-Length` — a streamed SSR\n * response does not, and buffering one just to measure it would defeat the\n * streaming render.\n */\nconst MIN_COMPRESSIBLE_BYTES = 1024;\n\n/**\n * Brotli quality 5 (of 11). The default, 11, is meant for static assets\n * compressed once at build time — on a streamed document it costs ~175 ms,\n * two orders of magnitude more than quality 5 for ~12% more savings. Quality 5\n * is the usual choice for dynamic content.\n *\n * `LGWIN` 19 caps the window at 512 kB rather than the default 16 MB. An SSR\n * document is far smaller than that, so the ratio is unchanged, and the bound\n * matters under concurrency: the window is allocated per in-flight response.\n */\nconst BROTLI_QUALITY = 5;\nconst BROTLI_WINDOW_BITS = 19;\n\n/** zlib's default level. Level 9 costs measurably more for ~1% on HTML. */\nconst GZIP_LEVEL = 6;\n\nfunction parseQValue(raw: string | undefined): number {\n if (raw === undefined) {\n return 1;\n }\n // `q` is a fixed-point number with at most three decimals (RFC 9110 §12.4.2).\n // Anything else is malformed; treat it as an unqualified \"acceptable\" rather\n // than dropping the encoding, matching what tolerant servers do.\n if (!/^\\d+(\\.\\d{0,3})?$/.test(raw.trim())) {\n return 1;\n }\n const value = Number(raw.trim());\n return Number.isFinite(value) ? Math.min(value, 1) : 1;\n}\n\n/**\n * Parses a request `Accept-Encoding` into `coding -> qvalue`.\n *\n * Returns `null` when the header is *absent*, which is distinct from an empty\n * one. RFC 9110 §12.5.3 says an absent header means any coding is acceptable,\n * but a client that cannot decode and forgets to say so is a broken page, not\n * a slow one — so we treat \"absent\" as \"identity\" and only encode when a\n * client has explicitly opted in. An empty header (`Accept-Encoding:`) is a\n * deliberate \"identity only\" and parses to an empty map.\n */\nexport function parseAcceptEncoding(header: string | null | undefined): Map<string, number> | null {\n if (header === null || header === undefined) {\n return null;\n }\n\n const accepted = new Map<string, number>();\n for (const part of header.split(\",\")) {\n const [rawCoding, ...params] = part.split(\";\");\n const coding = rawCoding.trim().toLowerCase();\n if (coding === \"\") {\n continue;\n }\n\n let q = 1;\n for (const param of params) {\n const separator = param.indexOf(\"=\");\n if (separator === -1) {\n continue;\n }\n if (param.slice(0, separator).trim().toLowerCase() === \"q\") {\n q = parseQValue(param.slice(separator + 1));\n break;\n }\n }\n\n accepted.set(coding, q);\n }\n\n return accepted;\n}\n\n/**\n * Picks the coding to use, or `null` for identity.\n *\n * A `q=0` is a refusal, `*` covers codings the client did not name, and ties\n * fall back to `available`'s order — so a plain `Accept-Encoding: gzip, br`\n * (equal q of 1) resolves to our preference rather than the client's.\n */\nexport function negotiateEncoding(\n header: string | null | undefined,\n available: ContentEncoding[] = SERVER_PREFERENCE,\n): ContentEncoding | null {\n const accepted = parseAcceptEncoding(header);\n if (!accepted) {\n return null;\n }\n\n const wildcard = accepted.get(\"*\");\n let best: ContentEncoding | null = null;\n let bestQ = 0;\n\n for (const coding of available) {\n const q = accepted.get(coding) ?? wildcard ?? 0;\n if (q > bestQ) {\n best = coding;\n bestQ = q;\n }\n }\n\n return best;\n}\n\nfunction hasDirective(headerValue: string | null, directive: string): boolean {\n if (!headerValue) {\n return false;\n }\n // Token match, not substring: `no-transform` must not be found inside\n // something like `x-no-transform`.\n return headerValue\n .split(\",\")\n .some((token) => token.trim().toLowerCase().split(\"=\")[0].trim() === directive);\n}\n\n/**\n * Whether this response's representation is one we may encode — and therefore\n * one that varies by `Accept-Encoding`, even on the requests where we end up\n * sending identity.\n *\n * HTML only, on purpose. JSON view-data and API responses are left alone so\n * that this change cannot alter how they are produced, framed or cached;\n * widening the set is a separate decision.\n */\nexport function isCompressible(method: string, res: Response): boolean {\n // A HEAD response carries no body to encode, and emitting `Content-Encoding`\n // without one would describe a body the client never receives.\n if (method === \"HEAD\") {\n return false;\n }\n\n if (!res.body) {\n return false;\n }\n\n // 204/304 are bodyless; 206 is a byte range of an already-committed\n // representation and re-encoding it would invalidate its `Content-Range`.\n if (res.status < 200 || res.status === 204 || res.status === 206 || res.status === 304) {\n return false;\n }\n\n if (res.headers.has(\"Content-Range\")) {\n return false;\n }\n\n const contentType = res.headers.get(\"Content-Type\");\n if (!contentType || !/^\\s*text\\/html\\s*(;|$)/i.test(contentType)) {\n return false;\n }\n\n // Already encoded upstream — `identity` is the one value that means \"not\n // encoded\" and is safe to replace.\n const contentEncoding = res.headers.get(\"Content-Encoding\");\n if (contentEncoding && contentEncoding.trim().toLowerCase() !== \"identity\") {\n return false;\n }\n\n // RFC 9110 §5.2.2.6: `no-transform` forbids intermediaries *and* us from\n // changing the representation's encoding.\n if (hasDirective(res.headers.get(\"Cache-Control\"), \"no-transform\")) {\n return false;\n }\n\n const contentLength = res.headers.get(\"Content-Length\");\n if (contentLength !== null && Number(contentLength) < MIN_COMPRESSIBLE_BYTES) {\n return false;\n }\n\n return true;\n}\n\n/**\n * Builds the encoder as a web `TransformStream`-shaped pair.\n *\n * Both codings are driven through `node:zlib` with an explicit per-write flush.\n * Without it the compressor holds output until its internal buffer fills,\n * which would sit on React's shell flush and turn a streamed render into a\n * buffered one — the compression win would be paid for in time to first byte.\n */\nexport function createEncoderStream(encoding: ContentEncoding) {\n const compressor =\n encoding === \"br\"\n ? createBrotliCompress({\n params: {\n [constants.BROTLI_PARAM_QUALITY]: BROTLI_QUALITY,\n [constants.BROTLI_PARAM_LGWIN]: BROTLI_WINDOW_BITS,\n },\n flush: constants.BROTLI_OPERATION_FLUSH,\n })\n : createGzip({ level: GZIP_LEVEL, flush: constants.Z_SYNC_FLUSH });\n\n return Duplex.toWeb(compressor) as unknown as ReadableWritablePair<Uint8Array, Uint8Array>;\n}\n\nfunction withVaryAcceptEncoding(headers: Headers) {\n const vary = headers.get(\"Vary\");\n if (!vary) {\n headers.set(\"Vary\", \"Accept-Encoding\");\n return;\n }\n const tokens = vary.split(\",\").map((token) => token.trim().toLowerCase());\n // `Vary: *` already means \"never reuse for another request\"; narrowing it\n // would be a downgrade.\n if (tokens.includes(\"*\") || tokens.includes(\"accept-encoding\")) {\n return;\n }\n headers.append(\"Vary\", \"Accept-Encoding\");\n}\n\n/**\n * Compresses an SSR HTML response when the client asked for it.\n *\n * Non-HTML responses are returned untouched — same object, same body, so this\n * is safe to apply at the edge of the server for every request.\n *\n * HTML responses always gain `Vary: Accept-Encoding`, whether or not this\n * particular request got an encoded body: without it a shared cache could\n * serve a stored encoded variant to a client that cannot decode it.\n */\nexport function compressResponse(req: Request, res: Response): Response {\n if (!isCompressible(req.method, res)) {\n return res;\n }\n\n const headers = new Headers(res.headers);\n withVaryAcceptEncoding(headers);\n\n const encoding = negotiateEncoding(req.headers.get(\"Accept-Encoding\"));\n if (!encoding) {\n return new Response(res.body, {\n status: res.status,\n statusText: res.statusText,\n headers,\n });\n }\n\n let encoder: ReadableWritablePair<Uint8Array, Uint8Array>;\n try {\n encoder = createEncoderStream(encoding);\n } catch {\n // A compressor we cannot construct is not worth failing a page render\n // over. Serve identity — with the `Vary` we already added.\n return new Response(res.body, {\n status: res.status,\n statusText: res.statusText,\n headers,\n });\n }\n\n headers.set(\"Content-Encoding\", encoding);\n // The length of the identity representation says nothing about the encoded\n // body, and a stale one would truncate the response.\n headers.delete(\"Content-Length\");\n\n return new Response(res.body!.pipeThrough(encoder), {\n status: res.status,\n statusText: res.statusText,\n headers,\n });\n}\n",
7
7
  "export function generateETag(lastModified: number): string {\n // Assuming the last modified timestamp is in milliseconds\n const lastModifiedStr = lastModified.toString();\n\n const hasher = new Bun.CryptoHasher(\"sha1\");\n hasher.update(lastModifiedStr);\n const hash = hasher.digest(\"hex\");\n\n return hash;\n}\n",
8
8
  "import { URLPattern } from \"./dist/urlpattern.js\";\n\nexport { URLPattern };\n\nif (!globalThis.URLPattern) {\n globalThis.URLPattern = URLPattern;\n}\n"
9
9
  ],
10
- "mappings": ";gTAAA,SAAS,OCkBT,WAAS,SACT,cAAS,oBAAW,UAAsB,aAW1C,IAAM,EAAuC,CAAC,KAAM,MAAM,EAQpD,EAAyB,KAYzB,EAAiB,EACjB,EAAqB,GAGrB,EAAa,EAEnB,SAAS,CAAW,CAAC,EAAiC,CACpD,GAAI,IAAQ,OACV,MAAO,GAKT,GAAI,CAAC,oBAAoB,KAAK,EAAI,KAAK,CAAC,EACtC,MAAO,GAET,IAAM,EAAQ,OAAO,EAAI,KAAK,CAAC,EAC/B,OAAO,OAAO,SAAS,CAAK,EAAI,KAAK,IAAI,EAAO,CAAC,EAAI,EAahD,SAAS,CAAmB,CAAC,EAA+D,CACjG,GAAI,IAAW,MAAQ,IAAW,OAChC,OAAO,KAGT,IAAM,EAAW,IAAI,IACrB,QAAW,KAAQ,EAAO,MAAM,GAAG,EAAG,CACpC,IAAO,KAAc,GAAU,EAAK,MAAM,GAAG,EACvC,EAAS,EAAU,KAAK,EAAE,YAAY,EAC5C,GAAI,IAAW,GACb,SAGF,IAAI,EAAI,EACR,QAAW,KAAS,EAAQ,CAC1B,IAAM,EAAY,EAAM,QAAQ,GAAG,EACnC,GAAI,IAAc,GAChB,SAEF,GAAI,EAAM,MAAM,EAAG,CAAS,EAAE,KAAK,EAAE,YAAY,IAAM,IAAK,CAC1D,EAAI,EAAY,EAAM,MAAM,EAAY,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B,YACpB,MAAO,MAAO,EAAK,IAAW,CAC5B,GAAI,CAAC,EAAI,QAAQ,IAAI,iBAAiB,EAAG,CAGvC,IAAM,EAAK,EAAO,UAAU,CAAG,EAC/B,GAAI,EAAI,EAAI,QAAQ,IAAI,kBAAmB,EAAG,OAAO,EAEvD,IAAM,EAAM,MAAM,EAAgB,EAAK,CAAc,EAKrD,OAAO,EAAqB,EAAiB,EAAK,CAAG,EAAI,GAE3D,YAAa,OAAO,QAAQ,IAAI,qBAAuB,EAAE,EACzD,KAAM,QAAQ,IAAI,MAAQ,IAC5B,CAAC,EAID,OAFA,EAAmB,CAAE,KAAM,EAAO,KAAM,SAAQ,CAAC,EAE1C",
11
+ "debugId": "398BEA458536170764756E2164756E21",
12
12
  "names": []
13
13
  }
@@ -0,0 +1,6 @@
1
+ // @bun
2
+ import{m as G}from"./chunk-ppt296ye.js";import{createElement as J}from"react";function Q(i,u){let s=Object.keys(u).sort((p,x)=>x.length-p.length).map((p)=>p.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),c=new RegExp(s.join("|"),"g");return i.replace(c,(p)=>u[p])}async function A(i,u,s=[]){let c=[...s.map((b)=>`${i}/views/${b}.tsx`),`${i}/views/RootLayout.tsx`],p=new Set;for(let b of c){let n=u.moduleGraph.getModulesByFile(b);if(n)for(let j of n)p.add(j)}let x=[],g=[],r={};for(let b of p)if(b)for(let n of b.importedModules){if(n.file.includes("module.css"))r[n.file]=n.ssrTransformResult.map.sourcesContent.join("");if(n.file.includes(".css"))g.push(n.file)}for(let b of g){let n=await u.transformRequest(b+"?direct"),j=b.includes("module.css"),q="";if(j)q=Q(r[b],n.default);x.push({isDev:!0,id:b,content:j?q:n.code})}return x.map(t)}async function F(i=[]){return i.map(t)}var X="gemi";function t(i,u){return J("style",{key:u,href:i.id,precedence:X,dangerouslySetInnerHTML:{__html:i.content}})}import{existsSync as _}from"fs";import{basename as $}from"path";import{networkInterfaces as v}from"os";var T={name:"gemi",version:"0.49.1",private:!1,license:"MIT",author:"Enes Tufekci <enes@gemijs.dev>",repository:{type:"git",url:"git+https://github.com/nstfkc/gemi.git",directory:"packages/gemi"},bin:{gemi:"./dist/bin/gemi.js"},files:["dist/**/*"],module:!0,exports:{"./http":"./http/index.ts","./client":"./client/index.ts","./app":"./app/index.ts","./facades":"./facades/index.ts","./email":"./email/index.ts","./vite":"./dist/vite/index.mjs","./runtime":"./client/runtime.ts","./kernel":"./kernel/index.ts","./services":"./services/index.ts","./broadcasting":"./broadcasting/index.ts","./i18n":"./i18n/index.ts","./server":"./server/index.ts","./config":"./config/index.ts","./bun/preload":"./bun/preload.ts","./bun/plugin":"./bun/plugin.ts"},scripts:{lint:"oxlint",build:"NODE_ENV=production bun run build:core && bun run build:bin && bun run build:types && bun run build:client && bun run build:plugin && bun run build:client-types","build:core":"bun ./scripts/build.ts","build:bin":"bun build --outdir=./dist/bin --target=bun --external=vite --external=react-dom --external=react/jsx-runtime --external=bun --external=sharp --external=@azure/storage-blob --sourcemap ./bin/gemi.ts && bun ./scripts/prepare-bin.ts","build:client":"vite build -c vite.client.config.mts","build:plugin":"vite build -c vite.plugin.config.mts","build:types":"tsc","build:client-types":"tsc -p tsconfig.browser.json",test:"vitest","test:types":"vitest run --typecheck.only","build:publish":"bun scripts/build-publish.ts",prepublishOnly:"echo 'Do not publish from this directory \u2014 its exports point at TS source. Run: bun run build:publish, then publish from .publish/' && exit 1"},dependencies:{"@aws-sdk/client-s3":"^3.629.0","@aws-sdk/s3-request-presigner":"^3.629.0","@prisma/client":"^6.4.1","ast-types":"^0.14.2",commander:"^12.1.0",history:"^5.3.0","jsx-email":"2.0.0-rc2.1",open:"^10.1.0","react-error-boundary":"^6.0.0",recast:"^0.23.9",resend:"^6.12.3",satori:"^0.12.2","temporal-polyfill":"^0.2.5","twitter-api-v2":"^1.20.2","urlpattern-polyfill":"^10.0.0",uuid:"^9.0.1"},devDependencies:{"@babel/parser":"^7.25.4","@repo/typescript-config":"*","@testing-library/react":"^16.3.2","@types/bun":"^1.3.14","@types/eslint":"^8.56.5","@types/node":"^20.11.24","@types/react":"^19.0.2","@types/react-dom":"^19.0.2",eslint:"^8.57.0",jsdom:"^30.0.1",oxlint:"^1.39.0",react:"19.2.3","react-dom":"19.2.3",typescript:"^5.7.3",vitest:"^4.0.0"},peerDependencies:{"@azure/storage-blob":"^12.28.0",react:">=19","react-dom":">=19",sharp:"^0.34.2",vite:"^8.0.0"},peerDependenciesMeta:{"@azure/storage-blob":{optional:!0}}};var y=[" \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2557\u2588\u2588\u2557","\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551","\u2588\u2588\u2551 \u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2554\u2588\u2588\u2588\u2588\u2554\u2588\u2588\u2551\u2588\u2588\u2551","\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2551\u255A\u2588\u2588\u2554\u255D\u2588\u2588\u2551\u2588\u2588\u2551","\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2551 \u255A\u2550\u255D \u2588\u2588\u2551\u2588\u2588\u2551"," \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u255D"],B=Boolean(process.stdout.isTTY)&&!process.env.NO_COLOR,l=(i,u)=>B?`\x1B[${i}m${u}\x1B[0m`:u,H=(i)=>l("1",i),z=(i)=>l("2",i),O=(i)=>l("36",i),K=(i)=>l("32",i),L=(i)=>l("35",i);function N(){return T.version??"?"}function U(i){for(let u of Object.values(v()))for(let s of u??[])if((s.family==="IPv4"||s.family===4)&&!s.internal)return`http://${s.address}:${i}`;return null}function W(i){return G(i).filter((u)=>_(u)).map((u)=>$(u))}function R(i){let{port:u,rootDir:s}=i,c=`http://localhost:${u}`,p=U(u),x=W(s),g=(b,n)=>` ${K("\u279C")} ${H(b.padEnd(9))}${n}`,r=["",...y.map((b)=>L(b)),"",` ${z("gemi")} ${O(`v${N()}`)}`,"",g("Local:",O(c)),g("Network:",p?O(p):z("unavailable")),g("Env:",x.length?x.join(", "):z("none")),""];console.log(r.join(`
3
+ `))}
4
+ export{A as g,F as h,R as i};
5
+
6
+ //# debugId=BFBD0AD2F1F74DB264756E2164756E21
@@ -2,10 +2,10 @@
2
2
  "version": 3,
3
3
  "sources": ["../server/styles.ts", "../server/banner.ts"],
4
4
  "sourcesContent": [
5
- "import { createElement } from \"react\";\nimport { type ModuleNode, type ViteDevServer } from \"vite\";\n\nfunction replaceStrings(text: string, record: Record<string, string>): string {\n const escapedKeys = Object.keys(record)\n .sort((a, b) => b.length - a.length)\n .map((key) => key.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\"));\n\n // Create a single regex with all keys\n const regex = new RegExp(escapedKeys.join(\"|\"), \"g\");\n\n return text.replace(regex, (match) => record[match]);\n}\n\nexport async function createDevStyles(\n appDir: string,\n vite: ViteDevServer,\n currentViews: string[] = [],\n) {\n const views = [\n ...currentViews.map((view) => `${appDir}/views/${view}.tsx`),\n `${appDir}/views/RootLayout.tsx`,\n ];\n\n const modules = new Set<ModuleNode>();\n for (const view of views) {\n const mod = vite.moduleGraph.getModulesByFile(view);\n if (mod) {\n for (const m of mod) modules.add(m);\n }\n }\n\n const styles = [];\n const cssModules = [];\n const cssModuleContent: Record<string, string> = {};\n for (const mod of modules as any) {\n if (mod) {\n for (const imported of mod.importedModules) {\n if (imported.file.includes(\"module.css\")) {\n cssModuleContent[imported.file] = imported.ssrTransformResult.map.sourcesContent.join(\"\");\n }\n if (imported.file.includes(\".css\")) {\n cssModules.push(imported.file);\n }\n }\n }\n }\n\n for (const cssModulePath of cssModules) {\n const transform = await vite.transformRequest(cssModulePath + \"?direct\");\n\n const isCssModule = cssModulePath.includes(\"module.css\");\n\n let transformedCssModule = \"\";\n\n if (isCssModule) {\n transformedCssModule = replaceStrings(\n cssModuleContent[cssModulePath],\n // Vite's `TransformResult` type has no `default`, but the CSS-module\n // transform attaches the class-name mapping there at runtime.\n (transform as unknown as { default: Record<string, string> }).default,\n );\n }\n\n styles.push({\n isDev: true,\n id: cssModulePath,\n content: isCssModule ? transformedCssModule : transform.code,\n });\n }\n\n return styles.map((style, i) => {\n return createElement(\"style\", {\n key: i,\n type: \"text/css\",\n \"data-vite-dev-id\": style.id,\n dangerouslySetInnerHTML: { __html: style.content },\n });\n });\n}\n\nexport async function createStyles(styles = []) {\n return styles.map((style, i) => {\n return createElement(\"style\", {\n key: i,\n id: style?.id,\n type: \"text/css\",\n dangerouslySetInnerHTML: { __html: style.content },\n });\n });\n}\n",
5
+ "import { createElement } from \"react\";\nimport { type ModuleNode, type ViteDevServer } from \"vite\";\n\nfunction replaceStrings(text: string, record: Record<string, string>): string {\n const escapedKeys = Object.keys(record)\n .sort((a, b) => b.length - a.length)\n .map((key) => key.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\"));\n\n // Create a single regex with all keys\n const regex = new RegExp(escapedKeys.join(\"|\"), \"g\");\n\n return text.replace(regex, (match) => record[match]);\n}\n\nexport async function createDevStyles(\n appDir: string,\n vite: ViteDevServer,\n currentViews: string[] = [],\n) {\n const views = [\n ...currentViews.map((view) => `${appDir}/views/${view}.tsx`),\n `${appDir}/views/RootLayout.tsx`,\n ];\n\n const modules = new Set<ModuleNode>();\n for (const view of views) {\n const mod = vite.moduleGraph.getModulesByFile(view);\n if (mod) {\n for (const m of mod) modules.add(m);\n }\n }\n\n const styles = [];\n const cssModules = [];\n const cssModuleContent: Record<string, string> = {};\n for (const mod of modules as any) {\n if (mod) {\n for (const imported of mod.importedModules) {\n if (imported.file.includes(\"module.css\")) {\n cssModuleContent[imported.file] = imported.ssrTransformResult.map.sourcesContent.join(\"\");\n }\n if (imported.file.includes(\".css\")) {\n cssModules.push(imported.file);\n }\n }\n }\n }\n\n for (const cssModulePath of cssModules) {\n const transform = await vite.transformRequest(cssModulePath + \"?direct\");\n\n const isCssModule = cssModulePath.includes(\"module.css\");\n\n let transformedCssModule = \"\";\n\n if (isCssModule) {\n transformedCssModule = replaceStrings(\n cssModuleContent[cssModulePath],\n // Vite's `TransformResult` type has no `default`, but the CSS-module\n // transform attaches the class-name mapping there at runtime.\n (transform as unknown as { default: Record<string, string> }).default,\n );\n }\n\n styles.push({\n isDev: true,\n id: cssModulePath,\n content: isCssModule ? transformedCssModule : transform.code,\n });\n }\n\n return styles.map(hoistable);\n}\n\nexport async function createStyles(styles = []) {\n return styles.map(hoistable);\n}\n\n/**\n * The precedence every gemi-emitted stylesheet is hoisted under. One shared\n * name on purpose: React keeps same-precedence styles in a single tag in\n * insertion order, which is the order the split assumes — the app bundle\n * first, then the route's own CSS layered over it.\n */\nconst STYLE_PRECEDENCE = \"gemi\";\n\n/**\n * A `<style>` React 19 will lift into `<head>` and block the first paint on.\n *\n * It only does that when the tag carries both `precedence` and `href` (the\n * dedupe key). Without them the tag stays where it was rendered, and these are\n * rendered as siblings *before* `<html>` — so React normalizes them into\n * `<body>`, nothing in `<head>` is render-blocking, and the browser paints the\n * whole document unstyled before the CSS applies (#328).\n *\n * React strips every other attribute off a hoisted style, `id` and\n * `data-vite-dev-id` included, and leaves only `data-precedence` +\n * `data-href`. `fetchRouteCSS` reads that `data-href` list to tell what is\n * already on the page; nothing reads the dev id, and Vite re-injects its own\n * tag for HMR rather than adopting this one.\n */\nfunction hoistable(style: { id: string; content: string }, i: number) {\n return createElement(\"style\", {\n key: i,\n href: style.id,\n precedence: STYLE_PRECEDENCE,\n dangerouslySetInnerHTML: { __html: style.content },\n });\n}\n",
6
6
  "import { existsSync } from \"node:fs\";\nimport { basename } from \"node:path\";\nimport { networkInterfaces } from \"node:os\";\nimport { envFiles } from \"./watchEnv\";\nimport pkg from \"../package.json\";\n\n// \"GEMI\" — ANSI Shadow figlet font.\nconst ART = [\n \" ██████╗ ███████╗███╗ ███╗██╗\",\n \"██╔════╝ ██╔════╝████╗ ████║██║\",\n \"██║ ███╗█████╗ ██╔████╔██║██║\",\n \"██║ ██║██╔══╝ ██║╚██╔╝██║██║\",\n \"╚██████╔╝███████╗██║ ╚═╝ ██║██║\",\n \" ╚═════╝ ╚══════╝╚═╝ ╚═╝╚═╝\",\n];\n\nconst useColor = Boolean(process.stdout.isTTY) && !process.env.NO_COLOR;\nconst paint = (code: string, text: string) =>\n useColor ? `\\x1b[${code}m${text}\\x1b[0m` : text;\nconst bold = (t: string) => paint(\"1\", t);\nconst dim = (t: string) => paint(\"2\", t);\nconst cyan = (t: string) => paint(\"36\", t);\nconst green = (t: string) => paint(\"32\", t);\nconst magenta = (t: string) => paint(\"35\", t);\n\nfunction gemiVersion(): string {\n return (pkg as { version?: string }).version ?? \"?\";\n}\n\nfunction networkUrl(port: number | string): string | null {\n for (const ifaces of Object.values(networkInterfaces())) {\n for (const iface of ifaces ?? []) {\n // Node <18 reported `family` as the number 4; newer Bun/Node use \"IPv4\".\n const isV4 = iface.family === \"IPv4\" || (iface.family as unknown) === 4;\n if (isV4 && !iface.internal) return `http://${iface.address}:${port}`;\n }\n }\n return null;\n}\n\nfunction loadedEnvFiles(rootDir: string): string[] {\n return envFiles(rootDir)\n .filter((file) => existsSync(file))\n .map((file) => basename(file));\n}\n\nexport function printStartupBanner(params: {\n port: number | string;\n rootDir: string;\n}) {\n const { port, rootDir } = params;\n const local = `http://localhost:${port}`;\n const network = networkUrl(port);\n const env = loadedEnvFiles(rootDir);\n\n const row = (label: string, value: string) =>\n ` ${green(\"➜\")} ${bold(label.padEnd(9))}${value}`;\n\n const out = [\n \"\",\n ...ART.map((line) => magenta(line)),\n \"\",\n ` ${dim(\"gemi\")} ${cyan(`v${gemiVersion()}`)}`,\n \"\",\n row(\"Local:\", cyan(local)),\n row(\"Network:\", network ? cyan(network) : dim(\"unavailable\")),\n row(\"Env:\", env.length ? env.join(\", \") : dim(\"none\")),\n \"\",\n ];\n\n console.log(out.join(\"\\n\"));\n}\n"
7
7
  ],
8
- "mappings": ";wCAAA,wBAAS,cAGT,SAAS,CAAc,CAAC,EAAc,EAAwC,CAC5E,IAAM,EAAc,OAAO,KAAK,CAAM,EACnC,KAAK,CAAC,EAAG,IAAM,EAAE,OAAS,EAAE,MAAM,EAClC,IAAI,CAAC,IAAQ,EAAI,QAAQ,sBAAuB,MAAM,CAAC,EAGpD,EAAQ,IAAI,OAAO,EAAY,KAAK,GAAG,EAAG,GAAG,EAEnD,OAAO,EAAK,QAAQ,EAAO,CAAC,IAAU,EAAO,EAAM,EAGrD,eAAsB,CAAe,CACnC,EACA,EACA,EAAyB,CAAC,EAC1B,CACA,IAAM,EAAQ,CACZ,GAAG,EAAa,IAAI,CAAC,IAAS,GAAG,WAAgB,OAAU,EAC3D,GAAG,wBACL,EAEM,EAAU,IAAI,IACpB,QAAW,KAAQ,EAAO,CACxB,IAAM,EAAM,EAAK,YAAY,iBAAiB,CAAI,EAClD,GAAI,EACF,QAAW,KAAK,EAAK,EAAQ,IAAI,CAAC,EAItC,IAAM,EAAS,CAAC,EACV,EAAa,CAAC,EACd,EAA2C,CAAC,EAClD,QAAW,KAAO,EAChB,GAAI,EACF,QAAW,KAAY,EAAI,gBAAiB,CAC1C,GAAI,EAAS,KAAK,SAAS,YAAY,EACrC,EAAiB,EAAS,MAAQ,EAAS,mBAAmB,IAAI,eAAe,KAAK,EAAE,EAE1F,GAAI,EAAS,KAAK,SAAS,MAAM,EAC/B,EAAW,KAAK,EAAS,IAAI,EAMrC,QAAW,KAAiB,EAAY,CACtC,IAAM,EAAY,MAAM,EAAK,iBAAiB,EAAgB,SAA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
+ "debugId": "BFBD0AD2F1F74DB264756E2164756E21",
10
10
  "names": []
11
11
  }
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{g as x,i as D}from"./chunk-x2ahg1k8.js";import{j as y,k as I}from"./chunk-ghes36xj.js";import"./chunk-vv72kw74.js";import"./chunk-ppt296ye.js";import"./chunk-pd3ycrny.js";import"./chunk-twg652g2.js";import"./chunk-x5f4e2fp.js";import"./chunk-p5r0t9jh.js";import"./chunk-xkrthw08.js";import"./chunk-4z53shav.js";import"./chunk-m0earq80.js";import"./chunk-f18weffa.js";import{IncomingMessage as T,ServerResponse as g}from"http";import{Socket as w}from"net";import{join as E}from"path";import{createServer as k}from"vite";function N(H){return H.replace(/\x1b\[[0-9;]*m/g,"").replace(/\[[0-9;]*m/g,"").replace(/\n\s*\n/g,`
2
+ import{g as x,i as D}from"./chunk-s7mcrmas.js";import{j as y,k as I}from"./chunk-ghes36xj.js";import"./chunk-vv72kw74.js";import"./chunk-ppt296ye.js";import"./chunk-pd3ycrny.js";import"./chunk-twg652g2.js";import"./chunk-x5f4e2fp.js";import"./chunk-p5r0t9jh.js";import"./chunk-xkrthw08.js";import"./chunk-4z53shav.js";import"./chunk-m0earq80.js";import"./chunk-f18weffa.js";import{IncomingMessage as T,ServerResponse as g}from"http";import{Socket as w}from"net";import{join as E}from"path";import{createServer as k}from"vite";function N(H){return H.replace(/\x1b\[[0-9;]*m/g,"").replace(/\[[0-9;]*m/g,"").replace(/\n\s*\n/g,`
3
3
  `).split(`
4
4
  `).map((J)=>J.trim()).filter((J)=>J.length>0).join(`
5
5
  `).trim()}function R(H){return`
@@ -1 +1 @@
1
- {"version":3,"file":"ClientRouter.d.ts","sourceRoot":"","sources":["../../client/ClientRouter.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAqB,SAAS,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAQ/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAoB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AAC,CAAC;IACnC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED,eAAO,MAAM,mBAAmB,mDAE/B,CAAC;AAEF,UAAU,yBAAyB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACxC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACtC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;CACzC;AAqBD,eAAO,MAAM,oBAAoB,GAC/B,OAAO,iBAAiB,CAAC,yBAAyB,CAAC,4CA0RpD,CAAC"}
@@ -2367,6 +2367,18 @@ var ComponentsProvider = (props) => {
2367
2367
  //#endregion
2368
2368
  //#region client/ClientRouterContext.tsx
2369
2369
  var ClientRouterContext = createContext({});
2370
+ /**
2371
+ * Whether `file`'s CSS is already on the page, in either of the two shapes it
2372
+ * can take. A client navigation appends `<style id={file}>`; the styles the
2373
+ * document was served with are hoisted into `<head>` by React, which strips
2374
+ * their `id` and records the files it merged into one space-separated
2375
+ * `data-href` list instead (#328). Missing the second shape means re-fetching
2376
+ * and re-appending the CSS the page already has on every navigation.
2377
+ */
2378
+ function isStyleOnPage(file) {
2379
+ if (document.getElementById(file)) return true;
2380
+ return Array.from(document.querySelectorAll("style[data-href]")).some((style) => style.getAttribute("data-href").split(" ").includes(file));
2381
+ }
2370
2382
  var ClientRouterProvider = (props) => {
2371
2383
  const { children, pathname, currentPath, is404, is500, routeManifest, cssManifest, pageData, params, searchParams, breadcrumbs, urlLocaleSegment } = props;
2372
2384
  const navigationAbortControllerRef = useRef(new AbortController());
@@ -2475,7 +2487,7 @@ var ClientRouterProvider = (props) => {
2475
2487
  if (!views) return;
2476
2488
  const cssFiles = views.flatMap((view) => {
2477
2489
  return cssManifest?.[view];
2478
- }).filter(Boolean).filter((file) => !document.getElementById(file));
2490
+ }).filter(Boolean).filter((file) => !isStyleOnPage(file));
2479
2491
  if (cssFiles.length === 0) return;
2480
2492
  async function fetchCSS(path) {
2481
2493
  return {
@@ -3670,7 +3682,7 @@ var Routes = (props) => {
3670
3682
  });
3671
3683
  const from = renderedRouteRef.current;
3672
3684
  setIsFetching(true);
3673
- fetchRouteCSS(routerState.routePath).catch((e) => console.error(e));
3685
+ const cssReady = fetchRouteCSS(routerState.routePath).catch((e) => console.error(e));
3674
3686
  for (const component of views) loadViewModule(component);
3675
3687
  const payload = await loadRoutePayload({
3676
3688
  url,
@@ -3681,6 +3693,7 @@ var Routes = (props) => {
3681
3693
  hydrate({ [path]: { [variantKey]: data } });
3682
3694
  }
3683
3695
  });
3696
+ await cssReady;
3684
3697
  if (payload) {
3685
3698
  const { data, i18n, prefetchedData, breadcrumbs, meta, directive = {}, is404 = false, appId } = payload;
3686
3699
  updateMeta(meta);