gemi 0.42.0 → 0.42.2
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 +32 -2
- package/dist/bin/gemi.js.map +3 -3
- package/dist/bun/plugin.js +1 -1
- package/dist/bun/preload.js +1 -1
- package/dist/{chunk-s2tm33hd.js → chunk-54wqarj8.js} +1 -1
- package/dist/{chunk-xzr4t6k9.js → chunk-akbepc3f.js} +65 -65
- package/dist/{chunk-xzr4t6k9.js.map → chunk-akbepc3f.js.map} +3 -3
- package/dist/{chunk-s4seq23x.js → chunk-m1t1f3s5.js} +2 -2
- package/dist/{chunk-s4seq23x.js.map → chunk-m1t1f3s5.js.map} +1 -1
- package/dist/{chunk-qprvfg0b.js → chunk-v3agzap3.js} +1 -1
- package/dist/email/Email.d.ts.map +1 -1
- package/dist/email/index.js +3 -2
- package/dist/email/index.js.map +15 -4
- package/dist/server/index.js +1 -1
- package/package.json +1 -1
- /package/dist/{chunk-s2tm33hd.js.map → chunk-54wqarj8.js.map} +0 -0
- /package/dist/{chunk-qprvfg0b.js.map → chunk-v3agzap3.js.map} +0 -0
|
@@ -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.42.
|
|
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.42.2",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=F1970A538709A56E64756E2164756E21
|
|
@@ -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,EA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
2
|
+
import{h as g,i as R}from"./chunk-m1t1f3s5.js";import"./chunk-ppt296ye.js";import{J as K,L as W}from"./chunk-pjgfvdr6.js";import"./chunk-yeqwzeq7.js";import"./chunk-sbmg0hfr.js";import"./chunk-n1xpxhm0.js";import"./chunk-bfnh3gwv.js";import"./chunk-cwq1vdcb.js";import{join as j}from"path";function V(J){let x=J.toString(),Q=new Bun.CryptoHasher("sha1");return Q.update(x),Q.digest("hex")}if(!globalThis.URLPattern)globalThis.URLPattern=K;import{exists as v}from"fs/promises";var u=process.env.GEMI_PROJECT_DIR??"",T=j(process.cwd(),u),F=j(T,"app"),$=j(T,"dist");async function a(J,x){let Q=await import(`${$}/client/.vite/manifest.json`),O=await import(`${$}/server/.vite/manifest.json`);process.env.ROOT_DIR=T,process.env.APP_DIR=F,process.env.DIST_DIR=$;let A={},C={},I={},S=(b,L)=>`"${b}": () => import("${L}")`,_=[];for(let b of["404",...J.getFlatComponentTree.call(J)]){let L=O[`app/views/${b}.tsx`];if(!L?.file){console.log(`Server file not found for ${b}`),console.log(L);let U=Object.keys(O),Y=`app/views/${b}.tsx`;console.log(`${Y} not found in server manifest`),console.log(U)}let z=await import(`${process.env.DIST_DIR}/server/${L?.file}`);A[b]=z.default,C[b]=z.OpenGraph;let k=Q[`app/views/${b}.tsx`];if(k?.css&&k?.css.length>0)I[b]=k?.css;if(k)_.push(S(b,`/${k?.file}`))}let N=`{${_.join(",")}}`,w=Q["app/client.tsx"]?.css??[],M=(await Promise.all(w.map((b)=>Bun.file(`${$}/client/${b}`).text()))).join(`
|
|
3
3
|
`),D=new K({pathname:"/*.:filetype(png|txt|js|css|jpg|svg|jpeg|avif|webp|ico|ttf|map)"});async function E(b){let{pathname:L}=new URL(b.url),z=L.startsWith("/.well-known"),k=D.test({pathname:L})||z,U=L.startsWith("/api");if(k&&!U){let Y=new URL(b.url),B=b.url.replace(Y.origin,"").split("?")[0],Z=`${$}/client${B.replace("/assets/assets","/assets")}`,H=await v(Z);if(!H&&Y.pathname.includes(".js"))return new Response(`if(caches){caches?.delete("${Z}")}window.location.reload();export {}`,{headers:{"Content-Type":"application/javascript"}});if(!H){if(L===W||L.startsWith(`${W}/`))return new Response("Not found",{status:404});return await y(b,L)}try{let G=Bun.file(Z),X=V(G.lastModified);return new Response(G.stream(),{headers:{"Content-Type":G.type,"Cache-Control":"public, max-age=31536000, must-revalidate","Content-Length":String(G.size),ETag:X}})}catch(G){return J.onException?.(G),new Response("Not found",{status:404})}}return await y(b,L)}async function y(b,L){let z=J.fetch.bind(J);try{let k=await z(b);if(k instanceof Response)return k;else{let U=[];return U.push({content:M}),await k({getStyles:async(B)=>{if(!B)return g([]);for(let Z of B){let H=Q[`app/views/${Z}.tsx`];for(let G of H?.css??[]){let X=Bun.file(`${process.env.DIST_DIR}/client/${G}`);U.push({id:G,content:await X.text()})}}return g(U)},bootstrapModules:[`/${Q["app/client.tsx"].file}`],loaders:N,viewImportMap:A,ogMap:C,cssManifest:I})}}catch(k){if(console.error(k),L.startsWith("/api"))return new Response(JSON.stringify({error:k.message}),{status:500,headers:{"Content-Type":"application/json"}});return J.onException?.(k),new Response(k.stack,{status:500})}}let P=Bun.serve({maxRequestBodySize:10737418240,fetch:async(b,L)=>{if(!b.headers.get("x-forwarded-for")){let z=L.requestIP(b);if(z)b.headers.set("x-forwarded-for",z.address)}return await x(b,E)},idleTimeout:Number(process.env.SERVER_IDLE_TIMEOUT??10),port:process.env.PORT||5173});return R({port:P.port,rootDir:T}),P}export{a as httpProd};
|
|
4
4
|
|
|
5
5
|
//# debugId=98F8FC0BCA71CCB764756E2164756E21
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Email.d.ts","sourceRoot":"","sources":["../../email/Email.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Email.d.ts","sourceRoot":"","sources":["../../email/Email.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA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index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{r as
|
|
2
|
+
import{r as B}from"../chunk-tb8yy4rf.js";import{la as o}from"../chunk-sbmg0hfr.js";import"../chunk-bfnh3gwv.js";import"../chunk-cwq1vdcb.js";import{render as i}from"jsx-email";import I from"process";import{Buffer as p}from"buffer";import t from"path";import{fileURLToPath as v0}from"url";import{promisify as O0}from"util";import a from"child_process";import j0,{constants as x0}from"fs/promises";import f from"process";import u,{constants as Z0}from"fs/promises";import w from"process";import Y0 from"os";import W from"fs";import Q0 from"fs";import P from"fs";var L;function J0(){try{return P.statSync("/.dockerenv"),!0}catch{return!1}}function K0(){try{return P.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function D(){if(L===void 0)L=J0()||K0();return L}var F,V0=()=>{try{return Q0.statSync("/run/.containerenv"),!0}catch{return!1}};function M(){if(F===void 0)F=V0()||D();return F}var y=()=>{if(w.platform!=="linux")return!1;if(Y0.release().toLowerCase().includes("microsoft")){if(M())return!1;return!0}try{if(W.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft"))return!M()}catch{}if(W.existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")||W.existsSync("/run/WSL"))return!M();return!1},S=w.env.__IS_WSL_TEST__?y:y();var G0=(()=>{let q;return async function(){if(q)return q;let J="/etc/wsl.conf",Q=!1;try{await u.access(J,Z0.F_OK),Q=!0}catch{}if(!Q)return"/mnt/";let K=await u.readFile(J,{encoding:"utf8"}),Y=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(K);if(!Y)return"/mnt/";return q=Y.groups.mountPoint.trim(),q=q.endsWith("/")?q:`${q}/`,q}})(),H0=async()=>{return`${await G0()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`},_=async()=>{if(S)return H0();return`${f.env.SYSTEMROOT||f.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`};function X($,q,J){let Q=(K)=>Object.defineProperty($,q,{value:K,enumerable:!0,writable:!0});return Object.defineProperty($,q,{configurable:!0,enumerable:!0,get(){let K=J();return Q(K),K},set(K){Q(K)}}),$}import{promisify as F0}from"util";import j from"process";import{execFile as W0}from"child_process";import{promisify as S0}from"util";import X0 from"process";import{execFile as M0}from"child_process";var R0=S0(M0);async function k(){if(X0.platform!=="darwin")throw Error("macOS only");let{stdout:$}=await R0("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]),J=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec($)?.groups.id??"com.apple.Safari";if(J==="com.apple.safari")return"com.apple.Safari";return J}import U0 from"process";import{promisify as N0}from"util";import{execFile as z0,execFileSync as J5}from"child_process";var E0=N0(z0);async function h($,{humanReadableOutput:q=!0,signal:J}={}){if(U0.platform!=="darwin")throw Error("macOS only");let Q=q?[]:["-ss"],K={};if(J)K.signal=J;let{stdout:Y}=await E0("osascript",["-e",$,Q],K);return Y.trim()}async function v($){return h(`tell application "Finder" to set app_path to application file id "${$}" as string
|
|
3
|
+
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`)}import{promisify as T0}from"util";import{execFile as L0}from"child_process";var D0=T0(L0),z={MSEdgeHTM:{name:"Edge",id:"com.microsoft.edge"},MSEdgeBHTML:{name:"Edge Beta",id:"com.microsoft.edge.beta"},MSEdgeDHTML:{name:"Edge Dev",id:"com.microsoft.edge.dev"},AppXq0fevzme2pys62n3e0fbqa7peapykr8v:{name:"Edge",id:"com.microsoft.edge.old"},ChromeHTML:{name:"Chrome",id:"com.google.chrome"},ChromeBHTML:{name:"Chrome Beta",id:"com.google.chrome.beta"},ChromeDHTML:{name:"Chrome Dev",id:"com.google.chrome.dev"},ChromiumHTM:{name:"Chromium",id:"org.chromium.Chromium"},BraveHTML:{name:"Brave",id:"com.brave.Browser"},BraveBHTML:{name:"Brave Beta",id:"com.brave.Browser.beta"},BraveDHTML:{name:"Brave Dev",id:"com.brave.Browser.dev"},BraveSSHTM:{name:"Brave Nightly",id:"com.brave.Browser.nightly"},FirefoxURL:{name:"Firefox",id:"org.mozilla.firefox"},OperaStable:{name:"Opera",id:"com.operasoftware.Opera"},VivaldiHTM:{name:"Vivaldi",id:"com.vivaldi.Vivaldi"},"IE.HTTP":{name:"Internet Explorer",id:"com.microsoft.ie"}},G5=new Map(Object.entries(z));class g extends Error{}async function O($=D0){let{stdout:q}=await $("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),J=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(q);if(!J)throw new g(`Cannot find Windows browser in stdout: ${JSON.stringify(q)}`);let{id:Q}=J.groups,K=Q.lastIndexOf("."),Y=Q.lastIndexOf("-"),G=K===-1?void 0:Q.slice(0,K),V=Y===-1?void 0:Q.slice(0,Y);return z[Q]??z[G]??z[V]??{name:Q,id:Q}}var _0=F0(W0),k0=($)=>$.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,(q)=>q.toUpperCase());async function x(){if(j.platform==="darwin"){let $=await k();return{name:await v($),id:$}}if(j.platform==="linux"){let{stdout:$}=await _0("xdg-mime",["query","default","x-scheme-handler/http"]),q=$.trim();return{name:k0(q.replace(/.desktop$/,"").replace("-"," ")),id:q}}if(j.platform==="win32")return O();throw Error("Only macOS, Linux, and Windows are supported")}var I0=O0(a.execFile),C=t.dirname(v0(import.meta.url)),l=t.join(C,"xdg-open"),{platform:U,arch:m}=I;async function C0(){let $=await _(),q=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,J=p.from(q,"utf16le").toString("base64"),{stdout:Q}=await I0($,["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand",J],{encoding:"utf8"}),K=Q.trim(),Y={ChromeHTML:"com.google.chrome",BraveHTML:"com.brave.Browser",MSEdgeHTM:"com.microsoft.edge",FirefoxURL:"org.mozilla.firefox"};return Y[K]?{id:Y[K]}:{}}var c=async($,q)=>{let J;for(let Q of $)try{return await q(Q)}catch(K){J=K}throw J},E=async($)=>{if($={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...$},Array.isArray($.app))return c($.app,(V)=>E({...$,app:V}));let{name:q,arguments:J=[]}=$.app??{};if(J=[...J],Array.isArray(q))return c(q,(V)=>E({...$,app:{name:V,arguments:J}}));if(q==="browser"||q==="browserPrivate"){let V={"com.google.chrome":"chrome","google-chrome.desktop":"chrome","com.brave.Browser":"brave","org.mozilla.firefox":"firefox","firefox.desktop":"firefox","com.microsoft.msedge":"edge","com.microsoft.edge":"edge","com.microsoft.edgemac":"edge","microsoft-edge.desktop":"edge"},Z={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},H=S?await C0():await x();if(H.id in V){let N=V[H.id];if(q==="browserPrivate")J.push(Z[N]);return E({...$,app:{name:R[N],arguments:J}})}throw Error(`${H.name} is not supported as a default browser`)}let Q,K=[],Y={};if(U==="darwin"){if(Q="open",$.wait)K.push("--wait-apps");if($.background)K.push("--background");if($.newInstance)K.push("--new");if(q)K.push("-a",q)}else if(U==="win32"||S&&!M()&&!q){if(Q=await _(),K.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),!S)Y.windowsVerbatimArguments=!0;let V=["Start"];if($.wait)V.push("-Wait");if(q){if(V.push(`"\`"${q}\`""`),$.target)J.push($.target)}else if($.target)V.push(`"${$.target}"`);if(J.length>0)J=J.map((Z)=>`"\`"${Z}\`""`),V.push("-ArgumentList",J.join(","));$.target=p.from(V.join(" "),"utf16le").toString("base64")}else{if(q)Q=q;else{let V=!C||C==="/",Z=!1;try{await j0.access(l,x0.X_OK),Z=!0}catch{}Q=I.versions.electron??(U==="android"||V||!Z)?"xdg-open":l}if(J.length>0)K.push(...J);if(!$.wait)Y.stdio="ignore",Y.detached=!0}if(U==="darwin"&&J.length>0)K.push("--args",...J);if($.target)K.push($.target);let G=a.spawn(Q,K,Y);if($.wait)return new Promise((V,Z)=>{G.once("error",Z),G.once("close",(H)=>{if(!$.allowNonzeroExitCode&&H>0){Z(Error(`Exited with code ${H}`));return}V(G)})});return G.unref(),G},B0=($,q)=>{if(typeof $!=="string")throw TypeError("Expected a `target`");return E({...q,target:$})};function d($){if(typeof $==="string"||Array.isArray($))return $;let{[m]:q}=$;if(!q)throw Error(`${m} is not supported`);return q}function T({[U]:$},{wsl:q}){if(q&&S)return d(q);if(!$)throw Error(`${U} is not supported`);return d($)}var R={};X(R,"chrome",()=>T({darwin:"google chrome",win32:"chrome",linux:["google-chrome","google-chrome-stable","chromium"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",x64:["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe","/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]}}));X(R,"brave",()=>T({darwin:"brave browser",win32:"brave",linux:["brave-browser","brave"]},{wsl:{ia32:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",x64:["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe","/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]}}));X(R,"firefox",()=>T({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));X(R,"edge",()=>T({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));X(R,"browser",()=>"browser");X(R,"browserPrivate",()=>"browserPrivate");var r=B0;import{jsx as n}from"react/jsx-runtime";class e{from="";to=[];subject="No Subject";cc=[];bcc=[];attachments=[];template;headers={};static async send($){let q=new this,J=o.use().service.defaultLocale,Q=B.use().service,{to:K=q.to,from:Y=q.from,subject:G=typeof q.subject==="string"?q.subject:q.subject[$.locale||J],cc:V=q.cc,bcc:Z=q.bcc,attachments:H=q.attachments,data:N,headers:s={}}=$,$0={...Q.headers??{},...q.headers??{},...s??{}};if(!(await Q.filterRecipients(K)).length)return;let[A,q0]=await Promise.all([q.render({...N,locale:$.locale}),q.renderText({...N,locale:$.locale})]);if(process.env.EMAIL_DEBUG==="true"){let b=`${process.env.ROOT_DIR}/.debug/emails/${new Date().toISOString()}${G}.html`;if(await Bun.write(b,A),process.env.CI!=="true")await r(b);return}await B.use().service.driver.send({bcc:Z,cc:V,from:Y,subject:G,to:K,attachments:H,html:A,headers:$0,text:q0,scheduledAt:$.scheduledAt})}static async preview($){return await new this().render({...$.data,locale:$.locale})}async render($){let q=this.template;return await i(n(q,{...$}))}async renderText($){let q=this.template;return await i(n(q,{...$}),{plainText:!0})}}export{e as Email};
|
|
3
4
|
|
|
4
|
-
//# debugId=
|
|
5
|
+
//# debugId=E1ED8C323A76619C64756E2164756E21
|
package/dist/email/index.js.map
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../email/Email.tsx"],
|
|
3
|
+
"sources": ["../email/Email.tsx", "../../../node_modules/.bun/open@10.2.0/node_modules/open/index.js", "../../../node_modules/.bun/wsl-utils@0.1.0/node_modules/wsl-utils/index.js", "../../../node_modules/.bun/is-wsl@3.1.1/node_modules/is-wsl/index.js", "../../../node_modules/.bun/is-inside-container@1.0.0/node_modules/is-inside-container/index.js", "../../../node_modules/.bun/is-docker@3.0.0/node_modules/is-docker/index.js", "../../../node_modules/.bun/define-lazy-prop@3.0.0/node_modules/define-lazy-prop/index.js", "../../../node_modules/.bun/default-browser@5.5.0/node_modules/default-browser/index.js", "../../../node_modules/.bun/default-browser-id@5.0.1/node_modules/default-browser-id/index.js", "../../../node_modules/.bun/run-applescript@7.1.0/node_modules/run-applescript/index.js", "../../../node_modules/.bun/bundle-name@4.1.0/node_modules/bundle-name/index.js", "../../../node_modules/.bun/default-browser@5.5.0/node_modules/default-browser/windows.js"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import type { ComponentType } from \"react\";\nimport { render } from \"jsx-email\";\nimport { EmailServiceContainer } from \"../services/email/EmailServiceContainer\";\nimport type { SendEmailParams } from \"../services/email/drivers/types\";\nimport { I18nServiceContainer } from \"../i18n/I18nServiceContainer\";\n\ninterface SendEmailArgs<T> extends Partial<Omit<SendEmailParams, \"html\">> {\n data: Omit<T, \"locale\">;\n locale?: string;\n}\n\nexport class Email {\n from = \"\";\n to = [];\n subject: string | Record<string, string> = \"No Subject\";\n cc = [];\n bcc = [];\n attachments = [];\n template: ComponentType<any>;\n headers: Record<string, string> = {};\n\n static async send<T extends Email>(\n this: new () => T,\n args: SendEmailArgs<T[\"template\"] extends (p: infer P) => any ? P : never>,\n ) {\n const instance = new this();\n\n const defaultLocale = I18nServiceContainer.use().service.defaultLocale;\n const emailService = EmailServiceContainer.use().service;\n\n const {\n to = instance.to,\n from = instance.from,\n subject = typeof instance.subject === \"string\"\n ? instance.subject\n : instance.subject[args.locale || defaultLocale],\n cc = instance.cc,\n bcc = instance.bcc,\n attachments = instance.attachments,\n data,\n headers = {},\n } = args;\n\n const _headers = {\n ...(emailService.headers ?? {}),\n ...(instance.headers ?? {}),\n ...(headers ?? {}),\n };\n\n const recipients = await emailService.filterRecipients(to);\n\n if (!recipients.length) {\n return;\n }\n\n const [html, text] = await Promise.all([\n instance.render({\n ...(data as any),\n locale: args.locale,\n }),\n instance.renderText({\n ...(data as any),\n locale: args.locale,\n }),\n ]);\n\n if (process.env.EMAIL_DEBUG === \"true\") {\n const fileName = `${process.env.ROOT_DIR}/.debug/emails/${new Date().toISOString()}${subject}.html`;\n await Bun.write(fileName, html);\n
|
|
5
|
+
"import type { ComponentType } from \"react\";\nimport { render } from \"jsx-email\";\nimport open from \"open\";\nimport { EmailServiceContainer } from \"../services/email/EmailServiceContainer\";\nimport type { SendEmailParams } from \"../services/email/drivers/types\";\nimport { I18nServiceContainer } from \"../i18n/I18nServiceContainer\";\n\ninterface SendEmailArgs<T> extends Partial<Omit<SendEmailParams, \"html\">> {\n data: Omit<T, \"locale\">;\n locale?: string;\n}\n\nexport class Email {\n from = \"\";\n to = [];\n subject: string | Record<string, string> = \"No Subject\";\n cc = [];\n bcc = [];\n attachments = [];\n template: ComponentType<any>;\n headers: Record<string, string> = {};\n\n static async send<T extends Email>(\n this: new () => T,\n args: SendEmailArgs<T[\"template\"] extends (p: infer P) => any ? P : never>,\n ) {\n const instance = new this();\n\n const defaultLocale = I18nServiceContainer.use().service.defaultLocale;\n const emailService = EmailServiceContainer.use().service;\n\n const {\n to = instance.to,\n from = instance.from,\n subject = typeof instance.subject === \"string\"\n ? instance.subject\n : instance.subject[args.locale || defaultLocale],\n cc = instance.cc,\n bcc = instance.bcc,\n attachments = instance.attachments,\n data,\n headers = {},\n } = args;\n\n const _headers = {\n ...(emailService.headers ?? {}),\n ...(instance.headers ?? {}),\n ...(headers ?? {}),\n };\n\n const recipients = await emailService.filterRecipients(to);\n\n if (!recipients.length) {\n return;\n }\n\n const [html, text] = await Promise.all([\n instance.render({\n ...(data as any),\n locale: args.locale,\n }),\n instance.renderText({\n ...(data as any),\n locale: args.locale,\n }),\n ]);\n\n if (process.env.EMAIL_DEBUG === \"true\") {\n const fileName = `${process.env.ROOT_DIR}/.debug/emails/${new Date().toISOString()}${subject}.html`;\n await Bun.write(fileName, html);\n if (process.env.CI !== \"true\") {\n await open(fileName);\n }\n return;\n }\n\n await EmailServiceContainer.use().service.driver.send({\n bcc,\n cc,\n from,\n subject,\n to,\n attachments,\n html,\n headers: _headers,\n text,\n scheduledAt: args.scheduledAt,\n });\n }\n\n static async preview<T extends Email>(\n this: new () => T,\n args: Pick<SendEmailArgs<T[\"template\"] extends (p: infer P) => any ? P : never>, \"data\" | \"locale\">,\n ) {\n\n const instance = new this();\n\n return await instance.render({\n ...args.data,\n locale: args.locale,\n })\n }\n\n protected async render<T extends Record<string, any>>(props: T) {\n const Template = this.template;\n return await render(<Template {...props} />);\n }\n\n protected async renderText<T extends Record<string, any>>(props: T) {\n const Template = this.template;\n return await render(<Template {...props} />, { plainText: true });\n }\n}\n",
|
|
6
|
+
"import process from 'node:process';\nimport {Buffer} from 'node:buffer';\nimport path from 'node:path';\nimport {fileURLToPath} from 'node:url';\nimport {promisify} from 'node:util';\nimport childProcess from 'node:child_process';\nimport fs, {constants as fsConstants} from 'node:fs/promises';\nimport {isWsl, powerShellPath} from 'wsl-utils';\nimport defineLazyProperty from 'define-lazy-prop';\nimport defaultBrowser from 'default-browser';\nimport isInsideContainer from 'is-inside-container';\n\nconst execFile = promisify(childProcess.execFile);\n\n// Path to included `xdg-open`.\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\nconst localXdgOpenPath = path.join(__dirname, 'xdg-open');\n\nconst {platform, arch} = process;\n\n/**\nGet the default browser name in Windows from WSL.\n\n@returns {Promise<string>} Browser name.\n*/\nasync function getWindowsDefaultBrowserFromWsl() {\n\tconst powershellPath = await powerShellPath();\n\tconst rawCommand = String.raw`(Get-ItemProperty -Path \"HKCU:\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice\").ProgId`;\n\tconst encodedCommand = Buffer.from(rawCommand, 'utf16le').toString('base64');\n\n\tconst {stdout} = await execFile(\n\t\tpowershellPath,\n\t\t[\n\t\t\t'-NoProfile',\n\t\t\t'-NonInteractive',\n\t\t\t'-ExecutionPolicy',\n\t\t\t'Bypass',\n\t\t\t'-EncodedCommand',\n\t\t\tencodedCommand,\n\t\t],\n\t\t{encoding: 'utf8'},\n\t);\n\n\tconst progId = stdout.trim();\n\n\t// Map ProgId to browser IDs\n\tconst browserMap = {\n\t\tChromeHTML: 'com.google.chrome',\n\t\tBraveHTML: 'com.brave.Browser',\n\t\tMSEdgeHTM: 'com.microsoft.edge',\n\t\tFirefoxURL: 'org.mozilla.firefox',\n\t};\n\n\treturn browserMap[progId] ? {id: browserMap[progId]} : {};\n}\n\nconst pTryEach = async (array, mapper) => {\n\tlet latestError;\n\n\tfor (const item of array) {\n\t\ttry {\n\t\t\treturn await mapper(item); // eslint-disable-line no-await-in-loop\n\t\t} catch (error) {\n\t\t\tlatestError = error;\n\t\t}\n\t}\n\n\tthrow latestError;\n};\n\n// eslint-disable-next-line complexity\nconst baseOpen = async options => {\n\toptions = {\n\t\twait: false,\n\t\tbackground: false,\n\t\tnewInstance: false,\n\t\tallowNonzeroExitCode: false,\n\t\t...options,\n\t};\n\n\tif (Array.isArray(options.app)) {\n\t\treturn pTryEach(options.app, singleApp => baseOpen({\n\t\t\t...options,\n\t\t\tapp: singleApp,\n\t\t}));\n\t}\n\n\tlet {name: app, arguments: appArguments = []} = options.app ?? {};\n\tappArguments = [...appArguments];\n\n\tif (Array.isArray(app)) {\n\t\treturn pTryEach(app, appName => baseOpen({\n\t\t\t...options,\n\t\t\tapp: {\n\t\t\t\tname: appName,\n\t\t\t\targuments: appArguments,\n\t\t\t},\n\t\t}));\n\t}\n\n\tif (app === 'browser' || app === 'browserPrivate') {\n\t\t// IDs from default-browser for macOS and windows are the same\n\t\tconst ids = {\n\t\t\t'com.google.chrome': 'chrome',\n\t\t\t'google-chrome.desktop': 'chrome',\n\t\t\t'com.brave.Browser': 'brave',\n\t\t\t'org.mozilla.firefox': 'firefox',\n\t\t\t'firefox.desktop': 'firefox',\n\t\t\t'com.microsoft.msedge': 'edge',\n\t\t\t'com.microsoft.edge': 'edge',\n\t\t\t'com.microsoft.edgemac': 'edge',\n\t\t\t'microsoft-edge.desktop': 'edge',\n\t\t};\n\n\t\t// Incognito flags for each browser in `apps`.\n\t\tconst flags = {\n\t\t\tchrome: '--incognito',\n\t\t\tbrave: '--incognito',\n\t\t\tfirefox: '--private-window',\n\t\t\tedge: '--inPrivate',\n\t\t};\n\n\t\tconst browser = isWsl ? await getWindowsDefaultBrowserFromWsl() : await defaultBrowser();\n\t\tif (browser.id in ids) {\n\t\t\tconst browserName = ids[browser.id];\n\n\t\t\tif (app === 'browserPrivate') {\n\t\t\t\tappArguments.push(flags[browserName]);\n\t\t\t}\n\n\t\t\treturn baseOpen({\n\t\t\t\t...options,\n\t\t\t\tapp: {\n\t\t\t\t\tname: apps[browserName],\n\t\t\t\t\targuments: appArguments,\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\n\t\tthrow new Error(`${browser.name} is not supported as a default browser`);\n\t}\n\n\tlet command;\n\tconst cliArguments = [];\n\tconst childProcessOptions = {};\n\n\tif (platform === 'darwin') {\n\t\tcommand = 'open';\n\n\t\tif (options.wait) {\n\t\t\tcliArguments.push('--wait-apps');\n\t\t}\n\n\t\tif (options.background) {\n\t\t\tcliArguments.push('--background');\n\t\t}\n\n\t\tif (options.newInstance) {\n\t\t\tcliArguments.push('--new');\n\t\t}\n\n\t\tif (app) {\n\t\t\tcliArguments.push('-a', app);\n\t\t}\n\t} else if (platform === 'win32' || (isWsl && !isInsideContainer() && !app)) {\n\t\tcommand = await powerShellPath();\n\n\t\tcliArguments.push(\n\t\t\t'-NoProfile',\n\t\t\t'-NonInteractive',\n\t\t\t'-ExecutionPolicy',\n\t\t\t'Bypass',\n\t\t\t'-EncodedCommand',\n\t\t);\n\n\t\tif (!isWsl) {\n\t\t\tchildProcessOptions.windowsVerbatimArguments = true;\n\t\t}\n\n\t\tconst encodedArguments = ['Start'];\n\n\t\tif (options.wait) {\n\t\t\tencodedArguments.push('-Wait');\n\t\t}\n\n\t\tif (app) {\n\t\t\t// Double quote with double quotes to ensure the inner quotes are passed through.\n\t\t\t// Inner quotes are delimited for PowerShell interpretation with backticks.\n\t\t\tencodedArguments.push(`\"\\`\"${app}\\`\"\"`);\n\t\t\tif (options.target) {\n\t\t\t\tappArguments.push(options.target);\n\t\t\t}\n\t\t} else if (options.target) {\n\t\t\tencodedArguments.push(`\"${options.target}\"`);\n\t\t}\n\n\t\tif (appArguments.length > 0) {\n\t\t\tappArguments = appArguments.map(argument => `\"\\`\"${argument}\\`\"\"`);\n\t\t\tencodedArguments.push('-ArgumentList', appArguments.join(','));\n\t\t}\n\n\t\t// Using Base64-encoded command, accepted by PowerShell, to allow special characters.\n\t\toptions.target = Buffer.from(encodedArguments.join(' '), 'utf16le').toString('base64');\n\t} else {\n\t\tif (app) {\n\t\t\tcommand = app;\n\t\t} else {\n\t\t\t// When bundled by Webpack, there's no actual package file path and no local `xdg-open`.\n\t\t\tconst isBundled = !__dirname || __dirname === '/';\n\n\t\t\t// Check if local `xdg-open` exists and is executable.\n\t\t\tlet exeLocalXdgOpen = false;\n\t\t\ttry {\n\t\t\t\tawait fs.access(localXdgOpenPath, fsConstants.X_OK);\n\t\t\t\texeLocalXdgOpen = true;\n\t\t\t} catch {}\n\n\t\t\tconst useSystemXdgOpen = process.versions.electron\n\t\t\t\t?? (platform === 'android' || isBundled || !exeLocalXdgOpen);\n\t\t\tcommand = useSystemXdgOpen ? 'xdg-open' : localXdgOpenPath;\n\t\t}\n\n\t\tif (appArguments.length > 0) {\n\t\t\tcliArguments.push(...appArguments);\n\t\t}\n\n\t\tif (!options.wait) {\n\t\t\t// `xdg-open` will block the process unless stdio is ignored\n\t\t\t// and it's detached from the parent even if it's unref'd.\n\t\t\tchildProcessOptions.stdio = 'ignore';\n\t\t\tchildProcessOptions.detached = true;\n\t\t}\n\t}\n\n\tif (platform === 'darwin' && appArguments.length > 0) {\n\t\tcliArguments.push('--args', ...appArguments);\n\t}\n\n\t// This has to come after `--args`.\n\tif (options.target) {\n\t\tcliArguments.push(options.target);\n\t}\n\n\tconst subprocess = childProcess.spawn(command, cliArguments, childProcessOptions);\n\n\tif (options.wait) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tsubprocess.once('error', reject);\n\n\t\t\tsubprocess.once('close', exitCode => {\n\t\t\t\tif (!options.allowNonzeroExitCode && exitCode > 0) {\n\t\t\t\t\treject(new Error(`Exited with code ${exitCode}`));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tresolve(subprocess);\n\t\t\t});\n\t\t});\n\t}\n\n\tsubprocess.unref();\n\n\treturn subprocess;\n};\n\nconst open = (target, options) => {\n\tif (typeof target !== 'string') {\n\t\tthrow new TypeError('Expected a `target`');\n\t}\n\n\treturn baseOpen({\n\t\t...options,\n\t\ttarget,\n\t});\n};\n\nexport const openApp = (name, options) => {\n\tif (typeof name !== 'string' && !Array.isArray(name)) {\n\t\tthrow new TypeError('Expected a valid `name`');\n\t}\n\n\tconst {arguments: appArguments = []} = options ?? {};\n\tif (appArguments !== undefined && appArguments !== null && !Array.isArray(appArguments)) {\n\t\tthrow new TypeError('Expected `appArguments` as Array type');\n\t}\n\n\treturn baseOpen({\n\t\t...options,\n\t\tapp: {\n\t\t\tname,\n\t\t\targuments: appArguments,\n\t\t},\n\t});\n};\n\nfunction detectArchBinary(binary) {\n\tif (typeof binary === 'string' || Array.isArray(binary)) {\n\t\treturn binary;\n\t}\n\n\tconst {[arch]: archBinary} = binary;\n\n\tif (!archBinary) {\n\t\tthrow new Error(`${arch} is not supported`);\n\t}\n\n\treturn archBinary;\n}\n\nfunction detectPlatformBinary({[platform]: platformBinary}, {wsl}) {\n\tif (wsl && isWsl) {\n\t\treturn detectArchBinary(wsl);\n\t}\n\n\tif (!platformBinary) {\n\t\tthrow new Error(`${platform} is not supported`);\n\t}\n\n\treturn detectArchBinary(platformBinary);\n}\n\nexport const apps = {};\n\ndefineLazyProperty(apps, 'chrome', () => detectPlatformBinary({\n\tdarwin: 'google chrome',\n\twin32: 'chrome',\n\tlinux: ['google-chrome', 'google-chrome-stable', 'chromium'],\n}, {\n\twsl: {\n\t\tia32: '/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe',\n\t\tx64: ['/mnt/c/Program Files/Google/Chrome/Application/chrome.exe', '/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe'],\n\t},\n}));\n\ndefineLazyProperty(apps, 'brave', () => detectPlatformBinary({\n\tdarwin: 'brave browser',\n\twin32: 'brave',\n\tlinux: ['brave-browser', 'brave'],\n}, {\n\twsl: {\n\t\tia32: '/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe',\n\t\tx64: ['/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe', '/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe'],\n\t},\n}));\n\ndefineLazyProperty(apps, 'firefox', () => detectPlatformBinary({\n\tdarwin: 'firefox',\n\twin32: String.raw`C:\\Program Files\\Mozilla Firefox\\firefox.exe`,\n\tlinux: 'firefox',\n}, {\n\twsl: '/mnt/c/Program Files/Mozilla Firefox/firefox.exe',\n}));\n\ndefineLazyProperty(apps, 'edge', () => detectPlatformBinary({\n\tdarwin: 'microsoft edge',\n\twin32: 'msedge',\n\tlinux: ['microsoft-edge', 'microsoft-edge-dev'],\n}, {\n\twsl: '/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe',\n}));\n\ndefineLazyProperty(apps, 'browser', () => 'browser');\n\ndefineLazyProperty(apps, 'browserPrivate', () => 'browserPrivate');\n\nexport default open;\n",
|
|
7
|
+
"import process from 'node:process';\nimport fs, {constants as fsConstants} from 'node:fs/promises';\nimport isWsl from 'is-wsl';\n\nexport const wslDrivesMountPoint = (() => {\n\t// Default value for \"root\" param\n\t// according to https://docs.microsoft.com/en-us/windows/wsl/wsl-config\n\tconst defaultMountPoint = '/mnt/';\n\n\tlet mountPoint;\n\n\treturn async function () {\n\t\tif (mountPoint) {\n\t\t\t// Return memoized mount point value\n\t\t\treturn mountPoint;\n\t\t}\n\n\t\tconst configFilePath = '/etc/wsl.conf';\n\n\t\tlet isConfigFileExists = false;\n\t\ttry {\n\t\t\tawait fs.access(configFilePath, fsConstants.F_OK);\n\t\t\tisConfigFileExists = true;\n\t\t} catch {}\n\n\t\tif (!isConfigFileExists) {\n\t\t\treturn defaultMountPoint;\n\t\t}\n\n\t\tconst configContent = await fs.readFile(configFilePath, {encoding: 'utf8'});\n\t\tconst configMountPoint = /(?<!#.*)root\\s*=\\s*(?<mountPoint>.*)/g.exec(configContent);\n\n\t\tif (!configMountPoint) {\n\t\t\treturn defaultMountPoint;\n\t\t}\n\n\t\tmountPoint = configMountPoint.groups.mountPoint.trim();\n\t\tmountPoint = mountPoint.endsWith('/') ? mountPoint : `${mountPoint}/`;\n\n\t\treturn mountPoint;\n\t};\n})();\n\nexport const powerShellPathFromWsl = async () => {\n\tconst mountPoint = await wslDrivesMountPoint();\n\treturn `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;\n};\n\nexport const powerShellPath = async () => {\n\tif (isWsl) {\n\t\treturn powerShellPathFromWsl();\n\t}\n\n\treturn `${process.env.SYSTEMROOT || process.env.windir || String.raw`C:\\Windows`}\\\\System32\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe`;\n};\n\nexport {default as isWsl} from 'is-wsl';\n",
|
|
8
|
+
"import process from 'node:process';\nimport os from 'node:os';\nimport fs from 'node:fs';\nimport isInsideContainer from 'is-inside-container';\n\nconst isWsl = () => {\n\tif (process.platform !== 'linux') {\n\t\treturn false;\n\t}\n\n\tif (os.release().toLowerCase().includes('microsoft')) {\n\t\tif (isInsideContainer()) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\ttry {\n\t\tif (fs.readFileSync('/proc/version', 'utf8').toLowerCase().includes('microsoft')) {\n\t\t\treturn !isInsideContainer();\n\t\t}\n\t} catch {}\n\n\t// Fallback for custom kernels: check WSL-specific paths.\n\tif (\n\t\tfs.existsSync('/proc/sys/fs/binfmt_misc/WSLInterop')\n\t\t|| fs.existsSync('/run/WSL')\n\t) {\n\t\treturn !isInsideContainer();\n\t}\n\n\treturn false;\n};\n\nexport default process.env.__IS_WSL_TEST__ ? isWsl : isWsl();\n",
|
|
9
|
+
"import fs from 'node:fs';\nimport isDocker from 'is-docker';\n\nlet cachedResult;\n\n// Podman detection\nconst hasContainerEnv = () => {\n\ttry {\n\t\tfs.statSync('/run/.containerenv');\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n};\n\nexport default function isInsideContainer() {\n\t// TODO: Use `??=` when targeting Node.js 16.\n\tif (cachedResult === undefined) {\n\t\tcachedResult = hasContainerEnv() || isDocker();\n\t}\n\n\treturn cachedResult;\n}\n",
|
|
10
|
+
"import fs from 'node:fs';\n\nlet isDockerCached;\n\nfunction hasDockerEnv() {\n\ttry {\n\t\tfs.statSync('/.dockerenv');\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nfunction hasDockerCGroup() {\n\ttry {\n\t\treturn fs.readFileSync('/proc/self/cgroup', 'utf8').includes('docker');\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nexport default function isDocker() {\n\t// TODO: Use `??=` when targeting Node.js 16.\n\tif (isDockerCached === undefined) {\n\t\tisDockerCached = hasDockerEnv() || hasDockerCGroup();\n\t}\n\n\treturn isDockerCached;\n}\n",
|
|
11
|
+
"export default function defineLazyProperty(object, propertyName, valueGetter) {\n\tconst define = value => Object.defineProperty(object, propertyName, {value, enumerable: true, writable: true});\n\n\tObject.defineProperty(object, propertyName, {\n\t\tconfigurable: true,\n\t\tenumerable: true,\n\t\tget() {\n\t\t\tconst result = valueGetter();\n\t\t\tdefine(result);\n\t\t\treturn result;\n\t\t},\n\t\tset(value) {\n\t\t\tdefine(value);\n\t\t}\n\t});\n\n\treturn object;\n}\n",
|
|
12
|
+
"import {promisify} from 'node:util';\nimport process from 'node:process';\nimport {execFile} from 'node:child_process';\nimport defaultBrowserId from 'default-browser-id';\nimport bundleName from 'bundle-name';\nimport windows from './windows.js';\n\nexport {_windowsBrowserProgIdMap} from './windows.js';\n\nconst execFileAsync = promisify(execFile);\n\n// Inlined: https://github.com/sindresorhus/titleize/blob/main/index.js\nconst titleize = string => string.toLowerCase().replaceAll(/(?:^|\\s|-)\\S/g, x => x.toUpperCase());\n\nexport default async function defaultBrowser() {\n\tif (process.platform === 'darwin') {\n\t\tconst id = await defaultBrowserId();\n\t\tconst name = await bundleName(id);\n\t\treturn {name, id};\n\t}\n\n\tif (process.platform === 'linux') {\n\t\tconst {stdout} = await execFileAsync('xdg-mime', ['query', 'default', 'x-scheme-handler/http']);\n\t\tconst id = stdout.trim();\n\t\tconst name = titleize(id.replace(/.desktop$/, '').replace('-', ' '));\n\t\treturn {name, id};\n\t}\n\n\tif (process.platform === 'win32') {\n\t\treturn windows();\n\t}\n\n\tthrow new Error('Only macOS, Linux, and Windows are supported');\n}\n",
|
|
13
|
+
"import {promisify} from 'node:util';\nimport process from 'node:process';\nimport {execFile} from 'node:child_process';\n\nconst execFileAsync = promisify(execFile);\n\nexport default async function defaultBrowserId() {\n\tif (process.platform !== 'darwin') {\n\t\tthrow new Error('macOS only');\n\t}\n\n\tconst {stdout} = await execFileAsync('defaults', ['read', 'com.apple.LaunchServices/com.apple.launchservices.secure', 'LSHandlers']);\n\n\t// `(?!-)` is to prevent matching `LSHandlerRoleAll = \"-\";`.\n\tconst match = /LSHandlerRoleAll = \"(?!-)(?<id>[^\"]+?)\";\\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout);\n\n\tconst browserId = match?.groups.id ?? 'com.apple.Safari';\n\n\t// Correct the case for Safari's bundle identifier\n\tif (browserId === 'com.apple.safari') {\n\t\treturn 'com.apple.Safari';\n\t}\n\n\treturn browserId;\n}\n",
|
|
14
|
+
"import process from 'node:process';\nimport {promisify} from 'node:util';\nimport {execFile, execFileSync} from 'node:child_process';\n\nconst execFileAsync = promisify(execFile);\n\nexport async function runAppleScript(script, {humanReadableOutput = true, signal} = {}) {\n\tif (process.platform !== 'darwin') {\n\t\tthrow new Error('macOS only');\n\t}\n\n\tconst outputArguments = humanReadableOutput ? [] : ['-ss'];\n\n\tconst execOptions = {};\n\tif (signal) {\n\t\texecOptions.signal = signal;\n\t}\n\n\tconst {stdout} = await execFileAsync('osascript', ['-e', script, outputArguments], execOptions);\n\treturn stdout.trim();\n}\n\nexport function runAppleScriptSync(script, {humanReadableOutput = true} = {}) {\n\tif (process.platform !== 'darwin') {\n\t\tthrow new Error('macOS only');\n\t}\n\n\tconst outputArguments = humanReadableOutput ? [] : ['-ss'];\n\n\tconst stdout = execFileSync('osascript', ['-e', script, ...outputArguments], {\n\t\tencoding: 'utf8',\n\t\tstdio: ['ignore', 'pipe', 'ignore'],\n\t\ttimeout: 500,\n\t});\n\n\treturn stdout.trim();\n}\n",
|
|
15
|
+
"import {runAppleScript} from 'run-applescript';\n\nexport default async function bundleName(bundleId) {\n\treturn runAppleScript(`tell application \"Finder\" to set app_path to application file id \"${bundleId}\" as string\\ntell application \"System Events\" to get value of property list item \"CFBundleName\" of property list file (app_path & \":Contents:Info.plist\")`);\n}\n",
|
|
16
|
+
"import {promisify} from 'node:util';\nimport {execFile} from 'node:child_process';\n\nconst execFileAsync = promisify(execFile);\n\n// TODO: Fix the casing of bundle identifiers in the next major version.\n\n// Windows doesn't have browser IDs in the same way macOS/Linux does so we give fake\n// ones that look real and match the macOS/Linux versions for cross-platform apps.\nconst windowsBrowserProgIds = {\n\tMSEdgeHTM: {name: 'Edge', id: 'com.microsoft.edge'}, // The missing `L` is correct.\n\tMSEdgeBHTML: {name: 'Edge Beta', id: 'com.microsoft.edge.beta'},\n\tMSEdgeDHTML: {name: 'Edge Dev', id: 'com.microsoft.edge.dev'},\n\tAppXq0fevzme2pys62n3e0fbqa7peapykr8v: {name: 'Edge', id: 'com.microsoft.edge.old'},\n\tChromeHTML: {name: 'Chrome', id: 'com.google.chrome'},\n\tChromeBHTML: {name: 'Chrome Beta', id: 'com.google.chrome.beta'},\n\tChromeDHTML: {name: 'Chrome Dev', id: 'com.google.chrome.dev'},\n\tChromiumHTM: {name: 'Chromium', id: 'org.chromium.Chromium'},\n\tBraveHTML: {name: 'Brave', id: 'com.brave.Browser'},\n\tBraveBHTML: {name: 'Brave Beta', id: 'com.brave.Browser.beta'},\n\tBraveDHTML: {name: 'Brave Dev', id: 'com.brave.Browser.dev'},\n\tBraveSSHTM: {name: 'Brave Nightly', id: 'com.brave.Browser.nightly'},\n\tFirefoxURL: {name: 'Firefox', id: 'org.mozilla.firefox'},\n\tOperaStable: {name: 'Opera', id: 'com.operasoftware.Opera'},\n\tVivaldiHTM: {name: 'Vivaldi', id: 'com.vivaldi.Vivaldi'},\n\t'IE.HTTP': {name: 'Internet Explorer', id: 'com.microsoft.ie'},\n};\n\nexport const _windowsBrowserProgIdMap = new Map(Object.entries(windowsBrowserProgIds));\n\nexport class UnknownBrowserError extends Error {}\n\nexport default async function defaultBrowser(_execFileAsync = execFileAsync) {\n\tconst {stdout} = await _execFileAsync('reg', [\n\t\t'QUERY',\n\t\t' HKEY_CURRENT_USER\\\\Software\\\\Microsoft\\\\Windows\\\\Shell\\\\Associations\\\\UrlAssociations\\\\http\\\\UserChoice',\n\t\t'/v',\n\t\t'ProgId',\n\t]);\n\n\tconst match = /ProgId\\s*REG_SZ\\s*(?<id>\\S+)/.exec(stdout);\n\tif (!match) {\n\t\tthrow new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout)}`);\n\t}\n\n\tconst {id} = match.groups;\n\n\t// Windows can append a hash suffix to ProgIds using a dot or hyphen\n\t// (e.g., `ChromeHTML.ABC123`, `FirefoxURL-6F193CCC56814779`).\n\t// Try exact match first, then try without the suffix.\n\tconst dotIndex = id.lastIndexOf('.');\n\tconst hyphenIndex = id.lastIndexOf('-');\n\tconst baseIdByDot = dotIndex === -1 ? undefined : id.slice(0, dotIndex);\n\tconst baseIdByHyphen = hyphenIndex === -1 ? undefined : id.slice(0, hyphenIndex);\n\n\treturn windowsBrowserProgIds[id] ?? windowsBrowserProgIds[baseIdByDot] ?? windowsBrowserProgIds[baseIdByHyphen] ?? {name: id, id};\n}\n"
|
|
6
17
|
],
|
|
7
|
-
"mappings": ";4JACA,YAAS,
|
|
8
|
-
"debugId": "
|
|
18
|
+
"mappings": ";4JACA,YAAS,aCDT,kBACA,iBAAQ,eACR,oBACA,wB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KACrB,GAAW,CAAC,CAClB,EAIA,GAAI,EAFe,MAAM,EAAa,iBAAiB,CAAE,GAEzC,OACd,OAGF,IAAO,EAAM,IAAQ,MAAM,QAAQ,IAAI,CACrC,EAAS,OAAO,IACV,EACJ,OAAQ,EAAK,MACf,CAAC,EACD,EAAS,WAAW,IACd,EACJ,OAAQ,EAAK,MACf,CAAC,CACH,CAAC,EAED,GAAI,QAAQ,IAAI,cAAgB,OAAQ,CACtC,IAAM,EAAW,GAAG,QAAQ,IAAI,0BAA0B,IAAI,KAAK,EAAE,YAAY,IAAI,SAErF,GADA,MAAM,IAAI,MAAM,EAAU,CAAI,EAC1B,QAAQ,IAAI,KAAO,OACrB,MAAM,EAAK,CAAQ,EAErB,OAGF,MAAM,EAAsB,IAAI,EAAE,QAAQ,OAAO,KAAK,CACpD,MACA,KACA,OACA,UACA,KACA,cACA,OACA,QAAS,GACT,QACA,YAAa,EAAK,WACpB,CAAC,cAGU,QAAwB,CAEnC,EACA,CAIA,OAAO,MAFU,IAAI,KAAK,EAEJ,OAAO,IACxB,EAAK,KACR,OAAQ,EAAK,MACf,CAAC,OAGa,OAAqC,CAAC,EAAU,CAC9D,IAAM,EAAW,KAAK,SACtB,OAAO,MAAM,EAAO,EAAC,EAAD,IAAc,EAAO,CAAE,OAG7B,WAAyC,CAAC,EAAU,CAClE,IAAM,EAAW,KAAK,SACtB,OAAO,MAAM,EAAO,EAAC,EAAD,IAAc,EAAO,EAAI,CAAE,UAAW,EAAK,CAAC,EAEpE",
|
|
19
|
+
"debugId": "E1ED8C323A76619C64756E2164756E21",
|
|
9
20
|
"names": []
|
|
10
21
|
}
|
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-gsvzrj5r.js";import"../chunk-pjgfvdr6.js";import"../chunk-yeqwzeq7.js";import"../chunk-sbmg0hfr.js";import"../chunk-b3qebxqh.js";import"../chunk-n1xpxhm0.js";import"../chunk-bfnh3gwv.js";import{Vb as S}from"../chunk-cwq1vdcb.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-gsvzrj5r.js";import"../chunk-pjgfvdr6.js";import"../chunk-yeqwzeq7.js";import"../chunk-sbmg0hfr.js";import"../chunk-b3qebxqh.js";import"../chunk-n1xpxhm0.js";import"../chunk-bfnh3gwv.js";import{Vb as S}from"../chunk-cwq1vdcb.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-v3agzap3.js");await f(this.app,this.instrumentation.bind(this))}else{g();let{httpDev:f}=await import("../chunk-54wqarj8.js");await f(this.app,this.instrumentation.bind(this))}}}export{i as Server};
|
|
3
3
|
|
|
4
4
|
//# debugId=4B643978D79229AA64756E2164756E21
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|