gemi 0.4.91 → 0.4.93
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/app/App.d.ts +2 -24
- package/dist/app/App.d.ts.map +1 -1
- package/dist/app/index.js +1 -1
- package/dist/bin/index.js +73 -31
- package/dist/broadcasting/index.js +1 -1
- package/dist/{chunk-8ee09f1f74206a04.js → chunk-035e233acf299392.js} +2 -2
- package/dist/chunk-04f04986e53516f0.js +2 -0
- package/dist/chunk-0f0add364d3ea615.js +2 -0
- package/dist/chunk-0fd23409fff0376b.js +2 -0
- package/dist/chunk-1770e9abf10029e0.js +2 -0
- package/dist/chunk-2573b2361de4a370.js +2 -0
- package/dist/{chunk-fcd9eb76c67113d3.js → chunk-2f8839f406606d63.js} +1 -1
- package/dist/{chunk-7d5fe4acabfee228.js → chunk-33abc8f4f7df6791.js} +2 -2
- package/dist/chunk-494de321e3423d54.js +2 -0
- package/dist/chunk-496c32676431beab.js +18 -0
- package/dist/chunk-6286081da32e2feb.js +2 -0
- package/dist/{chunk-24a86f8f5ddc0cbd.js → chunk-7ce930fe69575c87.js} +1 -1
- package/dist/chunk-8fec55214eb03a61.js +9 -0
- package/dist/chunk-9a9d43e4b919c267.js +2 -0
- package/dist/chunk-b6fb088270ea6584.js +3 -0
- package/dist/chunk-c459f3e37965c22f.js +2 -0
- package/dist/{chunk-0ba2cc302113ab40.js → chunk-cfb8c5b12b0e5378.js} +2 -2
- package/dist/chunk-cfbe2cbcadcb1ac1.js +2 -0
- package/dist/chunk-d09948245f5b426d.js +2 -0
- package/dist/chunk-d7525516b1305ba3.js +6 -0
- package/dist/{chunk-332553172e3ab961.js → chunk-dfb863d471bf3b18.js} +2 -2
- package/dist/{chunk-28694e5e949df0ff.js → chunk-e1929f0f7003fbdf.js} +2 -2
- package/dist/chunk-e76c7e3bf2d698af.js +2 -0
- package/dist/chunk-eabfa03c809e14df.js +2 -0
- package/dist/{chunk-43b1a27bc037bc09.js → chunk-ef791082443c0cbd.js} +1 -1
- package/dist/{chunk-201d67e6e22cc14b.js → chunk-f10ba402aaacfc12.js} +2 -2
- package/dist/client/ClientRouterContext.d.ts.map +1 -1
- package/dist/client/ServerDataProvider.d.ts +5 -1
- package/dist/client/ServerDataProvider.d.ts.map +1 -1
- package/dist/client/i18n/I18nContext.d.ts.map +1 -1
- package/dist/client/index.js +16 -14
- package/dist/email/index.js +1 -1
- package/dist/facades/index.js +1 -1
- package/dist/http/I18nServiceContainer.d.ts.map +1 -1
- package/dist/http/index.js +1 -1
- package/dist/kernel/Kernel.d.ts +5 -4
- package/dist/kernel/Kernel.d.ts.map +1 -1
- package/dist/kernel/context.d.ts +2 -2
- package/dist/kernel/context.d.ts.map +1 -1
- package/dist/kernel/index.js +1 -1
- package/dist/server/index.js +5 -5
- package/dist/services/ServiceProvider.d.ts +1 -1
- package/dist/services/ServiceProvider.d.ts.map +1 -1
- package/dist/services/index.js +1 -1
- package/dist/services/router/ViewRouterServiceContainer.d.ts +12 -0
- package/dist/services/router/ViewRouterServiceContainer.d.ts.map +1 -0
- package/dist/services/router/ViewRouterServiceProvider.d.ts +13 -0
- package/dist/services/router/ViewRouterServiceProvider.d.ts.map +1 -0
- package/dist/services/router/createComponentTree.d.ts +4 -0
- package/dist/services/router/createComponentTree.d.ts.map +1 -0
- package/dist/services/router/createComponentTree.test.d.ts +2 -0
- package/dist/services/router/createComponentTree.test.d.ts.map +1 -0
- package/dist/services/router/createFlatViewRoutes.d.ts +14 -0
- package/dist/services/router/createFlatViewRoutes.d.ts.map +1 -0
- package/dist/services/router/createFlatViewRoutes.test.d.ts +2 -0
- package/dist/services/router/createFlatViewRoutes.test.d.ts.map +1 -0
- package/dist/services/router/createRouteManifest.d.ts +3 -0
- package/dist/services/router/createRouteManifest.d.ts.map +1 -0
- package/dist/services/router/createRouteManifest.test.d.ts +2 -0
- package/dist/services/router/createRouteManifest.test.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/app/Plugin.d.ts +0 -10
- package/dist/app/Plugin.d.ts.map +0 -1
- package/dist/app/createComponentTree.d.ts +0 -4
- package/dist/app/createComponentTree.d.ts.map +0 -1
- package/dist/app/createFlatViewRoutes.d.ts +0 -10
- package/dist/app/createFlatViewRoutes.d.ts.map +0 -1
- package/dist/app/createRouteManifest.d.ts +0 -3
- package/dist/app/createRouteManifest.d.ts.map +0 -1
- package/dist/chunk-19790c50198f1898.js +0 -2
- package/dist/chunk-2b9b6009ebe271d3.js +0 -2
- package/dist/chunk-32d1342f9f8391c0.js +0 -2
- package/dist/chunk-3a6838d9e6866471.js +0 -2
- package/dist/chunk-53b7d6267c9172bc.js +0 -2
- package/dist/chunk-7085d9454a422181.js +0 -2
- package/dist/chunk-809308720fc22418.js +0 -2
- package/dist/chunk-900bf3955cb1bbab.js +0 -2
- package/dist/chunk-931a005d4bb28ffe.js +0 -2
- package/dist/chunk-9475c6ed18013dc8.js +0 -2
- package/dist/chunk-967cb54562e3d29b.js +0 -3
- package/dist/chunk-b94896500a1345bf.js +0 -2
- package/dist/chunk-bce765dc10669cd0.js +0 -6
- package/dist/chunk-bdac4694bbb37064.js +0 -1
- package/dist/chunk-c3c17a7115770391.js +0 -2
- package/dist/chunk-d1e1b959b1124e74.js +0 -18
- package/dist/chunk-f6a9cd06681eb0dc.js +0 -9
- package/dist/server/generateEtag.d.ts +0 -2
- package/dist/server/generateEtag.d.ts.map +0 -1
package/dist/app/App.d.ts
CHANGED
|
@@ -1,46 +1,24 @@
|
|
|
1
1
|
import type { ApiRouter } from "../http/ApiRouter";
|
|
2
2
|
import { ViewRouter } from "../http/ViewRouter";
|
|
3
|
-
import type { ComponentTree } from "../client/types";
|
|
4
|
-
import type { Plugin } from "./Plugin";
|
|
5
|
-
import type { Middleware } from "../http/Middleware";
|
|
6
3
|
import type { WebSocketHandler } from "bun";
|
|
7
4
|
import { ComponentType } from "react";
|
|
8
5
|
import { Kernel } from "../kernel";
|
|
9
|
-
interface RenderParams {
|
|
10
|
-
styles: string[];
|
|
11
|
-
manifest: Record<string, any>;
|
|
12
|
-
serverManifest: Record<string, any>;
|
|
13
|
-
bootstrapModules?: string[];
|
|
14
|
-
}
|
|
15
6
|
interface AppParams {
|
|
16
7
|
viewRouter: new () => ViewRouter;
|
|
17
8
|
apiRouter: new () => ApiRouter;
|
|
18
|
-
plugins?: (new () => Plugin)[];
|
|
19
|
-
middlewareAliases?: Record<string, new () => Middleware>;
|
|
20
9
|
root: ComponentType;
|
|
21
10
|
kernel: new () => Kernel;
|
|
22
11
|
}
|
|
23
12
|
export declare class App {
|
|
24
|
-
private renderParams;
|
|
25
|
-
private flatViewRoutes;
|
|
26
|
-
private routeManifest;
|
|
27
13
|
name: string;
|
|
28
|
-
private appId;
|
|
29
|
-
private componentTree;
|
|
30
|
-
middlewareAliases: Record<string, new () => Middleware>;
|
|
31
14
|
devVersion: number;
|
|
32
|
-
private params;
|
|
33
15
|
private apiRouter;
|
|
34
16
|
private viewRouter;
|
|
35
17
|
private Root;
|
|
36
18
|
private kernel;
|
|
37
|
-
private i18nServiceContainer;
|
|
38
|
-
private flatComponentTree;
|
|
39
19
|
constructor(params: AppParams);
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
setRenderParams(params: RenderParams): void;
|
|
43
|
-
handleViewRequest(req: Request): Promise<Response>;
|
|
20
|
+
getComponentTree(): import("../client/types").ComponentTree;
|
|
21
|
+
getFlatComponentTree(): string[];
|
|
44
22
|
fetch(req: Request): Promise<Response>;
|
|
45
23
|
websocket: WebSocketHandler<{
|
|
46
24
|
headers: Headers;
|
package/dist/app/App.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../app/App.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../app/App.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGnC,UAAU,SAAS;IACjB,UAAU,EAAE,UAAU,UAAU,CAAC;IACjC,SAAS,EAAE,UAAU,SAAS,CAAC;IAC/B,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,EAAE,UAAU,MAAM,CAAC;CAC1B;AAED,qBAAa,GAAG;IACP,IAAI,SAAS;IACb,UAAU,SAAK;IACtB,OAAO,CAAC,SAAS,CAAsB;IACvC,OAAO,CAAC,UAAU,CAAuB;IACzC,OAAO,CAAC,IAAI,CAAgB;IAC5B,OAAO,CAAC,MAAM,CAAS;gBAEX,MAAM,EAAE,SAAS;IAmCtB,gBAAgB;IAKhB,oBAAoB;IAKd,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC;IAgB5C,SAAS,EAAE,gBAAgB,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAoBtD;IAEK,SAAS,CACd,EAAE,EAAE,CACF,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,WAAW,GAAG,iBAAiB,EAChE,QAAQ,CAAC,EAAE,OAAO,KACf,IAAI;CAIZ"}
|
package/dist/app/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{x as o} from"../chunk-6286081da32e2feb.js";import{y,z as a} from"../chunk-7ce930fe69575c87.js";var R=a((j,v)=>{var K=function(e){if(typeof e==="function")return e;return(r)=>r.$extends(e)},W=function(e){return e},s=Object.defineProperty,w=Object.getOwnPropertyDescriptor,S=Object.getOwnPropertyNames,C=Object.prototype.hasOwnProperty,k=(e,r)=>{for(var i in r)s(e,i,{get:r[i],enumerable:!0})},A=(e,r,i,n)=>{if(r&&typeof r==="object"||typeof r==="function"){for(let t of S(r))if(!C.call(e,t)&&t!==i)s(e,t,{get:()=>r[t],enumerable:!(n=w(r,t))||n.enumerable})}return e},g=(e)=>A(s({},"__esModule",{value:!0}),e),c={};k(c,{Prisma:()=>p,PrismaClient:()=>H,default:()=>d});v.exports=g(c);var T={enginesVersion:"393aa359c9ad4a4bb28630fb5613f9c281cde053"},V="5.17.0",B=V,H=class{constructor(){throw new Error('@prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.')}},p={defineExtension:K,getExtensionContext:W,prismaVersion:{client:B,engine:T.enginesVersion}},d={Prisma:p}});var l=a((z,h)=>{h.exports={...R()}});class u{name="APP";devVersion=0;apiRouter;viewRouter;Root;kernel;constructor(e){this.apiRouter=e.apiRouter,this.viewRouter=e.viewRouter,this.Root=e.root,this.kernel=new e.kernel;const r=this.kernel.getServices(),i=r.authenticationServiceContainer.provider.basePath,n={"/":this.viewRouter,[i]:r.authenticationServiceContainer.provider.routers.view},t={"/":this.apiRouter,[i]:r.authenticationServiceContainer.provider.routers.api,"/__gemi__/services/i18n":r.i18nServiceContainer.routers.api};r.apiRouterServiceContainer.service.boot(t),r.viewRouterServiceContainer.service.boot(n,this.Root),r.i18nServiceContainer.boot()}getComponentTree(){return this.kernel.getServices().viewRouterServiceContainer.service.componentTree}getFlatComponentTree(){return this.kernel.getServices().viewRouterServiceContainer.service.flatComponentTree}async fetch(e){const r=new URL(e.url);return this.kernel.run.call(this.kernel,async()=>{if(r.pathname.startsWith("/api"))return await this.kernel.services.apiRouterServiceContainer.handleApiRequest(e);else return await this.kernel.services.viewRouterServiceContainer.handleViewRequest(e)})}websocket={message:(e,r)=>{this.kernel.run.bind(this.kernel)(()=>{o.getStore().broadcastingServiceContainer.run(e.data.headers,()=>{o.getStore().broadcastingServiceContainer.handleMessage(e,r)})})},open:(e)=>{},close:(e)=>{console.log("closed ws"),e.terminate()}};onPublish(e){this.kernel.services.broadcastingServiceContainer.onPublish(e)}}var b=y(l(),1),F=b.Prisma.defineExtension({name:"Gemi Policies",query:{async $allOperations({args:e,operation:r,query:i,model:n}){return await i(e)}}});export{F as prismaExtension,u as App};
|
package/dist/bin/index.js
CHANGED
|
@@ -9129,27 +9129,8 @@ async function startDevServer() {
|
|
|
9129
9129
|
}
|
|
9130
9130
|
}
|
|
9131
9131
|
async function getApp() {
|
|
9132
|
-
let app2;
|
|
9133
9132
|
try {
|
|
9134
|
-
|
|
9135
|
-
const { default: css } = await vite.ssrLoadModule(`${appDir}/app.css`);
|
|
9136
|
-
const styles2 = [];
|
|
9137
|
-
styles2.push({
|
|
9138
|
-
isDev: true,
|
|
9139
|
-
id: `${appDir}/app.css`,
|
|
9140
|
-
content: css
|
|
9141
|
-
});
|
|
9142
|
-
app2.setRenderParams({
|
|
9143
|
-
styles: createStyles(styles2),
|
|
9144
|
-
manifest: null,
|
|
9145
|
-
serverManifest: null,
|
|
9146
|
-
bootstrapModules: [
|
|
9147
|
-
"/refresh.js",
|
|
9148
|
-
"/app/client.tsx",
|
|
9149
|
-
"http://localhost:5173/@vite/client"
|
|
9150
|
-
]
|
|
9151
|
-
});
|
|
9152
|
-
return app2;
|
|
9133
|
+
return (await vite.ssrLoadModule(join(appDir, "bootstrap.ts"))).app;
|
|
9153
9134
|
} catch (err) {
|
|
9154
9135
|
console.log("Can't load bootstrap.ts");
|
|
9155
9136
|
console.error(err);
|
|
@@ -9175,7 +9156,43 @@ async function startDevServer() {
|
|
|
9175
9156
|
return await imageHandler(req);
|
|
9176
9157
|
}
|
|
9177
9158
|
try {
|
|
9178
|
-
|
|
9159
|
+
const result = await handler(req);
|
|
9160
|
+
if (result instanceof Response) {
|
|
9161
|
+
return result;
|
|
9162
|
+
} else {
|
|
9163
|
+
const viewImportMap = {};
|
|
9164
|
+
const template = (viewName, path) => `"${viewName}": () => import("${path}")`;
|
|
9165
|
+
const templates = [];
|
|
9166
|
+
for (const fileName of [
|
|
9167
|
+
"404",
|
|
9168
|
+
...app2.getFlatComponentTree.call(app2)
|
|
9169
|
+
]) {
|
|
9170
|
+
if (false) {
|
|
9171
|
+
}
|
|
9172
|
+
const appDir = `${process.env.APP_DIR}`;
|
|
9173
|
+
const mod = await vite.ssrLoadModule(`${appDir}/views/${fileName}.tsx`);
|
|
9174
|
+
viewImportMap[fileName] = mod.default;
|
|
9175
|
+
templates.push(template(fileName, `${appDir}/views/${fileName}.tsx`));
|
|
9176
|
+
}
|
|
9177
|
+
const loaders = `{${templates.join(",")}}`;
|
|
9178
|
+
const { default: css } = await vite.ssrLoadModule(`${appDir}/app.css`);
|
|
9179
|
+
const styles2 = [];
|
|
9180
|
+
styles2.push({
|
|
9181
|
+
isDev: true,
|
|
9182
|
+
id: `${appDir}/app.css`,
|
|
9183
|
+
content: css
|
|
9184
|
+
});
|
|
9185
|
+
return await result({
|
|
9186
|
+
styles: createStyles(styles2),
|
|
9187
|
+
bootstrapModules: [
|
|
9188
|
+
"/refresh.js",
|
|
9189
|
+
"/app/client.tsx",
|
|
9190
|
+
"http://localhost:5173/@vite/client"
|
|
9191
|
+
],
|
|
9192
|
+
viewImportMap,
|
|
9193
|
+
loaders
|
|
9194
|
+
});
|
|
9195
|
+
}
|
|
9179
9196
|
} catch (err) {
|
|
9180
9197
|
console.error(err);
|
|
9181
9198
|
if (pathname.startsWith("/api")) {
|
|
@@ -9203,7 +9220,7 @@ async function startDevServer() {
|
|
|
9203
9220
|
console.log(`Server started on http://localhost:${process.env.PORT || 5173}`);
|
|
9204
9221
|
vite.watcher.on("change", async (file) => {
|
|
9205
9222
|
const fileRelativePath = file.replace(rootDir, "");
|
|
9206
|
-
if (fileRelativePath.startsWith("app/views")) {
|
|
9223
|
+
if (fileRelativePath.startsWith("/app/views")) {
|
|
9207
9224
|
console.log(`[vite] ${fileRelativePath} changed. \uD83C\uDF5C Hot reloading...`);
|
|
9208
9225
|
return;
|
|
9209
9226
|
}
|
|
@@ -10035,8 +10052,6 @@ async function startProdServer() {
|
|
|
10035
10052
|
const { app } = await import(`${distDir}/server/bootstrap.mjs`);
|
|
10036
10053
|
const manifest = await import(`${distDir}/client/.vite/manifest.json`);
|
|
10037
10054
|
const serverManifest = await import(`${distDir}/server/.vite/manifest.json`);
|
|
10038
|
-
const cssFile = Bun.file(`${distDir}/client/${manifest["app/client.tsx"].css}`);
|
|
10039
|
-
const cssContent = await cssFile.text();
|
|
10040
10055
|
process.env.ROOT_DIR = rootDir2;
|
|
10041
10056
|
process.env.APP_DIR = appDir2;
|
|
10042
10057
|
process.env.DIST_DIR = distDir;
|
|
@@ -10067,18 +10082,45 @@ async function startProdServer() {
|
|
|
10067
10082
|
});
|
|
10068
10083
|
}
|
|
10069
10084
|
const styles3 = [];
|
|
10085
|
+
const cssFile = Bun.file(`${distDir}/client/${manifest["app/client.tsx"].css}`);
|
|
10086
|
+
const cssContent = await cssFile.text();
|
|
10070
10087
|
styles3.push({
|
|
10071
10088
|
content: cssContent
|
|
10072
10089
|
});
|
|
10073
|
-
|
|
10074
|
-
|
|
10075
|
-
|
|
10076
|
-
|
|
10077
|
-
|
|
10078
|
-
|
|
10090
|
+
const viewImportMap = {};
|
|
10091
|
+
const template = (viewName, path) => `"${viewName}": () => import("${path}")`;
|
|
10092
|
+
const templates = [];
|
|
10093
|
+
for (const fileName of ["404", ...app.getFlatComponentTree.call(app)]) {
|
|
10094
|
+
const serverFile = serverManifest[`app/views/${fileName}.tsx`];
|
|
10095
|
+
if (!serverFile?.file) {
|
|
10096
|
+
console.log(`Server file not found for ${fileName}`);
|
|
10097
|
+
console.log(serverFile);
|
|
10098
|
+
const files = Object.keys(serverManifest);
|
|
10099
|
+
const path = `app/views/${fileName}.tsx`;
|
|
10100
|
+
console.log(`${path} not found in server manifest`);
|
|
10101
|
+
console.log(files);
|
|
10102
|
+
}
|
|
10103
|
+
const mod = await import(`${process.env.DIST_DIR}/server/${serverFile?.file}`);
|
|
10104
|
+
viewImportMap[fileName] = mod.default;
|
|
10105
|
+
const clientFile = manifest[`app/views/${fileName}.tsx`];
|
|
10106
|
+
if (clientFile) {
|
|
10107
|
+
templates.push(template(fileName, `/${clientFile?.file}`));
|
|
10108
|
+
}
|
|
10109
|
+
}
|
|
10110
|
+
const loaders = `{${templates.join(",")}}`;
|
|
10079
10111
|
const handler = app.fetch.bind(app);
|
|
10080
10112
|
try {
|
|
10081
|
-
|
|
10113
|
+
const result = await handler(req);
|
|
10114
|
+
if (result instanceof Response) {
|
|
10115
|
+
return result;
|
|
10116
|
+
} else {
|
|
10117
|
+
return await result({
|
|
10118
|
+
styles: createStyles(styles3),
|
|
10119
|
+
bootstrapModules: [`/${manifest["app/client.tsx"].file}`],
|
|
10120
|
+
loaders,
|
|
10121
|
+
viewImportMap
|
|
10122
|
+
});
|
|
10123
|
+
}
|
|
10082
10124
|
} catch (err) {
|
|
10083
10125
|
console.error(err);
|
|
10084
10126
|
if (pathname.startsWith("/api")) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"../chunk-
|
|
2
|
+
import"../chunk-7ce930fe69575c87.js";class n{async subscribe(r){return!0}publish(r){return{}}}export{n as BroadcastingChannel};
|