gemi 0.41.3 → 0.41.4
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/bin/gemi.js +2 -1
- package/dist/bin/gemi.js.map +3 -3
- package/dist/{chunk-j7290k00.js → chunk-ghes36xj.js} +2 -2
- package/dist/{chunk-j7290k00.js.map → chunk-ghes36xj.js.map} +3 -3
- package/dist/{chunk-3xpfa0ye.js → chunk-kyw5n83x.js} +1 -1
- package/dist/{chunk-pdr63tqe.js → chunk-sns685hn.js} +2 -2
- package/dist/{chunk-pdr63tqe.js.map → chunk-sns685hn.js.map} +1 -1
- package/dist/{chunk-r9rgc769.js → chunk-wzxsj3cp.js} +1 -1
- package/dist/server/index.js +1 -1
- package/dist/vite/index.mjs +1 -0
- package/package.json +1 -1
- /package/dist/{chunk-3xpfa0ye.js.map → chunk-kyw5n83x.js.map} +0 -0
- /package/dist/{chunk-r9rgc769.js.map → chunk-wzxsj3cp.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{l as z}from"./chunk-vv72kw74.js";var J=["gemi","gemi/client","gemi/http","gemi/app","gemi/facades","gemi/email","gemi/runtime","gemi/kernel","gemi/services","gemi/broadcasting","gemi/i18n"];function q(j){return j==="gemi"||j.startsWith("gemi/")}var I=async()=>{let j=await z(process.cwd()),{plugins:B=[],...D}=j.vite??{};return[{name:"gemi-plugin-config",enforce:"pre",config:async(F,k)=>{let H=`${process.cwd()}/app`;return{assetsInclude:["/public"],build:{manifest:!0,ssrEmitAssets:!0,sourcemap:!0,rollupOptions:{input:Array.from(JSON.parse(process.env.GEMI_INPUT??"[]")),...k.isSsrBuild?{external:q}:{}}},resolve:{alias:{"@/app":H}}}}},{name:"gemi-plugin-user-config",config:()=>D},{name:"gemi-plugin-hot-reload",handleHotUpdate({server:F,modules:k}){if(k?.[0]?.id?.includes("/app/http/"))return[]}},...B]},O=I;
|
|
2
|
+
import{l as z}from"./chunk-vv72kw74.js";var J=["gemi","gemi/client","gemi/http","gemi/app","gemi/facades","gemi/email","gemi/runtime","gemi/kernel","gemi/services","gemi/broadcasting","gemi/i18n"];function q(j){return j==="gemi"||j.startsWith("gemi/")}var I=async()=>{let j=await z(process.cwd()),{plugins:B=[],...D}=j.vite??{};return[{name:"gemi-plugin-config",enforce:"pre",config:async(F,k)=>{let H=`${process.cwd()}/app`;return{assetsInclude:["/public"],build:{manifest:!0,ssrEmitAssets:!0,sourcemap:!0,rollupOptions:{input:Array.from(JSON.parse(process.env.GEMI_INPUT??"[]")),preserveEntrySignatures:"strict",...k.isSsrBuild?{external:q}:{}}},resolve:{alias:{"@/app":H}}}}},{name:"gemi-plugin-user-config",config:()=>D},{name:"gemi-plugin-hot-reload",handleHotUpdate({server:F,modules:k}){if(k?.[0]?.id?.includes("/app/http/"))return[]}},...B]},O=I;
|
|
3
3
|
export{J as j,O as k};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
5
|
+
//# debugId=0D2A9A2BD0061B8764756E2164756E21
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
"sources": ["../internal/gemiExternals.ts", "../vite/index.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"// Single source of truth for keeping `gemi` external to the SSR view graph.\n//\n// `gemi` is a linked package, so a bundler will otherwise compile its own copy\n// of gemi's module-level singletons (`RouteStateContext`, `I18nContext`, the\n// `useLocale`/`useRouteData` hooks, ...) into the view chunks — a *different*\n// instance than the running server's `Root` provider, so `useRouteData()` reads\n// the empty default and SSR crashes on `i18n.currentLocale`. Externalizing makes\n// view imports of `gemi/*` resolve to the one Bun-loaded instance.\n//\n// Two consumers, two forms:\n// - dev (`server/httpDev.ts`): Vite's `ssr.external` matches EXACT specifiers\n// only (subpaths are not covered by the bare name, regexes are ignored), so\n// it needs the enumerated list below. When you add a `gemi/*` export that a\n// view may import, add it here too or dev SSR will silently bundle a copy.\n// - build (`vite/index.ts`): rollup's `external` is a subpath-aware predicate,\n// so it uses `isGemiExternal` and needs no maintenance for new subpaths.\n\n// Every `gemi` entrypoint a view module may import. Keep in sync with the\n// view-facing `exports` in package.json (build/server-only subpaths like\n// `vite`, `server`, `bun/*`, and `config` are intentionally omitted — views\n// never import them).\nexport const GEMI_EXTERNAL_SPECIFIERS = [\n \"gemi\",\n \"gemi/client\",\n \"gemi/http\",\n \"gemi/app\",\n \"gemi/facades\",\n \"gemi/email\",\n \"gemi/runtime\",\n \"gemi/kernel\",\n \"gemi/services\",\n \"gemi/broadcasting\",\n \"gemi/i18n\",\n] as const;\n\n// Predicate form for rollup's `external`: covers `gemi` and every `gemi/*`\n// subpath.\nexport function isGemiExternal(id: string): boolean {\n return id === \"gemi\" || id.startsWith(\"gemi/\");\n}\n",
|
|
6
|
-
"import type { PluginOption } from \"vite\";\nimport { loadGemiConfig } from \"../config/load\";\nimport { isGemiExternal } from \"../internal/gemiExternals\";\n\n// Async so it can load `gemi.config.ts` before returning the plugin list. Both\n// consumers run under Bun (the CLI's `build()` and dev's `createServer`, spawned\n// via `bun`), so the config's TypeScript imports directly. Vite accepts a\n// `Promise<PluginOption[]>` as an entry in its `plugins` array, so gemi passes\n// `plugins: [gemi()]` itself — the app's own Vite plugins (e.g. React) come from\n// `gemi.config.ts` and are appended below, so there is no `vite.config.mjs`.\nconst gemi = async (): Promise<PluginOption[]> => {\n const userConfig = await loadGemiConfig(process.cwd());\n const { plugins: userVitePlugins = [], ...userViteConfig } =\n userConfig.vite ?? {};\n\n return [\n {\n name: \"gemi-plugin-config\",\n enforce: \"pre\",\n config: async (_config, env) => {\n const appPath = `${process.cwd()}/app`;\n return {\n assetsInclude: [\"/public\"],\n build: {\n manifest: true,\n ssrEmitAssets: true,\n // Emit source maps for both the client and SSR view builds so\n // browser devtools and server stack traces map back to app source.\n sourcemap: true,\n rollupOptions: {\n input: Array.from(JSON.parse(process.env.GEMI_INPUT ?? \"[]\")),\n // For the SSR build, externalize `gemi` (a linked package) and all\n // its subpaths. Otherwise the bundler compiles its own copy of\n // gemi's module-level singletons (`RouteStateContext`,\n // `I18nContext`, the `useLocale`/`useRouteData` hooks, ...) into a\n // shared chunk — a *different* instance than the running server's\n // `Root` provider — so `useRouteData()` reads the empty default and\n // SSR crashes on `i18n.currentLocale`. Externalizing makes the\n // built view chunks `import ... from \"gemi/*\"` at runtime, resolving\n // to the one instance shared with the renderer. (Vite 8's\n // `ssr.external` does not externalize for the build, so this is done\n // at the rollup level.) Mirrors `server/httpDev.ts`'s dev config\n // via the shared `internal/gemiExternals` source of truth.\n ...(env.isSsrBuild ? { external: isGemiExternal } : {}),\n },\n },\n resolve: {\n alias: {\n \"@/app\": appPath,\n },\n },\n };\n },\n },\n // The app's `gemi.config.ts` `vite` config (minus `plugins`, which are\n // appended below) as its own `config` hook. Vite deep-merges every plugin's\n // `config` result, so the app config layers cleanly on top of gemi's base\n // without a manual merge (and without pulling `vite`'s `mergeConfig` into\n // this bundle).\n {\n name: \"gemi-plugin-user-config\",\n config: () => userViteConfig,\n },\n {\n name: \"gemi-plugin-hot-reload\",\n handleHotUpdate({ server, modules }) {\n if (modules?.[0]?.id?.includes(\"/app/http/\")) {\n // server.ws.send({\n // type: \"custom\",\n // event: \"http-reload\",\n // data: {\n // id: modules[0].id,\n // },\n // });\n\n return [];\n }\n },\n },\n // App-provided Vite plugins run after gemi's own.\n ...userVitePlugins,\n ];\n};\n\nexport default gemi;\n"
|
|
6
|
+
"import type { PluginOption } from \"vite\";\nimport { loadGemiConfig } from \"../config/load\";\nimport { isGemiExternal } from \"../internal/gemiExternals\";\n\n// Async so it can load `gemi.config.ts` before returning the plugin list. Both\n// consumers run under Bun (the CLI's `build()` and dev's `createServer`, spawned\n// via `bun`), so the config's TypeScript imports directly. Vite accepts a\n// `Promise<PluginOption[]>` as an entry in its `plugins` array, so gemi passes\n// `plugins: [gemi()]` itself — the app's own Vite plugins (e.g. React) come from\n// `gemi.config.ts` and are appended below, so there is no `vite.config.mjs`.\nconst gemi = async (): Promise<PluginOption[]> => {\n const userConfig = await loadGemiConfig(process.cwd());\n const { plugins: userVitePlugins = [], ...userViteConfig } =\n userConfig.vite ?? {};\n\n return [\n {\n name: \"gemi-plugin-config\",\n enforce: \"pre\",\n config: async (_config, env) => {\n const appPath = `${process.cwd()}/app`;\n return {\n assetsInclude: [\"/public\"],\n build: {\n manifest: true,\n ssrEmitAssets: true,\n // Emit source maps for both the client and SSR view builds so\n // browser devtools and server stack traces map back to app source.\n sourcemap: true,\n rollupOptions: {\n input: Array.from(JSON.parse(process.env.GEMI_INPUT ?? \"[]\")),\n // Each view is a build entry, but the app never imports them\n // statically — the client router pulls them in via `import.meta.glob`\n // (a runtime dynamic import). Rolldown's default entry-signature\n // handling therefore sees a view's `export default` as unused and\n // tree-shakes it. For a plain view the component is hoisted into the\n // shared bundle so it still renders, but a view with a module-scope\n // `lazy(() => import(...))` keeps its own chunk alive as a side\n // effect while the \"unused\" default export is dropped — leaving a\n // hollow chunk whose default is `undefined`. Hydration then renders\n // `<undefined/>` → React #306 and the whole page unmounts to blank.\n // `\"strict\"` forces every entry to preserve its exact exports (a\n // facade chunk is emitted if needed), so every view keeps its\n // default regardless of how the router loads it.\n preserveEntrySignatures: \"strict\",\n // For the SSR build, externalize `gemi` (a linked package) and all\n // its subpaths. Otherwise the bundler compiles its own copy of\n // gemi's module-level singletons (`RouteStateContext`,\n // `I18nContext`, the `useLocale`/`useRouteData` hooks, ...) into a\n // shared chunk — a *different* instance than the running server's\n // `Root` provider — so `useRouteData()` reads the empty default and\n // SSR crashes on `i18n.currentLocale`. Externalizing makes the\n // built view chunks `import ... from \"gemi/*\"` at runtime, resolving\n // to the one instance shared with the renderer. (Vite 8's\n // `ssr.external` does not externalize for the build, so this is done\n // at the rollup level.) Mirrors `server/httpDev.ts`'s dev config\n // via the shared `internal/gemiExternals` source of truth.\n ...(env.isSsrBuild ? { external: isGemiExternal } : {}),\n },\n },\n resolve: {\n alias: {\n \"@/app\": appPath,\n },\n },\n };\n },\n },\n // The app's `gemi.config.ts` `vite` config (minus `plugins`, which are\n // appended below) as its own `config` hook. Vite deep-merges every plugin's\n // `config` result, so the app config layers cleanly on top of gemi's base\n // without a manual merge (and without pulling `vite`'s `mergeConfig` into\n // this bundle).\n {\n name: \"gemi-plugin-user-config\",\n config: () => userViteConfig,\n },\n {\n name: \"gemi-plugin-hot-reload\",\n handleHotUpdate({ server, modules }) {\n if (modules?.[0]?.id?.includes(\"/app/http/\")) {\n // server.ws.send({\n // type: \"custom\",\n // event: \"http-reload\",\n // data: {\n // id: modules[0].id,\n // },\n // });\n\n return [];\n }\n },\n },\n // App-provided Vite plugins run after gemi's own.\n ...userVitePlugins,\n ];\n};\n\nexport default gemi;\n"
|
|
7
7
|
],
|
|
8
|
-
"mappings": ";wCAqBO,IAAM,EAA2B,CACtC,OACA,cACA,YACA,WACA,eACA,aACA,eACA,cACA,gBACA,oBACA,WACF,EAIO,SAAS,CAAc,CAAC,EAAqB,CAClD,OAAO,IAAO,QAAU,EAAG,WAAW,OAAO,EC5B/C,IAAM,EAAO,SAAqC,CAChD,IAAM,EAAa,MAAM,EAAe,QAAQ,IAAI,CAAC,GAC7C,QAAS,EAAkB,CAAC,KAAM,GACxC,EAAW,MAAQ,CAAC,EAEtB,MAAO,CACL,CACE,KAAM,qBACN,QAAS,MACT,OAAQ,MAAO,EAAS,IAAQ,CAC9B,IAAM,EAAU,GAAG,QAAQ,IAAI,QAC/B,MAAO,CACL,cAAe,CAAC,SAAS,EACzB,MAAO,CACL,SAAU,GACV,cAAe,GAGf,UAAW,GACX,cAAe,CACb,MAAO,MAAM,KAAK,KAAK,MAAM,QAAQ,IAAI,YAAc,IAAI,CAAC,
|
|
9
|
-
"debugId": "
|
|
8
|
+
"mappings": ";wCAqBO,IAAM,EAA2B,CACtC,OACA,cACA,YACA,WACA,eACA,aACA,eACA,cACA,gBACA,oBACA,WACF,EAIO,SAAS,CAAc,CAAC,EAAqB,CAClD,OAAO,IAAO,QAAU,EAAG,WAAW,OAAO,EC5B/C,IAAM,EAAO,SAAqC,CAChD,IAAM,EAAa,MAAM,EAAe,QAAQ,IAAI,CAAC,GAC7C,QAAS,EAAkB,CAAC,KAAM,GACxC,EAAW,MAAQ,CAAC,EAEtB,MAAO,CACL,CACE,KAAM,qBACN,QAAS,MACT,OAAQ,MAAO,EAAS,IAAQ,CAC9B,IAAM,EAAU,GAAG,QAAQ,IAAI,QAC/B,MAAO,CACL,cAAe,CAAC,SAAS,EACzB,MAAO,CACL,SAAU,GACV,cAAe,GAGf,UAAW,GACX,cAAe,CACb,MAAO,MAAM,KAAK,KAAK,MAAM,QAAQ,IAAI,YAAc,IAAI,CAAC,EAc5D,wBAAyB,YAarB,EAAI,WAAa,CAAE,SAAU,CAAe,EAAI,CAAC,CACvD,CACF,EACA,QAAS,CACP,MAAO,CACL,QAAS,CACX,CACF,CACF,EAEJ,EAMA,CACE,KAAM,0BACN,OAAQ,IAAM,CAChB,EACA,CACE,KAAM,yBACN,eAAe,EAAG,SAAQ,WAAW,CACnC,GAAI,IAAU,IAAI,IAAI,SAAS,YAAY,EASzC,MAAO,CAAC,EAGd,EAEA,GAAG,CACL,GAGa",
|
|
9
|
+
"debugId": "0D2A9A2BD0061B8764756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{h as W,i as g}from"./chunk-
|
|
2
|
+
import{h as W,i as g}from"./chunk-sns685hn.js";import"./chunk-ppt296ye.js";import{M as Y}from"./chunk-c9wa4rtm.js";import"./chunk-agvzqxv7.js";import{join as x}from"path";function V(T){let _=T.toString(),k=new Bun.CryptoHasher("sha1");return k.update(_),k.digest("hex")}if(!globalThis.URLPattern)globalThis.URLPattern=Y;import{exists as F}from"fs/promises";var u=process.env.GEMI_PROJECT_DIR??"",Z=x(process.cwd(),u),h=x(Z,"app"),Q=x(Z,"dist");async function a(T,_){let k=await import(`${Q}/client/.vite/manifest.json`),$=await import(`${Q}/server/.vite/manifest.json`);process.env.ROOT_DIR=Z,process.env.APP_DIR=h,process.env.DIST_DIR=Q;let A={},I={},P={},S=(L,U)=>`"${L}": () => import("${U}")`,C=[];for(let L of["404",...T.getFlatComponentTree.call(T)]){let U=$[`app/views/${L}.tsx`];if(!U?.file){console.log(`Server file not found for ${L}`),console.log(U);let B=Object.keys($),H=`app/views/${L}.tsx`;console.log(`${H} not found in server manifest`),console.log(B)}let z=await import(`${process.env.DIST_DIR}/server/${U?.file}`);A[L]=z.default,I[L]=z.OpenGraph;let G=k[`app/views/${L}.tsx`];if(G?.css&&G?.css.length>0)P[L]=G?.css;if(G)C.push(S(L,`/${G?.file}`))}let y=`{${C.join(",")}}`,N=k["app/client.tsx"]?.css??[],w=(await Promise.all(N.map((L)=>Bun.file(`${Q}/client/${L}`).text()))).join(`
|
|
3
3
|
`);async function D(L){let{pathname:U}=new URL(L.url),z=new Y({pathname:"/*.:filetype(png|txt|js|css|jpg|svg|jpeg|avif|webp|ico|ttf|map)"}),G=U.startsWith("/.well-known"),B=z.test({pathname:U})||G,H=U.startsWith("/api");if(B&&!H){let R=new URL(L.url),J=L.url.replace(R.origin,"").split("?")[0],X=`${Q}/client${J.replace("/assets/assets","/assets")}`,O=await F(X);if(!O&&R.pathname.includes(".js"))return new Response(`if(caches){caches?.delete("${X}")}window.location.reload();export {}`,{headers:{"Content-Type":"application/javascript"}});if(!O)return new Response("Not found",{status:404});try{let b=Bun.file(X),K=V(b.lastModified);return new Response(b.stream(),{headers:{"Content-Type":b.type,"Cache-Control":"public, max-age=31536000, must-revalidate","Content-Length":String(b.size),ETag:K}})}catch(b){return T.onException?.(b),new Response("Not found",{status:404})}}let M=T.fetch.bind(T);try{let R=await M(L);if(R instanceof Response)return R;else{let J=[];return J.push({content:w}),await R({getStyles:async(O)=>{if(!O)return W([]);for(let b of O){let K=k[`app/views/${b}.tsx`];for(let E of K?.css??[]){let v=Bun.file(`${process.env.DIST_DIR}/client/${E}`);J.push({id:E,content:await v.text()})}}return W(J)},bootstrapModules:[`/${k["app/client.tsx"].file}`],loaders:y,viewImportMap:A,ogMap:I,cssManifest:P})}}catch(R){if(console.error(R),U.startsWith("/api"))return new Response(JSON.stringify({error:R.message}),{status:500,headers:{"Content-Type":"application/json"}});return T.onException?.(R),new Response(R.stack,{status:500})}}let j=Bun.serve({maxRequestBodySize:10737418240,fetch:async(L,U)=>{if(!L.headers.get("x-forwarded-for")){let z=U.requestIP(L);if(z)L.headers.set("x-forwarded-for",z.address)}return await _(L,D)},idleTimeout:Number(process.env.SERVER_IDLE_TIMEOUT??10),port:process.env.PORT||5173});return g({port:j.port,rootDir:Z}),j}export{a as httpProd};
|
|
4
4
|
|
|
5
5
|
//# debugId=9746BCBA13C1DFAB64756E2164756E21
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{m as O}from"./chunk-ppt296ye.js";import{createElement as j}from"react";function T(i,n){let t=Object.keys(n).sort((p,s)=>s.length-p.length).map((p)=>p.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),e=new RegExp(t.join("|"),"g");return i.replace(e,(p)=>n[p])}async function Y(i,n,t=[]){let e=[...t.map((b)=>`${i}/views/${b}.tsx`),`${i}/views/RootLayout.tsx`],p=new Set;for(let b of e){let u=n.moduleGraph.getModulesByFile(b);if(u)for(let d of u)p.add(d)}let s=[],r=[],c={};for(let b of p)if(b)for(let u of b.importedModules){if(u.file.includes("module.css"))c[u.file]=u.ssrTransformResult.map.sourcesContent.join("");if(u.file.includes(".css"))r.push(u.file)}for(let b of r){let u=await n.transformRequest(b+"?direct"),d=b.includes("module.css"),h="";if(d)h=T(c[b],u.default);s.push({isDev:!0,id:b,content:d?h:u.code})}return s.map((b,u)=>{return j("style",{key:u,type:"text/css","data-vite-dev-id":b.id,dangerouslySetInnerHTML:{__html:b.content}})})}async function Z(i=[]){return i.map((n,t)=>{return j("style",{key:t,id:n?.id,type:"text/css",dangerouslySetInnerHTML:{__html:n.content}})})}import{existsSync as y}from"fs";import{basename as _}from"path";import{networkInterfaces as z}from"os";var v={name:"gemi",version:"0.41.
|
|
2
|
+
import{m as O}from"./chunk-ppt296ye.js";import{createElement as j}from"react";function T(i,n){let t=Object.keys(n).sort((p,s)=>s.length-p.length).map((p)=>p.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),e=new RegExp(t.join("|"),"g");return i.replace(e,(p)=>n[p])}async function Y(i,n,t=[]){let e=[...t.map((b)=>`${i}/views/${b}.tsx`),`${i}/views/RootLayout.tsx`],p=new Set;for(let b of e){let u=n.moduleGraph.getModulesByFile(b);if(u)for(let d of u)p.add(d)}let s=[],r=[],c={};for(let b of p)if(b)for(let u of b.importedModules){if(u.file.includes("module.css"))c[u.file]=u.ssrTransformResult.map.sourcesContent.join("");if(u.file.includes(".css"))r.push(u.file)}for(let b of r){let u=await n.transformRequest(b+"?direct"),d=b.includes("module.css"),h="";if(d)h=T(c[b],u.default);s.push({isDev:!0,id:b,content:d?h:u.code})}return s.map((b,u)=>{return j("style",{key:u,type:"text/css","data-vite-dev-id":b.id,dangerouslySetInnerHTML:{__html:b.content}})})}async function Z(i=[]){return i.map((n,t)=>{return j("style",{key:t,id:n?.id,type:"text/css",dangerouslySetInnerHTML:{__html:n.content}})})}import{existsSync as y}from"fs";import{basename as _}from"path";import{networkInterfaces as z}from"os";var v={name:"gemi",version:"0.41.4",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 --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","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":"*","@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",oxlint:"^1.39.0",react:"19.2.3","react-dom":"19.2.3",typescript:"^5.7.3",vitest:"^4.0.0"},peerDependencies:{react:">=19","react-dom":">=19",sharp:"^0.34.2",vite:"^8.0.0"}};var G=[" \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"],H=Boolean(process.stdout.isTTY)&&!process.env.NO_COLOR,l=(i,n)=>H?`\x1B[${i}m${n}\x1B[0m`:n,J=(i)=>l("1",i),g=(i)=>l("2",i),x=(i)=>l("36",i),L=(i)=>l("32",i),N=(i)=>l("35",i);function Q(){return v.version??"?"}function R(i){for(let n of Object.values(z()))for(let t of n??[])if((t.family==="IPv4"||t.family===4)&&!t.internal)return`http://${t.address}:${i}`;return null}function W(i){return O(i).filter((n)=>y(n)).map((n)=>_(n))}function K(i){let{port:n,rootDir:t}=i,e=`http://localhost:${n}`,p=R(n),s=W(t),r=(b,u)=>` ${L("\u279C")} ${J(b.padEnd(9))}${u}`,c=["",...G.map((b)=>N(b)),"",` ${g("gemi")} ${x(`v${Q()}`)}`,"",r("Local:",x(e)),r("Network:",p?x(p):g("unavailable")),r("Env:",s.length?s.join(", "):g("none")),""];console.log(c.join(`
|
|
3
3
|
`))}
|
|
4
4
|
export{Y as g,Z as h,K as i};
|
|
5
5
|
|
|
6
|
-
//# debugId=
|
|
6
|
+
//# debugId=28E7463A1B1B3A4064756E2164756E21
|
|
@@ -6,6 +6,6 @@
|
|
|
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
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,SAAS,EAEjE,EAAc,EAAc,SAAS,YAAY,EAEnD,EAAuB,GAE3B,GAAI,EACF,EAAuB,EACrB,EAAiB,GAGhB,EAA6D,OAChE,EAGF,EAAO,KAAK,CACV,MAAO,GACP,GAAI,EACJ,QAAS,EAAc,EAAuB,EAAU,IAC1D,CAAC,EAGH,OAAO,EAAO,IAAI,CAAC,EAAO,IAAM,CAC9B,OAAO,EAAc,QAAS,CAC5B,IAAK,EACL,KAAM,WACN,mBAAoB,EAAM,GAC1B,wBAAyB,CAAE,OAAQ,EAAM,OAAQ,CACnD,CAAC,EACF,EAGH,eAAsB,CAAY,CAAC,EAAS,CAAC,EAAG,CAC9C,OAAO,EAAO,IAAI,CAAC,EAAO,IAAM,CAC9B,OAAO,EAAc,QAAS,CAC5B,IAAK,EACL,GAAI,GAAO,GACX,KAAM,WACN,wBAAyB,CAAE,OAAQ,EAAM,OAAQ,CACnD,CAAC,EACF,ECzFH,qBAAS,WACT,mBAAS,aACT,4BAAS,81EAKT,IAAM,EAAM,CACV,oKACA,mLACA,yKACA,oKACA,mLACA,yJACF,EAEM,EAAW,QAAQ,QAAQ,OAAO,KAAK,GAAK,CAAC,QAAQ,IAAI,SACzD,EAAQ,CAAC,EAAc,IAC3B,EAAW,QAAQ,KAAQ,WAAgB,EACvC,EAAO,CAAC,IAAc,EAAM,IAAK,CAAC,EAClC,EAAM,CAAC,IAAc,EAAM,IAAK,CAAC,EACjC,EAAO,CAAC,IAAc,EAAM,KAAM,CAAC,EACnC,EAAQ,CAAC,IAAc,EAAM,KAAM,CAAC,EACpC,EAAU,CAAC,IAAc,EAAM,KAAM,CAAC,EAE5C,SAAS,CAAW,EAAW,CAC7B,OAAQ,EAA6B,SAAW,IAGlD,SAAS,CAAU,CAAC,EAAsC,CACxD,QAAW,KAAU,OAAO,OAAO,EAAkB,CAAC,EACpD,QAAW,KAAS,GAAU,CAAC,EAG7B,IADa,EAAM,SAAW,QAAW,EAAM,SAAuB,IAC1D,CAAC,EAAM,SAAU,MAAO,UAAU,EAAM,WAAW,IAGnE,OAAO,KAGT,SAAS,CAAc,CAAC,EAA2B,CACjD,OAAO,EAAS,CAAO,EACpB,OAAO,CAAC,IAAS,EAAW,CAAI,CAAC,EACjC,IAAI,CAAC,IAAS,EAAS,CAAI,CAAC,EAG1B,SAAS,CAAkB,CAAC,EAGhC,CACD,IAAQ,OAAM,WAAY,EACpB,EAAQ,oBAAoB,IAC5B,EAAU,EAAW,CAAI,EACzB,EAAM,EAAe,CAAO,EAE5B,EAAM,CAAC,EAAe,IAC1B,KAAK,EAAM,QAAE,MAAM,EAAK,EAAM,OAAO,CAAC,CAAC,IAAI,IAEvC,EAAM,CACV,GACA,GAAG,EAAI,IAAI,CAAC,IAAS,EAAQ,CAAI,CAAC,EAClC,GACA,KAAK,EAAI,MAAM,KAAK,EAAK,IAAI,EAAY,GAAG,IAC5C,GACA,EAAI,SAAU,EAAK,CAAK,CAAC,EACzB,EAAI,WAAY,EAAU,EAAK,CAAO,EAAI,EAAI,aAAa,CAAC,EAC5D,EAAI,OAAQ,EAAI,OAAS,EAAI,KAAK,IAAI,EAAI,EAAI,MAAM,CAAC,EACrD,EACF,EAEA,QAAQ,IAAI,EAAI,KAAK;AAAA,CAAI,CAAC",
|
|
9
|
-
"debugId": "
|
|
9
|
+
"debugId": "28E7463A1B1B3A4064756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{g as I,i as f}from"./chunk-
|
|
2
|
+
import{g as I,i as f}from"./chunk-sns685hn.js";import{j as b,k as y}from"./chunk-ghes36xj.js";import"./chunk-vv72kw74.js";import"./chunk-ppt296ye.js";import"./chunk-q3wpyr9y.js";import"./chunk-88fb6hzq.js";import"./chunk-c9wa4rtm.js";import"./chunk-a8wmfnw6.js";import"./chunk-p6ezs2w7.js";import"./chunk-6b1abejc.js";import"./chunk-xnhktttd.js";import"./chunk-c1hsc4aa.js";import"./chunk-agvzqxv7.js";import{IncomingMessage as w,ServerResponse as N}from"http";import{Socket as T}from"net";import{join as g}from"path";import{createServer as E}from"vite";function S(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 P(H){return`
|
package/dist/server/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{n as g}from"../chunk-ppt296ye.js";import{o as b}from"../chunk-q3wpyr9y.js";import"../chunk-88fb6hzq.js";import"../chunk-c9wa4rtm.js";import"../chunk-a8wmfnw6.js";import"../chunk-p6ezs2w7.js";import"../chunk-6b1abejc.js";import"../chunk-xnhktttd.js";import"../chunk-c1hsc4aa.js";import{Tb as S}from"../chunk-agvzqxv7.js";class i{app;instrumentation;constructor(f){this.app=new b({kernel:f.kernel}),this.instrumentation=f.instrumentation??((z,B)=>B(z))}async start(){if(Bun.env.NODE_ENV==="production"){let{httpProd:f}=await import("../chunk-
|
|
2
|
+
import{n as g}from"../chunk-ppt296ye.js";import{o as b}from"../chunk-q3wpyr9y.js";import"../chunk-88fb6hzq.js";import"../chunk-c9wa4rtm.js";import"../chunk-a8wmfnw6.js";import"../chunk-p6ezs2w7.js";import"../chunk-6b1abejc.js";import"../chunk-xnhktttd.js";import"../chunk-c1hsc4aa.js";import{Tb as S}from"../chunk-agvzqxv7.js";class i{app;instrumentation;constructor(f){this.app=new b({kernel:f.kernel}),this.instrumentation=f.instrumentation??((z,B)=>B(z))}async start(){if(Bun.env.NODE_ENV==="production"){let{httpProd:f}=await import("../chunk-kyw5n83x.js");await f(this.app,this.instrumentation.bind(this))}else{g();let{httpDev:f}=await import("../chunk-wzxsj3cp.js");await f(this.app,this.instrumentation.bind(this))}}}export{i as Server};
|
|
3
3
|
|
|
4
4
|
//# debugId=989445B19C66D48064756E2164756E21
|
package/dist/vite/index.mjs
CHANGED
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|