baraqex 1.0.63 → 1.0.65

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 (98) hide show
  1. package/bin/baraqex.js +1013 -1126
  2. package/dist/api/hello.d.ts +3 -0
  3. package/dist/api/hello.d.ts.map +1 -0
  4. package/dist/api/users/[id].d.ts +5 -0
  5. package/dist/api/users/[id].d.ts.map +1 -0
  6. package/dist/browser.d.ts +40 -0
  7. package/dist/browser.d.ts.map +1 -0
  8. package/dist/browser.js +407 -1
  9. package/dist/browser.js.map +4 -4
  10. package/dist/browser.package.json +4 -0
  11. package/dist/forms/index.d.ts +2 -0
  12. package/dist/forms/index.d.ts.map +1 -0
  13. package/dist/forms/types.d.ts +2 -0
  14. package/dist/forms/types.d.ts.map +1 -0
  15. package/dist/frontend/components/WasmLoader.d.ts +2 -0
  16. package/dist/frontend/components/WasmLoader.d.ts.map +1 -0
  17. package/dist/frontend/hooks/useWasm.d.ts +2 -0
  18. package/dist/frontend/hooks/useWasm.d.ts.map +1 -0
  19. package/dist/frontend/index.d.ts +2 -0
  20. package/dist/frontend/index.d.ts.map +1 -0
  21. package/dist/index.d.ts +38 -0
  22. package/dist/index.d.ts.map +1 -0
  23. package/dist/index.js +678 -317
  24. package/dist/index.js.map +4 -4
  25. package/dist/renderComponent.d.ts +9 -0
  26. package/dist/renderComponent.d.ts.map +1 -0
  27. package/dist/router/index.d.ts +2 -0
  28. package/dist/router/index.d.ts.map +1 -0
  29. package/dist/router/types.d.ts +2 -0
  30. package/dist/router/types.d.ts.map +1 -0
  31. package/dist/server/api-router.d.ts +16 -0
  32. package/dist/server/api-router.d.ts.map +1 -0
  33. package/dist/server/auth.d.ts +25 -0
  34. package/dist/server/auth.d.ts.map +1 -0
  35. package/dist/server/database.d.ts +22 -0
  36. package/dist/server/database.d.ts.map +1 -0
  37. package/dist/server/index.d.ts +116 -0
  38. package/dist/server/index.d.ts.map +1 -0
  39. package/dist/{server.js → server/index.js} +120 -23
  40. package/dist/server/index.js.map +7 -0
  41. package/dist/server/middleware.d.ts +11 -0
  42. package/dist/server/middleware.d.ts.map +1 -0
  43. package/dist/server/package.json +4 -0
  44. package/dist/server/templates.d.ts +31 -0
  45. package/dist/server/templates.d.ts.map +1 -0
  46. package/dist/server/types.d.ts +69 -0
  47. package/dist/server/types.d.ts.map +1 -0
  48. package/dist/server/utils.d.ts +70 -0
  49. package/dist/server/utils.d.ts.map +1 -0
  50. package/dist/server/wasm.d.ts +29 -0
  51. package/dist/server/wasm.d.ts.map +1 -0
  52. package/dist/server-renderer.d.ts +5 -0
  53. package/dist/server-renderer.d.ts.map +1 -0
  54. package/dist/store/index.d.ts +2 -0
  55. package/dist/store/index.d.ts.map +1 -0
  56. package/dist/store/types.d.ts +2 -0
  57. package/dist/store/types.d.ts.map +1 -0
  58. package/dist/wasm.d.ts +51 -0
  59. package/dist/wasm.d.ts.map +1 -0
  60. package/package.json +65 -56
  61. package/templates/basic-app/src/main.tsx +1 -0
  62. package/templates/fullstack-template/.env.example +42 -0
  63. package/templates/fullstack-template/README.md +38 -42
  64. package/templates/fullstack-template/package-lock.json +7932 -0
  65. package/templates/fullstack-template/package.json +58 -6
  66. package/templates/fullstack-template/server.js +28 -9
  67. package/templates/fullstack-template/src/App.tsx +94 -0
  68. package/templates/fullstack-template/src/api/auth/login.ts +75 -0
  69. package/templates/fullstack-template/src/api/auth/me.ts +66 -0
  70. package/templates/fullstack-template/src/api/auth/register.ts +59 -0
  71. package/templates/fullstack-template/src/api/todos/[id].ts +108 -0
  72. package/templates/fullstack-template/src/api/todos/index.ts +79 -0
  73. package/templates/fullstack-template/src/components/Dashboard.tsx +129 -0
  74. package/templates/fullstack-template/src/components/Header.tsx +76 -0
  75. package/templates/fullstack-template/src/contexts/ApiContext.tsx +69 -0
  76. package/templates/fullstack-template/src/contexts/AuthContext.tsx +155 -0
  77. package/templates/fullstack-template/src/server.ts +167 -0
  78. package/templates/fullstack-template/src/styles/App.css +446 -0
  79. package/templates/ssr-template/package-lock.json +38 -60
  80. package/templates/ssr-template/package.json +1 -1
  81. package/templates/ssr-template/src/App.tsx +4 -3
  82. package/templates/ssr-template/src/client.tsx +2 -1
  83. package/templates/wasm/App.tsx +564 -0
  84. package/templates/wasm/client.tsx +220 -0
  85. package/templates/wasm/index.tsx +21 -0
  86. package/templates/wasm/package-lock.json +5347 -5307
  87. package/templates/wasm/package.json +43 -25
  88. package/templates/wasm/public/example.wasm +0 -0
  89. package/templates/wasm/public/wasm_exec.js +1 -12
  90. package/templates/wasm/server.ts +145 -0
  91. package/templates/wasm/vite.config.ts +42 -24
  92. package/README_WASM.md +0 -472
  93. package/dist/server.js.map +0 -7
  94. package/templates/basic-app/src/App.jsx +0 -0
  95. package/templates/basic-app/src/App.tsx +0 -0
  96. package/templates/fullstack-template/src/api/hello.js +0 -17
  97. package/templates/fullstack-template/src/pages/index.js +0 -206
  98. /package/templates/{basic-app/server.js → wasm/go/wasm_exec.js} +0 -0
File without changes
@@ -1,17 +0,0 @@
1
- export function get(req, res) {
2
- res.json({
3
- message: 'Hello from API!',
4
- timestamp: new Date().toISOString(),
5
- method: 'GET'
6
- });
7
- }
8
-
9
- export function post(req, res) {
10
- const { name } = req.body;
11
- res.json({
12
- message: `Hello ${name || 'World'}!`,
13
- timestamp: new Date().toISOString(),
14
- method: 'POST',
15
- received: req.body
16
- });
17
- }
@@ -1,206 +0,0 @@
1
- import { jsx, useState } from 'frontend-hamroun';
2
-
3
- export default function HomePage(props) {
4
- const [count, setCount] = useState(0);
5
-
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', {
33
- style: {
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', {
100
- style: {
101
- margin: '0 0 1rem 0',
102
- color: '#155724'
103
- }
104
- }, '🎯 Features Included:'),
105
- jsx('ul', {
106
- style: {
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
- )
144
- ),
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')
191
- )
192
- ),
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')
201
- );
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';