@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/.github/dependabot.yml
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
version: 2
|
|
2
|
-
updates:
|
|
3
|
-
- package-ecosystem: npm
|
|
4
|
-
directory: "/"
|
|
5
|
-
schedule:
|
|
6
|
-
interval:
|
|
7
|
-
open-pull-requests-limit: 10
|
|
8
|
-
ignore:
|
|
9
|
-
- dependency-name: html-crush
|
|
10
|
-
versions:
|
|
11
|
-
- 4.1.0
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: npm
|
|
4
|
+
directory: "/"
|
|
5
|
+
schedule:
|
|
6
|
+
interval: weekly
|
|
7
|
+
open-pull-requests-limit: 10
|
|
8
|
+
ignore:
|
|
9
|
+
- dependency-name: html-crush
|
|
10
|
+
versions:
|
|
11
|
+
- 4.1.0
|
|
@@ -1,29 +1,28 @@
|
|
|
1
|
-
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
|
|
2
|
-
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
|
3
|
-
|
|
4
|
-
name: Node.js CI
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
push:
|
|
8
|
-
branches: [master]
|
|
9
|
-
pull_request:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
- run: npm
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
CI: true
|
|
1
|
+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
|
|
2
|
+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
|
3
|
+
|
|
4
|
+
name: Node.js CI
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches: [master]
|
|
9
|
+
pull_request:
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
|
|
15
|
+
strategy:
|
|
16
|
+
matrix:
|
|
17
|
+
node-version: [12, 14, 16]
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v2
|
|
21
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
22
|
+
uses: actions/setup-node@v1
|
|
23
|
+
with:
|
|
24
|
+
node-version: ${{ matrix.node-version }}
|
|
25
|
+
- run: npm install
|
|
26
|
+
- run: npm test
|
|
27
|
+
env:
|
|
28
|
+
CI: true
|
package/package.json
CHANGED
|
@@ -1,84 +1,87 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@maizzle/framework",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Maizzle is a framework that helps you quickly build HTML emails with Tailwind CSS.",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"main": "src/index.js",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "https://github.com/maizzle/framework.git"
|
|
10
|
-
},
|
|
11
|
-
"bugs": "https://github.com/maizzle/framework/issues",
|
|
12
|
-
"homepage": "https://maizzle.com",
|
|
13
|
-
"author": "Cosmin Popovici (https://github.com/cossssmin)",
|
|
14
|
-
"keywords": [
|
|
15
|
-
"maizzle",
|
|
16
|
-
"tailwindcss",
|
|
17
|
-
"responsive-email",
|
|
18
|
-
"email-framework",
|
|
19
|
-
"email-template",
|
|
20
|
-
"email-marketing",
|
|
21
|
-
"email-campaigns",
|
|
22
|
-
"email-newsletter",
|
|
23
|
-
"email-boilerplate",
|
|
24
|
-
"html-emails"
|
|
25
|
-
],
|
|
26
|
-
"publishConfig": {
|
|
27
|
-
"access": "public"
|
|
28
|
-
},
|
|
29
|
-
"scripts": {
|
|
30
|
-
"test": "
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"posthtml
|
|
52
|
-
"posthtml-
|
|
53
|
-
"posthtml-
|
|
54
|
-
"posthtml-
|
|
55
|
-
"posthtml-
|
|
56
|
-
"posthtml-
|
|
57
|
-
"posthtml-
|
|
58
|
-
"posthtml-
|
|
59
|
-
"posthtml-
|
|
60
|
-
"posthtml-
|
|
61
|
-
"posthtml-
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"
|
|
78
|
-
},
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@maizzle/framework",
|
|
3
|
+
"version": "4.0.0-alpha.1",
|
|
4
|
+
"description": "Maizzle is a framework that helps you quickly build HTML emails with Tailwind CSS.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"main": "src/index.js",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/maizzle/framework.git"
|
|
10
|
+
},
|
|
11
|
+
"bugs": "https://github.com/maizzle/framework/issues",
|
|
12
|
+
"homepage": "https://maizzle.com",
|
|
13
|
+
"author": "Cosmin Popovici (https://github.com/cossssmin)",
|
|
14
|
+
"keywords": [
|
|
15
|
+
"maizzle",
|
|
16
|
+
"tailwindcss",
|
|
17
|
+
"responsive-email",
|
|
18
|
+
"email-framework",
|
|
19
|
+
"email-template",
|
|
20
|
+
"email-marketing",
|
|
21
|
+
"email-campaigns",
|
|
22
|
+
"email-newsletter",
|
|
23
|
+
"email-boilerplate",
|
|
24
|
+
"html-emails"
|
|
25
|
+
],
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"test": "c8 ava -s",
|
|
31
|
+
"pretest": "xo",
|
|
32
|
+
"style": "xo",
|
|
33
|
+
"release": "np"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"autoprefixer": "^10.4.0",
|
|
37
|
+
"browser-sync": "^2.26.13",
|
|
38
|
+
"color-shorthand-hex-to-six-digit": "^3.0.2",
|
|
39
|
+
"email-comb": "^5.0.0",
|
|
40
|
+
"front-matter": "^4.0.0",
|
|
41
|
+
"fs-extra": "^10.0.0",
|
|
42
|
+
"glob-promise": "^4.1.0",
|
|
43
|
+
"html-crush": "^4.0.0",
|
|
44
|
+
"is-url-superb": "^5.0.0",
|
|
45
|
+
"juice": "^8.0.0",
|
|
46
|
+
"lodash": "^4.17.20",
|
|
47
|
+
"ora": "^5.1.0",
|
|
48
|
+
"postcss": "^8.4.4",
|
|
49
|
+
"postcss-import": "^14.0.0",
|
|
50
|
+
"postcss-merge-longhand": "^5.0.1",
|
|
51
|
+
"posthtml": "^0.16.4",
|
|
52
|
+
"posthtml-attrs-parser": "^0.1.1",
|
|
53
|
+
"posthtml-base-url": "^1.0.1",
|
|
54
|
+
"posthtml-content": "^0.0.3",
|
|
55
|
+
"posthtml-expressions": "^1.8.1",
|
|
56
|
+
"posthtml-extend": "^0.6.0",
|
|
57
|
+
"posthtml-extra-attributes": "^1.0.0",
|
|
58
|
+
"posthtml-fetch": "^2.0.0",
|
|
59
|
+
"posthtml-markdownit": "^1.2.2",
|
|
60
|
+
"posthtml-modules": "^0.8.0",
|
|
61
|
+
"posthtml-mso": "^1.0.2",
|
|
62
|
+
"posthtml-postcss-merge-longhand": "^1.0.2",
|
|
63
|
+
"posthtml-remove-attributes": "^1.0.0",
|
|
64
|
+
"posthtml-safe-class-names": "^1.0.4",
|
|
65
|
+
"posthtml-url-parameters": "^1.0.4",
|
|
66
|
+
"pretty": "^2.0.0",
|
|
67
|
+
"prevent-widows": "^1.0.2",
|
|
68
|
+
"query-string": "^7.1.0",
|
|
69
|
+
"string-strip-html": "^8.2.0",
|
|
70
|
+
"tailwindcss": "^3.0.0",
|
|
71
|
+
"tailwindcss-box-shadow": "^1.0.0"
|
|
72
|
+
},
|
|
73
|
+
"devDependencies": {
|
|
74
|
+
"ava": "^4.0.1",
|
|
75
|
+
"c8": "^7.11.0",
|
|
76
|
+
"np": "*",
|
|
77
|
+
"xo": "0.39.1"
|
|
78
|
+
},
|
|
79
|
+
"engines": {
|
|
80
|
+
"node": ">=12.13.0"
|
|
81
|
+
},
|
|
82
|
+
"ava": {
|
|
83
|
+
"files": [
|
|
84
|
+
"test/**/test*.js"
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -29,130 +29,158 @@ module.exports = async (env, spinner, config) => {
|
|
|
29
29
|
|
|
30
30
|
const css = (typeof get(config, 'tailwind.compiled') === 'string')
|
|
31
31
|
? config.tailwind.compiled
|
|
32
|
-
: await Tailwind.compile('@tailwind components; @tailwind utilities;', '', {}, config)
|
|
32
|
+
: await Tailwind.compile('@tailwind components; @tailwind utilities;', '', {}, config, spinner)
|
|
33
33
|
|
|
34
|
+
// Parse each template config object
|
|
34
35
|
await asyncForEach(templatesConfig, async templateConfig => {
|
|
35
36
|
const outputDir = get(templateConfig, 'destination.path', `build_${env}`)
|
|
36
37
|
|
|
37
38
|
await fs.remove(outputDir)
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
* We do this first so that we can remove the <plaintext>
|
|
80
|
-
* tags from the markup before outputting the file.
|
|
81
|
-
*/
|
|
82
|
-
|
|
83
|
-
// Make this a breaking change in 4.0, get only from `templateConfig`
|
|
84
|
-
const plaintextConfig = get(templateConfig, 'plaintext', get(config, 'plaintext'))
|
|
85
|
-
const plaintextDestination = get(plaintextConfig, 'destination', config.permalink || file)
|
|
86
|
-
|
|
87
|
-
if ((typeof plaintextConfig === 'boolean' && plaintextConfig) || !isEmpty(plaintextConfig)) {
|
|
88
|
-
await Plaintext
|
|
89
|
-
.generate(html, plaintextDestination, merge(config, {filepath: file}))
|
|
90
|
-
.then(({plaintext, destination}) => fs.outputFile(destination, plaintext))
|
|
91
|
-
}
|
|
40
|
+
/**
|
|
41
|
+
* Get all files in the template config's source directory
|
|
42
|
+
* Supports `source` defined as:
|
|
43
|
+
* - string
|
|
44
|
+
* - array of strings
|
|
45
|
+
* - function that returns either of the above
|
|
46
|
+
*
|
|
47
|
+
* */
|
|
48
|
+
const templateSource = []
|
|
49
|
+
|
|
50
|
+
if (typeof templateConfig.source === 'function') {
|
|
51
|
+
const sources = templateConfig.source()
|
|
52
|
+
if (Array.isArray(sources)) {
|
|
53
|
+
templateSource.push(...sources)
|
|
54
|
+
} else {
|
|
55
|
+
templateSource.push(sources)
|
|
56
|
+
}
|
|
57
|
+
} else {
|
|
58
|
+
if (Array.isArray(templateConfig.source)) {
|
|
59
|
+
templateSource.push(...templateConfig.source)
|
|
60
|
+
} else {
|
|
61
|
+
templateSource.push(templateConfig.source)
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Parse each template source
|
|
66
|
+
await asyncForEach(templateSource, async source => {
|
|
67
|
+
await fs
|
|
68
|
+
.copy(source, outputDir)
|
|
69
|
+
.then(async () => {
|
|
70
|
+
const extensions = Array.isArray(templateConfig.filetypes)
|
|
71
|
+
? templateConfig.filetypes.join('|')
|
|
72
|
+
: templateConfig.filetypes || get(templateConfig, 'filetypes', 'html')
|
|
73
|
+
|
|
74
|
+
const templates = await glob(`${outputDir}/**/*.+(${extensions})`)
|
|
75
|
+
|
|
76
|
+
if (templates.length === 0) {
|
|
77
|
+
spinner.warn(`Error: no files with the .${extensions} extension found in ${templateConfig.source}`)
|
|
78
|
+
return
|
|
79
|
+
}
|
|
92
80
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
await fs.remove(file)
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// Keep track of handled files
|
|
116
|
-
files.push(file)
|
|
117
|
-
parsed.push(file)
|
|
118
|
-
})
|
|
119
|
-
})
|
|
120
|
-
.catch(error => {
|
|
121
|
-
switch (config.build.fail) {
|
|
122
|
-
case 'silent':
|
|
123
|
-
spinner.warn(`Failed to compile template: ${path.basename(file)}`)
|
|
124
|
-
break
|
|
125
|
-
case 'verbose':
|
|
126
|
-
spinner.warn(`Failed to compile template: ${path.basename(file)}`)
|
|
127
|
-
console.error(error)
|
|
128
|
-
break
|
|
129
|
-
default:
|
|
130
|
-
spinner.fail(`Failed to compile template: ${path.basename(file)}`)
|
|
131
|
-
throw error
|
|
132
|
-
}
|
|
81
|
+
// Store template config currently being processed
|
|
82
|
+
config.build.currentTemplates = templateConfig
|
|
83
|
+
|
|
84
|
+
if (config.events && typeof config.events.beforeCreate === 'function') {
|
|
85
|
+
await config.events.beforeCreate(config)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
await asyncForEach(templates, async file => {
|
|
89
|
+
const html = await fs.readFile(file, 'utf8')
|
|
90
|
+
|
|
91
|
+
await render(html, {
|
|
92
|
+
maizzle: {
|
|
93
|
+
...config,
|
|
94
|
+
env
|
|
95
|
+
},
|
|
96
|
+
tailwind: {
|
|
97
|
+
compiled: css
|
|
98
|
+
},
|
|
99
|
+
...config.events
|
|
133
100
|
})
|
|
134
|
-
|
|
101
|
+
.then(async ({html, config}) => {
|
|
102
|
+
const destination = config.permalink || file
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Generate plaintext
|
|
106
|
+
*
|
|
107
|
+
* We do this first so that we can remove the <plaintext>
|
|
108
|
+
* tags from the markup before outputting the file.
|
|
109
|
+
*/
|
|
110
|
+
|
|
111
|
+
const plaintextConfig = get(templateConfig, 'plaintext')
|
|
112
|
+
const plaintextDestination = get(plaintextConfig, 'destination', config.permalink || file)
|
|
113
|
+
|
|
114
|
+
if ((typeof plaintextConfig === 'boolean' && plaintextConfig) || !isEmpty(plaintextConfig)) {
|
|
115
|
+
await Plaintext
|
|
116
|
+
.generate(html, plaintextDestination, merge(config, {filepath: file}))
|
|
117
|
+
.then(({plaintext, destination}) => fs.outputFile(destination, plaintext))
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
html = removePlaintextTags(html, config)
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Output file
|
|
124
|
+
*/
|
|
125
|
+
const parts = path.parse(destination)
|
|
126
|
+
const extension = get(templateConfig, 'destination.extension', 'html')
|
|
127
|
+
const finalDestination = `${parts.dir}/${parts.name}.${extension}`
|
|
128
|
+
|
|
129
|
+
await fs.outputFile(finalDestination, html)
|
|
130
|
+
.then(async () => {
|
|
131
|
+
/**
|
|
132
|
+
* Remove original file if its path is different
|
|
133
|
+
* from the final destination path.
|
|
134
|
+
*
|
|
135
|
+
* This ensures non-HTML files do not pollute
|
|
136
|
+
* the build destination folder.
|
|
137
|
+
*/
|
|
138
|
+
if (finalDestination !== file) {
|
|
139
|
+
await fs.remove(file)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// Keep track of handled files
|
|
143
|
+
files.push(file)
|
|
144
|
+
parsed.push(file)
|
|
145
|
+
})
|
|
146
|
+
})
|
|
147
|
+
.catch(error => {
|
|
148
|
+
switch (config.build.fail) {
|
|
149
|
+
case 'silent':
|
|
150
|
+
spinner.warn(`Failed to compile template: ${path.basename(file)}`)
|
|
151
|
+
break
|
|
152
|
+
case 'verbose':
|
|
153
|
+
spinner.warn(`Failed to compile template: ${path.basename(file)}`)
|
|
154
|
+
console.error(error)
|
|
155
|
+
break
|
|
156
|
+
default:
|
|
157
|
+
spinner.fail(`Failed to compile template: ${path.basename(file)}`)
|
|
158
|
+
throw error
|
|
159
|
+
}
|
|
160
|
+
})
|
|
161
|
+
})
|
|
135
162
|
|
|
136
|
-
|
|
163
|
+
const assets = {source: '', destination: 'assets', ...get(templateConfig, 'assets')}
|
|
137
164
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
165
|
+
if (Array.isArray(assets.source)) {
|
|
166
|
+
await asyncForEach(assets.source, async source => {
|
|
167
|
+
if (fs.existsSync(source)) {
|
|
168
|
+
await fs.copy(source, path.join(templateConfig.destination.path, assets.destination)).catch(error => spinner.warn(error.message))
|
|
169
|
+
}
|
|
170
|
+
})
|
|
171
|
+
} else {
|
|
172
|
+
if (fs.existsSync(assets.source)) {
|
|
173
|
+
await fs.copy(assets.source, path.join(templateConfig.destination.path, assets.destination)).catch(error => spinner.warn(error.message))
|
|
142
174
|
}
|
|
143
|
-
})
|
|
144
|
-
} else {
|
|
145
|
-
if (fs.existsSync(assets.source)) {
|
|
146
|
-
await fs.copy(assets.source, path.join(templateConfig.destination.path, assets.destination)).catch(error => spinner.warn(error.message))
|
|
147
175
|
}
|
|
148
|
-
}
|
|
149
176
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
177
|
+
await glob(path.join(templateConfig.destination.path, '/**/*.*'))
|
|
178
|
+
.then(contents => {
|
|
179
|
+
files = [...new Set([...files, ...contents])]
|
|
180
|
+
})
|
|
181
|
+
})
|
|
182
|
+
.catch(error => spinner.warn(error.message))
|
|
183
|
+
})
|
|
156
184
|
})
|
|
157
185
|
|
|
158
186
|
if (config.events && typeof config.events.afterBuild === 'function') {
|