@travetto/email-compiler 5.0.0-rc.6 → 5.0.0-rc.8
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 +8 -8
- package/src/compiler.ts +4 -8
- package/src/util.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/email-compiler",
|
|
3
|
-
"version": "5.0.0-rc.
|
|
3
|
+
"version": "5.0.0-rc.8",
|
|
4
4
|
"description": "Email compiling module",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"email",
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"directory": "module/email-compiler"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@travetto/runtime": "^5.0.0-rc.
|
|
30
|
-
"@travetto/config": "^5.0.0-rc.
|
|
31
|
-
"@travetto/di": "^5.0.0-rc.
|
|
32
|
-
"@travetto/email": "^5.0.0-rc.
|
|
33
|
-
"@travetto/image": "^5.0.0-rc.
|
|
34
|
-
"@travetto/worker": "^5.0.0-rc.
|
|
29
|
+
"@travetto/runtime": "^5.0.0-rc.8",
|
|
30
|
+
"@travetto/config": "^5.0.0-rc.8",
|
|
31
|
+
"@travetto/di": "^5.0.0-rc.8",
|
|
32
|
+
"@travetto/email": "^5.0.0-rc.8",
|
|
33
|
+
"@travetto/image": "^5.0.0-rc.8",
|
|
34
|
+
"@travetto/worker": "^5.0.0-rc.8",
|
|
35
35
|
"@types/inline-css": "^3.0.3",
|
|
36
36
|
"html-entities": "^2.5.2",
|
|
37
37
|
"inline-css": "^4.0.2",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"sass": "^1.77.6"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@travetto/cli": "^5.0.0-rc.
|
|
42
|
+
"@travetto/cli": "^5.0.0-rc.8"
|
|
43
43
|
},
|
|
44
44
|
"peerDependenciesMeta": {
|
|
45
45
|
"@travetto/cli": {
|
package/src/compiler.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
|
|
4
|
-
import { TypedObject, Util, RuntimeIndex, watchCompiler } from '@travetto/runtime';
|
|
4
|
+
import { TypedObject, Util, RuntimeIndex, watchCompiler, Runtime } from '@travetto/runtime';
|
|
5
5
|
import { EmailCompiled, MailUtil, EmailTemplateImport, EmailTemplateModule } from '@travetto/email';
|
|
6
6
|
|
|
7
7
|
import { EmailCompileUtil } from './util';
|
|
@@ -15,13 +15,9 @@ export class EmailCompiler {
|
|
|
15
15
|
* Load Template
|
|
16
16
|
*/
|
|
17
17
|
static async loadTemplate(file: string): Promise<EmailTemplateModule> {
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
throw new Error(`Unable to find template for ${file}`);
|
|
22
|
-
}
|
|
23
|
-
const root: EmailTemplateImport = (await import(entry.outputFile)).default;
|
|
24
|
-
return await root.prepare({ file, module: mod.name });
|
|
18
|
+
const root = (await Runtime.importFrom<{ default: EmailTemplateImport }>(file)).default;
|
|
19
|
+
const entry = RuntimeIndex.getEntry(file)!;
|
|
20
|
+
return await root.prepare({ file, module: entry.module });
|
|
25
21
|
}
|
|
26
22
|
|
|
27
23
|
/**
|
package/src/util.ts
CHANGED
|
@@ -140,7 +140,7 @@ export class EmailCompileUtil {
|
|
|
140
140
|
const output = await ImageConverter.optimize(
|
|
141
141
|
ext === '.png' ? 'png' : 'jpeg', await opts.loader.readStream(src)
|
|
142
142
|
);
|
|
143
|
-
const buffer = toBuffer(output);
|
|
143
|
+
const buffer = await toBuffer(output);
|
|
144
144
|
pendingImages.push([token, ext, buffer]);
|
|
145
145
|
} else {
|
|
146
146
|
pendingImages.push([token, ext, opts.loader.read(src, true)]);
|