alepha 0.21.2 → 0.23.0
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/README.md +0 -1
- package/dist/api/audits/index.browser.js.map +1 -1
- package/dist/api/audits/index.d.ts +393 -403
- package/dist/api/audits/index.d.ts.map +1 -1
- package/dist/api/audits/index.js +25 -56
- package/dist/api/audits/index.js.map +1 -1
- package/dist/api/files/index.browser.js +31 -1
- package/dist/api/files/index.browser.js.map +1 -1
- package/dist/api/files/index.d.ts +313 -208
- package/dist/api/files/index.d.ts.map +1 -1
- package/dist/api/files/index.js +152 -42
- package/dist/api/files/index.js.map +1 -1
- package/dist/api/jobs/index.browser.js +2 -2
- package/dist/api/jobs/index.browser.js.map +1 -1
- package/dist/api/jobs/index.d.ts +282 -285
- package/dist/api/jobs/index.d.ts.map +1 -1
- package/dist/api/jobs/index.js +39 -33
- package/dist/api/jobs/index.js.map +1 -1
- package/dist/api/keys/index.d.ts +217 -222
- package/dist/api/keys/index.d.ts.map +1 -1
- package/dist/api/keys/index.js.map +1 -1
- package/dist/api/notifications/index.browser.js.map +1 -1
- package/dist/api/notifications/index.d.ts +188 -195
- package/dist/api/notifications/index.d.ts.map +1 -1
- package/dist/api/notifications/index.js.map +1 -1
- package/dist/api/oauth/index.d.ts +71 -76
- package/dist/api/oauth/index.d.ts.map +1 -1
- package/dist/api/oauth/index.js.map +1 -1
- package/dist/api/organizations/index.browser.js.map +1 -1
- package/dist/api/organizations/index.d.ts +104 -109
- package/dist/api/organizations/index.d.ts.map +1 -1
- package/dist/api/organizations/index.js.map +1 -1
- package/dist/api/parameters/index.browser.js +43 -16
- package/dist/api/parameters/index.browser.js.map +1 -1
- package/dist/api/parameters/index.d.ts +488 -344
- package/dist/api/parameters/index.d.ts.map +1 -1
- package/dist/api/parameters/index.js +175 -35
- package/dist/api/parameters/index.js.map +1 -1
- package/dist/api/payments/index.d.ts +396 -402
- package/dist/api/payments/index.d.ts.map +1 -1
- package/dist/api/payments/index.js.map +1 -1
- package/dist/api/subscriptions/index.d.ts +644 -652
- package/dist/api/subscriptions/index.d.ts.map +1 -1
- package/dist/api/subscriptions/index.js +1 -1
- package/dist/api/subscriptions/index.js.map +1 -1
- package/dist/api/users/index.browser.js +7 -0
- package/dist/api/users/index.browser.js.map +1 -1
- package/dist/api/users/index.d.ts +1106 -1005
- package/dist/api/users/index.d.ts.map +1 -1
- package/dist/api/users/index.js +307 -64
- package/dist/api/users/index.js.map +1 -1
- package/dist/api/verifications/index.browser.js.map +1 -1
- package/dist/api/verifications/index.d.ts +137 -143
- package/dist/api/verifications/index.d.ts.map +1 -1
- package/dist/api/verifications/index.js.map +1 -1
- package/dist/background/index.d.ts +95 -0
- package/dist/background/index.d.ts.map +1 -0
- package/dist/background/index.js +121 -0
- package/dist/background/index.js.map +1 -0
- package/dist/background/index.workerd.js +110 -0
- package/dist/background/index.workerd.js.map +1 -0
- package/dist/batch/index.d.ts +5 -7
- package/dist/batch/index.d.ts.map +1 -1
- package/dist/batch/index.js.map +1 -1
- package/dist/bin/index.js.map +1 -1
- package/dist/bucket/index.d.ts +76 -54
- package/dist/bucket/index.d.ts.map +1 -1
- package/dist/bucket/index.js +58 -11
- package/dist/bucket/index.js.map +1 -1
- package/dist/bucket/index.workerd.js +200 -5
- package/dist/bucket/index.workerd.js.map +1 -1
- package/dist/cache/core/index.d.ts +7 -10
- package/dist/cache/core/index.d.ts.map +1 -1
- package/dist/cache/core/index.js.map +1 -1
- package/dist/cache/core/index.workerd.js.map +1 -1
- package/dist/cache/database/index.d.ts +22 -26
- package/dist/cache/database/index.d.ts.map +1 -1
- package/dist/cache/database/index.js.map +1 -1
- package/dist/cache/redis/index.d.ts +4 -7
- package/dist/cache/redis/index.d.ts.map +1 -1
- package/dist/cache/redis/index.js.map +1 -1
- package/dist/captcha/index.d.ts +3 -6
- package/dist/captcha/index.d.ts.map +1 -1
- package/dist/captcha/index.js.map +1 -1
- package/dist/cli/config/index.d.ts.map +1 -1
- package/dist/cli/config/index.js.map +1 -1
- package/dist/cli/core/index.d.ts +458 -249
- package/dist/cli/core/index.d.ts.map +1 -1
- package/dist/cli/core/index.js +372 -660
- package/dist/cli/core/index.js.map +1 -1
- package/dist/cli/devtools/index.d.ts +3 -5
- package/dist/cli/devtools/index.d.ts.map +1 -1
- package/dist/cli/devtools/index.js.map +1 -1
- package/dist/cli/i18n/index.d.ts +20 -17
- package/dist/cli/i18n/index.d.ts.map +1 -1
- package/dist/cli/i18n/index.js +45 -11
- package/dist/cli/i18n/index.js.map +1 -1
- package/dist/cli/platform/index.d.ts +126 -1342
- package/dist/cli/platform/index.d.ts.map +1 -1
- package/dist/cli/platform/index.js +136 -2374
- package/dist/cli/platform/index.js.map +1 -1
- package/dist/cli/platform-lib/index.d.ts +1472 -0
- package/dist/cli/platform-lib/index.d.ts.map +1 -0
- package/dist/cli/platform-lib/index.js +2660 -0
- package/dist/cli/platform-lib/index.js.map +1 -0
- package/dist/cli/vendor/index.d.ts +17 -21
- package/dist/cli/vendor/index.d.ts.map +1 -1
- package/dist/cli/vendor/index.js.map +1 -1
- package/dist/command/index.d.ts +20 -19
- package/dist/command/index.d.ts.map +1 -1
- package/dist/command/index.js +39 -10
- package/dist/command/index.js.map +1 -1
- package/dist/{containers → container}/core/index.d.ts +13 -15
- package/dist/container/core/index.d.ts.map +1 -0
- package/dist/{containers → container}/core/index.js +23 -14
- package/dist/container/core/index.js.map +1 -0
- package/dist/{containers → container}/core/index.workerd.js +37 -22
- package/dist/container/core/index.workerd.js.map +1 -0
- package/dist/core/index.browser.js +27 -1
- package/dist/core/index.browser.js.map +1 -1
- package/dist/core/index.d.ts +48 -24
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +27 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.native.js +27 -1
- package/dist/core/index.native.js.map +1 -1
- package/dist/core/index.workerd.js +27 -1
- package/dist/core/index.workerd.js.map +1 -1
- package/dist/crypto/index.browser.js.map +1 -1
- package/dist/crypto/index.d.ts +5 -8
- package/dist/crypto/index.d.ts.map +1 -1
- package/dist/crypto/index.js.map +1 -1
- package/dist/datetime/index.d.ts +3 -4
- package/dist/datetime/index.d.ts.map +1 -1
- package/dist/datetime/index.js.map +1 -1
- package/dist/email/brevo/index.d.ts +2 -4
- package/dist/email/brevo/index.d.ts.map +1 -1
- package/dist/email/brevo/index.js.map +1 -1
- package/dist/email/cloudflare/index.d.ts +20 -7
- package/dist/email/cloudflare/index.d.ts.map +1 -1
- package/dist/email/cloudflare/index.js +46 -9
- package/dist/email/cloudflare/index.js.map +1 -1
- package/dist/email/core/index.d.ts +6 -9
- package/dist/email/core/index.d.ts.map +1 -1
- package/dist/email/core/index.js.map +1 -1
- package/dist/email/core/index.workerd.js.map +1 -1
- package/dist/email/smtp/index.d.ts +10 -13
- package/dist/email/smtp/index.d.ts.map +1 -1
- package/dist/email/smtp/index.js +107 -32
- package/dist/email/smtp/index.js.map +1 -1
- package/dist/fake/index.d.ts +1 -2
- package/dist/fake/index.d.ts.map +1 -1
- package/dist/fake/index.js.map +1 -1
- package/dist/lock/core/index.d.ts +9 -14
- package/dist/lock/core/index.d.ts.map +1 -1
- package/dist/lock/core/index.js.map +1 -1
- package/dist/lock/redis/index.d.ts +2 -4
- package/dist/lock/redis/index.d.ts.map +1 -1
- package/dist/lock/redis/index.js.map +1 -1
- package/dist/logger/index.d.ts +105 -76
- package/dist/logger/index.d.ts.map +1 -1
- package/dist/logger/index.js +196 -174
- package/dist/logger/index.js.map +1 -1
- package/dist/mcp/index.d.ts +25 -20
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +23 -0
- package/dist/mcp/index.js.map +1 -1
- package/dist/orm/core/index.browser.js.map +1 -1
- package/dist/orm/core/index.bun.js +19 -1
- package/dist/orm/core/index.bun.js.map +1 -1
- package/dist/orm/core/index.d.ts +76 -62
- package/dist/orm/core/index.d.ts.map +1 -1
- package/dist/orm/core/index.js +20 -2
- package/dist/orm/core/index.js.map +1 -1
- package/dist/orm/postgres/index.bun.js.map +1 -1
- package/dist/orm/postgres/index.d.ts +28 -20
- package/dist/orm/postgres/index.d.ts.map +1 -1
- package/dist/orm/postgres/index.js.map +1 -1
- package/dist/queue/core/index.d.ts +12 -15
- package/dist/queue/core/index.d.ts.map +1 -1
- package/dist/queue/core/index.js.map +1 -1
- package/dist/queue/core/index.workerd.js.map +1 -1
- package/dist/queue/redis/index.d.ts +3 -5
- package/dist/queue/redis/index.d.ts.map +1 -1
- package/dist/queue/redis/index.js.map +1 -1
- package/dist/react/auth/index.browser.js +9 -2
- package/dist/react/auth/index.browser.js.map +1 -1
- package/dist/react/auth/index.d.ts +14 -9
- package/dist/react/auth/index.d.ts.map +1 -1
- package/dist/react/auth/index.js +9 -2
- package/dist/react/auth/index.js.map +1 -1
- package/dist/react/core/index.d.ts +7 -8
- package/dist/react/core/index.d.ts.map +1 -1
- package/dist/react/core/index.js +6 -3
- package/dist/react/core/index.js.map +1 -1
- package/dist/react/form/index.d.ts +2 -5
- package/dist/react/form/index.d.ts.map +1 -1
- package/dist/react/form/index.js +16 -15
- package/dist/react/form/index.js.map +1 -1
- package/dist/react/head/index.browser.js.map +1 -1
- package/dist/react/head/index.d.ts +2 -4
- package/dist/react/head/index.d.ts.map +1 -1
- package/dist/react/head/index.js.map +1 -1
- package/dist/react/i18n/index.d.ts +90 -11
- package/dist/react/i18n/index.d.ts.map +1 -1
- package/dist/react/i18n/index.js +147 -11
- package/dist/react/i18n/index.js.map +1 -1
- package/dist/react/intro/index.d.ts +1 -2
- package/dist/react/intro/index.d.ts.map +1 -1
- package/dist/react/intro/index.js +2 -2
- package/dist/react/intro/index.js.map +1 -1
- package/dist/react/router/index.browser.js +193 -24
- package/dist/react/router/index.browser.js.map +1 -1
- package/dist/react/router/index.d.ts +434 -222
- package/dist/react/router/index.d.ts.map +1 -1
- package/dist/react/router/index.js +249 -35
- package/dist/react/router/index.js.map +1 -1
- package/dist/react/sitemap/index.browser.js +35 -0
- package/dist/react/sitemap/index.browser.js.map +1 -0
- package/dist/react/sitemap/index.d.ts +92 -0
- package/dist/react/sitemap/index.d.ts.map +1 -0
- package/dist/react/sitemap/index.js +131 -0
- package/dist/react/sitemap/index.js.map +1 -0
- package/dist/react/testing/index.d.ts +1 -2
- package/dist/react/testing/index.d.ts.map +1 -1
- package/dist/react/testing/index.js +16 -17
- package/dist/react/testing/index.js.map +1 -1
- package/dist/react/ui/index.d.ts +20 -25
- package/dist/react/ui/index.d.ts.map +1 -1
- package/dist/react/ui/index.js.map +1 -1
- package/dist/redis/index.bun.js.map +1 -1
- package/dist/redis/index.d.ts +17 -19
- package/dist/redis/index.d.ts.map +1 -1
- package/dist/redis/index.js.map +1 -1
- package/dist/retry/index.d.ts +2 -4
- package/dist/retry/index.d.ts.map +1 -1
- package/dist/retry/index.js.map +1 -1
- package/dist/router/index.d.ts.map +1 -1
- package/dist/router/index.js.map +1 -1
- package/dist/scheduler/index.d.ts +10 -13
- package/dist/scheduler/index.d.ts.map +1 -1
- package/dist/scheduler/index.js.map +1 -1
- package/dist/scheduler/index.workerd.js.map +1 -1
- package/dist/security/index.browser.js.map +1 -1
- package/dist/security/index.d.ts +45 -48
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/index.js.map +1 -1
- package/dist/server/auth/index.browser.js.map +1 -1
- package/dist/server/auth/index.d.ts +272 -173
- package/dist/server/auth/index.d.ts.map +1 -1
- package/dist/server/auth/index.js +1608 -15
- package/dist/server/auth/index.js.map +1 -1
- package/dist/server/cookies/index.browser.js.map +1 -1
- package/dist/server/cookies/index.d.ts +20 -7
- package/dist/server/cookies/index.d.ts.map +1 -1
- package/dist/server/cookies/index.js +22 -3
- package/dist/server/cookies/index.js.map +1 -1
- package/dist/server/core/index.browser.js.map +1 -1
- package/dist/server/core/index.d.ts +106 -73
- package/dist/server/core/index.d.ts.map +1 -1
- package/dist/server/core/index.js +44 -0
- package/dist/server/core/index.js.map +1 -1
- package/dist/server/cors/index.d.ts +11 -14
- package/dist/server/cors/index.d.ts.map +1 -1
- package/dist/server/cors/index.js.map +1 -1
- package/dist/server/etag/index.d.ts +6 -9
- package/dist/server/etag/index.d.ts.map +1 -1
- package/dist/server/etag/index.js.map +1 -1
- package/dist/server/health/index.d.ts +18 -21
- package/dist/server/health/index.d.ts.map +1 -1
- package/dist/server/health/index.js.map +1 -1
- package/dist/server/links/index.browser.js +2 -0
- package/dist/server/links/index.browser.js.map +1 -1
- package/dist/server/links/index.d.ts +63 -67
- package/dist/server/links/index.d.ts.map +1 -1
- package/dist/server/links/index.js +2 -0
- package/dist/server/links/index.js.map +1 -1
- package/dist/server/metrics/index.d.ts +5 -7
- package/dist/server/metrics/index.d.ts.map +1 -1
- package/dist/server/metrics/index.js.map +1 -1
- package/dist/server/proxy/index.d.ts +3 -5
- package/dist/server/proxy/index.d.ts.map +1 -1
- package/dist/server/proxy/index.js.map +1 -1
- package/dist/server/rate-limit/index.d.ts +10 -13
- package/dist/server/rate-limit/index.d.ts.map +1 -1
- package/dist/server/rate-limit/index.js.map +1 -1
- package/dist/server/static/index.d.ts +3 -5
- package/dist/server/static/index.d.ts.map +1 -1
- package/dist/server/static/index.js.map +1 -1
- package/dist/server/swagger/index.d.ts +5 -8
- package/dist/server/swagger/index.d.ts.map +1 -1
- package/dist/server/swagger/index.js.map +1 -1
- package/dist/sms/index.d.ts +3 -5
- package/dist/sms/index.d.ts.map +1 -1
- package/dist/sms/index.js.map +1 -1
- package/dist/system/index.browser.js.map +1 -1
- package/dist/system/index.d.ts +2 -4
- package/dist/system/index.d.ts.map +1 -1
- package/dist/system/index.js.map +1 -1
- package/dist/system/index.workerd.js.map +1 -1
- package/dist/topic/core/index.d.ts +4 -6
- package/dist/topic/core/index.d.ts.map +1 -1
- package/dist/topic/core/index.js.map +1 -1
- package/dist/topic/redis/index.d.ts +5 -8
- package/dist/topic/redis/index.d.ts.map +1 -1
- package/dist/topic/redis/index.js.map +1 -1
- package/package.json +59 -23
- package/src/api/audits/__tests__/AuditService.spec.ts +18 -110
- package/src/api/audits/controllers/AdminAuditController.ts +14 -0
- package/src/api/audits/services/AuditService.ts +21 -88
- package/src/api/files/__tests__/FileService.spec.ts +207 -2
- package/src/api/files/index.ts +3 -0
- package/src/api/files/schemas/fileCreatorSummarySchema.ts +22 -0
- package/src/api/files/schemas/fileResourceSchema.ts +10 -1
- package/src/api/files/services/FileService.ts +170 -72
- package/src/api/jobs/__tests__/$job.spec.ts +24 -1
- package/src/api/jobs/index.ts +4 -3
- package/src/api/jobs/primitives/$job.ts +7 -3
- package/src/api/jobs/providers/DirectJobDispatcher.ts +17 -36
- package/src/api/jobs/providers/JobProvider.ts +53 -24
- package/src/api/jobs/schemas/jobConfigAtom.ts +1 -1
- package/src/api/jobs/schemas/jobExecutionResourceSchema.ts +4 -1
- package/src/api/keys/schemas/adminApiKeyResourceSchema.ts +3 -1
- package/src/api/parameters/__tests__/$parameter.spec.ts +19 -2
- package/src/api/parameters/audits/ParameterAudits.ts +17 -0
- package/src/api/parameters/controllers/AdminParameterController.ts +95 -19
- package/src/api/parameters/index.ts +3 -0
- package/src/api/parameters/schemas/activateParameterBodySchema.ts +3 -3
- package/src/api/parameters/schemas/createParameterVersionBodySchema.ts +3 -2
- package/src/api/parameters/schemas/parameterCreatorSummarySchema.ts +25 -0
- package/src/api/parameters/schemas/parameterResponseSchema.ts +5 -0
- package/src/api/parameters/schemas/rollbackParameterBodySchema.ts +4 -2
- package/src/api/parameters/services/ParameterProvider.ts +69 -6
- package/src/api/subscriptions/jobs/SubscriptionJobs.ts +1 -1
- package/src/api/users/__tests__/AdminSessionController.spec.ts +37 -0
- package/src/api/users/audits/SessionAudits.ts +33 -0
- package/src/api/users/audits/UserAudits.ts +19 -43
- package/src/api/users/controllers/AdminUserController.ts +66 -1
- package/src/api/users/controllers/RealmController.ts +1 -0
- package/src/api/users/entities/sessions.ts +6 -0
- package/src/api/users/entities/users.ts +2 -0
- package/src/api/users/index.ts +9 -1
- package/src/api/users/primitives/$realm.ts +29 -0
- package/src/api/users/providers/RealmProvider.ts +15 -0
- package/src/api/users/schemas/realmConfigSchema.ts +14 -0
- package/src/api/users/schemas/sessionResourceSchema.ts +16 -0
- package/src/api/users/schemas/updateUserSchema.ts +1 -8
- package/src/api/users/schemas/userQuerySchema.ts +7 -0
- package/src/api/users/services/CredentialService.ts +15 -6
- package/src/api/users/services/IdentityService.ts +2 -1
- package/src/api/users/services/RegistrationService.ts +2 -1
- package/src/api/users/services/SessionCrudService.ts +19 -2
- package/src/api/users/services/SessionService.ts +39 -19
- package/src/api/users/services/UserService.ts +106 -8
- package/src/background/__tests__/BackgroundTaskProvider.spec.ts +96 -0
- package/src/background/index.ts +37 -0
- package/src/background/index.workerd.ts +28 -0
- package/src/background/providers/BackgroundTaskProvider.ts +70 -0
- package/src/background/providers/WorkerdBackgroundTaskProvider.ts +43 -0
- package/src/bucket/__tests__/$bucket.spec.ts +18 -0
- package/src/bucket/__tests__/LocalFileStorageProvider.spec.ts +5 -0
- package/src/bucket/__tests__/MemoryFileStorageProvider.spec.ts +5 -0
- package/src/bucket/__tests__/NodeS3BucketProvider.spec.ts +23 -4
- package/src/bucket/__tests__/shared.ts +30 -0
- package/src/bucket/index.ts +5 -5
- package/src/bucket/index.workerd.ts +11 -4
- package/src/bucket/primitives/$bucket.ts +27 -0
- package/src/bucket/providers/FileStorageProvider.ts +13 -0
- package/src/bucket/providers/LocalFileStorageProvider.ts +17 -1
- package/src/bucket/providers/MemoryFileStorageProvider.ts +7 -0
- package/src/bucket/providers/{CloudflareR2Provider.ts → R2FileStorageProvider.ts} +10 -1
- package/src/bucket/providers/{NodeS3BucketProvider.ts → S3FileStorageProvider.ts} +27 -5
- package/src/cli/core/__tests__/BuildDockerTask.spec.ts +25 -1
- package/src/cli/core/__tests__/init.spec.ts +0 -219
- package/src/cli/core/atoms/buildOptions.ts +0 -12
- package/src/cli/core/commands/__tests__/BuildCommand.spec.ts +43 -0
- package/src/cli/core/commands/build.ts +105 -37
- package/src/cli/core/commands/init.ts +0 -12
- package/src/cli/core/commands/pack.ts +133 -0
- package/src/cli/core/index.ts +3 -3
- package/src/cli/core/providers/ViteDevServerProvider.ts +40 -16
- package/src/cli/core/services/PackageManagerUtils.ts +0 -16
- package/src/cli/core/services/ProjectScaffolder.ts +29 -291
- package/src/cli/core/tasks/BuildCloudflareTask.ts +382 -56
- package/src/cli/core/tasks/BuildDockerTask.ts +33 -3
- package/src/cli/core/tasks/BuildPrerenderTask.ts +44 -7
- package/src/cli/core/tasks/BuildTask.ts +34 -0
- package/src/cli/core/templates/apiIndexTs.ts +1 -22
- package/src/cli/core/templates/mainCss.ts +0 -1
- package/src/cli/core/templates/webAppRouterTs.ts +0 -99
- package/src/cli/core/templates/webIndexTs.ts +1 -22
- package/src/cli/i18n/__tests__/I18nCheckService.spec.ts +48 -0
- package/src/cli/i18n/services/I18nCheckService.ts +65 -11
- package/src/cli/platform/__tests__/SecretsCommand.spec.ts +5 -3
- package/src/cli/platform/commands/SecretsCommand.ts +8 -6
- package/src/cli/platform/commands/platform.ts +192 -46
- package/src/cli/platform/index.ts +12 -52
- package/src/cli/{platform → platform-lib}/__tests__/CloudflareAdapter.spec.ts +426 -169
- package/src/cli/{platform → platform-lib}/__tests__/NamingService.spec.ts +91 -4
- package/src/cli/{platform → platform-lib}/__tests__/VercelAdapter.spec.ts +56 -85
- package/src/cli/{platform → platform-lib}/adapters/CloudflareAdapter.ts +519 -190
- package/src/cli/{platform → platform-lib}/adapters/PlatformAdapter.ts +62 -35
- package/src/cli/{platform → platform-lib}/adapters/VercelAdapter.ts +6 -10
- package/src/cli/{platform → platform-lib}/atoms/platformOptions.ts +34 -1
- package/src/cli/platform-lib/index.ts +67 -0
- package/src/cli/platform-lib/services/NamingService.ts +136 -0
- package/src/cli/{platform → platform-lib}/services/PlatformInspector.ts +60 -13
- package/src/cli/{platform → platform-lib}/services/PlatformOrchestrator.ts +54 -43
- package/src/cli/{platform → platform-lib}/services/WranglerApi.ts +4 -2
- package/src/command/__tests__/Runner.spec.ts +20 -0
- package/src/command/helpers/EnvUtils.ts +19 -3
- package/src/command/helpers/Runner.ts +12 -2
- package/src/command/providers/CliProvider.ts +34 -1
- package/src/{containers → container}/core/__tests__/$container.spec.ts +5 -5
- package/src/{containers → container}/core/index.ts +4 -4
- package/src/{containers → container}/core/index.workerd.ts +19 -3
- package/src/{containers → container}/core/primitives/$container.ts +1 -1
- package/src/{containers → container}/core/providers/CloudflareContainerProvider.ts +17 -19
- package/src/{containers → container}/core/providers/ContainerProvider.ts +16 -2
- package/src/{containers → container}/core/providers/MockContainerProvider.ts +1 -1
- package/src/core/Alepha.ts +49 -1
- package/src/core/__tests__/$env.spec.ts +42 -0
- package/src/core/__tests__/dump.spec.ts +47 -0
- package/src/email/cloudflare/__tests__/CloudflareEmailProvider.spec.ts +42 -10
- package/src/email/cloudflare/index.ts +14 -5
- package/src/email/cloudflare/providers/CloudflareEmailProvider.ts +54 -9
- package/src/logger/__tests__/Logger.spec.ts +55 -0
- package/src/logger/index.ts +13 -0
- package/src/logger/services/Logger.ts +31 -1
- package/src/mcp/__tests__/McpServerProvider.spec.ts +71 -0
- package/src/mcp/providers/McpServerProvider.ts +55 -0
- package/src/orm/__tests__/orm-showcase-tests.ts +27 -0
- package/src/orm/__tests__/orm-showcase.spec.ts +12 -0
- package/src/orm/core/interfaces/PgQuery.ts +4 -1
- package/src/orm/core/services/Repository.ts +27 -11
- package/src/react/auth/hooks/useAuth.ts +10 -5
- package/src/react/core/__tests__/useQuery.browser.spec.tsx +25 -0
- package/src/react/core/hooks/useAction.ts +14 -3
- package/src/react/core/hooks/useQuery.ts +24 -4
- package/src/react/form/__tests__/FormModel-submit-loading.spec.ts +71 -0
- package/src/react/form/__tests__/form-submitting-reactive.browser.spec.tsx +96 -0
- package/src/react/form/services/FormModel.ts +57 -39
- package/src/react/i18n/__tests__/I18nProvider.spec.ts +89 -0
- package/src/react/i18n/__tests__/locale-routing.spec.ts +107 -0
- package/src/react/i18n/components/Translate.tsx +47 -0
- package/src/react/i18n/index.ts +2 -0
- package/src/react/i18n/providers/I18nProvider.ts +171 -12
- package/src/react/intro/components/GettingStartedAdminSlide.tsx +2 -2
- package/src/react/router/__tests__/$page.spec.tsx +3 -2
- package/src/react/router/__tests__/RouterLocaleProvider.spec.ts +127 -0
- package/src/react/router/__tests__/page-can.spec.ts +18 -13
- package/src/react/router/hooks/useQueryParams.ts +114 -14
- package/src/react/router/index.browser.ts +4 -0
- package/src/react/router/index.shared.ts +1 -0
- package/src/react/router/index.ts +9 -0
- package/src/react/router/primitives/$page.ts +85 -4
- package/src/react/router/providers/ReactBrowserRouterProvider.ts +18 -8
- package/src/react/router/providers/ReactPageProvider.ts +12 -1
- package/src/react/router/providers/ReactServerProvider.ts +96 -14
- package/src/react/router/providers/RootComponentsProvider.ts +13 -0
- package/src/react/router/providers/RouterLocaleProvider.ts +125 -0
- package/src/react/router/providers/__tests__/RootComponentsProvider.spec.ts +15 -0
- package/src/react/router/providers/__tests__/rootComponents.ssr.browser.spec.tsx +67 -0
- package/src/react/sitemap/__tests__/$sitemap.spec.ts +131 -0
- package/src/react/sitemap/index.browser.ts +21 -0
- package/src/react/sitemap/index.ts +25 -0
- package/src/react/sitemap/primitives/$sitemap.browser.ts +26 -0
- package/src/react/sitemap/primitives/$sitemap.ts +196 -0
- package/src/react/ui/services/SchemaControl.ts +3 -4
- package/src/server/auth/__tests__/appleClientSecret.spec.ts +34 -0
- package/src/server/auth/__tests__/authFederationClient.spec.ts +40 -0
- package/src/server/auth/__tests__/federationAssertion.spec.ts +146 -0
- package/src/server/auth/__tests__/federationRedirectReplay.spec.ts +44 -0
- package/src/server/auth/helpers/appleClientSecret.ts +24 -0
- package/src/server/auth/helpers/federationAssertion.ts +74 -0
- package/src/server/auth/helpers/jtiReplayGuard.ts +41 -0
- package/src/server/auth/helpers/safeRedirectPath.ts +19 -0
- package/src/server/auth/index.ts +4 -0
- package/src/server/auth/primitives/$authFederationBroker.ts +273 -0
- package/src/server/auth/primitives/$authFederationClient.ts +89 -0
- package/src/server/auth/providers/ServerAuthProvider.ts +18 -4
- package/src/server/cookies/__tests__/ServerCookiesProvider.spec.ts +70 -0
- package/src/server/cookies/providers/ServerCookiesProvider.ts +23 -3
- package/src/server/core/interfaces/ServerRequest.ts +8 -0
- package/src/server/core/primitives/$route.ts +27 -0
- package/src/server/core/providers/ServerMultipartProvider.ts +19 -0
- package/src/server/links/providers/LinkProvider.ts +10 -0
- package/dist/containers/core/index.d.ts.map +0 -1
- package/dist/containers/core/index.js.map +0 -1
- package/dist/containers/core/index.workerd.js.map +0 -1
- package/src/cli/core/tasks/BuildSitemapTask.ts +0 -130
- package/src/cli/core/templates/componentsJsonTs.ts +0 -39
- package/src/cli/core/templates/saasAdminLayoutTsx.ts +0 -77
- package/src/cli/core/templates/saasAdminPagesTsx.ts +0 -26
- package/src/cli/core/templates/saasAuthLayoutTsx.ts +0 -22
- package/src/cli/core/templates/saasAuthPagesTsx.ts +0 -62
- package/src/cli/core/templates/saasRealmProviderTs.ts +0 -52
- package/src/cli/platform/services/NamingService.ts +0 -54
- /package/dist/orm/core/{chunk-o8xxKEmq.js → chunk-B4FMCO8f.js} +0 -0
- /package/dist/react/testing/{chunk-6Ep1yQYe.js → chunk-BpyX8vjI.js} +0 -0
- /package/src/cli/{platform → platform-lib}/__tests__/GitHubSecretStore.spec.ts +0 -0
- /package/src/cli/{platform → platform-lib}/__tests__/PlatformCacheProvider.spec.ts +0 -0
- /package/src/cli/{platform → platform-lib}/__tests__/PlatformInspector.spec.ts +0 -0
- /package/src/cli/{platform → platform-lib}/__tests__/PlatformOrchestrator.spec.ts +0 -0
- /package/src/cli/{platform → platform-lib}/__tests__/SecretFilterService.spec.ts +0 -0
- /package/src/cli/{platform → platform-lib}/__tests__/detectResources.spec.ts +0 -0
- /package/src/cli/{platform → platform-lib}/providers/GitHubSecretStore.ts +0 -0
- /package/src/cli/{platform → platform-lib}/providers/MemorySecretStore.ts +0 -0
- /package/src/cli/{platform → platform-lib}/providers/PlatformCacheProvider.ts +0 -0
- /package/src/cli/{platform → platform-lib}/providers/SecretStoreProvider.ts +0 -0
- /package/src/cli/{platform → platform-lib}/schemas/cloudflare.ts +0 -0
- /package/src/cli/{platform → platform-lib}/schemas/platform.ts +0 -0
- /package/src/cli/{platform → platform-lib}/schemas/vercel.ts +0 -0
- /package/src/cli/{platform → platform-lib}/services/CloudflareApi.ts +0 -0
- /package/src/cli/{platform → platform-lib}/services/SecretFilterService.ts +0 -0
- /package/src/cli/{platform → platform-lib}/services/VercelApi.ts +0 -0
- /package/src/cli/{platform → platform-lib}/services/VercelCli.ts +0 -0
- /package/src/{containers → container}/core/interfaces/ContainerOptions.ts +0 -0
- /package/src/{containers → container}/core/providers/NodeContainerProvider.ts +0 -0
|
@@ -19,7 +19,6 @@ import { BuildDockerTask } from "../tasks/BuildDockerTask.ts";
|
|
|
19
19
|
import { BuildPrerenderTask } from "../tasks/BuildPrerenderTask.ts";
|
|
20
20
|
import { BuildPwaTask } from "../tasks/BuildPwaTask.ts";
|
|
21
21
|
import { BuildServerTask } from "../tasks/BuildServerTask.ts";
|
|
22
|
-
import { BuildSitemapTask } from "../tasks/BuildSitemapTask.ts";
|
|
23
22
|
import { BuildStaticTask } from "../tasks/BuildStaticTask.ts";
|
|
24
23
|
import type { BuildTaskContext } from "../tasks/BuildTask.ts";
|
|
25
24
|
import { BuildVercelTask } from "../tasks/BuildVercelTask.ts";
|
|
@@ -43,7 +42,6 @@ export class BuildCommand {
|
|
|
43
42
|
$inject(BuildClientTask),
|
|
44
43
|
$inject(BuildServerTask),
|
|
45
44
|
$inject(BuildAssetsTask),
|
|
46
|
-
$inject(BuildSitemapTask),
|
|
47
45
|
$inject(BuildPwaTask),
|
|
48
46
|
$inject(BuildPrerenderTask),
|
|
49
47
|
$inject(BuildVercelTask),
|
|
@@ -53,6 +51,29 @@ export class BuildCommand {
|
|
|
53
51
|
$inject(BuildCompressTask),
|
|
54
52
|
];
|
|
55
53
|
|
|
54
|
+
/**
|
|
55
|
+
* Value aliases accepted for `--target`.
|
|
56
|
+
*
|
|
57
|
+
* These let the CLI accept short forms (e.g. `--target cf`) that are
|
|
58
|
+
* canonicalized to a real {@link BuildTarget} before they flow into the
|
|
59
|
+
* pipeline. The enum in `flags.target` must also list the alias so it
|
|
60
|
+
* passes schema validation.
|
|
61
|
+
*/
|
|
62
|
+
protected readonly targetAliases: Record<string, BuildTarget> = {
|
|
63
|
+
cf: "cloudflare",
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Canonicalize a raw `--target` value, mapping any known alias
|
|
68
|
+
* (e.g. `cf` → `cloudflare`) to its real {@link BuildTarget}.
|
|
69
|
+
*/
|
|
70
|
+
protected resolveTarget(target: string | undefined): BuildTarget | undefined {
|
|
71
|
+
if (!target) {
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
74
|
+
return this.targetAliases[target] ?? (target as BuildTarget);
|
|
75
|
+
}
|
|
76
|
+
|
|
56
77
|
/**
|
|
57
78
|
* Resolve the effective runtime based on target and explicit runtime flag.
|
|
58
79
|
*
|
|
@@ -99,9 +120,9 @@ export class BuildCommand {
|
|
|
99
120
|
}),
|
|
100
121
|
),
|
|
101
122
|
target: t.optional(
|
|
102
|
-
t.enum(["bare", "docker", "vercel", "cloudflare", "static"], {
|
|
123
|
+
t.enum(["bare", "docker", "vercel", "cloudflare", "cf", "static"], {
|
|
103
124
|
aliases: ["t"],
|
|
104
|
-
description: "Deployment target",
|
|
125
|
+
description: "Deployment target (cf = cloudflare)",
|
|
105
126
|
}),
|
|
106
127
|
),
|
|
107
128
|
runtime: t.optional(
|
|
@@ -130,11 +151,6 @@ export class BuildCommand {
|
|
|
130
151
|
"Skip the bundle steps (Vite client/server + asset compression). Only regenerates target-specific deploy config (e.g. wrangler.jsonc). Use when `dist/` is already built and you just need the config refreshed.",
|
|
131
152
|
}),
|
|
132
153
|
),
|
|
133
|
-
sitemap: t.optional(
|
|
134
|
-
t.text({
|
|
135
|
-
description: "Generate sitemap.xml with base URL",
|
|
136
|
-
}),
|
|
137
|
-
),
|
|
138
154
|
}),
|
|
139
155
|
handler: async ({ flags, run, root }) => {
|
|
140
156
|
process.env.NODE_ENV = "production";
|
|
@@ -152,24 +168,26 @@ export class BuildCommand {
|
|
|
152
168
|
this.log.trace("Entry file found", { entry });
|
|
153
169
|
|
|
154
170
|
// Resolve flags → mutate the atom (single source of truth)
|
|
155
|
-
this.alepha.store.mut(buildOptions, (current) =>
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
this.alepha.store.mut(buildOptions, (current) => {
|
|
172
|
+
const target = this.resolveTarget(flags.target) ?? current.target;
|
|
173
|
+
return {
|
|
174
|
+
...current,
|
|
175
|
+
stats: flags.stats ?? current.stats ?? false,
|
|
176
|
+
target,
|
|
177
|
+
runtime: this.resolveRuntime(
|
|
178
|
+
target,
|
|
179
|
+
flags.runtime ?? current.runtime,
|
|
180
|
+
),
|
|
181
|
+
...(flags.compile !== undefined && {
|
|
182
|
+
docker: {
|
|
183
|
+
...current.docker,
|
|
184
|
+
compile: flags.compile
|
|
185
|
+
? (current.docker?.compile ?? true)
|
|
186
|
+
: false,
|
|
187
|
+
},
|
|
188
|
+
}),
|
|
189
|
+
};
|
|
190
|
+
});
|
|
173
191
|
|
|
174
192
|
const options = this.options;
|
|
175
193
|
|
|
@@ -211,28 +229,57 @@ export class BuildCommand {
|
|
|
211
229
|
runtime: options.runtime,
|
|
212
230
|
});
|
|
213
231
|
|
|
232
|
+
// Prebuilt + manifest fast-path: skip `analyze app` (which boots
|
|
233
|
+
// the workspace via Vite and requires its full node_modules tree).
|
|
234
|
+
// BuildCloudflareTask reads from `ctx.manifest` instead of from
|
|
235
|
+
// `ctx.alepha` in this mode. Falls back to the introspection path
|
|
236
|
+
// when no manifest is present (older artifacts).
|
|
237
|
+
let manifest: Awaited<ReturnType<typeof this.loadManifest>> = null;
|
|
238
|
+
if (flags.prebuilt) {
|
|
239
|
+
manifest = await this.loadManifest(root);
|
|
240
|
+
}
|
|
241
|
+
|
|
214
242
|
let appAlepha: Alepha | undefined;
|
|
215
243
|
let hasClient = false;
|
|
216
244
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
245
|
+
if (!manifest) {
|
|
246
|
+
await run({
|
|
247
|
+
name: "analyze app",
|
|
248
|
+
handler: async () => {
|
|
249
|
+
appAlepha = await this.viteBuildProvider.init({ entry });
|
|
250
|
+
hasClient = this.viteBuildProvider.hasClient();
|
|
251
|
+
},
|
|
252
|
+
});
|
|
224
253
|
|
|
225
|
-
|
|
226
|
-
|
|
254
|
+
if (!appAlepha) {
|
|
255
|
+
throw new AlephaError("Alepha instance not found");
|
|
256
|
+
}
|
|
227
257
|
}
|
|
228
258
|
|
|
259
|
+
// Read platformOptions from the CLI's Alepha instance — this is
|
|
260
|
+
// where alepha.config.ts wrote them during the configure hook.
|
|
261
|
+
// The workspace's appAlepha (from Vite) is a separate instance
|
|
262
|
+
// and doesn't have these. Captured here so BuildCloudflareTask
|
|
263
|
+
// can serialize them into dist/manifest.json without needing to
|
|
264
|
+
// re-load alepha.config.ts at deploy time.
|
|
265
|
+
const platformOptions =
|
|
266
|
+
(this.alepha.store.get("alepha.cli.platform.options") as
|
|
267
|
+
| BuildTaskContext["platformOptions"]
|
|
268
|
+
| undefined) ?? null;
|
|
269
|
+
|
|
229
270
|
const ctx: BuildTaskContext = {
|
|
230
|
-
|
|
271
|
+
// Cast: when manifest mode is active, BuildCloudflareTask reads
|
|
272
|
+
// from ctx.manifest and never dereferences ctx.alepha. Bundle
|
|
273
|
+
// tasks (BuildClient/Server/etc.) self-guard on ctx.flags.prebuilt
|
|
274
|
+
// and return early, so they don't touch alepha either.
|
|
275
|
+
alepha: (appAlepha ?? null) as unknown as Alepha,
|
|
231
276
|
options,
|
|
232
277
|
root,
|
|
233
278
|
run,
|
|
234
279
|
entry,
|
|
235
280
|
hasClient,
|
|
281
|
+
manifest,
|
|
282
|
+
platformOptions,
|
|
236
283
|
flags: { image: flags.image, prebuilt: flags.prebuilt },
|
|
237
284
|
};
|
|
238
285
|
|
|
@@ -241,4 +288,25 @@ export class BuildCommand {
|
|
|
241
288
|
}
|
|
242
289
|
},
|
|
243
290
|
});
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Read `dist/manifest.json` produced by a previous `alepha build`.
|
|
294
|
+
* Returns null when absent or unparseable — caller falls back to the
|
|
295
|
+
* Vite-introspection path.
|
|
296
|
+
*/
|
|
297
|
+
protected async loadManifest(root: string) {
|
|
298
|
+
try {
|
|
299
|
+
const fs = await import("node:fs/promises");
|
|
300
|
+
const path = await import("node:path");
|
|
301
|
+
const raw = await fs.readFile(
|
|
302
|
+
path.join(root, "dist", "manifest.json"),
|
|
303
|
+
"utf-8",
|
|
304
|
+
);
|
|
305
|
+
return JSON.parse(
|
|
306
|
+
raw,
|
|
307
|
+
) as import("../tasks/BuildCloudflareTask.ts").BuildManifest;
|
|
308
|
+
} catch {
|
|
309
|
+
return null;
|
|
310
|
+
}
|
|
311
|
+
}
|
|
244
312
|
}
|
|
@@ -42,18 +42,6 @@ export class InitCommand {
|
|
|
42
42
|
description: "Include Tailwind CSS with Vite plugin. Implies --react",
|
|
43
43
|
}),
|
|
44
44
|
),
|
|
45
|
-
shadcn: t.optional(
|
|
46
|
-
t.union([t.boolean(), t.text()], {
|
|
47
|
-
description:
|
|
48
|
-
"Set up shadcn/ui (components.json, cn helper, theme tokens, alepha registry). Pass an optional preset id (default: b0). Implies --react and --tailwind",
|
|
49
|
-
}),
|
|
50
|
-
),
|
|
51
|
-
saas: t.optional(
|
|
52
|
-
t.union([t.boolean(), t.text()], {
|
|
53
|
-
description:
|
|
54
|
-
"Scaffold a SaaS starter: auth (login/register/reset/verify) + admin panel (/admin AppShell with users/sessions/api-keys/parameters/audits). Pass an optional preset id (default: b0). Implies --shadcn and --api",
|
|
55
|
-
}),
|
|
56
|
-
),
|
|
57
45
|
force: t.optional(
|
|
58
46
|
t.boolean({
|
|
59
47
|
aliases: ["f"],
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { $inject, AlephaError, t } from "alepha";
|
|
2
|
+
import { $command } from "alepha/command";
|
|
3
|
+
import { $logger } from "alepha/logger";
|
|
4
|
+
import { FileSystemProvider, ShellProvider } from "alepha/system";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Pack the workspace into a deployable `tar.gz`.
|
|
8
|
+
*
|
|
9
|
+
* The tar contains everything a remote runner (Alepha Rocket, or any
|
|
10
|
+
* `alepha platform <op> --prebuilt` consumer) needs to deploy the app:
|
|
11
|
+
*
|
|
12
|
+
* dist/ pre-built output (incl. manifest.json)
|
|
13
|
+
* migrations/ SQL files (if present)
|
|
14
|
+
*
|
|
15
|
+
* No source, no `alepha.config.ts`, no `package.json` — the deploy
|
|
16
|
+
* side reads everything from `dist/manifest.json` and never touches
|
|
17
|
+
* source. Excludes: `node_modules`, `.DS_Store`, macOS AppleDouble
|
|
18
|
+
* (`._*`), `.alepha` build cache, `e2e`, `playwright-report`,
|
|
19
|
+
* `coverage`.
|
|
20
|
+
*
|
|
21
|
+
* Output name: `<project-name>-<tag>.tar.gz` (default tag
|
|
22
|
+
* "latest"). Project name comes from `package.json.name`. Naming
|
|
23
|
+
* mirrors Docker tags — same artifact, different tag = different
|
|
24
|
+
* file.
|
|
25
|
+
*/
|
|
26
|
+
export class PackCommand {
|
|
27
|
+
protected readonly log = $logger();
|
|
28
|
+
protected readonly fs = $inject(FileSystemProvider);
|
|
29
|
+
protected readonly shell = $inject(ShellProvider);
|
|
30
|
+
|
|
31
|
+
public readonly pack = $command({
|
|
32
|
+
name: "pack",
|
|
33
|
+
description:
|
|
34
|
+
"Pack the workspace into a deployable tar.gz (for `alepha platform --prebuilt` consumers like Alepha Rocket).",
|
|
35
|
+
flags: t.object({
|
|
36
|
+
tag: t.optional(
|
|
37
|
+
t.text({
|
|
38
|
+
aliases: ["t"],
|
|
39
|
+
description:
|
|
40
|
+
"Tag suffix for the artifact name (Docker-style). Defaults to `latest` → `<project>-latest.tar.gz`. Pass a real version like `0.0.2` for a pinned artifact.",
|
|
41
|
+
}),
|
|
42
|
+
),
|
|
43
|
+
output: t.optional(
|
|
44
|
+
t.text({
|
|
45
|
+
aliases: ["o"],
|
|
46
|
+
description:
|
|
47
|
+
"Output directory for the tar.gz (default: current dir).",
|
|
48
|
+
}),
|
|
49
|
+
),
|
|
50
|
+
}),
|
|
51
|
+
handler: async ({ flags, root, run }) => {
|
|
52
|
+
const pkgPath = this.fs.join(root, "package.json");
|
|
53
|
+
let project: string;
|
|
54
|
+
try {
|
|
55
|
+
const pkg = await this.fs.readJsonFile<{ name?: string }>(pkgPath);
|
|
56
|
+
if (!pkg.name) {
|
|
57
|
+
throw new AlephaError(
|
|
58
|
+
'Missing "name" in package.json — `alepha pack` needs it for the artifact filename.',
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
project = pkg.name;
|
|
62
|
+
} catch (err) {
|
|
63
|
+
if (err instanceof AlephaError) throw err;
|
|
64
|
+
throw new AlephaError(
|
|
65
|
+
`Could not read package.json at ${pkgPath}. Run \`alepha pack\` from a workspace directory.`,
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const tag = flags.tag ?? "latest";
|
|
70
|
+
const outputDir = flags.output ?? root;
|
|
71
|
+
const filename = `${project}-${tag}.tar.gz`;
|
|
72
|
+
const outputPath = this.fs.join(outputDir, filename);
|
|
73
|
+
|
|
74
|
+
// Include list: just `dist/` + `migrations/`. Everything else
|
|
75
|
+
// (src, alepha.config.ts, tsconfig.json, package.json) is
|
|
76
|
+
// dev-time scaffolding — the deploy side reads
|
|
77
|
+
// `dist/manifest.json` for project/env/resources and never
|
|
78
|
+
// touches source.
|
|
79
|
+
const candidates = ["dist", "migrations"];
|
|
80
|
+
const includes: string[] = [];
|
|
81
|
+
for (const candidate of candidates) {
|
|
82
|
+
if (await this.fs.exists(this.fs.join(root, candidate))) {
|
|
83
|
+
includes.push(candidate);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (!includes.includes("dist")) {
|
|
88
|
+
throw new AlephaError(
|
|
89
|
+
"dist/ missing — run `alepha build --target=cloudflare` before `alepha pack`.",
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
const manifestPath = this.fs.join(root, "dist", "manifest.json");
|
|
93
|
+
if (!(await this.fs.exists(manifestPath))) {
|
|
94
|
+
throw new AlephaError(
|
|
95
|
+
`dist/manifest.json missing — required for prebuilt deploys. Rebuild with the current alepha version (\`alepha build --target=cloudflare\`).`,
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// macOS sets COPYFILE_DISABLE=0 by default; tar will then include
|
|
100
|
+
// AppleDouble `._*` files. Force it off here so the tarball is
|
|
101
|
+
// portable. Also pass explicit excludes for `node_modules`,
|
|
102
|
+
// `.DS_Store`, etc. — they slip in via `dist/`.
|
|
103
|
+
const excludes = [
|
|
104
|
+
"node_modules",
|
|
105
|
+
".DS_Store",
|
|
106
|
+
"._*",
|
|
107
|
+
".alepha",
|
|
108
|
+
"e2e",
|
|
109
|
+
"playwright-report",
|
|
110
|
+
"test-results",
|
|
111
|
+
"coverage",
|
|
112
|
+
]
|
|
113
|
+
.map((p) => `--exclude='${p}'`)
|
|
114
|
+
.join(" ");
|
|
115
|
+
|
|
116
|
+
const tarCmd = `tar -czf '${outputPath}' ${excludes} ${includes.map((p) => `'${p}'`).join(" ")}`;
|
|
117
|
+
// Wrap in `sh -c` so the env-var assignment is interpreted by the
|
|
118
|
+
// shell instead of being parsed as the binary name. COPYFILE_DISABLE
|
|
119
|
+
// suppresses macOS AppleDouble (`._*`) entries that tar otherwise
|
|
120
|
+
// emits when running on HFS+/APFS.
|
|
121
|
+
const cmd = `sh -c "COPYFILE_DISABLE=1 ${tarCmd}"`;
|
|
122
|
+
|
|
123
|
+
await run({
|
|
124
|
+
name: `pack → ${filename}`,
|
|
125
|
+
handler: async () => {
|
|
126
|
+
await this.shell.run(cmd, { root });
|
|
127
|
+
},
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
this.log.info(`Packed ${filename} → ${outputPath}`);
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
}
|
package/src/cli/core/index.ts
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
import { GenCommand } from "./commands/gen.ts";
|
|
15
15
|
import { InitCommand } from "./commands/init.ts";
|
|
16
16
|
import { LintCommand } from "./commands/lint.ts";
|
|
17
|
+
import { PackCommand } from "./commands/pack.ts";
|
|
17
18
|
import { RootCommand } from "./commands/root.ts";
|
|
18
19
|
import { TestCommand } from "./commands/test.ts";
|
|
19
20
|
import { TypecheckCommand } from "./commands/typecheck.ts";
|
|
@@ -33,7 +34,6 @@ import { BuildCompressTask } from "./tasks/BuildCompressTask.ts";
|
|
|
33
34
|
import { BuildDockerTask } from "./tasks/BuildDockerTask.ts";
|
|
34
35
|
import { BuildPrerenderTask } from "./tasks/BuildPrerenderTask.ts";
|
|
35
36
|
import { BuildServerTask } from "./tasks/BuildServerTask.ts";
|
|
36
|
-
import { BuildSitemapTask } from "./tasks/BuildSitemapTask.ts";
|
|
37
37
|
import { BuildStaticTask } from "./tasks/BuildStaticTask.ts";
|
|
38
38
|
import { BuildVercelTask } from "./tasks/BuildVercelTask.ts";
|
|
39
39
|
|
|
@@ -52,6 +52,7 @@ export * from "./commands/gen/changelog.ts";
|
|
|
52
52
|
export * from "./commands/gen/openapi.ts";
|
|
53
53
|
export * from "./commands/init.ts";
|
|
54
54
|
export * from "./commands/lint.ts";
|
|
55
|
+
export * from "./commands/pack.ts";
|
|
55
56
|
export * from "./commands/root.ts";
|
|
56
57
|
export * from "./commands/test.ts";
|
|
57
58
|
export * from "./commands/typecheck.ts";
|
|
@@ -72,7 +73,6 @@ export * from "./tasks/BuildCompressTask.ts";
|
|
|
72
73
|
export * from "./tasks/BuildDockerTask.ts";
|
|
73
74
|
export * from "./tasks/BuildPrerenderTask.ts";
|
|
74
75
|
export * from "./tasks/BuildServerTask.ts";
|
|
75
|
-
export * from "./tasks/BuildSitemapTask.ts";
|
|
76
76
|
export * from "./tasks/BuildStaticTask.ts";
|
|
77
77
|
export * from "./tasks/BuildTask.ts";
|
|
78
78
|
export * from "./tasks/BuildVercelTask.ts";
|
|
@@ -116,6 +116,7 @@ export const AlephaCli = $module({
|
|
|
116
116
|
DevCommand,
|
|
117
117
|
InitCommand,
|
|
118
118
|
LintCommand,
|
|
119
|
+
PackCommand,
|
|
119
120
|
RootCommand,
|
|
120
121
|
TestCommand,
|
|
121
122
|
TypecheckCommand,
|
|
@@ -129,7 +130,6 @@ export const AlephaCli = $module({
|
|
|
129
130
|
BuildDockerTask,
|
|
130
131
|
BuildPrerenderTask,
|
|
131
132
|
BuildServerTask,
|
|
132
|
-
BuildSitemapTask,
|
|
133
133
|
BuildStaticTask,
|
|
134
134
|
BuildVercelTask,
|
|
135
135
|
],
|
|
@@ -324,13 +324,22 @@ export class ViteDevServerProvider {
|
|
|
324
324
|
// Skip when waiting for startup retry
|
|
325
325
|
if (this.waitingForRetry) return [];
|
|
326
326
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
//
|
|
333
|
-
|
|
327
|
+
// React component (.tsx/.jsx) edits always need the SSR module
|
|
328
|
+
// graph invalidated — the `_ssrModule` shortcut below misses files
|
|
329
|
+
// that are workspace-linked source-only (e.g. `@alepha/ui/...`).
|
|
330
|
+
// Those don't carry an `_ssrModule` ref on `ctx.modules[0]` on
|
|
331
|
+
// first edit and get classified as browser-only, leaving stale
|
|
332
|
+
// SSR HTML and triggering hydration mismatches on next request.
|
|
333
|
+
const isTsx = /\.(tsx|jsx)$/.test(ctx.file);
|
|
334
|
+
if (!isTsx) {
|
|
335
|
+
const firstModule = ctx.modules[0] as
|
|
336
|
+
| { _ssrModule?: unknown; _clientModule?: unknown }
|
|
337
|
+
| undefined;
|
|
338
|
+
const isBrowserOnly = firstModule && !firstModule._ssrModule;
|
|
339
|
+
|
|
340
|
+
// Browser-only: let Vite HMR handle it (React Fast Refresh)
|
|
341
|
+
if (isBrowserOnly) return;
|
|
342
|
+
}
|
|
334
343
|
|
|
335
344
|
// Queue Alepha reload for server-side invalidation
|
|
336
345
|
this.changedFiles.add(ctx.file);
|
|
@@ -626,7 +635,17 @@ if (import.meta.hot) {
|
|
|
626
635
|
}
|
|
627
636
|
|
|
628
637
|
/**
|
|
629
|
-
* Invalidate modules and all their importers
|
|
638
|
+
* Invalidate modules and all their importers, across both client and
|
|
639
|
+
* SSR module graphs.
|
|
640
|
+
*
|
|
641
|
+
* Vite registers a file under multiple module ids (one per query
|
|
642
|
+
* variant — e.g. `?v=…`, `?import` and the bare path), and `getModuleById`
|
|
643
|
+
* only matches one. For workspace-linked source files (`@alepha/ui/...`)
|
|
644
|
+
* the SSR-graph entry is keyed by the absolute path while the client
|
|
645
|
+
* may use the package-qualified id. `getModulesByFile` returns every
|
|
646
|
+
* variant Vite knows about for a given absolute path — invalidating
|
|
647
|
+
* each catches both halves of the dual graph and prevents stale SSR
|
|
648
|
+
* compiled exports from surviving across edits.
|
|
630
649
|
*/
|
|
631
650
|
protected invalidateModulesWithImporters(changedFiles: Set<string>): void {
|
|
632
651
|
const graph = this.server.moduleGraph;
|
|
@@ -636,16 +655,21 @@ if (import.meta.hot) {
|
|
|
636
655
|
while (queue.length > 0) {
|
|
637
656
|
const file = queue.pop()!;
|
|
638
657
|
if (invalidated.has(file)) continue;
|
|
639
|
-
|
|
640
|
-
const mod = this.server.moduleGraph.getModuleById(file);
|
|
641
|
-
if (!mod) continue;
|
|
642
|
-
|
|
643
|
-
graph.invalidateModule(mod);
|
|
644
658
|
invalidated.add(file);
|
|
645
659
|
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
660
|
+
const mods = new Set([
|
|
661
|
+
...(graph.getModulesByFile(file) ?? []),
|
|
662
|
+
...(graph.getModuleById(file) ? [graph.getModuleById(file)!] : []),
|
|
663
|
+
]);
|
|
664
|
+
if (mods.size === 0) continue;
|
|
665
|
+
|
|
666
|
+
for (const mod of mods) {
|
|
667
|
+
graph.invalidateModule(mod);
|
|
668
|
+
for (const importer of mod.importers) {
|
|
669
|
+
const key = importer.file ?? importer.id;
|
|
670
|
+
if (key && !invalidated.has(key)) {
|
|
671
|
+
queue.push(key);
|
|
672
|
+
}
|
|
649
673
|
}
|
|
650
674
|
}
|
|
651
675
|
}
|
|
@@ -418,16 +418,6 @@ export class PackageManagerUtils {
|
|
|
418
418
|
devDependencies["@tailwindcss/vite"] = alephaDeps["@tailwindcss/vite"];
|
|
419
419
|
}
|
|
420
420
|
|
|
421
|
-
if (modes.shadcn) {
|
|
422
|
-
// Add `shadcn` CLI as a project devDep — `alepha init --shadcn` runs
|
|
423
|
-
// `yarn shadcn init` after install to scaffold components.json,
|
|
424
|
-
// theme tokens, cn() helper, and runtime deps (clsx, tailwind-merge,
|
|
425
|
-
// class-variance-authority, lucide-react, tw-animate-css). Keeping
|
|
426
|
-
// the CLI in the project lets users re-run `yarn shadcn add ...`
|
|
427
|
-
// without `npx`.
|
|
428
|
-
devDependencies.shadcn = alephaDeps.shadcn;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
421
|
if (modes.react) {
|
|
432
422
|
dependencies.react = alephaDeps.react;
|
|
433
423
|
dependencies["react-dom"] = alephaDeps["react-dom"];
|
|
@@ -459,12 +449,6 @@ export interface DependencyModes {
|
|
|
459
449
|
react?: boolean;
|
|
460
450
|
expo?: boolean;
|
|
461
451
|
tailwind?: boolean;
|
|
462
|
-
shadcn?: boolean;
|
|
463
|
-
/**
|
|
464
|
-
* SaaS starter: implies `shadcn` + adds the alepha auth + admin registry
|
|
465
|
-
* components on top via `shadcn add @alepha/...`.
|
|
466
|
-
*/
|
|
467
|
-
saas?: boolean;
|
|
468
452
|
/**
|
|
469
453
|
* Whether the project is a workspace package inside a monorepo.
|
|
470
454
|
*/
|