feat: #8734, remove semver.browser

use compare-versions as a module
v1.18.x
Barış Soner Uşaklı 5 years ago
parent 43df4b8e15
commit ae3a231fce

@ -42,6 +42,7 @@
"clipboard": "^2.0.6", "clipboard": "^2.0.6",
"colors": "^1.4.0", "colors": "^1.4.0",
"commander": "^6.0.0", "commander": "^6.0.0",
"compare-versions": "3.6.0",
"compression": "^1.7.4", "compression": "^1.7.4",
"connect-ensure-login": "^0.1.1", "connect-ensure-login": "^0.1.1",
"connect-flash": "^0.1.1", "connect-flash": "^0.1.1",

@ -1,7 +1,7 @@
'use strict'; 'use strict';
define('admin/dashboard', ['semver', 'Chart', 'translator', 'benchpress'], function (semver, Chart, translator, Benchpress) { define('admin/dashboard', ['Chart', 'translator', 'benchpress'], function (Chart, translator, Benchpress) {
var Admin = {}; var Admin = {};
var intervals = { var intervals = {
rooms: false, rooms: false,

@ -128,8 +128,9 @@ define('admin/extend/plugins', ['jqueryui', 'translator', 'benchpress'], functio
return bootbox.alert('[[admin/extend/plugins:alert.package-manager-unreachable]]'); return bootbox.alert('[[admin/extend/plugins:alert.package-manager-unreachable]]');
} }
require(['semver'], function (semver) { require(['compare-versions'], function (compareVersions) {
if (payload.version !== 'latest' && semver.gt(payload.version, parent.find('.currentVersion').text())) { var currentVersion = parent.find('.currentVersion').text();
if (payload.version !== 'latest' && compareVersions.compare(payload.version, currentVersion, '>')) {
upgrade(pluginID, btn, payload.version); upgrade(pluginID, btn, payload.version);
} else if (payload.version === 'latest') { } else if (payload.version === 'latest') {
confirmInstall(pluginID, function () { confirmInstall(pluginID, function () {

File diff suppressed because it is too large Load Diff

@ -89,7 +89,6 @@ JS.scripts = {
'public/vendor/jquery/sortable/Sortable.js', 'public/vendor/jquery/sortable/Sortable.js',
'public/vendor/colorpicker/colorpicker.js', 'public/vendor/colorpicker/colorpicker.js',
'public/src/admin/admin.js', 'public/src/admin/admin.js',
'public/vendor/semver/semver.browser.js',
'public/vendor/jquery/serializeObject/jquery.ba-serializeobject.min.js', 'public/vendor/jquery/serializeObject/jquery.ba-serializeobject.min.js',
'public/vendor/jquery/deserialize/jquery.deserialize.min.js', 'public/vendor/jquery/deserialize/jquery.deserialize.min.js',
], ],
@ -106,6 +105,7 @@ JS.scripts = {
'nprogress.js': 'node_modules/nprogress/nprogress.js', 'nprogress.js': 'node_modules/nprogress/nprogress.js',
'tinycon.js': 'node_modules/tinycon/tinycon.js', 'tinycon.js': 'node_modules/tinycon/tinycon.js',
'slideout.js': 'node_modules/slideout/dist/slideout.min.js', 'slideout.js': 'node_modules/slideout/dist/slideout.min.js',
'compare-versions.js': 'node_modules/compare-versions/index.js',
}, },
}; };

Loading…
Cancel
Save