Upgrade package versions

- Upgrade electron to 3.0.2
- Upgrade other dependencies to the latest versions
- Clean up deprecated code
This commit is contained in:
Vishwas Shashidhar 2018-10-02 12:34:38 +05:30
parent 6d86071072
commit ba83338e6e
7 changed files with 33 additions and 33 deletions

View File

@ -96,7 +96,7 @@ function readUserConfig(customConfigPath) {
if (err) {
log.send(logLevels.INFO, `cannot open user config file ${configPath}, error is ${err}`);
reject(`cannot open user config file ${configPath}, error is ${err}`);
reject(new Error(`cannot open user config file ${configPath}, error is ${err}`));
return;
}
@ -107,7 +107,7 @@ function readUserConfig(customConfigPath) {
resolve(userConfig);
} catch (e) {
log.send(logLevels.INFO, `cannot parse user config data ${data}, error is ${e}`);
reject(`cannot parse user config data ${data}, error is ${e}`);
reject(new Error(`cannot parse user config data ${data}, error is ${e}`));
}
});
@ -160,13 +160,13 @@ function readGlobalConfig() {
fs.readFile(configPath, 'utf8', (err, data) => {
if (err) {
reject('cannot open global config file: ' + configPath + ', error: ' + err);
reject(new Error('cannot open global config file: ' + configPath + ', error: ' + err));
} else {
try {
// data is the contents of the text file we just read
globalConfig = JSON.parse(data);
} catch (e) {
reject('can not parse config file data: ' + data + ', error: ' + err);
reject(new Error('can not parse config file data: ' + data + ', error: ' + err));
}
getRegistry('PodUrl')
.then((url) => {
@ -212,7 +212,7 @@ function saveUserConfig(fieldName, newValue, oldConfig) {
let configPath = path.join(app.getPath('userData'), configFileName);
if (!oldConfig || !fieldName) {
reject('can not save config, invalid input');
reject(new Error('can not save config, invalid input'));
return;
}
@ -256,14 +256,14 @@ function updateUserConfig(oldUserConfig) {
userConfigFile = path.join(app.getPath('userData'), configFileName);
if (!userConfigFile) {
reject(`user config file doesn't exist`);
reject(new Error(`user config file doesn't exist`));
return;
}
// write the new user config changes to the user config file
fs.writeFile(userConfigFile, newUserConfigString, 'utf-8', (err) => {
if (err) {
reject(`Failed to update user config error: ${err}`);
reject(new Error(`Failed to update user config error: ${err}`));
return;
}
resolve();
@ -284,7 +284,7 @@ function updateUserConfigOnLaunch() {
// user config file doesn't exist, we simple move on
if (!fs.existsSync(userConfigFile)) {
log.send(logLevels.WARN, 'config: Could not find the user config file!');
return Promise.reject('config: Could not find the user config file!');
return Promise.reject(new Error('config: Could not find the user config file!'));
}
// In case the file exists, we remove it so that all the
@ -314,7 +314,7 @@ function getMultipleConfigField(fieldNames) {
let userConfigData;
if (!fieldNames && fieldNames.length < 0) {
reject('cannot read config file, invalid fields');
reject(new Error('cannot read config file, invalid fields'));
return;
}

View File

@ -26,7 +26,7 @@ function getCrashReporterConfig(extras) {
.then((data) => {
if (!data && !data.crashReporter && !data.crashReporter.companyName) {
reject('Company name cannot be empty');
reject(new Error('Company name cannot be empty'));
return;
}

View File

@ -143,7 +143,7 @@ function readResult(outputFileName, resolve, reject, childProcessErr) {
try {
// convert binary data to base64 encoded string
let output = Buffer(data).toString('base64');
let output = Buffer.from(data).toString('base64');
resolve({
type: 'image/jpg;base64',
data: output

View File

@ -17,7 +17,7 @@ function split(v) {
}
function tryParse(v) {
return isNaN(Number(v)) ? v : Number(v);
return Number.isNaN(Number(v)) ? v : Number(v);
}
/**

View File

@ -27,7 +27,7 @@ let symphonyRegistryHKLM6432 = new Registry({
let getRegistry = function (name) {
return new Promise(function (resolve, reject) {
if (isMac) {
reject('registry is not supported for mac osx.');
reject(new Error('registry is not supported for mac osx.'));
return;
}
@ -53,7 +53,7 @@ let getRegistry = function (name) {
if (!err3 && reg3 !== null && reg3.value) {
resolve(reg3.value);
} else {
reject('Cannot find PodUrl Registry. Using default url.');
reject(new Error('Cannot find PodUrl Registry. Using default url.'));
}
});
});

View File

@ -75,38 +75,38 @@
"url": "https://support.symphony.com"
},
"devDependencies": {
"bluebird": "3.5.1",
"browserify": "16.2.2",
"chromedriver": "2.41.0",
"bluebird": "3.5.2",
"browserify": "16.2.3",
"chromedriver": "2.42.0",
"cross-env": "5.2.0",
"electron": "3.0.0",
"electron-builder": "20.28.1",
"electron": "3.0.2",
"electron-builder": "20.28.4",
"electron-builder-squirrel-windows": "12.3.0",
"electron-chromedriver": "3.0.0-beta.1",
"electron-packager": "12.1.0",
"electron-rebuild": "1.7.3",
"eslint": "5.0.1",
"eslint-config-airbnb": "14.1.0",
"eslint-plugin-import": "2.13.0",
"eslint-plugin-jsx-a11y": "6.0.3",
"eslint-plugin-react": "7.10.0",
"glob": "7.1.2",
"jest": "23.5.0",
"electron-rebuild": "1.8.2",
"eslint": "5.6.1",
"eslint-config-airbnb": "17.1.0",
"eslint-plugin-import": "2.14.0",
"eslint-plugin-jsx-a11y": "6.1.1",
"eslint-plugin-react": "7.11.0",
"glob": "7.1.3",
"jest": "23.6.0",
"jest-html-reporter": "2.4.2",
"ncp": "2.0.0",
"robotjs": "0.5.1",
"selenium-webdriver": "3.6.0",
"spectron": "3.8.0",
"spectron": "4.0.0",
"wdio-selenium-standalone-service": "0.0.10"
},
"dependencies": {
"@paulcbetts/system-idle-time": "1.0.4",
"archiver": "2.1.1",
"archiver": "3.0.0",
"async.map": "0.5.2",
"async.mapseries": "0.5.2",
"auto-launch": "5.0.5",
"electron-dl": "1.12.0",
"electron-log": "2.2.15",
"electron-log": "2.2.17",
"electron-spellchecker": "1.1.2",
"ffi": "git+https://github.com/keerthi16/node-ffi.git#v1.2.8",
"filesize": "3.6.1",

View File

@ -264,7 +264,7 @@ describe('read/write config tests', function() {
createTempUserConfig(userConfig);
return updateConfigField('', 'hello word').catch(function (err) {
expect(err).toBe('can not save config, invalid input');
expect(err.message).toBe('can not save config, invalid input');
});
});
@ -290,7 +290,7 @@ describe('read/write config tests', function() {
return saveUserConfig(undefined, 'something', 'oldConfig')
.catch(function (reject) {
expect(reject).toBe('can not save config, invalid input');
expect(reject.message).toBe('can not save config, invalid input');
});
});
@ -304,7 +304,7 @@ describe('read/write config tests', function() {
return saveUserConfig('url2', 'something', undefined)
.catch(function (reject) {
expect(reject).toBe('can not save config, invalid input');
expect(reject.message).toBe('can not save config, invalid input');
});
});