create-mantiq 0.1.10 → 0.1.11
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/package.json +1 -1
- package/src/templates.ts +63 -0
package/package.json
CHANGED
package/src/templates.ts
CHANGED
|
@@ -35,6 +35,7 @@ export function getTemplates(ctx: TemplateContext): Record<string, string> {
|
|
|
35
35
|
'@mantiq/queue': '^0.1.2',
|
|
36
36
|
'@mantiq/realtime': '^0.1.2',
|
|
37
37
|
'@mantiq/validation': '^0.1.2',
|
|
38
|
+
'@mantiq/mail': '^0.2.0',
|
|
38
39
|
},
|
|
39
40
|
devDependencies: {
|
|
40
41
|
'bun-types': 'latest',
|
|
@@ -74,6 +75,7 @@ DB_DATABASE=database/database.sqlite
|
|
|
74
75
|
|
|
75
76
|
LOG_CHANNEL=stack
|
|
76
77
|
QUEUE_CONNECTION=sync
|
|
78
|
+
MAIL_MAILER=log
|
|
77
79
|
`,
|
|
78
80
|
|
|
79
81
|
'.env.example': `APP_NAME=${ctx.name}
|
|
@@ -115,6 +117,7 @@ import { QueueServiceProvider } from '@mantiq/queue'
|
|
|
115
117
|
import { ValidationServiceProvider } from '@mantiq/validation'
|
|
116
118
|
import { HeartbeatServiceProvider, HeartbeatMiddleware } from '@mantiq/heartbeat'
|
|
117
119
|
import { RealtimeServiceProvider } from '@mantiq/realtime'
|
|
120
|
+
import { MailServiceProvider } from '@mantiq/mail'
|
|
118
121
|
import { DatabaseServiceProvider } from './app/Providers/DatabaseServiceProvider.ts'
|
|
119
122
|
|
|
120
123
|
// ── Load .env ─────────────────────────────────────────────────────────────────
|
|
@@ -146,6 +149,7 @@ await app.registerProviders([
|
|
|
146
149
|
ValidationServiceProvider,
|
|
147
150
|
HeartbeatServiceProvider,
|
|
148
151
|
RealtimeServiceProvider,
|
|
152
|
+
MailServiceProvider,
|
|
149
153
|
])
|
|
150
154
|
await app.bootProviders()
|
|
151
155
|
|
|
@@ -221,6 +225,7 @@ import {
|
|
|
221
225
|
ScheduleRunCommand,
|
|
222
226
|
} from '@mantiq/queue'
|
|
223
227
|
import { InstallCommand as HeartbeatInstallCommand } from '@mantiq/heartbeat'
|
|
228
|
+
import { MakeMailCommand } from '@mantiq/mail'
|
|
224
229
|
|
|
225
230
|
const kernel = new Kernel()
|
|
226
231
|
|
|
@@ -250,6 +255,7 @@ kernel.registerAll([
|
|
|
250
255
|
new MakeRuleCommand(),
|
|
251
256
|
new MakeSeederCommand(),
|
|
252
257
|
new MakeTestCommand(),
|
|
258
|
+
new MakeMailCommand(),
|
|
253
259
|
|
|
254
260
|
// Queue
|
|
255
261
|
new QueueWorkCommand(),
|
|
@@ -389,6 +395,60 @@ export default {
|
|
|
389
395
|
table: 'failed_jobs',
|
|
390
396
|
},
|
|
391
397
|
}
|
|
398
|
+
`,
|
|
399
|
+
|
|
400
|
+
'config/mail.ts': `import { env } from '@mantiq/core'
|
|
401
|
+
|
|
402
|
+
export default {
|
|
403
|
+
default: env('MAIL_MAILER', 'log'),
|
|
404
|
+
|
|
405
|
+
from: {
|
|
406
|
+
address: env('MAIL_FROM_ADDRESS', 'hello@example.com'),
|
|
407
|
+
name: env('MAIL_FROM_NAME', '${ctx.name}'),
|
|
408
|
+
},
|
|
409
|
+
|
|
410
|
+
mailers: {
|
|
411
|
+
smtp: {
|
|
412
|
+
driver: 'smtp' as const,
|
|
413
|
+
host: env('MAIL_HOST', 'localhost'),
|
|
414
|
+
port: Number(env('MAIL_PORT', '587')),
|
|
415
|
+
username: env('MAIL_USERNAME', ''),
|
|
416
|
+
password: env('MAIL_PASSWORD', ''),
|
|
417
|
+
encryption: env('MAIL_ENCRYPTION', 'starttls') as 'tls' | 'starttls' | 'none',
|
|
418
|
+
},
|
|
419
|
+
|
|
420
|
+
resend: {
|
|
421
|
+
driver: 'resend' as const,
|
|
422
|
+
apiKey: env('RESEND_API_KEY', ''),
|
|
423
|
+
},
|
|
424
|
+
|
|
425
|
+
sendgrid: {
|
|
426
|
+
driver: 'sendgrid' as const,
|
|
427
|
+
apiKey: env('SENDGRID_API_KEY', ''),
|
|
428
|
+
},
|
|
429
|
+
|
|
430
|
+
mailgun: {
|
|
431
|
+
driver: 'mailgun' as const,
|
|
432
|
+
apiKey: env('MAILGUN_API_KEY', ''),
|
|
433
|
+
domain: env('MAILGUN_DOMAIN', ''),
|
|
434
|
+
},
|
|
435
|
+
|
|
436
|
+
postmark: {
|
|
437
|
+
driver: 'postmark' as const,
|
|
438
|
+
serverToken: env('POSTMARK_TOKEN', ''),
|
|
439
|
+
},
|
|
440
|
+
|
|
441
|
+
ses: {
|
|
442
|
+
driver: 'ses' as const,
|
|
443
|
+
region: env('AWS_REGION', 'us-east-1'),
|
|
444
|
+
accessKeyId: env('AWS_ACCESS_KEY_ID', ''),
|
|
445
|
+
secretAccessKey: env('AWS_SECRET_ACCESS_KEY', ''),
|
|
446
|
+
},
|
|
447
|
+
|
|
448
|
+
log: { driver: 'log' as const },
|
|
449
|
+
array: { driver: 'array' as const },
|
|
450
|
+
},
|
|
451
|
+
}
|
|
392
452
|
`,
|
|
393
453
|
|
|
394
454
|
'config/heartbeat.ts': `export default {
|
|
@@ -673,6 +733,7 @@ function applyKitOverrides(templates: Record<string, string>, ctx: TemplateConte
|
|
|
673
733
|
'@mantiq/queue': '^0.1.2',
|
|
674
734
|
'@mantiq/realtime': '^0.1.2',
|
|
675
735
|
'@mantiq/validation': '^0.1.2',
|
|
736
|
+
'@mantiq/mail': '^0.2.0',
|
|
676
737
|
'@mantiq/vite': '^0.1.2',
|
|
677
738
|
},
|
|
678
739
|
devDependencies: {
|
|
@@ -771,6 +832,7 @@ import { QueueServiceProvider } from '@mantiq/queue'
|
|
|
771
832
|
import { ValidationServiceProvider } from '@mantiq/validation'
|
|
772
833
|
import { HeartbeatServiceProvider, HeartbeatMiddleware } from '@mantiq/heartbeat'
|
|
773
834
|
import { RealtimeServiceProvider } from '@mantiq/realtime'
|
|
835
|
+
import { MailServiceProvider } from '@mantiq/mail'
|
|
774
836
|
import { DatabaseServiceProvider } from './app/Providers/DatabaseServiceProvider.ts'
|
|
775
837
|
|
|
776
838
|
// ── Load .env ─────────────────────────────────────────────────────────────────
|
|
@@ -803,6 +865,7 @@ await app.registerProviders([
|
|
|
803
865
|
ValidationServiceProvider,
|
|
804
866
|
HeartbeatServiceProvider,
|
|
805
867
|
RealtimeServiceProvider,
|
|
868
|
+
MailServiceProvider,
|
|
806
869
|
])
|
|
807
870
|
await app.bootProviders()
|
|
808
871
|
|