@newlogic-digital/core 0.9.13 → 1.0.0-beta.2
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +15 -45
- package/index.js +262 -43
- package/package.json +13 -58
- package/LICENSE +0 -674
- package/modules/Core.js +0 -626
- package/modules/Emails.js +0 -110
- package/modules/Icons.js +0 -140
- package/modules/Scripts.js +0 -321
- package/modules/Serve.js +0 -124
- package/modules/Styles.js +0 -298
- package/modules/Templates.js +0 -468
- package/modules/Utils.js +0 -299
- package/modules/Watch.js +0 -75
- package/modules/tailwind/index.cjs +0 -84
- package/modules/tailwind/index.js +0 -75
- package/packages/gulp-clean-css/LICENSE +0 -20
- package/packages/gulp-clean-css/README.md +0 -79
- package/packages/gulp-clean-css/index.js +0 -66
- package/packages/gulp-clean-css/package.json +0 -68
- package/packages/gulp-twig2html/CHANGELOG.md +0 -77
- package/packages/gulp-twig2html/LICENSE +0 -22
- package/packages/gulp-twig2html/README.md +0 -112
- package/packages/gulp-twig2html/index.js +0 -30
- package/packages/gulp-twig2html/package.json +0 -47
- package/packages/postcss-inset/CHANGELOG.md +0 -5
- package/packages/postcss-inset/LICENSE.md +0 -106
- package/packages/postcss-inset/README.md +0 -121
- package/packages/postcss-inset/index.cjs.js +0 -49
- package/packages/postcss-inset/index.es.mjs +0 -47
- package/packages/postcss-inset/index.js +0 -47
- package/packages/postcss-inset/package.json +0 -58
- package/packages/twig-renderer/CHANGELOG.md +0 -66
- package/packages/twig-renderer/LICENSE +0 -22
- package/packages/twig-renderer/README.md +0 -93
- package/packages/twig-renderer/package.json +0 -49
- package/packages/twig-renderer/twig-renderer.js +0 -90
package/modules/Templates.js
DELETED
@@ -1,468 +0,0 @@
|
|
1
|
-
import fs from "fs";
|
2
|
-
import path from "path";
|
3
|
-
import lazypipe from "lazypipe";
|
4
|
-
import gulpif from "gulp-if";
|
5
|
-
import twig from "../packages/gulp-twig2html/index.js";
|
6
|
-
import lodash from "lodash";
|
7
|
-
import gulp from "gulp";
|
8
|
-
import plumber from "gulp-plumber";
|
9
|
-
import minifier from "html-minifier";
|
10
|
-
import through from "through2";
|
11
|
-
import Prism from 'prismjs'
|
12
|
-
import loadLanguages from 'prismjs/components/index.js'
|
13
|
-
import NormalizeWhitespace from 'prismjs/plugins/normalize-whitespace/prism-normalize-whitespace.js'
|
14
|
-
import {Config, Exists, Functions, Modules, root} from "./Core.js";
|
15
|
-
|
16
|
-
loadLanguages(['markup', 'css', 'javascript'])
|
17
|
-
|
18
|
-
export class Templates {
|
19
|
-
get functions() {
|
20
|
-
return Object.assign(Config.templates.functions, {
|
21
|
-
"color": (color, theme) => {
|
22
|
-
if (typeof theme === "undefined") {
|
23
|
-
theme = "main"
|
24
|
-
}
|
25
|
-
|
26
|
-
if (!Exists.styles) {
|
27
|
-
return "inherit"
|
28
|
-
}
|
29
|
-
|
30
|
-
if ((theme || color) && Config.styles.themePath.length !== 0) {
|
31
|
-
let pathColors = Config.styles.themePath.replace("{THEME}", theme).replace("{FORMAT}", Config.styles.format);
|
32
|
-
|
33
|
-
if (fs.existsSync(`${root + Config.paths.input.styles}/${pathColors}`)) {
|
34
|
-
let colors = fs.readFileSync(`${root + Config.paths.input.styles}/${pathColors}`, 'utf8').toString();
|
35
|
-
let parse = colors.substring(colors.indexOf(color)+color.length+1,colors.length);
|
36
|
-
|
37
|
-
return parse.substring(0,parse.indexOf(";")).replace(" ", "");
|
38
|
-
}
|
39
|
-
}
|
40
|
-
},
|
41
|
-
"fetch": (data) => {
|
42
|
-
if (typeof data !== "undefined") {
|
43
|
-
if (!fs.existsSync(root + Config.paths.cdn)){
|
44
|
-
fs.mkdirSync(root + Config.paths.cdn);
|
45
|
-
}
|
46
|
-
if (data.indexOf("http") > -1) {
|
47
|
-
if (data.indexOf("googleapis.com") > -1) {
|
48
|
-
let google_name = data.substring(data.indexOf("=") + 1, data.length).toLowerCase(),
|
49
|
-
google_name_path = root + Config.paths.cdn + "/inline." + google_name.substring(0,google_name.indexOf(":")) + ".css";
|
50
|
-
|
51
|
-
if (fs.existsSync(google_name_path)) {
|
52
|
-
return fs.readFileSync(google_name_path, 'utf8').toString();
|
53
|
-
} else {
|
54
|
-
(async() => await Functions.download(data, google_name_path))()
|
55
|
-
|
56
|
-
return fs.readFileSync(google_name_path, 'utf8').toString();
|
57
|
-
}
|
58
|
-
} else {
|
59
|
-
let font_name = data.substring(data.lastIndexOf("/") + 1, data.length).toLowerCase(),
|
60
|
-
font_name_path = root + Config.paths.cdn + "/inline." + font_name;
|
61
|
-
|
62
|
-
if (fs.existsSync(font_name_path)) {
|
63
|
-
return fs.readFileSync(font_name_path, 'utf8').toString();
|
64
|
-
} else {
|
65
|
-
(async() => await Functions.download(data, font_name_path))()
|
66
|
-
|
67
|
-
return fs.readFileSync(font_name_path, 'utf8').toString();
|
68
|
-
}
|
69
|
-
}
|
70
|
-
} else {
|
71
|
-
let slash = data.indexOf("/")+1;
|
72
|
-
if (slash > 1) {
|
73
|
-
slash = 0;
|
74
|
-
}
|
75
|
-
|
76
|
-
return fs.readFileSync(root + data.substring(slash,data.length),'utf8').toString();
|
77
|
-
}
|
78
|
-
}
|
79
|
-
},
|
80
|
-
"randomColor": () => {
|
81
|
-
return "#" + Math.random().toString(16).slice(2, 8);
|
82
|
-
},
|
83
|
-
"placeholder": (width, height, picsum, colors) => {
|
84
|
-
if (typeof colors === "undefined") {
|
85
|
-
colors = ["333", "444", "666", "222", "777", "888", "111"];
|
86
|
-
} else {
|
87
|
-
colors = [colors]
|
88
|
-
}
|
89
|
-
if (Config.local === false) {
|
90
|
-
let webp = "";
|
91
|
-
if (Config.templates.placeholder.webp === true) {
|
92
|
-
webp = ".webp"
|
93
|
-
}
|
94
|
-
if (!Config.templates.placeholder.picsum) {
|
95
|
-
if(Config.templates.placeholder.lorempixel === ""){
|
96
|
-
|
97
|
-
return "https://via.placeholder.com/"+width+"x"+height+"/"+colors[Math.floor(Math.random()*colors.length)]+`${webp}`;
|
98
|
-
}
|
99
|
-
else {
|
100
|
-
return "https://lorempixel.com/"+width+"/"+height+"/"+Config.templates.placeholder.lorempixel+"/"+Math.floor(Math.random()*10);
|
101
|
-
}
|
102
|
-
} else {
|
103
|
-
if (!isNaN(picsum)) {
|
104
|
-
return "https://picsum.photos/"+width+"/"+height+webp+"?image="+ picsum;
|
105
|
-
} else {
|
106
|
-
return "https://picsum.photos/"+width+"/"+height+webp+"?image="+ Math.floor(Math.random() * 100);
|
107
|
-
}
|
108
|
-
}
|
109
|
-
} else {
|
110
|
-
let text = width+"x"+height,
|
111
|
-
svg = encodeURIComponent(Functions.stripIndent('<svg width="'+width+'" height="'+height+'" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 '+width+' '+height+'" preserveAspectRatio="none"><defs><style type="text/css">#holder text {fill: #969696;font-family: sans-serif;font-size: 18px;font-weight: normal}</style></defs><g id="holder"><rect width="100%" height="100%" fill="#'+colors[Math.floor(Math.random()*colors.length)]+'"></rect><g><text text-anchor="middle" x="50%" y="50%" dy=".3em">'+text+'</text></g></g></svg>'));
|
112
|
-
|
113
|
-
return "data:image/svg+xml;charset=UTF-8,"+svg;
|
114
|
-
}
|
115
|
-
},
|
116
|
-
"lazy": (width, height) => {
|
117
|
-
let svg = encodeURIComponent(Functions.stripIndent('<svg width="'+width+'" height="'+height+'" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 '+width+' '+height+'"></svg>'));
|
118
|
-
|
119
|
-
return "data:image/svg+xml;charset=UTF-8,"+svg;
|
120
|
-
},
|
121
|
-
"ratio": (width, height) => {
|
122
|
-
return (height/width) * 100;
|
123
|
-
},
|
124
|
-
"webfont": (data) => {
|
125
|
-
let urls = [];
|
126
|
-
|
127
|
-
if (typeof data["google"] !== "undefined") {
|
128
|
-
data["google"]["families"].forEach(function(i){
|
129
|
-
urls.push("https://fonts.googleapis.com/css2?family="+i);
|
130
|
-
});
|
131
|
-
}
|
132
|
-
|
133
|
-
if (typeof data["typekit"] !== "undefined") {
|
134
|
-
urls.push(`https://use.typekit.net/${data["typekit"]["id"]}.css`);
|
135
|
-
}
|
136
|
-
|
137
|
-
if (typeof data["custom"] !== "undefined") {
|
138
|
-
data["custom"]["urls"].forEach(function(i){
|
139
|
-
urls.push(i);
|
140
|
-
});
|
141
|
-
}
|
142
|
-
|
143
|
-
return urls;
|
144
|
-
}
|
145
|
-
})
|
146
|
-
}
|
147
|
-
get filters() {
|
148
|
-
return Object.assign(Config.templates.filters, {
|
149
|
-
"asset": (url) => {
|
150
|
-
let directoryPath = "";
|
151
|
-
|
152
|
-
if (Config.serve.mode === "dev" && url.indexOf("/" + Config.paths.input.root) === 0 || url.includes("https://") || url.includes("http://")) {
|
153
|
-
return url;
|
154
|
-
}
|
155
|
-
|
156
|
-
if (Config.serve.mode !== "dev" && url.indexOf("/" + Config.paths.input.root) === 0) {
|
157
|
-
url = url
|
158
|
-
.replace(`/${Config.paths.input.styles}`, `/${Config.paths.output.styles}`)
|
159
|
-
.replace(`/${Config.paths.input.scripts}`, `/${Config.paths.output.scripts}`)
|
160
|
-
.replace(`/${Config.paths.input.assets}`, `/${Config.paths.output.assets}`)
|
161
|
-
.replace(`/${Config.paths.input.icons}`, `/${Config.paths.output.icons}`)
|
162
|
-
.replace(".less", ".css")
|
163
|
-
}
|
164
|
-
|
165
|
-
directoryPath = url.substr(0, url.lastIndexOf("/"));
|
166
|
-
|
167
|
-
if (directoryPath.indexOf("/") === 0) {
|
168
|
-
directoryPath = directoryPath.slice(1);
|
169
|
-
}
|
170
|
-
|
171
|
-
if (fs.existsSync(root + `${directoryPath}/rev-manifest.json`)) {
|
172
|
-
let rev = JSON.parse(fs.readFileSync(root + `${directoryPath}/rev-manifest.json`, 'utf8').toString());
|
173
|
-
|
174
|
-
Object.keys(rev).forEach(function eachKey(key) {
|
175
|
-
if (url.indexOf(key) > -1) {
|
176
|
-
url = url.replace(key,rev[key]);
|
177
|
-
}
|
178
|
-
})
|
179
|
-
} else if (directoryPath.indexOf(Config.paths.output.assets) !== -1 && fs.existsSync(`${root + Config.paths.output.assets}/rev-manifest.json`)) {
|
180
|
-
let rev = JSON.parse(fs.readFileSync(root + Config.paths.output.assets + '/rev-manifest.json', 'utf8').toString());
|
181
|
-
|
182
|
-
Object.keys(rev).forEach(function eachKey(key) {
|
183
|
-
if (url.indexOf(key) > -1) {
|
184
|
-
url = url.replace(key,rev[key]);
|
185
|
-
}
|
186
|
-
})
|
187
|
-
}
|
188
|
-
|
189
|
-
if (Config.paths.output.rewrite && url.indexOf(`/${Config.paths.output.root}`) === 0) {
|
190
|
-
url = url.replace(`/${Config.paths.output.root}`, Config.paths.base.length > 0 ? `/${Config.paths.base}` : "")
|
191
|
-
}
|
192
|
-
|
193
|
-
return url;
|
194
|
-
},
|
195
|
-
"rem": (value) => {
|
196
|
-
return `${value/16}rem`;
|
197
|
-
},
|
198
|
-
"encode64": (path) => {
|
199
|
-
let svg = encodeURIComponent(Functions.stripIndent(path));
|
200
|
-
|
201
|
-
return "data:image/svg+xml;charset=UTF-8,"+svg;
|
202
|
-
},
|
203
|
-
"exists": (path) => {
|
204
|
-
if (path.indexOf("/") === 0) {
|
205
|
-
path = path.slice(1);
|
206
|
-
}
|
207
|
-
|
208
|
-
return fs.existsSync(root + path)
|
209
|
-
},
|
210
|
-
"tel": (value) => {
|
211
|
-
return value.replace(/\s+/g, '').replace("(","").replace(")","");
|
212
|
-
}
|
213
|
-
})
|
214
|
-
}
|
215
|
-
get tags() {
|
216
|
-
return Config.templates.tags.concat([
|
217
|
-
(Twig) => {
|
218
|
-
Twig.exports.extendTag({
|
219
|
-
type: "code",
|
220
|
-
regex: /^code\s+(.+)$/,
|
221
|
-
next: ["endcode"], // match the type of the end tag
|
222
|
-
open: true,
|
223
|
-
compile: function (token) {
|
224
|
-
const expression = token.match[1];
|
225
|
-
|
226
|
-
token.stack = Reflect.apply(Twig.expression.compile, this, [{
|
227
|
-
type: Twig.expression.type.expression,
|
228
|
-
value: expression
|
229
|
-
}]).stack;
|
230
|
-
|
231
|
-
delete token.match;
|
232
|
-
return token;
|
233
|
-
},
|
234
|
-
parse: function (token, context, chain) {
|
235
|
-
let type = Reflect.apply(Twig.expression.parse, this, [token.stack, context]);
|
236
|
-
let output = this.parse(token.output, context);
|
237
|
-
let mirror = false;
|
238
|
-
|
239
|
-
if (type.includes(":mirror")) {
|
240
|
-
mirror = true;
|
241
|
-
type = type.replace(":mirror", "")
|
242
|
-
}
|
243
|
-
|
244
|
-
const Normalize = new NormalizeWhitespace({
|
245
|
-
'remove-trailing': true,
|
246
|
-
'remove-indent': true,
|
247
|
-
'left-trim': true,
|
248
|
-
'right-trim': true,
|
249
|
-
});
|
250
|
-
|
251
|
-
const wrap = (code, lang) => {
|
252
|
-
return `<pre class="language-${lang}"><code>${code}</code></pre>`
|
253
|
-
}
|
254
|
-
|
255
|
-
const highlight = (str, lang) => {
|
256
|
-
if (!lang) {
|
257
|
-
return wrap(str, 'text')
|
258
|
-
}
|
259
|
-
lang = lang.toLowerCase()
|
260
|
-
const rawLang = lang
|
261
|
-
if (lang === 'vue' || lang === 'html') {
|
262
|
-
lang = 'markup'
|
263
|
-
}
|
264
|
-
if (lang === 'md') {
|
265
|
-
lang = 'markdown'
|
266
|
-
}
|
267
|
-
if (lang === 'ts') {
|
268
|
-
lang = 'typescript'
|
269
|
-
}
|
270
|
-
if (lang === 'py') {
|
271
|
-
lang = 'python'
|
272
|
-
}
|
273
|
-
if (!Prism.languages[lang]) {
|
274
|
-
try {
|
275
|
-
loadLanguages([lang])
|
276
|
-
} catch (e) {
|
277
|
-
console.warn(`Syntax highlight for language "${lang}" is not supported.`)
|
278
|
-
}
|
279
|
-
}
|
280
|
-
if (Prism.languages[lang]) {
|
281
|
-
const code = Prism.highlight(Normalize.normalize(str), Prism.languages[lang], lang)
|
282
|
-
return wrap(code, rawLang)
|
283
|
-
}
|
284
|
-
return wrap(str, 'text')
|
285
|
-
}
|
286
|
-
|
287
|
-
return {
|
288
|
-
chain: chain,
|
289
|
-
output: `${mirror ? output : ""}${highlight(output, type)}`
|
290
|
-
};
|
291
|
-
}
|
292
|
-
});
|
293
|
-
Twig.exports.extendTag({
|
294
|
-
type: "endcode",
|
295
|
-
regex: /^endcode$/,
|
296
|
-
next: [ ],
|
297
|
-
open: false
|
298
|
-
});
|
299
|
-
},
|
300
|
-
(Twig) => {
|
301
|
-
Twig.exports.extendTag({
|
302
|
-
type: "json",
|
303
|
-
regex: /^json\s+(.+)$/,
|
304
|
-
next: ["endjson"],
|
305
|
-
open: true,
|
306
|
-
compile: function (token) {
|
307
|
-
const expression = token.match[1];
|
308
|
-
|
309
|
-
token.stack = Reflect.apply(Twig.expression.compile, this, [{
|
310
|
-
type: Twig.expression.type.expression,
|
311
|
-
value: expression
|
312
|
-
}]).stack;
|
313
|
-
|
314
|
-
delete token.match;
|
315
|
-
return token;
|
316
|
-
},
|
317
|
-
parse: function (token, context, chain) {
|
318
|
-
let name = Reflect.apply(Twig.expression.parse, this, [token.stack, context]);
|
319
|
-
let output = this.parse(token.output, context);
|
320
|
-
|
321
|
-
return {
|
322
|
-
chain: chain,
|
323
|
-
output: JSON.stringify({
|
324
|
-
[name]: minifier.minify(output, {
|
325
|
-
collapseWhitespace: true,
|
326
|
-
collapseInlineTagWhitespace: false,
|
327
|
-
minifyCSS: true,
|
328
|
-
minifyJS: true
|
329
|
-
})
|
330
|
-
})
|
331
|
-
};
|
332
|
-
}
|
333
|
-
});
|
334
|
-
Twig.exports.extendTag({
|
335
|
-
type: "endjson",
|
336
|
-
regex: /^endjson$/,
|
337
|
-
next: [ ],
|
338
|
-
open: false
|
339
|
-
});
|
340
|
-
}
|
341
|
-
])
|
342
|
-
}
|
343
|
-
async build(type) {
|
344
|
-
const data = (await import('gulp-data')).default;
|
345
|
-
const htmlmin = (await import('gulp-htmlmin')).default;
|
346
|
-
const rename = (await import('gulp-rename')).default;
|
347
|
-
|
348
|
-
const opts = {
|
349
|
-
collapseWhitespace: type === "production",
|
350
|
-
collapseInlineTagWhitespace: false,
|
351
|
-
minifyCSS: true,
|
352
|
-
minifyJS: true
|
353
|
-
}
|
354
|
-
|
355
|
-
let outputDir = "/" + Config.paths.output.root;
|
356
|
-
|
357
|
-
if (Config.paths.output.root === Config.paths.output.assets) {
|
358
|
-
outputDir = ""
|
359
|
-
}
|
360
|
-
|
361
|
-
const contextParams = {
|
362
|
-
config: Config,
|
363
|
-
lang: Config.lang,
|
364
|
-
outputPath: "/" + Config.paths.output.root,
|
365
|
-
inputPath: "/" + Config.paths.input.root,
|
366
|
-
resolvePath: Config.serve.mode === "dev" ? "" : outputDir,
|
367
|
-
}
|
368
|
-
|
369
|
-
const twigParams = {
|
370
|
-
functions: this.functions,
|
371
|
-
filters: this.filters,
|
372
|
-
extensions: this.tags,
|
373
|
-
context: lodash.merge(contextParams, {
|
374
|
-
layout: {template: Config.templates.layout}
|
375
|
-
}),
|
376
|
-
namespaces: {
|
377
|
-
'src': Config.paths.input.root
|
378
|
-
},
|
379
|
-
globals: root + Config.paths.input.main
|
380
|
-
}
|
381
|
-
|
382
|
-
const clearFile = () => {
|
383
|
-
return through.obj((file, enc, cb) => {
|
384
|
-
if (file.isBuffer()) {
|
385
|
-
if (file.extname === ".json") {
|
386
|
-
file = null;
|
387
|
-
}
|
388
|
-
|
389
|
-
cb(null, file);
|
390
|
-
}
|
391
|
-
});
|
392
|
-
};
|
393
|
-
|
394
|
-
const fileJSON = (file) => {
|
395
|
-
if (path.basename(file.path).indexOf("json") > -1 || path.basename(file.path).indexOf("dialog") > -1) {
|
396
|
-
return true;
|
397
|
-
}
|
398
|
-
}
|
399
|
-
|
400
|
-
const fileTemplate = (file) => {
|
401
|
-
if (fs.existsSync(file.path.replace('.json',`.${Config.templates.format}`))) {
|
402
|
-
return true;
|
403
|
-
}
|
404
|
-
}
|
405
|
-
|
406
|
-
const hbsData = (file) => {
|
407
|
-
let fileName = path.basename(file.path);
|
408
|
-
let filePath = `${root + Config.paths.input.templates}/${fileName.replace(`.${Config.templates.format}`,'.json')}`;
|
409
|
-
let main = {};
|
410
|
-
|
411
|
-
if (fs.existsSync(root + Config.paths.input.main)) {
|
412
|
-
main = lodash.merge({layout: {template: Config.templates.layout}}, JSON.parse(fs.readFileSync(root + Config.paths.input.main).toString()));
|
413
|
-
}
|
414
|
-
|
415
|
-
if (fs.existsSync(filePath)) {
|
416
|
-
return lodash.merge(main, JSON.parse(fs.readFileSync(filePath).toString()));
|
417
|
-
} else {
|
418
|
-
return main;
|
419
|
-
}
|
420
|
-
}
|
421
|
-
|
422
|
-
const hbsLayout = () => {
|
423
|
-
return through.obj((file, enc, cb) => {
|
424
|
-
if (file.isBuffer()) {
|
425
|
-
|
426
|
-
file.contents = Buffer.from("{{> (lookup layout 'template')}}");
|
427
|
-
|
428
|
-
cb(null, file);
|
429
|
-
}
|
430
|
-
});
|
431
|
-
}
|
432
|
-
|
433
|
-
const hbsPartials = `${root + Config.paths.input.templates}/**/*.hbs`;
|
434
|
-
const hbsHelpers = Modules.hbs.helpers(Object.assign(this.filters, this.functions));
|
435
|
-
|
436
|
-
const renameJson = lazypipe().pipe(rename, { extname: '.json' });
|
437
|
-
const renameHtml = lazypipe().pipe(rename, { extname: '.html' }).pipe(htmlmin,opts);
|
438
|
-
|
439
|
-
const buildLayoutClear = lazypipe().pipe(() => gulpif(fileTemplate, clearFile()));
|
440
|
-
const buildLayoutTwig = lazypipe().pipe(() => gulpif(Config.templates.format === "twig", twig(lodash.merge(twigParams, {data: "{% include layout.template %}"}))));
|
441
|
-
const buildLayoutHbs = lazypipe()
|
442
|
-
.pipe(() => gulpif(Config.templates.format === "hbs", hbsLayout()))
|
443
|
-
.pipe(() => gulpif(Config.templates.format === "hbs", data((file) => hbsData(file))))
|
444
|
-
.pipe(() => gulpif(Config.templates.format === "hbs", Modules.hbs.module(hbsPartials, hbsHelpers, contextParams)));
|
445
|
-
|
446
|
-
const buildClassic = lazypipe()
|
447
|
-
.pipe(() => gulpif("*.twig", twig(twigParams)))
|
448
|
-
.pipe(() => gulpif("*.hbs", data((file) => hbsData(file))))
|
449
|
-
.pipe(() => gulpif("*.hbs", Modules.hbs.module(hbsPartials, hbsHelpers, contextParams)));
|
450
|
-
|
451
|
-
return Promise.all([
|
452
|
-
new Promise(resolve => gulp.src([`${root + Config.paths.input.templates}/*.{hbs,html,twig}`])
|
453
|
-
.pipe(plumber(Functions.plumber))
|
454
|
-
.pipe(buildClassic())
|
455
|
-
.pipe(gulpif(fileJSON, renameJson(), renameHtml()))
|
456
|
-
.pipe(gulp.dest(root + Config.paths.output.root))
|
457
|
-
.on("end", resolve)),
|
458
|
-
new Promise(resolve => gulp.src([`${root + Config.paths.input.templates}/*.json`])
|
459
|
-
.pipe(plumber(Functions.plumber))
|
460
|
-
.pipe(buildLayoutClear())
|
461
|
-
.pipe(buildLayoutTwig())
|
462
|
-
.pipe(buildLayoutHbs())
|
463
|
-
.pipe(renameHtml())
|
464
|
-
.pipe(gulp.dest(root + Config.paths.output.root))
|
465
|
-
.on("end", resolve))
|
466
|
-
])
|
467
|
-
}
|
468
|
-
}
|