mod-build 3.6.34 → 3.6.35-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,13 @@
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
+
7
+ ## 3.6.35
8
+
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.
10
+
3
11
  ## 3.6.34
4
12
 
5
13
  - undid the chaining in `replaceFootAssetScripts` function inside our `grab-shared-scripts` task. seemed to make things worse in terms of replacing paths.
@@ -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 => {
@@ -13,7 +13,8 @@ const fileNames = {
13
13
  modFooterStylesFileName: '',
14
14
  qsFooterStylesFileName: '',
15
15
  modFormFileName: '',
16
- qsFormFileName: ''
16
+ qsFormFileName: '',
17
+ newModFormFileName: ''
17
18
  };
18
19
  var isQuotePageOrUseRelativePath = false;
19
20
  var resourceURL = '';
@@ -27,11 +28,21 @@ function replaceModalyticsSrc(gulp, gulpPlugins, siteSettings, siteData) {
27
28
  function replaceFootAssetScripts(gulp, gulpPlugins, siteSettings, siteData) {
28
29
  const resourcePath = isQuotePageOrUseRelativePath ? '{{#if this.nodeModulesPath}}{{this.nodeModulesPath}}{{/if}}resources/scripts' : '/resources/scripts';
29
30
  return gulp.src(siteSettings.srcFolder + '/shared-components/foot-assets/foot-assets.html')
30
- .pipe(replace(/"(?:(?!"|js")[\s\S])+(modutils|mod-utils.*?)js"/, `"${resourcePath}/mod-utils/${fileNames.modUtilsFileName}"`))
31
- .pipe(replace(/"(?:(?!"|")[\s\S])+(footer\/footer-component.*?)js"/, `"${resourcePath}/footer/${fileNames.footerComponentJsFileName}"`))
32
- .pipe(replace(/"(?:(?!"|")[\s\S])+(mod-form\/mod-form.*?)js"/, `"${resourcePath}/mod-form/${fileNames.modFormFileName}"`))
33
- .pipe(replace(/"(?:(?!"|")[\s\S])+(qs-form.*?)js"/, `"${resourcePath}/mod-form/${fileNames.qsFormFileName}"`))
34
- .pipe(replace(/"(?:(?!"|")[\s\S])+(mod-form\/form\/mod-form.*?)js"/, `"${resourcePath}/mod-form/form/${fileNames.newModFormFileName}"`))
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
+ if (match.includes('mod-form')) {
33
+ if (match.includes('mod-form/form')) {
34
+ return `"${resourcePath}/mod-form/form/${fileNames.newModFormFileName}"`;
35
+ } else if (match.includes('qs-form')) {
36
+ return `"${resourcePath}/mod-form/${fileNames.qsFormFileName}"`;
37
+ } else {
38
+ return `"${resourcePath}/mod-form/${fileNames.modFormFileName}"`;
39
+ }
40
+ } else if (match.includes('modutils') || match.includes('mod-utils')) {
41
+ return `"${resourcePath}/mod-utils/${fileNames.modUtilsFileName}"`;
42
+ } else if (match.includes('footer-component')) {
43
+ return `"${resourcePath}/footer/${fileNames.footerComponentJsFileName}"`;
44
+ }
45
+ }))
35
46
  .pipe(gulp.dest(siteSettings.srcFolder + '/shared-components/foot-assets'));
36
47
  }
37
48
  function replaceAbandonmentJsCssSrc(gulp, gulpPlugins, siteSettings, siteData) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "3.6.34",
3
+ "version": "3.6.35-beta.1",
4
4
  "description": "Share components for S3 sites.",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"