mod-build 3.6.73-beta.3 → 3.6.74-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.74-beta.1
4
+
5
+ - Updating modalytics script path with a new task if isPathSubdirectory flag present in SiteData
6
+
7
+ ## 3.6.74
8
+
9
+ - Updating the `add-path-subdirectories` task to update paths that also start with `accessible-components`
10
+
3
11
  ## 3.6.73
4
12
 
5
13
  - Updating `grab-shared-scripts` path to grab & replace the new, global `callrail.min.js` file
@@ -11,7 +11,7 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
11
11
  return `href="${pathSubdirectory}favicon.ico"`;
12
12
  }))
13
13
  .pipe(replace(/((src=")(images|scripts|shared-components)\/[^"]+")/g, function(match, path) {
14
- if (path.startsWith('src="images') || path.startsWith('src="scripts') || path.startsWith('src="shared-components')) {
14
+ if (path.startsWith('src="images') || path.startsWith('src="scripts') || path.startsWith('src="shared-components') || path.startsWith('src="accessible-components')) {
15
15
  return `src="${pathSubdirectory}${path.slice(5)}`;
16
16
  }
17
17
  return match;
@@ -23,7 +23,7 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
23
23
  return match;
24
24
  }))
25
25
  .pipe(replace(/((href=")(images|styles|shared-components)\/[^"]+")/g, function(match, path) {
26
- if (path.startsWith('href="images') || path.startsWith('href="styles') || path.startsWith('href="shared-components')) {
26
+ if (path.startsWith('href="images') || path.startsWith('href="styles') || path.startsWith('href="shared-components') || path.startsWith('src="accessible-components')) {
27
27
  return `href="${pathSubdirectory}${path.slice(6)}`;
28
28
  }
29
29
  return match;
@@ -20,6 +20,11 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
20
20
  sequenceOpts.push('copy-fonts');
21
21
  }
22
22
 
23
+ if (siteData.isPathSubdirectory) {
24
+ const index = sequenceOpts.indexOf('grab-shared-scripts');
25
+ sequenceOpts.splice(index, 0, 'update-modalytics-path');
26
+ }
27
+
23
28
  runSequence(...sequenceOpts, function() {
24
29
  console.log('\x1b[42m%s\x1b[0m', '✔ Build completed!');
25
30
  console.log('You can run \'gulp serve:dist\' to see production version.');
@@ -465,6 +465,18 @@ module.exports = function() {
465
465
 
466
466
  return require(opts.gulpTasksFolderPath + '/copy-fonts')(opts.gulp, opts.gulpSettings);
467
467
  }
468
+ },
469
+
470
+ // Update Modalytics Path
471
+ 'update-modalytics-path': {
472
+ subtasks: [],
473
+ func: function(opts) {
474
+ if ('undefined' === typeof opts.gulpTasksFolderPath) {
475
+ opts.gulpTasksFolderPath = '.';
476
+ }
477
+
478
+ return require(opts.gulpTasksFolderPath + '/update-modalytics-path')(opts.gulp, opts.gulpPlugins, opts.gulpSettings, opts.siteData);
479
+ }
468
480
  }
469
481
  };
470
482
 
@@ -0,0 +1,12 @@
1
+ var replace = require('gulp-replace');
2
+
3
+ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
4
+ const { isLocal } = siteSettings,
5
+ isPathSubdirectory = siteData.siteData && siteData.siteData.pathSubdirectory || siteData && siteData.pathSubdirectory,
6
+ pathSubdirectory = !isLocal && isPathSubdirectory ? isPathSubdirectory : '';
7
+ return function() {
8
+ return gulp.src(siteSettings.srcFolder + '/shared-components/head/head.html')
9
+ .pipe(replace(`${pathSubdirectory}{{#if this.src}}{{this.src}}{{/if}}resources/scripts/mod-alytics/`, `${pathSubdirectory}resources/scripts/mod-alytics/`))
10
+ .pipe(gulp.dest(siteSettings.srcFolder + '/shared-components/head'));
11
+ };
12
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "3.6.73-beta.3",
3
+ "version": "3.6.74-beta.1",
4
4
  "description": "Share components for S3 sites.",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",