@maizzle/framework 4.6.1 → 4.6.3

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.6.1",
3
+ "version": "4.6.3",
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",
@@ -43,15 +43,15 @@
43
43
  "dependencies": {
44
44
  "@maizzle/cli": "^1.5.1",
45
45
  "autoprefixer": "^10.4.14",
46
- "browser-sync": "^2.28.3",
46
+ "browser-sync": "^3.0.2",
47
47
  "color-shorthand-hex-to-six-digit": "^3.0.2",
48
48
  "email-comb": "^5.2.0",
49
49
  "front-matter": "^4.0.0",
50
- "fs-extra": "^10.0.0",
50
+ "fs-extra": "^11.2.0",
51
51
  "glob-promise": "^4.1.0",
52
52
  "html-crush": "^4.0.0",
53
53
  "is-url-superb": "^5.0.0",
54
- "juice": "^9.0.0",
54
+ "juice": "^10.0.0",
55
55
  "lodash": "^4.17.20",
56
56
  "ora": "^5.1.0",
57
57
  "postcss": "^8.4.21",
@@ -6,8 +6,8 @@ const Config = require('../generators/config')
6
6
  const buildToFile = require('../commands/build')
7
7
  const renderToString = require('../functions/render')
8
8
 
9
- const {get, isObject} = require('lodash')
10
- const {clearConsole, merge} = require('../utils/helpers')
9
+ const {get, merge, isObject} = require('lodash')
10
+ const {clearConsole} = require('../utils/helpers')
11
11
 
12
12
  /**
13
13
  * Initialize Browsersync on-demand
@@ -1,5 +1,6 @@
1
1
  const path = require('path')
2
- const {merge, requireUncached} = require('../utils/helpers')
2
+ const {merge} = require('lodash')
3
+ const {requireUncached} = require('../utils/helpers')
3
4
 
4
5
  const baseConfigFileNames = [
5
6
  './maizzle.config.js',
@@ -1,12 +1,11 @@
1
1
  const path = require('path')
2
2
  const fs = require('fs-extra')
3
3
  const glob = require('glob-promise')
4
- const {get, isEmpty} = require('lodash')
5
- const {merge} = require('../../utils/helpers')
4
+ const {get, merge, isEmpty} = require('lodash')
6
5
 
7
6
  const Config = require('../config')
8
- const Tailwind = require('../tailwindcss')
9
7
  const Plaintext = require('../plaintext')
8
+ const Tailwind = require('../tailwindcss')
10
9
 
11
10
  const render = require('./to-string')
12
11
 
@@ -1,10 +1,9 @@
1
1
  const fm = require('front-matter')
2
- const {get} = require('lodash')
2
+ const Config = require('../config')
3
+ const {get, merge} = require('lodash')
3
4
  const posthtml = require('../posthtml')
4
- const {merge} = require('../../utils/helpers')
5
- const Transformers = require('../../transformers')
6
5
  const Tailwind = require('../tailwindcss')
7
- const Config = require('../config')
6
+ const Transformers = require('../../transformers')
8
7
 
9
8
  module.exports = async (html, options) => {
10
9
  process.env.NODE_ENV = get(options, 'maizzle.env', 'local')
@@ -1,7 +1,6 @@
1
1
  const path = require('path')
2
- const {get} = require('lodash')
3
2
  const posthtml = require('posthtml')
4
- const {merge} = require('../utils/helpers')
3
+ const {get, merge} = require('lodash')
5
4
  const {stripHtml} = require('string-strip-html')
6
5
  const defaultConfig = require('./posthtml/defaultConfig')
7
6
 
@@ -1,9 +1,8 @@
1
1
  const fm = require('front-matter')
2
2
  const posthtml = require('posthtml')
3
- const {get, omit} = require('lodash')
4
3
  const fetch = require('posthtml-fetch')
5
4
  const layouts = require('posthtml-extend')
6
- const {merge} = require('../../utils/helpers')
5
+ const {get, merge, omit} = require('lodash')
7
6
  const components = require('posthtml-component')
8
7
  const defaultPosthtmlConfig = require('./defaultConfig')
9
8
  const defaultComponentsConfig = require('./defaultComponentsConfig')
@@ -3,9 +3,9 @@ const fs = require('fs-extra')
3
3
  const postcss = require('postcss')
4
4
  const tailwindcss = require('tailwindcss')
5
5
  const postcssImport = require('postcss-import')
6
- const {get, isObject, isEmpty} = require('lodash')
6
+ const {get, merge, isObject, isEmpty} = require('lodash')
7
7
  const postcssNested = require('tailwindcss/nesting')
8
- const {merge, requireUncached} = require('../utils/helpers')
8
+ const {requireUncached} = require('../utils/helpers')
9
9
  const mergeLonghand = require('postcss-merge-longhand')
10
10
  const defaultComponentsConfig = require('./posthtml/defaultComponentsConfig')
11
11
 
@@ -1,8 +1,14 @@
1
+ const {
2
+ get,
3
+ merge,
4
+ forEach,
5
+ intersection,
6
+ keys,
7
+ isEmpty
8
+ } = require('lodash')
1
9
  const posthtml = require('posthtml')
2
- const {merge} = require('../utils/helpers')
3
10
  const parseAttrs = require('posthtml-attrs-parser')
4
11
  const defaultConfig = require('../generators/posthtml/defaultConfig')
5
- const {get, forEach, intersection, keys, isEmpty} = require('lodash')
6
12
 
7
13
  module.exports = async (html, config = {}, direct = false) => {
8
14
  const posthtmlOptions = merge(defaultConfig, get(config, 'build.posthtml.options', {}))
@@ -1,8 +1,7 @@
1
1
  const posthtml = require('posthtml')
2
2
  const isUrl = require('is-url-superb')
3
- const {merge} = require('../utils/helpers')
4
3
  const baseUrl = require('posthtml-base-url')
5
- const {get, isObject, isEmpty} = require('lodash')
4
+ const {get, merge, isObject, isEmpty} = require('lodash')
6
5
  const defaultConfig = require('../generators/posthtml/defaultConfig')
7
6
 
8
7
  module.exports = async (html, config = {}, direct = false) => {
@@ -1,6 +1,5 @@
1
1
  const posthtml = require('posthtml')
2
- const {get, isObject} = require('lodash')
3
- const {merge} = require('../utils/helpers')
2
+ const {get, merge, isObject} = require('lodash')
4
3
  const addAttributes = require('posthtml-extra-attributes')
5
4
  const defaultConfig = require('../generators/posthtml/defaultConfig')
6
5
 
@@ -1,6 +1,5 @@
1
1
  const posthtml = require('posthtml')
2
- const {get, omit, has} = require('lodash')
3
- const {merge} = require('../../utils/helpers')
2
+ const {get, merge, omit, has} = require('lodash')
4
3
  const defaultFilters = require('./defaultFilters')
5
4
  const PostCSS = require('../../generators/postcss')
6
5
  const posthtmlContent = require('posthtml-content')
@@ -27,10 +27,10 @@ exports.process = async (html, config) => {
27
27
  html = await attributeToStyle(html, config)
28
28
  html = await inline(html, config)
29
29
  html = await removeUnusedCSS(html, config)
30
+ html = await removeAttributes(html, config)
30
31
  html = await shorthandInlineCSS(html, config)
31
32
  html = await removeInlineSizes(html, config)
32
33
  html = await removeInlineBgColor(html, config)
33
- html = await removeAttributes(html, config)
34
34
  html = await applyExtraAttributes(html, config)
35
35
  html = await applyBaseUrl(html, config)
36
36
  html = await addURLParams(html, config)
@@ -1,6 +1,5 @@
1
- const {get} = require('lodash')
2
1
  const posthtml = require('posthtml')
3
- const {merge} = require('../utils/helpers')
2
+ const {get, merge} = require('lodash')
4
3
  const markdown = require('posthtml-markdownit')
5
4
  const defaultConfig = require('../generators/posthtml/defaultConfig')
6
5
 
@@ -1,7 +1,6 @@
1
- const {get} = require('lodash')
2
1
  const posthtml = require('posthtml')
2
+ const {get, merge} = require('lodash')
3
3
  const outlook = require('posthtml-mso')
4
- const {merge} = require('../utils/helpers')
5
4
  const defaultConfig = require('../generators/posthtml/defaultConfig')
6
5
 
7
6
  module.exports = async (html, config) => {
@@ -1,7 +1,6 @@
1
1
  /* eslint-disable camelcase */
2
2
  const pretty = require('pretty')
3
- const {merge} = require('../utils/helpers')
4
- const {get, isEmpty, isObject} = require('lodash')
3
+ const {get, merge, isEmpty, isObject} = require('lodash')
5
4
 
6
5
  module.exports = async (html, config = {}, direct = false) => {
7
6
  const defaultConfig = {
@@ -1,6 +1,5 @@
1
1
  const posthtml = require('posthtml')
2
- const {get, isEmpty} = require('lodash')
3
- const {merge} = require('../utils/helpers')
2
+ const {get, merge, isEmpty} = require('lodash')
4
3
  const {removeWidows} = require('string-remove-widows')
5
4
  const defaultConfig = require('../generators/posthtml/defaultConfig')
6
5
 
@@ -1,6 +1,5 @@
1
- const {get} = require('lodash')
2
1
  const posthtml = require('posthtml')
3
- const {merge} = require('../utils/helpers')
2
+ const {get, merge} = require('lodash')
4
3
  const defaultConfig = require('../generators/posthtml/defaultConfig')
5
4
 
6
5
  module.exports = async (html, config = {}, direct = false) => {
@@ -1,7 +1,7 @@
1
1
  const posthtml = require('posthtml')
2
- const {get, isEmpty} = require('lodash')
2
+ const {get, merge, isEmpty} = require('lodash')
3
3
  const parseAttrs = require('posthtml-attrs-parser')
4
- const {merge, toStyleString} = require('../utils/helpers')
4
+ const {toStyleString} = require('../utils/helpers')
5
5
  const defaultConfig = require('../generators/posthtml/defaultConfig')
6
6
 
7
7
  module.exports = async (html, config = {}, direct = false) => {
@@ -1,7 +1,7 @@
1
1
  const posthtml = require('posthtml')
2
- const {get, isEmpty} = require('lodash')
2
+ const {get, merge, isEmpty} = require('lodash')
3
3
  const parseAttrs = require('posthtml-attrs-parser')
4
- const {merge, toStyleString} = require('../utils/helpers')
4
+ const {toStyleString} = require('../utils/helpers')
5
5
  const defaultConfig = require('../generators/posthtml/defaultConfig')
6
6
 
7
7
  module.exports = async (html, config = {}, direct = false) => {
@@ -18,8 +18,6 @@ module.exports = async (html, config = {}, direct = false) => {
18
18
 
19
19
  const removeInlineSizes = (mappings = {}) => tree => {
20
20
  const process = node => {
21
- const attrs = parseAttrs(node.attrs)
22
-
23
21
  Object.entries(mappings).forEach(([attribute, tags]) => {
24
22
  tags = Object.values(tags).map(tag => tag.toLowerCase())
25
23
 
@@ -27,6 +25,8 @@ const removeInlineSizes = (mappings = {}) => tree => {
27
25
  return node
28
26
  }
29
27
 
28
+ const attrs = parseAttrs(node.attrs)
29
+
30
30
  tags.forEach(() => {
31
31
  if (get(node, 'attrs.style')) {
32
32
  delete attrs.style[attribute]
@@ -1,7 +1,6 @@
1
1
  const postcss = require('postcss')
2
2
  const posthtml = require('posthtml')
3
- const {merge} = require('../utils/helpers')
4
- const {get, has, remove} = require('lodash')
3
+ const {get, merge, has, remove} = require('lodash')
5
4
  const parseAttrs = require('posthtml-attrs-parser')
6
5
  const matchHelper = require('posthtml-match-helper')
7
6
  const defaultConfig = require('../generators/posthtml/defaultConfig')
@@ -1,6 +1,5 @@
1
1
  const {comb} = require('email-comb')
2
- const {merge} = require('../utils/helpers')
3
- const {get, isEmpty, isObject} = require('lodash')
2
+ const {get, merge, isEmpty, isObject} = require('lodash')
4
3
  const removeInlinedClasses = require('./removeInlinedSelectors')
5
4
 
6
5
  module.exports = async (html, config = {}, direct = false) => {
@@ -1,6 +1,5 @@
1
1
  const posthtml = require('posthtml')
2
- const {get, isEmpty} = require('lodash')
3
- const {merge} = require('../utils/helpers')
2
+ const {get, merge, isEmpty} = require('lodash')
4
3
  const safeClassNames = require('posthtml-safe-class-names')
5
4
  const defaultConfig = require('../generators/posthtml/defaultConfig')
6
5
 
@@ -1,6 +1,5 @@
1
1
  const posthtml = require('posthtml')
2
- const {merge} = require('../utils/helpers')
3
- const {get, isObject, isEmpty} = require('lodash')
2
+ const {get, merge, isObject, isEmpty} = require('lodash')
4
3
  const mergeInlineLonghand = require('posthtml-postcss-merge-longhand')
5
4
  const defaultConfig = require('../generators/posthtml/defaultConfig')
6
5
 
@@ -1,6 +1,5 @@
1
- const {get} = require('lodash')
2
1
  const posthtml = require('posthtml')
3
- const {merge} = require('../utils/helpers')
2
+ const {get, merge} = require('lodash')
4
3
  const {conv} = require('color-shorthand-hex-to-six-digit')
5
4
  const defaultConfig = require('../generators/posthtml/defaultConfig')
6
5
 
@@ -1,6 +1,5 @@
1
1
  const posthtml = require('posthtml')
2
- const {get, isEmpty} = require('lodash')
3
- const {merge} = require('../utils/helpers')
2
+ const {get, merge, isEmpty} = require('lodash')
4
3
  const urlParams = require('posthtml-url-parameters')
5
4
  const defaultConfig = require('../generators/posthtml/defaultConfig')
6
5
 
@@ -1,5 +1,3 @@
1
- const {mergeWith} = require('lodash')
2
-
3
1
  module.exports = {
4
2
  requireUncached: module => {
5
3
  try {
@@ -11,24 +9,5 @@ module.exports = {
11
9
  },
12
10
  // https://github.com/lukeed/console-clear
13
11
  clearConsole: () => process.stdout.write('\x1B[H\x1B[2J'),
14
- toStyleString: (object = {}) => Object.entries(object).map(([k, v]) => `${k}: ${v}`).join('; '),
15
- merge: (...objects) => {
16
- if (objects.length < 2) {
17
- return objects[0]
18
- }
19
-
20
- let merged = {}
21
-
22
- for (const object of objects) {
23
- merged = mergeWith(merged, object, (existingValue, newValue) => {
24
- if (Array.isArray(existingValue) && Array.isArray(newValue)) {
25
- return [...existingValue, ...newValue]
26
- }
27
-
28
- return undefined
29
- })
30
- }
31
-
32
- return merged
33
- }
12
+ toStyleString: (object = {}) => Object.entries(object).map(([k, v]) => `${k}: ${v}`).join('; ')
34
13
  }