@maizzle/framework 3.6.2 → 4.0.0-alpha.1
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/.github/dependabot.yml +11 -11
- package/.github/workflows/nodejs.yml +28 -29
- package/package.json +87 -84
- package/src/generators/output/to-disk.js +139 -111
- package/src/generators/output/to-string.js +71 -64
- package/src/generators/posthtml.js +61 -60
- package/src/generators/tailwindcss.js +49 -18
- package/src/index.js +24 -36
- package/src/transformers/{attribute-to-style.js → attributeToStyle.js} +0 -0
- package/src/transformers/baseUrl.js +45 -0
- package/src/transformers/{extra-attributes.js → extraAttributes.js} +0 -0
- package/src/transformers/index.js +13 -13
- package/src/transformers/{inline.js → inlineCss.js} +0 -0
- package/src/transformers/{posthtml-mso.js → posthtmlMso.js} +0 -0
- package/src/transformers/{prevent-widows.js → preventWidows.js} +0 -0
- package/src/transformers/{remove-attributes.js → removeAttributes.js} +1 -1
- package/src/transformers/{remove-inline-bgcolor.js → removeInlineBackgroundColor.js} +0 -0
- package/src/transformers/{remove-inline-sizes.js → removeInlineSizes.js} +0 -0
- package/src/transformers/{remove-unused-css.js → removeUnusedCss.js} +0 -0
- package/src/transformers/{replace-strings.js → replaceStrings.js} +0 -0
- package/src/transformers/{safe-class-names.js → safeClassNames.js} +8 -2
- package/src/transformers/{six-hex.js → sixHex.js} +10 -10
- package/src/transformers/transform.js +4 -6
- package/src/transformers/{url-params.js → urlParameters.js} +0 -0
- package/src/utils/helpers.js +2 -8
- package/test/expected/transformers/base-image-url.html +83 -0
- package/test/expected/transformers/transform-postcss.html +19 -0
- package/test/expected/useConfig.html +9 -0
- package/test/fixtures/basic.html +9 -0
- package/test/fixtures/transformers/base-image-url.html +85 -0
- package/test/fixtures/useConfig.html +9 -0
- package/test/stubs/tailwind/preserve.html +1 -0
- package/test/test-misc.js +8 -8
- package/test/test-tailwind.js +100 -73
- package/test/test-todisk.js +71 -29
- package/test/test-tostring.js +12 -3
- package/test/test-transformers.js +343 -314
- package/xo.config.js +4 -0
- package/src/transformers/base-image-url.js +0 -10
package/xo.config.js
CHANGED
|
@@ -3,10 +3,14 @@ module.exports = {
|
|
|
3
3
|
rules: {
|
|
4
4
|
semi: 0,
|
|
5
5
|
complexity: 0,
|
|
6
|
+
'max-params': 0,
|
|
6
7
|
'no-lonely-if': 0,
|
|
7
8
|
'unicorn/no-reduce': 0,
|
|
9
|
+
'import/extensions': 0,
|
|
8
10
|
'operator-linebreak': 0,
|
|
9
11
|
'max-nested-callbacks': 0,
|
|
12
|
+
'unicorn/filename-case': 0,
|
|
13
|
+
'unicorn/no-hex-escape': 0,
|
|
10
14
|
'unicorn/prefer-ternary': 0,
|
|
11
15
|
'unicorn/string-content': 0,
|
|
12
16
|
'unicorn/no-array-for-each': 0,
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
module.exports = async (html, config = {}, direct = false) => {
|
|
2
|
-
const url = direct ? config : config.baseImageURL
|
|
3
|
-
|
|
4
|
-
if (url) {
|
|
5
|
-
return html.replace(/(background="|src=")(?!\s+|url\('?'?\)|"|https?:\/\/)\/?/gi, '$1' + url)
|
|
6
|
-
.replace(/(background(-image)?:\s?url\('?)(?![')]|https?:\/\/)\/?/gi, '$1' + url)
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
return html
|
|
10
|
-
}
|