gemi 0.95.0 → 0.96.0
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/ai/index.js +2 -2
- package/dist/ai/index.js.map +1 -1
- package/dist/app/index.js +1 -1
- package/dist/bun/plugin.js +1 -1
- package/dist/bun/preload.js +1 -1
- package/dist/{chunk-p3mdtnvv.js → chunk-1pbwrzwp.js} +2 -2
- package/dist/{chunk-j2nx0dtq.js.map → chunk-1pbwrzwp.js.map} +1 -1
- package/dist/{chunk-qqev9e50.js → chunk-1vs4xhcg.js} +2 -2
- package/dist/{chunk-qqev9e50.js.map → chunk-1vs4xhcg.js.map} +1 -1
- package/dist/{chunk-7dnb21s9.js → chunk-2tm56xq1.js} +2 -2
- package/dist/{chunk-7dnb21s9.js.map → chunk-2tm56xq1.js.map} +1 -1
- package/dist/{chunk-j9x86xsc.js → chunk-3tn480wt.js} +2 -2
- package/dist/{chunk-j9x86xsc.js.map → chunk-3tn480wt.js.map} +1 -1
- package/dist/{chunk-7hfv5n00.js → chunk-48dek9s7.js} +3 -3
- package/dist/{chunk-7hfv5n00.js.map → chunk-48dek9s7.js.map} +1 -1
- package/dist/{chunk-b8m6zs7e.js → chunk-4qjy1bts.js} +2 -2
- package/dist/{chunk-b8m6zs7e.js.map → chunk-4qjy1bts.js.map} +1 -1
- package/dist/{chunk-7s5nh5mx.js → chunk-4rns9cnb.js} +2 -2
- package/dist/{chunk-7s5nh5mx.js.map → chunk-4rns9cnb.js.map} +1 -1
- package/dist/{chunk-1hnpr3xt.js → chunk-5wgx5n2q.js} +2 -2
- package/dist/{chunk-1hnpr3xt.js.map → chunk-5wgx5n2q.js.map} +1 -1
- package/dist/{chunk-xtqxy492.js → chunk-6397mbr2.js} +3 -3
- package/dist/{chunk-xtqxy492.js.map → chunk-6397mbr2.js.map} +1 -1
- package/dist/{chunk-tcefqn3d.js → chunk-63cp4s8g.js} +2 -2
- package/dist/{chunk-tcefqn3d.js.map → chunk-63cp4s8g.js.map} +1 -1
- package/dist/{chunk-56gce2z7.js → chunk-64j3yef2.js} +2 -2
- package/dist/{chunk-56gce2z7.js.map → chunk-64j3yef2.js.map} +1 -1
- package/dist/{chunk-j2nx0dtq.js → chunk-68zf43ah.js} +2 -2
- package/dist/{chunk-p3mdtnvv.js.map → chunk-68zf43ah.js.map} +1 -1
- package/dist/{chunk-7ktsceyz.js → chunk-69yw2pb1.js} +2 -2
- package/dist/{chunk-7ktsceyz.js.map → chunk-69yw2pb1.js.map} +1 -1
- package/dist/{chunk-x24davqq.js → chunk-6abjjfjr.js} +2 -2
- package/dist/{chunk-x24davqq.js.map → chunk-6abjjfjr.js.map} +1 -1
- package/dist/{chunk-z9ydpvc8.js → chunk-77kw61f4.js} +2 -2
- package/dist/{chunk-z9ydpvc8.js.map → chunk-77kw61f4.js.map} +1 -1
- package/dist/{chunk-h24rv10h.js → chunk-7fn3wwyq.js} +2 -2
- package/dist/{chunk-h24rv10h.js.map → chunk-7fn3wwyq.js.map} +1 -1
- package/dist/{chunk-mf936r5e.js → chunk-7keqx61j.js} +2 -2
- package/dist/{chunk-mf936r5e.js.map → chunk-7keqx61j.js.map} +1 -1
- package/dist/{chunk-jrp35qrk.js → chunk-80t4tfke.js} +1 -1
- package/dist/{chunk-323715e8.js → chunk-8ma08vxq.js} +2 -2
- package/dist/{chunk-323715e8.js.map → chunk-8ma08vxq.js.map} +1 -1
- package/dist/{chunk-nqabsqty.js → chunk-99wzvsz5.js} +4 -4
- package/dist/{chunk-nqabsqty.js.map → chunk-99wzvsz5.js.map} +1 -1
- package/dist/{chunk-2jse74pn.js → chunk-a9nxjfdy.js} +2 -2
- package/dist/{chunk-2jse74pn.js.map → chunk-a9nxjfdy.js.map} +1 -1
- package/dist/{chunk-2yyr5tdc.js → chunk-aa13sgs2.js} +1 -1
- package/dist/{chunk-jxhznqhe.js → chunk-bf1q3m7a.js} +2 -2
- package/dist/{chunk-jxhznqhe.js.map → chunk-bf1q3m7a.js.map} +1 -1
- package/dist/{chunk-3fjkbcra.js → chunk-bvsevtpp.js} +1 -1
- package/dist/{chunk-nfhy3sp8.js → chunk-c0k26g4n.js} +2 -2
- package/dist/{chunk-nfhy3sp8.js.map → chunk-c0k26g4n.js.map} +1 -1
- package/dist/{chunk-ssqxzcad.js → chunk-c9vga0sk.js} +3 -3
- package/dist/{chunk-ssqxzcad.js.map → chunk-c9vga0sk.js.map} +1 -1
- package/dist/{chunk-w98tp5fa.js → chunk-cp8gxeqs.js} +2 -2
- package/dist/{chunk-w98tp5fa.js.map → chunk-cp8gxeqs.js.map} +1 -1
- package/dist/{chunk-5en4ydde.js → chunk-dn2mw39y.js} +2 -2
- package/dist/{chunk-5en4ydde.js.map → chunk-dn2mw39y.js.map} +1 -1
- package/dist/{chunk-qxda7pzm.js → chunk-f6s7ddjz.js} +2 -2
- package/dist/{chunk-qxda7pzm.js.map → chunk-f6s7ddjz.js.map} +1 -1
- package/dist/chunk-f9t39vwk.js +5 -0
- package/dist/chunk-f9t39vwk.js.map +10 -0
- package/dist/{chunk-fq03tz45.js → chunk-gykbgtvg.js} +2 -2
- package/dist/{chunk-fq03tz45.js.map → chunk-gykbgtvg.js.map} +1 -1
- package/dist/{chunk-mym0zxxp.js → chunk-h15bd9vn.js} +2 -2
- package/dist/{chunk-mym0zxxp.js.map → chunk-h15bd9vn.js.map} +1 -1
- package/dist/{chunk-38k1kjyb.js → chunk-hsec03gh.js} +2 -2
- package/dist/{chunk-38k1kjyb.js.map → chunk-hsec03gh.js.map} +1 -1
- package/dist/{chunk-2shkf2gs.js → chunk-jhaeemjf.js} +2 -2
- package/dist/{chunk-2shkf2gs.js.map → chunk-jhaeemjf.js.map} +1 -1
- package/dist/{chunk-bk4f99s4.js → chunk-jv38q9n7.js} +2 -2
- package/dist/{chunk-bk4f99s4.js.map → chunk-jv38q9n7.js.map} +1 -1
- package/dist/{chunk-fyxp4bn0.js → chunk-kcp39g56.js} +2 -2
- package/dist/{chunk-fyxp4bn0.js.map → chunk-kcp39g56.js.map} +1 -1
- package/dist/{chunk-qj5ts9d5.js → chunk-msg6re1f.js} +2 -2
- package/dist/{chunk-qj5ts9d5.js.map → chunk-msg6re1f.js.map} +1 -1
- package/dist/{chunk-kzh8bkg5.js → chunk-n63xjrck.js} +2 -2
- package/dist/{chunk-kzh8bkg5.js.map → chunk-n63xjrck.js.map} +1 -1
- package/dist/{chunk-9g5cpkkk.js → chunk-nffk2cj3.js} +2 -2
- package/dist/{chunk-9g5cpkkk.js.map → chunk-nffk2cj3.js.map} +1 -1
- package/dist/{chunk-z16nyxb8.js → chunk-np5b3cd7.js} +2 -2
- package/dist/{chunk-z16nyxb8.js.map → chunk-np5b3cd7.js.map} +1 -1
- package/dist/{chunk-twhf7w1x.js → chunk-pjg7gqnh.js} +1 -1
- package/dist/{chunk-f6veb369.js → chunk-prg5k57m.js} +2 -2
- package/dist/{chunk-f6veb369.js.map → chunk-prg5k57m.js.map} +1 -1
- package/dist/chunk-qttatc7h.js +5 -0
- package/dist/chunk-qttatc7h.js.map +12 -0
- package/dist/chunk-rc4z7ykq.js +17 -0
- package/dist/{chunk-ykbehyp9.js.map → chunk-rc4z7ykq.js.map} +4 -4
- package/dist/{chunk-5px4rkzf.js → chunk-shb51m4y.js} +2 -2
- package/dist/{chunk-5px4rkzf.js.map → chunk-shb51m4y.js.map} +1 -1
- package/dist/{chunk-8g99gnsd.js → chunk-snz7nze3.js} +2 -2
- package/dist/{chunk-8g99gnsd.js.map → chunk-snz7nze3.js.map} +1 -1
- package/dist/{chunk-qpek76vn.js → chunk-tymhsmgq.js} +3 -3
- package/dist/{chunk-qpek76vn.js.map → chunk-tymhsmgq.js.map} +1 -1
- package/dist/{chunk-f6e2t4vb.js → chunk-xf9axxzx.js} +3 -3
- package/dist/{chunk-f6e2t4vb.js.map → chunk-xf9axxzx.js.map} +1 -1
- package/dist/{chunk-et6thczw.js → chunk-xmjhensy.js} +2 -2
- package/dist/{chunk-et6thczw.js.map → chunk-xmjhensy.js.map} +1 -1
- package/dist/{chunk-37jb6q13.js → chunk-xp6nr441.js} +2 -2
- package/dist/{chunk-37jb6q13.js.map → chunk-xp6nr441.js.map} +1 -1
- package/dist/{chunk-bedkys40.js → chunk-y4fp0eg9.js} +2 -2
- package/dist/{chunk-bedkys40.js.map → chunk-y4fp0eg9.js.map} +1 -1
- package/dist/chunk-yhkffean.js +5 -0
- package/dist/{chunk-dhe96f7z.js.map → chunk-yhkffean.js.map} +1 -1
- package/dist/{chunk-qz2p0hv5.js → chunk-yk2mtcwv.js} +2 -2
- package/dist/{chunk-qz2p0hv5.js.map → chunk-yk2mtcwv.js.map} +1 -1
- package/dist/{chunk-zyw42zny.js → chunk-z8jf7jwg.js} +2 -2
- package/dist/{chunk-zyw42zny.js.map → chunk-z8jf7jwg.js.map} +1 -1
- package/dist/chunks/{ThemeProvider-z_MW40tl.js → ThemeProvider-Cqfwr6dk.js} +2 -2
- package/dist/chunks/ThemeProvider-Cqfwr6dk.js.map +1 -0
- package/dist/chunks/useParams-BN3XXfmG.js.map +1 -1
- package/dist/client/I18nContext.d.ts.map +1 -1
- package/dist/client/RouteStateContext.d.ts +3 -0
- package/dist/client/RouteStateContext.d.ts.map +1 -1
- package/dist/client/ServerDataProvider.d.ts +2 -0
- package/dist/client/ServerDataProvider.d.ts.map +1 -1
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +118 -2
- package/dist/client/index.js.map +1 -1
- package/dist/client/useDictionary.d.ts +5 -0
- package/dist/client/useDictionary.d.ts.map +1 -1
- package/dist/client/useFormatter.d.ts +24 -0
- package/dist/client/useFormatter.d.ts.map +1 -0
- package/dist/client/useRouteData.d.ts +2 -0
- package/dist/client/useRouteData.d.ts.map +1 -1
- package/dist/config/index.js +1 -1
- package/dist/console/run.js +2 -2
- package/dist/console/run.js.map +1 -1
- package/dist/container/index.js +2 -2
- package/dist/container/index.js.map +1 -1
- package/dist/database/index.js +1 -1
- package/dist/email/index.js +2 -2
- package/dist/email/index.js.map +1 -1
- package/dist/facades/Lang.d.ts +19 -0
- package/dist/facades/Lang.d.ts.map +1 -1
- package/dist/facades/index.js +1 -1
- package/dist/foundation/index.js +2 -2
- package/dist/foundation/index.js.map +1 -1
- package/dist/http/index.js +1 -1
- package/dist/i18n/Translator.d.ts +17 -0
- package/dist/i18n/Translator.d.ts.map +1 -1
- package/dist/i18n/config.d.ts +15 -0
- package/dist/i18n/config.d.ts.map +1 -1
- package/dist/i18n/dictionaryRuntime.js +1 -1
- package/dist/i18n/formatter.d.ts +52 -0
- package/dist/i18n/formatter.d.ts.map +1 -0
- package/dist/i18n/index.d.ts +1 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +2 -2
- package/dist/i18n/index.js.map +2 -2
- package/dist/kernel/index.js +2 -2
- package/dist/kernel/index.js.map +1 -1
- package/dist/orm/index.js +2 -2
- package/dist/orm/index.js.map +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/index.js.map +1 -1
- package/dist/services/index.js +2 -2
- package/dist/services/index.js.map +1 -1
- package/dist/services/queue/work.js +2 -2
- package/dist/services/queue/work.js.map +1 -1
- package/dist/services/router/ViewRouteDispatcher.d.ts.map +1 -1
- package/dist/support/index.js +2 -2
- package/dist/support/index.js.map +1 -1
- package/dist/testing/Page.d.ts +2 -0
- package/dist/testing/Page.d.ts.map +1 -1
- package/dist/testing/index.js +10 -4
- package/dist/testing/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/gemi-react-best-practices/SKILL.md +1 -0
- package/skills/gemi-react-best-practices/rules/i18n-format-with-use-formatter.md +41 -0
- package/dist/chunk-dhe96f7z.js +0 -5
- package/dist/chunk-m3z60v9d.js +0 -5
- package/dist/chunk-m3z60v9d.js.map +0 -11
- package/dist/chunk-safv6h9x.js +0 -5
- package/dist/chunk-safv6h9x.js.map +0 -10
- package/dist/chunk-ykbehyp9.js +0 -17
- package/dist/chunks/ThemeProvider-z_MW40tl.js.map +0 -1
- /package/dist/{chunk-jrp35qrk.js.map → chunk-80t4tfke.js.map} +0 -0
- /package/dist/{chunk-2yyr5tdc.js.map → chunk-aa13sgs2.js.map} +0 -0
- /package/dist/{chunk-3fjkbcra.js.map → chunk-bvsevtpp.js.map} +0 -0
- /package/dist/{chunk-twhf7w1x.js.map → chunk-pjg7gqnh.js.map} +0 -0
|
@@ -29,6 +29,11 @@ type ParamsOrNever<T> = T extends Record<string, never> ? [params?: never] : [pa
|
|
|
29
29
|
export declare function useDictionary<const T extends DictionaryTranslations>(dictionary: DictionaryHandle<T>): {
|
|
30
30
|
<K extends keyof T & string, U extends T[K] = T[K]>(key: K, ...args: ParamsOrNever<Parser<U extends Record<string, string> ? U : never>>): string;
|
|
31
31
|
jsx<K extends keyof T & string, U extends T[K] = T[K]>(key: K, ...args: ParamsOrNever<Parser<U extends Record<string, string> ? U : never>>): JSX.Element;
|
|
32
|
+
/**
|
|
33
|
+
* Formatting in this dictionary's locale and the app's time zone. See
|
|
34
|
+
* `useFormatter`.
|
|
35
|
+
*/
|
|
36
|
+
format: import("gemi/client").Formatter;
|
|
32
37
|
};
|
|
33
38
|
export {};
|
|
34
39
|
//# sourceMappingURL=useDictionary.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDictionary.d.ts","sourceRoot":"","sources":["../../client/useDictionary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEtE,OAAO,KAAK,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"useDictionary.d.ts","sourceRoot":"","sources":["../../client/useDictionary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC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|
+
import { type Formatter } from "../i18n/formatter";
|
|
2
|
+
/**
|
|
3
|
+
* Format dates, numbers, relative times and lists in the active locale and the
|
|
4
|
+
* app's time zone.
|
|
5
|
+
*
|
|
6
|
+
* ```tsx
|
|
7
|
+
* const format = useFormatter();
|
|
8
|
+
* format.date(order.createdAt, { dateStyle: "long" });
|
|
9
|
+
* format.number(1199.88, { style: "currency", currency: "USD" });
|
|
10
|
+
* format.date(order.createdAt, { timeZone: "Europe/Istanbul" }); // per call
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* The locale and zone both come from the page payload, so the server render
|
|
14
|
+
* and the hydrating browser format with the same ones. Prefer this to
|
|
15
|
+
* `toLocaleDateString()`, which uses the runtime's locale and zone and so
|
|
16
|
+
* differs between the two.
|
|
17
|
+
*
|
|
18
|
+
* Pass `options` to pin a zone for one subtree (`useFormatter({ timeZone })`).
|
|
19
|
+
*/
|
|
20
|
+
export declare function useFormatter(options?: {
|
|
21
|
+
locale?: string;
|
|
22
|
+
timeZone?: string;
|
|
23
|
+
}): Formatter;
|
|
24
|
+
//# sourceMappingURL=useFormatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormatter.d.ts","sourceRoot":"","sources":["../../client/useFormatter.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,mBAAmB,CAAC;AAG3B;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAC1B,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,GACnD,SAAS,CAeX"}
|
|
@@ -4,6 +4,8 @@ export declare function useRouteData(): {
|
|
|
4
4
|
currentLocale: string;
|
|
5
5
|
dictionary: Record<string, Record<string, unknown>>;
|
|
6
6
|
supportedLocales: string[];
|
|
7
|
+
defaultLocale?: string;
|
|
8
|
+
timeZone?: string;
|
|
7
9
|
};
|
|
8
10
|
prefetchedData: Record<string, unknown>;
|
|
9
11
|
breadcrumbs: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRouteData.d.ts","sourceRoot":"","sources":["../../client/useRouteData.ts"],"names":[],"mappings":"AAGA,wBAAgB,YAAY
|
|
1
|
+
{"version":3,"file":"useRouteData.d.ts","sourceRoot":"","sources":["../../client/useRouteData.ts"],"names":[],"mappings":"AAGA,wBAAgB,YAAY;;;;;;;;;;;EAK3B"}
|
package/dist/config/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"../chunk-
|
|
2
|
+
import"../chunk-68zf43ah.js";function k(b){return b}function q(b){if((process.env.GEMI_REACT_COMPILER??"auto").toLowerCase()==="off")return!1;return b??!0}export{q as reactCompiler,k as defineConfig};
|
|
3
3
|
|
|
4
4
|
//# debugId=2F7F86887FCF6F1A64756E2164756E21
|
package/dist/console/run.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Xa as A,Ya as l}from"../chunk-zytmxty5.js";import{Eb as q,Hb as m,Rb as p}from"../chunk-
|
|
2
|
+
import{Xa as A,Ya as l}from"../chunk-zytmxty5.js";import{Eb as q,Hb as m,Rb as p}from"../chunk-3tn480wt.js";import"../chunk-z8jf7jwg.js";import"../chunk-br9p390p.js";import"../chunk-n4807648.js";import"../chunk-ghz3e8b7.js";import{vg as u}from"../chunk-3fr22rtg.js";import"../chunk-48dek9s7.js";import"../chunk-f6s7ddjz.js";import"../chunk-xmjhensy.js";import{Ug as c}from"../chunk-n63xjrck.js";import"../chunk-68zf43ah.js";function F(){let z=Promise.resolve(),M=Promise.resolve(),X=(Q,G)=>new Promise(($)=>{Q.write(G,()=>$())});return{stdout:(Q)=>{z=X(process.stdout,Q)},stderr:(Q)=>{M=X(process.stderr,Q)},flush:async()=>{await Promise.all([z,M])}}}function b(z){let M=z.writers??F();return{args:z.args,options:z.options,argv:z.argv,line:(X="")=>M.stdout(`${X}
|
|
3
3
|
`),error:(X)=>M.stderr(`${X}
|
|
4
4
|
`),fail:(X,Q=1)=>{throw new q(X,Q)}}}import w from"path";function V(z){return z.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").toLowerCase()}function t(z){let M=new Map,X=new Map;for(let Q of z){M.set(V(Q.name),Q),M.set(Q.name,Q);let G="alias"in Q?Q.alias:void 0;if(G)X.set(G,Q)}return{byName:M,byAlias:X}}function x(z){if(z==="--")return!0;if(!z.startsWith("-"))return!1;if(z==="-")return!1;if(/^-(\d|\.\d)/.test(z))return!1;return!0}function k(z,M){let{byName:X,byAlias:Q}=t(z.options),G=[],$=[],Z=new Map,S=!X.has("help"),C=!Q.has("h"),P=!1,D=!1,I=(J)=>G.push(`Unknown option ${J} for command "${z.commandName}".`),T=(J,Y)=>{if(Y==="--help"||Y==="-h")D=!0;G.push(Y===void 0?`Option ${J} needs a value.`:`Option ${J} needs a value, but the next token is ${JSON.stringify(Y)}, which is another option. If that really is the value, write ${J}=${Y}.`)},_=0;while(_<M.length){let J=M[_];if(J==="--"){$.push(...M.slice(_+1));break}if(J.startsWith("--")){let Y=J.slice(2),j=Y.indexOf("="),B=j===-1?Y:Y.slice(0,j),K=j===-1?void 0:Y.slice(j+1),H=X.get(B),E=!1;if(!H&&B.startsWith("no-")){let W=X.get(B.slice(3));if(W&&W.type==="boolean")H=W,E=!0}if(!H&&B==="help"&&S){P=!0,_+=1;continue}if(!H){I(`--${B}`),_+=1;continue}if(H.type==="boolean"){if(K!==void 0&&K!=="true"&&K!=="false")G.push(`Option --${V(H.name)} is a flag and takes no value, but got ${JSON.stringify(K)}.`);else{let W=K===void 0?!0:K==="true";Z.set(H.name,E?!W:W)}_+=1;continue}if(K!==void 0){Z.set(H.name,K),_+=1;continue}let U=M[_+1];if(U===void 0||x(U)){T(`--${V(H.name)}`,U),_+=1;continue}Z.set(H.name,U),_+=2;continue}if(J.startsWith("-")&&J.length>1){let Y=J.slice(1),j=!1;for(let B=0;B<Y.length;B+=1){let K=Q.get(Y[B]);if(!K){if(Y[B]==="h"&&C){P=!0;continue}I(`-${Y[B]}`);break}if(K.type==="boolean"){Z.set(K.name,!0);continue}let H=Y.slice(B+1),E=H.startsWith("=")?H.slice(1):H;if(E!==""){Z.set(K.name,E);break}let U=M[_+1];if(U===void 0||x(U)){T(`-${K.alias}`,U);break}Z.set(K.name,U),j=!0;break}_+=j?2:1;continue}$.push(J),_+=1}let L={},O=0;for(let J of z.args){if(J.variadic){let j=$.slice(O);if(O=$.length,L[J.name]=j,J.required&&j.length===0)G.push(`Missing required argument <${J.name}...>. Command "${z.commandName}" needs at least one.`);continue}let Y=$[O];if(O+=1,Y!==void 0){L[J.name]=Y;continue}if(J.default!==void 0){L[J.name]=J.default;continue}if(J.required)G.push(`Missing required argument <${J.name}>.`);L[J.name]=void 0}if(O<$.length){let J=$.slice(O);G.push(`Unexpected argument${J.length===1?"":"s"} ${J.map((Y)=>JSON.stringify(Y)).join(", ")}. Command "${z.commandName}" takes ${z.args.length} argument${z.args.length===1?"":"s"}.`)}let R={};for(let J of z.options){let Y=Z.get(J.name);if(J.type==="boolean"){R[J.name]=Y===void 0?J.default??!1:Boolean(Y);continue}if(Y===void 0){if(J.default!==void 0)R[J.name]=J.default;else if(J.required)G.push(`Missing required option --${V(J.name)}.`),R[J.name]=void 0;else R[J.name]=void 0;continue}let j=String(Y);if(J.type==="number"){let B=Number(j);if(j.trim()===""||!Number.isFinite(B))G.push(`Option --${V(J.name)} expects a number, but got ${JSON.stringify(j)}.`),R[J.name]=void 0;else R[J.name]=B;continue}R[J.name]=j}let N=P&&!D;if(G.length>0)return{ok:!1,help:N,errors:G};return{ok:!0,help:N,args:L,options:R}}function f(z,M=" "){let X=z.reduce((Q,[G])=>Math.max(Q,G.length),0);return z.map(([Q,G])=>G===""?`${M}${Q}`:`${M}${Q.padEnd(X)} ${G}`)}function g(z){let M=z.variadic?`${z.name}...`:z.name;return z.required?`<${M}>`:`[${M}]`}function s(z){let M=(G)=>z.options.some(G),X=M((G)=>G.name==="help"||V(G.name)==="help"),Q=M((G)=>("alias"in G)&&G.alias==="h");if(X&&Q)return[];if(X)return[["-h","Show this message"]];return[[`${Q?"":"-h, "}--help`,"Show this message"]]}function v(z){let M=[],X=z.args.map(g).join(" "),Q=["gemi run",z.commandName,z.options.length>0?"[options]":"",X].filter(Boolean).join(" ");if(M.push(`Usage: ${Q}`),z.description)M.push("",z.description);if(z.args.length>0)M.push("","Arguments:"),M.push(...f(z.args.map((G)=>{let $=[G.description??"",G.default!==void 0?`(default: ${JSON.stringify(G.default)})`:""].filter(Boolean).join(" ");return[g(G),$]})));return M.push("","Options:"),M.push(...f([...z.options.map((G)=>{let $="alias"in G&&G.alias?`-${G.alias}, `:"",Z=G.type==="boolean"?"":` <${G.type}>`,S=[G.description??"",G.default!==void 0?`(default: ${JSON.stringify(G.default)})`:"","required"in G&&G.required?"(required)":""].filter(Boolean).join(" ");return[`${$}--${V(G.name)}${Z}`,S]}),...s(z)])),M.join(`
|
|
5
5
|
`)}function y(z,M){let X=M.declared?`${z.length} command${z.length===1?"":"s"} declared in app/config/command.ts:`:`Commands in ${M.dir}:`;if(z.length===0)return M.declared?`app/config/command.ts declares no commands.
|
|
@@ -13,4 +13,4 @@ A command is registered by existing: write a file there that exports a \`defineC
|
|
|
13
13
|
${Q.message}
|
|
14
14
|
\`gemi run\` boots your application the way the server does, so it needs the Kernel. Run it from the root of a gemi project.`,{cause:Q})}if(typeof X.default!=="function")throw new A(`${M} has no default export. gemi expects the Kernel subclass to be the default export of that file.`);return new X.default}function h(z,M,X,Q="returned"){if(z===void 0||z===null)return 0;if(typeof z==="number"&&Number.isInteger(z)&&z>=0&&z<=255)return z;let G=M?`Command "${M.commandName}"`:"The command";return X(`${G} ${Q} ${JSON.stringify(z)}, which is not an exit `+"code \u2014 an exit code is an integer from 0 to 255. Treating this as a "+"failure."),1}var[a,...o]=process.argv.slice(2),i=F();d({rootDir:process.cwd(),name:a,argv:o,writers:i}).then(async(z)=>{await i.flush(),process.exit(z)});
|
|
15
15
|
|
|
16
|
-
//# debugId=
|
|
16
|
+
//# debugId=2A6BC462585ADE5D64756E2164756E21
|
package/dist/console/run.js.map
CHANGED
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
"/**\n * The entry point `gemi run` spawns.\n *\n * Exposed through the exports map as `gemi/console/run` and resolved by the CLI\n * out of the *application's* `node_modules`, the same way `dev` and `start`\n * resolve `gemi/bun/preload`. That indirection is the point: the runner has to\n * be the application's copy of gemi, not the one bundled into `dist/bin/gemi.js`\n * — see the note at the top of `runner.ts`.\n *\n * Nothing but argv handling lives here, so that everything worth testing lives\n * in `runConsole`, which returns an exit code instead of taking one.\n */\nimport { processWriters } from \"./context\";\nimport { runConsole } from \"./runner\";\n\n// The tail is forwarded exactly as commander handed it over, `--` and all.\n// commander passes a `--` through as a literal operand (verified: `gemi run x --\n// --weird` arrives as `[\"--\", \"--weird\"]`), and `parse.ts` already treats a `--`\n// as \"everything after this is positional\". Stripping it here — which an earlier\n// draft did — consumed the escape hatch before the only thing that reads it,\n// leaving `-- --weird` reported as an unknown option and `-- --` the only way to\n// pass a flag-shaped value.\nconst [name, ...argv] = process.argv.slice(2);\n\nconst writers = processWriters();\n\n// `.then` rather than a top-level `await`, so this file typechecks under the\n// package's inherited `module: NodeNext` — the same TS1309 that keeps `bun/` out\n// of tsconfig.json's `include`. Bun runs it as ESM either way; this just avoids\n// buying a nested tsconfig for two lines.\nrunConsole({ rootDir: process.cwd(), name, argv, writers }).then(\n async (code) => {\n // Everything written has to reach the OS before the exit below discards it —\n // see `processWriters` for what that costs when it is skipped.\n await writers.flush();\n\n // Explicit, and not belt-and-braces. `kernel.destroy()` stops the scheduler,\n // but an open database pool, a Redis client or an unref'd timer will happily\n // hold the loop open after the work is done — a command that finishes and then\n // sits there, which is the failure `kernel/exit.test.ts` exists for and the\n // one `orm/context.test.ts` names by example.\n process.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QAAQ,GAIpB,eAAe,CAAU,CAAC,EAAkC,CAC1D,IAAM,EAAa,EAAK,QAAQ,EAAS,sBAAsB,EAE3D,EACJ,GAAI,CACF,EAAS,MAAa,UACtB,MAAO,EAAO,CACd,MAAM,IAAI,EACR,kBAAkB;AAAA,MAAqB,EAAgB;AAAA,8HAGvD,CAAE,MAAO,CAAM,CACjB,EAGF,GAAI,OAAO,EAAO,UAAY,WAC5B,MAAM,IAAI,EACR,GAAG,kGAEL,EAGF,OAAO,IAAI,EAAO,QAgBpB,SAAS,CAAW,CAClB,EACA,EACA,EACA,EAAS,WACD,CACR,GAAI,IAAW,QAAa,IAAW,KAAM,MAAO,GAEpD,GACE,OAAO,IAAW,UAClB,OAAO,UAAU,CAAM,GACvB,GAAU,GACV,GAAU,IAEV,OAAO,EAGT,IAAM,EAAU,EAAU,YAAY,EAAQ,eAAiB,cAO/D,OALA,EACE,GAAG,KAAW,KAAU,KAAK,UAAU,CAAM,2BAC3C,4EACA,UACJ,EACO,EGlPT,IAAO,KAAS,GAAQ,QAAQ,KAAK,MAAM,CAAC,EAEtC,EAAU,EAAe,EAM/B,EAAW,CAAE,QAAS,QAAQ,IAAI,EAAG,OAAM,OAAM,SAAQ,CAAC,EAAE,KAC1D,MAAO,IAAS,CAGd,MAAM,EAAQ,MAAM,EAOpB,QAAQ,KAAK,CAAI,EAErB",
|
|
12
|
-
"debugId": "
|
|
12
|
+
"debugId": "2A6BC462585ADE5D64756E2164756E21",
|
|
13
13
|
"names": []
|
|
14
14
|
}
|
package/dist/container/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Lg as e,Mg as o}from"../chunk-f6s7ddjz.js";import"../chunk-68zf43ah.js";export{o as Container,e as BindingResolutionError};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=3C840D77A3D0236264756E2164756E21
|
package/dist/database/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ya as N}from"../chunk-epwaxctc.js";import"../chunk-7kedxtbp.js";import"../chunk-adm5g1v8.js";import{$f as w,Yf as j,Zf as k,ag as x,bg as z,cg as A,dg as E,eg as F,fg as G,gg as H,hg as I,ig as J,jg as K,kg as L}from"../chunk-ghz3e8b7.js";import"../chunk-3fr22rtg.js";import"../chunk-
|
|
2
|
+
import{ya as N}from"../chunk-epwaxctc.js";import"../chunk-7kedxtbp.js";import"../chunk-adm5g1v8.js";import{$f as w,Yf as j,Zf as k,ag as x,bg as z,cg as A,dg as E,eg as F,fg as G,gg as H,hg as I,ig as J,jg as K,kg as L}from"../chunk-ghz3e8b7.js";import"../chunk-3fr22rtg.js";import"../chunk-68zf43ah.js";export{A as isSqlite,E as isMysqlFamily,z as inferDialect,j as defineDatabaseConfig,k as databaseConfigDefaults,w as UnknownDatabaseUrlError,H as UnknownConnectionError,I as ReservedConnectionNameError,x as MissingDatabaseUrlError,N as DatabaseServiceProvider,L as DatabaseManager,G as DEFAULT_CONNECTION,J as CrossConnectionTransactionError,K as Connection,F as AmbiguousSqlitePathError};
|
|
3
3
|
|
|
4
4
|
//# debugId=C8A29A8A60D3994A64756E2164756E21
|
package/dist/email/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ag as qS,Bg as JS}from"../chunk-
|
|
2
|
+
import{Ag as qS,Bg as JS}from"../chunk-77kw61f4.js";import{Gg as $S}from"../chunk-qttatc7h.js";import{Kg as P}from"../chunk-48dek9s7.js";import"../chunk-f6s7ddjz.js";import"../chunk-68zf43ah.js";import{render as s}from"jsx-email";import B from"process";import{Buffer as n}from"buffer";import r from"path";import{fileURLToPath as PS}from"url";import{promisify as yS}from"util";import o from"child_process";import wS,{constants as fS}from"fs/promises";import h from"process";import l,{constants as zS}from"fs/promises";import g from"process";import NS from"os";import W from"fs";import RS from"fs";import b from"fs";var F;function HS(){try{return b.statSync("/.dockerenv"),!0}catch{return!1}}function XS(){try{return b.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function L(){if(F===void 0)F=HS()||XS();return F}var O,US=()=>{try{return RS.statSync("/run/.containerenv"),!0}catch{return!1}};function R(){if(O===void 0)O=US()||L();return O}var u=()=>{if(g.platform!=="linux")return!1;if(NS.release().toLowerCase().includes("microsoft")){if(R())return!1;return!0}try{if(W.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft"))return!R()}catch{}if(W.existsSync("/proc/sys/fs/binfmt_misc/WSLInterop")||W.existsSync("/run/WSL"))return!R();return!1},H=g.env.__IS_WSL_TEST__?u:u();var ES=(()=>{let S;return async function(){if(S)return S;let q="/etc/wsl.conf",J=!1;try{await l.access(q,zS.F_OK),J=!0}catch{}if(!J)return"/mnt/";let K=await l.readFile(q,{encoding:"utf8"}),Q=/(?<!#.*)root\s*=\s*(?<mountPoint>.*)/g.exec(K);if(!Q)return"/mnt/";return S=Q.groups.mountPoint.trim(),S=S.endsWith("/")?S:`${S}/`,S}})(),MS=async()=>{return`${await ES()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`},v=async()=>{if(H)return MS();return`${h.env.SYSTEMROOT||h.env.windir||String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`};function X($,S,q){let J=(K)=>Object.defineProperty($,S,{value:K,enumerable:!0,writable:!0});return Object.defineProperty($,S,{configurable:!0,enumerable:!0,get(){let K=q();return J(K),K},set(K){J(K)}}),$}import{promisify as jS}from"util";import j from"process";import{execFile as xS}from"child_process";import{promisify as _S}from"util";import kS from"process";import{execFile as DS}from"child_process";var FS=_S(DS);async function T(){if(kS.platform!=="darwin")throw Error("macOS only");let{stdout:$}=await FS("defaults",["read","com.apple.LaunchServices/com.apple.launchservices.secure","LSHandlers"]),q=/LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec($)?.groups.id??"com.apple.Safari";if(q==="com.apple.safari")return"com.apple.Safari";return q}import LS from"process";import{promisify as OS}from"util";import{execFile as WS,execFileSync as H0}from"child_process";var vS=OS(WS);async function m($,{humanReadableOutput:S=!0,signal:q}={}){if(LS.platform!=="darwin")throw Error("macOS only");let J=S?[]:["-ss"],K={};if(q)K.signal=q;let{stdout:Q}=await vS("osascript",["-e",$,J],K);return Q.trim()}async function C($){return m(`tell application "Finder" to set app_path to application file id "${$}" as string
|
|
3
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 TS}from"util";import{execFile as CS}from"child_process";var IS=TS(CS),_={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"}},E0=new Map(Object.entries(_));class c extends Error{}async function I($=IS){let{stdout:S}=await $("reg",["QUERY"," HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice","/v","ProgId"]),q=/ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(S);if(!q)throw new c(`Cannot find Windows browser in stdout: ${JSON.stringify(S)}`);let{id:J}=q.groups,K=J.lastIndexOf("."),Q=J.lastIndexOf("-"),Z=K===-1?void 0:J.slice(0,K),V=Q===-1?void 0:J.slice(0,Q);return _[J]??_[Z]??_[V]??{name:J,id:J}}var BS=jS(xS),AS=($)=>$.toLowerCase().replaceAll(/(?:^|\s|-)\S/g,(S)=>S.toUpperCase());async function x(){if(j.platform==="darwin"){let $=await T();return{name:await C($),id:$}}if(j.platform==="linux"){let{stdout:$}=await BS("xdg-mime",["query","default","x-scheme-handler/http"]),S=$.trim();return{name:AS(S.replace(/.desktop$/,"").replace("-"," ")),id:S}}if(j.platform==="win32")return I();throw Error("Only macOS, Linux, and Windows are supported")}var bS=yS(o.execFile),A=r.dirname(PS(import.meta.url)),d=r.join(A,"xdg-open"),{platform:N,arch:p}=B;async function uS(){let $=await v(),S=String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`,q=n.from(S,"utf16le").toString("base64"),{stdout:J}=await bS($,["-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand",q],{encoding:"utf8"}),K=J.trim(),Q={ChromeHTML:"com.google.chrome",BraveHTML:"com.brave.Browser",MSEdgeHTM:"com.microsoft.edge",FirefoxURL:"org.mozilla.firefox"};return Q[K]?{id:Q[K]}:{}}var t=async($,S)=>{let q;for(let J of $)try{return await S(J)}catch(K){q=K}throw q},k=async($)=>{if($={wait:!1,background:!1,newInstance:!1,allowNonzeroExitCode:!1,...$},Array.isArray($.app))return t($.app,(V)=>k({...$,app:V}));let{name:S,arguments:q=[]}=$.app??{};if(q=[...q],Array.isArray(S))return t(S,(V)=>k({...$,app:{name:V,arguments:q}}));if(S==="browser"||S==="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"},Y={chrome:"--incognito",brave:"--incognito",firefox:"--private-window",edge:"--inPrivate"},G=H?await uS():await x();if(G.id in V){let z=V[G.id];if(S==="browserPrivate")q.push(Y[z]);return k({...$,app:{name:U[z],arguments:q}})}throw Error(`${G.name} is not supported as a default browser`)}let J,K=[],Q={};if(N==="darwin"){if(J="open",$.wait)K.push("--wait-apps");if($.background)K.push("--background");if($.newInstance)K.push("--new");if(S)K.push("-a",S)}else if(N==="win32"||H&&!R()&&!S){if(J=await v(),K.push("-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-EncodedCommand"),!H)Q.windowsVerbatimArguments=!0;let V=["Start"];if($.wait)V.push("-Wait");if(S){if(V.push(`"\`"${S}\`""`),$.target)q.push($.target)}else if($.target)V.push(`"${$.target}"`);if(q.length>0)q=q.map((Y)=>`"\`"${Y}\`""`),V.push("-ArgumentList",q.join(","));$.target=n.from(V.join(" "),"utf16le").toString("base64")}else{if(S)J=S;else{let V=!A||A==="/",Y=!1;try{await wS.access(d,fS.X_OK),Y=!0}catch{}J=B.versions.electron??(N==="android"||V||!Y)?"xdg-open":d}if(q.length>0)K.push(...q);if(!$.wait)Q.stdio="ignore",Q.detached=!0}if(N==="darwin"&&q.length>0)K.push("--args",...q);if($.target)K.push($.target);let Z=o.spawn(J,K,Q);if($.wait)return new Promise((V,Y)=>{Z.once("error",Y),Z.once("close",(G)=>{if(!$.allowNonzeroExitCode&&G>0){Y(Error(`Exited with code ${G}`));return}V(Z)})});return Z.unref(),Z},gS=($,S)=>{if(typeof $!=="string")throw TypeError("Expected a `target`");return k({...S,target:$})};function i($){if(typeof $==="string"||Array.isArray($))return $;let{[p]:S}=$;if(!S)throw Error(`${p} is not supported`);return S}function D({[N]:$},{wsl:S}){if(S&&H)return i(S);if(!$)throw Error(`${N} is not supported`);return i($)}var U={};X(U,"chrome",()=>D({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(U,"brave",()=>D({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(U,"firefox",()=>D({darwin:"firefox",win32:String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,linux:"firefox"},{wsl:"/mnt/c/Program Files/Mozilla Firefox/firefox.exe"}));X(U,"edge",()=>D({darwin:"microsoft edge",win32:"msedge",linux:["microsoft-edge","microsoft-edge-dev"]},{wsl:"/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"}));X(U,"browser",()=>"browser");X(U,"browserPrivate",()=>"browserPrivate");var a=gS;function hS($){return Array.from($,(S)=>{let q=S.charCodeAt(0);return S==="/"||S==="\\"||q<32||q===127?"_":S}).join("")}async function e($,S,q={}){let J=`${$}/${new Date().toISOString()}${hS(S.subject)}`,K={to:S.to,cc:S.cc,bcc:S.bcc,from:S.from,subject:S.subject,headers:S.headers??{},attachments:S.attachments.map((Q)=>({filename:Q.filename,bytes:Buffer.byteLength(Q.content)})),scheduledAt:S.scheduledAt??null,idempotencyKey:S.idempotencyKey??null,locale:q.locale??null,text:S.text??null};return await Bun.write(`${J}.json`,`${JSON.stringify(K,null,2)}
|
|
4
4
|
`),await Bun.write(`${J}.html`,S.html),`${J}.html`}import{jsx as SS}from"react/jsx-runtime";class KS{from="";to=[];subject="No Subject";cc=[];bcc=[];attachments=[];template;headers={};static async send($){let S=new this,q=P($S).defaultLocale,J=P(JS),{to:K=S.to,from:Q=S.from,subject:Z=typeof S.subject==="string"?S.subject:S.subject[$.locale||q],cc:V=S.cc,bcc:Y=S.bcc,attachments:G=S.attachments,data:z,headers:QS={}}=$,VS={...J.headers??{},...S.headers??{},...QS??{}},y=process.env.EMAIL_DEBUG==="true",E=y?"debug":J.driver?.provider??"custom",w=await J.filterRecipients(K);if(!w.length)return{id:null,provider:E,status:"skipped"};let[YS,ZS]=await Promise.all([S.render({...z,locale:$.locale}),S.renderText({...z,locale:$.locale})]),f={bcc:Y,cc:V,from:Q,subject:Z,to:w,attachments:G,html:YS,headers:VS,text:ZS,scheduledAt:$.scheduledAt,idempotencyKey:$.idempotencyKey};if(y){let GS=await e(`${process.env.ROOT_DIR}/.debug/emails`,f,{locale:$.locale});if(process.env.CI!=="true")await a(GS);return{id:`debug_${crypto.randomUUID()}`,provider:E,status:"debug"}}let M=await qS(J,f);return M.ok?{id:M.id,provider:E,status:"sent"}:{id:M.id,provider:E,status:"failed",error:M.error}}static async preview($){return await new this().render({...$.data,locale:$.locale})}async render($){let S=this.template;return await s(SS(S,{...$}))}async renderText($){let S=this.template;return await s(SS(S,{...$}),{plainText:!0})}}export{KS as Email};
|
|
5
5
|
|
|
6
|
-
//# debugId=
|
|
6
|
+
//# debugId=DE14A1645A14D24264756E2164756E21
|
package/dist/email/index.js.map
CHANGED
|
@@ -17,6 +17,6 @@
|
|
|
17
17
|
"import type { SendEmailParams } from \"../services/email/drivers/types\";\n\n/**\n * What `EMAIL_DEBUG=true` records about a send, next to the rendered HTML.\n *\n * The HTML alone can't say who a mail went to: plenty of templates render\n * nothing per recipient, so a test asserting \"this action mailed this user\"\n * could match another send with the same subject. The sidecar holds the\n * envelope the driver would have been handed, with `to` already filtered.\n */\nexport interface DebugEmailRecord {\n to: string[];\n cc: string[];\n bcc: string[];\n from: string;\n subject: string;\n headers: Record<string, string>;\n // Attachment bodies are left out: name and size are enough to assert on.\n attachments: Array<{ filename: string; bytes: number }>;\n scheduledAt: string | null;\n idempotencyKey: string | null;\n locale: string | null;\n text: string | null;\n}\n\n/**\n * A subject as a filename fragment. Path separators would write into a\n * subdirectory (or fail), and control characters aren't valid on every\n * filesystem. Everything else is kept, so a reader matching on the subject\n * substring keeps working.\n */\nexport function debugEmailFileSubject(subject: string) {\n return Array.from(subject, (char) => {\n const code = char.charCodeAt(0);\n return char === \"/\" || char === \"\\\\\" || code < 0x20 || code === 0x7f ? \"_\" : char;\n }).join(\"\");\n}\n\n/**\n * Writes `<dir>/<iso><subject>.json` and then `<dir>/<iso><subject>.html`, and\n * returns the HTML path. The sidecar goes first so a reader that sees the HTML\n * can rely on its envelope being there.\n */\nexport async function writeDebugEmail(\n dir: string,\n params: SendEmailParams,\n options: { locale?: string } = {},\n) {\n const base = `${dir}/${new Date().toISOString()}${debugEmailFileSubject(params.subject)}`;\n\n const record: DebugEmailRecord = {\n to: params.to,\n cc: params.cc,\n bcc: params.bcc,\n from: params.from,\n subject: params.subject,\n headers: params.headers ?? {},\n attachments: params.attachments.map((attachment) => ({\n filename: attachment.filename,\n bytes: Buffer.byteLength(attachment.content),\n })),\n scheduledAt: params.scheduledAt ?? null,\n idempotencyKey: params.idempotencyKey ?? null,\n locale: options.locale ?? null,\n text: params.text ?? null,\n };\n\n await Bun.write(`${base}.json`, `${JSON.stringify(record, null, 2)}\\n`);\n await Bun.write(`${base}.html`, params.html);\n\n return `${base}.html`;\n}\n"
|
|
18
18
|
],
|
|
19
19
|
"mappings": ";uNACA,YAAS,aCDT,kBACA,YAAQ,eACR,oBACA,wBAAQ,aACR,oBAAQ,cACR,6BACA,wBAAY,qBCNZ,uBACA,uBAAY,qBCDZ,uBACA,mBACA,kBCFA,mBCAA,kBAEA,IAAI,EAEJ,SAAS,EAAY,EAAG,CACvB,GAAI,CAEH,OADA,EAAG,SAAS,aAAa,EAClB,GACN,KAAM,CACP,MAAO,IAIT,SAAS,EAAe,EAAG,CAC1B,GAAI,CACH,OAAO,EAAG,aAAa,oBAAqB,MAAM,EAAE,SAAS,QAAQ,E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WAAW,IAAK,WAAU,OAAQ,OAAQ,EAMzE,IAAM,EAAS,MAAM,GAAe,EAAM,CAAM,EAEhD,OAAO,EAAO,GACV,CAAE,GAAI,EAAO,GAAI,WAAU,OAAQ,MAAO,EAC1C,CAAE,GAAI,EAAO,GAAI,WAAU,OAAQ,SAAU,MAAO,EAAO,KAAM,cAG1D,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,GAAC,EAAD,IAAc,EAAO,CAAE,OAG7B,WAAyC,CAAC,EAAU,CAClE,IAAM,EAAW,KAAK,SACtB,OAAO,MAAM,EAAO,GAAC,EAAD,IAAc,EAAO,EAAI,CAAE,UAAW,EAAK,CAAC,EAEpE",
|
|
20
|
-
"debugId": "
|
|
20
|
+
"debugId": "DE14A1645A14D24264756E2164756E21",
|
|
21
21
|
"names": []
|
|
22
22
|
}
|
package/dist/facades/Lang.d.ts
CHANGED
|
@@ -5,6 +5,25 @@ export declare class Lang extends Facade {
|
|
|
5
5
|
static getSupportedLocales(): string[];
|
|
6
6
|
static getDefaultLocale(): string;
|
|
7
7
|
static locale(): string;
|
|
8
|
+
/**
|
|
9
|
+
* The time zone dates are formatted in for the current request: what
|
|
10
|
+
* `translation.detectTimeZone` resolves, else `translation.timeZone`
|
|
11
|
+
* (`UTC` by default). Outside a request, the configured zone.
|
|
12
|
+
*/
|
|
13
|
+
static timeZone(): string;
|
|
14
|
+
/**
|
|
15
|
+
* A formatter bound to the current request's locale and time zone — the
|
|
16
|
+
* same ones the page renders with, so a date in a flash message or an email
|
|
17
|
+
* matches the one on screen.
|
|
18
|
+
*
|
|
19
|
+
* ```ts
|
|
20
|
+
* Lang.formatter().date(order.createdAt, { dateStyle: "long" });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
static formatter(options?: {
|
|
24
|
+
locale?: string;
|
|
25
|
+
timeZone?: string;
|
|
26
|
+
}): import("gemi/client").Formatter;
|
|
8
27
|
static setLocale(locale?: string): string;
|
|
9
28
|
}
|
|
10
29
|
//# sourceMappingURL=Lang.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Lang.d.ts","sourceRoot":"","sources":["../../facades/Lang.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,qBAAa,IAAK,SAAQ,MAAM;IAC9B,MAAM,CAAC,iBAAiB;IAIxB,MAAM,CAAC,mBAAmB;IAI1B,MAAM,CAAC,gBAAgB;IAIvB,MAAM,CAAC,MAAM;IAkBb,MAAM,CAAC,SAAS,CAAC,MAAM,SAAgB;CAuBxC"}
|
|
1
|
+
{"version":3,"file":"Lang.d.ts","sourceRoot":"","sources":["../../facades/Lang.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,qBAAa,IAAK,SAAQ,MAAM;IAC9B,MAAM,CAAC,iBAAiB;IAIxB,MAAM,CAAC,mBAAmB;IAI1B,MAAM,CAAC,gBAAgB;IAIvB,MAAM,CAAC,MAAM;IAkBb;;;;OAIG;IACH,MAAM,CAAC,QAAQ;IAKf;;;;;;;;OAQG;IACH,MAAM,CAAC,SAAS,CAAC,OAAO,GAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAO;IAQrE,MAAM,CAAC,SAAS,CAAC,MAAM,SAAgB;CAuBxC"}
|
package/dist/facades/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Lc as c,Mc as d,Nc as f,Oc as g,Pc as i,Qc as j,Rc as k,Sc as l,Tc as m,fd as n,gd as o,hd as p,mc as a}from"../chunk-
|
|
2
|
+
import{Lc as c,Mc as d,Nc as f,Oc as g,Pc as i,Qc as j,Rc as k,Sc as l,Tc as m,fd as n,gd as o,hd as p,mc as a}from"../chunk-rc4z7ykq.js";import"../chunk-bf1q3m7a.js";import"../chunk-adm5g1v8.js";import{lf as b,tf as e,vf as h}from"../chunk-h15bd9vn.js";import"../chunk-9xf2fx98.js";import"../chunk-eqtsfvvd.js";import"../chunk-br9p390p.js";import"../chunk-n4807648.js";import"../chunk-ghz3e8b7.js";import"../chunk-7vjbebst.js";import"../chunk-3fr22rtg.js";import"../chunk-qttatc7h.js";import"../chunk-48dek9s7.js";import"../chunk-f6s7ddjz.js";import"../chunk-n63xjrck.js";import"../chunk-2tm56xq1.js";import"../chunk-68zf43ah.js";export{g as Url,e as Storage,k as Redis,a as Redirect,l as RateLimiter,f as Query,i as Meta,h as Log,m as Lock,d as Lang,n as Features,b as Facade,p as DB,j as Cookie,o as ConnectionQueries,c as Auth};
|
|
3
3
|
|
|
4
4
|
//# debugId=0905CD6AC3F7D4D564756E2164756E21
|
package/dist/foundation/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Jg as o,Kg as r}from"../chunk-48dek9s7.js";import"../chunk-f6s7ddjz.js";import"../chunk-68zf43ah.js";export{r as app,o as Application};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=A00B1B74A01F1B4D64756E2164756E21
|
package/dist/http/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ac as H,Fd as I,Gd as J,Hd as K,Id as L,Jd as M,Kd as N,gc as n,hc as o,ic as p,jc as v,kc as w,lc as x,nc as y,oc as z,pc as A,qc as B,rc as C,sc as D,tc as E,yc as F,zc as G}from"../chunk-
|
|
2
|
+
import{Ac as H,Fd as I,Gd as J,Hd as K,Id as L,Jd as M,Kd as N,gc as n,hc as o,ic as p,jc as v,kc as w,lc as x,nc as y,oc as z,pc as A,qc as B,rc as C,sc as D,tc as E,yc as F,zc as G}from"../chunk-rc4z7ykq.js";import"../chunk-bf1q3m7a.js";import"../chunk-adm5g1v8.js";import{Me as a,Ne as b,Oe as d,Se as e,Te as f,Ue as g,Ve as h,We as i,Xe as j,af as k,bf as l,ff as m,gf as q,hf as r,if as s,jf as t,kf as u}from"../chunk-h15bd9vn.js";import{zf as c}from"../chunk-9xf2fx98.js";import"../chunk-eqtsfvvd.js";import"../chunk-br9p390p.js";import"../chunk-n4807648.js";import"../chunk-ghz3e8b7.js";import"../chunk-7vjbebst.js";import"../chunk-3fr22rtg.js";import"../chunk-qttatc7h.js";import"../chunk-48dek9s7.js";import"../chunk-f6s7ddjz.js";import"../chunk-n63xjrck.js";import"../chunk-2tm56xq1.js";import"../chunk-68zf43ah.js";export{g as toRangeHeaderValue,n as toMiddlewareList,f as resolveRange,e as parseRangeHeader,h as parseContentRange,E as middlewareConfigDefaults,z as httpError,d as getCookies,j as formatUnsatisfiedContentRange,i as formatContentRange,D as defineMiddlewareConfig,o as createUnsatisfiableResponse,p as createStreamResponse,A as createFileResponse,H as clientIp,B as ViewRouter,k as ValidationError,b as ResourceController,c as RequestBreakerError,G as RateLimitMiddleware,F as RateLimitExceededError,s as RangeNotSatisfiableError,M as PoliciesServiceProvider,N as Policies,C as Middleware,x as McpRouter,w as McpRouteDeclaration,l as InvalidValidationRuleError,r as InsufficientPermissionsError,y as HttpResponse,m as HttpRequest,t as FileNotFoundError,K as CorsMiddleware,a as Controller,J as CacheMiddleware,L as CSRFMiddleware,q as AuthorizationError,I as AuthenticationMiddleware,u as AuthenticationError,v as ApiRouter};
|
|
3
3
|
|
|
4
4
|
//# debugId=40862F9DA4E1987764756E2164756E21
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { HttpRequest } from "../http/HttpRequest";
|
|
2
2
|
import type { Dictionary } from "./Dictionary";
|
|
3
3
|
import type { TranslationConfig } from "./config";
|
|
4
|
+
import { type Formatter } from "./formatter";
|
|
4
5
|
export declare class Translator {
|
|
5
6
|
config: Required<TranslationConfig>;
|
|
6
7
|
static token: string;
|
|
@@ -22,6 +23,22 @@ export declare class Translator {
|
|
|
22
23
|
get supportedLocales(): string[];
|
|
23
24
|
get defaultLocale(): string;
|
|
24
25
|
get components(): Record<string, Dictionary<any>>;
|
|
26
|
+
/** The configured zone; `UTC` unless `translation.timeZone` says otherwise. */
|
|
27
|
+
get timeZone(): string;
|
|
28
|
+
/**
|
|
29
|
+
* The zone dates are formatted in for this request: `detectTimeZone`'s
|
|
30
|
+
* answer when it gives a zone `Intl` knows, the configured zone otherwise.
|
|
31
|
+
* A bad value from a cookie must not take the page down, so it is ignored
|
|
32
|
+
* rather than thrown.
|
|
33
|
+
*/
|
|
34
|
+
detectTimeZone(req: HttpRequest<any, any> | null | undefined): string;
|
|
35
|
+
/**
|
|
36
|
+
* A formatter for `locale` (the default locale when omitted) in `timeZone`
|
|
37
|
+
* (the configured zone when omitted). For server code outside a request —
|
|
38
|
+
* jobs, emails. Inside a request, `Lang.formatter()` picks up the request's
|
|
39
|
+
* locale and zone.
|
|
40
|
+
*/
|
|
41
|
+
formatter(locale?: string, timeZone?: string): Formatter;
|
|
25
42
|
onLocaleChange(locale: string): Promise<void> | void;
|
|
26
43
|
detectLocale(req: HttpRequest<any, any>): string;
|
|
27
44
|
getPageTranslations(locale: string, scope: string): any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Translator.d.ts","sourceRoot":"","sources":["../../i18n/Translator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":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@ export interface TranslationConfig {
|
|
|
13
13
|
components?: Record<string, Dictionary<any>>;
|
|
14
14
|
detectLocale?: (req: HttpRequest) => string | null;
|
|
15
15
|
onLocaleChange?: (locale: string) => Promise<void> | void;
|
|
16
|
+
/**
|
|
17
|
+
* The IANA time zone dates are formatted in by `useFormatter`,
|
|
18
|
+
* `useDictionary(...).format` and `Lang.formatter()`. Defaults to `UTC`.
|
|
19
|
+
*
|
|
20
|
+
* One zone for server and browser alike, so a server-rendered date and its
|
|
21
|
+
* hydrated copy print the same text. Override per call with
|
|
22
|
+
* `format.date(value, { timeZone })`.
|
|
23
|
+
*/
|
|
24
|
+
timeZone?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Resolve the zone for one request, e.g. from a cookie or the signed-in
|
|
27
|
+
* user's profile. Returning `null` (or a zone `Intl` does not know) falls back
|
|
28
|
+
* to `timeZone`. Runs on the server; the result ships with the page.
|
|
29
|
+
*/
|
|
30
|
+
detectTimeZone?: (req: HttpRequest) => string | null;
|
|
16
31
|
}
|
|
17
32
|
export declare function defineTranslationConfig(config: TranslationConfig): TranslationConfig;
|
|
18
33
|
export declare function translationConfigDefaults(): Required<TranslationConfig>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../i18n/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../i18n/config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGvD,MAAM,WAAW,iBAAiB;IAChC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAClD,6EAA6E;IAC7E,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;IAG7C,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,MAAM,GAAG,IAAI,CAAC;IACnD,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAE1D;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,MAAM,GAAG,IAAI,CAAC;CACtD;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,iBAAiB,GACxB,iBAAiB,CAEnB;AAED,wBAAgB,yBAAyB,IAAI,QAAQ,CAAC,iBAAiB,CAAC,CAavE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{aa as y,ba as p}from"../chunk-mekw2ap4.js";import{qa as c,ra as d,ta as l}from"../chunk-9a8qz3s7.js";import{mg as e,ng as i,pg as t,qg as r,rg as o,sg as n,tg as a,ug as s}from"../chunk-7vjbebst.js";import"../chunk-
|
|
2
|
+
import{aa as y,ba as p}from"../chunk-mekw2ap4.js";import{qa as c,ra as d,ta as l}from"../chunk-9a8qz3s7.js";import{mg as e,ng as i,pg as t,qg as r,rg as o,sg as n,tg as a,ug as s}from"../chunk-7vjbebst.js";import"../chunk-68zf43ah.js";export{o as setActiveLocale,r as seedDictionaries,t as preloadDictionaries,d as localeStrings,i as loadDictionary,n as getActiveLocale,e as dictionaryRegistrationMark,c as dictionaryLocales,l as dictionaryId,y as defineDictionary,s as createDictionarySink,a as __resetDictionaryRegistry,p as __gemi_dict__};
|
|
3
3
|
|
|
4
4
|
//# debugId=9CF699FACE5C277E64756E2164756E21
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Locale- and time-zone-aware formatting, shared by `useFormatter`, the
|
|
3
|
+
* `format` property of a `useDictionary` result and `Lang.formatter()`.
|
|
4
|
+
*
|
|
5
|
+
* Dependency-free on purpose: components import it, so it must not pull in the
|
|
6
|
+
* server facades.
|
|
7
|
+
*
|
|
8
|
+
* Why the time zone is pinned: a `Date` formatted with no `timeZone` uses the
|
|
9
|
+
* runtime's zone, which is the server's during SSR and the viewer's in the
|
|
10
|
+
* browser. The two disagree for anyone not sitting in the server's zone, so the
|
|
11
|
+
* same instant can print a different hour, or a different day, on each side —
|
|
12
|
+
* a hydration mismatch at best, a wrong date at worst. Every formatter here
|
|
13
|
+
* carries one zone, resolved on the server and shipped with the page, so both
|
|
14
|
+
* sides print the same text.
|
|
15
|
+
*/
|
|
16
|
+
export type DateInput = Date | number | string;
|
|
17
|
+
export interface FormatterInit {
|
|
18
|
+
/** BCP 47 locale tag. */
|
|
19
|
+
locale: string;
|
|
20
|
+
/** IANA time zone, such as `UTC` or `Europe/Istanbul`. */
|
|
21
|
+
timeZone: string;
|
|
22
|
+
}
|
|
23
|
+
export interface Formatter {
|
|
24
|
+
readonly locale: string;
|
|
25
|
+
readonly timeZone: string;
|
|
26
|
+
/** A date, `{ dateStyle: "medium" }` unless options are given. */
|
|
27
|
+
date(value: DateInput, options?: Intl.DateTimeFormatOptions): string;
|
|
28
|
+
/** A time of day, `{ timeStyle: "short" }` unless options are given. */
|
|
29
|
+
time(value: DateInput, options?: Intl.DateTimeFormatOptions): string;
|
|
30
|
+
/** Date and time, `{ dateStyle: "medium", timeStyle: "short" }` unless options are given. */
|
|
31
|
+
dateTime(value: DateInput, options?: Intl.DateTimeFormatOptions): string;
|
|
32
|
+
number(value: number | bigint, options?: Intl.NumberFormatOptions): string;
|
|
33
|
+
relative(value: number, unit: Intl.RelativeTimeFormatUnit, options?: Intl.RelativeTimeFormatOptions): string;
|
|
34
|
+
list(values: Iterable<string>, options?: Intl.ListFormatOptions): string;
|
|
35
|
+
/** The CLDR plural category for `count`: `one`, `few`, `other`, … */
|
|
36
|
+
plural(count: number, options?: Intl.PluralRulesOptions): Intl.LDMLPluralRule;
|
|
37
|
+
/**
|
|
38
|
+
* The cached `Intl.DateTimeFormat` behind `date`/`time`/`dateTime`, with the
|
|
39
|
+
* formatter's zone applied. For `formatToParts` or `formatRange`.
|
|
40
|
+
*/
|
|
41
|
+
dateTimeFormat(options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat;
|
|
42
|
+
}
|
|
43
|
+
/** The zone used when the app configures none. */
|
|
44
|
+
export declare const DEFAULT_TIME_ZONE = "UTC";
|
|
45
|
+
/**
|
|
46
|
+
* Whether `timeZone` is an IANA zone (or offset) this runtime's `Intl` accepts.
|
|
47
|
+
* An unknown zone makes `Intl.DateTimeFormat` throw a `RangeError`, so a zone
|
|
48
|
+
* that comes from a cookie or a user record is checked before it is trusted.
|
|
49
|
+
*/
|
|
50
|
+
export declare function isValidTimeZone(timeZone: unknown): timeZone is string;
|
|
51
|
+
export declare function createFormatter(init: FormatterInit): Formatter;
|
|
52
|
+
//# sourceMappingURL=formatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../../i18n/formatter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC;AAE/C,MAAM,WAAW,aAAa;IAC5B,yBAAyB;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,kEAAkE;IAClE,IAAI,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,qBAAqB,GAAG,MAAM,CAAC;IACrE,wEAAwE;IACxE,IAAI,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,qBAAqB,GAAG,MAAM,CAAC;IACrE,6FAA6F;IAC7F,QAAQ,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,qBAAqB,GAAG,MAAM,CAAC;IACzE,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,GAAG,MAAM,CAAC;IAC3E,QAAQ,CACN,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,IAAI,CAAC,sBAAsB,EACjC,OAAO,CAAC,EAAE,IAAI,CAAC,yBAAyB,GACvC,MAAM,CAAC;IACV,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,iBAAiB,GAAG,MAAM,CAAC;IACzE,qEAAqE;IACrE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,cAAc,CAAC;IAC9E;;;OAGG;IACH,cAAc,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,qBAAqB,GAAG,IAAI,CAAC,cAAc,CAAC;CAC3E;AAED,kDAAkD;AAClD,eAAO,MAAM,iBAAiB,QAAQ,CAAC;AAEvC;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,MAAM,CAUrE;AA6CD,wBAAgB,eAAe,CAAC,IAAI,EAAE,aAAa,GAAG,SAAS,CAqE9D"}
|
package/dist/i18n/index.d.ts
CHANGED
|
@@ -5,4 +5,5 @@ export { Dictionary } from "./Dictionary";
|
|
|
5
5
|
export { defineDictionary, type DictionaryHandle, } from "./defineDictionary";
|
|
6
6
|
export { translate } from "./translate";
|
|
7
7
|
export type { DictionaryTranslations, LocaleStrings } from "./dictionaryShape";
|
|
8
|
+
export { createFormatter, isValidTimeZone, DEFAULT_TIME_ZONE, type Formatter, type FormatterInit, type DateInput, } from "./formatter";
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/i18n/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../i18n/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,KAAK,iBAAiB,GACvB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C,OAAO,EACL,gBAAgB,EAChB,KAAK,gBAAgB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../i18n/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,KAAK,iBAAiB,GACvB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C,OAAO,EACL,gBAAgB,EAChB,KAAK,gBAAgB,GACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EACL,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,SAAS,GACf,MAAM,aAAa,CAAC"}
|
package/dist/i18n/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{aa as
|
|
2
|
+
import{aa as w}from"../chunk-mekw2ap4.js";import"../chunk-9a8qz3s7.js";import{Wa as b}from"../chunk-yhkffean.js";import{dc as R,ec as S}from"../chunk-f9t39vwk.js";import"../chunk-7kedxtbp.js";import{Mc as j}from"../chunk-rc4z7ykq.js";import"../chunk-bf1q3m7a.js";import"../chunk-adm5g1v8.js";import"../chunk-h15bd9vn.js";import"../chunk-9xf2fx98.js";import"../chunk-eqtsfvvd.js";import"../chunk-br9p390p.js";import"../chunk-n4807648.js";import"../chunk-ghz3e8b7.js";import"../chunk-7vjbebst.js";import"../chunk-3fr22rtg.js";import{Dg as X,Eg as E,Fg as V,Gg as L}from"../chunk-qttatc7h.js";import"../chunk-48dek9s7.js";import"../chunk-f6s7ddjz.js";import"../chunk-n63xjrck.js";import"../chunk-2tm56xq1.js";import"../chunk-68zf43ah.js";import{createElement as J,Fragment as M,isValidElement as U}from"react";function $(q,B){let G=Object.values(B).some((z)=>typeof z==="function"&&U(z(""))),Q=/{{([^{}]+?)(?::([^{}\[\]]+?))?(?:\[(.*?)\])?}}/g;if(!G)return q.replace(Q,(W,O,_,Z)=>{let C=O.includes(":")?O.split(":")[0]:O,H=B[C];if(H===void 0)return W;if(typeof H==="function"){let K=H(Z!==void 0?Z:"");if(U(K))throw Error("JSX returned in string context");return String(K)}if(_)switch(_.toLowerCase()){case"number":return Number(H).toString();case"string":return String(H);case"boolean":return Boolean(H).toString();default:return String(H)}return String(H)});else{let z=[],W=0,O=null;while((O=Q.exec(q))!==null){let[_,Z,C,H]=O,F=O.index,K=Z.includes(":")?Z.split(":")[0]:Z;if(F>W)z.push(q.substring(W,F));let Y=B[K];if(Y===void 0)z.push(_);else if(typeof Y==="function"){let A=Y(H!==void 0?H:"");z.push(A)}else if(C)switch(C.toLowerCase()){case"number":z.push(Number(Y).toString());break;case"string":z.push(String(Y));break;case"boolean":z.push(Boolean(Y).toString());break;default:z.push(String(Y))}else z.push(String(Y));W=F+_.length}if(W<q.length)z.push(q.substring(W));return J(M,{},...z)}}class P{name;dictionary;constructor(q,B){this.name=q;this.dictionary=B}reference(q){if(typeof window<"u")throw Error("Cannot use reference in the browser");if(!this.dictionary?.[q])throw Error(`Translation not found for ${String(q)}`);return this.dictionary[q]}render(q,...B){let{locale:G=j.locale(),params:Q}={params:{},...B[0]};if(typeof window<"u")throw Error("Cannot use render in the browser");if(!this.dictionary?.[q]?.[G])throw Error(`Translation not found for ${String(q)} in ${String(G)}`);return $(this.dictionary[q][G],Q??{})}static create(q,B){return new P(q,B)}static text(q,...B){let{locale:G=j.locale(),params:Q}={params:{},...B?.[0]};if(!q?.[G])throw Error(`Translation not found for ${String(G)}`);return $(q[G],Q??{})}}async function N(q,B,...G){let{locale:Q=j.locale(),params:z}={params:{},...G[0]},O=(await q.load(String(Q)))[B];if(typeof O!=="string")throw Error(`Translation not found for "${B}" in "${String(Q)}" (dictionary ${q.id})`);return $(O,z??{})}export{S as translationConfigDefaults,N as translate,E as isValidTimeZone,R as defineTranslationConfig,w as defineDictionary,V as createFormatter,L as Translator,b as TranslationServiceProvider,P as Dictionary,X as DEFAULT_TIME_ZONE};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=57FB2330D198750F64756E2164756E21
|
package/dist/i18n/index.js.map
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"// The module, not the `../facades` barrel. A dictionary is the one server-side\n// artifact a *component* test has to import — `<Page dictionaries={[…]}>` takes\n// the app's real `app/i18n/index.ts` — and the barrel drags the whole facade\n// set in behind it, including `Redis` and its `import { RedisClient } from\n// \"bun\"`. Under a browser-targeted runner (vitest/jsdom) that specifier does\n// not resolve, so importing the app's dictionaries failed to collect before it\n// rendered anything. `Lang` itself only needs the translator and the request\n// context.\nimport { Lang } from \"../facades/Lang\";\nimport { parseTranslation } from \"../utils/parseTranslation\";\nimport type {\n ParseTranslationParams,\n ParseTranslationParamsServer,\n Prettify,\n} from \"../utils/type\";\n\ntype Translations = Record<string, Record<string, string>>;\n\nexport class Dictionary<T extends Translations> {\n constructor(\n public name: string,\n public dictionary: T,\n ) {}\n\n reference(key: keyof T) {\n if (typeof window !== \"undefined\") {\n throw new Error(\"Cannot use reference in the browser\");\n }\n if (!this.dictionary?.[key]) {\n throw new Error(`Translation not found for ${String(key)}`);\n }\n return this.dictionary[key];\n }\n\n render<\n K extends keyof T,\n U extends keyof T[K],\n R = Prettify<ParseTranslationParams<T[K][U]>>,\n >(\n key: K,\n ...args: R extends Record<string, never>\n ? [args?: { locale?: U | (string & {}) }]\n : [args: { locale?: U | (string & {}); params: R }]\n ) {\n const { locale = Lang.locale(), params } = {\n params: {},\n ...args[0],\n };\n\n if (typeof window !== \"undefined\") {\n throw new Error(\"Cannot use render in the browser\");\n }\n\n if (!this.dictionary?.[key]?.[locale]) {\n throw new Error(\n `Translation not found for ${String(key)} in ${String(locale)}`,\n );\n }\n return parseTranslation(this.dictionary[key][locale], params ?? {});\n }\n\n /**\n * @deprecated Use `defineDictionary` from `gemi/client`, declared next to the\n * component that reads it. A dictionary made here has to be re-exported from\n * `app/i18n/index.ts` and listed against a route in the `prefetch` config,\n * and every locale of it stays resident whether a page uses it or not. Still\n * supported; see `docs/i18n.md`.\n */\n static create<const T extends Translations>(name: string, translations: T) {\n return new Dictionary<T>(name, translations);\n }\n\n static text<const T extends Record<string, string>, U extends keyof T>(\n content: T,\n ...args: Prettify<ParseTranslationParamsServer<T[U]>> extends Record<\n string,\n never\n >\n ? [args?: { locale?: U | (string & {}) }]\n : [\n args: {\n locale?: U | (string & {});\n params: Prettify<ParseTranslationParamsServer<T[U]>>;\n },\n ]\n ): string {\n const { locale = Lang.locale(), params } = { params: {}, ...args?.[0] };\n\n if (!content?.[locale]) {\n throw new Error(`Translation not found for ${String(locale)}`);\n }\n\n return parseTranslation(content[locale], params ?? {});\n }\n}\n",
|
|
7
7
|
"import { Lang } from \"../facades\";\nimport { parseTranslation } from \"../utils/parseTranslation\";\nimport type { ParseTranslationParamsServer, Prettify } from \"../utils/type\";\nimport type { DictionaryHandle } from \"./defineDictionary\";\nimport type { DictionaryTranslations } from \"./dictionaryShape\";\n\n/**\n * Read one string from a `defineDictionary` dictionary outside React — a\n * controller, a job, an email template.\n *\n * Async because a bundled dictionary loads its locale on demand. Server code\n * does not go through the bundler, so in practice this resolves without ever\n * yielding; the `await` is what makes the same call work either way.\n *\n * Kept out of `defineDictionary.ts` on purpose: that module is imported by\n * components and has to stay free of the server facades this one needs.\n */\nexport async function translate<\n T extends DictionaryTranslations,\n K extends keyof T & string,\n U extends keyof T[K],\n R = Prettify<ParseTranslationParamsServer<T[K][U] & string>>,\n>(\n dictionary: DictionaryHandle<T>,\n key: K,\n ...args: R extends Record<string, never>\n ? [args?: { locale?: U | (string & {}) }]\n : [args: { locale?: U | (string & {}); params: R }]\n): Promise<string> {\n const { locale = Lang.locale(), params } = { params: {}, ...args[0] };\n const strings = await dictionary.load(String(locale));\n const template = strings[key];\n\n if (typeof template !== \"string\") {\n throw new Error(\n `Translation not found for \"${key}\" in \"${String(locale)}\" (dictionary ${dictionary.id})`,\n );\n }\n\n return parseTranslation(template, (params ?? {}) as any) as string;\n}\n"
|
|
8
8
|
],
|
|
9
|
-
"mappings": ";
|
|
10
|
-
"debugId": "
|
|
9
|
+
"mappings": ";w0BAAA,mBAAS,SAAe,eAAU,SAO3B,IAAS,JAAgB,JAAC,HAAkB,HAAwB,JAEzE,DAAM,HAAS,EAAO,EAAO,JAAM,HAAE,AACnC,JAAC,DACC,EAAO,DAAU,YACjB,EAAgB,EAAkC,EAAE,CAAC,CACzD,EAMM,EAAQ,kDAEd,GAAI,CAAC,EAqCH,OAnCe,EAAS,QAAQ,EAAO,CAAC,EAAO,EAAM,E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MAAU,MACR,8BAA8B,UAAY,OAAO,CAAM,kBAAkB,EAAW,KACtF,EAGF,OAAO,EAAiB,EAAW,GAAU,CAAC,CAAS",
|
|
10
|
+
"debugId": "57FB2330D198750F64756E2164756E21",
|
|
11
11
|
"names": []
|
|
12
12
|
}
|
package/dist/kernel/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ya as y}from"../chunk-epwaxctc.js";import{Va as i}from"../chunk-
|
|
2
|
+
import{ya as y}from"../chunk-epwaxctc.js";import{Va as i}from"../chunk-pjg7gqnh.js";import{Wa as g}from"../chunk-yhkffean.js";import{$a as e,Za as T,_a as D,ab as A,bb as w,fb as P,gb as S,ib as h,jb as R,kb as u,lb as l,ob as v,pb as d,sb as c,vb as p,yb as n}from"../chunk-jv38q9n7.js";import"../chunk-wc46df4w.js";import"../chunk-3tn480wt.js";import{_b as r}from"../chunk-z8jf7jwg.js";import"../chunk-f9t39vwk.js";import"../chunk-7kedxtbp.js";import{Ad as m,Bd as Q,Cd as t,Dd as o,Fc as Zj,Gc as $j,Jc as Gj,Kc as Hj,nd as x,sd as I,td as E,wd as K,xd as M,yd as s,zd as C}from"../chunk-rc4z7ykq.js";import{Od as a}from"../chunk-bf1q3m7a.js";import{$d as V,ee as f}from"../chunk-adm5g1v8.js";import{ff as F}from"../chunk-h15bd9vn.js";import{yf as B}from"../chunk-9xf2fx98.js";import{Ef as L}from"../chunk-eqtsfvvd.js";import"../chunk-br9p390p.js";import"../chunk-n4807648.js";import"../chunk-ghz3e8b7.js";import"../chunk-7vjbebst.js";import"../chunk-3fr22rtg.js";import"../chunk-77kw61f4.js";import"../chunk-qttatc7h.js";import{Hg as _,Jg as N,Kg as b}from"../chunk-48dek9s7.js";import"../chunk-f6s7ddjz.js";import"../chunk-xmjhensy.js";import"../chunk-n63xjrck.js";import{Xg as q}from"../chunk-2tm56xq1.js";import"../chunk-68zf43ah.js";function Jj(j){let X=j.headers.get("Cache-Control")?.toLowerCase()??"";return/(^|[\s,])(public|s-maxage)\b/.test(X)}var Wj=new Set,Xj={refusal:null,apply:(j)=>j,carried:null};async function k(j){let X=b(x);if(X.config.global.length===0)return Xj;let{pathname:Z}=new URL(j.url),W=q(Z),z=new F(j,{},W?"api":"view","");return await L.run(z,async()=>{let $=L.getStore(),{headers:H,cookies:zj}=$,Y=(J)=>{if(!Jj(J))return Q(J,H,zj);let G=new Headers(H);return G.delete("Set-Cookie"),Q(J,G,Wj)};try{return await X.runGlobalMiddleware(),{refusal:null,apply:Y,carried:{user:$.user}}}catch(J){let G=!W&&Z.endsWith(".json");if(J?.kind===B){let O=W?m(J.payload.api):G?M(J.payload.viewData??J.payload.api):K(J.payload.view);return{refusal:Y(O),apply:Y,carried:null}}if(V(J)&&(W||G))return{refusal:Y(C()),apply:Y,carried:null};if(f(J)){console.error(J);let O=W||G?I():K(E());return{refusal:Y(O),apply:Y,carried:null}}throw J}finally{$.destroy()}})}var U=[l,d,y,P,n,A,S,v,R,D,h,p,u,g,c,w];class jj{config={};providers=[];services=[];serviceInstances=[];serviceTokens=new Set;servicesBooted=!1;models=[];app=new N;boot(){if(this.models.length>0)i(...this.models);else Yj();this.app.config.merge(this.config),N.setInstance(this.app),this.app.registerMany([...U,...this.providers]),this.registerServices()}registerServices(){let j=this.serviceTokens;this.serviceInstances=[],this.serviceTokens=new Set,this.servicesBooted=!1;let X=new Map;for(let Z of this.services){let W=typeof Z==="function"?new Z:Z,z=W.constructor;if(!z.token)throw Error(`Service [${z.name}] is listed in \`services\` but does not declare a \`static token\`.`);let $=X.get(z.token);if($)throw Error(`Services [${$}] and [${z.name}] both declare the token "${z.token}". Tokens are the container's keys, so they must be unique.`);X.set(z.token,z.name);let H=z;if(!j.has(z.token)&&this.app.bound(H))throw Error(`Service [${z.name}] declares the token "${z.token}", which is already bound in the container by the framework or a provider. Binding it would replace that service everywhere, so pick a token nothing else owns.`);this.app.instance(H,W),this.serviceInstances.push(W),this.serviceTokens.add(z.token)}}async waitForBoot(){await this.app.boot(),await this.bootServices(),e(this.app)}async bootServices(){if(this.servicesBooted)return;for(let j of this.serviceInstances)await j.boot();this.servicesBooted=!0}shutdown(j){return this.run(()=>this.app.shutdown(j))}run(j){return _.run(this.app,j)}resolve(j){return this.app.make(j)}apiRoutes(){return this.app.make(t)}viewRoutes(){return this.app.make(s)}domains(){return this.app.make(o)}queue(){return this.app.make(r)}globalMiddleware(j){return k(j)}destroy(){if(this.app.resolved(T))this.app.make(T).stop();if(this.app.flush(),N.getInstance()===this.app)N.setInstance(void 0);_.disable()}}function Yj(){if(Bun.env.NODE_ENV==="production")return;let j=a();if(j.length===0)return;console.warn(`[gemi] ${j.length} model${j.length===1?" is":"s are"} registered, but Kernel.models is empty.
|
|
3
3
|
Nested relation reads resolve a model by name, so a policy on a subclass that does not own its
|
|
4
4
|
`+" name is skipped inside every include \u2014 scoped at the root, "+`unscoped in an include, with nothing
|
|
5
5
|
to notice it. Declaring the modules registers each class under its own name and audits the set:
|
|
@@ -13,4 +13,4 @@ import{ya as y}from"../chunk-epwaxctc.js";import{Va as i}from"../chunk-twhf7w1x.
|
|
|
13
13
|
|
|
14
14
|
See docs/orm.md#your-model-class. Development only; this never prints in production.`)}export{$j as oneTimeSecretMatches,Zj as hashOneTimeSecret,U as frameworkProviders,Hj as UserProvider,Gj as SESSION_SELECT,jj as Kernel};
|
|
15
15
|
|
|
16
|
-
//# debugId=
|
|
16
|
+
//# debugId=EF7168C4632C856264756E2164756E21
|