@maizzle/framework 4.3.1 → 4.4.0-beta.2
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 +2 -3
- package/src/generators/posthtml/index.js +17 -24
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maizzle/framework",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0-beta.2",
|
|
4
4
|
"description": "Maizzle is a framework that helps you quickly build HTML emails with Tailwind CSS.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -59,14 +59,13 @@
|
|
|
59
59
|
"posthtml": "^0.16.6",
|
|
60
60
|
"posthtml-attrs-parser": "^0.1.1",
|
|
61
61
|
"posthtml-base-url": "^1.0.1",
|
|
62
|
+
"posthtml-component": "^1.0.0-beta.16",
|
|
62
63
|
"posthtml-content": "^0.1.0",
|
|
63
|
-
"posthtml-expressions": "^1.8.1",
|
|
64
64
|
"posthtml-extend": "^0.6.0",
|
|
65
65
|
"posthtml-extra-attributes": "^1.0.0",
|
|
66
66
|
"posthtml-fetch": "^2.2.0",
|
|
67
67
|
"posthtml-markdownit": "^1.3.0",
|
|
68
68
|
"posthtml-match-helper": "^1.0.3",
|
|
69
|
-
"posthtml-modules": "^0.9.0",
|
|
70
69
|
"posthtml-mso": "^1.0.4",
|
|
71
70
|
"posthtml-postcss-merge-longhand": "^1.0.2",
|
|
72
71
|
"posthtml-safe-class-names": "^2.0.0",
|
|
@@ -3,23 +3,17 @@ const posthtml = require('posthtml')
|
|
|
3
3
|
const {get, merge} = require('lodash')
|
|
4
4
|
const fetch = require('posthtml-fetch')
|
|
5
5
|
const layouts = require('posthtml-extend')
|
|
6
|
-
const
|
|
6
|
+
const components = require('posthtml-component')
|
|
7
7
|
const defaultConfig = require('./defaultConfig')
|
|
8
|
-
const expressions = require('posthtml-expressions')
|
|
9
8
|
|
|
10
9
|
module.exports = async (html, config) => {
|
|
11
10
|
const layoutsOptions = get(config, 'build.layouts', {})
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
// Fake `from` option so we can reference modules relatively
|
|
15
|
-
const modulesRoot = modulesOptions.root || './'
|
|
16
|
-
const modulesFrom = modulesOptions.from || `${modulesRoot}/fake`
|
|
11
|
+
const componentsOptions = get(config, 'build.components', {})
|
|
12
|
+
const expressionsOptions = merge({strictMode: false}, get(config, 'build.posthtml.expressions', {}))
|
|
17
13
|
|
|
18
14
|
const posthtmlOptions = merge(defaultConfig, get(config, 'build.posthtml.options', {}))
|
|
19
15
|
const posthtmlPlugins = get(config, 'build.posthtml.plugins', [])
|
|
20
16
|
|
|
21
|
-
const expressionsOptions = merge({strictMode: false}, get(config, 'build.posthtml.expressions', {}))
|
|
22
|
-
|
|
23
17
|
const locals = merge(
|
|
24
18
|
get(expressionsOptions, 'locals', {}),
|
|
25
19
|
get(config, 'locals', {}),
|
|
@@ -37,7 +31,6 @@ module.exports = async (html, config) => {
|
|
|
37
31
|
|
|
38
32
|
return posthtml([
|
|
39
33
|
fetchPlugin,
|
|
40
|
-
expressions({...expressionsOptions, locals}),
|
|
41
34
|
layouts(
|
|
42
35
|
merge(
|
|
43
36
|
{
|
|
@@ -47,20 +40,20 @@ module.exports = async (html, config) => {
|
|
|
47
40
|
layoutsOptions
|
|
48
41
|
)
|
|
49
42
|
),
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
43
|
+
components(
|
|
44
|
+
merge(
|
|
45
|
+
{
|
|
46
|
+
root: componentsOptions.root || './',
|
|
47
|
+
folders: ['src/components', 'src/layouts', 'src/templates'],
|
|
48
|
+
tag: 'component',
|
|
49
|
+
attribute: 'src',
|
|
50
|
+
yield: 'content',
|
|
51
|
+
propsAttribute: 'locals',
|
|
52
|
+
expressions: {...expressionsOptions, locals}
|
|
53
|
+
},
|
|
54
|
+
componentsOptions
|
|
55
|
+
)
|
|
56
|
+
),
|
|
64
57
|
...posthtmlPlugins
|
|
65
58
|
])
|
|
66
59
|
.process(html, {...posthtmlOptions})
|