@maizzle/framework 4.4.0-beta.5 → 4.4.0-beta.6
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/README.md
CHANGED
|
@@ -34,9 +34,9 @@ The Maizzle framework is open-sourced software licensed under the [MIT license](
|
|
|
34
34
|
|
|
35
35
|
[npm]: https://www.npmjs.com/package/@maizzle/framework
|
|
36
36
|
[npm-stats]: https://npm-stat.com/charts.html?package=%40maizzle%2Fframework&from=2019-03-27
|
|
37
|
-
[npm-version-shield]: https://img.shields.io/npm/v/@maizzle/framework.svg
|
|
38
|
-
[npm-stats-shield]: https://img.shields.io/npm/dt/@maizzle/framework.svg?
|
|
37
|
+
[npm-version-shield]: https://img.shields.io/npm/v/@maizzle/framework.svg
|
|
38
|
+
[npm-stats-shield]: https://img.shields.io/npm/dt/@maizzle/framework.svg?color=4f46e5
|
|
39
39
|
[github-ci]: https://github.com/maizzle/framework/actions
|
|
40
|
-
[github-ci-shield]: https://
|
|
40
|
+
[github-ci-shield]: https://github.com/maizzle/framework/actions/workflows/nodejs.yml/badge.svg
|
|
41
41
|
[license]: ./LICENSE
|
|
42
|
-
[license-shield]: https://img.shields.io/npm/l/@maizzle/framework.svg?
|
|
42
|
+
[license-shield]: https://img.shields.io/npm/l/@maizzle/framework.svg?color=0e9f6e
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maizzle/framework",
|
|
3
|
-
"version": "4.4.0-beta.
|
|
3
|
+
"version": "4.4.0-beta.6",
|
|
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",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@maizzle/cli": "^1.5.1",
|
|
44
44
|
"autoprefixer": "^10.4.13",
|
|
45
|
-
"browser-sync": "^2.
|
|
45
|
+
"browser-sync": "^2.27.11",
|
|
46
46
|
"color-shorthand-hex-to-six-digit": "^3.0.2",
|
|
47
47
|
"email-comb": "^5.2.0",
|
|
48
48
|
"front-matter": "^4.0.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"juice": "^8.0.0",
|
|
54
54
|
"lodash": "^4.17.20",
|
|
55
55
|
"ora": "^5.1.0",
|
|
56
|
-
"postcss": "^8.4.
|
|
56
|
+
"postcss": "^8.4.21",
|
|
57
57
|
"postcss-import": "^15.0.0",
|
|
58
58
|
"postcss-merge-longhand": "^5.1.7",
|
|
59
59
|
"posthtml": "^0.16.6",
|
|
@@ -64,20 +64,20 @@
|
|
|
64
64
|
"posthtml-extend": "^0.6.0",
|
|
65
65
|
"posthtml-extra-attributes": "^1.0.0",
|
|
66
66
|
"posthtml-fetch": "^2.2.0",
|
|
67
|
-
"posthtml-markdownit": "^1.3.
|
|
67
|
+
"posthtml-markdownit": "^1.3.1",
|
|
68
68
|
"posthtml-match-helper": "^1.0.3",
|
|
69
69
|
"posthtml-mso": "^1.0.4",
|
|
70
70
|
"posthtml-postcss-merge-longhand": "^1.0.2",
|
|
71
71
|
"posthtml-safe-class-names": "^2.0.0",
|
|
72
72
|
"posthtml-url-parameters": "^1.0.4",
|
|
73
73
|
"pretty": "^2.0.0",
|
|
74
|
-
"query-string": "^7.1.
|
|
74
|
+
"query-string": "^7.1.3",
|
|
75
75
|
"string-remove-widows": "^2.1.0",
|
|
76
76
|
"string-strip-html": "^8.2.0",
|
|
77
77
|
"tailwindcss": "^3.2.4"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
|
-
"ava": "^5.1.
|
|
80
|
+
"ava": "^5.1.1",
|
|
81
81
|
"c8": "^7.11.0",
|
|
82
82
|
"np": "*",
|
|
83
83
|
"xo": "0.39.1"
|
package/src/generators/config.js
CHANGED
|
@@ -13,16 +13,23 @@ module.exports = {
|
|
|
13
13
|
|
|
14
14
|
const cwd = env === 'maizzle-ci' ? './test/stubs/config' : process.cwd()
|
|
15
15
|
|
|
16
|
-
for (const module of ['./config', './config.local']) {
|
|
16
|
+
for (const module of ['./config', './config.cjs', './config.local', './config.local.cjs']) {
|
|
17
17
|
try {
|
|
18
18
|
baseConfig = merge(baseConfig, requireUncached(path.resolve(cwd, module)))
|
|
19
19
|
} catch {}
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
if (typeof env === 'string' && env !== 'local') {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
let loaded = false
|
|
24
|
+
for (const module of [`./config.${env}`, `./config.${env}.cjs`]) {
|
|
25
|
+
try {
|
|
26
|
+
envConfig = merge(envConfig, requireUncached(path.resolve(cwd, module)))
|
|
27
|
+
loaded = true
|
|
28
|
+
break
|
|
29
|
+
} catch {}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (!loaded) {
|
|
26
33
|
throw new Error(`could not load config.${env}.js`)
|
|
27
34
|
}
|
|
28
35
|
}
|
|
@@ -32,6 +32,11 @@ module.exports = async (env, spinner, config) => {
|
|
|
32
32
|
|
|
33
33
|
// Parse each template config object
|
|
34
34
|
await asyncForEach(templatesConfig, async templateConfig => {
|
|
35
|
+
if (!templateConfig) {
|
|
36
|
+
const configFileName = env === 'local' ? 'config.js' : `config.${env}.js`
|
|
37
|
+
throw new Error(`No template sources defined in \`build.templates\`, check your ${configFileName} file`)
|
|
38
|
+
}
|
|
39
|
+
|
|
35
40
|
const outputDir = get(templateConfig, 'destination.path', `build_${env}`)
|
|
36
41
|
|
|
37
42
|
await fs.remove(outputDir)
|
|
@@ -134,7 +139,7 @@ module.exports = async (env, spinner, config) => {
|
|
|
134
139
|
...config.events
|
|
135
140
|
})
|
|
136
141
|
|
|
137
|
-
const destination = config.permalink
|
|
142
|
+
const destination = get(compiled, 'config.permalink', file)
|
|
138
143
|
|
|
139
144
|
/**
|
|
140
145
|
* Generate plaintext
|
|
@@ -145,7 +150,7 @@ module.exports = async (env, spinner, config) => {
|
|
|
145
150
|
|
|
146
151
|
// Check if plaintext: true globally, fallback to template's front matter
|
|
147
152
|
const plaintextConfig = get(templateConfig, 'plaintext', get(compiled.config, 'plaintext', false))
|
|
148
|
-
const plaintextPath = get(plaintextConfig, 'destination.path',
|
|
153
|
+
const plaintextPath = get(plaintextConfig, 'destination.path', destination)
|
|
149
154
|
|
|
150
155
|
if (Boolean(plaintextConfig) || !isEmpty(plaintextConfig)) {
|
|
151
156
|
await Plaintext
|
|
@@ -23,7 +23,11 @@ module.exports = async (html, config = {}, direct = false) => {
|
|
|
23
23
|
if (isObject(url) && !isEmpty(url)) {
|
|
24
24
|
html = rewriteVMLs(html, get(url, 'url', ''))
|
|
25
25
|
|
|
26
|
-
return posthtml([
|
|
26
|
+
return posthtml([
|
|
27
|
+
baseUrl(merge({styleTag: true, inlineCss: true}, url))
|
|
28
|
+
])
|
|
29
|
+
.process(html, posthtmlOptions)
|
|
30
|
+
.then(result => result.html)
|
|
27
31
|
}
|
|
28
32
|
|
|
29
33
|
return html
|