@maizzle/framework 4.8.7 → 5.0.0-beta.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.
Files changed (80) hide show
  1. package/bin/maizzle +3 -1
  2. package/package.json +65 -58
  3. package/src/commands/build.js +244 -19
  4. package/src/commands/serve.js +2 -197
  5. package/src/generators/plaintext.js +192 -91
  6. package/src/generators/render.js +128 -0
  7. package/src/index.js +46 -14
  8. package/src/{generators/posthtml → posthtml}/defaultComponentsConfig.js +6 -4
  9. package/src/{generators/posthtml → posthtml}/defaultConfig.js +1 -1
  10. package/src/posthtml/index.js +74 -0
  11. package/src/posthtml/plugins/expandLinkTag.js +36 -0
  12. package/src/server/client.js +181 -0
  13. package/src/server/index.js +383 -0
  14. package/src/server/routes/hmr.js +24 -0
  15. package/src/server/routes/index.js +38 -0
  16. package/src/server/views/error.html +83 -0
  17. package/src/server/views/index.html +24 -0
  18. package/src/server/websockets.js +27 -0
  19. package/src/transformers/addAttributes.js +30 -0
  20. package/src/transformers/attributeToStyle.js +30 -36
  21. package/src/transformers/baseUrl.js +52 -23
  22. package/src/transformers/comb.js +51 -0
  23. package/src/transformers/core.js +20 -0
  24. package/src/transformers/filters/defaultFilters.js +90 -70
  25. package/src/transformers/filters/index.js +14 -78
  26. package/src/transformers/index.js +268 -63
  27. package/src/transformers/inline.js +240 -0
  28. package/src/transformers/markdown.js +13 -14
  29. package/src/transformers/minify.js +21 -16
  30. package/src/transformers/posthtmlMso.js +13 -8
  31. package/src/transformers/prettify.js +16 -15
  32. package/src/transformers/preventWidows.js +32 -26
  33. package/src/transformers/removeAttributes.js +17 -17
  34. package/src/transformers/replaceStrings.js +30 -9
  35. package/src/transformers/safeClassNames.js +24 -24
  36. package/src/transformers/shorthandCss.js +22 -0
  37. package/src/transformers/sixHex.js +15 -15
  38. package/src/transformers/urlParameters.js +18 -16
  39. package/src/transformers/useAttributeSizes.js +65 -0
  40. package/src/utils/getConfigByFilePath.js +124 -0
  41. package/src/utils/node.js +68 -0
  42. package/src/utils/string.js +117 -0
  43. package/types/build.d.ts +117 -57
  44. package/types/components.d.ts +130 -112
  45. package/types/config.d.ts +454 -242
  46. package/types/css/inline.d.ts +234 -0
  47. package/types/css/purge.d.ts +125 -0
  48. package/types/events.d.ts +5 -105
  49. package/types/index.d.ts +148 -116
  50. package/types/markdown.d.ts +20 -18
  51. package/types/minify.d.ts +122 -120
  52. package/types/plaintext.d.ts +46 -52
  53. package/types/posthtml.d.ts +103 -136
  54. package/types/render.d.ts +0 -117
  55. package/types/urlParameters.d.ts +21 -20
  56. package/types/widowWords.d.ts +9 -7
  57. package/src/functions/plaintext.js +0 -5
  58. package/src/functions/render.js +0 -5
  59. package/src/generators/config.js +0 -52
  60. package/src/generators/output/index.js +0 -4
  61. package/src/generators/output/to-disk.js +0 -254
  62. package/src/generators/output/to-string.js +0 -73
  63. package/src/generators/postcss.js +0 -23
  64. package/src/generators/posthtml/index.js +0 -75
  65. package/src/generators/tailwindcss.js +0 -157
  66. package/src/transformers/extraAttributes.js +0 -33
  67. package/src/transformers/inlineCss.js +0 -42
  68. package/src/transformers/removeInlineBackgroundColor.js +0 -56
  69. package/src/transformers/removeInlineSizes.js +0 -43
  70. package/src/transformers/removeInlinedSelectors.js +0 -100
  71. package/src/transformers/removeUnusedCss.js +0 -48
  72. package/src/transformers/shorthandInlineCSS.js +0 -26
  73. package/src/utils/helpers.js +0 -13
  74. package/types/baseUrl.d.ts +0 -79
  75. package/types/fetch.d.ts +0 -143
  76. package/types/inlineCss.d.ts +0 -207
  77. package/types/layouts.d.ts +0 -39
  78. package/types/removeUnusedCss.d.ts +0 -115
  79. package/types/tailwind.d.ts +0 -22
  80. package/types/templates.d.ts +0 -181
package/types/config.d.ts CHANGED
@@ -1,31 +1,82 @@
1
1
  import type BuildConfig from './build';
2
- import type InlineCSSConfig from './inlineCss';
3
- import type RemoveUnusedCSSConfig from './removeUnusedCss';
4
- import type WidowWordsConfig from './widowWords';
5
- import type BaseURLConfig from './baseURL';
6
- import type URLParametersConfig from './urlParameters';
7
- import type {CoreBeautifyOptions} from 'js-beautify';
8
2
  import type MinifyConfig from './minify';
3
+ import type PostHTMLConfig from './posthtml';
9
4
  import type MarkdownConfig from './markdown';
10
- import type EventsConfig from './events';
5
+ import type { ProcessOptions } from 'postcss';
6
+ import type PurgeCSSConfig from './css/purge';
7
+ import type CSSInlineConfig from './css/inline';
8
+ import type ComponentsConfig from './components';
9
+ import type WidowWordsConfig from './widowWords';
10
+ import type { CoreBeautifyOptions } from 'js-beautify';
11
+ import type { BaseURLConfig } from 'posthtml-base-url';
12
+ import type URLParametersConfig from './urlParameters';
13
+ import type {
14
+ beforeCreateType,
15
+ beforeRenderType,
16
+ afterRenderType,
17
+ afterTransformersType,
18
+ afterBuildType
19
+ } from './events';
20
+ import type PlaintextConfig from './plaintext';
21
+
22
+ import type { Config as TailwindConfig } from 'tailwindcss';
11
23
 
12
24
  export default interface Config {
13
- [key: string]: any;
25
+ [key: string]: any; // eslint-disable-line
26
+
27
+ /**
28
+ * Add or remove attributes from elements.
29
+ */
30
+ attributes?: {
31
+ /**
32
+ * Add attributes to specific elements.
33
+ *
34
+ * @default {}
35
+ *
36
+ * @example
37
+ * ```
38
+ * export default {
39
+ * attributes: {
40
+ * add: {
41
+ * table: {
42
+ * cellpadding: 0,
43
+ * cellspacing: 0,
44
+ * }
45
+ * }
46
+ * }
47
+ * }
48
+ * ```
49
+ */
50
+ add?: Record<string, Record<string, string|number>>;
51
+
52
+ /**
53
+ * Remove attributes from elements.
54
+ *
55
+ * @default {}
56
+ *
57
+ * @example
58
+ * ```
59
+ * export default {
60
+ * attributes: {
61
+ * remove: ['width', 'height'],
62
+ * }
63
+ * }
64
+ * ```
65
+ */
66
+ remove?: Record<string, string[]>;
67
+ }
14
68
 
15
69
  /**
16
70
  Configure build settings.
17
71
 
18
72
  @example
19
73
  ```
20
- module.exports = {
74
+ export default {
21
75
  build: {
22
- templates: TemplatesConfig,
23
- tailwind: TailwindConfig,
24
- layouts: LayoutsConfig,
25
76
  components: ComponentsConfig,
26
77
  posthtml: PostHTMLConfig,
27
- browsersync: BrowserSyncConfig,
28
- fail: 'silent' // or 'verbose'
78
+ tailwind: TailwindConfig,
79
+ templates: TemplatesConfig,
29
80
  }
30
81
  }
31
82
  ```
@@ -33,192 +84,327 @@ export default interface Config {
33
84
  build: BuildConfig;
34
85
 
35
86
  /**
36
- Toggle the use of Transformers.
37
-
38
- @default true
39
-
40
- @example
41
- ```
42
- module.exports = {
43
- applyTransformers: false,
44
- }
45
- ```
46
- */
47
- applyTransformers?: boolean;
48
-
49
- /**
50
- Configure CSS inlining.
87
+ Define a string that will be prepended to sources and hrefs in your HTML and CSS.
51
88
 
52
- To enable it with defaults, simply set it to `true`.
53
89
  @example
54
- ```js
55
- module.exports = {
56
- inlineCSS: true,
57
- }
58
- ```
59
- */
60
- inlineCSS?: boolean | InlineCSSConfig;
61
90
 
62
- /**
63
- Configure unused CSS purging.
91
+ Prepend to all sources and hrefs:
64
92
 
65
- To enable it with defaults, simply set it to `true`.
66
- @example
67
93
  ```
68
- module.exports = {
69
- removeUnusedCSS: true,
94
+ export default {
95
+ baseURL: 'https://cdn.example.com/'
70
96
  }
71
97
  ```
72
- */
73
- removeUnusedCSS?: boolean | RemoveUnusedCSSConfig;
74
-
75
- /**
76
- Automatically remove HTML attributes.
77
98
 
78
- By default, empty `style` and `class` attributes are removed.
79
-
80
- @default ['style', 'class']
99
+ Prepend only to `src` attributes on image tags:
81
100
 
82
- @example
83
101
  ```
84
- module.exports = {
85
- removeAttributes: ['data-src']
102
+ export default {
103
+ baseURL: {
104
+ url: 'https://cdn.example.com/',
105
+ tags: ['img'],
106
+ },
86
107
  }
87
108
  ```
88
109
  */
89
- removeAttributes?:
90
- | string[]
91
- | Array<{
92
- name: string;
93
- value: string | RegExp;
94
- }>;
110
+ baseURL?: string | BaseURLConfig;
95
111
 
96
112
  /**
97
- Prevent widow words inside a tag by adding a `&nbsp;` between its last two words.
113
+ * Configure components.
114
+ */
115
+ components?: ComponentsConfig;
98
116
 
99
- @example
100
- ```
101
- module.exports = {
102
- widowWords: true,
117
+ /**
118
+ * Configure how CSS is handled.
119
+ */
120
+ css: {
121
+ /**
122
+ * Configure CSS inlining.
123
+ */
124
+ inline?: CSSInlineConfig;
125
+
126
+ /**
127
+ * Configure CSS purging.
128
+ */
129
+ purge?: PurgeCSSConfig;
130
+
131
+ /**
132
+ * Normalize escaped character class names like `\:` or `\/` by replacing them
133
+ * with email-safe alternatives.
134
+ *
135
+ * @example
136
+ * ```
137
+ * export default {
138
+ * css: {
139
+ * safeClassNames: {
140
+ * ':': '__',
141
+ * '!': 'i-',
142
+ * }
143
+ * }
144
+ * }
145
+ * ```
146
+ */
147
+ safeClassNames?: boolean | Record<string, string>;
148
+
149
+ /**
150
+ * Ensure that all your HEX colors inside `bgcolor` and `color` attributes are defined with six digits.
151
+ *
152
+ * @default true
153
+ *
154
+ * @example
155
+ * ```
156
+ * export default {
157
+ * css: {
158
+ * sixHex: false,
159
+ * }
160
+ * }
161
+ * ```
162
+ */
163
+ sixHex?: boolean;
164
+
165
+ /**
166
+ * Rewrite longhand CSS inside style attributes with shorthand syntax.
167
+ * Only works with `margin`, `padding` and `border`, and only when
168
+ * all sides are specified.
169
+ *
170
+ * @default []
171
+ *
172
+ * @example
173
+ * ```
174
+ * export default {
175
+ * css: {
176
+ * shorthand: {
177
+ * tags: ['td', 'div'],
178
+ * } // or shorthand: true
179
+ * }
180
+ * }
181
+ * ```
182
+ */
183
+ shorthand?: boolean | Record<string, string[]>;
184
+
185
+ /**
186
+ * Use a custom Tailwind CSS configuration object.
187
+ *
188
+ */
189
+ tailwind?: TailwindConfig;
103
190
  }
104
- ```
105
- */
106
- widowWords?: WidowWordsConfig;
107
191
 
108
192
  /**
109
- [Add attributes](https://maizzle.com/docs/transformers/add-attributes) to elements in your HTML.
110
-
111
- @default
112
- {
113
- table: {
114
- cellpadding: 0,
115
- cellspacing: 0,
116
- role: 'none'
117
- },
118
- img: {
119
- alt: ''
120
- },
121
- }
122
- */
123
- extraAttributes?: boolean | Record<string, unknown>;
193
+ * Transform text inside elements marked with custom attributes.
194
+ * Filters work only on elements that contain only text.
195
+ *
196
+ * @default {}
197
+ *
198
+ * @example
199
+ * ```
200
+ * export default {
201
+ * filters: {
202
+ * uppercase: str => str.toUpperCase(),
203
+ * }
204
+ * }
205
+ * ```
206
+ */
207
+ filters: boolean | Record<string, (str: string) => string>;
124
208
 
125
209
  /**
126
- Normalize escaped character class names like `\:` or `\/` by replacing them with email-safe alternatives.
127
-
128
- @example
129
- ```
130
- module.exports = {
131
- safeClassNames: {
132
- ':': '__',
133
- '!': 'i-',
134
- }
135
- }
136
- ```
137
- */
138
- safeClassNames?: boolean | Record<string, string>;
210
+ * Define variables outside of the `page` object.
211
+ *
212
+ * @default {}
213
+ *
214
+ * @example
215
+ * ```
216
+ * export default {
217
+ * locals: {
218
+ * company: {
219
+ * name: 'Spacely Space Sprockets, Inc.'
220
+ * }
221
+ * }
222
+ * }
223
+ * ```
224
+ *
225
+ * `company` can then be used like this:
226
+ *
227
+ * ```
228
+ * <p>{{ company.name }}</p>
229
+ * ```
230
+ */
231
+ locals?: Record<string, any>; // eslint-disable-line
139
232
 
140
233
  /**
141
- Rewrite longhand CSS inside style attributes with shorthand syntax.
142
- Only works with margin, padding and border, and only when all sides are specified.
143
-
144
- @default []
145
-
146
- @example
147
- ```
148
- module.exports = {
149
- shorthandCSS: true, // or ['td', 'div'] to only apply to those tags
150
- }
151
- ```
152
- */
153
- shorthandCSS?: boolean | string[];
234
+ * Configure the Markdown parser.
235
+ *
236
+ * @example
237
+ *
238
+ * ```
239
+ * export default {
240
+ * markdown: {
241
+ * root: './', // Path relative to which markdown files are imported
242
+ * encoding: 'utf8', // Encoding for imported Markdown files
243
+ * markdownit: {}, // Options passed to markdown-it
244
+ * plugins: [], // Plugins for markdown-it
245
+ * }
246
+ * }
247
+ * ```
248
+ */
249
+ markdown?: MarkdownConfig;
154
250
 
155
251
  /**
156
- Define a string that will be prepended to sources and hrefs in your HTML and CSS.
157
-
158
- @example
159
-
160
- Prepend to all sources and hrefs:
252
+ * Minify the compiled HTML email code.
253
+ *
254
+ * @default false
255
+ *
256
+ * @example
257
+ * ```
258
+ * export default {
259
+ * minify: true,
260
+ * }
261
+ * ```
262
+ */
263
+ minify?: boolean | MinifyConfig;
161
264
 
162
- ```
163
- module.exports = {
164
- baseURL: 'https://cdn.example.com/'
165
- }
166
- ```
265
+ /**
266
+ Configure the `posthtml-mso` plugin.
267
+ */
268
+ outlook?: {
269
+ /**
270
+ The tag name to use for Outlook conditional comments.
167
271
 
168
- Prepend only to `src` attributes on image tags:
272
+ @default 'outlook'
169
273
 
170
- ```
171
- module.exports = {
172
- baseURL: {
173
- url: 'https://cdn.example.com/',
174
- tags: ['img'],
175
- },
176
- }
177
- ```
178
- */
179
- baseURL?: string | BaseURLConfig;
274
+ @example
275
+ ```
276
+ export default {
277
+ outlook: {
278
+ tag: 'mso'
279
+ }
280
+ }
281
+ // You now write <mso>...</mso> instead of <outlook>...</outlook>
282
+ ```
283
+ */
284
+ tag?: string;
285
+ };
180
286
 
181
287
  /**
182
- Transform text inside elements marked with custom attributes.
288
+ * Configure plaintext generation.
289
+ */
290
+ plaintext?: PlaintextConfig;
183
291
 
184
- Filters work only on elements that contain only text.
185
-
186
- @default {}
292
+ /**
293
+ * PostHTML configuration.
294
+ */
295
+ posthtml?: PostHTMLConfig;
187
296
 
188
- @example
189
- ```
190
- module.exports = {
191
- filters: {
192
- uppercase: str => str.toUpperCase()
193
- }
194
- }
195
- ```
196
- */
197
- filters: Record<string, unknown>;
297
+ /**
298
+ * Configure PostCSS
299
+ */
300
+ postcss?: {
301
+ /**
302
+ * Additional PostCSS plugins that you would like to use.
303
+ * @default []
304
+ * @example
305
+ * ```
306
+ * import examplePlugin from 'postcss-example-plugin'
307
+ * export default {
308
+ * postcss: {
309
+ * plugins: [
310
+ * examplePlugin()
311
+ * ]
312
+ * }
313
+ * }
314
+ * ```
315
+ */
316
+ plugins?: Array<() => void>;
317
+
318
+ /**
319
+ * PostCSS options
320
+ * @default {}
321
+ * @example
322
+ * ```
323
+ * export default {
324
+ * postcss: {
325
+ * options: {
326
+ * map: true
327
+ * }
328
+ * }
329
+ * ```
330
+ */
331
+ options?: ProcessOptions;
332
+ };
198
333
 
199
334
  /**
200
- Define variables outside of the `page` object.
335
+ * [Pretty print](https://maizzle.com/docs/transformers/prettify) your HTML email code
336
+ * so that it's nicely indented and more human-readable.
337
+ *
338
+ * @default undefined
339
+ *
340
+ * @example
341
+ * ```
342
+ * export default {
343
+ * prettify: true,
344
+ * }
345
+ * ```
346
+ */
347
+ prettify?: boolean | CoreBeautifyOptions;
201
348
 
202
- @default {}
349
+ /**
350
+ * Batch-replace strings in your HTML.
351
+ *
352
+ * @default {}
353
+ *
354
+ * @example
355
+ * ```
356
+ * export default {
357
+ * replaceStrings: {
358
+ * 'replace this exact string': 'with this one',
359
+ * '\\s?data-src=""': '', // remove empty data-src="" attributes
360
+ * }
361
+ * }
362
+ * ```
363
+ */
364
+ replaceStrings?: Record<string, string>;
203
365
 
204
- @example
205
- ```
206
- module.exports = {
207
- locals: {
208
- company: {
209
- name: 'Spacely Space Sprockets, Inc.'
210
- }
211
- }
366
+ /**
367
+ * Configure local server settings.
368
+ */
369
+ server?: {
370
+ /**
371
+ * Port to run the local server on.
372
+ *
373
+ * @default 3000
374
+ */
375
+ port?: number;
376
+
377
+ /**
378
+ * Enable HMR-like local development.
379
+ * When enabled, Maizzle will watch for changes in your templates
380
+ * and inject them into the browser without a full page reload.
381
+ *
382
+ * @default true
383
+ */
384
+ hmr?: boolean;
385
+
386
+ /**
387
+ * Enable synchronized scrolling across devices.
388
+ *
389
+ * @default false
390
+ */
391
+ syncScroll?: boolean;
392
+
393
+ /**
394
+ * Paths to watch for changes.
395
+ * When a file in these paths changes, Maizzle will do a full rebuild.
396
+ *
397
+ * @default []
398
+ */
399
+ watch?: string[];
400
+
401
+ /**
402
+ * Toggle reporting compiled file size in the console.
403
+ *
404
+ * @default false
405
+ */
406
+ reportFileSize?: boolean;
212
407
  }
213
- ```
214
-
215
- `company` can be then used like this:
216
-
217
- ```
218
- <p>{{ company.name }}</p>
219
- ```
220
- */
221
- locals?: Record<string, unknown>;
222
408
 
223
409
  /**
224
410
  Configure custom parameters to append to URLs.
@@ -243,99 +429,125 @@ export default interface Config {
243
429
  urlParameters?: URLParametersConfig;
244
430
 
245
431
  /**
246
- Ensure that all your HEX colors inside `bgcolor` and `color` attributes are defined with six digits.
247
-
248
- @default true
249
-
250
- @example
251
- ```
252
- module.exports = {
253
- sixHex: false,
254
- }
255
- ```
432
+ * Enable or disable all Transformers.
433
+ *
434
+ * @default true
435
+ *
436
+ * @example
437
+ * ```
438
+ * export default {
439
+ * useTransformers: false,
440
+ * }
441
+ * ```
256
442
  */
257
- sixHex?: boolean;
443
+ useTransformers?: boolean;
258
444
 
259
445
  /**
260
- [Pretty print](https://maizzle.com/docs/transformers/prettify) your HTML email code so that it's nicely indented and more human-readable.
261
-
262
- @default undefined
263
-
264
- @example
265
- ```
266
- module.exports = {
267
- prettify: true,
268
- }
269
- ```
270
- */
271
- prettify?: boolean | CoreBeautifyOptions;
446
+ * Prevent widow words inside a tag by adding a `&nbsp;` between its last two words.
447
+ *
448
+ * @default
449
+ * {
450
+ * minWordCount: 3,
451
+ * attrName: 'prevent-widows'
452
+ * }
453
+ *
454
+ * @example
455
+ * ```
456
+ * export default {
457
+ * widowWords: {
458
+ * minWordCount: 5,
459
+ * },
460
+ * }
461
+ * ```
462
+ */
463
+ widowWords?: WidowWordsConfig;
272
464
 
273
465
  /**
274
- Minify the compiled HTML email code.
275
-
276
- @default false
277
-
278
- @example
279
- ```
280
- module.exports = {
281
- minify: true,
282
- }
283
- ```
466
+ * Runs after the Environment config has been computed, but before Templates are processed.
467
+ * Exposes the `config` object so you can further customize it.
468
+ *
469
+ * @default undefined
470
+ *
471
+ * @example
472
+ * ```
473
+ * export default {
474
+ * beforeCreate: async (config) => {
475
+ * // do something with `config`
476
+ * }
477
+ * }
478
+ * ```
284
479
  */
285
- minify?: boolean | MinifyConfig;
480
+ beforeCreate: beforeCreateType;
286
481
 
287
482
  /**
288
- Configure the Markdown parser.
483
+ * Runs after the Template's config has been computed, but just before it is compiled.
484
+ * It exposes the Template's HTML, its config, and the Maizzle `render` function.
485
+ * Must return the `html` string.
486
+ *
487
+ * @default undefined
488
+ *
489
+ * @example
490
+ * ```
491
+ * export default {
492
+ * beforeRender: async ({html, config, render}) => {
493
+ * // do something...
494
+ * return html;
495
+ * }
496
+ * }
497
+ * ```
498
+ */
499
+ beforeRender: beforeRenderType;
289
500
 
290
- @example
291
-
292
- ```
293
- module.exports = {
294
- markdown: {
295
- root: './', // A path relative to which markdown files are imported
296
- encoding: 'utf8', // Encoding for imported Markdown files
297
- markdownit: {}, // Options passed to markdown-it
298
- plugins: [], // Plugins for markdown-it
299
- }
300
- }
301
- ```
501
+ /**
502
+ * Runs after the Template has been compiled, but before any Transformers have been applied.
503
+ * Exposes the rendered `html` string and the `config`. Must return the `html` string.
504
+ *
505
+ * @default undefined
506
+ *
507
+ * @example
508
+ * ```
509
+ * export default {
510
+ * afterRender: async ({html, config}) => {
511
+ * // do something...
512
+ * return html;
513
+ * }
514
+ * }
515
+ * ```
302
516
  */
303
- markdown?: MarkdownConfig;
517
+ afterRender: afterRenderType;
304
518
 
305
519
  /**
306
- Batch-replace strings in your HTML.
307
-
308
- @default {}
309
-
310
- @example
311
- ```
312
- module.exports = {
313
- replaceStrings: {
314
- 'replace this exact string': 'with this one',
315
- '\\s?data-src=""': '', // remove empty data-src="" attributes
316
- }
317
- }
318
- ```
520
+ * Runs after all Transformers have been applied, just before the final HTML is returned.
521
+ * Exposes the rendered `html` string and the `config`. Must return the `html` string.
522
+ *
523
+ * @default undefined
524
+ *
525
+ * @example
526
+ * ```
527
+ * export default {
528
+ * afterTransformers: async ({html, config, render}) => {
529
+ * // do something...
530
+ * return html;
531
+ * }
532
+ * }
533
+ * ```
319
534
  */
320
- replaceStrings?: Record<string, string>;
535
+ afterTransformers: afterTransformersType;
321
536
 
322
537
  /**
323
- When compiling your email templates, Maizzle goes through a series of steps like generating a Template config, rendering, or applying Transformers.
324
- You can hook into the build process and manipulate it by using functions that run before or after some of these steps.
325
-
326
- @default {}
327
-
328
- @example
329
- ```
330
- module.exports = {
331
- events: {
332
- beforeRender: async (html, config) => {
333
- // do something with html and config
334
- return html;
335
- },
336
- }
337
- }
338
- ```
538
+ * Runs after all Templates have been compiled and output to disk.
539
+ * The files parameter will contain the paths to all the files inside the `build.templates.destination.path` directory.
540
+ *
541
+ * @default undefined
542
+ *
543
+ * @example
544
+ * ```
545
+ * export default {
546
+ * afterBuild: async ({files, config, render}) => {
547
+ * // do something...
548
+ * }
549
+ * }
550
+ * ```
339
551
  */
340
- events?: EventsConfig;
552
+ afterBuild: afterBuildType;
341
553
  }