@maizzle/framework 4.0.2 → 4.1.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maizzle/framework",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
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",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"lodash": "^4.17.20",
|
|
51
51
|
"ora": "^5.1.0",
|
|
52
52
|
"postcss": "^8.4.4",
|
|
53
|
-
"postcss-import": "^
|
|
53
|
+
"postcss-import": "^15.0.0",
|
|
54
54
|
"postcss-merge-longhand": "^5.0.1",
|
|
55
55
|
"posthtml": "^0.16.6",
|
|
56
56
|
"posthtml-attrs-parser": "^0.1.1",
|
package/src/commands/serve.js
CHANGED
|
@@ -38,11 +38,14 @@ const serve = async (env = 'local', config = {}) => {
|
|
|
38
38
|
templates = Array.isArray(templates) ? templates : [templates]
|
|
39
39
|
|
|
40
40
|
const templatePaths = [...new Set(templates.map(config => `${get(config, 'source', 'src')}/**`))]
|
|
41
|
+
const tailwindConfig = get(config, 'build.tailwind.config', 'tailwind.config.js')
|
|
41
42
|
const globalPaths = [
|
|
42
43
|
'src/**',
|
|
43
|
-
get(config, 'build.tailwind.config', 'tailwind.config.js'),
|
|
44
44
|
...new Set(get(config, 'build.browsersync.watch', []))
|
|
45
45
|
]
|
|
46
|
+
if (typeof tailwindConfig === 'string') {
|
|
47
|
+
globalPaths.push(tailwindConfig);
|
|
48
|
+
}
|
|
46
49
|
|
|
47
50
|
// Watch for Template file changes
|
|
48
51
|
browsersync()
|
|
@@ -7,10 +7,12 @@ module.exports = async (html, config = {}, direct = false) => {
|
|
|
7
7
|
|
|
8
8
|
if (!isEmpty(urlParameters)) {
|
|
9
9
|
const {_options, ...parameters} = urlParameters
|
|
10
|
-
const
|
|
10
|
+
const tags = _options.tags ?? ['a']
|
|
11
|
+
const strict = _options.strict ?? true
|
|
12
|
+
const qs = _options.qs ?? {encode: false}
|
|
11
13
|
const posthtmlOptions = get(config, 'build.posthtml.options', {})
|
|
12
14
|
|
|
13
|
-
return posthtml([urlParams({parameters, tags, qs})]).process(html, posthtmlOptions).then(result => result.html)
|
|
15
|
+
return posthtml([urlParams({parameters, tags, qs, strict})]).process(html, posthtmlOptions).then(result => result.html)
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
return html
|
package/test/test-todisk.js
CHANGED
|
@@ -509,3 +509,34 @@ test('throws if templates path is invalid (function)', async t => {
|
|
|
509
509
|
})
|
|
510
510
|
}, {instanceOf: TypeError})
|
|
511
511
|
})
|
|
512
|
+
|
|
513
|
+
test('sets config.build.current.path', async t => {
|
|
514
|
+
await Maizzle.build('maizzle-ci', {
|
|
515
|
+
build: {
|
|
516
|
+
fail: 'silent',
|
|
517
|
+
templates: {
|
|
518
|
+
source: 'test/stubs/templates',
|
|
519
|
+
destination: {
|
|
520
|
+
path: t.context.folder
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
},
|
|
524
|
+
events: {
|
|
525
|
+
beforeRender(html, config) {
|
|
526
|
+
t.context.current = config.build.current
|
|
527
|
+
|
|
528
|
+
return html
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
})
|
|
532
|
+
|
|
533
|
+
t.deepEqual(t.context.current, {
|
|
534
|
+
path: {
|
|
535
|
+
root: '',
|
|
536
|
+
dir: t.context.folder,
|
|
537
|
+
base: '1.html',
|
|
538
|
+
ext: '.html',
|
|
539
|
+
name: '1'
|
|
540
|
+
}
|
|
541
|
+
})
|
|
542
|
+
})
|
|
@@ -323,9 +323,21 @@ test('filters (postcss)', async t => {
|
|
|
323
323
|
})
|
|
324
324
|
|
|
325
325
|
test('url parameters', async t => {
|
|
326
|
-
const html = await Maizzle.addURLParams(
|
|
326
|
+
const html = await Maizzle.addURLParams(
|
|
327
|
+
`<a href="example.com">test</a>
|
|
328
|
+
<link href="https://foo.bar">`,
|
|
329
|
+
{
|
|
330
|
+
_options: {
|
|
331
|
+
tags: ['a[href*="example"]'],
|
|
332
|
+
strict: false
|
|
333
|
+
},
|
|
334
|
+
bar: 'baz',
|
|
335
|
+
qix: 'qux'
|
|
336
|
+
}
|
|
337
|
+
)
|
|
327
338
|
|
|
328
|
-
t.is(html,
|
|
339
|
+
t.is(html, `<a href="example.com?bar=baz&qix=qux">test</a>
|
|
340
|
+
<link href="https://foo.bar">`)
|
|
329
341
|
})
|
|
330
342
|
|
|
331
343
|
test('attribute to style', async t => {
|