mod-build 3.6.91-beta.6 → 3.6.91
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 +48 -38
- package/CHANGELOG.md +1 -2
- package/gulp-tasks/cache-bust.js +2 -2
- package/gulp-tasks/copy-xml-files-to-dist.js +7 -0
- package/gulp-tasks/extras.js +1 -0
- package/gulp-tasks/js-lint.js +4 -6
- package/gulp-tasks/serve.js +3 -3
- package/gulp-tasks/tasks.js +11 -12
- package/gulp-tasks/templates.js +1 -0
- package/package.json +3 -7
- package/gulp-tasks/add-editorconfig.js +0 -22
package/.eslintrc.yml
CHANGED
|
@@ -1,49 +1,59 @@
|
|
|
1
1
|
parserOptions:
|
|
2
|
-
ecmaVersion:
|
|
2
|
+
ecmaVersion: 2018
|
|
3
3
|
sourceType: 'module'
|
|
4
|
-
|
|
5
4
|
env:
|
|
6
5
|
browser: true
|
|
7
6
|
jquery: true
|
|
8
|
-
node: true
|
|
9
|
-
|
|
10
|
-
extends: 'eslint:recommended'
|
|
11
7
|
|
|
12
8
|
globals:
|
|
13
9
|
require: true
|
|
14
10
|
module: true
|
|
15
11
|
|
|
16
|
-
rules:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
comma-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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: [1, { requireReturn: false, prefer: { return: "returns" }}],
|
|
12
|
+
rules:
|
|
13
|
+
indent: [1, 'tab']
|
|
14
|
+
brace-style: [2, "1tbs"]
|
|
15
|
+
comma-style: [1, "last"]
|
|
16
|
+
default-case: 2
|
|
17
|
+
no-floating-decimal: 2
|
|
18
|
+
no-nested-ternary: 2
|
|
19
|
+
no-undefined: 2
|
|
20
|
+
space-before-function-paren: [1, "never"]
|
|
21
|
+
keyword-spacing: [2, {before: true, after: true}]
|
|
22
|
+
space-before-blocks: 1
|
|
23
|
+
spaced-comment: [2, "always", { exceptions: ["-"]}]
|
|
24
|
+
valid-jsdoc: [1, { requireReturn: false, prefer: { return: "returns" }}]
|
|
48
25
|
wrap-iife: [2, "inside", { functionPrototypeMethods: true }]
|
|
49
|
-
|
|
26
|
+
guard-for-in: 2
|
|
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
|
package/CHANGELOG.md
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## 3.6.91
|
|
4
4
|
|
|
5
|
-
-
|
|
6
|
-
- 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
|
|
5
|
+
- Added support for xml files
|
|
7
6
|
|
|
8
7
|
## 3.6.90
|
|
9
8
|
|
package/gulp-tasks/cache-bust.js
CHANGED
|
@@ -4,8 +4,8 @@ module.exports = function(gulp, gulpPlugins, siteSettings) {
|
|
|
4
4
|
return gulp.src(siteSettings.distFolder + '/**')
|
|
5
5
|
.pipe(gulpPlugins.revAll.revision({
|
|
6
6
|
dontSearchFile: [/(resources)\/.*/, /(scripts\/components)\/.*/, /(fonts)\/.*/],
|
|
7
|
-
dontRenameFile: [/^\/favicon.ico$/g, '.html', '.txt', /modlogo([\w|\s|-])*\.(?:svg)/g, /(resources)\/.*/, /(fonts)
|
|
8
|
-
dontUpdateReference: [/^\/favicon.ico$/g, '.html', '.txt', /modlogo([\w|\s|-])*\.(?:svg)/g, /(resources)\/.*/, /(fonts)
|
|
7
|
+
dontRenameFile: [/^\/favicon.ico$/g, '.html', '.txt', /modlogo([\w|\s|-])*\.(?:svg)/g, /(resources)\/.*/, /(fonts)\/.*/, '.xml'],
|
|
8
|
+
dontUpdateReference: [/^\/favicon.ico$/g, '.html', '.txt', /modlogo([\w|\s|-])*\.(?:svg)/g, /(resources)\/.*/, /(fonts)\/.*/, '.xml'],
|
|
9
9
|
transformFilename: function (file, hash) {
|
|
10
10
|
var ext = path.extname(file.path);
|
|
11
11
|
return path.basename(file.path, ext) + '-' + hash.substr(0, 8) + ext;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// DO NOT REMOVE! It's being used at site level in the organic sites like MiamiHerald to copy sitemap file to destination folder.
|
|
2
|
+
module.exports = function(gulp, siteSettings) {
|
|
3
|
+
return function() {
|
|
4
|
+
return gulp.src(siteSettings.tmpFolder + '/**/*.xml')
|
|
5
|
+
.pipe(gulp.dest(siteSettings.distFolder));
|
|
6
|
+
};
|
|
7
|
+
};
|
package/gulp-tasks/extras.js
CHANGED
|
@@ -3,6 +3,7 @@ module.exports = function(gulp, gulpPlugins, siteSettings) {
|
|
|
3
3
|
|
|
4
4
|
srcPaths.push(siteSettings.srcFolder + '/*.*');
|
|
5
5
|
srcPaths.push('!' + siteSettings.srcFolder + '/**/*.html');
|
|
6
|
+
srcPaths.push('!' + siteSettings.srcFolder + '/**/*.xml');
|
|
6
7
|
|
|
7
8
|
for (var i = 0; i < siteSettings.browserSyncServeFolders.length; i ++) {
|
|
8
9
|
srcPaths.push(siteSettings.browserSyncServeFolders[i] + '/**/*.otf');
|
package/gulp-tasks/js-lint.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
module.exports = function(gulp, gulpPlugins, siteSettings) {
|
|
2
2
|
var fs = require('fs');
|
|
3
|
-
var gulpESLintNew = require('gulp-eslint-new');
|
|
4
3
|
|
|
5
4
|
// Default jsLint settings
|
|
6
5
|
if ('undefined' === typeof siteSettings.jsLint) {
|
|
7
6
|
siteSettings.jsLint = {
|
|
8
|
-
|
|
7
|
+
configFile: './node_modules/mod-build/.eslintrc.yml'
|
|
9
8
|
};
|
|
10
9
|
}
|
|
11
10
|
|
|
@@ -18,9 +17,8 @@ module.exports = function(gulp, gulpPlugins, siteSettings) {
|
|
|
18
17
|
'!' + siteSettings.srcFolder + '/' + siteSettings.scriptsSubfolder + '/resources/**/*.js', // do not lint copied shared resource scripts,
|
|
19
18
|
'!' + siteSettings.srcFolder + '/' + siteSettings.scriptsCompiledFolder + '**/*.js' // do not lint compiled scripts
|
|
20
19
|
])
|
|
21
|
-
.pipe(
|
|
22
|
-
.pipe(
|
|
23
|
-
.pipe(
|
|
24
|
-
.pipe(gulpESLintNew.failAfterError());
|
|
20
|
+
.pipe(gulpPlugins.eslint(siteSettings.jsLint))
|
|
21
|
+
.pipe(gulpPlugins.eslint.format())
|
|
22
|
+
.pipe(gulpPlugins.eslint.format('junit', fs.createWriteStream('eslint-results.xml')));
|
|
25
23
|
};
|
|
26
24
|
};
|
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', '
|
|
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'];
|
|
8
8
|
} else if (siteData.isQSPage) {
|
|
9
|
-
sequenceOpts = ['clean', '
|
|
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'];
|
|
10
10
|
} else {
|
|
11
|
-
sequenceOpts = ['clean', '
|
|
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'];
|
|
12
12
|
}
|
|
13
13
|
runSequence(...sequenceOpts, () => {
|
|
14
14
|
// Run a BrowserSync server
|
package/gulp-tasks/tasks.js
CHANGED
|
@@ -56,18 +56,6 @@ 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
|
-
|
|
71
59
|
// Grab component files from CDN so they can be swapped into build
|
|
72
60
|
'grab-shared-components': {
|
|
73
61
|
subtasks: [],
|
|
@@ -477,6 +465,17 @@ module.exports = function() {
|
|
|
477
465
|
|
|
478
466
|
return require(opts.gulpTasksFolderPath + '/copy-fonts')(opts.gulp, opts.gulpSettings);
|
|
479
467
|
}
|
|
468
|
+
},
|
|
469
|
+
|
|
470
|
+
'copy-xml-files-to-dist': {
|
|
471
|
+
subtasks: [],
|
|
472
|
+
func: function(opts) {
|
|
473
|
+
if ('undefined' === typeof opts.gulpTasksFolderPath) {
|
|
474
|
+
opts.gulpTasksFolderPath = '.';
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
return require('./copy-xml-files-to-dist')(opts.gulp, opts.gulpSettings);
|
|
478
|
+
}
|
|
480
479
|
}
|
|
481
480
|
};
|
|
482
481
|
|
package/gulp-tasks/templates.js
CHANGED
|
@@ -287,6 +287,7 @@ module.exports = function(gulp, gulpPlugins, siteSettings, siteData) {
|
|
|
287
287
|
return new Promise(function(resolve) {
|
|
288
288
|
return gulp.src([
|
|
289
289
|
siteSettings.srcFolder + '/' + siteSettings.templatesSubfolder + '/**/*.html',
|
|
290
|
+
siteSettings.srcFolder + '/' + '/**/*.xml',
|
|
290
291
|
'!' + siteSettings.srcFolder + '/' + siteSettings.templatesSubfolder + '/_partials/**/*.html'
|
|
291
292
|
])
|
|
292
293
|
.pipe(gulpPlugins.handlebarsFileInclude(templatesData, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mod-build",
|
|
3
|
-
"version": "3.6.91
|
|
3
|
+
"version": "3.6.91",
|
|
4
4
|
"description": "Share components for S3 sites.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
"bootstrap-sass": "^3.4.3",
|
|
16
16
|
"browser-sync": "^2.18.6",
|
|
17
17
|
"del": "^3.0.0",
|
|
18
|
-
"eslint": "^8.57.0",
|
|
19
18
|
"gulp": "^3.9.1",
|
|
20
19
|
"gulp-autoprefixer": "^3.1.1",
|
|
21
20
|
"gulp-babel": "^8.0.0",
|
|
@@ -25,7 +24,6 @@
|
|
|
25
24
|
"gulp-cssmin": "^0.1.7",
|
|
26
25
|
"gulp-csso": "^3.0.0",
|
|
27
26
|
"gulp-eslint": "^5.0.0",
|
|
28
|
-
"gulp-eslint-new": "^2.1.0",
|
|
29
27
|
"gulp-eslint-threshold": "^0.1.1",
|
|
30
28
|
"gulp-filter": "^5.0.0",
|
|
31
29
|
"gulp-handlebars-file-include": "^1.0.0",
|
|
@@ -68,8 +66,7 @@
|
|
|
68
66
|
"webpack-stream": "^5.2.1"
|
|
69
67
|
},
|
|
70
68
|
"resolutions": {
|
|
71
|
-
"graceful-fs": "4.2.3"
|
|
72
|
-
"eslint": "8.57.0"
|
|
69
|
+
"graceful-fs": "4.2.3"
|
|
73
70
|
},
|
|
74
71
|
"husky": {
|
|
75
72
|
"hooks": {
|
|
@@ -77,7 +74,6 @@
|
|
|
77
74
|
}
|
|
78
75
|
},
|
|
79
76
|
"overrides": {
|
|
80
|
-
"graceful-fs": "^4.2.9"
|
|
81
|
-
"eslint": "^8.57.0"
|
|
77
|
+
"graceful-fs": "^4.2.9"
|
|
82
78
|
}
|
|
83
79
|
}
|
|
@@ -1,22 +0,0 @@
|
|
|
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
|
-
}
|