gemi 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../../app/App.ts"],"names":[],"mappings":";;;AAAA,OAAO,KAAK,EAGV,SAAS,EACV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAsB,MAAM,oBAAoB,CAAC;AAKpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIrD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,KAAK,CAAC;AAM3C,OAAO,EAAE,aAAa,EAA2B,MAAM,OAAO,CAAC;AAE/D,UAAU,YAAY;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACrC;AAoCD,UAAU,SAAS;IACjB,UAAU,EAAE,KAAK,GAAG,EAAE,GAAG,KAAK,UAAU,CAAC;IACzC,SAAS,EAAE,KAAK,GAAG,EAAE,GAAG,KAAK,SAAS,CAAC;IACvC,OAAO,CAAC,EAAE,CAAC,UAAU,MAAM,CAAC,EAAE,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,UAAU,CAAC,CAAC;IACzD,IAAI,EAAE,aAAa,CAAC;CACrB;AAED,qBAAa,GAAG;IACd,OAAO,CAAC,cAAc,CAGf;IACP,OAAO,CAAC,aAAa,CAA2B;IAChD,OAAO,CAAC,aAAa,CAAg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AO,EAAE,YAAY,EAAE,YAAY;IAyGpD,OAAO,CAAC,sBAAsB,CAGtB;IACR,OAAO,CAAC,mBAAmB,CAEzB;IACF,OAAO,CAAC,oBAAoB,CAM1B;IAEF,SAAS;sBAdH,eAAe,WACV,MAAM,GAAG,MAAM;mBAES,eAAe;oBAI5C,eAAe,QACb,MAAM,UACJ,MAAM;MASd;CACH"}
package/dist/app/index.js CHANGED
@@ -1431,13 +1431,11 @@ class App {
1431
1431
  viewRouter;
1432
1432
  Root;
1433
1433
  constructor(params) {
1434
- console.log("[App] initialized");
1435
1434
  this.params = params;
1436
1435
  this.apiRouter = params.apiRouter;
1437
1436
  this.viewRouter = params.viewRouter;
1438
1437
  this.Root = params.root;
1439
1438
  this.prepare();
1440
- console.log("[App] routes are prepared");
1441
1439
  this.appId = generateETag(Date.now());
1442
1440
  }
1443
1441
  prepare() {
package/dist/bin/gemi CHANGED
Binary file
@@ -1,4 +1,6 @@
1
+ import { type ComponentType } from "react";
1
2
  export declare const ClientRouter: (props: {
2
3
  viewImportMap?: Record<string, any>;
4
+ RootLayout: ComponentType<any>;
3
5
  }) => import("react/jsx-runtime").JSX.Element;
4
6
  //# sourceMappingURL=ClientRouter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ClientRouter.d.ts","sourceRoot":"","sources":["../../client/ClientRouter.tsx"],"names":[],"mappings":"AA2HA,eAAO,MAAM,YAAY,UAAW;IAClC,aAAa,CAAC,EAAE,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;CACrC,4CAwBA,CAAC"}
1
+ {"version":3,"file":"ClientRouter.d.ts","sourceRoot":"","sources":["../../client/ClientRouter.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,aAAa,EACnB,MAAM,OAAO,CAAC;AAkHf,eAAO,MAAM,YAAY,UAAW;IAClC,aAAa,CAAC,EAAE,OAAO,MAAM,EAAE,GAAG,CAAC,CAAC;IACpC,UAAU,EAAE,cAAc,GAAG,CAAC,CAAC;CAChC,4CA2BA,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"createRoot.d.ts","sourceRoot":"","sources":["../../client/createRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAK3C,wBAAgB,UAAU,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,CAAC,WACxC,GAAG,6CAOnB"}
1
+ {"version":3,"file":"createRoot.d.ts","sourceRoot":"","sources":["../../client/createRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAK3C,wBAAgB,UAAU,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,CAAC,WACxC,GAAG,6CAQnB"}
@@ -29405,8 +29405,8 @@ const Route = (props) => {
29405
29405
  });
29406
29406
  }, []);
29407
29407
  if (!render) return null;
29408
- if (viewImportMap2) {
29409
- const Component = viewImportMap2[componentPath];
29408
+ const Component = viewImportMap2[componentPath];
29409
+ if (Component) {
29410
29410
  return /* @__PURE__ */ jsx(Component, { ...data, children: props.children });
29411
29411
  }
29412
29412
  return /* @__PURE__ */ jsx("div", { children: "Not found" });
@@ -29436,6 +29436,7 @@ const Routes = (props) => {
29436
29436
  }) });
29437
29437
  };
29438
29438
  const ClientRouter = (props) => {
29439
+ const { RootLayout } = props;
29439
29440
  const { routeManifest, router, componentTree, pageData, auth } = useContext(ServerDataContext);
29440
29441
  return /* @__PURE__ */ jsx(
29441
29442
  ClientRouterProvider,
@@ -29452,7 +29453,7 @@ const ClientRouter = (props) => {
29452
29453
  value: {
29453
29454
  viewImportMap: props.viewImportMap ?? viewImportMap
29454
29455
  },
29455
- children: /* @__PURE__ */ jsx(StrictMode, { children: /* @__PURE__ */ jsx(Routes, { componentTree }) })
29456
+ children: /* @__PURE__ */ jsx(StrictMode, { children: /* @__PURE__ */ jsx(RootLayout, { children: /* @__PURE__ */ jsx(Routes, { componentTree }) }) })
29456
29457
  }
29457
29458
  )
29458
29459
  }
@@ -29460,12 +29461,18 @@ const ClientRouter = (props) => {
29460
29461
  };
29461
29462
  function init(RootLayout) {
29462
29463
  clientExports.hydrateRoot(
29463
- document,
29464
- /* @__PURE__ */ jsx(RootLayout, { children: /* @__PURE__ */ jsx(ServerDataProvider, { children: /* @__PURE__ */ jsx(ClientRouter, {}) }) })
29464
+ document.body,
29465
+ /* @__PURE__ */ jsx(ServerDataProvider, { children: /* @__PURE__ */ jsx(ClientRouter, { RootLayout }) })
29465
29466
  );
29466
29467
  }
29467
29468
  function createRoot(RootLayout) {
29468
- return (props) => /* @__PURE__ */ jsx(RootLayout, { children: /* @__PURE__ */ jsx(ServerDataProvider, { value: props.data, children: /* @__PURE__ */ jsx(ClientRouter, { viewImportMap: props.viewImportMap }) }) });
29469
+ return (props) => /* @__PURE__ */ jsx(ServerDataProvider, { value: props.data, children: /* @__PURE__ */ jsx(
29470
+ ClientRouter,
29471
+ {
29472
+ RootLayout,
29473
+ viewImportMap: props.viewImportMap
29474
+ }
29475
+ ) });
29469
29476
  }
29470
29477
  export {
29471
29478
  Form,
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../client/init.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAK3C,wBAAgB,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,CAAC,QASlD"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../client/init.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAK3C,wBAAgB,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,CAAC,QAOlD"}
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "gemi",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "devDependencies": {
5
5
  "@repo/eslint-config": "*",
6
6
  "@repo/typescript-config": "*",
7
+ "@types/bun": "^1.1.4",
7
8
  "@types/eslint": "^8.56.5",
8
9
  "@types/node": "^20.11.24",
9
10
  "@types/react": "^18.2.61",