mod-build 3.6.3--beta.5 → 3.6.4-beta.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/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() {
|
package/gulp-tasks/js-lint.js
CHANGED
|
@@ -14,7 +14,6 @@ module.exports = function(gulp, gulpPlugins, siteSettings) {
|
|
|
14
14
|
'gulpfile.babel.js',
|
|
15
15
|
'gulp-tasks/*.js',
|
|
16
16
|
'!' + siteSettings.srcFolder + '/' + siteSettings.scriptsSubfolder + '/vendor/**/*.js', // do not lint 3rd party scripts,
|
|
17
|
-
'!' + siteSettings.srcFolder + '/' + siteSettings.scriptsSubfolder + '/resources/**/*.js', // do not lint copied shared resource scripts,
|
|
18
17
|
'!' + siteSettings.srcFolder + '/' + siteSettings.scriptsCompiledFolder + '**/*.js' // do not lint compiled scripts
|
|
19
18
|
])
|
|
20
19
|
.pipe(gulpPlugins.eslint(siteSettings.jsLint))
|
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
|
@@ -42,7 +42,7 @@ module.exports = function() {
|
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
|
|
45
|
-
// Grab component files from CDN so they can be swapped into build
|
|
45
|
+
// Grab component scss files from CDN so they can be swapped into build
|
|
46
46
|
'grab-shared-components': {
|
|
47
47
|
subtasks: [],
|
|
48
48
|
func: function(opts) {
|
|
@@ -56,20 +56,6 @@ module.exports = function() {
|
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
|
|
59
|
-
// Grab shared scripts from CDN so they can swapped into build
|
|
60
|
-
'grab-shared-scripts': {
|
|
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 + '/grab-shared-scripts')(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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mod-build",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.4-beta.1",
|
|
4
4
|
"description": "Share components for S3 sites.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
@@ -52,7 +52,6 @@
|
|
|
52
52
|
"jquery": "^3.2.1",
|
|
53
53
|
"lodash": "^4.17.15",
|
|
54
54
|
"lodash.merge": "^4.6.2",
|
|
55
|
-
"node-fetch": "^2.6.7",
|
|
56
55
|
"nouislider": "^10.1.0",
|
|
57
56
|
"path": "^0.12.7",
|
|
58
57
|
"request": "^2.88.0",
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
{{ fileInclude 'node_modules/mod-build/src/scripts/has-qs-params.js' }}
|
|
3
3
|
{{ fileInclude 'node_modules/mod-build/src/scripts/url-cleaner.js' }}
|
|
4
|
-
{{
|
|
5
|
-
|
|
6
|
-
Modalytics
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
{{#unless noheap}}
|
|
5
|
+
{{ fileInclude 'node_modules/mod-build/src/scripts/vendor/heap-tracking.js' }}
|
|
6
|
+
if(window.Modalytics) {
|
|
7
|
+
Modalytics.init();
|
|
8
|
+
} else {
|
|
9
|
+
{{ fileInclude 'node_modules/mod-build/src/scripts/vendor/heap-addeventproperties-identify.js' }}
|
|
10
|
+
}
|
|
11
|
+
{{/unless}}
|
|
12
|
+
|
|
10
13
|
{{#unless nogtm}}
|
|
11
14
|
{{ fileInclude 'node_modules/mod-build/src/scripts/vendor/google-tag-manager-head.js' }}
|
|
12
15
|
{{/unless}}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
var request = require('request');
|
|
2
|
-
var source = require('vinyl-source-stream');
|
|
3
|
-
|
|
4
|
-
function copyCurrentModalytics(gulp, gulpPlugins, siteSettings) {
|
|
5
|
-
return new Promise(resolve => {
|
|
6
|
-
request(`https://${siteSettings.nodeEnv}/quote/resources/mod-alytics/mod-alytics-version.txt`, function(err, resp, body) {
|
|
7
|
-
if (resp.statusCode !== 200) {
|
|
8
|
-
throw new Error(`${resp.statusCode}: Error while fetching mod-alytics-version.txt`);
|
|
9
|
-
}
|
|
10
|
-
var modalyticsVersion = body.split("/");
|
|
11
|
-
var file = modalyticsVersion[modalyticsVersion.length - 1];
|
|
12
|
-
resolve(file.replace(/\s+/g, ''));
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
})
|
|
16
|
-
.then((result) => {
|
|
17
|
-
return new Promise(resolve => {
|
|
18
|
-
request(`https://${siteSettings.nodeEnv}/quote/resources/mod-alytics/${result}`)
|
|
19
|
-
.on('response', resp => {
|
|
20
|
-
if (resp.statusCode !== 200) {
|
|
21
|
-
throw new Error(`${resp.statusCode} Error while fetching ${result}`);
|
|
22
|
-
}
|
|
23
|
-
})
|
|
24
|
-
.pipe(source(result))
|
|
25
|
-
.pipe(gulp.dest(`${siteSettings.srcFolder}/resources/scripts/mod-alytics`))
|
|
26
|
-
.on('finish', resolve);
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
module.exports = function(gulp, gulpPlugins, siteSettings) {
|
|
32
|
-
return function() {
|
|
33
|
-
const { nodeEnv } = siteSettings;
|
|
34
|
-
if (!nodeEnv) {
|
|
35
|
-
throw new Error('Missing environment variables. Did you start with gulp instead of npm run...?');
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return copyCurrentModalytics(gulp, gulpPlugins, siteSettings);
|
|
39
|
-
};
|
|
40
|
-
};
|