frontend-hamroun 1.2.83 → 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 (245) hide show
  1. package/bin/cli.js +57 -869
  2. package/dist/index.cjs +1 -1
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.client.cjs +1 -1
  5. package/dist/index.client.cjs.map +1 -1
  6. package/dist/index.client.js +2 -2
  7. package/dist/index.client.js.map +1 -1
  8. package/dist/index.js +116 -136
  9. package/dist/index.js.map +1 -1
  10. package/dist/jsx-runtime.cjs.map +1 -1
  11. package/dist/jsx-runtime.js.map +1 -1
  12. package/dist/renderer-DaVfBeVi.cjs +2 -0
  13. package/dist/renderer-DaVfBeVi.cjs.map +1 -0
  14. package/dist/renderer-nfT7XSpo.js +61 -0
  15. package/dist/renderer-nfT7XSpo.js.map +1 -0
  16. package/dist/server-renderer-B5b0Q0ck.cjs +2 -0
  17. package/dist/server-renderer-B5b0Q0ck.cjs.map +1 -0
  18. package/dist/{server-renderer-C1WXH-zV.js → server-renderer-C4MB-jAp.js} +6 -39
  19. package/dist/server-renderer-C4MB-jAp.js.map +1 -0
  20. package/dist/server-renderer.cjs +1 -1
  21. package/dist/server-renderer.js +1 -1
  22. package/package.json +1 -1
  23. package/templates/basic-app/build.d.ts +2 -0
  24. package/templates/basic-app/build.d.ts.map +1 -0
  25. package/templates/basic-app/dev.d.ts +2 -0
  26. package/templates/basic-app/dev.d.ts.map +1 -0
  27. package/templates/basic-app/esbuild.config.d.ts +2 -0
  28. package/templates/basic-app/esbuild.config.d.ts.map +1 -0
  29. package/templates/basic-app/postcss.config.d.ts +8 -0
  30. package/templates/basic-app/postcss.config.d.ts.map +1 -0
  31. package/templates/basic-app/server.d.ts +2 -0
  32. package/templates/basic-app/server.d.ts.map +1 -0
  33. package/templates/basic-app/src/App.d.ts +2 -0
  34. package/templates/basic-app/src/App.d.ts.map +1 -0
  35. package/templates/basic-app/src/App.js +148 -0
  36. package/templates/basic-app/src/App.tsx +397 -19
  37. package/templates/basic-app/src/client.d.ts +2 -0
  38. package/templates/basic-app/src/client.d.ts.map +1 -0
  39. package/templates/basic-app/src/client.js +6 -0
  40. package/templates/basic-app/src/components/Counter.d.ts +4 -0
  41. package/templates/basic-app/src/components/Counter.d.ts.map +1 -0
  42. package/templates/basic-app/src/components/Counter.js +9 -0
  43. package/templates/basic-app/src/jsx-shim.d.ts +8 -0
  44. package/templates/basic-app/src/jsx-shim.d.ts.map +1 -0
  45. package/templates/basic-app/src/main.d.ts +2 -0
  46. package/templates/basic-app/src/main.d.ts.map +1 -0
  47. package/templates/basic-app/src/main.js +57 -0
  48. package/templates/basic-app/src/server.d.ts +2 -0
  49. package/templates/basic-app/src/server.d.ts.map +1 -0
  50. package/templates/basic-app/tailwind.config.d.ts +9 -0
  51. package/templates/basic-app/tailwind.config.d.ts.map +1 -0
  52. package/templates/basic-app/vite.config.d.ts +3 -0
  53. package/templates/basic-app/vite.config.d.ts.map +1 -0
  54. package/templates/basic-app/vite.config.js +7 -0
  55. package/templates/complete-app/api/hello.d.ts +1 -0
  56. package/templates/complete-app/api/hello.d.ts.map +1 -0
  57. package/templates/complete-app/client.d.ts +2 -0
  58. package/templates/complete-app/client.d.ts.map +1 -0
  59. package/templates/complete-app/lib/frontend-hamroun.d.ts +18 -0
  60. package/templates/complete-app/lib/frontend-hamroun.d.ts.map +1 -0
  61. package/templates/complete-app/pages/about.d.ts +7 -0
  62. package/templates/complete-app/pages/about.d.ts.map +1 -0
  63. package/templates/complete-app/pages/index.d.ts +7 -0
  64. package/templates/complete-app/pages/index.d.ts.map +1 -0
  65. package/templates/complete-app/pages/wasm-demo.d.ts +7 -0
  66. package/templates/complete-app/pages/wasm-demo.d.ts.map +1 -0
  67. package/templates/complete-app/public/client.d.ts +17 -0
  68. package/templates/complete-app/public/client.d.ts.map +1 -0
  69. package/templates/complete-app/server.d.ts +2 -0
  70. package/templates/complete-app/server.d.ts.map +1 -0
  71. package/templates/complete-app/server.js +236 -218
  72. package/templates/complete-app/src/App.d.ts +2 -0
  73. package/templates/complete-app/src/App.d.ts.map +1 -0
  74. package/templates/complete-app/src/App.js +27 -0
  75. package/templates/complete-app/src/client.d.ts +2 -0
  76. package/templates/complete-app/src/client.d.ts.map +1 -0
  77. package/templates/complete-app/src/client.js +52 -0
  78. package/templates/complete-app/src/pages/index.d.ts +2 -0
  79. package/templates/complete-app/src/pages/index.d.ts.map +1 -0
  80. package/templates/complete-app/src/pages/index.js +19 -0
  81. package/templates/complete-app/src/server.d.ts +2 -0
  82. package/templates/complete-app/src/server.d.ts.map +1 -0
  83. package/templates/complete-app/src/server.js +192 -0
  84. package/templates/complete-app/vite.config.d.ts +3 -0
  85. package/templates/complete-app/vite.config.d.ts.map +1 -0
  86. package/templates/complete-app/vite.config.js +29 -57
  87. package/templates/fullstack-app/api/hello.d.ts +4 -0
  88. package/templates/fullstack-app/api/hello.d.ts.map +1 -0
  89. package/templates/fullstack-app/api/hello.js +14 -11
  90. package/templates/fullstack-app/api/users/[id].d.ts +5 -0
  91. package/templates/fullstack-app/api/users/[id].d.ts.map +1 -0
  92. package/templates/fullstack-app/api/users/[id].js +52 -0
  93. package/templates/fullstack-app/api/users/index.d.ts +4 -0
  94. package/templates/fullstack-app/api/users/index.d.ts.map +1 -0
  95. package/templates/fullstack-app/api/users/index.js +25 -0
  96. package/templates/fullstack-app/build/main.d.ts +211 -0
  97. package/templates/fullstack-app/build/main.d.ts.map +1 -0
  98. package/templates/fullstack-app/build.d.ts +2 -0
  99. package/templates/fullstack-app/build.d.ts.map +1 -0
  100. package/templates/fullstack-app/build.js +190 -0
  101. package/templates/fullstack-app/postcss.config.d.ts +5 -0
  102. package/templates/fullstack-app/postcss.config.d.ts.map +1 -0
  103. package/templates/fullstack-app/process-tailwind.d.ts +2 -0
  104. package/templates/fullstack-app/process-tailwind.d.ts.map +1 -0
  105. package/templates/fullstack-app/public/route-handler.d.ts +1 -0
  106. package/templates/fullstack-app/public/route-handler.d.ts.map +1 -0
  107. package/templates/fullstack-app/server.d.ts +2 -0
  108. package/templates/fullstack-app/server.d.ts.map +1 -0
  109. package/templates/fullstack-app/server.js +428 -266
  110. package/templates/fullstack-app/src/client.d.ts +2 -0
  111. package/templates/fullstack-app/src/client.d.ts.map +1 -0
  112. package/templates/fullstack-app/src/components/ClientHome.d.ts +1 -0
  113. package/templates/fullstack-app/src/components/ClientHome.d.ts.map +1 -0
  114. package/templates/fullstack-app/src/components/ClientHome.js +1 -0
  115. package/templates/fullstack-app/src/components/ErrorBoundary.d.ts +7 -0
  116. package/templates/fullstack-app/src/components/ErrorBoundary.d.ts.map +1 -0
  117. package/templates/fullstack-app/src/components/ErrorBoundary.js +12 -0
  118. package/templates/fullstack-app/src/components/Layout.d.ts +7 -0
  119. package/templates/fullstack-app/src/components/Layout.d.ts.map +1 -0
  120. package/templates/fullstack-app/src/components/Layout.js +4 -0
  121. package/templates/fullstack-app/src/components/StateDemo.d.ts +2 -0
  122. package/templates/fullstack-app/src/components/StateDemo.d.ts.map +1 -0
  123. package/templates/fullstack-app/src/components/StateDemo.js +86 -0
  124. package/templates/fullstack-app/src/components/UserList.d.ts +11 -0
  125. package/templates/fullstack-app/src/components/UserList.d.ts.map +1 -0
  126. package/templates/fullstack-app/src/components/UserList.js +7 -0
  127. package/templates/fullstack-app/src/config.d.ts +29 -0
  128. package/templates/fullstack-app/src/config.d.ts.map +1 -0
  129. package/templates/fullstack-app/src/config.js +36 -0
  130. package/templates/fullstack-app/src/data/api.d.ts +35 -0
  131. package/templates/fullstack-app/src/data/api.d.ts.map +1 -0
  132. package/templates/fullstack-app/src/data/api.js +173 -0
  133. package/templates/fullstack-app/src/main.d.ts +7 -0
  134. package/templates/fullstack-app/src/main.d.ts.map +1 -0
  135. package/templates/fullstack-app/src/main.js +130 -0
  136. package/templates/fullstack-app/src/middleware.d.ts +10 -0
  137. package/templates/fullstack-app/src/middleware.d.ts.map +1 -0
  138. package/templates/fullstack-app/src/middleware.js +14 -0
  139. package/templates/fullstack-app/src/pages/404.d.ts +4 -0
  140. package/templates/fullstack-app/src/pages/404.d.ts.map +1 -0
  141. package/templates/fullstack-app/src/pages/404.js +4 -0
  142. package/templates/fullstack-app/src/pages/[id].d.ts +1 -0
  143. package/templates/fullstack-app/src/pages/[id].d.ts.map +1 -0
  144. package/templates/fullstack-app/src/pages/[id].js +1 -0
  145. package/templates/fullstack-app/src/pages/_app.d.ts +6 -0
  146. package/templates/fullstack-app/src/pages/_app.d.ts.map +1 -0
  147. package/templates/fullstack-app/src/pages/_app.js +6 -0
  148. package/templates/fullstack-app/src/pages/_document.d.ts +7 -0
  149. package/templates/fullstack-app/src/pages/_document.d.ts.map +1 -0
  150. package/templates/fullstack-app/src/pages/_document.js +4 -0
  151. package/templates/fullstack-app/src/pages/_error.d.ts +4 -0
  152. package/templates/fullstack-app/src/pages/_error.d.ts.map +1 -0
  153. package/templates/fullstack-app/src/pages/_error.js +8 -0
  154. package/templates/fullstack-app/src/pages/about/index.d.ts +5 -0
  155. package/templates/fullstack-app/src/pages/about/index.d.ts.map +1 -0
  156. package/templates/fullstack-app/src/pages/about/index.js +6 -0
  157. package/templates/fullstack-app/src/pages/about.d.ts +10 -0
  158. package/templates/fullstack-app/src/pages/about.d.ts.map +1 -0
  159. package/templates/fullstack-app/src/pages/about.js +21 -0
  160. package/templates/fullstack-app/src/pages/api/users/[id].d.ts +6 -0
  161. package/templates/fullstack-app/src/pages/api/users/[id].d.ts.map +1 -0
  162. package/templates/fullstack-app/src/pages/api/users/[id].js +51 -0
  163. package/templates/fullstack-app/src/pages/api/users/index.d.ts +4 -0
  164. package/templates/fullstack-app/src/pages/api/users/index.d.ts.map +1 -0
  165. package/templates/fullstack-app/src/pages/api/users/index.js +33 -0
  166. package/templates/fullstack-app/src/pages/index.d.ts +21 -0
  167. package/templates/fullstack-app/src/pages/index.d.ts.map +1 -0
  168. package/templates/fullstack-app/src/pages/index.js +66 -0
  169. package/templates/fullstack-app/src/pages/users/[id].d.ts +38 -0
  170. package/templates/fullstack-app/src/pages/users/[id].d.ts.map +1 -0
  171. package/templates/fullstack-app/src/pages/users/[id].js +79 -0
  172. package/templates/fullstack-app/src/pages/users.d.ts +14 -0
  173. package/templates/fullstack-app/src/pages/users.d.ts.map +1 -0
  174. package/templates/fullstack-app/src/pages/users.js +14 -0
  175. package/templates/fullstack-app/src/pages/wasm-demo.d.ts +1 -0
  176. package/templates/fullstack-app/src/pages/wasm-demo.d.ts.map +1 -0
  177. package/templates/fullstack-app/src/pages/wasm-demo.js +2 -0
  178. package/templates/fullstack-app/src/router.d.ts +22 -0
  179. package/templates/fullstack-app/src/router.d.ts.map +1 -0
  180. package/templates/fullstack-app/src/router.js +210 -0
  181. package/templates/fullstack-app/tailwind.config.d.ts +3 -0
  182. package/templates/fullstack-app/tailwind.config.d.ts.map +1 -0
  183. package/templates/fullstack-app/vite.config.d.ts +3 -0
  184. package/templates/fullstack-app/vite.config.d.ts.map +1 -0
  185. package/templates/ssr-template/dist/client/assets/main-D-VH3xOb.d.ts +2 -0
  186. package/templates/ssr-template/dist/client/assets/main-D-VH3xOb.d.ts.map +1 -0
  187. package/templates/ssr-template/dist/client.d.ts +85 -0
  188. package/templates/ssr-template/dist/client.d.ts.map +1 -0
  189. package/templates/ssr-template/dist/server.d.ts +2 -0
  190. package/templates/ssr-template/dist/server.d.ts.map +1 -0
  191. package/templates/ssr-template/esbuild.config.d.ts +2 -0
  192. package/templates/ssr-template/esbuild.config.d.ts.map +1 -0
  193. package/templates/ssr-template/jsx-shim.d.ts +2 -0
  194. package/templates/ssr-template/jsx-shim.d.ts.map +1 -0
  195. package/templates/ssr-template/src/App.d.ts +2 -0
  196. package/templates/ssr-template/src/App.d.ts.map +1 -0
  197. package/templates/ssr-template/src/App.js +625 -0
  198. package/templates/ssr-template/src/App.tsx +43 -18
  199. package/templates/ssr-template/src/client.d.ts +2 -0
  200. package/templates/ssr-template/src/client.d.ts.map +1 -0
  201. package/templates/ssr-template/src/client.js +3 -0
  202. package/templates/ssr-template/src/server.d.ts +2 -0
  203. package/templates/ssr-template/src/server.d.ts.map +1 -0
  204. package/templates/ssr-template/src/server.js +29 -0
  205. package/templates/ssr-template/vite.config.d.ts +3 -0
  206. package/templates/ssr-template/vite.config.d.ts.map +1 -0
  207. package/templates/ssr-template/vite.config.js +30 -0
  208. package/templates/wasm/build-wasm.d.ts +2 -0
  209. package/templates/wasm/build-wasm.d.ts.map +1 -0
  210. package/templates/wasm/dist/assets/index-BNqTDBdE.d.ts +30 -0
  211. package/templates/wasm/dist/assets/index-BNqTDBdE.d.ts.map +1 -0
  212. package/templates/wasm/dist/wasm_exec.d.ts +1 -0
  213. package/templates/wasm/dist/wasm_exec.d.ts.map +1 -0
  214. package/templates/wasm/esbuild.config.d.ts +2 -0
  215. package/templates/wasm/esbuild.config.d.ts.map +1 -0
  216. package/templates/wasm/go/wasm_exec.d.ts +1 -0
  217. package/templates/wasm/go/wasm_exec.d.ts.map +1 -0
  218. package/templates/wasm/jsx-shim.d.ts +5 -0
  219. package/templates/wasm/jsx-shim.d.ts.map +1 -0
  220. package/templates/wasm/public/wasm_exec.d.ts +1 -0
  221. package/templates/wasm/public/wasm_exec.d.ts.map +1 -0
  222. package/templates/wasm/src/App.d.ts +2 -0
  223. package/templates/wasm/src/App.d.ts.map +1 -0
  224. package/templates/wasm/src/App.js +381 -0
  225. package/templates/wasm/src/client.d.ts +2 -0
  226. package/templates/wasm/src/client.d.ts.map +1 -0
  227. package/templates/wasm/src/client.js +210 -0
  228. package/templates/wasm/src/index.d.ts +2 -0
  229. package/templates/wasm/src/index.d.ts.map +1 -0
  230. package/templates/wasm/src/index.js +20 -0
  231. package/templates/wasm/src/server.d.ts +2 -0
  232. package/templates/wasm/src/server.d.ts.map +1 -0
  233. package/templates/wasm/src/server.js +131 -0
  234. package/templates/wasm/vite.config.d.ts +3 -0
  235. package/templates/wasm/vite.config.d.ts.map +1 -0
  236. package/templates/wasm/vite.config.js +36 -0
  237. package/templates/wasm/wasm-loader.d.ts +6 -0
  238. package/templates/wasm/wasm-loader.d.ts.map +1 -0
  239. package/dist/renderer-BL3gq8cW.cjs +0 -2
  240. package/dist/renderer-BL3gq8cW.cjs.map +0 -1
  241. package/dist/renderer-Dyy-o05F.js +0 -52
  242. package/dist/renderer-Dyy-o05F.js.map +0 -1
  243. package/dist/server-renderer-C1WXH-zV.js.map +0 -1
  244. package/dist/server-renderer-Chs-nmJm.cjs +0 -2
  245. package/dist/server-renderer-Chs-nmJm.cjs.map +0 -1
@@ -0,0 +1,210 @@
1
+ import { jsx } from 'frontend-hamroun';
2
+ // Define router class for handling routes
3
+ export class Router {
4
+ constructor() {
5
+ this.routes = {};
6
+ this.notFoundComponent = null;
7
+ }
8
+ // Register a component for a specific route
9
+ register(path, component) {
10
+ const normalizedPath = path === '/' ? 'index' : path.replace(/^\//, '');
11
+ this.routes[normalizedPath] = component;
12
+ console.log(`[Router] Registered component for path: ${normalizedPath}`);
13
+ return this;
14
+ }
15
+ // Set the not found component
16
+ setNotFound(component) {
17
+ this.notFoundComponent = component;
18
+ return this;
19
+ }
20
+ // Get the not found component
21
+ getNotFound() {
22
+ return this.notFoundComponent;
23
+ }
24
+ // Get all registered routes
25
+ getAllRoutes() {
26
+ return this.routes;
27
+ }
28
+ // Find component for a given path
29
+ async resolve(path) {
30
+ const normalizedPath = path === '/' ? 'index' : path.replace(/^\//, '');
31
+ console.log(`[Router] Resolving component for path: ${normalizedPath}`);
32
+ // Check for exact match first
33
+ if (this.routes[normalizedPath]) {
34
+ return this.routes[normalizedPath];
35
+ }
36
+ // Check for nested routes (e.g., "users/123" should match a "users/[id]" route)
37
+ const pathSegments = normalizedPath.split('/');
38
+ const registeredRoutes = Object.keys(this.routes);
39
+ // Try to find dynamic route matches
40
+ for (const route of registeredRoutes) {
41
+ const routeSegments = route.split('/');
42
+ // Skip routes with different segment count
43
+ if (routeSegments.length !== pathSegments.length)
44
+ continue;
45
+ let isMatch = true;
46
+ const params = {};
47
+ // Compare each segment
48
+ for (let i = 0; i < routeSegments.length; i++) {
49
+ const routeSegment = routeSegments[i];
50
+ const pathSegment = pathSegments[i];
51
+ // Handle dynamic segments (e.g., [id])
52
+ if (routeSegment.startsWith('[') && routeSegment.endsWith(']')) {
53
+ const paramName = routeSegment.slice(1, -1);
54
+ params[paramName] = pathSegment;
55
+ }
56
+ // Regular segment, must match exactly
57
+ else if (routeSegment !== pathSegment) {
58
+ isMatch = false;
59
+ break;
60
+ }
61
+ }
62
+ if (isMatch) {
63
+ console.log(`[Router] Found dynamic route match: ${route}`);
64
+ // Return the component with params
65
+ return this.routes[route];
66
+ }
67
+ }
68
+ // If no match found yet, try to dynamically import the component
69
+ try {
70
+ let component = null;
71
+ let resolvedPath = normalizedPath;
72
+ // Next.js-style dynamic route resolution
73
+ try {
74
+ // First, try direct file match (e.g., ./pages/users.tsx)
75
+ // Focus on .tsx since that's what this project uses
76
+ try {
77
+ console.log(`[Router] Trying direct import: ./pages/${resolvedPath}.tsx`);
78
+ const directModule = await import(/* @vite-ignore */ `./pages/${resolvedPath}.tsx`)
79
+ .catch(() => null);
80
+ if (directModule) {
81
+ component = directModule.default || directModule;
82
+ }
83
+ }
84
+ catch (e) {
85
+ console.warn(`[Router] Error importing ./pages/${resolvedPath}.tsx:`, e);
86
+ }
87
+ // Next, try index file in directory (e.g., ./pages/about/index.tsx)
88
+ if (!component && !resolvedPath.endsWith('index')) {
89
+ try {
90
+ console.log(`[Router] Trying index file: ./pages/${resolvedPath}/index.tsx`);
91
+ const indexModule = await import(/* @vite-ignore */ `./pages/${resolvedPath}/index.tsx`)
92
+ .catch(() => null);
93
+ if (indexModule) {
94
+ component = indexModule.default || indexModule;
95
+ }
96
+ }
97
+ catch (e) {
98
+ console.warn(`[Router] Error importing ./pages/${resolvedPath}/index.tsx:`, e);
99
+ }
100
+ }
101
+ }
102
+ catch (routeError) {
103
+ console.warn(`[Router] Error resolving Next.js style route:`, routeError);
104
+ }
105
+ // Register and return component if found
106
+ if (component) {
107
+ this.routes[normalizedPath] = component;
108
+ return component;
109
+ }
110
+ }
111
+ catch (error) {
112
+ console.warn(`[Router] Error importing component for ${normalizedPath}:`, error);
113
+ }
114
+ // If we reach here, no component was found
115
+ console.warn(`[Router] No component found for path: ${normalizedPath}`);
116
+ return this.notFoundComponent;
117
+ }
118
+ // Auto-discover components in the pages directory
119
+ async discoverRoutes() {
120
+ console.log('[Router] Auto-discovering routes from pages directory...');
121
+ try {
122
+ // Use a more conventional approach instead of relying on import.meta.glob
123
+ await this.tryLoadCoreRoutes();
124
+ console.log('[Router] Route discovery complete. Available routes:', Object.keys(this.routes));
125
+ return this.routes;
126
+ }
127
+ catch (error) {
128
+ console.error('[Router] Error discovering routes:', error);
129
+ await this.tryLoadCoreRoutes();
130
+ return this.routes;
131
+ }
132
+ }
133
+ // Fallback method to load core routes
134
+ async tryLoadCoreRoutes() {
135
+ // First try the auto-discovery approach with dynamic imports
136
+ const pageModules = [
137
+ { path: './pages/index', route: 'index' },
138
+ { path: './pages/about/index', route: 'about' },
139
+ { path: './pages/users', route: 'users' }
140
+ ];
141
+ // Try importing each module dynamically - focus on .tsx files
142
+ for (const { path, route } of pageModules) {
143
+ if (!this.routes[route]) {
144
+ try {
145
+ console.log(`[Router] Attempting to load route: ${route}`);
146
+ // Only try .tsx imports since that's what the project uses
147
+ const module = await import(/* @vite-ignore */ `${path}.tsx`)
148
+ .catch(() => null);
149
+ if (module && module.default) {
150
+ this.routes[route] = module.default;
151
+ console.log(`[Router] Registered route: ${route}`);
152
+ }
153
+ }
154
+ catch (error) {
155
+ console.warn(`[Router] Could not load route: ${route}`, error);
156
+ }
157
+ }
158
+ }
159
+ }
160
+ }
161
+ // Create and export a router instance
162
+ export const router = new Router();
163
+ // NotFound component as fallback (using jsx function instead of JSX syntax)
164
+ export const NotFound = ({ initialState }) => {
165
+ return jsx('div', { className: 'container mx-auto px-4 py-12 max-w-4xl' }, [
166
+ jsx('div', { className: 'bg-white shadow-lg rounded-lg overflow-hidden p-8' }, [
167
+ jsx('h1', { className: 'text-3xl font-bold text-gray-800 mb-4' }, ['Page Not Found']),
168
+ jsx('p', { className: 'text-gray-600 mb-6' }, [`No component found for path: ${initialState?.route || 'unknown'}`]),
169
+ jsx('a', { href: '/', className: 'text-blue-600 hover:text-blue-800 hover:underline transition-colors' }, ['Go to Home']),
170
+ jsx('div', { className: 'mt-8 p-6 bg-gray-50 rounded-lg border border-gray-200' }, [
171
+ jsx('h3', { className: 'text-lg font-medium text-gray-700 mb-3' }, ['Available Routes']),
172
+ jsx('ul', { className: 'space-y-2' }, [
173
+ jsx('li', {}, [jsx('a', { href: '/', className: 'text-blue-600 hover:text-blue-800 hover:underline' }, ['Home'])]),
174
+ jsx('li', {}, [jsx('a', { href: '/about', className: 'text-blue-600 hover:text-blue-800 hover:underline' }, ['About'])]),
175
+ jsx('li', {}, [jsx('a', { href: '/users', className: 'text-blue-600 hover:text-blue-800 hover:underline' }, ['Users'])])
176
+ ])
177
+ ])
178
+ ])
179
+ ]);
180
+ };
181
+ // Set NotFound as the default fallback
182
+ router.setNotFound(NotFound);
183
+ // Improved router initialization with auto-discovery
184
+ export async function initializeRouter() {
185
+ try {
186
+ console.log('[Router] Initializing router with auto-discovery...');
187
+ // Auto-discover routes
188
+ await router.discoverRoutes();
189
+ // Register fallback pages for key routes if they weren't discovered
190
+ const routes = router.getAllRoutes();
191
+ if (!routes['index']) {
192
+ router.register('index', ({ initialState }) => jsx('div', {}, [
193
+ jsx('h1', {}, ['Welcome']),
194
+ jsx('p', {}, ['This is the home page.'])
195
+ ]));
196
+ }
197
+ if (!routes['about']) {
198
+ router.register('about', ({ initialState }) => jsx('div', {}, [
199
+ jsx('h1', {}, ['About']),
200
+ jsx('p', {}, ['This is the about page.'])
201
+ ]));
202
+ }
203
+ console.log('[Router] Router initialized with routes:', Object.keys(router.getAllRoutes()));
204
+ return router;
205
+ }
206
+ catch (error) {
207
+ console.error('[Router] Error initializing router:', error);
208
+ return router;
209
+ }
210
+ }
@@ -0,0 +1,3 @@
1
+ declare const _exports: any;
2
+ export = _exports;
3
+ //# sourceMappingURL=tailwind.config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tailwind.config.d.ts","sourceRoot":"","sources":["tailwind.config.js"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ declare const _default: import("vite").UserConfig;
2
+ export default _default;
3
+ //# sourceMappingURL=vite.config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vite.config.d.ts","sourceRoot":"","sources":["vite.config.js"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=main-D-VH3xOb.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main-D-VH3xOb.d.ts","sourceRoot":"","sources":["main-D-VH3xOb.js"],"names":[],"mappings":""}
@@ -0,0 +1,85 @@
1
+ declare function batchUpdates(fn: any): void;
2
+ declare function batchUpdates(fn: any): void;
3
+ declare function setRenderCallback(callback: any, element: any, container: any): void;
4
+ declare function setRenderCallback(callback: any, element: any, container: any): void;
5
+ declare function prepareRender(): any;
6
+ declare function prepareRender(): any;
7
+ declare function finishRender(): void;
8
+ declare function finishRender(): void;
9
+ declare function useState(initial: any): any[];
10
+ declare function useState(initial: any): any[];
11
+ declare function useEffect(callback: any, deps: any): void;
12
+ declare function useEffect(callback: any, deps: any): void;
13
+ declare function useMemo(factory: any, deps: any): any;
14
+ declare function useMemo(factory: any, deps: any): any;
15
+ declare function rerender(rendererId: any): Promise<void>;
16
+ declare function rerender(rendererId: any): Promise<void>;
17
+ declare function useErrorBoundary(): any[];
18
+ declare function useErrorBoundary(): any[];
19
+ declare function jsx(type: any, props: any, ...children: any[]): {
20
+ type: any;
21
+ props: any;
22
+ };
23
+ declare function jsx(type: any, props: any, ...args: any[]): {
24
+ type: any;
25
+ props: any;
26
+ };
27
+ declare function jsx(type: any, props: any, ...args: any[]): {
28
+ type: any;
29
+ props: any;
30
+ };
31
+ declare function createElement(vnode: any): Promise<any>;
32
+ declare function createElement(vnode: any): any;
33
+ declare function hydrate(element: any, container: any): void;
34
+ declare function hydrate(element: any, container: any): Promise<void>;
35
+ declare function hydrate(element: any, container: any): Promise<void>;
36
+ declare function render(element: any, container: any): Promise<void>;
37
+ declare function render(element: any, container: any): Promise<void>;
38
+ declare function TodoItem({ todo, onToggle, onDelete }: {
39
+ todo: any;
40
+ onToggle: any;
41
+ onDelete: any;
42
+ }): {
43
+ type: any;
44
+ props: any;
45
+ };
46
+ declare function ThemeToggleButton({ theme, onToggle }: {
47
+ theme: any;
48
+ onToggle: any;
49
+ }): {
50
+ type: any;
51
+ props: any;
52
+ };
53
+ declare function AppFooter({ theme, isBrowser }: {
54
+ theme: any;
55
+ isBrowser: any;
56
+ }): {
57
+ type: any;
58
+ props: any;
59
+ };
60
+ declare function App({ Component, pageProps, initialState: initialState2 }: {
61
+ Component: any;
62
+ pageProps: any;
63
+ initialState: any;
64
+ }): {
65
+ type: any;
66
+ props: any;
67
+ };
68
+ declare function App(): {
69
+ type: any;
70
+ props: any;
71
+ };
72
+ declare var isBatching: boolean;
73
+ declare var queue: any[];
74
+ declare var currentRender: number;
75
+ declare var states: Map<any, any>;
76
+ declare var stateIndices: Map<any, any>;
77
+ declare var effects: Map<any, any>;
78
+ declare var memos: Map<any, any>;
79
+ declare var globalRenderCallback: null;
80
+ declare var globalContainer: null;
81
+ declare var currentElement: null;
82
+ declare var isServer: boolean;
83
+ declare var serverStates: Map<any, any>;
84
+ declare var isHydrating: boolean;
85
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["client.js"],"names":[],"mappings":";AAGA,6CAeC;;AAWD,sFAIC;;AACD,sCAIC;;AACD,sCAKC;;AACD,+CAyCC;;AACD,2DAmBC;;AACD,uDAiBC;;AACD,0DAgBC;;AACD,2CAGC;;;;;;;;;AACD;;;EAOC;;AACD,gDAqEC;;;AAED,sEAOC;;AACD,qEAeC;AAGD;;;;;;;EAkBC;AACD;;;;;;EAUC;AACD;;;;;;EAEC;;;;;;;;;AACD;;;EAupBC;AAl7BD,gCAAuB;AACvB,yBAAe;AAiBf,kCAAsB;AACtB,kCAAuC;AACvC,wCAA6C;AAC7C,mCAAwC;AACxC,iCAAsC;AACtC,uCAAgC;AAChC,kCAA2B;AAC3B,iCAA0B;AAC1B,8BAA6C;AAC7C,wCAA6C;AAoM7C,iCAAwB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["server.js"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=esbuild.config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"esbuild.config.d.ts","sourceRoot":"","sources":["esbuild.config.js"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export { jsx, Fragment } from "frontend-hamroun";
2
+ //# sourceMappingURL=jsx-shim.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx-shim.d.ts","sourceRoot":"","sources":["jsx-shim.js"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export declare function App(): JSX.Element;
2
+ //# sourceMappingURL=App.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["App.tsx"],"names":[],"mappings":"AAwFA,wBAAgB,GAAG,gBAyxBlB"}