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
@@ -6,8 +6,33 @@ import {
6
6
  useErrorBoundary
7
7
  } from 'frontend-hamroun';
8
8
 
9
+ // Todo item interface
10
+ interface Todo {
11
+ id: number;
12
+ text: string;
13
+ completed: boolean;
14
+ priority: 'high' | 'medium' | 'low';
15
+ }
16
+
17
+ // Component prop interfaces
18
+ interface TodoItemProps {
19
+ todo: Todo;
20
+ onToggle: (id: number) => void;
21
+ onDelete: (id: number) => void;
22
+ }
23
+
24
+ interface ThemeToggleButtonProps {
25
+ theme: string;
26
+ onToggle: () => void;
27
+ }
28
+
29
+ interface AppFooterProps {
30
+ theme: string;
31
+ isBrowser: boolean;
32
+ }
33
+
9
34
  // Todo Item Component - simple props-based component
10
- function TodoItem({ todo, onToggle, onDelete }) {
35
+ function TodoItem({ todo, onToggle, onDelete }: TodoItemProps) {
11
36
  return (
12
37
  <div className={`todo-item ${todo.completed ? 'completed' : ''}`}>
13
38
  <input
@@ -37,7 +62,7 @@ function TodoItem({ todo, onToggle, onDelete }) {
37
62
  }
38
63
 
39
64
  // Theme Toggle Button Component
40
- function ThemeToggleButton({ theme, onToggle }) {
65
+ function ThemeToggleButton({ theme, onToggle }: ThemeToggleButtonProps) {
41
66
  return (
42
67
  <button
43
68
  onClick={onToggle}
@@ -50,7 +75,7 @@ function ThemeToggleButton({ theme, onToggle }) {
50
75
  }
51
76
 
52
77
  // App Footer Component
53
- function AppFooter({ theme, isBrowser }) {
78
+ function AppFooter({ theme, isBrowser }: AppFooterProps) {
54
79
  return (
55
80
  <footer className="app-footer">
56
81
  <div className="container">
@@ -62,17 +87,17 @@ function AppFooter({ theme, isBrowser }) {
62
87
  }
63
88
 
64
89
  export function App() {
65
- // State hooks
66
- const [todos, setTodos] = useState([
90
+ // State hooks with proper typing
91
+ const [todos, setTodos] = useState<Todo[]>([
67
92
  { id: 1, text: 'Learn Frontend Hamroun hooks', completed: false, priority: 'high' },
68
93
  { id: 2, text: 'Build a todo app', completed: false, priority: 'medium' },
69
94
  { id: 3, text: 'Master SSR concepts', completed: true, priority: 'low' }
70
95
  ]);
71
- const [newTask, setNewTask] = useState('');
72
- const [taskFilter, setTaskFilter] = useState('all');
73
- const [taskPriority, setTaskPriority] = useState('medium');
74
- const [theme, setTheme] = useState('light');
75
- const [isLoading, setIsLoading] = useState(false);
96
+ const [newTask, setNewTask] = useState<string>('');
97
+ const [taskFilter, setTaskFilter] = useState<string>('all');
98
+ const [taskPriority, setTaskPriority] = useState<'high' | 'medium' | 'low'>('medium');
99
+ const [theme, setTheme] = useState<string>('light');
100
+ const [isLoading, setIsLoading] = useState<boolean>(false);
76
101
 
77
102
  // Error boundary hook
78
103
  const [error, resetError] = useErrorBoundary();
@@ -147,22 +172,22 @@ export function App() {
147
172
  }, [todos]);
148
173
 
149
174
  // Todo action handlers
150
- const handleToggleTodo = (id) => {
175
+ const handleToggleTodo = (id: number) => {
151
176
  console.log('Toggling todo:', id);
152
177
  setTodos(prev => prev.map(todo =>
153
178
  todo.id === id ? { ...todo, completed: !todo.completed } : todo
154
179
  ));
155
180
  };
156
181
 
157
- const handleDeleteTodo = (id) => {
182
+ const handleDeleteTodo = (id: number) => {
158
183
  console.log('Deleting todo:', id);
159
184
  setTodos(prev => prev.filter(todo => todo.id !== id));
160
185
  };
161
186
 
162
- const handleAddTodo = (text, priority) => {
187
+ const handleAddTodo = (text: string, priority: 'high' | 'medium' | 'low') => {
163
188
  if (!text || !text.trim()) return;
164
189
 
165
- const newTodo = {
190
+ const newTodo: Todo = {
166
191
  id: Date.now(),
167
192
  text: text.trim(),
168
193
  completed: false,
@@ -185,7 +210,7 @@ export function App() {
185
210
  }
186
211
  };
187
212
 
188
- const handleKeyPress = (e) => {
213
+ const handleKeyPress = (e: React.KeyboardEvent<HTMLInputElement>) => {
189
214
  if (e.key === 'Enter') {
190
215
  addTask();
191
216
  }
@@ -211,7 +236,7 @@ export function App() {
211
236
  return (
212
237
  <div className="error-container">
213
238
  <h2>Something went wrong!</h2>
214
- <p>{error.message}</p>
239
+ <p>{(error as Error).message}</p>
215
240
  <button onClick={resetError} className="btn btn-primary">
216
241
  Try Again
217
242
  </button>
@@ -267,7 +292,7 @@ export function App() {
267
292
 
268
293
  <select
269
294
  value={taskPriority}
270
- onChange={(e) => setTaskPriority(e.target.value)}
295
+ onChange={(e) => setTaskPriority(e.target.value as 'high' | 'medium' | 'low')}
271
296
  className="select priority-select"
272
297
  disabled={isLoading}
273
298
  >
@@ -291,7 +316,7 @@ export function App() {
291
316
  <h2>🔍 Filter Todos</h2>
292
317
 
293
318
  <div className="filters">
294
- {['all', 'active', 'completed', 'high', 'medium', 'low'].map(filterType => (
319
+ {(['all', 'active', 'completed', 'high', 'medium', 'low'] as const).map(filterType => (
295
320
  <button
296
321
  key={filterType}
297
322
  onClick={() => setTaskFilter(filterType)}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["client.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import { hydrate, jsx } from 'frontend-hamroun';
2
+ import { App } from './App.js';
3
+ hydrate(jsx(App, {}), document.getElementById('root'));
@@ -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.ts"],"names":[],"mappings":""}
@@ -0,0 +1,29 @@
1
+ import express from 'express';
2
+ import path from 'path';
3
+ import { fileURLToPath } from 'url';
4
+ import { renderToString, jsx } from 'frontend-hamroun';
5
+ import { App } from './App.js';
6
+ const __filename = fileURLToPath(import.meta.url);
7
+ const __dirname = path.dirname(__filename);
8
+ const app = express();
9
+ const port = 3000;
10
+ // Serve static files from dist directory
11
+ app.use(express.static(path.join(__dirname)));
12
+ app.get('/', async (req, res) => {
13
+ const html = await renderToString(jsx(App, {}));
14
+ res.send(`
15
+ <!DOCTYPE html>
16
+ <html>
17
+ <head>
18
+ <title>SSR App</title>
19
+ </head>
20
+ <body>
21
+ <div id="root">${html}</div>
22
+ <script type="module" src="/client.js"></script>
23
+ </body>
24
+ </html>
25
+ `);
26
+ });
27
+ app.listen(port, () => {
28
+ console.log(`Server running at http://localhost:${port}`);
29
+ });
@@ -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.ts"],"names":[],"mappings":";AAGA,wBA4BG"}
@@ -0,0 +1,30 @@
1
+ import { defineConfig } from 'vite';
2
+ export default defineConfig({
3
+ esbuild: {
4
+ jsx: 'transform',
5
+ jsxFactory: 'jsx',
6
+ jsxFragment: 'Fragment',
7
+ jsxImportSource: 'frontend-hamroun',
8
+ },
9
+ ssr: {
10
+ noExternal: ['frontend-hamroun']
11
+ },
12
+ optimizeDeps: {
13
+ include: ['frontend-hamroun'],
14
+ exclude: []
15
+ },
16
+ build: {
17
+ target: 'esnext',
18
+ rollupOptions: {
19
+ output: {
20
+ format: 'es'
21
+ }
22
+ }
23
+ },
24
+ resolve: {
25
+ alias: {
26
+ 'frontend-hamroun/jsx-dev-runtime': 'frontend-hamroun',
27
+ 'frontend-hamroun/jsx-runtime': 'frontend-hamroun'
28
+ }
29
+ }
30
+ });
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=build-wasm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-wasm.d.ts","sourceRoot":"","sources":["build-wasm.js"],"names":[],"mappings":""}
@@ -0,0 +1,30 @@
1
+ declare function R(t: any): void;
2
+ declare function L(): number;
3
+ declare function _(): void;
4
+ declare function q(t: any, i: any, ...args: any[]): {
5
+ type: any;
6
+ props: any;
7
+ };
8
+ declare function h(t: any): any;
9
+ declare function N(t: any, i: any): Promise<void>;
10
+ declare function d(t: any): void;
11
+ declare function G(t: any, i: any): void;
12
+ declare function e(t: any, i: any, ...args: any[]): {
13
+ type: any;
14
+ props: any;
15
+ };
16
+ declare function j(t: any, ...i: any[]): any;
17
+ declare function J(): {
18
+ type: any;
19
+ props: any;
20
+ };
21
+ declare function k(): Promise<any>;
22
+ declare function Y(): Promise<void>;
23
+ declare let y: boolean;
24
+ declare const w: any[];
25
+ declare let m: number;
26
+ declare const z: Map<any, any>;
27
+ declare const T: boolean;
28
+ declare const H: Map<any, any>;
29
+ declare let O: boolean;
30
+ //# sourceMappingURL=index-BNqTDBdE.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-BNqTDBdE.d.ts","sourceRoot":"","sources":["index-BNqTDBdE.js"],"names":[],"mappings":"AAA0tB,iCAA0G;AAAsD,6BAAqC;AAAA,2BAAgC;AAAA;;;EAA+K;AAAA,gCAAkwC;AAAS,kDAA2J;AAAA,iCAAyE;AAAA,yCAA4E;AAAA;;;EAA+K;AAAA,6CAAiP;AAAgD;;;EAwR/mG;AAAA,mCAAmF;AAAA,oCAclF;AAtS2rB,uBAAS;AAAA,uBAAW;AAA0G,sBAAQ;AAAM,+BAAS;AAAC,yBAAmB;AAAC,+BAAS;AAAu/C,uBAAS"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=wasm_exec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wasm_exec.d.ts","sourceRoot":"","sources":["wasm_exec.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 @@
1
+ //# sourceMappingURL=wasm_exec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wasm_exec.d.ts","sourceRoot":"","sources":["wasm_exec.js"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import { jsx } from 'frontend-hamroun';
2
+ import { jsxs } from 'frontend-hamroun';
3
+ import { Fragment } from 'frontend-hamroun';
4
+ export { jsx, jsxs, Fragment };
5
+ //# sourceMappingURL=jsx-shim.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx-shim.d.ts","sourceRoot":"","sources":["jsx-shim.js"],"names":[],"mappings":"oBACoC,kBAAkB;qBAAlB,kBAAkB;yBAAlB,kBAAkB"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=wasm_exec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wasm_exec.d.ts","sourceRoot":"","sources":["wasm_exec.js"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export default 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":"AAGA,MAAM,CAAC,OAAO,UAAU,GAAG,gBAkiB1B"}