@travetto/email-compiler 5.0.19 → 5.0.20
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 +5 -2
- package/src/util.ts +1 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/email-compiler",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.20",
|
|
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/config": "^5.0.
|
|
30
|
-
"@travetto/di": "^5.0.
|
|
31
|
-
"@travetto/email": "^5.0.
|
|
32
|
-
"@travetto/image": "^5.0.
|
|
33
|
-
"@travetto/runtime": "^5.0.
|
|
34
|
-
"@travetto/worker": "^5.0.
|
|
29
|
+
"@travetto/config": "^5.0.15",
|
|
30
|
+
"@travetto/di": "^5.0.15",
|
|
31
|
+
"@travetto/email": "^5.0.15",
|
|
32
|
+
"@travetto/image": "^5.0.19",
|
|
33
|
+
"@travetto/runtime": "^5.0.15",
|
|
34
|
+
"@travetto/worker": "^5.0.17",
|
|
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.83.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@travetto/cli": "^5.0.
|
|
42
|
+
"@travetto/cli": "^5.0.18"
|
|
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, RuntimeIndex, watchCompiler, Runtime, BinaryUtil } from '@travetto/runtime';
|
|
4
|
+
import { TypedObject, RuntimeIndex, watchCompiler, Runtime, BinaryUtil, castTo } from '@travetto/runtime';
|
|
5
5
|
import { EmailCompiled, MailUtil, EmailTemplateImport, EmailTemplateModule } from '@travetto/email';
|
|
6
6
|
|
|
7
7
|
import { EmailCompileUtil } from './util';
|
|
@@ -15,7 +15,10 @@ export class EmailCompiler {
|
|
|
15
15
|
* Load Template
|
|
16
16
|
*/
|
|
17
17
|
static async loadTemplate(file: string): Promise<EmailTemplateModule> {
|
|
18
|
-
|
|
18
|
+
let root = (await Runtime.importFrom<{ default: EmailTemplateImport }>(file)).default;
|
|
19
|
+
if ('default' in root) {
|
|
20
|
+
root = castTo(root.default);
|
|
21
|
+
}
|
|
19
22
|
const entry = RuntimeIndex.getEntry(file)!;
|
|
20
23
|
return await root.prepare({ file, module: entry.module });
|
|
21
24
|
}
|
package/src/util.ts
CHANGED
|
@@ -11,7 +11,7 @@ type Tokenized = {
|
|
|
11
11
|
finalize: (onToken: (token: string) => string) => string;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
const SUPPORT_SRC = /(support|src)\//;
|
|
14
|
+
const SUPPORT_SRC = /(?:support|src)\//;
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Email compile tools
|
|
@@ -175,7 +175,6 @@ export class EmailCompileUtil {
|
|
|
175
175
|
.concat('\n');
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
|
|
179
178
|
/**
|
|
180
179
|
* Apply styles into a given html document
|
|
181
180
|
*/
|