mod-build 3.6.1--beta.20 → 3.6.1--beta.21
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/gulp-tasks/build.js +4 -4
- package/gulp-tasks/check-seasonal-variations.js +13 -17
- package/gulp-tasks/serve.js +3 -3
- package/gulp-tasks/tasks.js +0 -14
- package/gulp-tasks/templates.js +10 -0
- package/package.json +1 -1
package/gulp-tasks/build.js
CHANGED
|
@@ -5,15 +5,15 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
|
|
|
5
5
|
var sequenceOpts;
|
|
6
6
|
|
|
7
7
|
if (siteData.useTypescript) {
|
|
8
|
-
sequenceOpts = ['clean', 'grab-cdn', 'grab-shared-components', '
|
|
8
|
+
sequenceOpts = ['clean', 'grab-cdn', 'grab-shared-components', 'templates', 'styles', 'compile-prod', 'js-lint', 'html-min', 'css-min', 'js-min', 'img-min', 'extras', 'brand', 'cache-bust', 'build-stat'];
|
|
9
9
|
} else if (siteData.isWhiteLabel) {
|
|
10
10
|
if (siteData.isQSPage) {
|
|
11
|
-
sequenceOpts = ['clean', 'grab-cdn', 'grab-shared-components', '
|
|
11
|
+
sequenceOpts = ['clean', 'grab-cdn', 'grab-shared-components', 'templates', 'styles', 'grab-theme-json', 'combine-files', 'grab-images', 'copy-json', 'js-lint', 'html-min', 'css-min', 'js-min', 'img-min', 'extras', 'brand', 'copy-files-to-build-path', 'cache-bust', 'grab-tooltips-json', 'build-stat'];
|
|
12
12
|
} else {
|
|
13
|
-
sequenceOpts = ['clean', 'grab-cdn', 'grab-shared-components', '
|
|
13
|
+
sequenceOpts = ['clean', 'grab-cdn', 'grab-shared-components', 'templates', 'styles', 'combine-files', 'grab-images', 'js-lint', 'html-min', 'css-min', 'js-min', 'img-min', 'extras', 'brand', 'cache-bust', 'grab-tooltips-json', 'build-stat'];
|
|
14
14
|
}
|
|
15
15
|
} else {
|
|
16
|
-
sequenceOpts = ['clean', 'grab-cdn', 'grab-shared-components', '
|
|
16
|
+
sequenceOpts = ['clean', 'grab-cdn', 'grab-shared-components', 'templates', 'styles', 'js-lint', 'html-min', 'css-min', 'js-min', 'img-min', 'extras', 'brand', 'cache-bust', 'build-stat'];
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
runSequence(...sequenceOpts, function() {
|
|
@@ -12,6 +12,17 @@ function getDefinedSeasons(gulp, gulpPlugins, siteSettings) {
|
|
|
12
12
|
"endDate": "10-31"
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
+
// return new Promise(resolve => { // eslint-disable-line no-undef
|
|
16
|
+
// request(`https://${siteSettings.nodeEnv}/quote/resources/mod-site/data/seasons.json`)
|
|
17
|
+
// .on('response', resp => {
|
|
18
|
+
// if (resp.statusCode !== 200) {
|
|
19
|
+
// throw new Error(`${resp.statusCode} Error while fetching data/seasons.json`);
|
|
20
|
+
// }
|
|
21
|
+
// })
|
|
22
|
+
// .pipe(source('seasons'))
|
|
23
|
+
// .then(seasons => { return seasons } )
|
|
24
|
+
// .on('finish', resolve);
|
|
25
|
+
// });
|
|
15
26
|
}
|
|
16
27
|
|
|
17
28
|
function getActiveSeasons() {
|
|
@@ -30,23 +41,8 @@ function getActiveSeasons() {
|
|
|
30
41
|
activeSeason.push(seasonName)
|
|
31
42
|
}
|
|
32
43
|
}
|
|
44
|
+
|
|
33
45
|
return activeSeason;
|
|
34
46
|
}
|
|
35
47
|
|
|
36
|
-
module.exports =
|
|
37
|
-
const activeSeason = getActiveSeasons();
|
|
38
|
-
if (activeSeason !== ''){
|
|
39
|
-
if (activeSeason in siteData.seasonalVariations) {
|
|
40
|
-
siteData = {...siteData, ...siteData.seasonalVariations[activeSeason]};
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
console.log(siteData);
|
|
45
|
-
|
|
46
|
-
return function() {
|
|
47
|
-
const { nodeEnv } = siteSettings;
|
|
48
|
-
if (!nodeEnv) {
|
|
49
|
-
throw new Error('Missing environment variables. Did you start with gulp instead of npm run...?');
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
};
|
|
48
|
+
module.exports = getActiveSeasons;
|
package/gulp-tasks/serve.js
CHANGED
|
@@ -4,11 +4,11 @@ module.exports.src = function(gulp, gulpPlugins, siteSettings, siteData) {
|
|
|
4
4
|
var runSequence = require('run-sequence');
|
|
5
5
|
var sequenceOpts;
|
|
6
6
|
if (siteData.useTypescript) {
|
|
7
|
-
sequenceOpts = ['clean', 'grab-cdn', 'grab-shared-components', '
|
|
7
|
+
sequenceOpts = ['clean', 'grab-cdn', 'grab-shared-components', 'templates', 'styles', 'compile', 'grab-tooltips-json', 'combine-files', 'grab-images', 'js-lint'];
|
|
8
8
|
} else if (siteData.isQSPage) {
|
|
9
|
-
sequenceOpts = ['clean', 'grab-cdn', 'grab-shared-components', '
|
|
9
|
+
sequenceOpts = ['clean', 'grab-cdn', 'grab-shared-components', 'templates', 'styles', 'grab-theme-json', 'grab-tooltips-json', 'combine-files', 'grab-images', 'js-lint'];
|
|
10
10
|
} else {
|
|
11
|
-
sequenceOpts = ['clean', 'grab-cdn', 'grab-shared-components', '
|
|
11
|
+
sequenceOpts = ['clean', 'grab-cdn', 'grab-shared-components', 'templates', 'styles', 'grab-tooltips-json', 'combine-files', 'grab-images', 'js-lint'];
|
|
12
12
|
}
|
|
13
13
|
runSequence(...sequenceOpts, () => {
|
|
14
14
|
// Run a BrowserSync server
|
package/gulp-tasks/tasks.js
CHANGED
|
@@ -56,20 +56,6 @@ module.exports = function() {
|
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
|
|
59
|
-
// Check seasons defined on CDN & update seasonal variations accordingly
|
|
60
|
-
'check-seasonal-variations': {
|
|
61
|
-
subtasks: [],
|
|
62
|
-
func: function(opts) {
|
|
63
|
-
if ('undefined' === typeof opts.gulpTasksFolderPath) {
|
|
64
|
-
opts.gulpTasksFolderPath = '.';
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (opts.siteData.useCDN) {
|
|
68
|
-
return require(opts.gulpTasksFolderPath + '/check-seasonal-variations')(opts.gulp, opts.gulpPlugins, opts.gulpSettings, opts.siteData);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
|
|
73
59
|
// Link scss files
|
|
74
60
|
'sass-lint': {
|
|
75
61
|
subtasks: [],
|
package/gulp-tasks/templates.js
CHANGED
|
@@ -12,6 +12,15 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
|
|
|
12
12
|
var qsFooterData = require('../src/data/components/qs-footer.js');
|
|
13
13
|
var quoteFooterData = require('../src/data/components/quote-footer.js');
|
|
14
14
|
|
|
15
|
+
// Checking for seasonal variations in the template.js
|
|
16
|
+
var checkSeasonalVariations = require('./check-seasonal-variations.js');
|
|
17
|
+
const activeSeason = checkSeasonalVariations();
|
|
18
|
+
if (activeSeason !== ''){
|
|
19
|
+
if (activeSeason in siteData.seasonalVariations) {
|
|
20
|
+
siteData = {...siteData, ...siteData.seasonalVariations[activeSeason]};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
15
24
|
var templatesData = Object.assign(commonData(), qsFooterData(siteData), quoteFooterData(siteData), siteData, { isLocal, nodeEnv, assetsPath, buildPath });
|
|
16
25
|
|
|
17
26
|
// This is helper function to evaluate JS expressions
|
|
@@ -136,4 +145,5 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
|
|
|
136
145
|
}))
|
|
137
146
|
.pipe(gulp.dest(siteSettings.tmpFolder));
|
|
138
147
|
};
|
|
148
|
+
|
|
139
149
|
};
|