From 95b13ce5e2fe3ee496a1339e010f10aa74082fa3 Mon Sep 17 00:00:00 2001 From: hinamiyagk Date: Tue, 19 Jan 2016 18:07:40 +0900 Subject: [PATCH 1/2] Make companyName and submitURL option required on crashReporter.start --- github-electron/github-electron-main-tests.ts | 3 --- github-electron/github-electron.d.ts | 14 +++++--------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/github-electron/github-electron-main-tests.ts b/github-electron/github-electron-main-tests.ts index fd7437a890..a60ffed8e7 100644 --- a/github-electron/github-electron-main-tests.ts +++ b/github-electron/github-electron-main-tests.ts @@ -26,9 +26,6 @@ import path = require('path'); // Quick start // https://github.com/atom/electron/blob/master/docs/tutorial/quick-start.md -// Report crashes to our server. -require('crash-reporter').start(); - // Keep a global reference of the window object, if you don't, the window will // be closed automatically when the javascript object is GCed. var mainWindow: GitHubElectron.BrowserWindow = null; diff --git a/github-electron/github-electron.d.ts b/github-electron/github-electron.d.ts index 290bf06aa2..85f6eaa982 100644 --- a/github-electron/github-electron.d.ts +++ b/github-electron/github-electron.d.ts @@ -1193,7 +1193,7 @@ declare module GitHubElectron { /** * File types that can be displayed, see dialog.showOpenDialog for an example. */ - + filters?: { name: string; extensions: string[]; @@ -1334,15 +1334,11 @@ declare module GitHubElectron { * Default: Electron */ productName?: string; - /** - * Default: GitHub, Inc. - */ - companyName?: string; + companyName: string; /** * URL that crash reports would be sent to as POST. - * Default: http://54.249.141.255:1127/post */ - submitURL?: string; + submitURL: string; /** * Send the crash report without user interaction. * Default: true. @@ -1357,7 +1353,7 @@ declare module GitHubElectron { * Only string properties are send correctly. * Nested objects are not supported. */ - extra?: {}; + extra?: any; } interface CrashReporterPayload extends Object { @@ -1401,7 +1397,7 @@ declare module GitHubElectron { } interface CrashReporter { - start(options?: CrashReporterStartOptions): void; + start(options: CrashReporterStartOptions): void; /** * @returns The date and ID of the last crash report. When there was no crash report From 8e0f150890d6523858654968a7418c06f26fef72 Mon Sep 17 00:00:00 2001 From: hinamiyagk Date: Sat, 23 Jan 2016 15:01:48 +0900 Subject: [PATCH 2/2] Make CrashReporterStartOptions.extra have only string properties --- github-electron/github-electron-main-tests.ts | 5 ++++- github-electron/github-electron.d.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/github-electron/github-electron-main-tests.ts b/github-electron/github-electron-main-tests.ts index a60ffed8e7..432fb58fd7 100644 --- a/github-electron/github-electron-main-tests.ts +++ b/github-electron/github-electron-main-tests.ts @@ -497,7 +497,10 @@ crashReporter.start({ productName: 'YourName', companyName: 'YourCompany', submitURL: 'https://your-domain.com/url-to-submit', - autoSubmit: true + autoSubmit: true, + extra: { + someKey: "value" + } }); // nativeImage diff --git a/github-electron/github-electron.d.ts b/github-electron/github-electron.d.ts index 85f6eaa982..7992764246 100644 --- a/github-electron/github-electron.d.ts +++ b/github-electron/github-electron.d.ts @@ -1353,7 +1353,7 @@ declare module GitHubElectron { * Only string properties are send correctly. * Nested objects are not supported. */ - extra?: any; + extra?: {[prop: string]: string}; } interface CrashReporterPayload extends Object {