mod-build 3.6.38 → 3.6.39--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.39
4
+
5
+ - implementing a buffer to our `grab-shared-scripts` task, which fixes the hashing issue we were facing for our larger files. updated the hashing algorithm to MD5, so it matches our CircleCI CLI hash. updated `mod-form-beta.min.js` to `homeowner.min.js`
6
+
3
7
  ## 3.6.38
4
8
 
5
9
  - when we removed the mod-form-beta functionality in 3.6.37 — we needed to also remove the replace search in the function.
@@ -4,6 +4,7 @@ var replace = require('gulp-replace');
4
4
  var hash = require('gulp-hash');
5
5
  var tap = require('gulp-tap');
6
6
  var path = require('path');
7
+ var buffer = require('gulp-buffer');
7
8
 
8
9
  const fileNames = {
9
10
  modAlyticsFileName: '',
@@ -14,7 +15,7 @@ const fileNames = {
14
15
  qsFooterStylesFileName: '',
15
16
  modFormFileName: '',
16
17
  qsFormFileName: '',
17
- newModFormFileName: ''
18
+ homeownerFormFileName: ''
18
19
  };
19
20
  var isQuotePageOrUseRelativePath = false;
20
21
  var resourceURL = '';
@@ -28,10 +29,10 @@ function replaceModalyticsSrc(gulp, gulpPlugins, siteSettings, siteData) {
28
29
  function replaceFootAssetScripts(gulp, gulpPlugins, siteSettings, siteData) {
29
30
  const resourcePath = isQuotePageOrUseRelativePath ? '{{#if this.nodeModulesPath}}{{this.nodeModulesPath}}{{/if}}resources/scripts' : '/resources/scripts';
30
31
  return gulp.src(siteSettings.srcFolder + '/shared-components/foot-assets/foot-assets.html')
31
- .pipe(replace(/"(?:(?!"|js")[\s\S])+(modutils|mod-utils.*?)js"|"(?:(?!"|")[\s\S])+(footer\/footer-component.*?)js"|"(?:(?!"|")[\s\S])+(mod-form\/mod-form.*?)js"|"(?:(?!"|")[\s\S])+(qs-form.*?)js"/g, function(match) {
32
+ .pipe(replace(/"(?:(?!"|js")[\s\S])+(modutils|mod-utils.*?)js"|"(?:(?!"|")[\s\S])+(footer\/footer-component.*?)js"|"(?:(?!"|")[\s\S])+(mod-form\/mod-form.*?)js"|"(?:(?!"|")[\s\S])+(qs-form.*?)js"|"(?:(?!"|")[\s\S])+(mod-form\/form.*?)js"/g, function(match) {
32
33
  if (match.includes('mod-form')) {
33
34
  if (match.includes('mod-form/form')) {
34
- return `"${resourcePath}/mod-form/form/${fileNames.newModFormFileName}"`;
35
+ return `"${resourcePath}/mod-form/form/${fileNames.homeownerFormFileName}"`;
35
36
  } else if (match.includes('qs-form')) {
36
37
  return `"${resourcePath}/mod-form/${fileNames.qsFormFileName}"`;
37
38
  } else {
@@ -95,9 +96,11 @@ function getResource(url, config = {}, fn, fnArray) {
95
96
  throw new Error(`${resp.statusCode} Error while fetching ${file}`);
96
97
  }
97
98
  })
98
- .pipe(source(`${file}`))
99
+ .pipe(source(file))
100
+ .pipe(buffer())
99
101
  .pipe(hash({
100
102
  hashLength: 20,
103
+ algorithm: 'md5',
101
104
  template: file.replace(/^([^.]*)\.(.*)$/, '$1-<%= hash %>.$2')
102
105
  }))
103
106
  .pipe(tap(function(file, t) {
@@ -120,7 +123,7 @@ function getResource(url, config = {}, fn, fnArray) {
120
123
  }
121
124
  }
122
125
  })
123
- .pipe(source(`${file}`))
126
+ .pipe(source(file))
124
127
  .pipe(config.gulp.dest(`${config.siteSettings.srcFolder}/resources/${config.dest}`))
125
128
  .on('finish', resolve);
126
129
  });
@@ -137,27 +140,27 @@ function getResource(url, config = {}, fn, fnArray) {
137
140
  }
138
141
  const TASKS = {
139
142
  copyModalytics: {
140
- url: `mod-alytics/modalytics.min.js`,
143
+ url: 'mod-alytics/modalytics.min.js',
141
144
  config: {
142
145
  fileName: 'modAlyticsFileName',
143
146
  dest: 'scripts/mod-alytics',
144
- mapUrl: `mod-alytics/modalytics.min.js.map`,
147
+ mapUrl: 'mod-alytics/modalytics.min.js.map',
145
148
  },
146
149
  srcReplaceFn: replaceModalyticsSrc,
147
150
  additionalSrcReplaceFns: []
148
151
  },
149
152
  copyModutils: {
150
- url: `mod-utils/modutils.min.js`,
153
+ url: 'mod-utils/modutils.min.js',
151
154
  config: {
152
155
  fileName: 'modUtilsFileName',
153
156
  dest: 'scripts/mod-utils',
154
- mapUrl: `mod-utils/modutils.min.js.map`,
157
+ mapUrl: 'mod-utils/modutils.min.js.map',
155
158
  },
156
159
  srcReplaceFn: null,
157
160
  additionalSrcReplaceFns: []
158
161
  },
159
162
  copyAbandonmentComponentStyles: {
160
- url: `shared-resources/styles/components/abandonment/abandonment.min.css`,
163
+ url: 'shared-resources/styles/components/abandonment/abandonment.min.css',
161
164
  config: {
162
165
  fileName: 'abandonmentStylesFileName',
163
166
  dest: 'styles/components/abandonment',
@@ -167,47 +170,57 @@ const TASKS = {
167
170
  additionalSrcReplaceFns: []
168
171
  },
169
172
  copyAbandonmentJs: {
170
- url: `shared-resources/scripts/abandonment/abandonment.min.js`,
173
+ url: 'shared-resources/scripts/abandonment/abandonment.min.js',
171
174
  config: {
172
175
  fileName: 'abandonmentJsFileName',
173
176
  dest: 'scripts/abandonment',
174
- mapUrl: `shared-resources/scripts/abandonment/abandonment.min.js.map`,
177
+ mapUrl: 'shared-resources/scripts/abandonment/abandonment.min.js.map',
175
178
  },
176
179
  srcReplaceFn: replaceAbandonmentJsCssSrc,
177
180
  additionalSrcReplaceFns: []
178
181
  },
179
182
  copyFooterComponentJs: {
180
- url: `shared-resources/scripts/footer/footer-component.min.js`,
183
+ url: 'shared-resources/scripts/footer/footer-component.min.js',
181
184
  config: {
182
185
  fileName: 'footerComponentJsFileName',
183
186
  dest: 'scripts/footer',
184
- mapUrl: `shared-resources/scripts/footer/footer-component.min.js.map`,
187
+ mapUrl: 'shared-resources/scripts/footer/footer-component.min.js.map',
185
188
  },
186
189
  srcReplaceFn: null,
187
190
  additionalSrcReplaceFns: []
188
191
  },
189
192
  copyModForm: {
190
- url: `mod-form/mod-form.min.js`,
193
+ url: 'mod-form/mod-form.min.js',
191
194
  config: {
192
195
  fileName: 'modFormFileName',
193
196
  dest: 'scripts/mod-form',
194
- mapUrl: `mod-form/mod-form.min.js.map`,
197
+ mapUrl: 'mod-form/mod-form.min.js.map',
195
198
  },
196
199
  srcReplaceFn: null,
197
200
  additionalSrcReplaceFns: []
198
201
  },
199
202
  copyQsForm: {
200
- url: `mod-form/qs-form.min.js`,
203
+ url: 'mod-form/qs-form.min.js',
201
204
  config: {
202
205
  fileName: 'qsFormFileName',
203
206
  dest: 'scripts/mod-form',
204
- mapUrl: `mod-form/qs-form.min.js.map`,
207
+ mapUrl: 'mod-form/qs-form.min.js.map',
205
208
  },
206
209
  srcReplaceFn: replaceFootAssetScripts,
207
210
  additionalSrcReplaceFns: []
208
211
  },
212
+ copyHomeownerForm: {
213
+ url: 'mod-form/form/homeowner.min.js',
214
+ config: {
215
+ fileName: 'homeownerFormFileName',
216
+ dest: 'scripts/mod-form/form',
217
+ mapUrl: 'mod-form/form/homeowner.min.js.map',
218
+ },
219
+ srcReplaceFn: null,
220
+ additionalSrcReplaceFns: []
221
+ },
209
222
  copyModFooterComponentStyles: {
210
- url: `shared-resources/styles/components/footer/mod-footer.min.css`,
223
+ url: 'shared-resources/styles/components/footer/mod-footer.min.css',
211
224
  config: {
212
225
  fileName: 'modFooterStylesFileName',
213
226
  dest: 'styles/components/footer',
@@ -217,7 +230,7 @@ const TASKS = {
217
230
  additionalSrcReplaceFns: [replaceFooterStylesReference, replaceFooterStylesReferenceInMap]
218
231
  },
219
232
  copyQsFooterComponentStyles: {
220
- url: `shared-resources/styles/components/footer/qs-footer.min.css`,
233
+ url: 'shared-resources/styles/components/footer/qs-footer.min.css',
221
234
  config: {
222
235
  fileName: 'qsFooterStylesFileName',
223
236
  dest: 'styles/components/footer',
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "3.6.38",
3
+ "version": "3.6.39--beta.1",
4
4
  "description": "Share components for S3 sites.",
5
5
  "scripts": {
6
- "test": "echo \"Error: no test specified\" && exit 1"
6
+ "test": "echo \"Error: no test specified\" && exit 1",
7
+ "serve": "node --max-old-space-size=4096 gulp grab-shared-scripts"
7
8
  },
8
9
  "author": "",
9
10
  "license": "ISC",
@@ -17,6 +18,7 @@
17
18
  "gulp": "^3.9.1",
18
19
  "gulp-autoprefixer": "^3.1.1",
19
20
  "gulp-babel": "^8.0.0",
21
+ "gulp-buffer": "0.0.2",
20
22
  "gulp-clean-css": "^3.0.4",
21
23
  "gulp-concat": "^2.6.1",
22
24
  "gulp-cssmin": "^0.1.7",
@@ -17,7 +17,7 @@
17
17
  */
18
18
 
19
19
  modForm.getTradeFromUrl = function() {
20
- var trades = ['solar', 'roofing', 'windows', 'hvac', 'siding', 'gutters', 'bathrooms', 'kitchen-remodeling', 'cabinets', 'home-security', 'home-warranty', 'medical-alerts', 'stair-lifts', 'walk-in-tubs', 'hot-tubs', 'flooring'],
20
+ var trades = ['solar', 'roofing', 'windows', 'hvac', 'siding', 'gutters', 'bathrooms', 'kitchen-remodeling', 'cabinets', 'home-security', 'home-warranty', 'medical-alerts', 'stair-lifts', 'walk-in-tubs', 'hot-tubs', 'flooring', 'tree-services'],
21
21
  queryParamString = (location.search.slice(1) !== '') ? location.search.slice(1) : '',
22
22
  params = queryParamString.toLowerCase(),
23
23
  filteredTrades = trades.filter(function(trade) {