alepha 0.20.1 → 0.20.2

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 (232) hide show
  1. package/dist/api/files/index.js +2 -1
  2. package/dist/api/files/index.js.map +1 -1
  3. package/dist/api/jobs/index.browser.js +64 -148
  4. package/dist/api/jobs/index.browser.js.map +1 -1
  5. package/dist/api/jobs/index.d.ts +371 -573
  6. package/dist/api/jobs/index.d.ts.map +1 -1
  7. package/dist/api/jobs/index.js +605 -1012
  8. package/dist/api/jobs/index.js.map +1 -1
  9. package/dist/api/notifications/index.d.ts +78 -17
  10. package/dist/api/notifications/index.d.ts.map +1 -1
  11. package/dist/api/notifications/index.js +90 -23
  12. package/dist/api/notifications/index.js.map +1 -1
  13. package/dist/api/payments/index.d.ts +2 -1
  14. package/dist/api/payments/index.d.ts.map +1 -1
  15. package/dist/api/payments/index.js +4 -2
  16. package/dist/api/payments/index.js.map +1 -1
  17. package/dist/api/users/index.d.ts +34 -31
  18. package/dist/api/users/index.d.ts.map +1 -1
  19. package/dist/api/users/index.js +13 -7
  20. package/dist/api/users/index.js.map +1 -1
  21. package/dist/api/verifications/index.js +2 -1
  22. package/dist/api/verifications/index.js.map +1 -1
  23. package/dist/cli/core/index.d.ts +8 -34
  24. package/dist/cli/core/index.d.ts.map +1 -1
  25. package/dist/cli/core/index.js +43 -232
  26. package/dist/cli/core/index.js.map +1 -1
  27. package/dist/cli/platform/index.d.ts +36 -11
  28. package/dist/cli/platform/index.d.ts.map +1 -1
  29. package/dist/cli/platform/index.js +93 -27
  30. package/dist/cli/platform/index.js.map +1 -1
  31. package/dist/command/index.d.ts +1 -1
  32. package/dist/core/index.browser.js +6 -0
  33. package/dist/core/index.browser.js.map +1 -1
  34. package/dist/core/index.d.ts +6 -0
  35. package/dist/core/index.d.ts.map +1 -1
  36. package/dist/core/index.js +6 -0
  37. package/dist/core/index.js.map +1 -1
  38. package/dist/core/index.native.js +6 -0
  39. package/dist/core/index.native.js.map +1 -1
  40. package/dist/core/index.workerd.js +6 -0
  41. package/dist/core/index.workerd.js.map +1 -1
  42. package/dist/react/form/index.d.ts +60 -1
  43. package/dist/react/form/index.d.ts.map +1 -1
  44. package/dist/react/form/index.js +86 -1
  45. package/dist/react/form/index.js.map +1 -1
  46. package/dist/react/head/index.browser.js +16 -1
  47. package/dist/react/head/index.browser.js.map +1 -1
  48. package/dist/react/head/index.d.ts +6 -0
  49. package/dist/react/head/index.d.ts.map +1 -1
  50. package/dist/react/head/index.js +16 -1
  51. package/dist/react/head/index.js.map +1 -1
  52. package/dist/react/router/index.browser.js +0 -10
  53. package/dist/react/router/index.browser.js.map +1 -1
  54. package/dist/react/router/index.d.ts +35 -12
  55. package/dist/react/router/index.d.ts.map +1 -1
  56. package/dist/react/router/index.js +0 -10
  57. package/dist/react/router/index.js.map +1 -1
  58. package/dist/react/ui/index.d.ts +124 -0
  59. package/dist/react/ui/index.d.ts.map +1 -0
  60. package/dist/react/ui/index.js +206 -0
  61. package/dist/react/ui/index.js.map +1 -0
  62. package/dist/router/index.d.ts +13 -13
  63. package/dist/router/index.d.ts.map +1 -1
  64. package/dist/router/index.js +45 -32
  65. package/dist/router/index.js.map +1 -1
  66. package/dist/system/index.d.ts.map +1 -1
  67. package/dist/system/index.js +1 -0
  68. package/dist/system/index.js.map +1 -1
  69. package/dist/topic/core/index.js +1 -1
  70. package/dist/topic/core/index.js.map +1 -1
  71. package/package.json +6 -23
  72. package/src/api/files/jobs/FileJobs.ts +2 -1
  73. package/src/api/jobs/__tests__/$job.spec.ts +316 -2867
  74. package/src/api/jobs/controllers/AdminJobController.ts +29 -138
  75. package/src/api/jobs/entities/jobExecutionEntity.ts +27 -19
  76. package/src/api/jobs/index.browser.ts +5 -7
  77. package/src/api/jobs/index.ts +23 -51
  78. package/src/api/jobs/primitives/$job.ts +66 -58
  79. package/src/api/jobs/providers/JobProvider.ts +561 -566
  80. package/src/api/jobs/providers/JobQueueProvider.ts +18 -19
  81. package/src/api/jobs/schemas/jobConfigAtom.ts +20 -23
  82. package/src/api/jobs/schemas/jobExecutionQuerySchema.ts +3 -27
  83. package/src/api/jobs/schemas/jobExecutionResourceSchema.ts +5 -7
  84. package/src/api/jobs/schemas/jobRegistrationSchema.ts +7 -4
  85. package/src/api/jobs/schemas/triggerJobSchema.ts +0 -1
  86. package/src/api/jobs/services/JobService.ts +90 -483
  87. package/src/api/notifications/controllers/AdminNotificationController.ts +19 -12
  88. package/src/api/notifications/index.ts +7 -4
  89. package/src/api/notifications/jobs/NotificationJobs.ts +83 -12
  90. package/src/api/payments/services/PaymentService.ts +4 -2
  91. package/src/api/users/__tests__/UserJobs.spec.ts +10 -49
  92. package/src/api/users/audits/UserAudits.ts +3 -1
  93. package/src/api/users/buckets/UserBuckets.ts +2 -1
  94. package/src/api/users/index.ts +1 -4
  95. package/src/api/users/jobs/UserJobs.ts +5 -4
  96. package/src/api/verifications/jobs/VerificationJobs.ts +2 -1
  97. package/src/cli/core/__tests__/init.spec.ts +1 -1
  98. package/src/cli/core/commands/init.ts +0 -12
  99. package/src/cli/core/services/PackageManagerUtils.ts +2 -9
  100. package/src/cli/core/services/ProjectScaffolder.ts +17 -65
  101. package/src/cli/core/templates/agentMd.ts +2 -8
  102. package/src/cli/core/templates/apiIndexTs.ts +4 -18
  103. package/src/cli/core/templates/mainCss.ts +1 -36
  104. package/src/cli/core/templates/vitestConfigTs.ts +17 -0
  105. package/src/cli/core/templates/webAppRouterTs.ts +2 -85
  106. package/src/cli/platform/__tests__/CloudflareAdapter.spec.ts +22 -71
  107. package/src/cli/platform/adapters/CloudflareAdapter.ts +12 -11
  108. package/src/cli/platform/atoms/platformOptions.ts +9 -0
  109. package/src/cli/platform/schemas/cloudflare.ts +3 -2
  110. package/src/cli/platform/services/CloudflareApi.ts +164 -25
  111. package/src/cli/platform/services/WranglerApi.ts +0 -17
  112. package/src/core/Alepha.ts +9 -0
  113. package/src/react/form/index.ts +2 -0
  114. package/src/react/form/services/parseField.ts +163 -0
  115. package/src/react/form/services/prettyName.ts +19 -0
  116. package/src/react/head/providers/BrowserHeadProvider.ts +31 -10
  117. package/src/react/router/primitives/$page.ts +35 -12
  118. package/src/react/ui/atoms/uiAtom.ts +28 -0
  119. package/src/react/ui/components/ColorScheme.tsx +36 -0
  120. package/src/react/ui/hooks/useColorMode.ts +49 -0
  121. package/src/react/ui/hooks/useSidebarState.ts +26 -0
  122. package/src/react/ui/hooks/useTheme.ts +22 -0
  123. package/src/react/ui/index.ts +35 -0
  124. package/src/react/ui/services/UiPersistence.ts +41 -0
  125. package/src/router/TemplatedPathParser.ts +50 -51
  126. package/src/router/__tests__/RouterProvider.spec.ts +62 -0
  127. package/src/router/__tests__/TemplatedPathParser.spec.ts +18 -0
  128. package/src/router/providers/RouterProvider.ts +10 -5
  129. package/src/system/providers/NodeShellProvider.ts +1 -0
  130. package/src/topic/core/providers/TopicProvider.ts +1 -1
  131. package/dist/api/invitations/index.d.ts +0 -790
  132. package/dist/api/invitations/index.d.ts.map +0 -1
  133. package/dist/api/invitations/index.js +0 -662
  134. package/dist/api/invitations/index.js.map +0 -1
  135. package/dist/api/issues/index.d.ts +0 -810
  136. package/dist/api/issues/index.d.ts.map +0 -1
  137. package/dist/api/issues/index.js +0 -444
  138. package/dist/api/issues/index.js.map +0 -1
  139. package/dist/api/subscriptions/index.d.ts +0 -1692
  140. package/dist/api/subscriptions/index.d.ts.map +0 -1
  141. package/dist/api/subscriptions/index.js +0 -1867
  142. package/dist/api/subscriptions/index.js.map +0 -1
  143. package/dist/api/workflows/index.browser.js +0 -246
  144. package/dist/api/workflows/index.browser.js.map +0 -1
  145. package/dist/api/workflows/index.d.ts +0 -1618
  146. package/dist/api/workflows/index.d.ts.map +0 -1
  147. package/dist/api/workflows/index.js +0 -1495
  148. package/dist/api/workflows/index.js.map +0 -1
  149. package/src/api/invitations/__tests__/InvitationService.spec.ts +0 -439
  150. package/src/api/invitations/controllers/AdminInvitationController.ts +0 -86
  151. package/src/api/invitations/controllers/InvitationController.ts +0 -84
  152. package/src/api/invitations/entities/invitations.ts +0 -33
  153. package/src/api/invitations/index.ts +0 -58
  154. package/src/api/invitations/jobs/InvitationJobs.ts +0 -37
  155. package/src/api/invitations/providers/InvitationProvider.ts +0 -45
  156. package/src/api/invitations/schemas/createInvitationSchema.ts +0 -12
  157. package/src/api/invitations/schemas/invitationConfigAtom.ts +0 -20
  158. package/src/api/invitations/schemas/invitationQuerySchema.ts +0 -15
  159. package/src/api/invitations/schemas/invitationResourceSchema.ts +0 -6
  160. package/src/api/invitations/schemas/invitationWithResourceInfoSchema.ts +0 -22
  161. package/src/api/invitations/schemas/myInvitationsQuerySchema.ts +0 -10
  162. package/src/api/invitations/services/InvitationService.ts +0 -556
  163. package/src/api/issues/__tests__/IssueService.spec.ts +0 -263
  164. package/src/api/issues/controllers/AdminIssueController.ts +0 -149
  165. package/src/api/issues/controllers/IssueController.ts +0 -44
  166. package/src/api/issues/entities/issues.ts +0 -49
  167. package/src/api/issues/index.ts +0 -50
  168. package/src/api/issues/schemas/createIssueSchema.ts +0 -13
  169. package/src/api/issues/schemas/issueConfigAtom.ts +0 -13
  170. package/src/api/issues/schemas/issueQuerySchema.ts +0 -18
  171. package/src/api/issues/schemas/issueResourceSchema.ts +0 -6
  172. package/src/api/issues/schemas/myIssueQuerySchema.ts +0 -10
  173. package/src/api/issues/schemas/updateIssueSchema.ts +0 -13
  174. package/src/api/issues/services/IssueService.ts +0 -264
  175. package/src/api/jobs/__tests__/$job-middleware.spec.ts +0 -126
  176. package/src/api/jobs/__tests__/JobService.spec.ts +0 -31
  177. package/src/api/jobs/entities/jobExecutionLogEntity.ts +0 -13
  178. package/src/api/jobs/schemas/jobActivitySchema.ts +0 -15
  179. package/src/api/jobs/schemas/jobCronInfoSchema.ts +0 -22
  180. package/src/api/jobs/schemas/jobExecutionDetailResourceSchema.ts +0 -20
  181. package/src/api/jobs/schemas/jobFailureSchema.ts +0 -9
  182. package/src/api/jobs/schemas/jobQueueDepthSchema.ts +0 -14
  183. package/src/api/jobs/schemas/jobStatsSchema.ts +0 -14
  184. package/src/api/jobs/services/JobService-tests.ts +0 -157
  185. package/src/api/subscriptions/__tests__/BillingService.spec.ts +0 -218
  186. package/src/api/subscriptions/__tests__/SubscriptionService.spec.ts +0 -278
  187. package/src/api/subscriptions/controllers/AdminSubscriptionController.ts +0 -212
  188. package/src/api/subscriptions/controllers/SubscriptionController.ts +0 -189
  189. package/src/api/subscriptions/entities/subscriptionEvents.ts +0 -54
  190. package/src/api/subscriptions/entities/subscriptions.ts +0 -68
  191. package/src/api/subscriptions/index.ts +0 -133
  192. package/src/api/subscriptions/jobs/SubscriptionJobs.ts +0 -382
  193. package/src/api/subscriptions/middleware/$requireLimit.ts +0 -50
  194. package/src/api/subscriptions/middleware/$requirePlan.ts +0 -49
  195. package/src/api/subscriptions/notifications/SubscriptionNotifications.ts +0 -110
  196. package/src/api/subscriptions/schemas/cancelSubscriptionSchema.ts +0 -8
  197. package/src/api/subscriptions/schemas/changePlanSchema.ts +0 -9
  198. package/src/api/subscriptions/schemas/createSubscriptionSchema.ts +0 -11
  199. package/src/api/subscriptions/schemas/entitlementsSchema.ts +0 -21
  200. package/src/api/subscriptions/schemas/mrrSchema.ts +0 -13
  201. package/src/api/subscriptions/schemas/planDefinitionSchema.ts +0 -71
  202. package/src/api/subscriptions/schemas/planResourceSchema.ts +0 -25
  203. package/src/api/subscriptions/schemas/subscriptionEventResourceSchema.ts +0 -8
  204. package/src/api/subscriptions/schemas/subscriptionQuerySchema.ts +0 -19
  205. package/src/api/subscriptions/schemas/subscriptionResourceSchema.ts +0 -6
  206. package/src/api/subscriptions/schemas/subscriptionSettingsSchema.ts +0 -32
  207. package/src/api/subscriptions/schemas/subscriptionStatsSchema.ts +0 -23
  208. package/src/api/subscriptions/services/BillingService.ts +0 -437
  209. package/src/api/subscriptions/services/SubscriptionConfig.ts +0 -56
  210. package/src/api/subscriptions/services/SubscriptionService.ts +0 -867
  211. package/src/api/subscriptions/services/UsageService.ts +0 -118
  212. package/src/api/workflows/__tests__/$workflow.spec.ts +0 -616
  213. package/src/api/workflows/controllers/AdminWorkflowController.ts +0 -191
  214. package/src/api/workflows/entities/workflowExecutions.ts +0 -74
  215. package/src/api/workflows/entities/workflowStepExecutions.ts +0 -74
  216. package/src/api/workflows/entities/workflowStepLogs.ts +0 -13
  217. package/src/api/workflows/index.browser.ts +0 -22
  218. package/src/api/workflows/index.ts +0 -115
  219. package/src/api/workflows/jobs/WorkflowJobs.ts +0 -77
  220. package/src/api/workflows/primitives/$workflow.ts +0 -202
  221. package/src/api/workflows/providers/WorkflowProvider.ts +0 -1284
  222. package/src/api/workflows/schemas/workflowActivitySchema.ts +0 -15
  223. package/src/api/workflows/schemas/workflowConfigAtom.ts +0 -51
  224. package/src/api/workflows/schemas/workflowExecutionDetailSchema.ts +0 -18
  225. package/src/api/workflows/schemas/workflowExecutionQuerySchema.ts +0 -26
  226. package/src/api/workflows/schemas/workflowExecutionResourceSchema.ts +0 -30
  227. package/src/api/workflows/schemas/workflowRegistrationSchema.ts +0 -26
  228. package/src/api/workflows/schemas/workflowStatsSchema.ts +0 -16
  229. package/src/api/workflows/schemas/workflowStepExecutionResourceSchema.ts +0 -15
  230. package/src/api/workflows/services/WorkflowService.ts +0 -382
  231. package/src/cli/core/templates/apiAppSecurityTs.ts +0 -43
  232. package/src/cli/core/templates/webAdminDashboardTsx.ts +0 -17
@@ -598,7 +598,7 @@ var AlephaCliUtils = class {
598
598
  };
599
599
  //#endregion
600
600
  //#region ../../package.json
601
- var version$1 = "0.20.1";
601
+ var version$1 = "0.20.2";
602
602
  //#endregion
603
603
  //#region ../../src/cli/core/alephaPackageJson.ts
604
604
  const alephaPackageJson = {
@@ -703,16 +703,6 @@ const alephaPackageJson = {
703
703
  "import": "./src/api/files/index.ts",
704
704
  "default": "./src/api/files/index.ts"
705
705
  },
706
- "./api/invitations": {
707
- "types": "./src/api/invitations/index.ts",
708
- "import": "./src/api/invitations/index.ts",
709
- "default": "./src/api/invitations/index.ts"
710
- },
711
- "./api/issues": {
712
- "types": "./src/api/issues/index.ts",
713
- "import": "./src/api/issues/index.ts",
714
- "default": "./src/api/issues/index.ts"
715
- },
716
706
  "./api/jobs": {
717
707
  "types": "./src/api/jobs/index.ts",
718
708
  "react-native": "./src/api/jobs/index.browser.ts",
@@ -751,11 +741,6 @@ const alephaPackageJson = {
751
741
  "import": "./src/api/payments/index.ts",
752
742
  "default": "./src/api/payments/index.ts"
753
743
  },
754
- "./api/subscriptions": {
755
- "types": "./src/api/subscriptions/index.ts",
756
- "import": "./src/api/subscriptions/index.ts",
757
- "default": "./src/api/subscriptions/index.ts"
758
- },
759
744
  "./api/users": {
760
745
  "types": "./src/api/users/index.ts",
761
746
  "react-native": "./src/api/users/index.browser.ts",
@@ -770,13 +755,6 @@ const alephaPackageJson = {
770
755
  "import": "./src/api/verifications/index.ts",
771
756
  "default": "./src/api/verifications/index.ts"
772
757
  },
773
- "./api/workflows": {
774
- "types": "./src/api/workflows/index.ts",
775
- "react-native": "./src/api/workflows/index.browser.ts",
776
- "browser": "./src/api/workflows/index.browser.ts",
777
- "import": "./src/api/workflows/index.ts",
778
- "default": "./src/api/workflows/index.ts"
779
- },
780
758
  "./batch": {
781
759
  "types": "./src/batch/index.ts",
782
760
  "import": "./src/batch/index.ts",
@@ -971,6 +949,11 @@ const alephaPackageJson = {
971
949
  "import": "./src/react/testing/index.ts",
972
950
  "default": "./src/react/testing/index.ts"
973
951
  },
952
+ "./react/ui": {
953
+ "types": "./src/react/ui/index.ts",
954
+ "import": "./src/react/ui/index.ts",
955
+ "default": "./src/react/ui/index.ts"
956
+ },
974
957
  "./react/websocket": {
975
958
  "types": "./src/react/websocket/index.ts",
976
959
  "import": "./src/react/websocket/index.ts",
@@ -1359,7 +1342,7 @@ var PackageManagerUtils = class {
1359
1342
  const alephaDeps = alephaPackageJson.devDependencies;
1360
1343
  const dependencies = { alepha: `^${version}` };
1361
1344
  const devDependencies = { vite: alephaDeps.vite };
1362
- if (!(modes.react && !modes.ui)) devDependencies["drizzle-kit"] = alephaDeps["drizzle-kit"];
1345
+ if (!modes.react) devDependencies["drizzle-kit"] = alephaDeps["drizzle-kit"];
1363
1346
  if (!modes.isPackage) {
1364
1347
  devDependencies["@biomejs/biome"] = alephaDeps["@biomejs/biome"];
1365
1348
  if (modes.test) devDependencies.vitest = alephaDeps.vitest;
@@ -1372,10 +1355,6 @@ var PackageManagerUtils = class {
1372
1355
  verify: "alepha verify"
1373
1356
  };
1374
1357
  if (modes.test) scripts.test = "vitest run";
1375
- if (modes.ui) {
1376
- dependencies["@alepha/ui"] = `^${version}`;
1377
- modes.react = true;
1378
- }
1379
1358
  if (modes.tailwind) {
1380
1359
  devDependencies.tailwindcss = "^4.2.0";
1381
1360
  devDependencies["@tailwindcss/vite"] = "^4.2.0";
@@ -1402,11 +1381,7 @@ var PackageManagerUtils = class {
1402
1381
  //#endregion
1403
1382
  //#region ../../src/cli/core/templates/agentMd.ts
1404
1383
  const agentMd = (options) => {
1405
- const header = options.type === "claude" ? `# CLAUDE.md` : `# AGENTS.md`;
1406
- const docs = [`- Framework source: \`node_modules/alepha/src/\``];
1407
- if (options.ui) docs.push(`- UI components: \`node_modules/@alepha/ui/src/\``);
1408
- docs.push(`- Docs: https://alepha.dev/llms.txt`);
1409
- return `${header}
1384
+ return `${options.type === "claude" ? `# CLAUDE.md` : `# AGENTS.md`}
1410
1385
 
1411
1386
  This is an **Alepha** project.
1412
1387
 
@@ -1428,7 +1403,8 @@ alepha build # Build
1428
1403
 
1429
1404
  ## Documentation
1430
1405
 
1431
- ${docs.join("\n")}
1406
+ - Framework source: \`node_modules/alepha/src/\`
1407
+ - Docs: https://alepha.dev/llms.txt
1432
1408
  `.trim();
1433
1409
  };
1434
1410
  //#endregion
@@ -1460,49 +1436,6 @@ export default defineConfig({
1460
1436
  `;
1461
1437
  };
1462
1438
  //#endregion
1463
- //#region ../../src/cli/core/templates/apiAppSecurityTs.ts
1464
- const apiAppSecurityTs = (opts = {}) => {
1465
- return `
1466
- import { $realm } from "alepha/api/users";
1467
-
1468
- export class AppSecurity {
1469
- users = $realm({
1470
- settings: {
1471
- // Auto-promote these users to admin on login
1472
- adminEmails: ${opts.adminEmail ? `["${opts.adminEmail}"]` : "[]"},
1473
- adminUsernames: [],
1474
-
1475
- // Registration & login options
1476
- registrationAllowed: true,
1477
- email: "required",
1478
- username: "none",
1479
- phoneNumber: "none",
1480
-
1481
- // Verification (requires notifications feature)
1482
- verifyEmailRequired: false,
1483
- verifyPhoneRequired: false,
1484
- resetPasswordAllowed: false,
1485
- },
1486
- features: {
1487
- // Enable additional features
1488
- notifications: false,
1489
- audits: false,
1490
- apiKeys: false,
1491
- sessionPurge: false,
1492
- avatars: false,
1493
- parameters: false,
1494
- },
1495
- identities: {
1496
- // Enable authentication providers
1497
- credentials: true,
1498
- // google: true,
1499
- // github: true,
1500
- },
1501
- });
1502
- }
1503
- `.trim();
1504
- };
1505
- //#endregion
1506
1439
  //#region ../../src/cli/core/templates/apiHelloControllerTs.ts
1507
1440
  const apiHelloControllerTs = (options = {}) => {
1508
1441
  return `import { $action } from "alepha/server";
@@ -1539,21 +1472,14 @@ export type HelloResponse = Static<typeof helloResponseSchema>;
1539
1472
  //#endregion
1540
1473
  //#region ../../src/cli/core/templates/apiIndexTs.ts
1541
1474
  const apiIndexTs = (options = {}) => {
1542
- const { appName = "app", auth = false } = options;
1543
- const imports = ["import { $module } from \"alepha\";"];
1544
- const services = [];
1545
- if (auth) {
1546
- imports.push("import { AppSecurity } from \"./AppSecurity.ts\";");
1547
- services.push("AppSecurity");
1548
- }
1549
- imports.push("import { HelloController } from \"./controllers/HelloController.ts\";");
1550
- services.push("HelloController");
1475
+ const { appName = "app" } = options;
1551
1476
  return `
1552
- ${imports.join("\n")}
1477
+ import { $module } from "alepha";
1478
+ import { HelloController } from "./controllers/HelloController.ts";
1553
1479
 
1554
1480
  export const ApiModule = $module({
1555
1481
  name: "${appName}.api",
1556
- services: [${services.join(", ")}],
1482
+ services: [HelloController],
1557
1483
  });
1558
1484
  `.trim();
1559
1485
  };
@@ -1725,37 +1651,6 @@ run(alepha);
1725
1651
  //#endregion
1726
1652
  //#region ../../src/cli/core/templates/mainCss.ts
1727
1653
  const mainCss = (opts = {}) => {
1728
- if (opts.ui) return `/**
1729
- * Alepha UI - Based on Mantine component library
1730
- * Mantine Docs: https://mantine.dev
1731
- * Mantine LLM context: https://mantine.dev/llms.txt
1732
- *
1733
- * Switch theme index: alepha.set(alephaThemeAtom, { index: 1 })
1734
- *
1735
- * Custom themes (in src/web/index.ts):
1736
- *
1737
- * import { alephaThemeListAtom } from "@alepha/ui";
1738
- *
1739
- * export const WebModule = $module({
1740
- * name: "app.web",
1741
- * services: [AppRouter],
1742
- * register(alepha) {
1743
- * alepha.register(AppRouter);
1744
- * alepha.set(alephaThemeListAtom, [{
1745
- * name: "My Theme",
1746
- * description: "Custom theme",
1747
- * primaryColor: "blue",
1748
- * defaultColorScheme: "dark",
1749
- * // ...MantineThemeOverride options
1750
- * }]);
1751
- * },
1752
- * });
1753
- *
1754
- * Alternatives (remove the import below):
1755
- * - Tailwind CSS: https://tailwindcss.com/docs/installation/using-vite
1756
- * - Raw CSS: Write your own styles
1757
- */
1758
- @import "@alepha/ui/styles";`;
1759
1654
  if (opts.tailwind) return `@import "tailwindcss";
1760
1655
 
1761
1656
  /* Add your styles here */
@@ -1764,7 +1659,6 @@ const mainCss = (opts = {}) => {
1764
1659
  * Global styles for your application.
1765
1660
  *
1766
1661
  * Options:
1767
- * - @alepha/ui: Use \`alepha init --ui\` to add Mantine-based components
1768
1662
  * - Tailwind CSS: Use \`alepha init --tailwind\` to add Tailwind CSS
1769
1663
  * - Raw CSS: Write your own styles below
1770
1664
  */
@@ -1819,89 +1713,38 @@ export default defineConfig({
1819
1713
  `;
1820
1714
  };
1821
1715
  //#endregion
1822
- //#region ../../src/cli/core/templates/webAdminDashboardTsx.ts
1823
- const webAdminDashboardTsx = () => {
1824
- return `import { Flex, Text } from "@alepha/ui";
1825
-
1826
- const AdminDashboard = () => {
1827
- return (
1828
- <Flex direction="column" align="center" justify="center" mih="60vh" gap="md">
1829
- <Text size="xl" fw={600}>
1830
- Admin Panel
1831
- </Text>
1832
- <Text c="dimmed">Welcome to the admin panel.</Text>
1833
- </Flex>
1834
- );
1835
- };
1716
+ //#region ../../src/cli/core/templates/vitestConfigTs.ts
1717
+ /**
1718
+ * Minimal Vitest config for a freshly scaffolded Alepha project.
1719
+ *
1720
+ * Defines `test.root` explicitly so Vitest doesn't walk up the directory
1721
+ * tree and inherit a parent monorepo config (which can pull in unrelated
1722
+ * setup files, database connections, etc.).
1723
+ */
1724
+ const vitestConfigTs = () => `import { defineConfig } from "vitest/config";
1836
1725
 
1837
- export default AdminDashboard;
1726
+ export default defineConfig({
1727
+ test: {
1728
+ root: ".",
1729
+ globals: true,
1730
+ },
1731
+ });
1838
1732
  `;
1839
- };
1840
1733
  //#endregion
1841
1734
  //#region ../../src/cli/core/templates/webAppRouterTs.ts
1842
1735
  const webAppRouterTs = (options) => {
1843
- const imports = [];
1736
+ const imports = ["import { $page } from \"alepha/react/router\";"];
1844
1737
  const classMembers = [];
1845
- if (options.ui) imports.push("import { $ui } from \"@alepha/ui\";");
1846
- if (options.auth) imports.push("import { $uiAuth } from \"@alepha/ui/auth\";");
1847
- if (options.admin) {
1848
- imports.push("import { $uiAdmin } from \"@alepha/ui/admin\";");
1849
- imports.push("import { AdminUserRouter } from \"@alepha/ui/admin-users\";");
1850
- imports.push("import { AdminSessionRouter } from \"@alepha/ui/admin-sessions\";");
1851
- imports.push("import { $inject } from \"alepha\";");
1852
- imports.push("import { IconLayoutDashboard, IconUsers } from \"@tabler/icons-react\";");
1853
- }
1854
- imports.push("import { $page } from \"alepha/react/router\";");
1855
1738
  if (options.api) {
1856
1739
  imports.push("import { $client } from \"alepha/server/links\";");
1857
1740
  imports.push("import type { HelloController } from \"../api/controllers/HelloController.ts\";");
1858
1741
  classMembers.push(" api = $client<HelloController>();");
1859
- }
1860
- if (options.ui) {
1861
- classMembers.push(" ui = $ui();");
1862
- if (options.auth) classMembers.push(" uiAuth = $uiAuth();");
1863
- if (options.admin) classMembers.push(` // ── Admin Dashboard ─────────────────────────────
1864
- // Defined first so it can be referenced by the admin panel below.
1865
- // \`$uiAdmin\` auto-parents listed pages under the admin layout.
1866
- adminDashboard = $page({
1867
- path: "/",
1868
- label: "Dashboard",
1869
- icon: IconLayoutDashboard,
1870
- lazy: () => import("./components/AdminDashboard.tsx"),
1871
- });
1872
-
1873
- // ── Admin Domain Routers ──────────────────────────
1874
- protected users = $inject(AdminUserRouter);
1875
- protected sessions = $inject(AdminSessionRouter);
1876
-
1877
- // ── Admin Panel ─────────────────────────────────
1878
- admin = $uiAdmin({
1879
- pages: [
1880
- this.adminDashboard,
1881
- this.users.adminUsers,
1882
- this.users.adminUserLayout,
1883
- this.sessions.adminSessions,
1884
- ],
1885
- sidebarItems: [
1886
- this.adminDashboard,
1887
- {
1888
- label: "Identity",
1889
- icon: IconUsers,
1890
- children: [this.users.adminUsers, this.sessions.adminSessions],
1891
- },
1892
- ],
1893
- });`);
1894
- classMembers.push(` layout = $page({
1895
- parent: this.ui.root,
1896
- children: () => [this.home],
1897
- });`);
1898
- }
1899
- if (options.api) classMembers.push(` home = $page({
1742
+ classMembers.push(` home = $page({
1900
1743
  path: "/",
1901
1744
  lazy: () => import("./components/Home.tsx"),
1902
1745
  loader: () => this.api.hello(),
1903
1746
  });`);
1904
- else classMembers.push(` home = $page({
1747
+ } else classMembers.push(` home = $page({
1905
1748
  path: "/",
1906
1749
  lazy: () => import("./components/Home.tsx"),
1907
1750
  });`);
@@ -2061,13 +1904,9 @@ var ProjectScaffolder = class {
2061
1904
  const appName = this.getAppName(root);
2062
1905
  await this.fs.mkdir(this.fs.join(root, "src/api/controllers"), { recursive: true });
2063
1906
  await this.fs.mkdir(this.fs.join(root, "src/api/schemas"), { recursive: true });
2064
- await this.ensureFile(root, "src/api/index.ts", apiIndexTs({
2065
- appName,
2066
- auth: opts.auth
2067
- }), opts.force);
1907
+ await this.ensureFile(root, "src/api/index.ts", apiIndexTs({ appName }), opts.force);
2068
1908
  await this.ensureFile(root, "src/api/controllers/HelloController.ts", apiHelloControllerTs({ appName }), opts.force);
2069
1909
  await this.ensureFile(root, "src/api/schemas/helloResponseSchema.ts", apiHelloResponseSchemaTs(), opts.force);
2070
- if (opts.auth) await this.ensureFile(root, "src/api/AppSecurity.ts", apiAppSecurityTs({ adminEmail: opts.adminEmail }), opts.force);
2071
1910
  }
2072
1911
  /**
2073
1912
  * Ensure web/React project structure exists.
@@ -2082,28 +1921,23 @@ var ProjectScaffolder = class {
2082
1921
  await this.fs.mkdir(this.fs.join(root, "src/web/components"), { recursive: true });
2083
1922
  await this.fs.mkdir(this.fs.join(root, "public"), { recursive: true });
2084
1923
  await this.ensureFile(root, "public/favicon.svg", logoSvg, opts.force);
2085
- await this.ensureFile(root, "src/main.css", mainCss({
2086
- ui: opts.ui,
2087
- tailwind: opts.tailwind
2088
- }), opts.force);
1924
+ await this.ensureFile(root, "src/main.css", mainCss({ tailwind: opts.tailwind }), opts.force);
2089
1925
  if (opts.tailwind) await this.ensureFile(root, "vite.config.ts", viteConfigTs(), opts.force);
2090
1926
  await this.ensureFile(root, "src/web/index.ts", webIndexTs({ appName }), opts.force);
2091
- await this.ensureFile(root, "src/web/AppRouter.ts", webAppRouterTs({
2092
- api: opts.api,
2093
- ui: opts.ui,
2094
- auth: opts.auth,
2095
- admin: opts.admin
2096
- }), opts.force);
1927
+ await this.ensureFile(root, "src/web/AppRouter.ts", webAppRouterTs({ api: opts.api }), opts.force);
2097
1928
  await this.ensureFile(root, "src/web/components/Home.tsx", webHomeComponentTsx({ api: opts.api }), opts.force);
2098
- if (opts.admin) await this.ensureFile(root, "src/web/components/AdminDashboard.tsx", webAdminDashboardTsx(), opts.force);
2099
1929
  await this.ensureFile(root, "src/main.browser.ts", mainBrowserTs(), opts.force);
2100
1930
  }
2101
1931
  /**
2102
- * Ensure test directory exists with a dummy test file.
1932
+ * Ensure test directory exists with a dummy test file + a self-contained
1933
+ * `vitest.config.ts`. Pinning `test.root` prevents Vitest from walking up
1934
+ * to a parent monorepo config (e.g. one that boots a Postgres container).
2103
1935
  */
2104
1936
  async ensureTestDir(root) {
2105
1937
  const testDir = this.fs.join(root, "test");
2106
1938
  const dummyPath = this.fs.join(testDir, "dummy.spec.ts");
1939
+ const vitestConfigPath = this.fs.join(root, "vitest.config.ts");
1940
+ if (!await this.fs.exists(vitestConfigPath)) await this.fs.writeFile(vitestConfigPath, vitestConfigTs());
2107
1941
  if (!await this.fs.exists(testDir)) {
2108
1942
  await this.fs.mkdir(testDir, { recursive: true });
2109
1943
  await this.fs.writeFile(dummyPath, dummySpecTs());
@@ -2119,20 +1953,14 @@ var ProjectScaffolder = class {
2119
1953
  root = this.fs.join(root, args);
2120
1954
  await this.fs.mkdir(root, { force: true });
2121
1955
  }
2122
- if (flags.saas) {
2123
- flags.api = true;
2124
- flags.ui = true;
2125
- }
2126
- if (flags.ui) flags.react = true;
2127
1956
  if (flags.tailwind) flags.react = true;
2128
- if ((flags.saas || flags.api || flags.ui || flags.react || flags.tailwind) && !flags.force) {
1957
+ if ((flags.api || flags.react || flags.tailwind) && !flags.force) {
2129
1958
  if ((await this.fs.ls(root)).filter((f) => f !== "package.json").length > 0) throw new AlephaError(`Target directory is not empty (${root}). Use --force to overwrite existing files.`);
2130
1959
  }
2131
1960
  const workspace = await this.pm.getWorkspaceContext(root);
2132
1961
  let agentType = false;
2133
1962
  if (!workspace.isPackage) agentType = await this.utils.isInstalledAsync("claude") ? "claude" : "agents";
2134
1963
  const isExpo = await this.pm.hasExpo(root);
2135
- const adminEmail = flags.saas ? await this.utils.getGitEmail() : void 0;
2136
1964
  const force = !!flags.force;
2137
1965
  await run({
2138
1966
  name: "ensuring configuration files",
@@ -2146,10 +1974,7 @@ var ProjectScaffolder = class {
2146
1974
  tsconfigJson: !workspace.config.tsconfigJson,
2147
1975
  biomeJson: true,
2148
1976
  editorconfig: !workspace.config.editorconfig,
2149
- agentMd: agentType ? {
2150
- type: agentType,
2151
- ui: !!flags.ui
2152
- } : false
1977
+ agentMd: agentType ? { type: agentType } : false
2153
1978
  });
2154
1979
  await this.ensureAlephaConfig(root, { force });
2155
1980
  await this.ensureMainServerTs(root, {
@@ -2157,16 +1982,9 @@ var ProjectScaffolder = class {
2157
1982
  react: !!flags.react && !isExpo,
2158
1983
  force
2159
1984
  });
2160
- if (flags.api) await this.ensureApiProject(root, {
2161
- auth: !!flags.saas,
2162
- adminEmail,
2163
- force
2164
- });
1985
+ if (flags.api) await this.ensureApiProject(root, { force });
2165
1986
  if (flags.react && !isExpo) await this.ensureWebProject(root, {
2166
1987
  api: !!flags.api,
2167
- ui: !!flags.ui,
2168
- auth: !!flags.saas,
2169
- admin: !!flags.saas,
2170
1988
  tailwind: !!flags.tailwind,
2171
1989
  force
2172
1990
  });
@@ -2205,11 +2023,6 @@ var ProjectScaffolder = class {
2205
2023
  this.log.info("");
2206
2024
  this.log.info(` ${c.set("GREY_DARK", "$")} cd ${c.set("CYAN", projectName)}`);
2207
2025
  this.log.info(` ${c.set("GREY_DARK", "$")} ${c.set("CYAN", `${pmRun} dev`)}`);
2208
- if (adminEmail) {
2209
- this.log.info("");
2210
- this.log.info(` Admin email: ${c.set("GREEN", adminEmail)}`);
2211
- this.log.info(` ${c.set("GREY_DARK", "(from git config, change in src/api/AppSecurity.ts)")}`);
2212
- }
2213
2026
  this.log.info("");
2214
2027
  }
2215
2028
  /**
@@ -4774,8 +4587,6 @@ var InitCommand = class {
4774
4587
  aliases: ["r"],
4775
4588
  description: "Include React dependencies and web module (src/web/)"
4776
4589
  })),
4777
- ui: t.optional(t.boolean({ description: "Include @alepha/ui (components, auth portal, admin portal)" })),
4778
- saas: t.optional(t.boolean({ description: "Include authentication, admin portal, API, UI, and React. Everything you need for a SaaS app." })),
4779
4590
  tailwind: t.optional(t.boolean({ description: "Include Tailwind CSS with Vite plugin. Implies --react" })),
4780
4591
  test: t.optional(t.boolean({ description: "Include Vitest and create test directory" })),
4781
4592
  force: t.optional(t.boolean({