mod-build 3.6.91 → 3.6.93
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/.eslintrc.yml +38 -48
- package/CHANGELOG.md +10 -1
- package/gulp-tasks/add-editorconfig.js +22 -0
- package/gulp-tasks/grab-cdn.js +10 -3
- package/gulp-tasks/js-lint.js +6 -4
- package/gulp-tasks/serve.js +3 -3
- package/gulp-tasks/tasks.js +12 -0
- package/package.json +81 -77
package/.eslintrc.yml
CHANGED
|
@@ -1,59 +1,49 @@
|
|
|
1
1
|
parserOptions:
|
|
2
|
-
ecmaVersion:
|
|
2
|
+
ecmaVersion: 'latest'
|
|
3
3
|
sourceType: 'module'
|
|
4
|
+
|
|
4
5
|
env:
|
|
5
6
|
browser: true
|
|
6
7
|
jquery: true
|
|
8
|
+
node: true
|
|
9
|
+
|
|
10
|
+
extends: 'eslint:recommended'
|
|
7
11
|
|
|
8
12
|
globals:
|
|
9
13
|
require: true
|
|
10
14
|
module: true
|
|
11
15
|
|
|
12
|
-
rules:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
comma-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
rules: {
|
|
17
|
+
brace-style: [2, '1tbs'],
|
|
18
|
+
camelcase: 2,
|
|
19
|
+
comma-dangle: [2, 'never'],
|
|
20
|
+
comma-style: [2, 'last'],
|
|
21
|
+
curly: [2, 'all'],
|
|
22
|
+
default-case: 2,
|
|
23
|
+
dot-notation: 2,
|
|
24
|
+
eqeqeq: [2, 'always', {'null': 'ignore'}],
|
|
25
|
+
guard-for-in: 2,
|
|
26
|
+
indent: [2, 'tab'],
|
|
27
|
+
key-spacing: [2, {beforeColon: false, afterColon: true, mode: 'minimum'}],
|
|
28
|
+
keyword-spacing: [2, { before: true, after: true }],
|
|
29
|
+
new-cap: 2,
|
|
30
|
+
no-console: 0,
|
|
31
|
+
no-floating-decimal: 2,
|
|
32
|
+
no-nested-ternary: 2,
|
|
33
|
+
no-new: 2,
|
|
34
|
+
no-shadow: 2,
|
|
35
|
+
no-use-before-define: 2,
|
|
36
|
+
operator-linebreak: [2, 'before', {overrides: {'?': 'after', ':': 'after'}}],
|
|
37
|
+
prefer-const: 2,
|
|
38
|
+
quotes: [2, 'single'],
|
|
39
|
+
semi: 2,
|
|
40
|
+
semi-spacing: 2,
|
|
41
|
+
space-before-blocks: [2, 'always'],
|
|
42
|
+
space-before-function-paren: [2, 'never'],
|
|
43
|
+
spaced-comment: [2, 'always', { exceptions: ['-']}],
|
|
44
|
+
space-infix-ops: 2,
|
|
45
|
+
space-in-parens: [2, 'never'],
|
|
46
|
+
strict: [2, 'never'],
|
|
47
|
+
valid-jsdoc: [2, { requireReturn: false, prefer: { return: "returns" }}],
|
|
25
48
|
wrap-iife: [2, "inside", { functionPrototypeMethods: true }]
|
|
26
|
-
|
|
27
|
-
strict: [2, "never"]
|
|
28
|
-
camelcase: 1
|
|
29
|
-
curly: [2, "all"]
|
|
30
|
-
eqeqeq: [2, "allow-null"]
|
|
31
|
-
no-empty: 2
|
|
32
|
-
no-use-before-define: 2
|
|
33
|
-
no-obj-calls: 2
|
|
34
|
-
no-unused-vars: [1, {vars: "local", args: "after-used"}]
|
|
35
|
-
new-cap: 2
|
|
36
|
-
no-shadow: 1
|
|
37
|
-
no-invalid-regexp: 2
|
|
38
|
-
comma-dangle: [1, "never"]
|
|
39
|
-
no-undef: 2
|
|
40
|
-
no-new: 2
|
|
41
|
-
no-extra-semi: 2
|
|
42
|
-
no-debugger: 2
|
|
43
|
-
no-caller: 1
|
|
44
|
-
semi: 2
|
|
45
|
-
quotes: [1, "single", "avoid-escape"]
|
|
46
|
-
no-unreachable: 2
|
|
47
|
-
eol-last: 1
|
|
48
|
-
operator-linebreak: [1, "before", {overrides: {"?": "after", ":": "after"}}]
|
|
49
|
-
no-multi-str: 1
|
|
50
|
-
no-mixed-spaces-and-tabs: 1
|
|
51
|
-
no-trailing-spaces: 1
|
|
52
|
-
space-infix-ops: 1
|
|
53
|
-
space-unary-ops: 0
|
|
54
|
-
no-with: 2
|
|
55
|
-
dot-notation: 1
|
|
56
|
-
semi-spacing: 1
|
|
57
|
-
key-spacing: [1, {beforeColon: false, afterColon: true, mode: "minimum"}]
|
|
58
|
-
space-in-parens: [1, "never"]
|
|
59
|
-
prefer-const: 2
|
|
49
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.6.93
|
|
4
|
+
|
|
5
|
+
- updated grab-cdn task to pull geolocation script
|
|
6
|
+
|
|
7
|
+
## 3.6.92
|
|
8
|
+
|
|
9
|
+
- Updating `.eslintrc.yml` with our new lint rules; This configuration will also live on `quote.modernize.com`
|
|
10
|
+
- Adding a new `add-editorconfig` task that will grab our global `editorconfig` file configuration & either add it to the project, or override the existing file contents
|
|
11
|
+
|
|
3
12
|
## 3.6.91
|
|
4
13
|
|
|
5
14
|
- Added support for xml files
|
|
@@ -279,7 +288,7 @@
|
|
|
279
288
|
|
|
280
289
|
## 3.6.5
|
|
281
290
|
|
|
282
|
-
- Updating `settings_tolerance` & `library_tolerance` parameters default values in the VWO script to help reduce Heap-VWO undefined properties (for more information on these parameters you can read here -> https://help.vwo.com/hc/en-us/articles/900001789546-Why-Does-VWO-SmartCode-Time-out-and-How-to-Resolve-It
|
|
291
|
+
- Updating `settings_tolerance` & `library_tolerance` parameters default values in the VWO script to help reduce Heap-VWO undefined properties (for more information on these parameters you can read here -> <https://help.vwo.com/hc/en-us/articles/900001789546-Why-Does-VWO-SmartCode-Time-out-and-How-to-Resolve-It->)
|
|
283
292
|
|
|
284
293
|
## 3.6.3
|
|
285
294
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
var request = require('request');
|
|
2
|
+
var source = require('vinyl-source-stream');
|
|
3
|
+
|
|
4
|
+
function addEditorConfig(gulp, siteSettings) {
|
|
5
|
+
return new Promise(resolve => {
|
|
6
|
+
request(`https://${siteSettings.nodeEnv}/quote/resources/mod-site/configurations/editorconfig`)
|
|
7
|
+
.on('response', resp => {
|
|
8
|
+
if (resp.statusCode !== 200) {
|
|
9
|
+
throw new Error(`${resp.statusCode} Error while fetching editorconfig`);
|
|
10
|
+
}
|
|
11
|
+
})
|
|
12
|
+
.pipe(source('.editorconfig'))
|
|
13
|
+
.pipe(gulp.dest('./'))
|
|
14
|
+
.on('finish', resolve);
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
module.exports = function(gulp, siteSettings) {
|
|
19
|
+
return function() {
|
|
20
|
+
addEditorConfig(gulp, siteSettings);
|
|
21
|
+
}
|
|
22
|
+
}
|
package/gulp-tasks/grab-cdn.js
CHANGED
|
@@ -18,11 +18,11 @@ function streamToDestination(gulp, siteSettings, inputPath, destPath, fileName)
|
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
module.exports = function(gulp,
|
|
21
|
+
module.exports = function(gulp, _gulpPlugins, siteSettings, siteData) {
|
|
22
22
|
return function() {
|
|
23
23
|
const { nodeEnv, isLocal } = siteSettings;
|
|
24
24
|
const { isQSPage, isWhiteLabel, domain } = siteData;
|
|
25
|
-
const isModWhiteLabel = isWhiteLabel && !isQSPage
|
|
25
|
+
const isModWhiteLabel = isWhiteLabel && !isQSPage;
|
|
26
26
|
const domainHasModernize = domain.indexOf('modernize') > -1;
|
|
27
27
|
|
|
28
28
|
let externalResources;
|
|
@@ -40,7 +40,7 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
|
|
|
40
40
|
'/quote/resources/shared-resources/templates/modals/terms/': ['/resources/templates/modals/terms/', 'index.html'],
|
|
41
41
|
'/quote/resources/shared-resources/templates/modals/contact-us/': ['/resources/templates/modals/contact-us/', 'index.html'],
|
|
42
42
|
'/quote/resources/shared-resources/templates/modals/faq/': ['/resources/templates/modals/faq/', 'index.html']
|
|
43
|
-
})
|
|
43
|
+
});
|
|
44
44
|
|
|
45
45
|
if (isModWhiteLabel || domainHasModernize) {
|
|
46
46
|
Object.assign(externalResources, {'/quote/resources/mod-site/templates/scripts/recaptcha.html': ['/templates/scripts/', 'recaptcha.html']});
|
|
@@ -60,6 +60,13 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
|
|
|
60
60
|
externalResources = { ...externalResources, ...remoteFilesForLocalDev };
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
// Geolocation js
|
|
64
|
+
Object.assign(externalResources, {
|
|
65
|
+
'/quote/resources/shared-resources/scripts/geolocation/geolocation.min.js': [
|
|
66
|
+
'resources/scripts/geolocation/', 'geolocation.min.js'
|
|
67
|
+
]
|
|
68
|
+
});
|
|
69
|
+
|
|
63
70
|
const filesPromiseMap = Object.keys(externalResources).map(key => {
|
|
64
71
|
const destinationPath = externalResources[key][0];
|
|
65
72
|
const fileName = externalResources[key][1];
|
package/gulp-tasks/js-lint.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
module.exports = function(gulp, gulpPlugins, siteSettings) {
|
|
2
2
|
var fs = require('fs');
|
|
3
|
+
var gulpESLintNew = require('gulp-eslint-new');
|
|
3
4
|
|
|
4
5
|
// Default jsLint settings
|
|
5
6
|
if ('undefined' === typeof siteSettings.jsLint) {
|
|
6
7
|
siteSettings.jsLint = {
|
|
7
|
-
|
|
8
|
+
overrideConfigFile: './node_modules/mod-build/.eslintrc.yml'
|
|
8
9
|
};
|
|
9
10
|
}
|
|
10
11
|
|
|
@@ -17,8 +18,9 @@ module.exports = function(gulp, gulpPlugins, siteSettings) {
|
|
|
17
18
|
'!' + siteSettings.srcFolder + '/' + siteSettings.scriptsSubfolder + '/resources/**/*.js', // do not lint copied shared resource scripts,
|
|
18
19
|
'!' + siteSettings.srcFolder + '/' + siteSettings.scriptsCompiledFolder + '**/*.js' // do not lint compiled scripts
|
|
19
20
|
])
|
|
20
|
-
.pipe(
|
|
21
|
-
.pipe(
|
|
22
|
-
.pipe(
|
|
21
|
+
.pipe(gulpESLintNew(siteSettings.jsLint))
|
|
22
|
+
.pipe(gulpESLintNew.format())
|
|
23
|
+
.pipe(gulpESLintNew.format('junit', fs.createWriteStream('eslint-results.xml')))
|
|
24
|
+
.pipe(gulpESLintNew.failAfterError());
|
|
23
25
|
};
|
|
24
26
|
};
|
package/gulp-tasks/serve.js
CHANGED
|
@@ -4,11 +4,11 @@ module.exports.src = function(gulp, gulpPlugins, siteSettings, siteData) {
|
|
|
4
4
|
var runSequence = require('run-sequence');
|
|
5
5
|
var sequenceOpts;
|
|
6
6
|
if (siteData.useTypescript) {
|
|
7
|
-
sequenceOpts = ['clean', 'grab-cdn', 'grab-shared-components', 'grab-shared-scripts', 'grab-form-helpers', 'templates', 'styles', 'compile', 'grab-tooltips-json', 'combine-files', 'grab-images', 'js-lint'];
|
|
7
|
+
sequenceOpts = ['clean', 'add-editorconfig', 'grab-cdn', 'grab-shared-components', 'grab-shared-scripts', 'grab-form-helpers', 'templates', 'styles', 'compile', 'grab-tooltips-json', 'combine-files', 'grab-images', 'js-lint'];
|
|
8
8
|
} else if (siteData.isQSPage) {
|
|
9
|
-
sequenceOpts = ['clean', 'grab-cdn', 'grab-shared-components', 'grab-shared-scripts', 'grab-form-helpers', 'templates', 'styles', 'grab-theme-json', 'grab-tooltips-json', 'combine-files', 'grab-images', 'js-lint'];
|
|
9
|
+
sequenceOpts = ['clean', 'add-editorconfig', 'grab-cdn', 'grab-shared-components', 'grab-shared-scripts', 'grab-form-helpers', 'templates', 'styles', 'grab-theme-json', 'grab-tooltips-json', 'combine-files', 'grab-images', 'js-lint'];
|
|
10
10
|
} else {
|
|
11
|
-
sequenceOpts = ['clean', 'grab-cdn', 'grab-shared-components', 'grab-shared-scripts', 'grab-form-helpers', 'templates', 'styles', 'grab-tooltips-json', 'combine-files', 'grab-images','grab-global-images', 'js-lint'];
|
|
11
|
+
sequenceOpts = ['clean', 'add-editorconfig', 'grab-cdn', 'grab-shared-components', 'grab-shared-scripts', 'grab-form-helpers', 'templates', 'styles', 'grab-tooltips-json', 'combine-files', 'grab-images','grab-global-images', 'js-lint'];
|
|
12
12
|
}
|
|
13
13
|
runSequence(...sequenceOpts, () => {
|
|
14
14
|
// Run a BrowserSync server
|
package/gulp-tasks/tasks.js
CHANGED
|
@@ -56,6 +56,18 @@ module.exports = function() {
|
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
|
|
59
|
+
// Grab global editorconfig file and add to project or override existing file contents
|
|
60
|
+
'add-editorconfig': {
|
|
61
|
+
subtasks: [],
|
|
62
|
+
func: function(opts) {
|
|
63
|
+
if ('undefined' === typeof opts.gulpTasksFolderPath) {
|
|
64
|
+
opts.gulpTasksFolderPath = '.';
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return require(opts.gulpTasksFolderPath + '/add-editorconfig')(opts.gulp, opts.gulpSettings);
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
|
|
59
71
|
// Grab component files from CDN so they can be swapped into build
|
|
60
72
|
'grab-shared-components': {
|
|
61
73
|
subtasks: [],
|
package/package.json
CHANGED
|
@@ -1,79 +1,83 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
2
|
+
"name": "mod-build",
|
|
3
|
+
"version": "3.6.93",
|
|
4
|
+
"description": "Share components for S3 sites.",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
7
|
+
"serve": "node --max-old-space-size=4096 gulp grab-shared-scripts"
|
|
8
|
+
},
|
|
9
|
+
"author": "",
|
|
10
|
+
"license": "ISC",
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@babel/core": "^7.0.0",
|
|
13
|
+
"@babel/preset-env": "^7.0.0",
|
|
14
|
+
"@babel/register": "^7.0.0",
|
|
15
|
+
"bootstrap-sass": "^3.4.3",
|
|
16
|
+
"browser-sync": "^2.18.6",
|
|
17
|
+
"del": "^3.0.0",
|
|
18
|
+
"eslint": "^8.57.0",
|
|
19
|
+
"gulp": "^3.9.1",
|
|
20
|
+
"gulp-autoprefixer": "^3.1.1",
|
|
21
|
+
"gulp-babel": "^8.0.0",
|
|
22
|
+
"gulp-buffer": "0.0.2",
|
|
23
|
+
"gulp-clean-css": "^3.0.4",
|
|
24
|
+
"gulp-concat": "^2.6.1",
|
|
25
|
+
"gulp-cssmin": "^0.1.7",
|
|
26
|
+
"gulp-csso": "^3.0.0",
|
|
27
|
+
"gulp-eslint": "^5.0.0",
|
|
28
|
+
"gulp-eslint-new": "^2.1.0",
|
|
29
|
+
"gulp-eslint-threshold": "^0.1.1",
|
|
30
|
+
"gulp-filter": "^5.0.0",
|
|
31
|
+
"gulp-handlebars-file-include": "^1.0.0",
|
|
32
|
+
"gulp-hash": "^4.2.2",
|
|
33
|
+
"gulp-htmlmin": "^3.0.0",
|
|
34
|
+
"gulp-if": "^2.0.2",
|
|
35
|
+
"gulp-imagemin": "^3.2.0",
|
|
36
|
+
"gulp-insert": "^0.5.0",
|
|
37
|
+
"gulp-load-plugins": "^0.10.0",
|
|
38
|
+
"gulp-minify": "0.0.14",
|
|
39
|
+
"gulp-mocha-phantomjs": "^0.12.1",
|
|
40
|
+
"gulp-plumber": "^1.1.0",
|
|
41
|
+
"gulp-rename": "^1.2.2",
|
|
42
|
+
"gulp-replace": "^0.5.4",
|
|
43
|
+
"gulp-rev": "^7.1.2",
|
|
44
|
+
"gulp-rev-all": "^0.9.7",
|
|
45
|
+
"gulp-rev-delete-original": "^0.2.3",
|
|
46
|
+
"gulp-rev-replace": "^0.4.3",
|
|
47
|
+
"gulp-sass": "^5.1.0",
|
|
48
|
+
"gulp-sass-lint": "^1.3.2",
|
|
49
|
+
"gulp-sass-variables": "^1.2.0",
|
|
50
|
+
"gulp-size": "^2.1.0",
|
|
51
|
+
"gulp-sourcemaps": "^2.6.0",
|
|
52
|
+
"gulp-tap": "^2.0.0",
|
|
53
|
+
"gulp-uglify": "^2.1.2",
|
|
54
|
+
"gulp-useref": "^5.0.0",
|
|
55
|
+
"husky": "^1.3.1",
|
|
56
|
+
"imagemin-mozjpeg": "^7.0.0",
|
|
57
|
+
"imagemin-webp": "^5.1.0",
|
|
58
|
+
"jquery": "^3.2.1",
|
|
59
|
+
"lodash": "^4.17.15",
|
|
60
|
+
"lodash.merge": "^4.6.2",
|
|
61
|
+
"nouislider": "^10.1.0",
|
|
62
|
+
"path": "^0.12.7",
|
|
63
|
+
"request": "^2.88.0",
|
|
64
|
+
"run-sequence": "^2.2.1",
|
|
65
|
+
"sass": "^1.49.9",
|
|
66
|
+
"should": "^11.2.1",
|
|
67
|
+
"vinyl-source-stream": "^2.0.0",
|
|
68
|
+
"webpack-stream": "^5.2.1"
|
|
69
|
+
},
|
|
70
|
+
"resolutions": {
|
|
71
|
+
"graceful-fs": "4.2.3",
|
|
72
|
+
"eslint": "8.57.0"
|
|
73
|
+
},
|
|
74
|
+
"husky": {
|
|
75
|
+
"hooks": {
|
|
76
|
+
"pre-push": "gulp sass-lint && gulp js-lint-husky"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"overrides": {
|
|
80
|
+
"graceful-fs": "^4.2.9",
|
|
81
|
+
"eslint": "8.57.0"
|
|
82
|
+
}
|
|
79
83
|
}
|