Clean logs on start - and eslint/mocha with code coverage (#1945)

* Clean logs on startup; install server-side testing/linting

* Add eslint config, make all of app/ conform to its demands

* Add Node.js testing and linting to CI

* Lock project to Node.js 7.9.0, used by Electron 1.7.10

* New eslint error: trailing commas in function argumensts

Node 7.9.0 doesn't like trailing commas, but Electron does

* Move electron to devDependency, tell eslint it's built-in
This commit is contained in:
Scott Nonnenberg 2018-01-08 13:19:25 -08:00 committed by GitHub
parent 6464d0a5fa
commit 64fe9dbfb2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 1782 additions and 316 deletions

View file

@ -1,18 +1,20 @@
function createTemplate(options, messages) {
const showDebugLog = options.showDebugLog;
const showAbout = options.showAbout;
const openReleaseNotes = options.openReleaseNotes;
const openNewBugForm = options.openNewBugForm;
const openSupportPage = options.openSupportPage;
const openForums = options.openForums;
const {
showDebugLog,
showAbout,
openReleaseNotes,
openNewBugForm,
openSupportPage,
openForums,
} = options;
let template = [{
const template = [{
label: messages.mainMenuFile.message,
submenu: [
{
role: 'quit',
},
]
],
},
{
label: messages.mainMenuEdit.message,
@ -43,8 +45,8 @@ function createTemplate(options, messages) {
},
{
role: 'selectall',
}
]
},
],
},
{
label: messages.mainMenuView.message,
@ -77,7 +79,7 @@ function createTemplate(options, messages) {
{
role: 'toggledevtools',
},
]
],
},
{
label: messages.mainMenuWindow.message,
@ -86,7 +88,7 @@ function createTemplate(options, messages) {
{
role: 'minimize',
},
]
],
},
{
label: messages.mainMenuHelp.message,
@ -118,7 +120,7 @@ function createTemplate(options, messages) {
label: messages.aboutSignalDesktop.message,
click: showAbout,
},
]
],
}];
if (process.platform === 'darwin') {
@ -129,8 +131,10 @@ function createTemplate(options, messages) {
}
function updateForMac(template, messages, options) {
const showWindow = options.showWindow;
const showAbout = options.showAbout;
const {
showWindow,
showAbout,
} = options;
// Remove About item and separator from Help menu, since it's on the first menu
template[4].submenu.pop();
@ -162,13 +166,13 @@ function updateForMac(template, messages, options) {
{
role: 'quit',
},
]
],
});
// Add to Edit menu
template[1].submenu.push(
{
type: 'separator'
type: 'separator',
},
{
label: messages.speech.message,
@ -179,11 +183,12 @@ function updateForMac(template, messages, options) {
{
role: 'stopspeaking',
},
]
],
}
);
// Add to Window menu
// Replace Window menu
// eslint-disable-next-line no-param-reassign
template[3].submenu = [
{
accelerator: 'CmdOrCtrl+W',