Merge branch 'master' into acp-paper

v1.18.x
psychobunny 10 years ago
commit 3c43e58d85

@ -2,7 +2,7 @@
"name": "nodebb", "name": "nodebb",
"license": "GPL-3.0", "license": "GPL-3.0",
"description": "NodeBB Forum", "description": "NodeBB Forum",
"version": "0.7.3-dev", "version": "0.7.3",
"homepage": "http://www.nodebb.org", "homepage": "http://www.nodebb.org",
"repository": { "repository": {
"type": "git", "type": "git",
@ -45,7 +45,7 @@
"nodebb-plugin-emoji-extended": "0.4.9", "nodebb-plugin-emoji-extended": "0.4.9",
"nodebb-plugin-markdown": "4.0.4", "nodebb-plugin-markdown": "4.0.4",
"nodebb-plugin-mentions": "1.0.0", "nodebb-plugin-mentions": "1.0.0",
"nodebb-plugin-soundpack-default": "0.1.2", "nodebb-plugin-soundpack-default": "0.1.3",
"nodebb-plugin-spam-be-gone": "0.4.1", "nodebb-plugin-spam-be-gone": "0.4.1",
"nodebb-rewards-essentials": "0.0.3", "nodebb-rewards-essentials": "0.0.3",
"nodebb-theme-lavender": "1.0.49", "nodebb-theme-lavender": "1.0.49",

@ -29,7 +29,7 @@ module.exports = function(Meta) {
var pkgData = JSON.parse(pkgData), var pkgData = JSON.parse(pkgData),
ok = semver.satisfies(pkgData.version, pkg.dependencies[module]); ok = semver.satisfies(pkgData.version, pkg.dependencies[module]);
if (ok || pkgData._resolved.indexOf('//github.com') != -1) { if (ok || (pkgData._resolved && pkgData._resolved.indexOf('//github.com') !== -1)) {
next(true); next(true);
} else { } else {
process.stdout.write('[' + 'outdated'.yellow + '] ' + module.bold + ' v' + pkgData.version + ', requires ' + pkg.dependencies[module] + '\n') process.stdout.write('[' + 'outdated'.yellow + '] ' + module.bold + ' v' + pkgData.version + ', requires ' + pkg.dependencies[module] + '\n')

@ -31,6 +31,7 @@ var fs = require('fs'),
Plugins.clientScripts = []; Plugins.clientScripts = [];
Plugins.customLanguages = []; Plugins.customLanguages = [];
Plugins.libraryPaths = []; Plugins.libraryPaths = [];
Plugins.versionWarning = [];
Plugins.initialized = false; Plugins.initialized = false;
@ -74,6 +75,7 @@ var fs = require('fs'),
Plugins.libraries = {}; Plugins.libraries = {};
Plugins.loadedHooks = {}; Plugins.loadedHooks = {};
Plugins.staticDirs = {}; Plugins.staticDirs = {};
Plugins.versionWarning = [];
Plugins.cssFiles.length = 0; Plugins.cssFiles.length = 0;
Plugins.lessFiles.length = 0; Plugins.lessFiles.length = 0;
Plugins.clientScripts.length = 0; Plugins.clientScripts.length = 0;
@ -106,6 +108,16 @@ var fs = require('fs'),
}); });
}, },
function(next) { function(next) {
// If some plugins are incompatible, throw the warning here
if (Plugins.versionWarning.length) {
process.stdout.write('\n');
winston.warn('[plugins/load] The following plugins may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing. In the event of an unresponsive NodeBB caused by this plugin, run `./nodebb reset -p PLUGINNAME` to disable it.');
for(var x=0,numPlugins=Plugins.versionWarning.length;x<numPlugins;x++) {
process.stdout.write(' * '.yellow + Plugins.versionWarning[x].reset + '\n');
}
process.stdout.write('\n');
}
Object.keys(Plugins.loadedHooks).forEach(function(hook) { Object.keys(Plugins.loadedHooks).forEach(function(hook) {
var hooks = Plugins.loadedHooks[hook]; var hooks = Plugins.loadedHooks[hook];
hooks = hooks.sort(function(a, b) { hooks = hooks.sort(function(a, b) {

@ -20,7 +20,7 @@ module.exports = function(Plugins) {
return callback(pluginPath.match('nodebb-theme') ? null : err); return callback(pluginPath.match('nodebb-theme') ? null : err);
} }
versionWarning(pluginData); checkVersion(pluginData);
async.parallel([ async.parallel([
function(next) { function(next) {
@ -53,20 +53,19 @@ module.exports = function(Plugins) {
}); });
}; };
function versionWarning(pluginData) { function checkVersion(pluginData) {
function display() { function add() {
process.stdout.write('\n'); if (Plugins.versionWarning.indexOf(pluginData.id) === -1) {
winston.warn('[plugins/' + pluginData.id + '] This plugin may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing.'); Plugins.versionWarning.push(pluginData.id);
winston.warn('[plugins/' + pluginData.id + '] In the event of an unresponsive NodeBB caused by this plugin, run ./nodebb reset -p ' + pluginData.id + '.'); }
process.stdout.write('\n');
} }
if (pluginData.nbbpm && pluginData.nbbpm.compatibility && semver.validRange(pluginData.nbbpm.compatibility)) { if (pluginData.nbbpm && pluginData.nbbpm.compatibility && semver.validRange(pluginData.nbbpm.compatibility)) {
if (!semver.gtr(nconf.get('version'), pluginData.nbbpm.compatibility)) { if (!semver.satisfies(nconf.get('version'), pluginData.nbbpm.compatibility)) {
display(); add();
} }
} else { } else {
display(); add();
} }
} }

Loading…
Cancel
Save