mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 03:26:04 +01:00
Bump dependencies
Bumping eslint & configs meant making some linting fixes For future reference, the `xmlhttprequest-ssl` library must be of equal versioning to the one in `engine.io-client`, otherwise it won't be deduped which causes the socket.io tests to fail
This commit is contained in:
committed by
Julian Lam
parent
47bbe846cb
commit
da9da8190f
@@ -32,6 +32,9 @@
|
|||||||
"no-prototype-builtins": "off",
|
"no-prototype-builtins": "off",
|
||||||
"new-cap": "off",
|
"new-cap": "off",
|
||||||
"no-plusplus": ["error", { "allowForLoopAfterthoughts": true }],
|
"no-plusplus": ["error", { "allowForLoopAfterthoughts": true }],
|
||||||
|
"object-curly-newline": "off",
|
||||||
|
"no-restricted-globals": "off",
|
||||||
|
"function-paren-newline": "off",
|
||||||
"import/no-unresolved": "error",
|
"import/no-unresolved": "error",
|
||||||
|
|
||||||
// ES6
|
// ES6
|
||||||
@@ -42,6 +45,7 @@
|
|||||||
"no-var": "off",
|
"no-var": "off",
|
||||||
"object-shorthand": "off",
|
"object-shorthand": "off",
|
||||||
"vars-on-top": "off",
|
"vars-on-top": "off",
|
||||||
|
"prefer-destructuring": "off",
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
"import/no-extraneous-dependencies": "off",
|
"import/no-extraneous-dependencies": "off",
|
||||||
|
|||||||
60
package.json
60
package.json
@@ -19,27 +19,27 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ace-builds": "^1.2.8",
|
"ace-builds": "^1.2.8",
|
||||||
"async": "2.5.0",
|
"async": "2.5.0",
|
||||||
"autoprefixer": "7.1.3",
|
"autoprefixer": "7.1.4",
|
||||||
"bcryptjs": "2.4.3",
|
"bcryptjs": "2.4.3",
|
||||||
"benchpressjs": "^1.0.3",
|
"benchpressjs": "^1.1.0",
|
||||||
"body-parser": "^1.17.2",
|
"body-parser": "^1.18.2",
|
||||||
"bootstrap": "^3.3.7",
|
"bootstrap": "^3.3.7",
|
||||||
"chart.js": "^2.6.0",
|
"chart.js": "^2.6.0",
|
||||||
"colors": "^1.1.2",
|
"colors": "^1.1.2",
|
||||||
"compression": "^1.7.0",
|
"compression": "^1.7.1",
|
||||||
"connect-ensure-login": "^0.1.1",
|
"connect-ensure-login": "^0.1.1",
|
||||||
"connect-flash": "^0.1.1",
|
"connect-flash": "^0.1.1",
|
||||||
"connect-mongo": "1.3.2",
|
"connect-mongo": "1.3.2",
|
||||||
"connect-multiparty": "^2.0.0",
|
"connect-multiparty": "^2.0.0",
|
||||||
"connect-redis": "3.3.0",
|
"connect-redis": "3.3.2",
|
||||||
"cookie-parser": "^1.4.3",
|
"cookie-parser": "^1.4.3",
|
||||||
"cron": "^1.2.1",
|
"cron": "^1.2.1",
|
||||||
"cropperjs": "^0.8.1",
|
"cropperjs": "^1.0.0",
|
||||||
"csurf": "^1.9.0",
|
"csurf": "^1.9.0",
|
||||||
"daemon": "^1.1.0",
|
"daemon": "^1.1.0",
|
||||||
"express": "^4.15.4",
|
"express": "^4.16.1",
|
||||||
"express-session": "^1.15.5",
|
"express-session": "^1.15.6",
|
||||||
"express-useragent": "1.0.7",
|
"express-useragent": "1.0.8",
|
||||||
"html-to-text": "3.3.0",
|
"html-to-text": "3.3.0",
|
||||||
"ipaddr.js": "^1.5.2",
|
"ipaddr.js": "^1.5.2",
|
||||||
"jimp": "0.2.28",
|
"jimp": "0.2.28",
|
||||||
@@ -49,13 +49,13 @@
|
|||||||
"lodash": "^4.17.4",
|
"lodash": "^4.17.4",
|
||||||
"logrotate-stream": "^0.2.5",
|
"logrotate-stream": "^0.2.5",
|
||||||
"lru-cache": "4.1.1",
|
"lru-cache": "4.1.1",
|
||||||
"mime": "^1.4.0",
|
"mime": "^2.0.3",
|
||||||
"minimist": "^1.2.0",
|
"minimist": "^1.2.0",
|
||||||
"mkdirp": "^0.5.1",
|
"mkdirp": "^0.5.1",
|
||||||
"mongodb": "2.2.31",
|
"mongodb": "2.2.31",
|
||||||
"morgan": "^1.8.2",
|
"morgan": "^1.9.0",
|
||||||
"mousetrap": "^1.6.1",
|
"mousetrap": "^1.6.1",
|
||||||
"nconf": "^0.8.4",
|
"nconf": "^0.8.5",
|
||||||
"nodebb-plugin-composer-default": "6.0.0",
|
"nodebb-plugin-composer-default": "6.0.0",
|
||||||
"nodebb-plugin-dbsearch": "2.0.6",
|
"nodebb-plugin-dbsearch": "2.0.6",
|
||||||
"nodebb-plugin-emoji-extended": "1.1.1",
|
"nodebb-plugin-emoji-extended": "1.1.1",
|
||||||
@@ -70,20 +70,20 @@
|
|||||||
"nodebb-theme-slick": "1.1.1",
|
"nodebb-theme-slick": "1.1.1",
|
||||||
"nodebb-theme-vanilla": "7.0.1",
|
"nodebb-theme-vanilla": "7.0.1",
|
||||||
"nodebb-widget-essentials": "3.0.5",
|
"nodebb-widget-essentials": "3.0.5",
|
||||||
"nodemailer": "4.1.0",
|
"nodemailer": "4.1.1",
|
||||||
"passport": "^0.3.0",
|
"passport": "^0.4.0",
|
||||||
"passport-local": "1.0.0",
|
"passport-local": "1.0.0",
|
||||||
"postcss": "6.0.10",
|
"postcss": "6.0.12",
|
||||||
"postcss-clean": "1.0.3",
|
"postcss-clean": "1.1.0",
|
||||||
"promise-polyfill": "^6.0.2",
|
"promise-polyfill": "^6.0.2",
|
||||||
"prompt": "^1.0.0",
|
"prompt": "^1.0.0",
|
||||||
"redis": "2.8.0",
|
"redis": "2.8.0",
|
||||||
"request": "2.81.0",
|
"request": "2.83.0",
|
||||||
"rimraf": "2.6.1",
|
"rimraf": "2.6.2",
|
||||||
"rss": "^1.2.2",
|
"rss": "^1.2.2",
|
||||||
"sanitize-html": "^1.14.0",
|
"sanitize-html": "^1.14.1",
|
||||||
"semver": "^5.4.1",
|
"semver": "^5.4.1",
|
||||||
"serve-favicon": "^2.4.3",
|
"serve-favicon": "^2.4.5",
|
||||||
"sitemap": "^1.13.0",
|
"sitemap": "^1.13.0",
|
||||||
"socket.io": "2.0.3",
|
"socket.io": "2.0.3",
|
||||||
"socket.io-client": "2.0.3",
|
"socket.io-client": "2.0.3",
|
||||||
@@ -92,24 +92,24 @@
|
|||||||
"spdx-license-list": "^3.0.1",
|
"spdx-license-list": "^3.0.1",
|
||||||
"string": "^3.3.3",
|
"string": "^3.3.3",
|
||||||
"toobusy-js": "^0.5.1",
|
"toobusy-js": "^0.5.1",
|
||||||
"uglify-js": "^3.0.28",
|
"uglify-js": "^3.1.3",
|
||||||
"validator": "8.1.0",
|
"validator": "9.0.0",
|
||||||
"winston": "^2.3.1",
|
"winston": "^2.3.1",
|
||||||
"xml": "^1.0.1",
|
"xml": "^1.0.1",
|
||||||
"xregexp": "3.2.0",
|
"xregexp": "3.2.0",
|
||||||
"zxcvbn": "^4.4.2"
|
"zxcvbn": "^4.4.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"coveralls": "^2.11.14",
|
"coveralls": "^3.0.0",
|
||||||
"eslint": "^3.12.0",
|
"eslint": "^4.8.0",
|
||||||
"eslint-config-airbnb-base": "^11.1.0",
|
"eslint-config-airbnb-base": "^12.0.1",
|
||||||
"eslint-plugin-import": "^2.2.0",
|
"eslint-plugin-import": "^2.7.0",
|
||||||
"grunt": "^1.0.1",
|
"grunt": "^1.0.1",
|
||||||
"grunt-contrib-watch": "^1.0.0",
|
"grunt-contrib-watch": "^1.0.0",
|
||||||
"istanbul": "^0.4.2",
|
"istanbul": "^0.4.5",
|
||||||
"jsdom": "^11.2.0",
|
"jsdom": "^11.3.0",
|
||||||
"mocha": "^3.5.0",
|
"mocha": "^3.5.3",
|
||||||
"mocha-lcov-reporter": "^1.2.0",
|
"mocha-lcov-reporter": "^1.3.0",
|
||||||
"xmlhttprequest": "1.8.0",
|
"xmlhttprequest": "1.8.0",
|
||||||
"xmlhttprequest-ssl": "1.5.3"
|
"xmlhttprequest-ssl": "1.5.3"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -148,8 +148,7 @@ define('admin/extend/widgets', ['jqueryui'], function () {
|
|||||||
.addClass(btn.attr('data-class'));
|
.addClass(btn.attr('data-class'));
|
||||||
|
|
||||||
container.attr('data-container-html', container.attr('data-container-html')
|
container.attr('data-container-html', container.attr('data-container-html')
|
||||||
.replace(/class="[a-zA-Z0-9-\s]+"/, 'class="' + container[0].className.replace(' pointer ui-draggable', '') + '"')
|
.replace(/class="[a-zA-Z0-9-\s]+"/, 'class="' + container[0].className.replace(' pointer ui-draggable', '') + '"'));
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -472,8 +472,7 @@ define('admin/general/dashboard', ['semver', 'Chart', 'translator', 'benchpress'
|
|||||||
var topic = topics[tids[i]];
|
var topic = topics[tids[i]];
|
||||||
var label = topic.value === '0' ? topic.title : '<a title="' + topic.title + '"href="' + RELATIVE_PATH + '/topic/' + tids[i] + '" target="_blank"> ' + topic.title + '</a>';
|
var label = topic.value === '0' ? topic.title : '<a title="' + topic.title + '"href="' + RELATIVE_PATH + '/topic/' + tids[i] + '" target="_blank"> ' + topic.title + '</a>';
|
||||||
|
|
||||||
legend.append(
|
legend.append('<li>' +
|
||||||
'<li>' +
|
|
||||||
'<div style="background-color: ' + topicColors[i] + ';"></div>' +
|
'<div style="background-color: ' + topicColors[i] + ';"></div>' +
|
||||||
'<span>' + label + '</span>' +
|
'<span>' + label + '</span>' +
|
||||||
'</li>');
|
'</li>');
|
||||||
|
|||||||
@@ -73,7 +73,8 @@ define('forum/account/header', [
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setupCoverPhoto() {
|
function setupCoverPhoto() {
|
||||||
coverPhoto.init(components.get('account/cover'),
|
coverPhoto.init(
|
||||||
|
components.get('account/cover'),
|
||||||
function (imageData, position, callback) {
|
function (imageData, position, callback) {
|
||||||
socket.emit('user.updateCover', {
|
socket.emit('user.updateCover', {
|
||||||
uid: ajaxify.data.uid,
|
uid: ajaxify.data.uid,
|
||||||
|
|||||||
@@ -96,9 +96,7 @@ define('forum/chats/messages', ['components', 'sounds', 'translator', 'benchpres
|
|||||||
|
|
||||||
messages.scrollToBottom = function (containerEl) {
|
messages.scrollToBottom = function (containerEl) {
|
||||||
if (containerEl.length) {
|
if (containerEl.length) {
|
||||||
containerEl.scrollTop(
|
containerEl.scrollTop(containerEl[0].scrollHeight - containerEl.height());
|
||||||
containerEl[0].scrollHeight - containerEl.height()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ define('forum/groups/details', [
|
|||||||
if (ajaxify.data.group.isOwner) {
|
if (ajaxify.data.group.isOwner) {
|
||||||
Details.prepareSettings();
|
Details.prepareSettings();
|
||||||
|
|
||||||
coverPhoto.init(components.get('groups/cover'),
|
coverPhoto.init(
|
||||||
|
components.get('groups/cover'),
|
||||||
function (imageData, position, callback) {
|
function (imageData, position, callback) {
|
||||||
socket.emit('groups.cover.update', {
|
socket.emit('groups.cover.update', {
|
||||||
groupName: groupName,
|
groupName: groupName,
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ uploadsController.uploadLogo = function (req, res, next) {
|
|||||||
uploadsController.uploadSound = function (req, res, next) {
|
uploadsController.uploadSound = function (req, res, next) {
|
||||||
var uploadedFile = req.files.files[0];
|
var uploadedFile = req.files.files[0];
|
||||||
|
|
||||||
var mimeType = mime.lookup(uploadedFile.name);
|
var mimeType = mime.getType(uploadedFile.name);
|
||||||
if (!/^audio\//.test(mimeType)) {
|
if (!/^audio\//.test(mimeType)) {
|
||||||
return next(Error('[[error:invalid-data]]'));
|
return next(Error('[[error:invalid-data]]'));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ file.saveFileToLocal = function (filename, folder, tempPath, callback) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
file.base64ToLocal = function (imageData, uploadPath, callback) {
|
file.base64ToLocal = function (imageData, uploadPath, callback) {
|
||||||
var buffer = new Buffer(imageData.slice(imageData.indexOf('base64') + 7), 'base64');
|
var buffer = Buffer.from(imageData.slice(imageData.indexOf('base64') + 7), 'base64');
|
||||||
uploadPath = path.join(nconf.get('upload_path'), uploadPath);
|
uploadPath = path.join(nconf.get('upload_path'), uploadPath);
|
||||||
|
|
||||||
fs.writeFile(uploadPath, buffer, {
|
fs.writeFile(uploadPath, buffer, {
|
||||||
@@ -141,7 +141,7 @@ file.linkDirs = function linkDirs(sourceDir, destDir, callback) {
|
|||||||
file.typeToExtension = function (type) {
|
file.typeToExtension = function (type) {
|
||||||
var extension;
|
var extension;
|
||||||
if (type) {
|
if (type) {
|
||||||
extension = '.' + mime.extension(type);
|
extension = '.' + mime.getExtension(type);
|
||||||
}
|
}
|
||||||
return extension;
|
return extension;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ module.exports = function (Groups) {
|
|||||||
|
|
||||||
var tempPath = data.file ? data.file : '';
|
var tempPath = data.file ? data.file : '';
|
||||||
var url;
|
var url;
|
||||||
var type = data.file ? mime.lookup(data.file) : 'image/png';
|
var type = data.file ? mime.getType(data.file) : 'image/png';
|
||||||
|
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
function (next) {
|
function (next) {
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ image.writeImageDataToTempFile = function (imageData, callback) {
|
|||||||
|
|
||||||
var filepath = path.join(os.tmpdir(), filename + extension);
|
var filepath = path.join(os.tmpdir(), filename + extension);
|
||||||
|
|
||||||
var buffer = new Buffer(imageData.slice(imageData.indexOf('base64') + 7), 'base64');
|
var buffer = Buffer.from(imageData.slice(imageData.indexOf('base64') + 7), 'base64');
|
||||||
|
|
||||||
fs.writeFile(filepath, buffer, {
|
fs.writeFile(filepath, buffer, {
|
||||||
encoding: 'base64',
|
encoding: 'base64',
|
||||||
|
|||||||
@@ -282,9 +282,9 @@ function buildCSS(data, callback) {
|
|||||||
processImportFrom: ['local'],
|
processImportFrom: ['local'],
|
||||||
}),
|
}),
|
||||||
] : [autoprefixer]).process(lessOutput.css).then(function (result) {
|
] : [autoprefixer]).process(lessOutput.css).then(function (result) {
|
||||||
callback(null, { code: result.css });
|
process.nextTick(callback, null, { code: result.css });
|
||||||
}, function (err) {
|
}, function (err) {
|
||||||
callback(err);
|
process.nextTick(callback, err);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,8 +39,7 @@ module.exports = function (Plugins) {
|
|||||||
(Plugins.deprecatedHooks[data.hook] ?
|
(Plugins.deprecatedHooks[data.hook] ?
|
||||||
'please use `' + Plugins.deprecatedHooks[data.hook] + '` instead.' :
|
'please use `' + Plugins.deprecatedHooks[data.hook] + '` instead.' :
|
||||||
'there is no alternative.'
|
'there is no alternative.'
|
||||||
)
|
));
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
// handle hook's startsWith, i.e. action:homepage.get
|
// handle hook's startsWith, i.e. action:homepage.get
|
||||||
var parts = data.hook.split(':');
|
var parts = data.hook.split(':');
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ module.exports = function (Topics) {
|
|||||||
|
|
||||||
var extension = path.extname(data.thumb);
|
var extension = path.extname(data.thumb);
|
||||||
if (!extension) {
|
if (!extension) {
|
||||||
extension = '.' + mime.extension(type);
|
extension = '.' + mime.getExtension(type);
|
||||||
}
|
}
|
||||||
filename = Date.now() + '-topic-thumb' + extension;
|
filename = Date.now() + '-topic-thumb' + extension;
|
||||||
pathToUpload = path.join(nconf.get('upload_path'), 'files', filename);
|
pathToUpload = path.join(nconf.get('upload_path'), 'files', filename);
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ module.exports = function (User) {
|
|||||||
var uploadSize = parseInt(meta.config.maximumProfileImageSize, 10) || 256;
|
var uploadSize = parseInt(meta.config.maximumProfileImageSize, 10) || 256;
|
||||||
var size = res.headers['content-length'];
|
var size = res.headers['content-length'];
|
||||||
var type = res.headers['content-type'];
|
var type = res.headers['content-type'];
|
||||||
var extension = mime.extension(type);
|
var extension = mime.getExtension(type);
|
||||||
|
|
||||||
if (['png', 'jpeg', 'jpg', 'gif'].indexOf(extension) === -1) {
|
if (['png', 'jpeg', 'jpg', 'gif'].indexOf(extension) === -1) {
|
||||||
return callback(new Error('[[error:invalid-image-extension]]'));
|
return callback(new Error('[[error:invalid-image-extension]]'));
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ describe('minifier', function () {
|
|||||||
it('.css.bundle() should minify styles', function (done) {
|
it('.css.bundle() should minify styles', function (done) {
|
||||||
minifier.css.bundle(styles, paths, true, false, function (err, bundle) {
|
minifier.css.bundle(styles, paths, true, false, function (err, bundle) {
|
||||||
assert.ifError(err);
|
assert.ifError(err);
|
||||||
assert.strictEqual(bundle.code, '.help{margin:10px;display:block}.yellow{background:#ff0}.help .blue{background:#00f}');
|
assert.strictEqual(bundle.code, '.help{margin:10px}.yellow{background:#ff0}.help{display:block}.help .blue{background:#00f}');
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -67,10 +67,8 @@ describe('admin search', function () {
|
|||||||
describe('simplify', function () {
|
describe('simplify', function () {
|
||||||
it('should remove all mustaches', function (done) {
|
it('should remove all mustaches', function (done) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
search.simplify(
|
search.simplify('Pellentesque tristique {{senectus}}habitant morbi' +
|
||||||
'Pellentesque tristique {{senectus}}habitant morbi' +
|
'liquam tincidunt {mauris.eu}risus'),
|
||||||
'liquam tincidunt {mauris.eu}risus'
|
|
||||||
),
|
|
||||||
'Pellentesque tristique habitant morbi' +
|
'Pellentesque tristique habitant morbi' +
|
||||||
'liquam tincidunt risus'
|
'liquam tincidunt risus'
|
||||||
);
|
);
|
||||||
@@ -78,10 +76,8 @@ describe('admin search', function () {
|
|||||||
});
|
});
|
||||||
it('should collapse all whitespace', function (done) {
|
it('should collapse all whitespace', function (done) {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
search.simplify(
|
search.simplify('Pellentesque tristique habitant morbi' +
|
||||||
'Pellentesque tristique habitant morbi' +
|
' \n\n liquam tincidunt mauris eu risus.'),
|
||||||
' \n\n liquam tincidunt mauris eu risus.'
|
|
||||||
),
|
|
||||||
'Pellentesque tristique habitant morbi' +
|
'Pellentesque tristique habitant morbi' +
|
||||||
'\nliquam tincidunt mauris eu risus.'
|
'\nliquam tincidunt mauris eu risus.'
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -72,7 +72,8 @@ describe('socket.io', function () {
|
|||||||
helpers.connectSocketIO(res, function (err, _io) {
|
helpers.connectSocketIO(res, function (err, _io) {
|
||||||
io = _io;
|
io = _io;
|
||||||
assert.ifError(err);
|
assert.ifError(err);
|
||||||
done(err);
|
|
||||||
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -654,8 +654,8 @@ describe('Topic\'s', function () {
|
|||||||
function (next) {
|
function (next) {
|
||||||
topicPids = replies.map(function (reply) { return reply.pid; });
|
topicPids = replies.map(function (reply) { return reply.pid; });
|
||||||
socketTopics.bookmark({ uid: topic.userId }, { tid: newTopic.tid, index: originalBookmark }, next);
|
socketTopics.bookmark({ uid: topic.userId }, { tid: newTopic.tid, index: originalBookmark }, next);
|
||||||
}],
|
},
|
||||||
done);
|
], done);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should fail with invalid data', function (done) {
|
it('should fail with invalid data', function (done) {
|
||||||
@@ -711,7 +711,8 @@ describe('Topic\'s', function () {
|
|||||||
'Fork test, no bookmark update',
|
'Fork test, no bookmark update',
|
||||||
topicPids.slice(1, 3),
|
topicPids.slice(1, 3),
|
||||||
newTopic.tid,
|
newTopic.tid,
|
||||||
next);
|
next
|
||||||
|
);
|
||||||
},
|
},
|
||||||
function (forkedTopicData, next) {
|
function (forkedTopicData, next) {
|
||||||
topics.getUserBookmark(newTopic.tid, topic.userId, next);
|
topics.getUserBookmark(newTopic.tid, topic.userId, next);
|
||||||
|
|||||||
Reference in New Issue
Block a user