mod-build 3.6.35 → 3.6.36-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
|
+
## 3.6.36
|
|
4
|
+
|
|
5
|
+
- implementing fix needed for grabbing SVG sprites in our `grab-global-images` task. also removed consoles running in `grab-shared-scripts`
|
|
6
|
+
|
|
3
7
|
## 3.6.35
|
|
4
8
|
|
|
5
9
|
- trying one replace pipe for `replaceFootAssetScripts` function inside our `grab-shared-scripts` task. also added some console logs so within build.sh in circleci — you will be able to see it complete all the replacements.
|
|
@@ -16,7 +16,7 @@ function getFilePathFromURL(url) {
|
|
|
16
16
|
|
|
17
17
|
function streamToDestination(gulp, siteSettings, url) {
|
|
18
18
|
let finalDestination;
|
|
19
|
-
|
|
19
|
+
let fileName = path.basename(url);
|
|
20
20
|
const filePath = getFilePathFromURL(url);
|
|
21
21
|
|
|
22
22
|
if (!fs.existsSync(siteSettings.distFolder)) {
|
|
@@ -25,6 +25,13 @@ function streamToDestination(gulp, siteSettings, url) {
|
|
|
25
25
|
finalDestination = siteSettings.distFolder;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
// fix for svg sprites
|
|
29
|
+
if (fileName.includes(".svg#")) {
|
|
30
|
+
const hashIndex = fileName.indexOf("#");
|
|
31
|
+
const strippedFileName = fileName.substring(0, hashIndex);
|
|
32
|
+
fileName = strippedFileName;
|
|
33
|
+
}
|
|
34
|
+
|
|
28
35
|
return new Promise(resolve => { // eslint-disable-line no-undef
|
|
29
36
|
request(url)
|
|
30
37
|
.on('response', resp => {
|
|
@@ -14,7 +14,7 @@ const fileNames = {
|
|
|
14
14
|
qsFooterStylesFileName: '',
|
|
15
15
|
modFormFileName: '',
|
|
16
16
|
qsFormFileName: '',
|
|
17
|
-
|
|
17
|
+
homeownerFormFileName: ''
|
|
18
18
|
};
|
|
19
19
|
var isQuotePageOrUseRelativePath = false;
|
|
20
20
|
var resourceURL = '';
|
|
@@ -28,23 +28,18 @@ function replaceModalyticsSrc(gulp, gulpPlugins, siteSettings, siteData) {
|
|
|
28
28
|
function replaceFootAssetScripts(gulp, gulpPlugins, siteSettings, siteData) {
|
|
29
29
|
const resourcePath = isQuotePageOrUseRelativePath ? '{{#if this.nodeModulesPath}}{{this.nodeModulesPath}}{{/if}}resources/scripts' : '/resources/scripts';
|
|
30
30
|
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"|"(?:(?!"|")[\s\S])+(mod-form\/form
|
|
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"|"(?:(?!"|")[\s\S])+(mod-form\/form.*?)js"/g, function(match) {
|
|
32
32
|
if (match.includes('mod-form')) {
|
|
33
33
|
if (match.includes('mod-form/form')) {
|
|
34
|
-
|
|
35
|
-
return `"${resourcePath}/mod-form/form/${fileNames.newModFormFileName}"`;
|
|
34
|
+
return `"${resourcePath}/mod-form/form/${fileNames.homeownerFormFileName}"`;
|
|
36
35
|
} else if (match.includes('qs-form')) {
|
|
37
|
-
console.log('replaced qs-form');
|
|
38
36
|
return `"${resourcePath}/mod-form/${fileNames.qsFormFileName}"`;
|
|
39
37
|
} else {
|
|
40
|
-
console.log('replaced mod-form');
|
|
41
38
|
return `"${resourcePath}/mod-form/${fileNames.modFormFileName}"`;
|
|
42
39
|
}
|
|
43
40
|
} else if (match.includes('modutils') || match.includes('mod-utils')) {
|
|
44
|
-
console.log('replaced modutils');
|
|
45
41
|
return `"${resourcePath}/mod-utils/${fileNames.modUtilsFileName}"`;
|
|
46
42
|
} else if (match.includes('footer-component')) {
|
|
47
|
-
console.log('replaced footer component');
|
|
48
43
|
return `"${resourcePath}/footer/${fileNames.footerComponentJsFileName}"`;
|
|
49
44
|
}
|
|
50
45
|
}))
|
|
@@ -94,21 +89,18 @@ function getResource(url, config = {}, fn, fnArray) {
|
|
|
94
89
|
|
|
95
90
|
return new Promise(resolve => {
|
|
96
91
|
const file = getFileFromURL(url);
|
|
97
|
-
|
|
98
|
-
let stream = request(`${resourceURL}/${url}`)
|
|
92
|
+
request(`${resourceURL}/${url}`)
|
|
99
93
|
.on('response', resp => {
|
|
100
94
|
if (resp.statusCode !== 200) {
|
|
101
95
|
throw new Error(`${resp.statusCode} Error while fetching ${file}`);
|
|
102
96
|
}
|
|
103
97
|
})
|
|
104
98
|
.pipe(source(`${file}`))
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
stream.pipe(tap(function(file, t) {
|
|
99
|
+
.pipe(hash({
|
|
100
|
+
hashLength: 20,
|
|
101
|
+
template: file.replace(/^([^.]*)\.(.*)$/, '$1-<%= hash %>.$2')
|
|
102
|
+
}))
|
|
103
|
+
.pipe(tap(function(file, t) {
|
|
112
104
|
fileNames[config.fileName] = path.basename(file.path);
|
|
113
105
|
}))
|
|
114
106
|
.pipe(config.gulp.dest(`${config.siteSettings.srcFolder}/resources/${config.dest}`))
|
|
@@ -204,12 +196,12 @@ const TASKS = {
|
|
|
204
196
|
srcReplaceFn: null,
|
|
205
197
|
additionalSrcReplaceFns: []
|
|
206
198
|
},
|
|
207
|
-
|
|
208
|
-
url: `mod-form/form/
|
|
209
|
-
mapUrl: `mod-form/form/mod-form-beta.min.js.map`,
|
|
199
|
+
copyHomeownerForm: {
|
|
200
|
+
url: `mod-form/form/homeowner.min.js`,
|
|
210
201
|
config: {
|
|
211
|
-
fileName: '
|
|
212
|
-
dest: 'scripts/mod-form/form'
|
|
202
|
+
fileName: 'homeownerFormFileName',
|
|
203
|
+
dest: 'scripts/mod-form/form',
|
|
204
|
+
mapUrl: `mod-form/form/homeowner.min.js.map`,
|
|
213
205
|
},
|
|
214
206
|
srcReplaceFn: null,
|
|
215
207
|
additionalSrcReplaceFns: []
|
|
@@ -264,6 +256,7 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
|
|
|
264
256
|
});
|
|
265
257
|
}
|
|
266
258
|
|
|
259
|
+
console.log('calling this')
|
|
267
260
|
return Promise.all(getAllResources);
|
|
268
261
|
}());
|
|
269
262
|
};
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mod-build",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.36-beta.2",
|
|
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",
|
|
@@ -14,6 +15,8 @@
|
|
|
14
15
|
"bootstrap-sass": "^3.4.3",
|
|
15
16
|
"browser-sync": "^2.18.6",
|
|
16
17
|
"del": "^3.0.0",
|
|
18
|
+
"es6-promise": "^2.1.1",
|
|
19
|
+
"fancy-log": "^2.0.0",
|
|
17
20
|
"gulp": "^3.9.1",
|
|
18
21
|
"gulp-autoprefixer": "^3.1.1",
|
|
19
22
|
"gulp-babel": "^8.0.0",
|
|
@@ -31,6 +34,7 @@
|
|
|
31
34
|
"gulp-imagemin": "^3.2.0",
|
|
32
35
|
"gulp-insert": "^0.5.0",
|
|
33
36
|
"gulp-load-plugins": "^0.10.0",
|
|
37
|
+
"gulp-md5": "^0.1.3",
|
|
34
38
|
"gulp-minify": "0.0.14",
|
|
35
39
|
"gulp-mocha-phantomjs": "^0.12.1",
|
|
36
40
|
"gulp-plumber": "^1.1.0",
|
|
@@ -53,13 +57,18 @@
|
|
|
53
57
|
"imagemin-webp": "^5.1.0",
|
|
54
58
|
"jquery": "^3.2.1",
|
|
55
59
|
"lodash": "^4.17.15",
|
|
60
|
+
"lodash.assign": "^2.4.1",
|
|
56
61
|
"lodash.merge": "^4.6.2",
|
|
62
|
+
"lodash.template": "^2.4.1",
|
|
57
63
|
"nouislider": "^10.1.0",
|
|
58
64
|
"path": "^0.12.7",
|
|
65
|
+
"plugin-error": "^2.0.1",
|
|
59
66
|
"request": "^2.88.0",
|
|
60
67
|
"run-sequence": "^2.2.1",
|
|
61
68
|
"sass": "^1.49.9",
|
|
62
69
|
"should": "^11.2.1",
|
|
70
|
+
"through2": "^2.0.0",
|
|
71
|
+
"vinyl": "^2.2.1",
|
|
63
72
|
"vinyl-source-stream": "^2.0.0",
|
|
64
73
|
"webpack-stream": "^5.2.1"
|
|
65
74
|
},
|