alepha 0.19.2 → 0.19.4
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/assets/swagger-ui/swagger-ui-bundle.js +1 -1
- package/dist/api/audits/index.d.ts +8 -8
- package/dist/api/invitations/index.d.ts +790 -0
- package/dist/api/invitations/index.d.ts.map +1 -0
- package/dist/api/invitations/index.js +665 -0
- package/dist/api/invitations/index.js.map +1 -0
- package/dist/api/jobs/index.browser.js +8 -9
- package/dist/api/jobs/index.browser.js.map +1 -1
- package/dist/api/jobs/index.d.ts +90 -34
- package/dist/api/jobs/index.d.ts.map +1 -1
- package/dist/api/jobs/index.js +267 -44
- package/dist/api/jobs/index.js.map +1 -1
- package/dist/api/notifications/index.browser.js +0 -1
- package/dist/api/notifications/index.browser.js.map +1 -1
- package/dist/api/notifications/index.d.ts +3 -3
- package/dist/api/notifications/index.d.ts.map +1 -1
- package/dist/api/notifications/index.js +0 -1
- package/dist/api/notifications/index.js.map +1 -1
- package/dist/api/parameters/index.browser.js +112 -1
- package/dist/api/parameters/index.browser.js.map +1 -1
- package/dist/api/parameters/index.d.ts +90 -3
- package/dist/api/parameters/index.d.ts.map +1 -1
- package/dist/api/parameters/index.js +79 -12
- package/dist/api/parameters/index.js.map +1 -1
- package/dist/{billing → api/payments}/index.d.ts +67 -49
- package/dist/api/payments/index.d.ts.map +1 -0
- package/dist/{billing → api/payments}/index.js +108 -74
- package/dist/api/payments/index.js.map +1 -0
- package/dist/api/subscriptions/index.d.ts +1692 -0
- package/dist/api/subscriptions/index.d.ts.map +1 -0
- package/dist/api/subscriptions/index.js +1870 -0
- package/dist/api/subscriptions/index.js.map +1 -0
- package/dist/api/users/index.d.ts +27 -21
- package/dist/api/users/index.d.ts.map +1 -1
- package/dist/api/users/index.js +167 -34
- package/dist/api/users/index.js.map +1 -1
- package/dist/api/workflows/index.browser.js +246 -0
- package/dist/api/workflows/index.browser.js.map +1 -0
- package/dist/api/workflows/index.d.ts +1618 -0
- package/dist/api/workflows/index.d.ts.map +1 -0
- package/dist/api/workflows/index.js +1504 -0
- package/dist/api/workflows/index.js.map +1 -0
- package/dist/cli/config/index.d.ts +6 -28
- package/dist/cli/config/index.d.ts.map +1 -1
- package/dist/cli/config/index.js +5 -10
- package/dist/cli/config/index.js.map +1 -1
- package/dist/cli/core/index.d.ts +11669 -208
- package/dist/cli/core/index.d.ts.map +1 -1
- package/dist/cli/core/index.js +60 -69
- package/dist/cli/core/index.js.map +1 -1
- package/dist/cli/devtools/index.d.ts +5 -0
- package/dist/cli/devtools/index.d.ts.map +1 -1
- package/dist/cli/devtools/index.js +4 -0
- package/dist/cli/devtools/index.js.map +1 -1
- package/dist/cli/platform/index.d.ts +69 -64
- package/dist/cli/platform/index.d.ts.map +1 -1
- package/dist/cli/platform/index.js +6 -2
- package/dist/cli/platform/index.js.map +1 -1
- package/dist/cli/vendor/index.d.ts +38 -10
- package/dist/cli/vendor/index.d.ts.map +1 -1
- package/dist/cli/vendor/index.js +85 -26
- package/dist/cli/vendor/index.js.map +1 -1
- package/dist/core/index.browser.js +21 -2
- package/dist/core/index.browser.js.map +1 -1
- package/dist/core/index.d.ts +33 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +25 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.native.js +25 -2
- package/dist/core/index.native.js.map +1 -1
- package/dist/core/index.workerd.js +25 -2
- package/dist/core/index.workerd.js.map +1 -1
- package/dist/email/smtp/index.js +24 -8
- package/dist/email/smtp/index.js.map +1 -1
- package/dist/logger/index.d.ts.map +1 -1
- package/dist/logger/index.js +1 -1
- package/dist/logger/index.js.map +1 -1
- package/dist/orm/core/index.browser.js +0 -18
- package/dist/orm/core/index.browser.js.map +1 -1
- package/dist/orm/core/index.bun.js +25 -73
- package/dist/orm/core/index.bun.js.map +1 -1
- package/dist/orm/core/index.d.ts +10 -32
- package/dist/orm/core/index.d.ts.map +1 -1
- package/dist/orm/core/index.js +25 -73
- package/dist/orm/core/index.js.map +1 -1
- package/dist/orm/postgres/index.bun.js +3 -3
- package/dist/orm/postgres/index.bun.js.map +1 -1
- package/dist/orm/postgres/index.d.ts +2 -1
- package/dist/orm/postgres/index.d.ts.map +1 -1
- package/dist/orm/postgres/index.js +3 -3
- package/dist/orm/postgres/index.js.map +1 -1
- package/dist/react/router/index.browser.js +25 -3
- package/dist/react/router/index.browser.js.map +1 -1
- package/dist/react/router/index.d.ts +16 -1
- package/dist/react/router/index.d.ts.map +1 -1
- package/dist/react/router/index.js +25 -3
- package/dist/react/router/index.js.map +1 -1
- package/dist/security/index.d.ts +28 -0
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/index.js +28 -0
- package/dist/security/index.js.map +1 -1
- package/package.json +37 -20
- package/src/api/invitations/__tests__/InvitationService.spec.ts +439 -0
- package/src/api/invitations/controllers/AdminInvitationController.ts +86 -0
- package/src/api/invitations/controllers/InvitationController.ts +84 -0
- package/src/api/invitations/entities/invitations.ts +33 -0
- package/src/api/invitations/index.ts +65 -0
- package/src/api/invitations/jobs/InvitationJobs.ts +37 -0
- package/src/api/invitations/providers/InvitationProvider.ts +45 -0
- package/src/api/invitations/schemas/createInvitationSchema.ts +12 -0
- package/src/api/invitations/schemas/invitationConfigAtom.ts +20 -0
- package/src/api/invitations/schemas/invitationQuerySchema.ts +15 -0
- package/src/api/invitations/schemas/invitationResourceSchema.ts +6 -0
- package/src/api/invitations/schemas/invitationWithResourceInfoSchema.ts +22 -0
- package/src/api/invitations/schemas/myInvitationsQuerySchema.ts +10 -0
- package/src/api/invitations/services/InvitationService.ts +556 -0
- package/src/api/jobs/__tests__/$job.spec.ts +876 -0
- package/src/api/jobs/controllers/AdminJobController.ts +44 -0
- package/src/api/jobs/entities/jobExecutionEntity.ts +0 -2
- package/src/api/jobs/index.ts +0 -3
- package/src/api/jobs/primitives/$job.ts +22 -11
- package/src/api/jobs/providers/JobProvider.ts +239 -25
- package/src/api/jobs/schemas/jobConfigAtom.ts +4 -0
- package/src/api/jobs/schemas/jobCronInfoSchema.ts +1 -0
- package/src/api/jobs/schemas/jobExecutionQuerySchema.ts +0 -1
- package/src/api/jobs/schemas/jobQueueDepthSchema.ts +1 -0
- package/src/api/jobs/schemas/jobRegistrationSchema.ts +1 -6
- package/src/api/jobs/services/JobService.ts +51 -12
- package/src/api/notifications/schemas/notificationQuerySchema.ts +0 -1
- package/src/api/parameters/__tests__/$parameter.spec.ts +327 -0
- package/src/api/parameters/controllers/AdminParameterController.ts +29 -3
- package/src/api/parameters/index.browser.ts +12 -0
- package/src/api/parameters/primitives/$parameter.ts +20 -3
- package/src/api/parameters/services/ParameterProvider.ts +48 -7
- package/src/{billing → api/payments}/__tests__/PaymentMethodService.spec.ts +32 -6
- package/src/api/payments/__tests__/PaymentService.spec.ts +279 -0
- package/src/{billing/controllers/AdminBillingController.ts → api/payments/controllers/AdminPaymentController.ts} +26 -21
- package/src/{billing/controllers/BillingController.ts → api/payments/controllers/PaymentController.ts} +23 -11
- package/src/{billing → api/payments}/entities/paymentIntents.ts +1 -0
- package/src/{billing/errors/BillingError.ts → api/payments/errors/PaymentError.ts} +1 -1
- package/src/{billing → api/payments}/index.ts +31 -25
- package/src/{billing/providers/MemoryBillingProvider.ts → api/payments/providers/MemoryPaymentProvider.ts} +4 -4
- package/src/{billing/providers/BillingProvider.ts → api/payments/providers/PaymentProvider.ts} +9 -2
- package/src/{billing → api/payments}/services/PaymentMethodService.ts +5 -5
- package/src/{billing/services/BillingService.ts → api/payments/services/PaymentService.ts} +94 -18
- package/src/api/subscriptions/__tests__/BillingService.spec.ts +218 -0
- package/src/api/subscriptions/__tests__/SubscriptionService.spec.ts +278 -0
- package/src/api/subscriptions/controllers/AdminSubscriptionController.ts +212 -0
- package/src/api/subscriptions/controllers/SubscriptionController.ts +189 -0
- package/src/api/subscriptions/entities/subscriptionEvents.ts +54 -0
- package/src/api/subscriptions/entities/subscriptions.ts +68 -0
- package/src/api/subscriptions/index.ts +144 -0
- package/src/api/subscriptions/jobs/SubscriptionJobs.ts +382 -0
- package/src/api/subscriptions/middleware/$requireLimit.ts +50 -0
- package/src/api/subscriptions/middleware/$requirePlan.ts +49 -0
- package/src/api/subscriptions/notifications/SubscriptionNotifications.ts +110 -0
- package/src/api/subscriptions/schemas/cancelSubscriptionSchema.ts +8 -0
- package/src/api/subscriptions/schemas/changePlanSchema.ts +9 -0
- package/src/api/subscriptions/schemas/createSubscriptionSchema.ts +11 -0
- package/src/api/subscriptions/schemas/entitlementsSchema.ts +21 -0
- package/src/api/subscriptions/schemas/mrrSchema.ts +13 -0
- package/src/api/subscriptions/schemas/planDefinitionSchema.ts +71 -0
- package/src/api/subscriptions/schemas/planResourceSchema.ts +25 -0
- package/src/api/subscriptions/schemas/subscriptionEventResourceSchema.ts +8 -0
- package/src/api/subscriptions/schemas/subscriptionQuerySchema.ts +19 -0
- package/src/api/subscriptions/schemas/subscriptionResourceSchema.ts +6 -0
- package/src/api/subscriptions/schemas/subscriptionSettingsSchema.ts +32 -0
- package/src/api/subscriptions/schemas/subscriptionStatsSchema.ts +23 -0
- package/src/api/subscriptions/services/BillingService.ts +437 -0
- package/src/api/subscriptions/services/SubscriptionConfig.ts +56 -0
- package/src/api/subscriptions/services/SubscriptionService.ts +867 -0
- package/src/api/subscriptions/services/UsageService.ts +118 -0
- package/src/api/users/__tests__/AdminUserController.spec.ts +80 -1
- package/src/api/users/__tests__/CredentialService.spec.ts +177 -0
- package/src/api/users/__tests__/EmailVerification.spec.ts +29 -18
- package/src/api/users/__tests__/PasswordReset.spec.ts +3 -0
- package/src/api/users/__tests__/RegistrationService.spec.ts +148 -1
- package/src/api/users/__tests__/SessionService.spec.ts +142 -1
- package/src/api/users/atoms/realmAuthSettingsAtom.ts +10 -1
- package/src/api/users/controllers/UserController.ts +3 -8
- package/src/api/users/notifications/UserNotifications.ts +23 -0
- package/src/api/users/schemas/loginSchema.ts +1 -1
- package/src/api/users/services/CredentialService.ts +51 -4
- package/src/api/users/services/RegistrationService.ts +38 -9
- package/src/api/users/services/SessionService.ts +62 -9
- package/src/api/users/services/UserService.ts +21 -12
- package/src/api/workflows/__tests__/$workflow.spec.ts +616 -0
- package/src/api/workflows/controllers/AdminWorkflowController.ts +191 -0
- package/src/api/workflows/entities/workflowExecutions.ts +74 -0
- package/src/api/workflows/entities/workflowStepExecutions.ts +74 -0
- package/src/api/workflows/entities/workflowStepLogs.ts +13 -0
- package/src/api/workflows/index.browser.ts +22 -0
- package/src/api/workflows/index.ts +124 -0
- package/src/api/workflows/jobs/WorkflowJobs.ts +77 -0
- package/src/api/workflows/primitives/$workflow.ts +202 -0
- package/src/api/workflows/providers/WorkflowProvider.ts +1284 -0
- package/src/api/workflows/schemas/workflowActivitySchema.ts +15 -0
- package/src/api/workflows/schemas/workflowConfigAtom.ts +51 -0
- package/src/api/workflows/schemas/workflowExecutionDetailSchema.ts +18 -0
- package/src/api/workflows/schemas/workflowExecutionQuerySchema.ts +26 -0
- package/src/api/workflows/schemas/workflowExecutionResourceSchema.ts +30 -0
- package/src/api/workflows/schemas/workflowRegistrationSchema.ts +26 -0
- package/src/api/workflows/schemas/workflowStatsSchema.ts +16 -0
- package/src/api/workflows/schemas/workflowStepExecutionResourceSchema.ts +15 -0
- package/src/api/workflows/services/WorkflowService.ts +382 -0
- package/src/cli/config/defineConfig.ts +17 -46
- package/src/cli/core/providers/ViteDevServerProvider.ts +45 -3
- package/src/cli/core/services/PackageManagerUtils.ts +3 -1
- package/src/cli/core/services/ProjectScaffolder.ts +5 -5
- package/src/cli/core/templates/agentMd.ts +14 -5
- package/src/cli/core/templates/webAppRouterTs.ts +5 -58
- package/src/cli/devtools/index.ts +21 -1
- package/src/cli/platform/index.ts +23 -2
- package/src/cli/vendor/__tests__/VendorService.spec.ts +283 -178
- package/src/cli/vendor/index.ts +20 -3
- package/src/cli/vendor/services/VendorService.ts +126 -27
- package/src/core/Alepha.ts +10 -0
- package/src/core/__tests__/TypeProvider.spec.ts +4 -2
- package/src/core/providers/SchemaValidator.ts +1 -1
- package/src/core/providers/TypeProvider.ts +46 -3
- package/src/logger/index.ts +6 -1
- package/src/orm/__tests__/enums.spec.ts +22 -29
- package/src/orm/__tests__/orm-showcase-tests.ts +430 -0
- package/src/orm/__tests__/orm-showcase.spec.ts +167 -0
- package/src/orm/core/providers/DatabaseTypeProvider.ts +0 -29
- package/src/orm/core/providers/DrizzleKitProvider.ts +56 -105
- package/src/orm/postgres/services/PostgresModelBuilder.ts +3 -6
- package/src/react/router/__tests__/$page.browser.spec.tsx +157 -0
- package/src/react/router/providers/ReactBrowserProvider.ts +39 -0
- package/src/react/router/providers/ReactBrowserRouterProvider.ts +22 -0
- package/src/security/__tests__/$secure-combinations.spec.ts +945 -0
- package/src/security/primitives/$secure.ts +28 -0
- package/tsconfig.base.json +0 -1
- package/dist/billing/index.d.ts.map +0 -1
- package/dist/billing/index.js.map +0 -1
- package/src/billing/__tests__/BillingService.spec.ts +0 -136
- /package/src/{billing → api/payments}/entities/paymentMethods.ts +0 -0
- /package/src/{billing → api/payments}/entities/refunds.ts +0 -0
- /package/src/{billing → api/payments}/schemas/intentSchemas.ts +0 -0
- /package/src/{billing → api/payments}/schemas/paymentMethodSchemas.ts +0 -0
- /package/src/{billing → api/payments}/schemas/refundSchemas.ts +0 -0
|
@@ -248,6 +248,26 @@ export class ViteDevServerProvider {
|
|
|
248
248
|
}
|
|
249
249
|
});
|
|
250
250
|
|
|
251
|
+
// Readiness endpoint: responds only when Alepha is fully loaded
|
|
252
|
+
server.middlewares.use(async (req, res, next) => {
|
|
253
|
+
if (req.url !== "/__alepha/ready") {
|
|
254
|
+
next();
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
if (this.currentReloadPromise) {
|
|
259
|
+
await this.currentReloadPromise;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
if (this.alepha?.isReady()) {
|
|
263
|
+
res.writeHead(200, { "content-type": "text/plain" });
|
|
264
|
+
res.end("ok");
|
|
265
|
+
} else {
|
|
266
|
+
res.writeHead(503, { "content-type": "text/plain" });
|
|
267
|
+
res.end("not ready");
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
|
|
251
271
|
// Return function to run AFTER Vite's built-in middleware
|
|
252
272
|
return () => {
|
|
253
273
|
server.middlewares.use(async (req, res, next) => {
|
|
@@ -258,6 +278,11 @@ export class ViteDevServerProvider {
|
|
|
258
278
|
return;
|
|
259
279
|
}
|
|
260
280
|
|
|
281
|
+
// Wait for in-progress reload to complete before serving
|
|
282
|
+
if (this.currentReloadPromise) {
|
|
283
|
+
await this.currentReloadPromise;
|
|
284
|
+
}
|
|
285
|
+
|
|
261
286
|
// In error state, serve a minimal HTML shell so the browser
|
|
262
287
|
// can connect to Vite's HMR and display the error overlay
|
|
263
288
|
if (this.hasError && !this.alepha) {
|
|
@@ -332,11 +357,10 @@ export class ViteDevServerProvider {
|
|
|
332
357
|
|
|
333
358
|
/**
|
|
334
359
|
* Send full browser reload via Vite's HMR.
|
|
360
|
+
* Uses a custom event so the client can poll for readiness before reloading.
|
|
335
361
|
*/
|
|
336
362
|
protected sendBrowserReload(): void {
|
|
337
|
-
this.server.hot.send({
|
|
338
|
-
type: "full-reload",
|
|
339
|
-
});
|
|
363
|
+
this.server.hot.send("alepha:reload", {});
|
|
340
364
|
}
|
|
341
365
|
|
|
342
366
|
/**
|
|
@@ -551,6 +575,24 @@ export class ViteDevServerProvider {
|
|
|
551
575
|
if (preamble) {
|
|
552
576
|
tags.push(preamble);
|
|
553
577
|
}
|
|
578
|
+
|
|
579
|
+
// Reload handler: polls /__alepha/ready before reloading to avoid
|
|
580
|
+
// hitting the server while it's still restarting.
|
|
581
|
+
tags.push(`<script type="module">
|
|
582
|
+
if (import.meta.hot) {
|
|
583
|
+
import.meta.hot.on("alepha:reload", async () => {
|
|
584
|
+
for (let i = 0; i < 50; i++) {
|
|
585
|
+
try {
|
|
586
|
+
const res = await fetch("/__alepha/ready");
|
|
587
|
+
if (res.ok) { window.location.reload(); return; }
|
|
588
|
+
} catch {}
|
|
589
|
+
await new Promise(r => setTimeout(r, 200));
|
|
590
|
+
}
|
|
591
|
+
window.location.reload();
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
</script>`);
|
|
595
|
+
|
|
554
596
|
if (style) {
|
|
555
597
|
tags.push(`<link rel="stylesheet" href="/${style}">`);
|
|
556
598
|
}
|
|
@@ -398,7 +398,9 @@ export class PackageManagerUtils {
|
|
|
398
398
|
alepha: `^${version}`,
|
|
399
399
|
};
|
|
400
400
|
|
|
401
|
-
const devDependencies: Record<string, string> = {
|
|
401
|
+
const devDependencies: Record<string, string> = {
|
|
402
|
+
vite: alephaDeps.vite,
|
|
403
|
+
};
|
|
402
404
|
|
|
403
405
|
// Only include drizzle-kit when the project uses a database.
|
|
404
406
|
// React-only projects (--react without --api/--saas) don't need it.
|
|
@@ -5,7 +5,7 @@ import type { RunnerMethod } from "alepha/command";
|
|
|
5
5
|
import { $logger, ConsoleColorProvider } from "alepha/logger";
|
|
6
6
|
import { FileSystemProvider } from "alepha/system";
|
|
7
7
|
import { cliAssets } from "../assets.ts";
|
|
8
|
-
import { type
|
|
8
|
+
import { type AgentMdOptions, agentMd } from "../templates/agentMd.ts";
|
|
9
9
|
import { alephaConfigTs } from "../templates/alephaConfigTs.ts";
|
|
10
10
|
import { apiAppSecurityTs } from "../templates/apiAppSecurityTs.ts";
|
|
11
11
|
import { apiHelloControllerTs } from "../templates/apiHelloControllerTs.ts";
|
|
@@ -75,7 +75,7 @@ export class ProjectScaffolder {
|
|
|
75
75
|
tsconfigJson?: boolean;
|
|
76
76
|
biomeJson?: boolean;
|
|
77
77
|
editorconfig?: boolean;
|
|
78
|
-
agentMd?: false |
|
|
78
|
+
agentMd?: false | AgentMdOptions;
|
|
79
79
|
},
|
|
80
80
|
): Promise<void> {
|
|
81
81
|
const tasks: Promise<void>[] = [];
|
|
@@ -187,10 +187,10 @@ export class ProjectScaffolder {
|
|
|
187
187
|
|
|
188
188
|
public async ensureAgentMd(
|
|
189
189
|
root: string,
|
|
190
|
-
options:
|
|
190
|
+
options: AgentMdOptions & { force?: boolean },
|
|
191
191
|
): Promise<void> {
|
|
192
192
|
const filename = options.type === "claude" ? "CLAUDE.md" : "AGENTS.md";
|
|
193
|
-
await this.ensureFile(root, filename, agentMd(options
|
|
193
|
+
await this.ensureFile(root, filename, agentMd(options), options.force);
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
/**
|
|
@@ -481,7 +481,7 @@ export class ProjectScaffolder {
|
|
|
481
481
|
tsconfigJson: !workspace.config.tsconfigJson,
|
|
482
482
|
biomeJson: true,
|
|
483
483
|
editorconfig: !workspace.config.editorconfig,
|
|
484
|
-
agentMd: agentType ? { type: agentType } : false,
|
|
484
|
+
agentMd: agentType ? { type: agentType, ui: !!flags.ui } : false,
|
|
485
485
|
});
|
|
486
486
|
|
|
487
487
|
// Create alepha.config.ts with documented options
|
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
export type AgentMdType = "claude" | "agents";
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
|
|
3
|
+
export interface AgentMdOptions {
|
|
4
|
+
type: AgentMdType;
|
|
5
|
+
ui?: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const agentMd = (options: AgentMdOptions): string => {
|
|
9
|
+
const header = options.type === "claude" ? `# CLAUDE.md` : `# AGENTS.md`;
|
|
10
|
+
|
|
11
|
+
const docs = [`- Framework source: \`node_modules/alepha/src/\``];
|
|
12
|
+
if (options.ui) {
|
|
13
|
+
docs.push(`- UI components: \`node_modules/@alepha/ui/src/\``);
|
|
14
|
+
}
|
|
15
|
+
docs.push(`- Docs: https://alepha.dev/llms.txt`);
|
|
5
16
|
|
|
6
17
|
return `${header}
|
|
7
18
|
|
|
@@ -25,8 +36,6 @@ alepha build # Build
|
|
|
25
36
|
|
|
26
37
|
## Documentation
|
|
27
38
|
|
|
28
|
-
|
|
29
|
-
- UI components: \`node_modules/@alepha/ui/src/\`
|
|
30
|
-
- Docs: https://alepha.dev/llms.txt
|
|
39
|
+
${docs.join("\n")}
|
|
31
40
|
`.trim();
|
|
32
41
|
};
|
|
@@ -24,23 +24,8 @@ export const webAppRouterTs = (options: {
|
|
|
24
24
|
imports.push(
|
|
25
25
|
'import { AdminSessionRouter } from "@alepha/ui/admin-sessions";',
|
|
26
26
|
);
|
|
27
|
-
imports.push('import { AdminAuditRouter } from "@alepha/ui/admin-audits";');
|
|
28
|
-
imports.push('import { AdminFileRouter } from "@alepha/ui/admin-files";');
|
|
29
|
-
imports.push(
|
|
30
|
-
'import { AdminParameterRouter } from "@alepha/ui/admin-parameters";',
|
|
31
|
-
);
|
|
32
|
-
imports.push('import { AdminJobRouter } from "@alepha/ui/admin-jobs";');
|
|
33
|
-
imports.push('import { AdminApiKeyRouter } from "@alepha/ui/admin-keys";');
|
|
34
|
-
imports.push(
|
|
35
|
-
'import { AdminNotificationRouter } from "@alepha/ui/admin-notifications";',
|
|
36
|
-
);
|
|
37
|
-
imports.push(
|
|
38
|
-
'import { AdminBillingRouter } from "@alepha/ui/admin-billing";',
|
|
39
|
-
);
|
|
40
27
|
imports.push('import { $inject } from "alepha";');
|
|
41
|
-
imports.push(
|
|
42
|
-
'import { IconLayoutDashboard, IconLockPassword, IconCreditCard } from "@tabler/icons-react";',
|
|
43
|
-
);
|
|
28
|
+
imports.push('import { IconLayoutDashboard } from "@tabler/icons-react";');
|
|
44
29
|
}
|
|
45
30
|
|
|
46
31
|
// Page import
|
|
@@ -67,61 +52,23 @@ export const webAppRouterTs = (options: {
|
|
|
67
52
|
classMembers.push(` // ── Admin Domain Routers ──────────────────────────
|
|
68
53
|
protected users = $inject(AdminUserRouter);
|
|
69
54
|
protected sessions = $inject(AdminSessionRouter);
|
|
70
|
-
protected audits = $inject(AdminAuditRouter);
|
|
71
|
-
protected files = $inject(AdminFileRouter);
|
|
72
|
-
protected parameters = $inject(AdminParameterRouter);
|
|
73
|
-
protected jobs = $inject(AdminJobRouter);
|
|
74
|
-
protected apiKeys = $inject(AdminApiKeyRouter);
|
|
75
|
-
protected notifications = $inject(AdminNotificationRouter);
|
|
76
|
-
protected billing = $inject(AdminBillingRouter);
|
|
77
55
|
|
|
78
56
|
// ── Admin Panel ─────────────────────────────────
|
|
79
57
|
admin = $uiAdmin({
|
|
80
58
|
pages: [
|
|
81
59
|
this.users.adminUsers,
|
|
60
|
+
this.users.adminUserLayout,
|
|
82
61
|
this.sessions.adminSessions,
|
|
83
|
-
this.audits.adminAudits,
|
|
84
|
-
this.files.adminFiles,
|
|
85
|
-
this.parameters.adminParameters,
|
|
86
|
-
this.jobs.adminJobs,
|
|
87
|
-
this.apiKeys.adminApiKeys,
|
|
88
|
-
this.notifications.adminNotifications,
|
|
89
|
-
this.billing.adminBilling,
|
|
90
62
|
],
|
|
91
63
|
sidebarItems: [
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
children: [
|
|
95
|
-
{ label: "Identity", icon: IconLockPassword, children: [
|
|
96
|
-
this.users.adminUsers,
|
|
97
|
-
this.sessions.adminSessions,
|
|
98
|
-
this.apiKeys.adminApiKeys,
|
|
99
|
-
]},
|
|
100
|
-
this.audits.adminAudits,
|
|
101
|
-
],
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
label: "System",
|
|
105
|
-
children: [
|
|
106
|
-
this.files.adminFiles,
|
|
107
|
-
this.jobs.adminJobs,
|
|
108
|
-
this.notifications.adminNotifications,
|
|
109
|
-
this.parameters.adminParameters,
|
|
110
|
-
],
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
label: "Commerce",
|
|
114
|
-
icon: IconCreditCard,
|
|
115
|
-
children: [
|
|
116
|
-
this.billing.adminBilling,
|
|
117
|
-
],
|
|
118
|
-
},
|
|
64
|
+
this.users.adminUsers,
|
|
65
|
+
this.sessions.adminSessions,
|
|
119
66
|
],
|
|
120
67
|
});
|
|
121
68
|
|
|
122
69
|
// ── Admin Dashboard ─────────────────────────────
|
|
123
70
|
adminDashboard = $page({
|
|
124
|
-
parent: this.admin
|
|
71
|
+
parent: this.admin,
|
|
125
72
|
path: "/",
|
|
126
73
|
label: "Dashboard",
|
|
127
74
|
icon: IconLayoutDashboard,
|
|
@@ -3,7 +3,19 @@ import { createRequire } from "node:module";
|
|
|
3
3
|
import { dirname, join } from "node:path";
|
|
4
4
|
import { $module, AlephaError } from "alepha";
|
|
5
5
|
import { ViteDevServerProvider } from "alepha/cli";
|
|
6
|
-
import {
|
|
6
|
+
import { cliConfigPlugins } from "alepha/cli/config";
|
|
7
|
+
import {
|
|
8
|
+
type DevtoolsOptions,
|
|
9
|
+
devtoolsOptions,
|
|
10
|
+
} from "./atoms/devtoolsOptions.ts";
|
|
11
|
+
|
|
12
|
+
// ---------------------------------------------------------------------------------------------------------------------
|
|
13
|
+
|
|
14
|
+
declare module "alepha/cli/config" {
|
|
15
|
+
interface AlephaCliConfig {
|
|
16
|
+
devtools?: DevtoolsOptions;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
7
19
|
|
|
8
20
|
// ---------------------------------------------------------------------------------------------------------------------
|
|
9
21
|
|
|
@@ -191,4 +203,12 @@ export const AlephaCliDevtoolsPlugin = $module({
|
|
|
191
203
|
|
|
192
204
|
// ---------------------------------------------------------------------------------------------------------------------
|
|
193
205
|
|
|
206
|
+
cliConfigPlugins.push((config, alepha) => {
|
|
207
|
+
if (config.devtools) {
|
|
208
|
+
alepha.set(devtoolsOptions, config.devtools);
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
// ---------------------------------------------------------------------------------------------------------------------
|
|
213
|
+
|
|
194
214
|
export * from "./atoms/devtoolsOptions.ts";
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { $module } from "alepha";
|
|
2
2
|
import { AlephaCli } from "alepha/cli";
|
|
3
|
+
import { cliConfigPlugins } from "alepha/cli/config";
|
|
3
4
|
import { CloudflareAdapter } from "./adapters/CloudflareAdapter.ts";
|
|
4
5
|
import { VercelAdapter } from "./adapters/VercelAdapter.ts";
|
|
6
|
+
import {
|
|
7
|
+
type PlatformOptions,
|
|
8
|
+
platformOptions,
|
|
9
|
+
} from "./atoms/platformOptions.ts";
|
|
5
10
|
import { PlatformCommand } from "./commands/platform.ts";
|
|
6
11
|
import { SecretsCommand } from "./commands/SecretsCommand.ts";
|
|
7
12
|
import { GitHubSecretStore } from "./providers/GitHubSecretStore.ts";
|
|
@@ -18,6 +23,14 @@ import { WranglerApi } from "./services/WranglerApi.ts";
|
|
|
18
23
|
|
|
19
24
|
// ---------------------------------------------------------------------------
|
|
20
25
|
|
|
26
|
+
declare module "alepha/cli/config" {
|
|
27
|
+
interface AlephaCliConfig {
|
|
28
|
+
platform?: PlatformOptions;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// ---------------------------------------------------------------------------
|
|
33
|
+
|
|
21
34
|
/**
|
|
22
35
|
* CLI plugin for multi-cloud deployment orchestration.
|
|
23
36
|
*
|
|
@@ -38,10 +51,10 @@ import { WranglerApi } from "./services/WranglerApi.ts";
|
|
|
38
51
|
* Configuration in `alepha.config.ts`:
|
|
39
52
|
*
|
|
40
53
|
* ```typescript
|
|
41
|
-
* import {
|
|
54
|
+
* import { AlephaCliPlatformPlugin } from "alepha/cli/platform";
|
|
42
55
|
*
|
|
43
56
|
* export default defineConfig({
|
|
44
|
-
* services: [
|
|
57
|
+
* services: [AlephaCliPlatformPlugin],
|
|
45
58
|
* platform: {
|
|
46
59
|
* environments: {
|
|
47
60
|
* production: { adapter: "cloudflare", domain: "myapp.com" },
|
|
@@ -74,6 +87,14 @@ export const AlephaCliPlatformPlugin = $module({
|
|
|
74
87
|
|
|
75
88
|
// ---------------------------------------------------------------------------
|
|
76
89
|
|
|
90
|
+
cliConfigPlugins.push((config, alepha) => {
|
|
91
|
+
if (config.platform) {
|
|
92
|
+
alepha.set(platformOptions, config.platform);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
// ---------------------------------------------------------------------------
|
|
97
|
+
|
|
77
98
|
export * from "./adapters/CloudflareAdapter.ts";
|
|
78
99
|
export * from "./adapters/PlatformAdapter.ts";
|
|
79
100
|
export * from "./adapters/VercelAdapter.ts";
|