@travetto/email-compiler 6.0.1 → 7.0.0-rc.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/email-compiler",
3
- "version": "6.0.1",
3
+ "version": "7.0.0-rc.0",
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": "^6.0.1",
30
- "@travetto/di": "^6.0.1",
31
- "@travetto/email": "^6.0.1",
32
- "@travetto/image": "^6.0.1",
33
- "@travetto/runtime": "^6.0.1",
34
- "@travetto/worker": "^6.0.1",
29
+ "@travetto/config": "^7.0.0-rc.0",
30
+ "@travetto/di": "^7.0.0-rc.0",
31
+ "@travetto/email": "^7.0.0-rc.0",
32
+ "@travetto/image": "^7.0.0-rc.0",
33
+ "@travetto/runtime": "^7.0.0-rc.0",
34
+ "@travetto/worker": "^7.0.0-rc.0",
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.93.2"
39
+ "sass": "^1.94.2"
40
40
  },
41
41
  "peerDependencies": {
42
- "@travetto/cli": "^6.0.1"
42
+ "@travetto/cli": "^7.0.0-rc.0"
43
43
  },
44
44
  "peerDependenciesMeta": {
45
45
  "@travetto/cli": {
@@ -1,6 +1,7 @@
1
1
  import { MailService, EmailOptions, MailTransport } from '@travetto/email';
2
- import { DependencyRegistry, Injectable } from '@travetto/di';
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 = DependencyRegistry.getCandidateTypes(MailTransportTarget);
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
- DependencyRegistry.registerFactory({
26
- fn: () => new NodemailerTransport(senderConfig),
27
- target: MailTransportTarget,
28
- src: cls,
29
- id: 'nodemailer',
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
- DependencyRegistry.install(cls, { curr: cls, type: 'added' });
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 DependencyRegistry.getInstance(MailService);
44
+ return await DependencyRegistryIndex.getInstance(MailService);
40
45
  }
41
46
 
42
47
  /**
@@ -1,4 +1,4 @@
1
- import { RootRegistry } from '@travetto/registry';
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 RootRegistry.init();
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 { RootRegistry } from '@travetto/registry';
4
- import { DependencyRegistry } from '@travetto/di';
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 RootRegistry.init();
23
- const service = await DependencyRegistry.getInstance(EditorService);
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 { RootRegistry } from '@travetto/registry';
3
+ import { Registry } from '@travetto/registry';
4
4
  import { CliCommandShape, CliCommand } from '@travetto/cli';
5
- import { DependencyRegistry } from '@travetto/di';
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 RootRegistry.init();
23
- const editor = await DependencyRegistry.getInstance(EditorService);
22
+ await Registry.init();
23
+ const editor = await DependencyRegistryIndex.getInstance(EditorService);
24
24
  await editor.sendFile(file, to);
25
25
  }
26
26
  }