@travetto/email-compiler 7.0.4 → 7.0.5
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 +9 -9
- package/src/compiler.ts +6 -6
- package/src/util.ts +1 -1
- package/support/bin/config.ts +1 -1
- package/support/bin/editor.ts +3 -3
- package/support/bin/send.ts +1 -1
- package/support/cli.email_compile.ts +1 -1
- package/support/cli.email_test.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/email-compiler",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Email compiling module",
|
|
6
6
|
"keywords": [
|
|
@@ -27,20 +27,20 @@
|
|
|
27
27
|
"directory": "module/email-compiler"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@travetto/config": "^7.0.
|
|
31
|
-
"@travetto/di": "^7.0.
|
|
32
|
-
"@travetto/email": "^7.0.
|
|
33
|
-
"@travetto/image": "^7.0.
|
|
34
|
-
"@travetto/runtime": "^7.0.
|
|
35
|
-
"@travetto/worker": "^7.0.
|
|
30
|
+
"@travetto/config": "^7.0.5",
|
|
31
|
+
"@travetto/di": "^7.0.5",
|
|
32
|
+
"@travetto/email": "^7.0.5",
|
|
33
|
+
"@travetto/image": "^7.0.4",
|
|
34
|
+
"@travetto/runtime": "^7.0.4",
|
|
35
|
+
"@travetto/worker": "^7.0.4",
|
|
36
36
|
"@types/inline-css": "^3.0.4",
|
|
37
37
|
"html-entities": "^2.6.0",
|
|
38
38
|
"inline-css": "^4.0.3",
|
|
39
39
|
"purgecss": "^7.0.2",
|
|
40
|
-
"sass": "^1.97.
|
|
40
|
+
"sass": "^1.97.2"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@travetto/cli": "^7.0.
|
|
43
|
+
"@travetto/cli": "^7.0.6"
|
|
44
44
|
},
|
|
45
45
|
"peerDependenciesMeta": {
|
|
46
46
|
"@travetto/cli": {
|
package/src/compiler.ts
CHANGED
|
@@ -3,7 +3,7 @@ import path from 'node:path';
|
|
|
3
3
|
import { spawn } from 'node:child_process';
|
|
4
4
|
|
|
5
5
|
import { TypedObject, RuntimeIndex, Runtime, BinaryUtil, ExecUtil } from '@travetto/runtime';
|
|
6
|
-
import { EmailCompiled, MailUtil, EmailTemplateImport, EmailTemplateModule } from '@travetto/email';
|
|
6
|
+
import { type EmailCompiled, MailUtil, type EmailTemplateImport, type EmailTemplateModule } from '@travetto/email';
|
|
7
7
|
|
|
8
8
|
import { EmailCompileUtil } from './util.ts';
|
|
9
9
|
|
|
@@ -27,7 +27,7 @@ export class EmailCompiler {
|
|
|
27
27
|
static findAllTemplates(moduleName?: string): string[] {
|
|
28
28
|
return RuntimeIndex
|
|
29
29
|
.find({
|
|
30
|
-
module:
|
|
30
|
+
module: module => !moduleName ? module.roles.includes('std') : moduleName === module.name,
|
|
31
31
|
folder: folder => folder === 'support',
|
|
32
32
|
file: file => EmailCompileUtil.isTemplateFile(file.sourceFile)
|
|
33
33
|
})
|
|
@@ -39,8 +39,8 @@ export class EmailCompiler {
|
|
|
39
39
|
*/
|
|
40
40
|
static getOutputFiles(file: string): EmailCompiled {
|
|
41
41
|
const entry = RuntimeIndex.getEntry(file)!;
|
|
42
|
-
const
|
|
43
|
-
return EmailCompileUtil.getOutputs(file, path.join(
|
|
42
|
+
const module = RuntimeIndex.getModule(entry.module)!;
|
|
43
|
+
return EmailCompileUtil.getOutputs(file, path.join(module.sourcePath, 'resources'));
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
/**
|
|
@@ -78,8 +78,8 @@ export class EmailCompiler {
|
|
|
78
78
|
/**
|
|
79
79
|
* Compile all
|
|
80
80
|
*/
|
|
81
|
-
static async compileAll(
|
|
82
|
-
const keys = this.findAllTemplates(
|
|
81
|
+
static async compileAll(module?: string): Promise<string[]> {
|
|
82
|
+
const keys = this.findAllTemplates(module);
|
|
83
83
|
await Promise.all(keys.map(key => this.compile(key)));
|
|
84
84
|
return keys;
|
|
85
85
|
}
|
package/src/util.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { buffer as toBuffer } from 'node:stream/consumers';
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import type { CompileResult, Options } from 'sass';
|
|
4
4
|
|
|
5
|
-
import { EmailCompiled, EmailTemplateModule, EmailTemplateResource } from '@travetto/email';
|
|
5
|
+
import type { EmailCompiled, EmailTemplateModule, EmailTemplateResource } from '@travetto/email';
|
|
6
6
|
import { ImageUtil } from '@travetto/image';
|
|
7
7
|
import { RuntimeIndex } from '@travetto/runtime';
|
|
8
8
|
|
package/support/bin/config.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { parse, stringify } from 'yaml';
|
|
|
3
3
|
|
|
4
4
|
import { Runtime, BinaryUtil } from '@travetto/runtime';
|
|
5
5
|
|
|
6
|
-
import { EditorConfigType } from './types.ts';
|
|
6
|
+
import type { EditorConfigType } from './types.ts';
|
|
7
7
|
|
|
8
8
|
export const CONFIG_FILE = 'resources/email/local.yml';
|
|
9
9
|
|
package/support/bin/editor.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Inject, Injectable } from '@travetto/di';
|
|
2
|
-
import { MailUtil, EmailCompiled, MailInterpolator } from '@travetto/email';
|
|
2
|
+
import { MailUtil, type EmailCompiled, type MailInterpolator } from '@travetto/email';
|
|
3
3
|
import { AppError, TypedObject, WatchUtil } from '@travetto/runtime';
|
|
4
4
|
|
|
5
|
-
import { EditorSendService } from './send.ts';
|
|
5
|
+
import type { EditorSendService } from './send.ts';
|
|
6
6
|
import { EditorConfig } from './config.ts';
|
|
7
|
-
import { EditorRequest, EditorResponse } from './types.ts';
|
|
7
|
+
import type { EditorRequest, EditorResponse } from './types.ts';
|
|
8
8
|
|
|
9
9
|
import { EmailCompiler } from '../../src/compiler.ts';
|
|
10
10
|
import { EmailCompileUtil } from '../../src/util.ts';
|
package/support/bin/send.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MailService, EmailOptions, MailTransport } from '@travetto/email';
|
|
1
|
+
import { MailService, type EmailOptions, type MailTransport } from '@travetto/email';
|
|
2
2
|
import { DependencyRegistryIndex, Injectable } from '@travetto/di';
|
|
3
3
|
import { toConcrete } from '@travetto/runtime';
|
|
4
4
|
import { Registry } from '@travetto/registry';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Registry } from '@travetto/registry';
|
|
2
|
-
import { CliCommandShape, CliCommand, cliTpl } from '@travetto/cli';
|
|
2
|
+
import { type CliCommandShape, CliCommand, cliTpl } from '@travetto/cli';
|
|
3
3
|
import { Env, Runtime, WatchUtil } from '@travetto/runtime';
|
|
4
4
|
|
|
5
5
|
import { EmailCompiler } from '../src/compiler.ts';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
|
|
3
3
|
import { Registry } from '@travetto/registry';
|
|
4
|
-
import { CliCommandShape, CliCommand } from '@travetto/cli';
|
|
4
|
+
import { type CliCommandShape, CliCommand } from '@travetto/cli';
|
|
5
5
|
import { DependencyRegistryIndex } from '@travetto/di';
|
|
6
6
|
import { Env } from '@travetto/runtime';
|
|
7
7
|
|