@maizzle/framework 5.2.0 → 6.0.0-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.
- package/CHANGELOG.md +24 -0
- package/package.json +7 -6
- package/src/posthtml/index.js +13 -5
- package/src/posthtml/plugins/combineMediaQueries.js +42 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,30 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
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
6
|
|
|
7
|
+
## [5.2.1] - 2025-06-25
|
|
8
|
+
|
|
9
|
+
This is just a maintenance release to update dependencies.
|
|
10
|
+
|
|
11
|
+
- build(deps): bump posthtml-base-url from 3.1.7 to 3.1.8 9144f5d
|
|
12
|
+
- fix: specify correct posthtml-base-url minimum version f2f8434
|
|
13
|
+
- build(deps): bump posthtml-url-parameters from 3.1.2 to 3.1.3 03a33ea
|
|
14
|
+
- build(deps): bump posthtml-markdownit from 3.1.1 to 3.1.2 142002c
|
|
15
|
+
- build(deps): bump posthtml-fetch from 4.0.2 to 4.0.3 ebbdfd7
|
|
16
|
+
- build(deps): bump posthtml-extra-attributes from 3.1.3 to 3.1.4 fc578ec
|
|
17
|
+
- build(deps): bump posthtml-postcss-merge-longhand from 3.1.3 to 3.1.4 3b10c6f
|
|
18
|
+
|
|
19
|
+
## [5.2.0] - 2025-06-24
|
|
20
|
+
|
|
21
|
+
This release adds support for configuring multiple static asset folders, allowing you to specify multiple directories from which static assets will be copied to the build output.
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
- feature: support an array of objects with source and destination 13d4379
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- fix: ignoring production folders as static files sources for server a3e4044
|
|
30
|
+
|
|
7
31
|
## [5.1.0] - 2025-06-13
|
|
8
32
|
|
|
9
33
|
This release adds support for using Tailwind CSS color opacity modifiers in Gmail by automatically converting modern rgb/a syntax to the legacy, comma-separated syntax.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maizzle/framework",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0-0",
|
|
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",
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
],
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@maizzle/cli": "^2.0.0",
|
|
54
|
+
"@tailwindcss/postcss": "^4.1.11",
|
|
54
55
|
"cheerio": "^1.0.0",
|
|
55
56
|
"chokidar": "^3.6.0",
|
|
56
57
|
"cli-table3": "^0.6.5",
|
|
@@ -70,13 +71,13 @@
|
|
|
70
71
|
"pathe": "^2.0.0",
|
|
71
72
|
"postcss": "^8.4.49",
|
|
72
73
|
"postcss-calc": "^10.0.2",
|
|
73
|
-
"postcss-color-functional-notation": "^7.0.10",
|
|
74
74
|
"postcss-css-variables": "^0.19.0",
|
|
75
|
-
"postcss-
|
|
75
|
+
"postcss-lightningcss": "^1.0.1",
|
|
76
76
|
"postcss-safe-parser": "^7.0.0",
|
|
77
|
+
"postcss-sort-media-queries": "^5.2.0",
|
|
77
78
|
"posthtml": "^0.16.6",
|
|
78
79
|
"posthtml-attrs-parser": "^1.1.1",
|
|
79
|
-
"posthtml-base-url": "^3.1.
|
|
80
|
+
"posthtml-base-url": "^3.1.8",
|
|
80
81
|
"posthtml-component": "^2.1.0",
|
|
81
82
|
"posthtml-content": "^2.1.0",
|
|
82
83
|
"posthtml-expressions": "^1.11.4",
|
|
@@ -93,11 +94,11 @@
|
|
|
93
94
|
"posthtml-widows": "^1.0.0",
|
|
94
95
|
"pretty": "^2.0.0",
|
|
95
96
|
"string-strip-html": "^13.4.8",
|
|
96
|
-
"tailwindcss": "^
|
|
97
|
+
"tailwindcss": "^4.1.11",
|
|
97
98
|
"ws": "^8.18.0"
|
|
98
99
|
},
|
|
99
100
|
"devDependencies": {
|
|
100
|
-
"@biomejs/biome": "2.
|
|
101
|
+
"@biomejs/biome": "2.1.1",
|
|
101
102
|
"@types/js-beautify": "^1.14.3",
|
|
102
103
|
"@types/markdown-it": "^14.1.2",
|
|
103
104
|
"@vitest/coverage-v8": "^3.0.4",
|
package/src/posthtml/index.js
CHANGED
|
@@ -10,14 +10,14 @@ import posthtmlPostcss from 'posthtml-postcss'
|
|
|
10
10
|
import expandLinkTag from './plugins/expandLinkTag.js'
|
|
11
11
|
import envAttributes from './plugins/envAttributes.js'
|
|
12
12
|
import { getPosthtmlOptions } from './defaultConfig.js'
|
|
13
|
+
import combineMediaQueries from './plugins/combineMediaQueries.js'
|
|
13
14
|
|
|
14
15
|
// PostCSS
|
|
15
|
-
import tailwindcss from 'tailwindcss'
|
|
16
|
+
import tailwindcss from '@tailwindcss/postcss'
|
|
16
17
|
import postcssCalc from 'postcss-calc'
|
|
17
|
-
import postcssImport from 'postcss-import'
|
|
18
18
|
import cssVariables from 'postcss-css-variables'
|
|
19
19
|
import postcssSafeParser from 'postcss-safe-parser'
|
|
20
|
-
import
|
|
20
|
+
import postcssLightningCss from 'postcss-lightningcss'
|
|
21
21
|
|
|
22
22
|
import defaultComponentsConfig from './defaultComponentsConfig.js'
|
|
23
23
|
|
|
@@ -33,11 +33,18 @@ export async function process(html = '', config = {}) {
|
|
|
33
33
|
|
|
34
34
|
const postcssPlugin = posthtmlPostcss(
|
|
35
35
|
[
|
|
36
|
-
postcssImport(),
|
|
37
36
|
tailwindcss(get(config, 'css.tailwind', {})),
|
|
38
37
|
resolveCSSProps !== false && cssVariables(resolveCSSProps),
|
|
39
38
|
resolveCalc !== false && postcssCalc(resolveCalc),
|
|
40
|
-
|
|
39
|
+
postcssLightningCss({
|
|
40
|
+
lightningcssOptions: {
|
|
41
|
+
errorRecovery: true,
|
|
42
|
+
minify: false,
|
|
43
|
+
targets: {
|
|
44
|
+
ie: 1,
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}),
|
|
41
48
|
...get(config, 'postcss.plugins', []),
|
|
42
49
|
],
|
|
43
50
|
merge(
|
|
@@ -114,6 +121,7 @@ export async function process(html = '', config = {}) {
|
|
|
114
121
|
postcssPlugin,
|
|
115
122
|
envTags(config.env),
|
|
116
123
|
envAttributes(config.env),
|
|
124
|
+
combineMediaQueries(get(config, 'css.combineMediaQueries', { sort: 'mobile-first' })),
|
|
117
125
|
...get(
|
|
118
126
|
config,
|
|
119
127
|
'posthtml.plugins.after',
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import postcss from 'postcss'
|
|
2
|
+
import sortMediaQueries from 'postcss-sort-media-queries'
|
|
3
|
+
|
|
4
|
+
const plugin = (options = {}) => tree => {
|
|
5
|
+
const process = node => {
|
|
6
|
+
// Check if this is a style tag with content
|
|
7
|
+
if (node.tag === 'style' && node.content && Array.isArray(node.content)) {
|
|
8
|
+
// Get the CSS content from the style tag
|
|
9
|
+
const cssContent = node.content.join('')
|
|
10
|
+
|
|
11
|
+
if (cssContent.trim()) {
|
|
12
|
+
try {
|
|
13
|
+
// Create PostCSS processor for combining and sorting media queries
|
|
14
|
+
const processor = postcss([
|
|
15
|
+
sortMediaQueries({
|
|
16
|
+
sort: options.sort || 'mobile-first',
|
|
17
|
+
...options
|
|
18
|
+
})
|
|
19
|
+
])
|
|
20
|
+
|
|
21
|
+
// Process CSS synchronously
|
|
22
|
+
const result = processor.process(cssContent, {
|
|
23
|
+
from: undefined,
|
|
24
|
+
to: undefined
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
// Replace the content with processed CSS
|
|
28
|
+
node.content = [result.css]
|
|
29
|
+
} catch (error) {
|
|
30
|
+
// If processing fails, leave the content unchanged
|
|
31
|
+
console.warn('Failed to process media queries:', error.message)
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return node
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return tree.walk(process)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export default plugin
|