mod-build 3.6.1--beta.21 → 3.6.1--beta.23

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
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## 3.6.2
4
4
 
5
- - Adding `ifSeason` handlebar helper to make seasonal updates with JSON
5
+ - Adding `check-seasonal-variations` to grab seasons json from mod-site; loop through the siteData for `seasonalVariations: {}`; find any active seasons; and adjust json accordingly
6
6
 
7
7
  ## 3.5.7
8
8
 
@@ -1,32 +1,5 @@
1
- var request = require('request');
2
- var source = require('vinyl-source-stream');
3
-
4
- function getDefinedSeasons(gulp, gulpPlugins, siteSettings) {
5
- return {
6
- "warmerWeather": {
7
- "firstDay": "03-14",
8
- "lastDay": "09-25"
9
- },
10
- "spookySeason": {
11
- "startDate": "10-01",
12
- "endDate": "10-31"
13
- }
14
- }
15
- // return new Promise(resolve => { // eslint-disable-line no-undef
16
- // request(`https://${siteSettings.nodeEnv}/quote/resources/mod-site/data/seasons.json`)
17
- // .on('response', resp => {
18
- // if (resp.statusCode !== 200) {
19
- // throw new Error(`${resp.statusCode} Error while fetching data/seasons.json`);
20
- // }
21
- // })
22
- // .pipe(source('seasons'))
23
- // .then(seasons => { return seasons } )
24
- // .on('finish', resolve);
25
- // });
26
- }
27
-
28
1
  function getActiveSeasons() {
29
- var seasons = getDefinedSeasons();
2
+ var seasons = require(`../src/data/seasons.js`);
30
3
  const today = new Date();
31
4
  const year = today.getFullYear();
32
5
  let activeSeason = [];
@@ -45,4 +18,4 @@ function getActiveSeasons() {
45
18
  return activeSeason;
46
19
  }
47
20
 
48
- module.exports = getActiveSeasons;
21
+ module.exports = getActiveSeasons;
@@ -12,7 +12,7 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
12
12
  var qsFooterData = require('../src/data/components/qs-footer.js');
13
13
  var quoteFooterData = require('../src/data/components/quote-footer.js');
14
14
 
15
- // Checking for seasonal variations in the template.js
15
+ // Checking for seasonal variations in the template.js + updating content
16
16
  var checkSeasonalVariations = require('./check-seasonal-variations.js');
17
17
  const activeSeason = checkSeasonalVariations();
18
18
  if (activeSeason !== ''){
@@ -145,5 +145,4 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
145
145
  }))
146
146
  .pipe(gulp.dest(siteSettings.tmpFolder));
147
147
  };
148
-
149
148
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "3.6.1--beta.21",
3
+ "version": "3.6.1--beta.23",
4
4
  "description": "Share components for S3 sites.",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -51,6 +51,7 @@
51
51
  "imagemin-webp": "^5.1.0",
52
52
  "jquery": "^3.2.1",
53
53
  "lodash": "^4.17.15",
54
+ "node-fetch": "^2.6.7",
54
55
  "nouislider": "^10.1.0",
55
56
  "request": "^2.88.0",
56
57
  "run-sequence": "^2.2.1",
@@ -0,0 +1,12 @@
1
+ var seasons = {
2
+ "warmerWeather": {
3
+ "firstDay": "03-14",
4
+ "lastDay": "09-25"
5
+ },
6
+ "spookySeason": {
7
+ "startDate": "10-01",
8
+ "endDate": "10-31"
9
+ }
10
+ }
11
+
12
+ module.exports = seasons;