@travetto/email-compiler 6.0.1 → 7.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/email-compiler",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-rc.1",
|
|
4
4
|
"description": "Email compiling module",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"email",
|
|
@@ -26,20 +26,20 @@
|
|
|
26
26
|
"directory": "module/email-compiler"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@travetto/config": "^
|
|
30
|
-
"@travetto/di": "^
|
|
31
|
-
"@travetto/email": "^
|
|
32
|
-
"@travetto/image": "^
|
|
33
|
-
"@travetto/runtime": "^
|
|
34
|
-
"@travetto/worker": "^
|
|
29
|
+
"@travetto/config": "^7.0.0-rc.1",
|
|
30
|
+
"@travetto/di": "^7.0.0-rc.1",
|
|
31
|
+
"@travetto/email": "^7.0.0-rc.1",
|
|
32
|
+
"@travetto/image": "^7.0.0-rc.1",
|
|
33
|
+
"@travetto/runtime": "^7.0.0-rc.1",
|
|
34
|
+
"@travetto/worker": "^7.0.0-rc.1",
|
|
35
35
|
"@types/inline-css": "^3.0.4",
|
|
36
36
|
"html-entities": "^2.6.0",
|
|
37
37
|
"inline-css": "^4.0.3",
|
|
38
38
|
"purgecss": "^7.0.2",
|
|
39
|
-
"sass": "^1.
|
|
39
|
+
"sass": "^1.94.2"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@travetto/cli": "^
|
|
42
|
+
"@travetto/cli": "^7.0.0-rc.1"
|
|
43
43
|
},
|
|
44
44
|
"peerDependenciesMeta": {
|
|
45
45
|
"@travetto/cli": {
|
package/support/bin/send.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { MailService, EmailOptions, MailTransport } from '@travetto/email';
|
|
2
|
-
import {
|
|
2
|
+
import { DependencyRegistryIndex, Injectable } from '@travetto/di';
|
|
3
3
|
import { toConcrete } from '@travetto/runtime';
|
|
4
|
+
import { Registry } from '@travetto/registry';
|
|
4
5
|
|
|
5
6
|
import { EditorConfig } from './config.ts';
|
|
6
7
|
|
|
@@ -15,20 +16,24 @@ export class EditorSendService {
|
|
|
15
16
|
async service(): Promise<MailService> {
|
|
16
17
|
const MailTransportTarget = toConcrete<MailTransport>();
|
|
17
18
|
|
|
18
|
-
const transports =
|
|
19
|
+
const transports = DependencyRegistryIndex.getCandidates(MailTransportTarget);
|
|
19
20
|
|
|
20
21
|
if (!transports.length) {
|
|
21
22
|
try {
|
|
22
23
|
const { NodemailerTransport } = await import('@travetto/email-nodemailer');
|
|
23
24
|
const senderConfig = await EditorConfig.get('sender');
|
|
24
25
|
const cls = class { };
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
DependencyRegistryIndex.getForRegister(cls).register({
|
|
27
|
+
candidates: {
|
|
28
|
+
factory: {
|
|
29
|
+
candidateType: MailTransportTarget,
|
|
30
|
+
factory: () => new NodemailerTransport(senderConfig),
|
|
31
|
+
class: cls,
|
|
32
|
+
method: 'factory',
|
|
33
|
+
}
|
|
34
|
+
}
|
|
30
35
|
});
|
|
31
|
-
|
|
36
|
+
Registry.process([{ type: 'added', curr: cls }]);
|
|
32
37
|
|
|
33
38
|
this.ethereal = !!senderConfig.host?.includes('ethereal.email');
|
|
34
39
|
} catch {
|
|
@@ -36,7 +41,7 @@ export class EditorSendService {
|
|
|
36
41
|
throw new Error('A mail transport is currently needed to support sending emails. Please install @travetto/email-nodemailer or any other compatible transport');
|
|
37
42
|
}
|
|
38
43
|
}
|
|
39
|
-
return await
|
|
44
|
+
return await DependencyRegistryIndex.getInstance(MailService);
|
|
40
45
|
}
|
|
41
46
|
|
|
42
47
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Registry } from '@travetto/registry';
|
|
2
2
|
import { CliCommandShape, CliCommand, cliTpl } from '@travetto/cli';
|
|
3
3
|
import { Env, Runtime } from '@travetto/runtime';
|
|
4
4
|
|
|
@@ -20,7 +20,7 @@ export class EmailCompileCommand implements CliCommandShape {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
async main(): Promise<void> {
|
|
23
|
-
await
|
|
23
|
+
await Registry.init();
|
|
24
24
|
|
|
25
25
|
// Let the engine template
|
|
26
26
|
const all = await EmailCompiler.compileAll();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Env } from '@travetto/runtime';
|
|
2
2
|
import { CliCommand, CliUtil } from '@travetto/cli';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { Registry } from '@travetto/registry';
|
|
4
|
+
import { DependencyRegistryIndex } from '@travetto/di';
|
|
5
5
|
|
|
6
6
|
import { EditorService } from './bin/editor.ts';
|
|
7
7
|
|
|
@@ -19,8 +19,8 @@ export class EmailEditorCommand {
|
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
await
|
|
23
|
-
const service = await
|
|
22
|
+
await Registry.init();
|
|
23
|
+
const service = await DependencyRegistryIndex.getInstance(EditorService);
|
|
24
24
|
await service.listen();
|
|
25
25
|
}
|
|
26
26
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Registry } from '@travetto/registry';
|
|
4
4
|
import { CliCommandShape, CliCommand } from '@travetto/cli';
|
|
5
|
-
import {
|
|
5
|
+
import { DependencyRegistryIndex } from '@travetto/di';
|
|
6
6
|
import { Env } from '@travetto/runtime';
|
|
7
7
|
|
|
8
8
|
import { EditorService } from './bin/editor.ts';
|
|
@@ -19,8 +19,8 @@ export class EmailTestCommand implements CliCommandShape {
|
|
|
19
19
|
|
|
20
20
|
async main(file: string, to: string): Promise<void> {
|
|
21
21
|
file = path.resolve(file);
|
|
22
|
-
await
|
|
23
|
-
const editor = await
|
|
22
|
+
await Registry.init();
|
|
23
|
+
const editor = await DependencyRegistryIndex.getInstance(EditorService);
|
|
24
24
|
await editor.sendFile(file, to);
|
|
25
25
|
}
|
|
26
26
|
}
|