baraqex 1.0.32 → 1.0.33

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 (36) hide show
  1. package/bin/baraqex.js +28 -27
  2. package/dist/server/index.d.ts +3 -6
  3. package/dist/server/index.d.ts.map +1 -1
  4. package/dist/server/index.js +8 -125
  5. package/dist/server/index.js.map +1 -1
  6. package/package.json +1 -1
  7. package/templates/fullstack-template/src/pages/index.js +193 -48
  8. package/templates/ssr-template/package-lock.json +5080 -0
  9. package/templates/ssr-template/package.json +8 -14
  10. package/templates/ssr-template/src/App.tsx +7 -19
  11. package/templates/ssr-template/src/client.tsx +1 -21
  12. package/templates/ssr-template/src/server.ts +14 -183
  13. package/templates/ssr-template/tsconfig.json +6 -15
  14. package/templates/ssr-template/tsconfig.server.json +5 -18
  15. package/templates/wasm/build-wasm.js +228 -0
  16. package/templates/wasm/esbuild.config.js +63 -0
  17. package/templates/wasm/go/main.go +256 -0
  18. package/templates/wasm/go/wasm_exec.js +0 -0
  19. package/templates/wasm/index.html +97 -0
  20. package/templates/wasm/jsx-shim.js +9 -0
  21. package/templates/wasm/package-lock.json +4848 -0
  22. package/templates/wasm/package.json +27 -0
  23. package/templates/wasm/public/example.wasm +0 -0
  24. package/templates/wasm/public/wasm_exec.js +572 -0
  25. package/templates/wasm/src/App.tsx +519 -0
  26. package/templates/wasm/src/client.tsx +220 -0
  27. package/templates/wasm/src/index.html +14 -0
  28. package/templates/wasm/src/index.tsx +21 -0
  29. package/templates/wasm/src/main.tsx +5 -0
  30. package/templates/wasm/src/server.ts +145 -0
  31. package/templates/wasm/src/wasm-loader.ts +119 -0
  32. package/templates/wasm/tsconfig.json +21 -0
  33. package/templates/wasm/tsconfig.node.json +13 -0
  34. package/templates/wasm/tsconfig.server.json +23 -0
  35. package/templates/wasm/vite.config.ts +73 -0
  36. package/templates/wasm/wasm-loader.js +103 -0
@@ -3,59 +3,204 @@ import { jsx, useState } from 'frontend-hamroun';
3
3
  export default function HomePage(props) {
4
4
  const [count, setCount] = useState(0);
5
5
 
6
- return jsx('div', { style: { padding: '2rem', textAlign: 'center', fontFamily: 'system-ui' } },
7
- jsx('h1', null, 'Welcome to Your Full-Stack App! 🚀'),
8
- jsx('p', null, `Counter: ${count}`),
9
- jsx('div', { style: { margin: '1rem 0' } },
10
- jsx('button', {
11
- onclick: () => setCount(count + 1),
6
+ return jsx('div', {
7
+ style: {
8
+ padding: '2rem',
9
+ textAlign: 'center',
10
+ fontFamily: 'system-ui',
11
+ maxWidth: '800px',
12
+ margin: '0 auto'
13
+ }
14
+ },
15
+ jsx('h1', {
16
+ style: {
17
+ color: '#2c3e50',
18
+ marginBottom: '1rem',
19
+ fontSize: '2.5rem'
20
+ }
21
+ }, 'Welcome to Your Baraqex Full-Stack App! 🚀'),
22
+
23
+ jsx('div', {
24
+ style: {
25
+ background: '#f8f9fa',
26
+ padding: '2rem',
27
+ borderRadius: '12px',
28
+ margin: '2rem 0',
29
+ border: '1px solid #dee2e6'
30
+ }
31
+ },
32
+ jsx('p', {
12
33
  style: {
13
- padding: '0.5rem 1rem',
14
- margin: '0.5rem',
15
- background: '#007acc',
16
- color: 'white',
17
- border: 'none',
18
- borderRadius: '4px',
19
- cursor: 'pointer'
20
- }
21
- }, 'Increment'),
22
- jsx('button', {
23
- onclick: () => setCount(count - 1),
34
+ fontSize: '1.5rem',
35
+ fontWeight: 'bold',
36
+ color: '#495057',
37
+ margin: '0 0 1rem 0'
38
+ }
39
+ }, `Counter: ${count}`),
40
+
41
+ jsx('div', { style: { margin: '1rem 0' } },
42
+ jsx('button', {
43
+ onclick: () => setCount(count + 1),
44
+ style: {
45
+ padding: '0.75rem 1.5rem',
46
+ margin: '0.5rem',
47
+ background: '#007acc',
48
+ color: 'white',
49
+ border: 'none',
50
+ borderRadius: '6px',
51
+ cursor: 'pointer',
52
+ fontSize: '1rem',
53
+ fontWeight: '500',
54
+ transition: 'all 0.2s ease'
55
+ }
56
+ }, 'Increment'),
57
+ jsx('button', {
58
+ onclick: () => setCount(count - 1),
59
+ style: {
60
+ padding: '0.75rem 1.5rem',
61
+ margin: '0.5rem',
62
+ background: '#e74c3c',
63
+ color: 'white',
64
+ border: 'none',
65
+ borderRadius: '6px',
66
+ cursor: 'pointer',
67
+ fontSize: '1rem',
68
+ fontWeight: '500',
69
+ transition: 'all 0.2s ease'
70
+ }
71
+ }, 'Decrement'),
72
+ jsx('button', {
73
+ onclick: () => setCount(0),
74
+ style: {
75
+ padding: '0.75rem 1.5rem',
76
+ margin: '0.5rem',
77
+ background: '#95a5a6',
78
+ color: 'white',
79
+ border: 'none',
80
+ borderRadius: '6px',
81
+ cursor: 'pointer',
82
+ fontSize: '1rem',
83
+ fontWeight: '500',
84
+ transition: 'all 0.2s ease'
85
+ }
86
+ }, 'Reset')
87
+ )
88
+ ),
89
+
90
+ jsx('div', {
91
+ style: {
92
+ marginTop: '2rem',
93
+ padding: '1.5rem',
94
+ background: '#e8f5e8',
95
+ borderRadius: '8px',
96
+ border: '1px solid #c3e6c3'
97
+ }
98
+ },
99
+ jsx('h3', {
24
100
  style: {
25
- padding: '0.5rem 1rem',
26
- margin: '0.5rem',
27
- background: '#e74c3c',
28
- color: 'white',
29
- border: 'none',
30
- borderRadius: '4px',
31
- cursor: 'pointer'
32
- }
33
- }, 'Decrement'),
34
- jsx('button', {
35
- onclick: () => setCount(0),
101
+ margin: '0 0 1rem 0',
102
+ color: '#155724'
103
+ }
104
+ }, '🎯 Features Included:'),
105
+ jsx('ul', {
36
106
  style: {
37
- padding: '0.5rem 1rem',
38
- margin: '0.5rem',
39
- background: '#95a5a6',
40
- color: 'white',
41
- border: 'none',
42
- borderRadius: '4px',
43
- cursor: 'pointer'
44
- }
45
- }, 'Reset')
107
+ textAlign: 'left',
108
+ maxWidth: '500px',
109
+ margin: '0 auto',
110
+ listStyle: 'none',
111
+ padding: 0
112
+ }
113
+ },
114
+ jsx('li', {
115
+ style: {
116
+ padding: '0.5rem 0',
117
+ borderBottom: '1px solid rgba(0,0,0,0.1)'
118
+ }
119
+ }, '✅ Server-side rendering with ESBuild'),
120
+ jsx('li', {
121
+ style: {
122
+ padding: '0.5rem 0',
123
+ borderBottom: '1px solid rgba(0,0,0,0.1)'
124
+ }
125
+ }, '✅ API routes in src/api/'),
126
+ jsx('li', {
127
+ style: {
128
+ padding: '0.5rem 0',
129
+ borderBottom: '1px solid rgba(0,0,0,0.1)'
130
+ }
131
+ }, '✅ Page-based routing'),
132
+ jsx('li', {
133
+ style: {
134
+ padding: '0.5rem 0',
135
+ borderBottom: '1px solid rgba(0,0,0,0.1)'
136
+ }
137
+ }, '✅ Client-side hydration'),
138
+ jsx('li', {
139
+ style: {
140
+ padding: '0.5rem 0'
141
+ }
142
+ }, '✅ Frontend Hamroun hooks')
143
+ )
46
144
  ),
47
- jsx('div', { style: { marginTop: '2rem', padding: '1rem', background: '#f8f9fa', borderRadius: '8px' } },
48
- jsx('h3', null, '🎯 Features Included:'),
49
- jsx('ul', { style: { textAlign: 'left', maxWidth: '400px', margin: '0 auto' } },
50
- jsx('li', null, '✅ Server-side rendering'),
51
- jsx('li', null, '✅ API routes in src/api/'),
52
- jsx('li', null, '✅ Page-based routing'),
53
- jsx('li', null, '✅ Client-side hydration'),
54
- jsx('li', null, '✅ Frontend Hamroun hooks')
145
+
146
+ jsx('div', {
147
+ style: {
148
+ marginTop: '2rem',
149
+ padding: '1.5rem',
150
+ background: '#fff3cd',
151
+ borderRadius: '8px',
152
+ border: '1px solid #ffeaa7'
153
+ }
154
+ },
155
+ jsx('h3', {
156
+ style: {
157
+ margin: '0 0 1rem 0',
158
+ color: '#856404'
159
+ }
160
+ }, '🔗 Quick Links:'),
161
+ jsx('div', {
162
+ style: {
163
+ display: 'flex',
164
+ gap: '1rem',
165
+ justifyContent: 'center',
166
+ flexWrap: 'wrap'
167
+ }
168
+ },
169
+ jsx('a', {
170
+ href: '/api/hello',
171
+ style: {
172
+ padding: '0.5rem 1rem',
173
+ background: '#17a2b8',
174
+ color: 'white',
175
+ textDecoration: 'none',
176
+ borderRadius: '4px',
177
+ fontSize: '0.9rem'
178
+ }
179
+ }, 'API Hello'),
180
+ jsx('a', {
181
+ href: '/api-docs',
182
+ style: {
183
+ padding: '0.5rem 1rem',
184
+ background: '#6f42c1',
185
+ color: 'white',
186
+ textDecoration: 'none',
187
+ borderRadius: '4px',
188
+ fontSize: '0.9rem'
189
+ }
190
+ }, 'API Docs')
55
191
  )
56
192
  ),
57
- jsx('p', { style: { marginTop: '2rem', color: '#666' } },
58
- 'Edit src/pages/index.js to customize this page'
59
- )
193
+
194
+ jsx('p', {
195
+ style: {
196
+ marginTop: '2rem',
197
+ color: '#6c757d',
198
+ fontSize: '0.9rem'
199
+ }
200
+ }, 'Edit src/pages/index.js to customize this page')
60
201
  );
61
202
  }
203
+
204
+ // Optional: Add metadata for SEO
205
+ HomePage.title = 'Baraqex Full-Stack App';
206
+ HomePage.description = 'A complete full-stack application built with Baraqex framework';