refactor(GUI): get rid of the username module (#1245)

This module contains various fallbacks in case `os.userInfo()` doesn't
exist, which does exist in Electron.

Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This commit is contained in:
Juan Cruz Viotti 2017-03-31 10:52:21 -04:00 committed by GitHub
parent 4f66d6713f
commit bc2512ac5e
3 changed files with 1 additions and 33 deletions

View File

@ -22,7 +22,6 @@
const _ = require('lodash');
const angular = require('angular');
const username = require('username');
const isRunningInAsar = require('electron-is-running-in-asar');
const errors = require('../../shared/errors');
const os = require('os');
@ -94,7 +93,7 @@ analytics.run(($window) => {
}
$window.trackJs.configure({
userId: username.sync(),
userId: os.userInfo().username,
version: packageJSON.version
});
});

30
npm-shrinkwrap.json generated
View File

@ -1109,11 +1109,6 @@
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz",
"dev": true
},
"cross-spawn-async": {
"version": "2.2.4",
"from": "cross-spawn-async@>=2.1.1 <3.0.0",
"resolved": "https://registry.npmjs.org/cross-spawn-async/-/cross-spawn-async-2.2.4.tgz"
},
"cryptiles": {
"version": "2.0.5",
"from": "cryptiles@>=2.0.0 <3.0.0",
@ -2252,11 +2247,6 @@
"resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.0.tgz",
"dev": true
},
"execa": {
"version": "0.4.0",
"from": "execa@>=0.4.0 <0.5.0",
"resolved": "https://registry.npmjs.org/execa/-/execa-0.4.0.tgz"
},
"exit-hook": {
"version": "1.1.1",
"from": "exit-hook@>=1.0.0 <2.0.0",
@ -4625,11 +4615,6 @@
"resolved": "https://registry.npmjs.org/markdown-utils/-/markdown-utils-0.7.3.tgz",
"dev": true
},
"mem": {
"version": "0.1.1",
"from": "mem@>=0.1.0 <0.2.0",
"resolved": "https://registry.npmjs.org/mem/-/mem-0.1.1.tgz"
},
"meow": {
"version": "3.7.0",
"from": "meow@>=3.7.0 <4.0.0",
@ -5063,11 +5048,6 @@
"resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.0.1.tgz",
"dev": true
},
"npm-run-path": {
"version": "1.0.0",
"from": "npm-run-path@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-1.0.0.tgz"
},
"npmlog": {
"version": "4.0.2",
"from": "npmlog@>=4.0.0 <5.0.0",
@ -5318,11 +5298,6 @@
"from": "path-is-inside@>=1.0.2 <2.0.0",
"resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz"
},
"path-key": {
"version": "1.0.0",
"from": "path-key@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-1.0.0.tgz"
},
"path-parse": {
"version": "1.0.5",
"from": "path-parse@>=1.0.5 <2.0.0",
@ -6904,11 +6879,6 @@
"resolved": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz",
"dev": true
},
"username": {
"version": "2.2.2",
"from": "username@>=2.1.0 <3.0.0",
"resolved": "https://registry.npmjs.org/username/-/username-2.2.2.tgz"
},
"util": {
"version": "0.10.3",
"from": "util@>=0.10.1 <0.11.0",

View File

@ -105,7 +105,6 @@
"tail": "^1.1.0",
"trackjs": "^2.1.16",
"unbzip2-stream": "^1.0.11",
"username": "^2.1.0",
"yargs": "^4.6.0",
"yauzl": "^2.6.0"
},