gemi 0.52.0 → 0.53.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/{chunk-a0sy9f9x.js → chunk-07jtzbf0.js} +1 -1
- package/dist/{chunk-jdfe4dmh.js → chunk-1pqfmw5h.js} +2 -2
- package/dist/{chunk-jdfe4dmh.js.map → chunk-1pqfmw5h.js.map} +1 -1
- package/dist/chunk-3d3nmr5g.js +4 -0
- package/dist/{chunk-qj4mmner.js.map → chunk-3d3nmr5g.js.map} +2 -2
- package/dist/{chunk-et0j6jx8.js → chunk-7s1g3v1y.js} +3 -3
- package/dist/{chunk-et0j6jx8.js.map → chunk-7s1g3v1y.js.map} +1 -1
- package/dist/chunk-92793zh4.js +5 -0
- package/dist/{chunk-0tbwn6er.js.map → chunk-92793zh4.js.map} +3 -4
- package/dist/chunk-9279y4af.js +5 -0
- package/dist/{chunk-f29vd5mc.js.map → chunk-9279y4af.js.map} +2 -2
- package/dist/chunk-bq4w14a6.js +5 -0
- package/dist/chunk-bq4w14a6.js.map +10 -0
- package/dist/{chunk-4t6a82fh.js → chunk-cg53h5ht.js} +2 -2
- package/dist/{chunk-4t6a82fh.js.map → chunk-cg53h5ht.js.map} +1 -1
- package/dist/{chunk-km6x37ws.js → chunk-ear03axe.js} +24 -24
- package/dist/{chunk-km6x37ws.js.map → chunk-ear03axe.js.map} +3 -5
- package/dist/{chunk-38ma6gg3.js → chunk-fbp5vapa.js} +2 -2
- package/dist/{chunk-38ma6gg3.js.map → chunk-fbp5vapa.js.map} +2 -2
- package/dist/chunk-ffre1z8s.js +6 -0
- package/dist/{chunk-hbycemy5.js.map → chunk-ffre1z8s.js.map} +2 -2
- package/dist/{chunk-53e48ce8.js → chunk-qjnv2rkh.js} +2 -2
- package/dist/{chunk-53e48ce8.js.map → chunk-qjnv2rkh.js.map} +1 -1
- package/dist/{chunk-1ce7veh9.js → chunk-tkv6cw94.js} +3 -3
- package/dist/{chunk-1ce7veh9.js.map → chunk-tkv6cw94.js.map} +1 -1
- package/dist/chunk-y4djde42.js +5 -0
- package/dist/chunk-y4djde42.js.map +11 -0
- package/dist/chunks/ThemeProvider-CTX9LOFC.js +2718 -0
- package/dist/chunks/ThemeProvider-CTX9LOFC.js.map +1 -0
- package/dist/client/Mutation.d.ts +1 -1
- package/dist/client/Mutation.d.ts.map +1 -1
- package/dist/client/ThemeProvider.d.ts +7 -0
- package/dist/client/ThemeProvider.d.ts.map +1 -1
- package/dist/client/index.js +107 -2673
- package/dist/client/index.js.map +1 -1
- package/dist/client/useIsNavigationPending.d.ts.map +1 -1
- package/dist/client/useMutate.d.ts.map +1 -1
- package/dist/database/index.js +2 -2
- package/dist/database/index.js.map +1 -1
- package/dist/facades/index.js +2 -2
- package/dist/facades/index.js.map +1 -1
- package/dist/http/index.js +2 -2
- package/dist/http/index.js.map +1 -1
- package/dist/i18n/Dictionary.d.ts.map +1 -1
- package/dist/i18n/index.js +2 -2
- package/dist/i18n/index.js.map +3 -3
- package/dist/kernel/index.js +2 -2
- package/dist/kernel/index.js.map +2 -2
- package/dist/orm/index.js +2 -2
- package/dist/orm/index.js.map +2 -2
- package/dist/server/index.js +1 -1
- package/dist/services/index.js +2 -2
- package/dist/services/index.js.map +2 -2
- package/dist/testing/Page.d.ts +166 -0
- package/dist/testing/Page.d.ts.map +1 -0
- package/dist/testing/index.d.ts +3 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +352 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/utils/Subject.d.ts.map +1 -1
- package/dist/utils/variantKey.d.ts +19 -0
- package/dist/utils/variantKey.d.ts.map +1 -0
- package/package.json +2 -1
- package/dist/chunk-0tbwn6er.js +0 -5
- package/dist/chunk-f29vd5mc.js +0 -5
- package/dist/chunk-hbycemy5.js +0 -6
- package/dist/chunk-qj4mmner.js +0 -4
- /package/dist/{chunk-a0sy9f9x.js.map → chunk-07jtzbf0.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useIsNavigationPending.d.ts","sourceRoot":"","sources":["../../client/useIsNavigationPending.ts"],"names":[],"mappings":"AAGA,wBAAgB,sBAAsB,
|
|
1
|
+
{"version":3,"file":"useIsNavigationPending.d.ts","sourceRoot":"","sources":["../../client/useIsNavigationPending.ts"],"names":[],"mappings":"AAGA,wBAAgB,sBAAsB,YAerC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMutate.d.ts","sourceRoot":"","sources":["../../client/useMutate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGnE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGzC,KAAK,MAAM,GAAG;KACX,CAAC,IAAI,MAAM,GAAG,IAAI,CAAC,SAAS,OAAO,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC;CACnE,CAAC;AAEF,KAAK,IAAI,CAAC,CAAC,SAAS,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"useMutate.d.ts","sourceRoot":"","sources":["../../client/useMutate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGnE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGzC,KAAK,MAAM,GAAG;KACX,CAAC,IAAI,MAAM,GAAG,IAAI,CAAC,SAAS,OAAO,MAAM,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC;CACnE,CAAC;AAEF,KAAK,IAAI,CAAC,CAAC,SAAS,MAAM,MAAM,IAC9B,MAAM,CAAC,CAAC,CAAC,SAAS,gBAAgB,CAAC,GAAG,EAAE,MAAM,IAAI,EAAE,GAAG,CAAC,GACpD,aAAa,CAAC,IAAI,CAAC,GACnB,KAAK,CAAC;AAEZ,wBAAgB,SAAS,KAEA,CAAC,SAAS,MAAM,MAAM,EAC3C,SAAS;IACP,IAAI,EAAE,CAAC,CAAC;IACR,MAAM,CAAC,EAAE,SAAS,CAAC,GAAG,CAAC,GAAG,MAAM,EAAE,CAAC,CAAC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC9B,EACD,KACI,CAAC,CAAC,IAAI,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAC5D,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SA+C9B"}
|
package/dist/database/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{p as b}from"../chunk-
|
|
2
|
+
import{p as b}from"../chunk-qjnv2rkh.js";import"../chunk-ttzkn1qd.js";import{Cc as e,Dc as o,Ec as r,Fc as n,Gc as a,Hc as t,Ic as i,Jc as s,Kc as C,Lc as f,Mc as D,Nc as c,Oc as p}from"../chunk-tkv6cw94.js";import"../chunk-cg53h5ht.js";import"../chunk-3y9nf09k.js";import"../chunk-0h3jr9d9.js";export{n as isSqlite,a as isMysqlFamily,r as inferDialect,c as defineDatabaseConfig,p as databaseConfigDefaults,e as UnknownDatabaseUrlError,i as UnknownConnectionError,s as ReservedConnectionNameError,o as MissingDatabaseUrlError,b as DatabaseServiceProvider,D as DatabaseManager,t as DEFAULT_CONNECTION,C as CrossConnectionTransactionError,f as Connection};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=FF7E217A7DC0FB5D64756E2164756E21
|
package/dist/facades/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Hb as c,Ib as d,Ob as f,_b as g,dc as h,ec as i,fc as j,gc as k,ic as l,jc as m,kc as n,lc as o}from"../chunk-ear03axe.js";import"../chunk-7s1g3v1y.js";import"../chunk-tkv6cw94.js";import{id as b,jd as e}from"../chunk-y4djde42.js";import{Gd as a}from"../chunk-3d3nmr5g.js";import"../chunk-bq4w14a6.js";import"../chunk-cg53h5ht.js";import"../chunk-92793zh4.js";import"../chunk-3y9nf09k.js";import"../chunk-88pq4gmf.js";import"../chunk-mt2755rs.js";import"../chunk-qyaqg07q.js";import"../chunk-0h3jr9d9.js";export{i as Url,f as Storage,l as Redis,a as Redirect,m as RateLimiter,h as Query,j as Meta,g as Log,e as Lang,b as Facade,o as DB,k as Cookie,n as ConnectionQueries,c as Broadcast,d as Auth};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=25F5EC18D86D946C64756E2164756E21
|
package/dist/http/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{$d as H,Ad as o,Bd as p,Cd as q,Dd as r,Ed as s,Hd as t,Id as u,Jd as v,Kd as w,Ld as x,Md as y,Sd as z,Td as A,Ud as B,Wd as C,Xd as D,Yd as E,Zd as F,_d as G,kd as a,ld as b,nd as c,od as d,pd as e,qd as f,rd as g,sd as h,ud as i,vd as j,wd as k,xd as l,yd as m,zd as n}from"../chunk-
|
|
2
|
+
import{$d as H,Ad as o,Bd as p,Cd as q,Dd as r,Ed as s,Hd as t,Id as u,Jd as v,Kd as w,Ld as x,Md as y,Sd as z,Td as A,Ud as B,Wd as C,Xd as D,Yd as E,Zd as F,_d as G,kd as a,ld as b,nd as c,od as d,pd as e,qd as f,rd as g,sd as h,ud as i,vd as j,wd as k,xd as l,yd as m,zd as n}from"../chunk-3d3nmr5g.js";import"../chunk-bq4w14a6.js";import"../chunk-cg53h5ht.js";import"../chunk-92793zh4.js";import"../chunk-3y9nf09k.js";import"../chunk-mt2755rs.js";import"../chunk-qyaqg07q.js";import"../chunk-0h3jr9d9.js";export{e as toRangeHeaderValue,d as resolveRange,c as parseRangeHeader,f as parseContentRange,y as middlewareConfigDefaults,w as getCookies,h as formatUnsatisfiedContentRange,g as formatContentRange,x as defineMiddlewareConfig,l as createUnsatisfiableResponse,m as createStreamResponse,t as createFileResponse,E as clientIp,u as ViewRouter,j as ValidationError,b as ResourceController,i as RequestBreakerError,D as RateLimitMiddleware,C as RateLimitExceededError,p as RangeNotSatisfiableError,G as PoliciesServiceProvider,H as Policies,v as Middleware,o as InsufficientPermissionsError,k as HttpRequest,q as FileNotFoundError,B as CorsMiddleware,a as Controller,A as CacheMiddleware,F as CSRFMiddleware,n as AuthorizationError,z as AuthenticationMiddleware,r as AuthenticationError,s as ApiRouter};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=7519E40AFFF1950164756E2164756E21
|
package/dist/http/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dictionary.d.ts","sourceRoot":"","sources":["../../i18n/Dictionary.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Dictionary.d.ts","sourceRoot":"","sources":["../../i18n/Dictionary.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,sBAAsB,EACtB,4BAA4B,EAC5B,QAAQ,EACT,MAAM,eAAe,CAAC;AAEvB,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAE3D,qBAAa,UAAU,CAAC,CAAC,SAAS,YAAY;IAEnC,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,CAAC;gBADb,IAAI,EAAE,MAAM,EACZ,UAAU,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,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACtD;KACF,GACJ,MAAM;CASV"}
|
package/dist/i18n/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{M as
|
|
2
|
+
import{M as $}from"../chunk-2qn472j4.js";import{Ab as K,zb as C}from"../chunk-msz8rngs.js";import"../chunk-ttzkn1qd.js";import{jd as h}from"../chunk-y4djde42.js";import"../chunk-92793zh4.js";import"../chunk-3y9nf09k.js";import{Ie as S}from"../chunk-88pq4gmf.js";import"../chunk-mt2755rs.js";import"../chunk-qyaqg07q.js";import"../chunk-0h3jr9d9.js";import{createElement as R,Fragment as x,isValidElement as b}from"react";function P(r,n){let s=Object.values(n).some((i)=>typeof i==="function"&&b(i(""))),f=/{{([^{}]+?)(?::([^{}\[\]]+?))?(?:\[(.*?)\])?}}/g;if(!s)return r.replace(f,(e,d,T,a)=>{let g=d.includes(":")?d.split(":")[0]:d,o=n[g];if(o===void 0)return e;if(typeof o==="function"){let w=o(a!==void 0?a:"");if(b(w))throw Error("JSX returned in string context");return String(w)}if(T)switch(T.toLowerCase()){case"number":return Number(o).toString();case"string":return String(o);case"boolean":return Boolean(o).toString();default:return String(o)}return String(o)});else{let i=[],e=0,d=null;while((d=f.exec(r))!==null){let[T,a,g,o]=d,c=d.index,w=a.includes(":")?a.split(":")[0]:a;if(c>e)i.push(r.substring(e,c));let t=n[w];if(t===void 0)i.push(T);else if(typeof t==="function"){let U=t(o!==void 0?o:"");i.push(U)}else if(g)switch(g.toLowerCase()){case"number":i.push(Number(t).toString());break;case"string":i.push(String(t));break;case"boolean":i.push(Boolean(t).toString());break;default:i.push(String(t))}else i.push(String(t));e=c+T.length}if(e<r.length)i.push(r.substring(e));return R(x,{},...i)}}class y{name;dictionary;constructor(r,n){this.name=r;this.dictionary=n}reference(r){if(typeof window<"u")throw Error("Cannot use reference in the browser");if(!this.dictionary?.[r])throw Error(`Translation not found for ${String(r)}`);return this.dictionary[r]}render(r,...n){let{locale:s=h.locale(),params:f}={params:{},...n[0]};if(typeof window<"u")throw Error("Cannot use render in the browser");if(!this.dictionary?.[r]?.[s])throw Error(`Translation not found for ${String(r)} in ${String(s)}`);return P(this.dictionary[r][s],f??{})}static create(r,n){return new y(r,n)}static text(r,...n){let{locale:s=h.locale(),params:f}={params:{},...n?.[0]};if(!r?.[s])throw Error(`Translation not found for ${String(s)}`);return P(r[s],f??{})}}export{K as translationConfigDefaults,C as defineTranslationConfig,S as Translator,$ as TranslationServiceProvider,y as Dictionary};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
4
|
+
//# debugId=CF598147D467E95464756E2164756E21
|
package/dist/i18n/index.js.map
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
"sources": ["../utils/parseTranslation.tsx", "../i18n/Dictionary.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"import { createElement, Fragment, isValidElement, type JSX } from \"react\";\n\ntype TemplateParams = Record<\n string,\n string | ((p: unknown) => string | JSX.Element)\n>;\n\nexport function parseTranslation(template: string, params: TemplateParams) {\n // Check if we have any JSX in our parameters\n const hasJSX = Object.values(params).some(\n (value) =>\n typeof value === \"function\" &&\n isValidElement((value as (p: unknown) => unknown)(\"\")),\n );\n\n // Regular expression to match template variables:\n // {{name}} - simple variable\n // {{name:type}} - variable with type casting\n // {{name:[content]}} - variable with interpolated content\n const regex = /{{([^{}]+?)(?::([^{}\\[\\]]+?))?(?:\\[(.*?)\\])?}}/g;\n\n if (!hasJSX) {\n // Simple string replacement\n const result = template.replace(regex, (match, name, type, content) => {\n // Clean the name part by removing any colon if present\n const cleanName = name.includes(\":\") ? name.split(\":\")[0] : name;\n\n const value = params[cleanName];\n if (value === undefined) {\n return match; // Return original match if no parameter found\n }\n\n if (typeof value === \"function\") {\n // If value is a function, call it with the content if available\n const functionParam = content !== undefined ? content : \"\";\n const functionResult = value(functionParam);\n // Check if function returned JSX - this shouldn't happen in the string branch\n if (isValidElement(functionResult)) {\n throw new Error(\"JSX returned in string context\");\n }\n return String(functionResult);\n }\n\n // Handle type casting if specified\n if (type) {\n switch (type.toLowerCase()) {\n case \"number\":\n return Number(value).toString();\n case \"string\":\n return String(value);\n case \"boolean\":\n return Boolean(value).toString();\n default:\n return String(value);\n }\n }\n return String(value);\n });\n return result as any;\n } else {\n // JSX replacement - we'll split the template into parts\n const parts: Array<string | JSX.Element> = [];\n let lastIndex = 0;\n let match: RegExpExecArray | null = null;\n\n while ((match = regex.exec(template)) !== null) {\n const [fullMatch, name, type, content] = match;\n const matchIndex = match.index;\n\n // Clean the name part by removing any colon if present\n const cleanName = name.includes(\":\") ? name.split(\":\")[0] : name;\n\n // Add text before the match\n if (matchIndex > lastIndex) {\n parts.push(template.substring(lastIndex, matchIndex));\n }\n\n const value = params[cleanName];\n if (value === undefined) {\n // Keep original template variable if no parameter found\n parts.push(fullMatch);\n } else if (typeof value === \"function\") {\n // If value is a function, call it with the content if available\n const functionParam = content !== undefined ? content : \"\";\n const functionResult = value(functionParam);\n parts.push(functionResult);\n } else if (type) {\n // Handle type casting if specified\n switch (type.toLowerCase()) {\n case \"number\":\n parts.push(Number(value).toString());\n break;\n case \"string\":\n parts.push(String(value));\n break;\n case \"boolean\":\n parts.push(Boolean(value).toString());\n break;\n default:\n parts.push(String(value));\n }\n } else {\n parts.push(String(value));\n }\n\n lastIndex = matchIndex + fullMatch.length;\n }\n\n // Add any remaining text\n if (lastIndex < template.length) {\n parts.push(template.substring(lastIndex));\n }\n\n // Convert the parts array to JSX\n return createElement(Fragment, {}, ...parts) as any;\n }\n}\n",
|
|
6
|
-
"import { Lang } from \"../facades\";\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 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"
|
|
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 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
|
],
|
|
8
|
-
"mappings": ";
|
|
9
|
-
"debugId": "
|
|
8
|
+
"mappings": ";0YAAA,mBAAS,SAAe,eAAU,SAO3B,IAAS,JAAgB,JAAC,HAAkB,HAAwB,CAEzE,IAAM,EAAS,OAAO,OAAO,CAAM,EAAE,KACn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|
|
11
11
|
}
|
package/dist/kernel/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{p as X}from"../chunk-
|
|
2
|
+
import{p as X}from"../chunk-qjnv2rkh.js";import{L as m}from"../chunk-fbp5vapa.js";import{M as Y}from"../chunk-2qn472j4.js";import{Ma as H,Na as W,Oa as Z,Pa as _,Qa as $,Ra as F,Sa as T,Va as V,Wa as y,Za as K,_a as L,fb as Q,ib as U,jb as B}from"../chunk-1pqfmw5h.js";import{mb as k}from"../chunk-tmk4zfz9.js";import"../chunk-msz8rngs.js";import"../chunk-ha7n1c94.js";import"../chunk-ttzkn1qd.js";import{Gb as I,bc as b,cc as f}from"../chunk-ear03axe.js";import"../chunk-7s1g3v1y.js";import"../chunk-tkv6cw94.js";import"../chunk-y4djde42.js";import{Qd as w}from"../chunk-3d3nmr5g.js";import{de as D}from"../chunk-bq4w14a6.js";import"../chunk-cg53h5ht.js";import"../chunk-92793zh4.js";import"../chunk-3y9nf09k.js";import"../chunk-cmq5t8p9.js";import"../chunk-88pq4gmf.js";import{Je as G,Le as x}from"../chunk-mt2755rs.js";import"../chunk-qyaqg07q.js";import"../chunk-0h3jr9d9.js";var E=[T,y,X,B,W,_,V,$,L,U,K,F,Y,Q,Z];class M{config={};providers=[];services=[];serviceInstances=[];serviceTokens=new Set;servicesBooted=!1;models=[];app=new x;boot(){if(this.models.length>0)m(...this.models);else R();this.app.config.merge(this.config),x.setInstance(this.app),this.app.registerMany([...E,...this.providers]),this.registerServices()}registerServices(){let q=this.serviceTokens;this.serviceInstances=[],this.serviceTokens=new Set,this.servicesBooted=!1;let J=new Map;for(let z of this.services){let C=typeof z==="function"?new z:z,j=C.constructor;if(!j.token)throw Error(`Service [${j.name}] is listed in \`services\` but does not declare a \`static token\`.`);let N=J.get(j.token);if(N)throw Error(`Services [${N}] and [${j.name}] both declare the token "${j.token}". Tokens are the container's keys, so they must be unique.`);J.set(j.token,j.name);let O=j;if(!q.has(j.token)&&this.app.bound(O))throw Error(`Service [${j.name}] declares the token "${j.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(O,C),this.serviceInstances.push(C),this.serviceTokens.add(j.token)}}async waitForBoot(){await this.app.boot(),await this.bootServices()}async bootServices(){if(this.servicesBooted)return;for(let q of this.serviceInstances)await q.boot();this.servicesBooted=!0}run(q){return G.run(this.app,q)}resolve(q){return this.app.make(q)}apiRoutes(){return this.app.make(f)}viewRoutes(){return this.app.make(b)}broadcast(){return this.app.make(I)}queue(){return this.app.make(k)}destroy(){if(this.app.resolved(H))this.app.make(H).stop();if(this.app.flush(),x.getInstance()===this.app)x.setInstance(void 0);G.disable()}}function R(){if(Bun.env.NODE_ENV==="production")return;let q=D();if(q.length===0)return;console.warn(`[gemi] ${q.length} model${q.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{p as X}from"../chunk-53e48ce8.js";import{L as m}from"../chunk-38ma6gg3.js
|
|
|
13
13
|
|
|
14
14
|
See docs/orm.md#your-model-class. Development only; this never prints in production.`)}export{E as frameworkProviders,w as UserProvider,M as Kernel};
|
|
15
15
|
|
|
16
|
-
//# debugId=
|
|
16
|
+
//# debugId=744E823E3A8AD41164756E2164756E21
|
package/dist/kernel/index.js.map
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"import type { ServiceProviderConstructor } from \"../foundation/Application\";\nimport { AuthServiceProvider } from \"../auth/AuthServiceProvider\";\nimport { DatabaseServiceProvider } from \"../database/DatabaseServiceProvider\";\nimport { TranslationServiceProvider } from \"../i18n/TranslationServiceProvider\";\nimport { ScheduleServiceProvider } from \"../services/cron/ScheduleServiceProvider\";\nimport { MailServiceProvider } from \"../services/email/MailServiceProvider\";\nimport { FilesystemServiceProvider } from \"../services/file-storage/FilesystemServiceProvider\";\nimport { ImageServiceProvider } from \"../services/image-optimization/ImageServiceProvider\";\nimport { KernelIdServiceProvider } from \"../services/kernel-id/KernelIdServiceProvider\";\nimport { LogServiceProvider } from \"../services/logging/LogServiceProvider\";\nimport { MiddlewareServiceProvider } from \"../services/middleware/MiddlewareServiceProvider\";\nimport { BroadcastServiceProvider } from \"../services/pubsub/BroadcastServiceProvider\";\nimport { QueueServiceProvider } from \"../services/queue/QueueServiceProvider\";\nimport { RateLimiterServiceProvider } from \"../services/rate-limiter/RateLimiterServiceProvider\";\nimport { RedisServiceProvider } from \"../services/redis/RedisServiceProvider\";\nimport { RouteServiceProvider } from \"../services/router/RouteServiceProvider\";\n\n/**\n * The providers every gemi app boots with, in registration order. Fifteen\n * providers for sixteen services — `RouteServiceProvider` owns both the api and\n * the view dispatcher, the way Laravel's does.\n *\n * Order only matters for `boot()`; `register()` binds factories and resolves\n * nothing, so no provider here depends on an earlier one having run.\n */\nexport const frameworkProviders: ServiceProviderConstructor[] = [\n KernelIdServiceProvider,\n MiddlewareServiceProvider,\n DatabaseServiceProvider,\n RouteServiceProvider,\n AuthServiceProvider,\n MailServiceProvider,\n LogServiceProvider,\n FilesystemServiceProvider,\n QueueServiceProvider,\n RedisServiceProvider,\n BroadcastServiceProvider,\n ImageServiceProvider,\n TranslationServiceProvider,\n RateLimiterServiceProvider,\n ScheduleServiceProvider,\n];\n",
|
|
6
6
|
"import { Application } from \"../foundation/Application\";\nimport type { ServiceProviderConstructor } from \"../foundation/Application\";\nimport type { ServiceToken } from \"../container/Container\";\nimport type { ConfigItems } from \"../support/Repository\";\nimport type { Service, ServiceConstructor } from \"../support/Service\";\nimport { registerModels } from \"../orm/registration\";\nimport { registeredNames } from \"../orm/registry\";\nimport { Scheduler } from \"../services/cron/Scheduler\";\nimport { BroadcastManager } from \"../services/pubsub/BroadcastManager\";\nimport { QueueManager } from \"../services/queue/QueueManager\";\nimport { ApiRouteDispatcher } from \"../services/router/ApiRouteDispatcher\";\nimport { ViewRouteDispatcher } from \"../services/router/ViewRouteDispatcher\";\nimport { kernelContext } from \"./context\";\nimport { frameworkProviders } from \"./providers\";\n\n/**\n * The app's entry point into the framework. A Kernel subclass declares what the\n * app adds — its `config` slices and any extra `providers` — and everything\n * else lives in the Application container it owns.\n */\nexport class Kernel {\n /**\n * App-level config, merged over the framework defaults. Each key is a config\n * slice: `{ mail: { ... }, route: { ... } }`, normally the modules under\n * `app/config`.\n */\n protected config: ConfigItems = {};\n\n /**\n * App-level providers, registered after the framework's own so they can\n * rebind anything the framework bound.\n */\n protected providers: ServiceProviderConstructor[] = [];\n\n /**\n * The app's own singleton services. Each is constructed during the\n * synchronous boot phase and its `boot()` awaited during the asynchronous\n * one, in the order listed — so a service whose `boot()` depends on another\n * goes after it.\n *\n * An entry is either the class itself or a configured instance from\n * `Service.with({ ... })`. Listing is explicit rather than discovered because\n * the order is load-bearing here, and because a service is always imported by\n * whatever injects it — there is no file the import graph would miss.\n */\n protected services: Array<ServiceConstructor | Service> = [];\n\n private serviceInstances: Service[] = [];\n private serviceTokens = new Set<string>();\n private servicesBooted = false;\n\n /**\n * The modules holding the app's model classes — normally\n * `[generated, models]`, the generated namespace and the barrel of subclasses\n * written over it. Every model class they export is registered under the name\n * its schema carries, later modules winning, and the whole set is audited\n * before anything else boots.\n *\n * ### Why this is a Kernel field and not a line in a file somewhere\n *\n * Registration used to be `register(\"User\", User)` next to each subclass, and\n * the failure mode of forgetting it is an authorization hole that nothing\n * reports: a relation read resolves its target by name, so an unregistered\n * policied subclass leaves the generated base owning the name and every\n * nested `include` of that model comes back unscoped. No error at the root\n * either, because `$exec`'s divergence guard begins `registered !== this` and\n * the base it is running on *is* the registered one. A model only ever read\n * through an include — a membership, a pivot, the kind that carries a tenant\n * scope — never trips anything.\n *\n * Listing the modules here says it once, in the same place the app already\n * declares its config slices and providers, and turns the mistake into a\n * failure to boot rather than a quiet cross-tenant read.\n *\n * It sees the modules it is given, so a model class in a file that no barrel\n * re-exports is still invisible. That is the residual, and it is a smaller\n * one: a barrel is a place to notice an omission, and thirteen `register`\n * lines scattered across thirteen files is not.\n */\n protected models: Array<Record<string, unknown>> = [];\n\n readonly app = new Application();\n\n /**\n * Phase one, synchronous: every provider is constructed and its `register()`\n * runs. Only bindings are recorded here — no service is instantiated, so this\n * is safe to call from a synchronous constructor (`new App({ kernel })`).\n * Phase two is `waitForBoot()`.\n */\n boot() {\n // Before the container, deliberately. This throws on a model whose policies\n // would be skipped, and the useful moment for that is the one where nothing\n // has been constructed and no request can be in flight.\n if (this.models.length > 0) registerModels(...this.models);\n else warnIfModelsAreRegisteredButUndeclared();\n\n this.app.config.merge(this.config);\n Application.setInstance(this.app);\n this.app.registerMany([...frameworkProviders, ...this.providers]);\n this.registerServices();\n }\n\n /**\n * Constructs every listed service and binds it into the container. Runs after\n * the providers have registered, so a provider's `boot()` can `inject()` one;\n * a `Service` constructor does no I/O, so doing this synchronously costs\n * nothing beyond the field initializers.\n */\n private registerServices() {\n // What a previous pass bound, so re-running this on the same kernel is not\n // mistaken for a collision with something else.\n const ours = this.serviceTokens;\n\n this.serviceInstances = [];\n this.serviceTokens = new Set();\n this.servicesBooted = false;\n\n const owners = new Map<string, string>();\n\n for (const declaration of this.services) {\n const instance =\n typeof declaration === \"function\" ? new declaration() : declaration;\n const ctor = instance.constructor as ServiceConstructor;\n\n if (!ctor.token) {\n throw new Error(\n `Service [${ctor.name}] is listed in \\`services\\` but does not declare a \\`static token\\`.`,\n );\n }\n\n // Two services under one token is the failure this refuses to have\n // silently: the second would replace the first in the container, and\n // every `inject()` written against either would hand back whichever was\n // listed last.\n const owner = owners.get(ctor.token);\n if (owner) {\n throw new Error(\n `Services [${owner}] and [${ctor.name}] both declare the token \"${ctor.token}\". Tokens are the container's keys, so they must be unique.`,\n );\n }\n owners.set(ctor.token, ctor.name);\n\n // The same failure one level out. `Container.instance()` writes into\n // `instances`, which `make()` consults before `bindings`, so a token that\n // is already spoken for is not shared with its owner — it replaces it, for\n // every `app()` and `inject()` in the process. An app service that named\n // itself \"mail\" would leave `Mail.send()` resolving to an object with no\n // `send`, and the boot that caused it would report nothing. Providers have\n // all registered by now, so anything bound here belongs to somebody else.\n const token = ctor as unknown as ServiceToken<Service>;\n if (!ours.has(ctor.token) && this.app.bound(token)) {\n throw new Error(\n `Service [${ctor.name}] declares the token \"${ctor.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.`,\n );\n }\n\n this.app.instance(token, instance);\n this.serviceInstances.push(instance);\n this.serviceTokens.add(ctor.token);\n }\n }\n\n /**\n * Phase two, asynchronous: every provider's `boot()` runs, in registration\n * order, after all of them have registered. Idempotent.\n */\n async waitForBoot() {\n await this.app.boot();\n await this.bootServices();\n }\n\n /**\n * Phase two for services, after every provider's `boot()` — so a service may\n * use the facades and anything else a provider owns. Idempotent, like the\n * provider phase it follows.\n */\n private async bootServices() {\n if (this.servicesBooted) {\n return;\n }\n for (const service of this.serviceInstances) {\n await service.boot();\n }\n this.servicesBooted = true;\n }\n\n run<T>(cb: () => T) {\n return kernelContext.run(this.app, cb);\n }\n\n /**\n * Resolve a service by token. Callers outside this module should prefer the\n * named accessors below or `app()`; this exists for tooling that holds a\n * Kernel but no ambient context.\n */\n resolve<T>(token: ServiceToken<T>): T {\n return this.app.make(token);\n }\n\n // Named accessors. `app/App.ts` goes through these rather than importing the\n // service classes itself — see the note in that file about the two copies of\n // gemi that coexist at build time.\n apiRoutes(): ApiRouteDispatcher {\n return this.app.make(ApiRouteDispatcher);\n }\n\n viewRoutes(): ViewRouteDispatcher {\n return this.app.make(ViewRouteDispatcher);\n }\n\n broadcast(): BroadcastManager {\n return this.app.make(BroadcastManager);\n }\n\n queue(): QueueManager {\n return this.app.make(QueueManager);\n }\n\n destroy() {\n // Only touch services that were actually resolved — resolving one here\n // would construct it purely to tear it down.\n if (this.app.resolved(Scheduler)) {\n this.app.make(Scheduler).stop();\n }\n\n this.app.flush();\n\n if (Application.getInstance() === this.app) {\n Application.setInstance(undefined);\n }\n\n kernelContext.disable();\n }\n}\n\n/**\n * Says something to an application that has models and has not declared them.\n *\n * Without this the fix for #316 defaults to off. `models` is `[]`, `boot()`\n * no-ops, and an app upgrading from 0.48 is in exactly the state the issue\n * describes until somebody edits their Kernel by hand — while the only place\n * that says to is the **Setup** section of `docs/orm.md`, which an existing app\n * read once and will not read again. #316 was filed by an app mid-migration\n * with a 79-model schema, which is precisely the reader who never sees it.\n *\n * The condition is what makes this worth printing. A populated registry with an\n * empty `models` means the generated `index.ts` was imported and its bases are\n * what every nested read resolves to — so if any policy lives on a subclass, it\n * is being skipped inside includes right now. A Kernel with no ORM at all has\n * an empty registry and hears nothing.\n *\n * Development only, and a warning rather than a throw: an app in this state is\n * running today, and turning a working deploy into a failure to start over an\n * arrangement that *might* be fine is not a patch-level thing to do. The\n * failure it points at is silent, so the fix for it has to be noisy somewhere,\n * and the terminal an author is already looking at is the cheapest somewhere\n * there is.\n */\nfunction warnIfModelsAreRegisteredButUndeclared(): void {\n if (process.env.NODE_ENV === \"production\") return;\n\n const registered = registeredNames();\n if (registered.length === 0) return;\n\n console.warn(\n `[gemi] ${registered.length} model${registered.length === 1 ? \" is\" : \"s are\"} ` +\n `registered, but Kernel.models is empty.\\n` +\n ` Nested relation reads resolve a model by name, so a policy on a ` +\n `subclass that does not own its\\n` +\n ` name is skipped inside every include — scoped at the root, ` +\n `unscoped in an include, with nothing\\n` +\n ` to notice it. Declaring the modules registers each class under ` +\n `its own name and audits the set:\\n\\n` +\n ` import * as generated from \"../models/generated\"\\n` +\n ` import * as models from \"../models\"\\n\\n` +\n ` export default class extends Kernel {\\n` +\n ` models = [generated, models]\\n` +\n ` }\\n\\n` +\n ` See docs/orm.md#your-model-class. Development only; this never ` +\n `prints in production.`,\n );\n}\n"
|
|
7
7
|
],
|
|
8
|
-
"mappings": ";
|
|
9
|
-
"debugId": "
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