frontend-hamroun 1.2.84 → 1.2.85

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.
Files changed (215) hide show
  1. package/package.json +1 -1
  2. package/templates/basic-app/build.d.ts +2 -0
  3. package/templates/basic-app/build.d.ts.map +1 -0
  4. package/templates/basic-app/dev.d.ts +2 -0
  5. package/templates/basic-app/dev.d.ts.map +1 -0
  6. package/templates/basic-app/esbuild.config.d.ts +2 -0
  7. package/templates/basic-app/esbuild.config.d.ts.map +1 -0
  8. package/templates/basic-app/postcss.config.d.ts +8 -0
  9. package/templates/basic-app/postcss.config.d.ts.map +1 -0
  10. package/templates/basic-app/server.d.ts +2 -0
  11. package/templates/basic-app/server.d.ts.map +1 -0
  12. package/templates/basic-app/src/App.d.ts +2 -0
  13. package/templates/basic-app/src/App.d.ts.map +1 -0
  14. package/templates/basic-app/src/App.js +148 -0
  15. package/templates/basic-app/src/client.d.ts +2 -0
  16. package/templates/basic-app/src/client.d.ts.map +1 -0
  17. package/templates/basic-app/src/client.js +6 -0
  18. package/templates/basic-app/src/components/Counter.d.ts +4 -0
  19. package/templates/basic-app/src/components/Counter.d.ts.map +1 -0
  20. package/templates/basic-app/src/components/Counter.js +9 -0
  21. package/templates/basic-app/src/jsx-shim.d.ts +8 -0
  22. package/templates/basic-app/src/jsx-shim.d.ts.map +1 -0
  23. package/templates/basic-app/src/main.d.ts +2 -0
  24. package/templates/basic-app/src/main.d.ts.map +1 -0
  25. package/templates/basic-app/src/main.js +57 -0
  26. package/templates/basic-app/src/server.d.ts +2 -0
  27. package/templates/basic-app/src/server.d.ts.map +1 -0
  28. package/templates/basic-app/tailwind.config.d.ts +9 -0
  29. package/templates/basic-app/tailwind.config.d.ts.map +1 -0
  30. package/templates/basic-app/vite.config.d.ts +3 -0
  31. package/templates/basic-app/vite.config.d.ts.map +1 -0
  32. package/templates/basic-app/vite.config.js +7 -0
  33. package/templates/complete-app/api/hello.d.ts +1 -0
  34. package/templates/complete-app/api/hello.d.ts.map +1 -0
  35. package/templates/complete-app/client.d.ts +2 -0
  36. package/templates/complete-app/client.d.ts.map +1 -0
  37. package/templates/complete-app/lib/frontend-hamroun.d.ts +18 -0
  38. package/templates/complete-app/lib/frontend-hamroun.d.ts.map +1 -0
  39. package/templates/complete-app/pages/about.d.ts +7 -0
  40. package/templates/complete-app/pages/about.d.ts.map +1 -0
  41. package/templates/complete-app/pages/index.d.ts +7 -0
  42. package/templates/complete-app/pages/index.d.ts.map +1 -0
  43. package/templates/complete-app/pages/wasm-demo.d.ts +7 -0
  44. package/templates/complete-app/pages/wasm-demo.d.ts.map +1 -0
  45. package/templates/complete-app/public/client.d.ts +17 -0
  46. package/templates/complete-app/public/client.d.ts.map +1 -0
  47. package/templates/complete-app/server.d.ts +2 -0
  48. package/templates/complete-app/server.d.ts.map +1 -0
  49. package/templates/complete-app/server.js +236 -218
  50. package/templates/complete-app/src/App.d.ts +2 -0
  51. package/templates/complete-app/src/App.d.ts.map +1 -0
  52. package/templates/complete-app/src/App.js +27 -0
  53. package/templates/complete-app/src/client.d.ts +2 -0
  54. package/templates/complete-app/src/client.d.ts.map +1 -0
  55. package/templates/complete-app/src/client.js +52 -0
  56. package/templates/complete-app/src/pages/index.d.ts +2 -0
  57. package/templates/complete-app/src/pages/index.d.ts.map +1 -0
  58. package/templates/complete-app/src/pages/index.js +19 -0
  59. package/templates/complete-app/src/server.d.ts +2 -0
  60. package/templates/complete-app/src/server.d.ts.map +1 -0
  61. package/templates/complete-app/src/server.js +192 -0
  62. package/templates/complete-app/vite.config.d.ts +3 -0
  63. package/templates/complete-app/vite.config.d.ts.map +1 -0
  64. package/templates/complete-app/vite.config.js +29 -57
  65. package/templates/fullstack-app/api/hello.d.ts +4 -0
  66. package/templates/fullstack-app/api/hello.d.ts.map +1 -0
  67. package/templates/fullstack-app/api/hello.js +14 -11
  68. package/templates/fullstack-app/api/users/[id].d.ts +5 -0
  69. package/templates/fullstack-app/api/users/[id].d.ts.map +1 -0
  70. package/templates/fullstack-app/api/users/[id].js +52 -0
  71. package/templates/fullstack-app/api/users/index.d.ts +4 -0
  72. package/templates/fullstack-app/api/users/index.d.ts.map +1 -0
  73. package/templates/fullstack-app/api/users/index.js +25 -0
  74. package/templates/fullstack-app/build/main.d.ts +211 -0
  75. package/templates/fullstack-app/build/main.d.ts.map +1 -0
  76. package/templates/fullstack-app/build.d.ts +2 -0
  77. package/templates/fullstack-app/build.d.ts.map +1 -0
  78. package/templates/fullstack-app/build.js +190 -0
  79. package/templates/fullstack-app/postcss.config.d.ts +5 -0
  80. package/templates/fullstack-app/postcss.config.d.ts.map +1 -0
  81. package/templates/fullstack-app/process-tailwind.d.ts +2 -0
  82. package/templates/fullstack-app/process-tailwind.d.ts.map +1 -0
  83. package/templates/fullstack-app/public/route-handler.d.ts +1 -0
  84. package/templates/fullstack-app/public/route-handler.d.ts.map +1 -0
  85. package/templates/fullstack-app/server.d.ts +2 -0
  86. package/templates/fullstack-app/server.d.ts.map +1 -0
  87. package/templates/fullstack-app/server.js +428 -266
  88. package/templates/fullstack-app/src/client.d.ts +2 -0
  89. package/templates/fullstack-app/src/client.d.ts.map +1 -0
  90. package/templates/fullstack-app/src/components/ClientHome.d.ts +1 -0
  91. package/templates/fullstack-app/src/components/ClientHome.d.ts.map +1 -0
  92. package/templates/fullstack-app/src/components/ClientHome.js +1 -0
  93. package/templates/fullstack-app/src/components/ErrorBoundary.d.ts +7 -0
  94. package/templates/fullstack-app/src/components/ErrorBoundary.d.ts.map +1 -0
  95. package/templates/fullstack-app/src/components/ErrorBoundary.js +12 -0
  96. package/templates/fullstack-app/src/components/Layout.d.ts +7 -0
  97. package/templates/fullstack-app/src/components/Layout.d.ts.map +1 -0
  98. package/templates/fullstack-app/src/components/Layout.js +4 -0
  99. package/templates/fullstack-app/src/components/StateDemo.d.ts +2 -0
  100. package/templates/fullstack-app/src/components/StateDemo.d.ts.map +1 -0
  101. package/templates/fullstack-app/src/components/StateDemo.js +86 -0
  102. package/templates/fullstack-app/src/components/UserList.d.ts +11 -0
  103. package/templates/fullstack-app/src/components/UserList.d.ts.map +1 -0
  104. package/templates/fullstack-app/src/components/UserList.js +7 -0
  105. package/templates/fullstack-app/src/config.d.ts +29 -0
  106. package/templates/fullstack-app/src/config.d.ts.map +1 -0
  107. package/templates/fullstack-app/src/config.js +36 -0
  108. package/templates/fullstack-app/src/data/api.d.ts +35 -0
  109. package/templates/fullstack-app/src/data/api.d.ts.map +1 -0
  110. package/templates/fullstack-app/src/data/api.js +173 -0
  111. package/templates/fullstack-app/src/main.d.ts +7 -0
  112. package/templates/fullstack-app/src/main.d.ts.map +1 -0
  113. package/templates/fullstack-app/src/main.js +130 -0
  114. package/templates/fullstack-app/src/middleware.d.ts +10 -0
  115. package/templates/fullstack-app/src/middleware.d.ts.map +1 -0
  116. package/templates/fullstack-app/src/middleware.js +14 -0
  117. package/templates/fullstack-app/src/pages/404.d.ts +4 -0
  118. package/templates/fullstack-app/src/pages/404.d.ts.map +1 -0
  119. package/templates/fullstack-app/src/pages/404.js +4 -0
  120. package/templates/fullstack-app/src/pages/[id].d.ts +1 -0
  121. package/templates/fullstack-app/src/pages/[id].d.ts.map +1 -0
  122. package/templates/fullstack-app/src/pages/[id].js +1 -0
  123. package/templates/fullstack-app/src/pages/_app.d.ts +6 -0
  124. package/templates/fullstack-app/src/pages/_app.d.ts.map +1 -0
  125. package/templates/fullstack-app/src/pages/_app.js +6 -0
  126. package/templates/fullstack-app/src/pages/_document.d.ts +7 -0
  127. package/templates/fullstack-app/src/pages/_document.d.ts.map +1 -0
  128. package/templates/fullstack-app/src/pages/_document.js +4 -0
  129. package/templates/fullstack-app/src/pages/_error.d.ts +4 -0
  130. package/templates/fullstack-app/src/pages/_error.d.ts.map +1 -0
  131. package/templates/fullstack-app/src/pages/_error.js +8 -0
  132. package/templates/fullstack-app/src/pages/about/index.d.ts +5 -0
  133. package/templates/fullstack-app/src/pages/about/index.d.ts.map +1 -0
  134. package/templates/fullstack-app/src/pages/about/index.js +6 -0
  135. package/templates/fullstack-app/src/pages/about.d.ts +10 -0
  136. package/templates/fullstack-app/src/pages/about.d.ts.map +1 -0
  137. package/templates/fullstack-app/src/pages/about.js +21 -0
  138. package/templates/fullstack-app/src/pages/api/users/[id].d.ts +6 -0
  139. package/templates/fullstack-app/src/pages/api/users/[id].d.ts.map +1 -0
  140. package/templates/fullstack-app/src/pages/api/users/[id].js +51 -0
  141. package/templates/fullstack-app/src/pages/api/users/index.d.ts +4 -0
  142. package/templates/fullstack-app/src/pages/api/users/index.d.ts.map +1 -0
  143. package/templates/fullstack-app/src/pages/api/users/index.js +33 -0
  144. package/templates/fullstack-app/src/pages/index.d.ts +21 -0
  145. package/templates/fullstack-app/src/pages/index.d.ts.map +1 -0
  146. package/templates/fullstack-app/src/pages/index.js +66 -0
  147. package/templates/fullstack-app/src/pages/users/[id].d.ts +38 -0
  148. package/templates/fullstack-app/src/pages/users/[id].d.ts.map +1 -0
  149. package/templates/fullstack-app/src/pages/users/[id].js +79 -0
  150. package/templates/fullstack-app/src/pages/users.d.ts +14 -0
  151. package/templates/fullstack-app/src/pages/users.d.ts.map +1 -0
  152. package/templates/fullstack-app/src/pages/users.js +14 -0
  153. package/templates/fullstack-app/src/pages/wasm-demo.d.ts +1 -0
  154. package/templates/fullstack-app/src/pages/wasm-demo.d.ts.map +1 -0
  155. package/templates/fullstack-app/src/pages/wasm-demo.js +2 -0
  156. package/templates/fullstack-app/src/router.d.ts +22 -0
  157. package/templates/fullstack-app/src/router.d.ts.map +1 -0
  158. package/templates/fullstack-app/src/router.js +210 -0
  159. package/templates/fullstack-app/tailwind.config.d.ts +3 -0
  160. package/templates/fullstack-app/tailwind.config.d.ts.map +1 -0
  161. package/templates/fullstack-app/vite.config.d.ts +3 -0
  162. package/templates/fullstack-app/vite.config.d.ts.map +1 -0
  163. package/templates/ssr-template/dist/client/assets/main-D-VH3xOb.d.ts +2 -0
  164. package/templates/ssr-template/dist/client/assets/main-D-VH3xOb.d.ts.map +1 -0
  165. package/templates/ssr-template/dist/client.d.ts +85 -0
  166. package/templates/ssr-template/dist/client.d.ts.map +1 -0
  167. package/templates/ssr-template/dist/server.d.ts +2 -0
  168. package/templates/ssr-template/dist/server.d.ts.map +1 -0
  169. package/templates/ssr-template/esbuild.config.d.ts +2 -0
  170. package/templates/ssr-template/esbuild.config.d.ts.map +1 -0
  171. package/templates/ssr-template/jsx-shim.d.ts +2 -0
  172. package/templates/ssr-template/jsx-shim.d.ts.map +1 -0
  173. package/templates/ssr-template/src/App.d.ts +2 -0
  174. package/templates/ssr-template/src/App.d.ts.map +1 -0
  175. package/templates/ssr-template/src/App.js +625 -0
  176. package/templates/ssr-template/src/client.d.ts +2 -0
  177. package/templates/ssr-template/src/client.d.ts.map +1 -0
  178. package/templates/ssr-template/src/client.js +3 -0
  179. package/templates/ssr-template/src/server.d.ts +2 -0
  180. package/templates/ssr-template/src/server.d.ts.map +1 -0
  181. package/templates/ssr-template/src/server.js +29 -0
  182. package/templates/ssr-template/vite.config.d.ts +3 -0
  183. package/templates/ssr-template/vite.config.d.ts.map +1 -0
  184. package/templates/ssr-template/vite.config.js +30 -0
  185. package/templates/wasm/build-wasm.d.ts +2 -0
  186. package/templates/wasm/build-wasm.d.ts.map +1 -0
  187. package/templates/wasm/dist/assets/index-BNqTDBdE.d.ts +30 -0
  188. package/templates/wasm/dist/assets/index-BNqTDBdE.d.ts.map +1 -0
  189. package/templates/wasm/dist/wasm_exec.d.ts +1 -0
  190. package/templates/wasm/dist/wasm_exec.d.ts.map +1 -0
  191. package/templates/wasm/esbuild.config.d.ts +2 -0
  192. package/templates/wasm/esbuild.config.d.ts.map +1 -0
  193. package/templates/wasm/go/wasm_exec.d.ts +1 -0
  194. package/templates/wasm/go/wasm_exec.d.ts.map +1 -0
  195. package/templates/wasm/jsx-shim.d.ts +5 -0
  196. package/templates/wasm/jsx-shim.d.ts.map +1 -0
  197. package/templates/wasm/public/wasm_exec.d.ts +1 -0
  198. package/templates/wasm/public/wasm_exec.d.ts.map +1 -0
  199. package/templates/wasm/src/App.d.ts +2 -0
  200. package/templates/wasm/src/App.d.ts.map +1 -0
  201. package/templates/wasm/src/App.js +381 -0
  202. package/templates/wasm/src/client.d.ts +2 -0
  203. package/templates/wasm/src/client.d.ts.map +1 -0
  204. package/templates/wasm/src/client.js +210 -0
  205. package/templates/wasm/src/index.d.ts +2 -0
  206. package/templates/wasm/src/index.d.ts.map +1 -0
  207. package/templates/wasm/src/index.js +20 -0
  208. package/templates/wasm/src/server.d.ts +2 -0
  209. package/templates/wasm/src/server.d.ts.map +1 -0
  210. package/templates/wasm/src/server.js +131 -0
  211. package/templates/wasm/vite.config.d.ts +3 -0
  212. package/templates/wasm/vite.config.d.ts.map +1 -0
  213. package/templates/wasm/vite.config.js +36 -0
  214. package/templates/wasm/wasm-loader.d.ts +6 -0
  215. package/templates/wasm/wasm-loader.d.ts.map +1 -0
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "frontend-hamroun/jsx-runtime";
2
+ export default function NotFound({ initialState }) {
3
+ return (_jsx("div", { className: "not-found-container max-w-4xl mx-auto p-6", children: _jsxs("div", { className: "bg-gray-50 border border-gray-200 rounded-lg p-8 shadow-sm", children: [_jsx("h1", { className: "text-3xl font-bold text-gray-700 mb-4", children: "Page Not Found" }), _jsx("p", { className: "text-lg text-gray-600 mb-4", children: "The page you are looking for does not exist or has been moved." }), _jsxs("p", { className: "text-gray-600 mb-6", children: ["Path: ", _jsx("code", { className: "bg-gray-100 px-2 py-1 rounded", children: initialState?.route || 'unknown' })] }), _jsx("div", { className: "mt-6", children: _jsx("a", { href: "/", className: "inline-block px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700", children: "Back to Home" }) })] }) }));
4
+ }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=%5Bid%5D.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"[id].d.ts","sourceRoot":"","sources":["[id].tsx"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,6 @@
1
+ export default function App({ Component, pageProps, initialState }: {
2
+ Component: any;
3
+ pageProps: any;
4
+ initialState: any;
5
+ }): JSX.Element;
6
+ //# sourceMappingURL=_app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_app.d.ts","sourceRoot":"","sources":["_app.tsx"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO,UAAU,GAAG,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE;;;;CAAA,eAMjE"}
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "frontend-hamroun/jsx-runtime";
2
+ import Layout from '../components/Layout';
3
+ // This is the main App wrapper component similar to Next.js _app.js
4
+ export default function App({ Component, pageProps, initialState }) {
5
+ return (_jsx(Layout, { children: _jsx(Component, { ...pageProps, initialState: initialState }) }));
6
+ }
@@ -0,0 +1,7 @@
1
+ export default function Document({ title, headContent, bodyContent, scripts }: {
2
+ title?: string | undefined;
3
+ headContent: any;
4
+ bodyContent: any;
5
+ scripts: any;
6
+ }): JSX.Element;
7
+ //# sourceMappingURL=_document.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_document.d.ts","sourceRoot":"","sources":["_document.tsx"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,KAA8B,EAC9B,WAAW,EACX,WAAW,EACX,OAAO,EACR;;;;;CAAA,eAiBA"}
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "frontend-hamroun/jsx-runtime";
2
+ export default function Document({ title = 'Frontend Hamroun App', headContent, bodyContent, scripts }) {
3
+ return (_jsxs("html", { lang: "en", children: [_jsxs("head", { children: [_jsx("meta", { charSet: "UTF-8" }), _jsx("meta", { name: "viewport", content: "width=device-width, initial-scale=1.0" }), _jsx("title", { children: title }), _jsx("link", { rel: "stylesheet", href: "/styles.css" }), headContent] }), _jsxs("body", { children: [_jsx("div", { id: "root", children: bodyContent }), _jsx("script", { src: "/build/main.js", type: "module" }), scripts] })] }));
4
+ }
@@ -0,0 +1,4 @@
1
+ export default function ErrorPage({ initialState }: {
2
+ initialState: any;
3
+ }): JSX.Element;
4
+ //# sourceMappingURL=_error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_error.d.ts","sourceRoot":"","sources":["_error.tsx"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAAE,YAAY,EAAE;;CAAA,eA0CjD"}
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "frontend-hamroun/jsx-runtime";
2
+ import { useState } from 'frontend-hamroun';
3
+ export default function ErrorPage({ initialState }) {
4
+ const { error } = initialState || {};
5
+ const [showDetails, setShowDetails] = useState(false);
6
+ const isDev = process.env.NODE_ENV !== 'production';
7
+ return (_jsx("div", { className: "error-page-container max-w-4xl mx-auto p-6", children: _jsxs("div", { className: "bg-red-50 border border-red-200 rounded-lg p-8 shadow-sm", children: [_jsx("h1", { className: "text-3xl font-bold text-red-700 mb-4", children: "Something went wrong" }), _jsx("p", { className: "text-lg text-red-600 mb-4", children: error?.message || "An unexpected error occurred" }), isDev && error?.stack && (_jsxs("div", { className: "mt-6", children: [_jsxs("button", { className: "text-blue-600 underline mb-2", onClick: () => setShowDetails(!showDetails), children: [showDetails ? "Hide" : "Show", " technical details"] }), showDetails && (_jsx("pre", { className: "bg-gray-100 p-4 rounded-md text-sm overflow-auto max-h-96 text-gray-800", children: error.stack }))] })), _jsx("div", { className: "mt-6", children: _jsx("a", { href: "/", className: "inline-block px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700", children: "Back to Home" }) })] }) }));
8
+ }
@@ -0,0 +1,5 @@
1
+ declare const AboutPage: ({ initialState }: {
2
+ initialState: any;
3
+ }) => JSX.Element;
4
+ export default AboutPage;
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAGA,QAAA,MAAM,SAAS;;iBA6Dd,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "frontend-hamroun/jsx-runtime";
2
+ import Layout from '../../components/Layout';
3
+ const AboutPage = ({ initialState }) => {
4
+ return (_jsx(Layout, { title: "About This App", children: _jsx("div", { className: "max-w-4xl mx-auto bg-white shadow-lg rounded-lg overflow-hidden", children: _jsxs("div", { className: "p-8", children: [_jsx("p", { className: "text-lg text-gray-700 mb-6", children: "This is a frontend application built with Frontend Hamroun framework and styled with Tailwind CSS." }), _jsx("p", { className: "text-gray-600 mb-8", children: "It features server-side rendering, client-side navigation, and websocket-based live reloading during development." }), _jsxs("div", { className: "bg-gray-50 p-6 rounded-lg border border-gray-200 mb-8", children: [_jsx("h2", { className: "text-xl font-semibold text-gray-800 mb-4", children: "Key Features" }), _jsxs("ul", { className: "space-y-2 text-gray-700", children: [_jsxs("li", { className: "flex items-center", children: [_jsx("svg", { className: "w-5 h-5 text-green-500 mr-2", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M5 13l4 4L19 7" }) }), "Server-side rendering"] }), _jsxs("li", { className: "flex items-center", children: [_jsx("svg", { className: "w-5 h-5 text-green-500 mr-2", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M5 13l4 4L19 7" }) }), "Client-side navigation"] }), _jsxs("li", { className: "flex items-center", children: [_jsx("svg", { className: "w-5 h-5 text-green-500 mr-2", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M5 13l4 4L19 7" }) }), "Component-based architecture"] }), _jsxs("li", { className: "flex items-center", children: [_jsx("svg", { className: "w-5 h-5 text-green-500 mr-2", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M5 13l4 4L19 7" }) }), "Integrated API backend"] }), _jsxs("li", { className: "flex items-center", children: [_jsx("svg", { className: "w-5 h-5 text-green-500 mr-2", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M5 13l4 4L19 7" }) }), "Live reload during development"] }), _jsxs("li", { className: "flex items-center", children: [_jsx("svg", { className: "w-5 h-5 text-green-500 mr-2", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "2", d: "M5 13l4 4L19 7" }) }), "Tailwind CSS for styling"] })] })] }), _jsx("a", { href: "/", className: "inline-block px-6 py-3 bg-blue-600 text-white font-medium rounded-lg hover:bg-blue-700 transition-colors", children: "Back to Home" })] }) }) }));
5
+ };
6
+ export default AboutPage;
@@ -0,0 +1,10 @@
1
+ export default function AboutPage({ initialState }: {
2
+ initialState: any;
3
+ }): JSX.Element;
4
+ export declare function getServerSideProps(): Promise<{
5
+ props: {
6
+ pageTitle: string;
7
+ description: string;
8
+ };
9
+ }>;
10
+ //# sourceMappingURL=about.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"about.d.ts","sourceRoot":"","sources":["about.tsx"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAAE,YAAY,EAAE;;CAAA,eAyDjD;AAGD,wBAAsB,kBAAkB;;;;;GAOvC"}
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "frontend-hamroun/jsx-runtime";
2
+ import Layout from '../components/Layout';
3
+ export default function AboutPage({ initialState }) {
4
+ return (_jsx(Layout, { title: "About - Frontend Hamroun", children: _jsxs("div", { className: "max-w-4xl mx-auto", children: [_jsx("h1", { className: "text-3xl font-bold text-blue-600 mb-6", children: "About Frontend Hamroun" }), _jsxs("div", { className: "bg-white shadow-lg rounded-lg p-8 mb-8", children: [_jsx("h2", { className: "text-xl font-semibold text-gray-800 mb-4", children: "What is Frontend Hamroun?" }), _jsx("p", { className: "text-gray-600 mb-4", children: "Frontend Hamroun is a lightweight JavaScript framework for building modern web applications. It provides a familiar component-based architecture with hooks, JSX support, and server-side rendering capabilities." }), _jsx("p", { className: "text-gray-600 mb-4", children: "This framework is designed to be simple yet powerful, offering the essential features needed for web application development without the complexity of larger frameworks." }), _jsx("h3", { className: "text-lg font-medium text-gray-700 mt-6 mb-2", children: "Key Features:" }), _jsxs("ul", { className: "list-disc pl-6 text-gray-600 space-y-2", children: [_jsx("li", { children: "Component-based architecture" }), _jsx("li", { children: "JSX support" }), _jsx("li", { children: "Hooks for state and effects" }), _jsx("li", { children: "Server-side rendering" }), _jsx("li", { children: "Minimal API surface" }), _jsx("li", { children: "File-based routing" }), _jsx("li", { children: "Built-in API routes" })] })] }), _jsxs("div", { className: "bg-white shadow-lg rounded-lg p-8", children: [_jsx("h2", { className: "text-xl font-semibold text-gray-800 mb-4", children: "Getting Started" }), _jsx("p", { className: "text-gray-600 mb-4", children: "This application was created using the Frontend Hamroun fullstack template, which provides a complete setup for building applications with server-side rendering, API routes, and client-side navigation." }), _jsxs("div", { className: "bg-gray-50 p-4 rounded-md mt-4", children: [_jsx("h3", { className: "text-md font-medium text-gray-700 mb-2", children: "Quick Start:" }), _jsx("pre", { className: "bg-gray-800 text-gray-100 p-4 rounded overflow-x-auto", children: _jsx("code", { children: `# Create a new application
5
+ npx frontend-hamroun create my-app
6
+
7
+ # Change directory
8
+ cd my-app
9
+
10
+ # Start the development server
11
+ npm run dev` }) })] })] })] }) }));
12
+ }
13
+ // Server-side data fetching
14
+ export async function getServerSideProps() {
15
+ return {
16
+ props: {
17
+ pageTitle: 'About Frontend Hamroun',
18
+ description: 'Learn more about the Frontend Hamroun framework'
19
+ }
20
+ };
21
+ }
@@ -0,0 +1,6 @@
1
+ import { Request, Response } from 'express';
2
+ export declare function get(req: Request, res: Response): Promise<Response<any, Record<string, any>> | undefined>;
3
+ export declare function put(req: Request, res: Response): Promise<Response<any, Record<string, any>> | undefined>;
4
+ export declare function del(req: Request, res: Response): Promise<Response<any, Record<string, any>> | undefined>;
5
+ export declare const DELETE: typeof del;
6
+ //# sourceMappingURL=%5Bid%5D.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"[id].d.ts","sourceRoot":"","sources":["[id].ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAa5C,wBAAsB,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,2DAcpD;AAGD,wBAAsB,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,2DAkBpD;AAGD,wBAAsB,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,2DAiBpD;AAGD,eAAO,MAAM,MAAM,YAAM,CAAC"}
@@ -0,0 +1,51 @@
1
+ // Sample data store
2
+ const users = [
3
+ { id: 1, name: 'User 1', email: 'user1@example.com' },
4
+ { id: 2, name: 'User 2', email: 'user2@example.com' },
5
+ { id: 3, name: 'User 3', email: 'user3@example.com' }
6
+ ];
7
+ // Utility to find user by ID
8
+ const findUser = (id) => users.find(user => user.id === id);
9
+ // GET handler for retrieving a specific user
10
+ export async function get(req, res) {
11
+ const userId = parseInt(req.params.id);
12
+ if (isNaN(userId)) {
13
+ return res.status(400).json({ error: 'Invalid user ID' });
14
+ }
15
+ const user = findUser(userId);
16
+ if (!user) {
17
+ return res.status(404).json({ error: 'User not found' });
18
+ }
19
+ res.json(user);
20
+ }
21
+ // PUT handler for updating a user
22
+ export async function put(req, res) {
23
+ const userId = parseInt(req.params.id);
24
+ if (isNaN(userId)) {
25
+ return res.status(400).json({ error: 'Invalid user ID' });
26
+ }
27
+ const userIndex = users.findIndex(user => user.id === userId);
28
+ if (userIndex === -1) {
29
+ return res.status(404).json({ error: 'User not found' });
30
+ }
31
+ // Update user, but preserve the ID
32
+ const updatedUser = { ...req.body, id: userId };
33
+ users[userIndex] = updatedUser;
34
+ res.json(updatedUser);
35
+ }
36
+ // DELETE handler for removing a user
37
+ export async function del(req, res) {
38
+ const userId = parseInt(req.params.id);
39
+ if (isNaN(userId)) {
40
+ return res.status(400).json({ error: 'Invalid user ID' });
41
+ }
42
+ const userIndex = users.findIndex(user => user.id === userId);
43
+ if (userIndex === -1) {
44
+ return res.status(404).json({ error: 'User not found' });
45
+ }
46
+ // Remove the user
47
+ users.splice(userIndex, 1);
48
+ res.status(204).end();
49
+ }
50
+ // Use delete handler for DELETE method since 'delete' is a reserved word
51
+ export const DELETE = del;
@@ -0,0 +1,4 @@
1
+ import { Request, Response } from 'express';
2
+ export declare function get(req: Request, res: Response): Promise<void>;
3
+ export declare function post(req: Request, res: Response): Promise<Response<any, Record<string, any>> | undefined>;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAU5C,wBAAsB,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,iBASpD;AAGD,wBAAsB,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,2DAmBrD"}
@@ -0,0 +1,33 @@
1
+ // Sample data store
2
+ const users = [
3
+ { id: 1, name: 'User 1', email: 'user1@example.com' },
4
+ { id: 2, name: 'User 2', email: 'user2@example.com' },
5
+ { id: 3, name: 'User 3', email: 'user3@example.com' }
6
+ ];
7
+ // GET handler for retrieving all users
8
+ export async function get(req, res) {
9
+ // Option to simulate delay for testing loading states
10
+ const delay = req.query.delay ? parseInt(req.query.delay) : 0;
11
+ if (delay) {
12
+ await new Promise(resolve => setTimeout(resolve, delay));
13
+ }
14
+ res.json(users);
15
+ }
16
+ // POST handler for creating a new user
17
+ export async function post(req, res) {
18
+ try {
19
+ const newUser = req.body;
20
+ // Validation
21
+ if (!newUser.name || !newUser.email) {
22
+ return res.status(400).json({ error: 'Name and email are required' });
23
+ }
24
+ // Generate new ID
25
+ const newId = Math.max(0, ...users.map(u => u.id)) + 1;
26
+ const createdUser = { ...newUser, id: newId };
27
+ users.push(createdUser);
28
+ res.status(201).json(createdUser);
29
+ }
30
+ catch (error) {
31
+ res.status(500).json({ error: 'Failed to create user' });
32
+ }
33
+ }
@@ -0,0 +1,21 @@
1
+ export default function HomePage({ users, posts, initialState }: {
2
+ users: any;
3
+ posts: any;
4
+ initialState: any;
5
+ }): JSX.Element;
6
+ export declare function getServerSideProps(): Promise<{
7
+ props: {
8
+ users: {
9
+ id: number;
10
+ name: string;
11
+ email: string;
12
+ }[];
13
+ posts: {
14
+ id: number;
15
+ title: string;
16
+ content: string;
17
+ authorId: number;
18
+ }[];
19
+ };
20
+ }>;
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":"AAOA,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE;;;;CAAA,eA+E9D;AAGD,wBAAsB,kBAAkB;;;;;;;;;;;;;;GAoBvC"}
@@ -0,0 +1,66 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "frontend-hamroun/jsx-runtime";
2
+ import { useState, useEffect, batchUpdates } from 'frontend-hamroun';
3
+ import UserList from '../components/UserList';
4
+ import StateDemo from '../components/StateDemo';
5
+ import { ErrorBoundary } from '../components/ErrorBoundary';
6
+ import { UserApi } from '../data/api';
7
+ // Home Page Component with Server Side Props
8
+ export default function HomePage({ users, posts, initialState }) {
9
+ const [state, setState] = useState(initialState || {});
10
+ const [refreshTrigger, setRefreshTrigger] = useState(0);
11
+ // Fetch data when refresh is triggered
12
+ useEffect(() => {
13
+ if (refreshTrigger === 0)
14
+ return; // Skip initial render
15
+ async function fetchData() {
16
+ try {
17
+ const [users, posts] = await Promise.all([
18
+ UserApi.getAll(),
19
+ UserApi.getPosts()
20
+ ]);
21
+ // Use batch updates for efficiency
22
+ batchUpdates(() => {
23
+ setState(prev => ({
24
+ ...prev,
25
+ data: {
26
+ ...prev.data,
27
+ users,
28
+ posts
29
+ },
30
+ lastUpdate: new Date().toISOString()
31
+ }));
32
+ });
33
+ }
34
+ catch (error) {
35
+ console.error('Error fetching data:', error);
36
+ }
37
+ }
38
+ fetchData();
39
+ }, [refreshTrigger]);
40
+ const handleRefresh = () => {
41
+ setRefreshTrigger(t => t + 1);
42
+ };
43
+ return (_jsxs("div", { className: "max-w-4xl mx-auto py-8", children: [_jsx("h1", { className: "text-3xl font-bold text-blue-600 mb-6", children: "Welcome to your Next-style Frontend Hamroun application!" }), _jsxs("div", { className: "mb-8", children: [_jsx("button", { className: "mb-4 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700", onClick: handleRefresh, children: "Refresh Data" }), _jsx("div", { className: "bg-blue-50 p-4 rounded-lg border border-blue-100 mb-6", children: _jsxs("p", { className: "text-blue-700", children: ["Last updated: ", state.lastUpdate || 'Never'] }) })] }), _jsx(ErrorBoundary, { children: _jsxs("div", { className: "bg-white shadow-lg rounded-lg p-6 mb-8", children: [_jsx("h2", { className: "text-xl font-semibold text-gray-800 mb-4", children: "User List" }), _jsx(UserList, { users: users || state.data?.users || [] })] }) }), _jsx(ErrorBoundary, { children: _jsx(StateDemo, {}) }), _jsxs("div", { className: "bg-gray-50 rounded-lg p-6 border border-gray-200 mt-8", children: [_jsx("h3", { className: "text-lg font-medium text-gray-700 mb-3", children: "Application State" }), _jsx("pre", { className: "overflow-auto p-4 bg-gray-100 rounded-md text-sm text-gray-800", children: JSON.stringify({ users, posts, ...state }, null, 2) })] })] }));
44
+ }
45
+ // Server-side data fetching (Next.js style)
46
+ export async function getServerSideProps() {
47
+ try {
48
+ const users = await UserApi.getAll();
49
+ const posts = await UserApi.getPosts();
50
+ return {
51
+ props: {
52
+ users,
53
+ posts
54
+ }
55
+ };
56
+ }
57
+ catch (error) {
58
+ console.error('Error fetching initial data:', error);
59
+ return {
60
+ props: {
61
+ users: [],
62
+ posts: []
63
+ }
64
+ };
65
+ }
66
+ }
@@ -0,0 +1,38 @@
1
+ export default function UserDetail({ user, posts, initialState }: {
2
+ user: any;
3
+ posts: any;
4
+ initialState: any;
5
+ }): JSX.Element;
6
+ export declare function getServerSideProps({ params }: {
7
+ params: any;
8
+ }): Promise<{
9
+ notFound: boolean;
10
+ props?: undefined;
11
+ } | {
12
+ props: {
13
+ user: {
14
+ id: number;
15
+ name: string;
16
+ email: string;
17
+ };
18
+ posts: {
19
+ id: number;
20
+ title: string;
21
+ content: string;
22
+ authorId: number;
23
+ }[];
24
+ error?: undefined;
25
+ };
26
+ notFound?: undefined;
27
+ } | {
28
+ props: {
29
+ error: {
30
+ message: any;
31
+ status: any;
32
+ };
33
+ user: null;
34
+ posts: never[];
35
+ };
36
+ notFound?: undefined;
37
+ }>;
38
+ //# sourceMappingURL=%5Bid%5D.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"[id].d.ts","sourceRoot":"","sources":["[id].tsx"],"names":[],"mappings":"AAGA,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE;;;;CAAA,eA4G/D;AAGD,wBAAsB,kBAAkB,CAAC,EAAE,MAAM,EAAE;;CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsClD"}
@@ -0,0 +1,79 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "frontend-hamroun/jsx-runtime";
2
+ import { useState, useEffect } from 'frontend-hamroun';
3
+ import { UserApi } from '../../data/api';
4
+ export default function UserDetail({ user, posts, initialState }) {
5
+ // State for client-side data fetching when needed
6
+ const [userData, setUserData] = useState(user);
7
+ const [userPosts, setUserPosts] = useState(posts || []);
8
+ const [loading, setLoading] = useState(false);
9
+ const [error, setError] = useState(null);
10
+ // Get user ID from route params
11
+ const { id } = initialState?.params || {};
12
+ // Fetch user data if not provided from server
13
+ useEffect(() => {
14
+ if (!userData && id) {
15
+ setLoading(true);
16
+ Promise.all([
17
+ UserApi.getById(id),
18
+ UserApi.getPosts(id)
19
+ ])
20
+ .then(([userData, postsData]) => {
21
+ setUserData(userData);
22
+ setUserPosts(postsData);
23
+ setLoading(false);
24
+ })
25
+ .catch(err => {
26
+ console.error('Error fetching user data:', err);
27
+ setError(err.message || 'Failed to load user data');
28
+ setLoading(false);
29
+ });
30
+ }
31
+ }, [userData, id]);
32
+ if (loading) {
33
+ return (_jsx("div", { className: "max-w-4xl mx-auto p-4", children: _jsxs("div", { className: "animate-pulse rounded-md bg-gray-100 p-8", children: [_jsx("div", { className: "h-8 bg-gray-200 rounded w-1/4 mb-4" }), _jsx("div", { className: "h-4 bg-gray-200 rounded w-1/2 mb-2" }), _jsx("div", { className: "h-4 bg-gray-200 rounded w-3/4 mb-4" }), _jsx("div", { className: "h-40 bg-gray-200 rounded mb-4" })] }) }));
34
+ }
35
+ if (error) {
36
+ return (_jsx("div", { className: "max-w-4xl mx-auto p-4", children: _jsxs("div", { className: "rounded-md bg-red-50 p-4 border border-red-200", children: [_jsx("h2", { className: "text-lg font-bold text-red-700", children: "Error Loading User" }), _jsx("p", { className: "text-red-600", children: error })] }) }));
37
+ }
38
+ if (!userData) {
39
+ return (_jsx("div", { className: "max-w-4xl mx-auto p-4", children: _jsxs("div", { className: "rounded-md bg-yellow-50 p-4 border border-yellow-200", children: [_jsx("h2", { className: "text-lg font-bold text-yellow-700", children: "User Not Found" }), _jsxs("p", { className: "text-yellow-600", children: ["Could not find user with ID: ", id] }), _jsx("a", { href: "/users", className: "text-blue-600 hover:underline mt-2 block", children: "Back to Users List" })] }) }));
40
+ }
41
+ return (_jsxs("div", { className: "max-w-4xl mx-auto p-4", children: [_jsxs("div", { className: "bg-white shadow-lg rounded-lg p-6 mb-6", children: [_jsx("h1", { className: "text-2xl font-bold text-gray-800 mb-4", children: userData.name }), _jsxs("div", { className: "user-info mb-6", children: [_jsxs("p", { className: "text-gray-600", children: [_jsx("span", { className: "font-bold", children: "ID:" }), " ", userData.id] }), _jsxs("p", { className: "text-gray-600", children: [_jsx("span", { className: "font-bold", children: "Email:" }), " ", userData.email] })] }), _jsx("a", { href: "/users", className: "text-blue-600 hover:underline", children: "Back to Users List" })] }), userPosts && userPosts.length > 0 ? (_jsxs("div", { className: "bg-white shadow-lg rounded-lg p-6", children: [_jsxs("h2", { className: "text-xl font-bold text-gray-800 mb-4", children: ["Posts by ", userData.name] }), _jsx("div", { className: "space-y-4", children: userPosts.map(post => (_jsxs("div", { className: "border-b pb-4", children: [_jsx("h3", { className: "text-lg font-semibold", children: post.title }), _jsx("p", { className: "text-gray-600", children: post.content })] }, post.id))) })] })) : (_jsxs("div", { className: "bg-white shadow-lg rounded-lg p-6", children: [_jsxs("h2", { className: "text-xl font-bold text-gray-800 mb-4", children: ["Posts by ", userData.name] }), _jsx("p", { className: "text-gray-500 italic", children: "No posts found for this user." })] }))] }));
42
+ }
43
+ // Next.js style server-side data fetching
44
+ export async function getServerSideProps({ params }) {
45
+ try {
46
+ const userId = params.id;
47
+ // Parallel data fetching
48
+ const [user, posts] = await Promise.all([
49
+ UserApi.getById(parseInt(userId)),
50
+ UserApi.getPosts(parseInt(userId))
51
+ ]);
52
+ // Handle user not found
53
+ if (!user) {
54
+ return {
55
+ notFound: true
56
+ };
57
+ }
58
+ return {
59
+ props: {
60
+ user,
61
+ posts
62
+ }
63
+ };
64
+ }
65
+ catch (error) {
66
+ console.error(`Error fetching user ${params.id}:`, error);
67
+ // Pass the error for client-side handling
68
+ return {
69
+ props: {
70
+ error: {
71
+ message: error.message,
72
+ status: error.status || 500
73
+ },
74
+ user: null,
75
+ posts: []
76
+ }
77
+ };
78
+ }
79
+ }
@@ -0,0 +1,14 @@
1
+ declare const UsersPage: {
2
+ ({ initialState }: {
3
+ initialState: any;
4
+ }): JSX.Element;
5
+ getInitialData(): Promise<{
6
+ users: {
7
+ id: number;
8
+ name: string;
9
+ email: string;
10
+ }[];
11
+ }>;
12
+ };
13
+ export default UsersPage;
14
+ //# sourceMappingURL=users.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"users.d.ts","sourceRoot":"","sources":["users.tsx"],"names":[],"mappings":"AAIA,QAAA,MAAM,SAAS;;;;;;;;;;;CA8Cd,CAAC;AASF,eAAe,SAAS,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "frontend-hamroun/jsx-runtime";
2
+ import Layout from '../components/Layout';
3
+ import { UserApi } from '../data/api';
4
+ const UsersPage = ({ initialState }) => {
5
+ const users = initialState.data?.users || [];
6
+ return (_jsx(Layout, { title: "User Management", children: _jsxs("div", { className: "max-w-4xl mx-auto", children: [_jsxs("div", { className: "bg-blue-50 p-6 rounded-lg mb-8 border border-blue-100", children: [_jsx("h2", { className: "text-xl font-semibold text-blue-800 mb-2", children: "Data Fetching Demo" }), _jsx("p", { className: "text-blue-700", children: "This page demonstrates dynamic data fetching with the Users API." })] }), _jsxs("div", { className: "bg-white shadow-md rounded-lg overflow-hidden", children: [_jsx("div", { className: "px-6 py-4 border-b border-gray-200", children: _jsx("h2", { className: "text-xl font-semibold text-gray-800", children: "User List" }) }), users.length === 0 ? (_jsx("div", { className: "p-6 text-center text-gray-500", children: _jsx("p", { children: "No users found." }) })) : (_jsx("div", { className: "overflow-x-auto", children: _jsxs("table", { className: "w-full", children: [_jsx("thead", { children: _jsxs("tr", { className: "bg-gray-50", children: [_jsx("th", { className: "text-left py-3 px-6 font-medium text-gray-600 text-sm uppercase tracking-wider border-b", children: "ID" }), _jsx("th", { className: "text-left py-3 px-6 font-medium text-gray-600 text-sm uppercase tracking-wider border-b", children: "Name" }), _jsx("th", { className: "text-left py-3 px-6 font-medium text-gray-600 text-sm uppercase tracking-wider border-b", children: "Email" })] }) }), _jsx("tbody", { className: "divide-y divide-gray-200", children: users.map(user => (_jsxs("tr", { className: "hover:bg-gray-50", children: [_jsx("td", { className: "py-4 px-6 text-sm text-gray-900", children: user.id }), _jsx("td", { className: "py-4 px-6 text-sm font-medium text-gray-900", children: user.name }), _jsx("td", { className: "py-4 px-6 text-sm text-gray-500", children: user.email })] }, user.id))) })] }) }))] })] }) }));
7
+ };
8
+ // Static method to fetch initial data for this page
9
+ UsersPage.getInitialData = async () => {
10
+ return {
11
+ users: await UserApi.getAll()
12
+ };
13
+ };
14
+ export default UsersPage;
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=wasm-demo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wasm-demo.d.ts","sourceRoot":"","sources":["wasm-demo.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ // This file will be removed as it contains WASM functionality
@@ -0,0 +1,22 @@
1
+ export interface PageProps {
2
+ initialState: any;
3
+ }
4
+ export interface PageComponent {
5
+ (props: PageProps): any;
6
+ getInitialData?: (path: string) => Promise<any>;
7
+ }
8
+ export declare class Router {
9
+ private routes;
10
+ private notFoundComponent;
11
+ register(path: string, component: PageComponent): Router;
12
+ setNotFound(component: PageComponent): Router;
13
+ getNotFound(): PageComponent | null;
14
+ getAllRoutes(): Record<string, PageComponent>;
15
+ resolve(path: string): Promise<PageComponent | null>;
16
+ discoverRoutes(): Promise<Record<string, PageComponent>>;
17
+ tryLoadCoreRoutes(): Promise<void>;
18
+ }
19
+ export declare const router: Router;
20
+ export declare const NotFound: PageComponent;
21
+ export declare function initializeRouter(): Promise<Router>;
22
+ //# sourceMappingURL=router.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["router.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,SAAS;IACxB,YAAY,EAAE,GAAG,CAAC;CACnB;AAED,MAAM,WAAW,aAAa;IAC5B,CAAC,KAAK,EAAE,SAAS,GAAG,GAAG,CAAC;IACxB,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;CACjD;AAQD,qBAAa,MAAM;IACjB,OAAO,CAAC,MAAM,CAAqC;IACnD,OAAO,CAAC,iBAAiB,CAA8B;IAGvD,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,GAAG,MAAM;IAQxD,WAAW,CAAC,SAAS,EAAE,aAAa,GAAG,MAAM;IAM7C,WAAW,IAAI,aAAa,GAAG,IAAI;IAKnC,YAAY,IAAI,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;IAKvC,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAsGpD,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAiBxD,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;CA4BzC;AAGD,eAAO,MAAM,MAAM,QAAe,CAAC;AAGnC,eAAO,MAAM,QAAQ,EAAE,aAgBtB,CAAC;AAMF,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC,CA8BxD"}