alepha 0.12.1 → 0.13.1

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 (198) hide show
  1. package/dist/api-notifications/index.d.ts +111 -111
  2. package/dist/api-users/index.d.ts +1240 -1240
  3. package/dist/api-verifications/index.d.ts +94 -94
  4. package/dist/cli/{dist-Sz2EXvQX.cjs → dist-Dl9Vl7Ur.js} +17 -13
  5. package/dist/cli/{dist-BBPjuQ56.js.map → dist-Dl9Vl7Ur.js.map} +1 -1
  6. package/dist/cli/index.d.ts +3 -11
  7. package/dist/cli/index.js +106 -74
  8. package/dist/cli/index.js.map +1 -1
  9. package/dist/email/index.js +71 -73
  10. package/dist/email/index.js.map +1 -1
  11. package/dist/orm/index.d.ts +1 -1
  12. package/dist/orm/index.js.map +1 -1
  13. package/dist/queue/index.d.ts +4 -4
  14. package/dist/redis/index.d.ts +10 -10
  15. package/dist/retry/index.d.ts +1 -1
  16. package/dist/retry/index.js +2 -2
  17. package/dist/retry/index.js.map +1 -1
  18. package/dist/scheduler/index.d.ts +6 -6
  19. package/dist/server/index.js +1 -1
  20. package/dist/server/index.js.map +1 -1
  21. package/dist/server-auth/index.d.ts +193 -193
  22. package/dist/server-health/index.d.ts +17 -17
  23. package/dist/server-links/index.d.ts +34 -34
  24. package/dist/server-metrics/index.js +170 -174
  25. package/dist/server-metrics/index.js.map +1 -1
  26. package/dist/server-security/index.d.ts +9 -9
  27. package/dist/vite/index.js +4 -5
  28. package/dist/vite/index.js.map +1 -1
  29. package/dist/websocket/index.d.ts +7 -7
  30. package/package.json +52 -103
  31. package/src/cli/apps/AlephaPackageBuilderCli.ts +7 -2
  32. package/src/cli/assets/appRouterTs.ts +9 -0
  33. package/src/cli/assets/indexHtml.ts +2 -1
  34. package/src/cli/assets/mainBrowserTs.ts +10 -0
  35. package/src/cli/commands/CoreCommands.ts +6 -5
  36. package/src/cli/commands/DrizzleCommands.ts +65 -57
  37. package/src/cli/commands/VerifyCommands.ts +1 -1
  38. package/src/cli/services/ProjectUtils.ts +44 -38
  39. package/src/orm/providers/DrizzleKitProvider.ts +1 -1
  40. package/src/retry/descriptors/$retry.ts +5 -3
  41. package/src/server/providers/NodeHttpServerProvider.ts +1 -1
  42. package/src/vite/helpers/boot.ts +3 -3
  43. package/dist/api-files/index.cjs +0 -1293
  44. package/dist/api-files/index.cjs.map +0 -1
  45. package/dist/api-files/index.d.cts +0 -829
  46. package/dist/api-jobs/index.cjs +0 -274
  47. package/dist/api-jobs/index.cjs.map +0 -1
  48. package/dist/api-jobs/index.d.cts +0 -654
  49. package/dist/api-notifications/index.cjs +0 -380
  50. package/dist/api-notifications/index.cjs.map +0 -1
  51. package/dist/api-notifications/index.d.cts +0 -289
  52. package/dist/api-parameters/index.cjs +0 -66
  53. package/dist/api-parameters/index.cjs.map +0 -1
  54. package/dist/api-parameters/index.d.cts +0 -84
  55. package/dist/api-users/index.cjs +0 -6009
  56. package/dist/api-users/index.cjs.map +0 -1
  57. package/dist/api-users/index.d.cts +0 -4740
  58. package/dist/api-verifications/index.cjs +0 -407
  59. package/dist/api-verifications/index.cjs.map +0 -1
  60. package/dist/api-verifications/index.d.cts +0 -207
  61. package/dist/batch/index.cjs +0 -408
  62. package/dist/batch/index.cjs.map +0 -1
  63. package/dist/batch/index.d.cts +0 -330
  64. package/dist/bin/index.cjs +0 -17
  65. package/dist/bin/index.cjs.map +0 -1
  66. package/dist/bin/index.d.cts +0 -1
  67. package/dist/bucket/index.cjs +0 -303
  68. package/dist/bucket/index.cjs.map +0 -1
  69. package/dist/bucket/index.d.cts +0 -355
  70. package/dist/cache/index.cjs +0 -241
  71. package/dist/cache/index.cjs.map +0 -1
  72. package/dist/cache/index.d.cts +0 -202
  73. package/dist/cache-redis/index.cjs +0 -84
  74. package/dist/cache-redis/index.cjs.map +0 -1
  75. package/dist/cache-redis/index.d.cts +0 -40
  76. package/dist/cli/chunk-DSlc6foC.cjs +0 -43
  77. package/dist/cli/dist-BBPjuQ56.js +0 -2778
  78. package/dist/cli/dist-Sz2EXvQX.cjs.map +0 -1
  79. package/dist/cli/index.cjs +0 -1241
  80. package/dist/cli/index.cjs.map +0 -1
  81. package/dist/cli/index.d.cts +0 -422
  82. package/dist/command/index.cjs +0 -693
  83. package/dist/command/index.cjs.map +0 -1
  84. package/dist/command/index.d.cts +0 -340
  85. package/dist/core/index.cjs +0 -2264
  86. package/dist/core/index.cjs.map +0 -1
  87. package/dist/core/index.d.cts +0 -1927
  88. package/dist/datetime/index.cjs +0 -318
  89. package/dist/datetime/index.cjs.map +0 -1
  90. package/dist/datetime/index.d.cts +0 -145
  91. package/dist/email/index.cjs +0 -10874
  92. package/dist/email/index.cjs.map +0 -1
  93. package/dist/email/index.d.cts +0 -186
  94. package/dist/fake/index.cjs +0 -34641
  95. package/dist/fake/index.cjs.map +0 -1
  96. package/dist/fake/index.d.cts +0 -74
  97. package/dist/file/index.cjs +0 -1212
  98. package/dist/file/index.cjs.map +0 -1
  99. package/dist/file/index.d.cts +0 -698
  100. package/dist/lock/index.cjs +0 -226
  101. package/dist/lock/index.cjs.map +0 -1
  102. package/dist/lock/index.d.cts +0 -361
  103. package/dist/lock-redis/index.cjs +0 -113
  104. package/dist/lock-redis/index.cjs.map +0 -1
  105. package/dist/lock-redis/index.d.cts +0 -24
  106. package/dist/logger/index.cjs +0 -521
  107. package/dist/logger/index.cjs.map +0 -1
  108. package/dist/logger/index.d.cts +0 -281
  109. package/dist/orm/index.cjs +0 -2986
  110. package/dist/orm/index.cjs.map +0 -1
  111. package/dist/orm/index.d.cts +0 -2213
  112. package/dist/queue/index.cjs +0 -1044
  113. package/dist/queue/index.cjs.map +0 -1
  114. package/dist/queue/index.d.cts +0 -1265
  115. package/dist/queue-redis/index.cjs +0 -873
  116. package/dist/queue-redis/index.cjs.map +0 -1
  117. package/dist/queue-redis/index.d.cts +0 -82
  118. package/dist/redis/index.cjs +0 -153
  119. package/dist/redis/index.cjs.map +0 -1
  120. package/dist/redis/index.d.cts +0 -82
  121. package/dist/retry/index.cjs +0 -146
  122. package/dist/retry/index.cjs.map +0 -1
  123. package/dist/retry/index.d.cts +0 -172
  124. package/dist/router/index.cjs +0 -111
  125. package/dist/router/index.cjs.map +0 -1
  126. package/dist/router/index.d.cts +0 -46
  127. package/dist/scheduler/index.cjs +0 -576
  128. package/dist/scheduler/index.cjs.map +0 -1
  129. package/dist/scheduler/index.d.cts +0 -145
  130. package/dist/security/index.cjs +0 -2402
  131. package/dist/security/index.cjs.map +0 -1
  132. package/dist/security/index.d.cts +0 -598
  133. package/dist/server/index.cjs +0 -1680
  134. package/dist/server/index.cjs.map +0 -1
  135. package/dist/server/index.d.cts +0 -810
  136. package/dist/server-auth/index.cjs +0 -3146
  137. package/dist/server-auth/index.cjs.map +0 -1
  138. package/dist/server-auth/index.d.cts +0 -1164
  139. package/dist/server-cache/index.cjs +0 -252
  140. package/dist/server-cache/index.cjs.map +0 -1
  141. package/dist/server-cache/index.d.cts +0 -164
  142. package/dist/server-compress/index.cjs +0 -141
  143. package/dist/server-compress/index.cjs.map +0 -1
  144. package/dist/server-compress/index.d.cts +0 -38
  145. package/dist/server-cookies/index.cjs +0 -234
  146. package/dist/server-cookies/index.cjs.map +0 -1
  147. package/dist/server-cookies/index.d.cts +0 -144
  148. package/dist/server-cors/index.cjs +0 -201
  149. package/dist/server-cors/index.cjs.map +0 -1
  150. package/dist/server-cors/index.d.cts +0 -140
  151. package/dist/server-health/index.cjs +0 -62
  152. package/dist/server-health/index.cjs.map +0 -1
  153. package/dist/server-health/index.d.cts +0 -58
  154. package/dist/server-helmet/index.cjs +0 -131
  155. package/dist/server-helmet/index.cjs.map +0 -1
  156. package/dist/server-helmet/index.d.cts +0 -97
  157. package/dist/server-links/index.cjs +0 -992
  158. package/dist/server-links/index.cjs.map +0 -1
  159. package/dist/server-links/index.d.cts +0 -513
  160. package/dist/server-metrics/index.cjs +0 -4535
  161. package/dist/server-metrics/index.cjs.map +0 -1
  162. package/dist/server-metrics/index.d.cts +0 -35
  163. package/dist/server-multipart/index.cjs +0 -237
  164. package/dist/server-multipart/index.cjs.map +0 -1
  165. package/dist/server-multipart/index.d.cts +0 -50
  166. package/dist/server-proxy/index.cjs +0 -186
  167. package/dist/server-proxy/index.cjs.map +0 -1
  168. package/dist/server-proxy/index.d.cts +0 -234
  169. package/dist/server-rate-limit/index.cjs +0 -241
  170. package/dist/server-rate-limit/index.cjs.map +0 -1
  171. package/dist/server-rate-limit/index.d.cts +0 -183
  172. package/dist/server-security/index.cjs +0 -316
  173. package/dist/server-security/index.cjs.map +0 -1
  174. package/dist/server-security/index.d.cts +0 -173
  175. package/dist/server-static/index.cjs +0 -170
  176. package/dist/server-static/index.cjs.map +0 -1
  177. package/dist/server-static/index.d.cts +0 -121
  178. package/dist/server-swagger/index.cjs +0 -1021
  179. package/dist/server-swagger/index.cjs.map +0 -1
  180. package/dist/server-swagger/index.d.cts +0 -382
  181. package/dist/sms/index.cjs +0 -221
  182. package/dist/sms/index.cjs.map +0 -1
  183. package/dist/sms/index.d.cts +0 -130
  184. package/dist/thread/index.cjs +0 -350
  185. package/dist/thread/index.cjs.map +0 -1
  186. package/dist/thread/index.d.cts +0 -260
  187. package/dist/topic/index.cjs +0 -282
  188. package/dist/topic/index.cjs.map +0 -1
  189. package/dist/topic/index.d.cts +0 -523
  190. package/dist/topic-redis/index.cjs +0 -71
  191. package/dist/topic-redis/index.cjs.map +0 -1
  192. package/dist/topic-redis/index.d.cts +0 -42
  193. package/dist/vite/index.cjs +0 -1077
  194. package/dist/vite/index.cjs.map +0 -1
  195. package/dist/vite/index.d.cts +0 -542
  196. package/dist/websocket/index.cjs +0 -1117
  197. package/dist/websocket/index.cjs.map +0 -1
  198. package/dist/websocket/index.d.cts +0 -861
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "alepha",
3
3
  "description": "Easy-to-use modern TypeScript framework for building many kind of applications.",
4
4
  "author": "Nicolas Foures",
5
- "version": "0.12.1",
5
+ "version": "0.13.1",
6
6
  "type": "module",
7
7
  "engines": {
8
8
  "node": ">=22.0.0"
@@ -70,268 +70,217 @@
70
70
  "exports": {
71
71
  "./api/files": {
72
72
  "types": "./dist/api-files/index.js",
73
- "import": "./dist/api-files/index.js",
74
- "require": "./dist/api-files/index.js"
73
+ "import": "./dist/api-files/index.js"
75
74
  },
76
75
  "./api/jobs": {
77
76
  "types": "./dist/api-jobs/index.js",
78
- "import": "./dist/api-jobs/index.js",
79
- "require": "./dist/api-jobs/index.js"
77
+ "import": "./dist/api-jobs/index.js"
80
78
  },
81
79
  "./api/notifications": {
82
80
  "types": "./dist/api-notifications/index.js",
83
- "import": "./dist/api-notifications/index.js",
84
- "require": "./dist/api-notifications/index.js"
81
+ "import": "./dist/api-notifications/index.js"
85
82
  },
86
83
  "./api/parameters": {
87
84
  "types": "./dist/api-parameters/index.js",
88
- "import": "./dist/api-parameters/index.js",
89
- "require": "./dist/api-parameters/index.js"
85
+ "import": "./dist/api-parameters/index.js"
90
86
  },
91
87
  "./api/users": {
92
88
  "types": "./dist/api-users/index.js",
93
89
  "browser": "./dist/api-users/index.browser.js",
94
- "import": "./dist/api-users/index.js",
95
- "require": "./dist/api-users/index.js"
90
+ "import": "./dist/api-users/index.js"
96
91
  },
97
92
  "./api/verifications": {
98
93
  "types": "./dist/api-verifications/index.js",
99
- "import": "./dist/api-verifications/index.js",
100
- "require": "./dist/api-verifications/index.js"
94
+ "import": "./dist/api-verifications/index.js"
101
95
  },
102
96
  "./batch": {
103
97
  "types": "./dist/batch/index.js",
104
- "import": "./dist/batch/index.js",
105
- "require": "./dist/batch/index.js"
98
+ "import": "./dist/batch/index.js"
106
99
  },
107
100
  "./bin": {
108
101
  "types": "./dist/bin/index.js",
109
- "import": "./dist/bin/index.js",
110
- "require": "./dist/bin/index.js"
102
+ "import": "./dist/bin/index.js"
111
103
  },
112
104
  "./bucket": {
113
105
  "types": "./dist/bucket/index.js",
114
- "import": "./dist/bucket/index.js",
115
- "require": "./dist/bucket/index.js"
106
+ "import": "./dist/bucket/index.js"
116
107
  },
117
108
  "./cache": {
118
109
  "types": "./dist/cache/index.js",
119
- "import": "./dist/cache/index.js",
120
- "require": "./dist/cache/index.js"
110
+ "import": "./dist/cache/index.js"
121
111
  },
122
112
  "./cache/redis": {
123
113
  "types": "./dist/cache-redis/index.js",
124
- "import": "./dist/cache-redis/index.js",
125
- "require": "./dist/cache-redis/index.js"
114
+ "import": "./dist/cache-redis/index.js"
126
115
  },
127
116
  "./cli": {
128
117
  "types": "./dist/cli/index.js",
129
- "import": "./dist/cli/index.js",
130
- "require": "./dist/cli/index.js"
118
+ "import": "./dist/cli/index.js"
131
119
  },
132
120
  "./command": {
133
121
  "types": "./dist/command/index.js",
134
- "import": "./dist/command/index.js",
135
- "require": "./dist/command/index.js"
122
+ "import": "./dist/command/index.js"
136
123
  },
137
124
  ".": {
138
125
  "types": "./dist/core/index.js",
139
126
  "browser": "./dist/core/index.browser.js",
140
- "import": "./dist/core/index.js",
141
- "require": "./dist/core/index.js"
127
+ "import": "./dist/core/index.js"
142
128
  },
143
129
  "./datetime": {
144
130
  "types": "./dist/datetime/index.js",
145
- "import": "./dist/datetime/index.js",
146
- "require": "./dist/datetime/index.js"
131
+ "import": "./dist/datetime/index.js"
147
132
  },
148
133
  "./email": {
149
134
  "types": "./dist/email/index.js",
150
- "import": "./dist/email/index.js",
151
- "require": "./dist/email/index.js"
135
+ "import": "./dist/email/index.js"
152
136
  },
153
137
  "./fake": {
154
138
  "types": "./dist/fake/index.js",
155
- "import": "./dist/fake/index.js",
156
- "require": "./dist/fake/index.js"
139
+ "import": "./dist/fake/index.js"
157
140
  },
158
141
  "./file": {
159
142
  "types": "./dist/file/index.js",
160
- "import": "./dist/file/index.js",
161
- "require": "./dist/file/index.js"
143
+ "import": "./dist/file/index.js"
162
144
  },
163
145
  "./lock": {
164
146
  "types": "./dist/lock/index.js",
165
- "import": "./dist/lock/index.js",
166
- "require": "./dist/lock/index.js"
147
+ "import": "./dist/lock/index.js"
167
148
  },
168
149
  "./lock/redis": {
169
150
  "types": "./dist/lock-redis/index.js",
170
- "import": "./dist/lock-redis/index.js",
171
- "require": "./dist/lock-redis/index.js"
151
+ "import": "./dist/lock-redis/index.js"
172
152
  },
173
153
  "./logger": {
174
154
  "types": "./dist/logger/index.js",
175
- "import": "./dist/logger/index.js",
176
- "require": "./dist/logger/index.js"
155
+ "import": "./dist/logger/index.js"
177
156
  },
178
157
  "./orm": {
179
158
  "types": "./dist/orm/index.js",
180
159
  "browser": "./dist/orm/index.browser.js",
181
- "import": "./dist/orm/index.js",
182
- "require": "./dist/orm/index.js"
160
+ "import": "./dist/orm/index.js"
183
161
  },
184
162
  "./queue": {
185
163
  "types": "./dist/queue/index.js",
186
- "import": "./dist/queue/index.js",
187
- "require": "./dist/queue/index.js"
164
+ "import": "./dist/queue/index.js"
188
165
  },
189
166
  "./queue/redis": {
190
167
  "types": "./dist/queue-redis/index.js",
191
- "import": "./dist/queue-redis/index.js",
192
- "require": "./dist/queue-redis/index.js"
168
+ "import": "./dist/queue-redis/index.js"
193
169
  },
194
170
  "./redis": {
195
171
  "types": "./dist/redis/index.js",
196
- "import": "./dist/redis/index.js",
197
- "require": "./dist/redis/index.js"
172
+ "import": "./dist/redis/index.js"
198
173
  },
199
174
  "./retry": {
200
175
  "types": "./dist/retry/index.js",
201
- "import": "./dist/retry/index.js",
202
- "require": "./dist/retry/index.js"
176
+ "import": "./dist/retry/index.js"
203
177
  },
204
178
  "./router": {
205
179
  "types": "./dist/router/index.js",
206
- "import": "./dist/router/index.js",
207
- "require": "./dist/router/index.js"
180
+ "import": "./dist/router/index.js"
208
181
  },
209
182
  "./scheduler": {
210
183
  "types": "./dist/scheduler/index.js",
211
- "import": "./dist/scheduler/index.js",
212
- "require": "./dist/scheduler/index.js"
184
+ "import": "./dist/scheduler/index.js"
213
185
  },
214
186
  "./security": {
215
187
  "types": "./dist/security/index.js",
216
188
  "browser": "./dist/security/index.browser.js",
217
- "import": "./dist/security/index.js",
218
- "require": "./dist/security/index.js"
189
+ "import": "./dist/security/index.js"
219
190
  },
220
191
  "./server": {
221
192
  "types": "./dist/server/index.js",
222
193
  "browser": "./dist/server/index.browser.js",
223
- "import": "./dist/server/index.js",
224
- "require": "./dist/server/index.js"
194
+ "import": "./dist/server/index.js"
225
195
  },
226
196
  "./server/auth": {
227
197
  "types": "./dist/server-auth/index.js",
228
198
  "browser": "./dist/server-auth/index.browser.js",
229
- "import": "./dist/server-auth/index.js",
230
- "require": "./dist/server-auth/index.js"
199
+ "import": "./dist/server-auth/index.js"
231
200
  },
232
201
  "./server/cache": {
233
202
  "types": "./dist/server-cache/index.js",
234
- "import": "./dist/server-cache/index.js",
235
- "require": "./dist/server-cache/index.js"
203
+ "import": "./dist/server-cache/index.js"
236
204
  },
237
205
  "./server/compress": {
238
206
  "types": "./dist/server-compress/index.js",
239
- "import": "./dist/server-compress/index.js",
240
- "require": "./dist/server-compress/index.js"
207
+ "import": "./dist/server-compress/index.js"
241
208
  },
242
209
  "./server/cookies": {
243
210
  "types": "./dist/server-cookies/index.js",
244
211
  "browser": "./dist/server-cookies/index.browser.js",
245
- "import": "./dist/server-cookies/index.js",
246
- "require": "./dist/server-cookies/index.js"
212
+ "import": "./dist/server-cookies/index.js"
247
213
  },
248
214
  "./server/cors": {
249
215
  "types": "./dist/server-cors/index.js",
250
- "import": "./dist/server-cors/index.js",
251
- "require": "./dist/server-cors/index.js"
216
+ "import": "./dist/server-cors/index.js"
252
217
  },
253
218
  "./server/health": {
254
219
  "types": "./dist/server-health/index.js",
255
- "import": "./dist/server-health/index.js",
256
- "require": "./dist/server-health/index.js"
220
+ "import": "./dist/server-health/index.js"
257
221
  },
258
222
  "./server/helmet": {
259
223
  "types": "./dist/server-helmet/index.js",
260
- "import": "./dist/server-helmet/index.js",
261
- "require": "./dist/server-helmet/index.js"
224
+ "import": "./dist/server-helmet/index.js"
262
225
  },
263
226
  "./server/links": {
264
227
  "types": "./dist/server-links/index.js",
265
228
  "browser": "./dist/server-links/index.browser.js",
266
- "import": "./dist/server-links/index.js",
267
- "require": "./dist/server-links/index.js"
229
+ "import": "./dist/server-links/index.js"
268
230
  },
269
231
  "./server/metrics": {
270
232
  "types": "./dist/server-metrics/index.js",
271
- "import": "./dist/server-metrics/index.js",
272
- "require": "./dist/server-metrics/index.js"
233
+ "import": "./dist/server-metrics/index.js"
273
234
  },
274
235
  "./server/multipart": {
275
236
  "types": "./dist/server-multipart/index.js",
276
- "import": "./dist/server-multipart/index.js",
277
- "require": "./dist/server-multipart/index.js"
237
+ "import": "./dist/server-multipart/index.js"
278
238
  },
279
239
  "./server/proxy": {
280
240
  "types": "./dist/server-proxy/index.js",
281
- "import": "./dist/server-proxy/index.js",
282
- "require": "./dist/server-proxy/index.js"
241
+ "import": "./dist/server-proxy/index.js"
283
242
  },
284
243
  "./server/rate-limit": {
285
244
  "types": "./dist/server-rate-limit/index.js",
286
- "import": "./dist/server-rate-limit/index.js",
287
- "require": "./dist/server-rate-limit/index.js"
245
+ "import": "./dist/server-rate-limit/index.js"
288
246
  },
289
247
  "./server/security": {
290
248
  "types": "./dist/server-security/index.js",
291
249
  "browser": "./dist/server-security/index.browser.js",
292
- "import": "./dist/server-security/index.js",
293
- "require": "./dist/server-security/index.js"
250
+ "import": "./dist/server-security/index.js"
294
251
  },
295
252
  "./server/static": {
296
253
  "types": "./dist/server-static/index.js",
297
- "import": "./dist/server-static/index.js",
298
- "require": "./dist/server-static/index.js"
254
+ "import": "./dist/server-static/index.js"
299
255
  },
300
256
  "./server/swagger": {
301
257
  "types": "./dist/server-swagger/index.js",
302
- "import": "./dist/server-swagger/index.js",
303
- "require": "./dist/server-swagger/index.js"
258
+ "import": "./dist/server-swagger/index.js"
304
259
  },
305
260
  "./sms": {
306
261
  "types": "./dist/sms/index.js",
307
- "import": "./dist/sms/index.js",
308
- "require": "./dist/sms/index.js"
262
+ "import": "./dist/sms/index.js"
309
263
  },
310
264
  "./thread": {
311
265
  "types": "./dist/thread/index.js",
312
- "import": "./dist/thread/index.js",
313
- "require": "./dist/thread/index.js"
266
+ "import": "./dist/thread/index.js"
314
267
  },
315
268
  "./topic": {
316
269
  "types": "./dist/topic/index.js",
317
- "import": "./dist/topic/index.js",
318
- "require": "./dist/topic/index.js"
270
+ "import": "./dist/topic/index.js"
319
271
  },
320
272
  "./topic/redis": {
321
273
  "types": "./dist/topic-redis/index.js",
322
- "import": "./dist/topic-redis/index.js",
323
- "require": "./dist/topic-redis/index.js"
274
+ "import": "./dist/topic-redis/index.js"
324
275
  },
325
276
  "./vite": {
326
277
  "types": "./dist/vite/index.js",
327
- "import": "./dist/vite/index.js",
328
- "require": "./dist/vite/index.js"
278
+ "import": "./dist/vite/index.js"
329
279
  },
330
280
  "./websocket": {
331
281
  "types": "./dist/websocket/index.js",
332
282
  "browser": "./dist/websocket/index.browser.js",
333
- "import": "./dist/websocket/index.js",
334
- "require": "./dist/websocket/index.js"
283
+ "import": "./dist/websocket/index.js"
335
284
  },
336
285
  "./tsconfig.base": "./tsconfig.base.json",
337
286
  "./package.json": "./package.json"
@@ -34,6 +34,7 @@ export class AlephaPackageBuilderCli {
34
34
  });
35
35
 
36
36
  pkgData.exports = {};
37
+
37
38
  for (const item of modules) {
38
39
  const path =
39
40
  item.name === "core" ? "." : `./${item.name.replace("-", "/")}`;
@@ -46,13 +47,16 @@ export class AlephaPackageBuilderCli {
46
47
  pkgData.exports[path].import = `./src/${item.name}/index.ts`;
47
48
  pkgData.exports[path].require = `./src/${item.name}/index.ts`;
48
49
  }
50
+
49
51
  if (packageName === "alepha") {
50
52
  pkgData.exports["./tsconfig.base"] = "./tsconfig.base.json";
51
53
  pkgData.exports["./package.json"] = "./package.json";
52
54
  }
55
+
53
56
  if (packageName === "@alepha/ui") {
54
57
  pkgData.exports["./styles"] = "./styles.css";
55
58
  }
59
+
56
60
  await this.fs.writeFile("package.json", JSON.stringify(pkgData, null, 2));
57
61
 
58
62
  const tmpDir = join(root, "node_modules/.alepha");
@@ -65,7 +69,8 @@ export class AlephaPackageBuilderCli {
65
69
 
66
70
  const external = [
67
71
  "alepha",
68
- ...modules.map((item) => `alepha/${item.name}`),
72
+ packageName,
73
+ ...modules.map((item) => `${packageName}/${item.name}`),
69
74
  ];
70
75
 
71
76
  await run.rm(this.dist);
@@ -78,7 +83,7 @@ export class AlephaPackageBuilderCli {
78
83
  entries.push({
79
84
  entry: join(src, "index.ts"),
80
85
  outDir: dest,
81
- format: ["esm", "cjs"],
86
+ format: ["esm"],
82
87
  sourcemap: true,
83
88
  fixedExtension: false,
84
89
  platform: "node", // TODO: node must be enabled only if index.node.ts exists
@@ -0,0 +1,9 @@
1
+ export const appRouterTs = () => `
2
+ import { $page } from "@alepha/react";
3
+
4
+ export class AppRouter {
5
+ home = $page({
6
+ component: () => "Hello World",
7
+ });
8
+ }
9
+ `.trim()
@@ -1,5 +1,5 @@
1
1
  export const indexHtml = (
2
- browserEntry: string = "/src/main.tsx",
2
+ browserEntry: string,
3
3
  ) => `
4
4
  <!DOCTYPE html>
5
5
  <html lang="en">
@@ -8,6 +8,7 @@ export const indexHtml = (
8
8
  <title>App</title>
9
9
  </head>
10
10
  <body>
11
+ <div id="root"></div>
11
12
  <script type="module" src="${browserEntry}"></script>
12
13
  </body>
13
14
  </html>
@@ -0,0 +1,10 @@
1
+ export const mainBrowserTs = () => `
2
+ import { Alepha, run } from "alepha";
3
+ import { AppRouter } from "./AppRouter.ts";
4
+
5
+ const alepha = Alepha.create();
6
+
7
+ alepha.with(AppRouter);
8
+
9
+ run(alepha);
10
+ `.trim()
@@ -57,15 +57,13 @@ export class CoreCommands {
57
57
  // }),
58
58
  // choose package manager
59
59
  yarn: t.optional(t.boolean({ description: "Use Yarn package manager" })),
60
+ pnpm: t.optional(t.boolean({ description: "Use pnpm package manager" })),
60
61
  // choose which dependencies to add
61
- api: t.optional(
62
- t.boolean({ description: "Include Alepha Server dependencies" }),
63
- ),
64
62
  react: t.optional(
65
63
  t.boolean({ description: "Include Alepha React dependencies" }),
66
64
  ),
67
- orm: t.optional(
68
- t.boolean({ description: "Include Alepha ORM dependencies" }),
65
+ admin: t.optional(
66
+ t.boolean({ description: "Include Alepha admin panel dependencies" }),
69
67
  ),
70
68
  }),
71
69
  handler: async ({ run, flags, root }) => {
@@ -75,6 +73,8 @@ export class CoreCommands {
75
73
  await this.utils.ensureConfig(root, {
76
74
  tsconfigJson: true,
77
75
  packageJson: flags,
76
+ biomeJson: true,
77
+ viteConfigTs: true,
78
78
  indexHtml: !!flags.react,
79
79
  });
80
80
  },
@@ -86,6 +86,7 @@ export class CoreCommands {
86
86
 
87
87
  if (flags.yarn || guessedPm === "yarn") {
88
88
  await this.utils.ensureYarn(root);
89
+ await run("yarn set version stable");
89
90
  await run("yarn install", {
90
91
  alias: "Installing dependencies with Yarn",
91
92
  });
@@ -1,9 +1,9 @@
1
1
  import { readFile } from "node:fs/promises";
2
- import { createRequire } from "node:module";
3
2
  import { join } from "node:path";
4
3
  import { $inject, AlephaError, t } from "alepha";
5
4
  import { $command } from "alepha/command";
6
5
  import { $logger } from "alepha/logger";
6
+ import type { DrizzleKitProvider, RepositoryProvider } from "alepha/orm";
7
7
  import { ProcessRunner } from "../services/ProcessRunner.ts";
8
8
  import { ProjectUtils } from "../services/ProjectUtils.ts";
9
9
 
@@ -25,7 +25,7 @@ export class DrizzleCommands {
25
25
  * Check if database migrations are up to date.
26
26
  */
27
27
  check = $command({
28
- name: "db:migrate:check",
28
+ name: "db:check-migrations",
29
29
  description: "Check if database migration files are up to date",
30
30
  args: t.optional(
31
31
  t.text({
@@ -34,81 +34,89 @@ export class DrizzleCommands {
34
34
  }),
35
35
  ),
36
36
  flags: drizzleCommandFlags,
37
- handler: async ({ args, flags, root }) => {
37
+ handler: async ({ args, root }) => {
38
38
  const rootDir = root;
39
39
  this.log.debug(`Using project root: ${rootDir}`);
40
+
40
41
  const { alepha } = await this.utils.loadAlephaFromServerEntryFile(
41
42
  rootDir,
42
43
  args,
43
44
  );
44
45
 
45
- const models: any[] = [];
46
- const repositories = alepha.descriptors("repository") as any[];
47
- const kit = createRequire(import.meta.url)("drizzle-kit/api");
48
- const migrationDir = join(rootDir, "migrations");
46
+ const repositoryProvider =
47
+ alepha.inject<RepositoryProvider>("RepositoryProvider");
48
+ const drizzleKitProvider =
49
+ alepha.inject<DrizzleKitProvider>("DrizzleKitProvider");
50
+ const accepted = new Set<string>([]);
49
51
 
50
- const journalFile = await readFile(
51
- `${migrationDir}/meta/_journal.json`,
52
- "utf-8",
53
- ).catch(() => null);
54
-
55
- if (!journalFile) {
56
- this.log.info(`No migration journal found.`);
57
- return;
58
- }
52
+ for (const descriptor of repositoryProvider.getRepositories()) {
53
+ const provider = descriptor.provider;
54
+ const providerName = provider.name;
55
+ if (accepted.has(providerName)) {
56
+ continue;
57
+ }
59
58
 
60
- const journal = JSON.parse(journalFile);
59
+ accepted.add(providerName);
61
60
 
62
- const lastMigration = journal.entries[journal.entries.length - 1];
61
+ const migrationDir = join(rootDir, "migrations", providerName);
63
62
 
64
- const lastSnapshot = JSON.parse(
65
- await readFile(
66
- `${migrationDir}/meta/${String(lastMigration.idx).padStart(4, "0")}_snapshot.json`,
63
+ const journalFile = await readFile(
64
+ `${migrationDir}/meta/_journal.json`,
67
65
  "utf-8",
68
- ),
69
- );
66
+ ).catch(() => null);
70
67
 
71
- for (const repository of repositories) {
72
- if (!models.includes(repository.table)) {
73
- models.push(repository.table);
68
+ if (!journalFile) {
69
+ this.log.info(`No migration journal found.`);
70
+ return;
74
71
  }
75
- }
76
72
 
77
- const now = kit.generateDrizzleJson(models, lastSnapshot.id);
73
+ const journal = JSON.parse(journalFile);
74
+ const lastMigration = journal.entries[journal.entries.length - 1];
75
+ const lastSnapshot = JSON.parse(
76
+ await readFile(
77
+ `${migrationDir}/meta/${String(lastMigration.idx).padStart(4, "0")}_snapshot.json`,
78
+ "utf-8",
79
+ ),
80
+ );
78
81
 
79
- const migrationStatements = await new Promise<Array<any>>((resolve) => {
80
- (async () => {
81
- const timer = setTimeout(() => {
82
- resolve([{ message: "Migration generation timed out." }]);
83
- }, 5000);
84
- const statements = await kit.generateMigration(lastSnapshot, now);
85
- clearTimeout(timer);
86
- resolve(statements);
87
- })();
88
- });
82
+ const models = drizzleKitProvider.getModels(provider);
83
+ const kit = drizzleKitProvider.importDrizzleKit();
84
+ const now = kit.generateDrizzleJson(models, lastSnapshot.id);
89
85
 
90
- if (migrationStatements.length === 0) {
91
- this.log.info("No changes detected.");
92
- return;
93
- }
86
+ const migrationStatements = await new Promise<Array<any>>((resolve) => {
87
+ (async () => {
88
+ const timer = setTimeout(() => {
89
+ resolve([{ message: "Migration generation timed out." }]);
90
+ }, 5000);
91
+ const statements = await kit.generateMigration(lastSnapshot, now);
92
+ clearTimeout(timer);
93
+ resolve(statements);
94
+ })();
95
+ });
94
96
 
95
- this.log.info("");
96
- this.log.info("Detected migration statements:");
97
- this.log.info("");
98
- for (const stmt of migrationStatements) {
99
- this.log.info(stmt);
100
- }
101
- this.log.info("");
97
+ if (migrationStatements.length === 0) {
98
+ this.log.info("No changes detected.");
99
+ return;
100
+ }
102
101
 
103
- this.log.info(
104
- `At least ${migrationStatements.length} change(s) detected.`,
105
- );
106
- this.log.info(
107
- "Please, run 'alepha db:generate' to update the migration files.",
108
- );
109
- this.log.info("");
102
+ this.log.info("");
103
+ this.log.info("Detected migration statements:");
104
+ this.log.info("");
105
+ for (const stmt of migrationStatements) {
106
+ this.log.info(stmt);
107
+ }
108
+ this.log.info("");
110
109
 
111
- throw new AlephaError("Database migrations are not up to date.");
110
+ this.log.info(
111
+ `At least ${migrationStatements.length} change(s) detected.`,
112
+ );
113
+ this.log.info(
114
+ "Please, run 'alepha db:generate' to update the migration files.",
115
+ );
116
+ this.log.info("");
117
+
118
+ throw new AlephaError("Database migrations are not up to date.");
119
+ }
112
120
  },
113
121
  });
114
122
 
@@ -36,7 +36,7 @@ export class VerifyCommands {
36
36
  }
37
37
 
38
38
  if (await this.utils.hasDir(root, "migrations")) {
39
- await run("alepha db:migrate:check");
39
+ await run("alepha db:check-migrations");
40
40
  }
41
41
 
42
42
  await run("alepha build");