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.
- package/bin/baraqex.js +28 -27
- package/dist/server/index.d.ts +3 -6
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +8 -125
- package/dist/server/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/fullstack-template/src/pages/index.js +193 -48
- package/templates/ssr-template/package-lock.json +5080 -0
- package/templates/ssr-template/package.json +8 -14
- package/templates/ssr-template/src/App.tsx +7 -19
- package/templates/ssr-template/src/client.tsx +1 -21
- package/templates/ssr-template/src/server.ts +14 -183
- package/templates/ssr-template/tsconfig.json +6 -15
- package/templates/ssr-template/tsconfig.server.json +5 -18
- package/templates/wasm/build-wasm.js +228 -0
- package/templates/wasm/esbuild.config.js +63 -0
- package/templates/wasm/go/main.go +256 -0
- package/templates/wasm/go/wasm_exec.js +0 -0
- package/templates/wasm/index.html +97 -0
- package/templates/wasm/jsx-shim.js +9 -0
- package/templates/wasm/package-lock.json +4848 -0
- package/templates/wasm/package.json +27 -0
- package/templates/wasm/public/example.wasm +0 -0
- package/templates/wasm/public/wasm_exec.js +572 -0
- package/templates/wasm/src/App.tsx +519 -0
- package/templates/wasm/src/client.tsx +220 -0
- package/templates/wasm/src/index.html +14 -0
- package/templates/wasm/src/index.tsx +21 -0
- package/templates/wasm/src/main.tsx +5 -0
- package/templates/wasm/src/server.ts +145 -0
- package/templates/wasm/src/wasm-loader.ts +119 -0
- package/templates/wasm/tsconfig.json +21 -0
- package/templates/wasm/tsconfig.node.json +13 -0
- package/templates/wasm/tsconfig.server.json +23 -0
- package/templates/wasm/vite.config.ts +73 -0
- 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', {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
-
|
|
58
|
-
|
|
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';
|