@maizzle/framework 5.0.5 → 5.0.7

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/CHANGELOG.md ADDED
@@ -0,0 +1,584 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [5.0.7] - 2025-04-03
8
+
9
+ ### Fixed
10
+
11
+ - fixed an issue with `alt` attribute values being overwritten f083636
12
+
13
+ ### Changed
14
+
15
+ - chore: add license and changelog to dist 4685745
16
+ - chore: update types a5c08ce
17
+
18
+ ## [5.0.6] - 2025-03-12
19
+
20
+ ### Fixed
21
+
22
+ - fix: skip vml tags when replacing sources inside mso comments e1a867f
23
+
24
+ https://github.com/maizzle/framework/compare/v5.0.5...v5.0.6
25
+
26
+ ## [5.0.5] - 2025-03-10
27
+
28
+ ### Fixed
29
+
30
+ - fix: broad regex when checking for selectors to preserve 97073e4
31
+
32
+ https://github.com/maizzle/framework/compare/v5.0.4...v5.0.5
33
+
34
+ ## [5.0.4] - 2025-03-10
35
+
36
+ ### Fixed
37
+
38
+ - fix: handling of pseudo-classes when inlining css c0b7457
39
+
40
+ https://github.com/maizzle/framework/compare/v5.0.3...v5.0.4
41
+
42
+ ## [5.0.3] - 2025-03-10
43
+
44
+ ### Fixed
45
+
46
+ - fix: handling of base64 encoded css values in `preferUnitlessValues` 2e0b456
47
+
48
+ https://github.com/maizzle/framework/compare/v5.0.2...v5.0.3
49
+
50
+ ## [5.0.2] - 2025-03-04
51
+
52
+ ### Fixed
53
+
54
+ - fix: handle baseUrl inside mso comments for non-vml tags 935d4fb
55
+ - build(deps): bump posthtml-base-url from 3.1.6 to 3.1.7 35306ff
56
+ - fix: export correct generatePlaintext type definition 0dc868a
57
+ - fix: plaintext files output path 9fba8f7
58
+ - fix: output files at root of output.path bdc66b6
59
+ - fix: ensure node exists 85c4685
60
+
61
+ https://github.com/maizzle/framework/compare/v5.0.1...v5.0.2
62
+
63
+ ## [5.0.1] - 2025-02-24
64
+
65
+ ### Fixed
66
+
67
+ - fixed an issue with HMR in workspaces and pnpm projects
68
+ - fixed an issue preventing `<fetch>` from working
69
+
70
+ ### Changed
71
+
72
+ - updated dependencies (see compare link below)
73
+
74
+ https://github.com/maizzle/framework/compare/v5.0.0...v5.0.1
75
+
76
+ ## [5.0.0] - 2024-12-16
77
+
78
+ ## Maizzle 5
79
+
80
+ Maizzle 5 comes with awesome new features like:
81
+
82
+ - New dev server with HMR*
83
+ - 10x faster local dev
84
+ - Streamlined configs
85
+ - Streamlined Tailwind CSS
86
+ - `npx create-maizzle`
87
+ - Revamped CLI
88
+ - Content source globs
89
+ - Updated template
90
+ - Better modern CSS support (vars, calc)
91
+ - Improved type definitions
92
+ - New tags (`<env:?>`, `<template>`)
93
+ - Enhanced events/hooks
94
+
95
+ Maizzle 5 requires Node.js 18.20+
96
+
97
+ \* Hot Markup Replacement&trade;
98
+
99
+ Upgrade guide: https://maizzle.com/docs/upgrade-guide
100
+
101
+ ## [5.0.0-beta.38] - 2024-11-30
102
+
103
+ ### Fixed
104
+
105
+ - fix: `attributes.remove` type d10dc05
106
+ - fix: include user-defined `components.fileExtension` in list of component file extensions to scan for 005e2ee
107
+
108
+ ### Changed
109
+
110
+ - refactor: access `baseURL` config only once d42f405
111
+
112
+ ## [5.0.0-beta.37] - 2024-11-29
113
+
114
+ ### Fixed
115
+
116
+ - fix: use correct output file extensions 5c9421b
117
+
118
+ ## [5.0.0-beta.36] - 2024-11-29
119
+
120
+ ### Added
121
+
122
+ - build(deps): use posthtml-component@next f725e50
123
+
124
+ This release uses `posthtml-component@next` which now supports `fileExtension` as an `Array` of file extensions to use when scanning for components.
125
+
126
+ The goal is to allow using templates with multiple file extensions, as right now only one extension can be used.
127
+
128
+ So for example you could have a project for Woocommerce emails with this structure:
129
+
130
+ ```sh
131
+ emails
132
+ ├── html
133
+ │ └── order-received.html
134
+ └── woocommerce
135
+ └── order-received.php
136
+ ```
137
+
138
+ ### Fixed
139
+
140
+ - fix: server start time logging ad4e8e0
141
+
142
+ ## [5.0.0-beta.35] - 2024-11-28
143
+
144
+ ### Fixed
145
+
146
+ - fix: css type declarations e234e76
147
+ - chore: add `build.current` to server routes a9160e2
148
+
149
+ ### Changed
150
+
151
+ - build: update dependencies 596f4b2
152
+
153
+ ## [5.0.0-beta.34] - 2024-11-26
154
+
155
+ ### Added
156
+
157
+ - feat: add `css.resolveCalc` option cde20d4
158
+
159
+ ### Changed
160
+
161
+ - chore: remove duplicate declaration removal 619ef35
162
+
163
+ ## [5.0.0-beta.33] - 2024-11-26
164
+
165
+ ### Added
166
+
167
+ - feat: add `css.resolveProps` option 097e8d4
168
+
169
+ ### Fixed
170
+
171
+ - fix: add back build.current in `maizzle serve` 9b53fcb
172
+
173
+ ### Changed
174
+
175
+ - refactor: remove `beforeCreate` event in `maizzle serve` 653ec48
176
+
177
+ ## [5.0.0-beta.32] - 2024-11-20
178
+
179
+ ### Added
180
+
181
+ - feat: scan additional components folders 38e0ed4
182
+
183
+ ## [5.0.0-beta.31] - 2024-11-19
184
+
185
+ ### Added
186
+
187
+ - feat: add types for safelist options 6e1610f
188
+
189
+ ## [5.0.0-beta.30] - 2024-11-19
190
+
191
+ ### Added
192
+
193
+ - feat: `preservedSelectors` option for inliner 3598cf7
194
+
195
+ ### Changed
196
+
197
+ - refactor: rename comb option to `safelist` 89d7051
198
+ - refactor: rename `preservedSelectors` to `safelist` 58f2e9c
199
+ - build(deps): update vitest 2917c80
200
+
201
+ ## [5.0.0-beta.29] - 2024-11-17
202
+
203
+ ### Fixed
204
+
205
+ - fix: list of templates to compile 9688ff9
206
+ - fix: copy source files to destination 0b4caab
207
+
208
+ ## [5.0.0-beta.28] - 2024-11-16
209
+
210
+ ### Changed
211
+
212
+ - build(deps): update dependencies d24e49a
213
+ - refactor: use `posthtml-widows` instead of `string-remove-widows ` bccbd7b
214
+
215
+ ## [5.0.0-beta.27] - 2024-11-04
216
+
217
+ ### Fixed
218
+
219
+ - fix: default posthtml options 6a5249b
220
+
221
+ ### Changed
222
+
223
+ - refactor: widow words default attribute name 01623cc
224
+
225
+ ## [5.0.0-beta.26] - 2024-09-28
226
+
227
+ ### Fixed
228
+
229
+ - fix: preserve email client target selectors when inlining 24a1a9b
230
+ - fix: using style[data-embed] c735364
231
+ - test: generates plaintext file e9fb327
232
+
233
+ ### Changed
234
+
235
+ - build(deps): update dependencies 1d6a684
236
+ - refactor: transformers tests a21172a
237
+ - refactor: transformer order 4a24a9b
238
+
239
+ ## [5.0.0-beta.25] - 2024-09-10
240
+
241
+ ### Added
242
+
243
+ - feat: toggle nested folders in dev index page 368f04b
244
+
245
+ ### Fixed
246
+
247
+ - fix: config object in beforeCreate event 81288f8
248
+ - fix: encode index URI for special characters d7053a8
249
+ - fix: error when filename has a space 5ca34b5
250
+
251
+ ### Changed
252
+
253
+ - chore: update markdown type definition 9dd5708
254
+ - feat: return early in markdown transformer daea021
255
+
256
+ https://github.com/maizzle/framework/compare/v5.0.0-beta.24...v5.0.0-beta.25
257
+
258
+ ## [5.0.0-beta.24] - 2024-08-28
259
+
260
+ ### Fixed
261
+
262
+ - synchronized scrolling 619fb51
263
+ - checking `<template>` tag for `preserve` attribute f957568
264
+ - return tree from `prettify` transformer 1d15fc5
265
+ - use correct config object in events e3a4b36
266
+
267
+ ### Changed
268
+
269
+ - move expressions config object to root 43a1d76
270
+ - **[breaking]** bump required node version to `18.20` b305d56
271
+ - updated dependencies e42050d
272
+
273
+ https://github.com/maizzle/framework/compare/v5.0.0-beta.23...v5.0.0-beta.24
274
+
275
+ ## [5.0.0-beta.23] - 2024-08-19
276
+
277
+ ### Fixed
278
+
279
+ - plaintext generation 571c1cf
280
+
281
+ ### Changed
282
+
283
+ - update inline type dec0dd5
284
+ - bump `juice` to `10.0.1` 973a820
285
+ - updated index page b8e6b83
286
+
287
+ https://github.com/maizzle/framework/compare/v5.0.0-beta.22...v5.0.0-beta.23
288
+
289
+ ## [5.0.0-beta.22] - 2024-08-19
290
+
291
+ ### Changed
292
+
293
+ - downgrade `cheerio` to `rc.12` d9e2924
294
+
295
+ ## [5.0.0-beta.21] - 2024-08-12
296
+
297
+ ### Fixed
298
+
299
+ - update `cheerio` import path dca3fb6
300
+
301
+ ## [5.0.0-beta.20] - 2024-08-01
302
+
303
+ ### Fixed
304
+
305
+ - create correct build output paths 398705c
306
+
307
+ ### Changed
308
+
309
+ - add type for `build.output.from` 49b1955
310
+
311
+ https://github.com/maizzle/framework/compare/v5.0.0-beta.19...v5.0.0-beta.20
312
+
313
+ ## [5.0.0-beta.19] - 2024-08-01
314
+
315
+ ### Added
316
+
317
+ - add types for `build.current` 18c75f7
318
+ - 404 page for local dev ce9416f
319
+
320
+ ### Fixed
321
+
322
+ - locals passed to fetch plugin cca8060
323
+ - serve static files added to watched paths after server was started ab7eb6d
324
+ - wait for file contents to be written before reading them 8c9324c
325
+ - posthtml expression config 1f95625
326
+
327
+ ### Changed
328
+
329
+ - start dev server spinner sooner 566dc54
330
+ - watch maizzle `.ts` config files cdbf3dd
331
+ - watch more config file extensions 45575fb
332
+
333
+ https://github.com/maizzle/framework/compare/v5.0.0-beta.18...v5.0.0-beta.19
334
+
335
+ ## [5.0.0-beta.18] - 2024-07-30
336
+
337
+ ### Added
338
+
339
+ - allow capturing groups replacement in `replaceStrings` transformer 6a381b7
340
+
341
+ ### Changed
342
+
343
+ - revert exposing posthtml compiler in events 50eb0ff
344
+ - revert automatically setting `baseURL` dd6c321
345
+ - update github workflow 657cba3
346
+
347
+ https://github.com/maizzle/framework/compare/v5.0.0-beta.17...v5.0.0-beta.18
348
+
349
+
350
+ ## [5.0.0-beta.17] - 2024-07-26
351
+
352
+ ### Fixed
353
+
354
+ - `env` tags and attributes in components bf33ee8
355
+
356
+ ### Changed
357
+
358
+ - update events types 0847b46
359
+ - export `fetch` tag config types b7e3a64
360
+ - define `fetch` key at root of config 0acd06b
361
+
362
+ https://github.com/maizzle/framework/compare/v5.0.0-beta.16...v5.0.0-beta.17
363
+
364
+ ## [5.0.0-beta.16] - 2024-07-25
365
+
366
+ ### Changed
367
+
368
+ - type definitions 6e59b4f
369
+ - updated dependencies a96bf00
370
+
371
+ https://github.com/maizzle/framework/compare/v5.0.0-beta.15...v5.0.0-beta.16
372
+
373
+ ## [5.0.0-beta.15] - 2024-07-25
374
+
375
+ ### Added
376
+
377
+ - add `<fetch>` tag 7ec603b
378
+
379
+ ### Fixed
380
+
381
+ - serve templates added after the watcher started cc58423
382
+ - make keys optional in type definitions faf910b
383
+
384
+ https://github.com/maizzle/framework/compare/v5.0.0-beta.14...v5.0.0-beta.15
385
+
386
+ ## [5.0.0-beta.14] - 2024-07-24
387
+
388
+ ### Fixed
389
+
390
+ - don't import transformers in build command cf8acef
391
+
392
+ ## [5.0.0-beta.13] - 2024-07-24
393
+
394
+ ### Fixed
395
+
396
+ - pass posthtml options to parse function d048b08
397
+
398
+ ### Changed
399
+
400
+ - update `urlParameters` type definition 8ff5e1c
401
+ - update config types 504e158
402
+ - update build config type definitions 2e662da
403
+ - update events type definitions e4ed0ed
404
+ - revert exposing transformers in events 9f0797c
405
+ - update transformers tests 41e864b
406
+ - ensure `addAttribute` adds default img attribute with no value b36d92d
407
+
408
+ https://github.com/maizzle/framework/compare/v5.0.0-beta.12...v5.0.0-beta.13
409
+
410
+ ## [5.0.0-beta.12] - 2024-07-23
411
+
412
+ ### Added
413
+
414
+ - expose front matter object in events 9603739
415
+
416
+ ### Changed
417
+
418
+ - events type definitions 9858437
419
+ - use posthtml default config when parsing front matter dca806c
420
+
421
+ https://github.com/maizzle/framework/compare/v5.0.0-beta.11...v5.0.0-beta.12
422
+
423
+ ## [5.0.0-beta.11] - 2024-07-23
424
+
425
+ ### Added
426
+
427
+ - allow customizing the spinner when developing locally 7d06117
428
+
429
+ ### Fixed
430
+
431
+ - use components options from user config 3cd3096
432
+
433
+ ### Changed
434
+
435
+ - remove unused imports 430908d
436
+
437
+ https://github.com/maizzle/framework/compare/v5.0.0-beta.10...v5.0.0-beta.11
438
+
439
+ ## [5.0.0-beta.10] - 2024-07-22
440
+
441
+ ### Fixed
442
+
443
+ - copying static assets 43c28b6
444
+
445
+ Fixed an issue with static assets being copied twice if they were nested in the `static.source` directory.
446
+
447
+ For example this:
448
+
449
+ ```sh
450
+ src/images
451
+ /v1/hero.jpg
452
+ logo.jpg
453
+ ```
454
+
455
+ ... was copied over to this:
456
+
457
+ ```sh
458
+ build_production/images
459
+ /v1/hero.jpg
460
+ hero.jpg # this shouldn't be here!
461
+ logo.jpg
462
+ ```
463
+
464
+ https://github.com/maizzle/framework/compare/v5.0.0-beta.9...v5.0.0-beta.10
465
+
466
+
467
+ ## [5.0.0-beta.9] - 2024-07-22
468
+
469
+ ### Changed
470
+
471
+ - update posthtml-base-url 7362db8
472
+ - update dependencies 11d30b7
473
+ - update morphdom to 2.7.4 9a5b7cd
474
+
475
+ https://github.com/maizzle/framework/compare/v5.0.0-beta.8...v5.0.0-beta.9
476
+
477
+ ## [5.0.0-beta.8] - 2024-07-20
478
+
479
+ ### Added
480
+
481
+ - `<template>` tag 9ae94ee
482
+ - built templates count ff28808
483
+
484
+ ### Fixed
485
+
486
+ - inlining css values containing colons 66a5e34
487
+ - loose check for `env` tags cf1d875
488
+ - srcset `baseUrl` path joins eb49bd6
489
+
490
+ ### Changed
491
+
492
+ - update `env` tag test 3e34c20
493
+
494
+ https://github.com/maizzle/framework/compare/v5.0.0-beta.7...v5.0.0-beta.8
495
+
496
+ ## [5.0.0-beta.7] - 2024-07-19
497
+
498
+ ### Added
499
+
500
+ - add support for `<env:...>` tags aedc861
501
+
502
+ https://github.com/maizzle/framework/compare/v5.0.0-beta.6...v5.0.0-beta.7
503
+
504
+ ## [5.0.0-beta.6] - 2024-07-19
505
+
506
+ ### Added
507
+
508
+ - support more attribute names for preventing inlining ee0523e
509
+
510
+ https://github.com/maizzle/framework/compare/v5.0.0-beta.5...v5.0.0-beta.6
511
+
512
+ ## [5.0.0-beta.5] - 2024-07-18
513
+
514
+ ### Added
515
+
516
+ - environment-based attribute values d129e6a
517
+
518
+ https://github.com/maizzle/framework/compare/v5.0.0-beta.4...v5.0.0-beta.5
519
+
520
+ ## [5.0.0-beta.4] - 2024-07-18
521
+
522
+ ### Added
523
+
524
+ - expose transformers to `afterBuild` event b1154e1
525
+ - expose posthtml and transformers to `render` events ae1227a
526
+
527
+ ### Fixed
528
+
529
+ - export types for `build.expressions` 8175e1b
530
+ - actually export transformers 66d5872
531
+ - `build.content` type definition 98ab301
532
+ - missing calc precision param d128cd7
533
+
534
+ ### Changed
535
+
536
+ - update events tests 9227365
537
+ - build command 9f84e35
538
+ - set `resolveCalc` precision to `2` df006eb
539
+
540
+ https://github.com/maizzle/framework/compare/v5.0.0-beta.3...v5.0.0-beta.4
541
+
542
+ ## [5.0.0-beta.3] - 2024-07-16
543
+
544
+ ### Added
545
+
546
+ - add release script 56c78d8
547
+
548
+ ### Changed
549
+
550
+ - `safeClassNames` option name 8dceb20
551
+ - update dependencies d223968
552
+
553
+ https://github.com/maizzle/framework/compare/v5.0.0-beta.2...v5.0.0-beta.3
554
+
555
+ ## [5.0.0-beta.2] - 2024-07-15
556
+
557
+ ### Fixed
558
+
559
+ - morphdom path e2bb669
560
+
561
+ ### Changed
562
+
563
+ - force reload if no websocket support a79a50c
564
+
565
+ https://github.com/maizzle/framework/compare/v5.0.0-beta.1...v5.0.0-beta.2
566
+
567
+ ## [5.0.0-beta.1] - 2024-07-15
568
+
569
+ ### Fixed
570
+
571
+ - git conflicts fd73020
572
+
573
+ ### Changed
574
+
575
+ - bump posthtml-attrs-parser from 1.1.0 to 1.1.1 2140655
576
+ - bump posthtml-markdownit from 1.3.1 to 3.1.0 6575567
577
+ - bump posthtml-content from 1.0.3 to 2.1.0 fad8740
578
+ - bump posthtml-mso from 2.0.1 to 3.1.0 ca2df93
579
+ - bump posthtml-postcss-merge-longhand from 3.1.1 to 3.1.2 925f21a
580
+ - bump postcss from 8.4.38 to 8.4.39 547659a
581
+
582
+ https://github.com/maizzle/framework/compare/v4.8.8...v5.0.0-beta.1
583
+
584
+ ## [5.0.0-beta.0] - 2024-07-15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maizzle/framework",
3
- "version": "5.0.5",
3
+ "version": "5.0.7",
4
4
  "description": "Maizzle is a framework that helps you quickly build HTML emails with Tailwind CSS.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -16,7 +16,9 @@
16
16
  "files": [
17
17
  "bin",
18
18
  "src",
19
- "types"
19
+ "types",
20
+ "LICENSE",
21
+ "CHANGELOG.md"
20
22
  ],
21
23
  "publishConfig": {
22
24
  "access": "public"
@@ -103,12 +103,16 @@ const rewriteVMLs = (html, url) => {
103
103
  * Handle other sources inside MSO comments
104
104
  */
105
105
 
106
- // Make a | pipe-separated list of all the default tags and use it to create a regex
106
+ // Make a pipe-separated list of all the default tags and use it to create a regex
107
107
  const uniqueSourceAttributes = [
108
108
  ...new Set(Object.values(defaultTags).flatMap(Object.keys))
109
109
  ].join('|')
110
110
 
111
- const sourceAttrRegex = new RegExp(`\\b(${uniqueSourceAttributes})="([^"]+)"`, 'g')
111
+ /**
112
+ * This regex uses a negative lookbehind to avoid matching VML elements
113
+ * like <v:image> and <v:fill>, which are already handled above.
114
+ */
115
+ const sourceAttrRegex = new RegExp(`(?<!<v:image|fill[^>]*]*)\\b(${uniqueSourceAttributes})="([^"]+)"`, 'g')
112
116
 
113
117
  // Replace all the source attributes inside MSO comments
114
118
  html = html.replace(/<!--\[if [^\]]+\]>[\s\S]*?<!\[endif\]-->/g, (msoBlock) => {
package/types/build.d.ts CHANGED
@@ -142,7 +142,7 @@ export default interface BuildConfig {
142
142
  * ```
143
143
  * {
144
144
  path: {
145
- root: 'build_production',
145
+ root: '',
146
146
  dir: 'build_production',
147
147
  base: 'transactional.html',
148
148
  ext: '.html',
@@ -151,7 +151,7 @@ export default interface BuildConfig {
151
151
  }
152
152
  * ```
153
153
  */
154
- current?: {
154
+ readonly current?: {
155
155
  path?: {
156
156
  root: string;
157
157
  dir: string;
package/types/events.d.ts CHANGED
@@ -33,7 +33,7 @@ export default interface Events {
33
33
  * @example
34
34
  * ```
35
35
  * export default {
36
- * beforeRender: async ({html, matter, config, posthtml}) => {
36
+ * beforeRender: async ({html, matter, config}) => {
37
37
  * // do something...
38
38
  * return html;
39
39
  * }
@@ -67,7 +67,7 @@ export default interface Events {
67
67
  * @example
68
68
  * ```
69
69
  * export default {
70
- * afterRender: async async ({html, matter, config, posthtml}) => {
70
+ * afterRender: async async ({html, matter, config}) => {
71
71
  * // do something...
72
72
  * return html;
73
73
  * }
@@ -101,7 +101,7 @@ export default interface Events {
101
101
  * @example
102
102
  * ```
103
103
  * export default {
104
- * afterTransformers: async ({html, matter, config, posthtml}) => {
104
+ * afterTransformers: async ({html, matter, config}) => {
105
105
  * // do something...
106
106
  * return html;
107
107
  * }