mod-build 4.0.55 → 4.0.56-beta.2

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
+ ## 4.0.56
4
+
5
+ - Added `geolocation.min.js` to the `grab-shared-scripts` task to grab & hash that file during build (leaving the file in `grab-cdn` task to not break what is currently there).
6
+
3
7
  ## 4.0.55
4
8
 
5
9
  - Added extra conditions for `addTcpaAboveCta` and `addTcpaBelowCta` helper functions to not break when required data is not passed.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "4.0.55",
3
+ "version": "4.0.56-beta.2",
4
4
  "description": "Share components for S3 sites.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -21,14 +21,20 @@ let useAccessibleComponents = false;
21
21
  const axiosInstance = axios.create();
22
22
  responseInterceptor(axiosInstance);
23
23
 
24
- function replaceModalyticsSrc(gulp, defaultSettings) {
25
- const resourcePath = '/resources/scripts/mod-alytics/';
24
+ function replaceHeadScripts(gulp, defaultSettings) {
25
+ const resourcePath = '/resources/scripts';
26
26
  return new Promise((resolve) => {
27
27
  gulp.src(`${defaultSettings.srcFolder}/${componentFolderPath}/head/head.html`)
28
- .pipe(replace(/".*(modalytics).*"/, `"${resourcePath}${fileNames.modAlyticsFileName}"`))
28
+ .pipe(replace(/"(?:(?!"|")[\s\S])+(modalytics.*?)js"|"(?:(?!"|")[\s\S])+(geolocation.*?)js"/g, function(match) {
29
+ if (match.includes('modalytics')) {
30
+ return `"${resourcePath}/mod-alytics/${fileNames.modAlyticsFileName}"`;
31
+ } else if (match.includes('geolocation')) {
32
+ return `"${resourcePath}/geolocation/${fileNames.geolocationFileName}"`;
33
+ }
34
+ }))
29
35
  .pipe(gulp.dest(`${defaultSettings.srcFolder}/${componentFolderPath}/head`))
30
36
  .on('finish', resolve);
31
- });
37
+ });
32
38
  }
33
39
 
34
40
  function replaceFootAssetScripts(gulp, defaultSettings) {
@@ -97,7 +103,7 @@ const TASKS = {
97
103
  dest: 'scripts/mod-utils',
98
104
  hasMapFile: true
99
105
  },
100
- srcReplaceFn: null,
106
+ srcReplaceFn: null
101
107
  },
102
108
  copyCallrail: {
103
109
  url: 'shared-resources/scripts/callrail/callrail.min.js',
@@ -106,7 +112,7 @@ const TASKS = {
106
112
  dest: 'scripts/callrail',
107
113
  hasMapFile: true
108
114
  },
109
- srcReplaceFn: null,
115
+ srcReplaceFn: null
110
116
  },
111
117
  copyFooterComponentJs: {
112
118
  url: 'shared-resources/scripts/footer/footer-component.min.js',
@@ -115,7 +121,7 @@ const TASKS = {
115
121
  dest: 'scripts/footer',
116
122
  hasMapFile: true
117
123
  },
118
- srcReplaceFn: null,
124
+ srcReplaceFn: null
119
125
  },
120
126
  copyHomeownerForm: {
121
127
  url: 'mod-form/form/homeowner.min.js',
@@ -124,7 +130,7 @@ const TASKS = {
124
130
  dest: 'scripts/mod-form/form',
125
131
  hasMapFile: true
126
132
  },
127
- srcReplaceFn: replaceFootAssetScripts,
133
+ srcReplaceFn: replaceFootAssetScripts
128
134
  },
129
135
  copyContractorForm: {
130
136
  url: 'mod-form/form/contractor.min.js',
@@ -133,7 +139,16 @@ const TASKS = {
133
139
  dest: 'scripts/mod-form/form',
134
140
  hasMapFile: true
135
141
  },
136
- srcReplaceFn: null,
142
+ srcReplaceFn: null
143
+ },
144
+ copyGeolocation: {
145
+ url: 'geolocation/geolocation.min.js',
146
+ config: {
147
+ fileName: 'geolocationFileName',
148
+ dest: 'scripts/geolocation',
149
+ hasMapFile: true
150
+ },
151
+ srcReplaceFn: null
137
152
  },
138
153
  copyModalytics: {
139
154
  url: 'mod-alytics/modalytics.min.js',
@@ -142,7 +157,7 @@ const TASKS = {
142
157
  dest: 'scripts/mod-alytics',
143
158
  hasMapFile: true
144
159
  },
145
- srcReplaceFn: replaceModalyticsSrc,
160
+ srcReplaceFn: replaceHeadScripts
146
161
  },
147
162
  copyAbandonmentComponentStyles: {
148
163
  url: 'shared-resources/styles/components/abandonment/abandonment.min.css',
@@ -150,7 +165,7 @@ const TASKS = {
150
165
  fileName: 'abandonmentStylesFileName',
151
166
  dest: 'styles/components/abandonment'
152
167
  },
153
- srcReplaceFn: null,
168
+ srcReplaceFn: null
154
169
  },
155
170
  copyAbandonmentJs: {
156
171
  url: 'shared-resources/scripts/abandonment/abandonment.min.js',
@@ -159,7 +174,7 @@ const TASKS = {
159
174
  dest: 'scripts/abandonment',
160
175
  hasMapFile: true
161
176
  },
162
- srcReplaceFn: replaceAbandonmentJsCssSrc,
177
+ srcReplaceFn: replaceAbandonmentJsCssSrc
163
178
  },
164
179
  copyModFooterComponentStyles: {
165
180
  url: 'shared-resources/styles/components/footer/mod-footer.min.css',
@@ -167,7 +182,7 @@ const TASKS = {
167
182
  fileName: 'modFooterStylesFileName',
168
183
  dest: 'styles/components/footer'
169
184
  },
170
- srcReplaceFn: null,
185
+ srcReplaceFn: null
171
186
  },
172
187
  copyQsFooterComponentStyles: {
173
188
  url: 'shared-resources/styles/components/footer/qs-footer.min.css',
@@ -175,7 +190,7 @@ const TASKS = {
175
190
  fileName: 'qsFooterStylesFileName',
176
191
  dest: 'styles/components/footer'
177
192
  },
178
- srcReplaceFn: replaceFooterStylesReference,
193
+ srcReplaceFn: replaceFooterStylesReference
179
194
  }
180
195
  };
181
196