mod-build 3.6.35 → 3.6.36

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
- const fileName = path.basename(url);
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 => {
@@ -31,20 +31,15 @@ function replaceFootAssetScripts(gulp, gulpPlugins, siteSettings, siteData) {
31
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\/mod-form.*?)js"/g, function(match) {
32
32
  if (match.includes('mod-form')) {
33
33
  if (match.includes('mod-form/form')) {
34
- console.log('replaced modular mod-form');
35
34
  return `"${resourcePath}/mod-form/form/${fileNames.newModFormFileName}"`;
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
  }))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "3.6.35",
3
+ "version": "3.6.36",
4
4
  "description": "Share components for S3 sites.",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"