@maizzle/framework 4.4.0-beta.4 → 4.4.0-beta.5
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
|
@@ -67,6 +67,17 @@ module.exports = async (env, spinner, config) => {
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
// Create a pipe-delimited list of allowed extensions
|
|
71
|
+
// We only compile these, the rest are copied as-is
|
|
72
|
+
const extensions = Array.isArray(templateConfig.filetypes)
|
|
73
|
+
? templateConfig.filetypes.join('|')
|
|
74
|
+
: templateConfig.filetypes || get(templateConfig, 'filetypes', 'html')
|
|
75
|
+
|
|
76
|
+
// List of files that won't be copied to the output directory
|
|
77
|
+
const omitted = Array.isArray(templateConfig.omit) ?
|
|
78
|
+
templateConfig.omit :
|
|
79
|
+
[get(templateConfig, 'omit', '')]
|
|
80
|
+
|
|
70
81
|
// Parse each template source
|
|
71
82
|
await asyncForEach(templateSource, async source => {
|
|
72
83
|
/**
|
|
@@ -77,13 +88,22 @@ module.exports = async (env, spinner, config) => {
|
|
|
77
88
|
const out = fs.lstatSync(source).isFile() ? `${outputDir}/${path.basename(source)}` : outputDir
|
|
78
89
|
|
|
79
90
|
await fs
|
|
80
|
-
.copy(source, out
|
|
91
|
+
.copy(source, out, {filter: file => {
|
|
92
|
+
// Do not copy omitted files
|
|
93
|
+
return !omitted
|
|
94
|
+
.filter(Boolean)
|
|
95
|
+
.some(omit => path.normalize(file).includes(path.normalize(omit)))
|
|
96
|
+
}})
|
|
81
97
|
.then(async () => {
|
|
82
|
-
const
|
|
83
|
-
? templateConfig.filetypes.join('|')
|
|
84
|
-
: templateConfig.filetypes || get(templateConfig, 'filetypes', 'html')
|
|
98
|
+
const allSourceFiles = await glob(`${outputDir}/**/*.+(${extensions})`)
|
|
85
99
|
|
|
86
|
-
const
|
|
100
|
+
const skipped = Array.isArray(templateConfig.skip) ?
|
|
101
|
+
templateConfig.skip :
|
|
102
|
+
[get(templateConfig, 'skip', '')]
|
|
103
|
+
|
|
104
|
+
const templates = allSourceFiles.filter(template => {
|
|
105
|
+
return !skipped.includes(template.replace(`${outputDir}/`, ''))
|
|
106
|
+
})
|
|
87
107
|
|
|
88
108
|
if (templates.length === 0) {
|
|
89
109
|
spinner.warn(`Error: no files with the .${extensions} extension found in ${templateConfig.source}`)
|
|
@@ -9,7 +9,9 @@ module.exports = {
|
|
|
9
9
|
return postcss([
|
|
10
10
|
postcssImport(),
|
|
11
11
|
postcssNested(),
|
|
12
|
-
maizzleConfig
|
|
12
|
+
get(maizzleConfig, 'shorthandCSS', get(maizzleConfig, 'shorthandInlineCSS')) === true ?
|
|
13
|
+
mergeLonghand() :
|
|
14
|
+
() => {},
|
|
13
15
|
...get(maizzleConfig, 'build.postcss.plugins', [])
|
|
14
16
|
])
|
|
15
17
|
.process(css, {from: undefined})
|
|
@@ -5,7 +5,7 @@ const {get, merge, isObject, isEmpty} = require('lodash')
|
|
|
5
5
|
const defaultConfig = require('../generators/posthtml/defaultConfig')
|
|
6
6
|
|
|
7
7
|
module.exports = async (html, config = {}, direct = false) => {
|
|
8
|
-
const url = direct ? config : get(config, 'baseURL')
|
|
8
|
+
const url = direct ? config : get(config, 'baseURL', get(config, 'baseUrl'))
|
|
9
9
|
const posthtmlOptions = merge(defaultConfig, get(config, 'build.posthtml.options', {}))
|
|
10
10
|
|
|
11
11
|
// Handle `baseUrl` as a string
|
|
@@ -19,9 +19,9 @@ module.exports = async (html, config = {}, direct = false) => {
|
|
|
19
19
|
.then(result => result.html)
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
// Handle `
|
|
22
|
+
// Handle `baseURL` as an object
|
|
23
23
|
if (isObject(url) && !isEmpty(url)) {
|
|
24
|
-
html = rewriteVMLs(html, url
|
|
24
|
+
html = rewriteVMLs(html, get(url, 'url', ''))
|
|
25
25
|
|
|
26
26
|
return posthtml([baseUrl(url)]).process(html, posthtmlOptions).then(result => result.html)
|
|
27
27
|
}
|