mod-build 3.6.2 → 3.6.3--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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.6.3
4
+
5
+ - Updating `cache-bust` gulp task to use dashes instead of a period. For example, cached files will now be `home-51fbcbac.js` instead of `home.51fbcbac.js`
6
+
3
7
  ## 3.6.2
4
8
 
5
9
  - Adding `check-seasonal-variations` to grab seasons json; loop through the siteData for `seasonalVariations: {}`; find any active seasons; merge the json objects and adjust json content accordingly;
@@ -1,9 +1,14 @@
1
1
  module.exports = function(gulp, gulpPlugins, siteSettings) {
2
+ var path = require('path');
2
3
  return function() {
3
4
  return gulp.src(siteSettings.distFolder + '/**')
4
5
  .pipe(gulpPlugins.revAll.revision({
5
6
  dontRenameFile: [/^\/favicon.ico$/g, '.html', '.txt', /modlogo([\w|\s|-])*\.(?:svg)/g],
6
- dontUpdateReference: [/^\/favicon.ico$/g, '.html', '.txt', /modlogo([\w|\s|-])*\.(?:svg)/g]
7
+ dontUpdateReference: [/^\/favicon.ico$/g, '.html', '.txt', /modlogo([\w|\s|-])*\.(?:svg)/g],
8
+ transformFilename: function (file, hash) {
9
+ var ext = path.extname(file.path);
10
+ return path.basename(file.path, ext) + '-' + hash.substr(0, 8) + ext;
11
+ }
7
12
  }))
8
13
  .pipe(gulpPlugins.revDeleteOriginal())
9
14
  .pipe(gulp.dest(siteSettings.distFolder))
@@ -3,7 +3,7 @@ var source = require('vinyl-source-stream');
3
3
 
4
4
  // helper to allow us to define an "end" event to multiple streams
5
5
  function streamToDestination(gulp, siteSettings, inputPath, destPath, fileName) {
6
- var url = `https://${siteSettings.nodeEnv}/quote/resources/mod-site${inputPath}`;
6
+ var url = `https://${siteSettings.nodeEnv}/quote/resources${inputPath}`;
7
7
 
8
8
  return new Promise(resolve => { // eslint-disable-line no-undef
9
9
  request(url)
@@ -30,21 +30,23 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
30
30
  // key: inputPath, value: destPath
31
31
 
32
32
  externalResources = {
33
- '/templates/scripts/trusted-form.html': ['/templates/scripts/', 'trusted-form.html']
33
+ '/mod-site/templates/scripts/trusted-form.html': ['/templates/scripts/', 'trusted-form.html'],
34
+ '/mod-alytics/modalytics.min.js': ['/scripts/resources/', 'modalytics.min.js'],
35
+ '/mod-utils/modutils.min.js': ['/scripts/resources/', 'modutils.min.js']
34
36
  };
35
37
 
36
- Object.assign(externalResources, {'/templates/scripts/jornaya.html': ['/templates/scripts/', 'jornaya.html']});
38
+ Object.assign(externalResources, {'/mod-site/templates/scripts/jornaya.html': ['/templates/scripts/', 'jornaya.html']});
37
39
 
38
40
  if (isModWhiteLabel || domainHasModernize) {
39
- Object.assign(externalResources, {'/templates/scripts/recaptcha.html': ['/templates/scripts/', 'recaptcha.html']});
41
+ Object.assign(externalResources, {'/mod-site/templates/scripts/recaptcha.html': ['/templates/scripts/', 'recaptcha.html']});
40
42
  }
41
43
 
42
44
  // local dev files
43
45
  const remoteFilesForLocalDev = {
44
- '/scripts/mod-form.js': ['/temp/scripts/', 'mod-form.js'],
45
- '/scripts/mod-utils.js': ['/temp/scripts/', 'mod-utils.js'],
46
- '/scripts/qs-form.js': ['/temp/scripts/', 'qs-form.js'],
47
- '/scripts/vendor/maxmind-geoip2.js': ['/temp/scripts/', 'maxmind-geoip2.js']
46
+ '/mod-site/scripts/mod-form.js': ['/temp/scripts/', 'mod-form.js'],
47
+ '/mod-site/scripts/mod-utils.js': ['/temp/scripts/', 'mod-utils.js'],
48
+ '/mod-site/scripts/qs-form.js': ['/temp/scripts/', 'qs-form.js'],
49
+ '/mod-site/scripts/vendor/maxmind-geoip2.js': ['/temp/scripts/', 'maxmind-geoip2.js']
48
50
  };
49
51
 
50
52
  if (!nodeEnv) {
@@ -14,6 +14,7 @@ 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,
17
18
  '!' + siteSettings.srcFolder + '/' + siteSettings.scriptsCompiledFolder + '**/*.js' // do not lint compiled scripts
18
19
  ])
19
20
  .pipe(gulpPlugins.eslint(siteSettings.jsLint))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "3.6.2",
3
+ "version": "3.6.3--beta.1",
4
4
  "description": "Share components for S3 sites.",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -53,6 +53,7 @@
53
53
  "lodash": "^4.17.15",
54
54
  "lodash.merge": "^4.6.2",
55
55
  "nouislider": "^10.1.0",
56
+ "path": "^0.12.7",
56
57
  "request": "^2.88.0",
57
58
  "run-sequence": "^2.2.1",
58
59
  "sass": "^1.49.9",
@@ -1,58 +0,0 @@
1
- /* global modUtils locationStr */
2
-
3
- /**
4
- * Link this file into a TY page to render generic TYP and fire pixels
5
- */
6
-
7
- var thankyouPage = (function($) {
8
- var getVars = modUtils.getUrlParamsToObject(),
9
- apiUrl = modUtils.getApiDomain() + '/v1/';
10
-
11
- /**
12
- * Starts TY page
13
- */
14
- var init = function() {
15
- // Personalized intro copy (/thankyou page)
16
- if (getVars.fName && getVars.lName) {
17
- $('#intro').text(getVars.fName + ' ' + getVars.lName + ', thanks for your request.');
18
- }
19
-
20
- // Location
21
- if (getVars.city && getVars.state) {
22
- locationStr = getVars.city + ', ' + getVars.state;
23
- }
24
- if (locationStr) {
25
- $('[data-bind="location"]').text(locationStr);
26
- }
27
-
28
- // leadToken
29
- if (getVars.leadToken) {
30
- $('#leadid_token').val(getVars.leadToken);
31
- }
32
-
33
- // Grab and fire the affiliate pixel if one exists and not a duplicate.
34
- if (getVars.projectId && !getVars.isDupe) {
35
- $.ajax({
36
- url: apiUrl + 'tracking/get-typ-pixel/' + getVars.projectId,
37
- type: 'GET',
38
- dataType: 'json',
39
- crossDomain: true,
40
- success: function(response) {
41
- if (!response || !response.data.pixel) {
42
- return;
43
- }
44
-
45
- $('body').append(response.data.pixel);
46
- }
47
- });
48
- }
49
- };
50
-
51
- return {
52
- init: init
53
- };
54
- })(jQuery);
55
-
56
- $(document).ready(function() {
57
- thankyouPage.init();
58
- });