electron update
Summary:
Started with upgrading electron from 3.0.0 to 4.0.5. This required a bunch of subsequent updates:
* upgrading `electron-builder` to latest version, because the old version couldn't build electron 4 apps.
* `appDir` is deprecated in builder config, `projectDir` is used instead, which we already had set, so its fine to just remove this ([see GitHub commit](a5e457163e)).
* upgrading `jest-runner/electron` because the old version couldn't run electron 4 tests.
* upgrading our custom dependency resolution to use electron 4.0.5, because the test runner still resolves to 2.0.8 ([see GitHub issue](https://github.com/facebook-atom/jest-electron-runner/issues/31)).
* updating `sandcastle.sh` to use the new cache files from D14131344.
* removing `package-lock.json` as is was causing warnings. We use `yarn` and `yarn.lock` anyways. This file must have been committed by accident.
* updating our check to only run one version of Flipper at a time to use the new electron API `app.requestSingleInstanceLock` as the old one was removed in electron 4.
* updating the snapshot test that checks App rendering, which changed a little due to the electron upgrade.
* upgrading flow-type definitions to `electron-v4.0.5.js` generated by [electron-flowtype-definitions](https://github.com/danielbuechele/electron-flowtype-definitions).
**PS: Best new feature in Electron 4: Copy&paste working in dev tools**
Reviewed By: jknoxville
Differential Revision: D14131360
fbshipit-source-id: d7ed9643875629a1fa1860bb61b11dd0c64112ab
This commit is contained in:
committed by
Facebook Github Bot
parent
0a59dc2918
commit
13f7444013
@@ -5,7 +5,7 @@
|
||||
* @format
|
||||
* @flow
|
||||
*
|
||||
* This is an autogenerated libdef for: electron-v3.0.0-beta.4 renderer process
|
||||
* This is an autogenerated libdef for: electron-v4.0.5 renderer process
|
||||
*/
|
||||
|
||||
declare module 'electron' {
|
||||
@@ -45,7 +45,7 @@ declare module 'electron' {
|
||||
},
|
||||
crashReporter: {
|
||||
start: (options: {
|
||||
companyName?: ?string,
|
||||
companyName: string,
|
||||
submitURL: string,
|
||||
productName?: ?string,
|
||||
uploadToServer?: ?boolean,
|
||||
@@ -77,7 +77,11 @@ declare module 'electron' {
|
||||
removeAllListeners: (channel: string) => void,
|
||||
send: (channel: string, ...args: Array<any>) => void,
|
||||
sendSync: (channel: string, ...args: Array<any>) => any,
|
||||
sendTo: (windowId: number, channel: string, ...args: Array<any>) => void,
|
||||
sendTo: (
|
||||
webContentsId: number,
|
||||
channel: string,
|
||||
...args: Array<any>
|
||||
) => void,
|
||||
sendToHost: (channel: string, ...args: Array<any>) => void,
|
||||
},
|
||||
nativeImage: {
|
||||
@@ -99,6 +103,7 @@ declare module 'electron' {
|
||||
},
|
||||
process: {
|
||||
crash: () => void,
|
||||
getCreationTime: () => number | null,
|
||||
getCPUUsage: () => CPUUsage,
|
||||
getIOCounters: () => IOCounters,
|
||||
getHeapStatistics: () => {
|
||||
@@ -113,10 +118,9 @@ declare module 'electron' {
|
||||
doesZapGarbage: boolean,
|
||||
},
|
||||
getProcessMemoryInfo: () => {
|
||||
workingSetSize: number,
|
||||
peakWorkingSetSize: number,
|
||||
privateBytes: number,
|
||||
sharedBytes: number,
|
||||
residentSet: number,
|
||||
private: number,
|
||||
shared: number,
|
||||
},
|
||||
getSystemMemoryInfo: () => {
|
||||
total: number,
|
||||
@@ -124,6 +128,7 @@ declare module 'electron' {
|
||||
swapTotal: number,
|
||||
swapFree: number,
|
||||
},
|
||||
takeHeapSnapshot: (filePath: string) => boolean,
|
||||
hang: () => void,
|
||||
setFdLimit: (maxDescriptors: number) => void,
|
||||
on: (eventName: 'loaded', callback: () => void) => void,
|
||||
@@ -133,6 +138,7 @@ declare module 'electron' {
|
||||
noAsar?: ?boolean,
|
||||
noDeprecation?: ?boolean,
|
||||
resourcesPath?: ?string,
|
||||
sandboxed?: ?boolean,
|
||||
throwDeprecation?: ?boolean,
|
||||
traceDeprecation?: ?boolean,
|
||||
traceProcessWarnings?: ?boolean,
|
||||
@@ -223,6 +229,7 @@ declare module 'electron' {
|
||||
disableDomainBlockingFor3DAPIs: () => void,
|
||||
getAppMetrics: () => Array<ProcessMetric>,
|
||||
getGPUFeatureStatus: () => GPUFeatureStatus,
|
||||
getGPUInfo: (infoType: string) => Promise<any>,
|
||||
setBadgeCount: (count: number) => boolean,
|
||||
getBadgeCount: () => number,
|
||||
isUnityRunning: () => boolean,
|
||||
@@ -250,6 +257,7 @@ declare module 'electron' {
|
||||
}) => void,
|
||||
isAccessibilitySupportEnabled: () => boolean,
|
||||
setAccessibilitySupportEnabled: (enabled: boolean) => void,
|
||||
showAboutPanel: () => void,
|
||||
setAboutPanelOptions: (options: {
|
||||
applicationName?: ?string,
|
||||
applicationVersion?: ?string,
|
||||
@@ -260,6 +268,7 @@ declare module 'electron' {
|
||||
startAccessingSecurityScopedResource: (
|
||||
bookmarkData: string,
|
||||
) => Function,
|
||||
enableSandbox: () => void,
|
||||
enableMixedSandbox: () => void,
|
||||
isInApplicationsFolder: () => boolean,
|
||||
moveToApplicationsFolder: () => boolean,
|
||||
@@ -384,7 +393,7 @@ declare module 'electron' {
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'session-created',
|
||||
callback: (event: Event, session: Session) => void,
|
||||
callback: (session: Session) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'second-instance',
|
||||
@@ -393,6 +402,46 @@ declare module 'electron' {
|
||||
argv: Array<string>,
|
||||
workingDirectory: string,
|
||||
) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'remote-require',
|
||||
callback: (
|
||||
event: Event,
|
||||
webContents: WebContents,
|
||||
moduleName: string,
|
||||
) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'remote-get-global',
|
||||
callback: (
|
||||
event: Event,
|
||||
webContents: WebContents,
|
||||
globalName: string,
|
||||
) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'remote-get-builtin',
|
||||
callback: (
|
||||
event: Event,
|
||||
webContents: WebContents,
|
||||
moduleName: string,
|
||||
) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'remote-get-current-window',
|
||||
callback: (event: Event, webContents: WebContents) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'remote-get-current-web-contents',
|
||||
callback: (event: Event, webContents: WebContents) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'remote-get-guest-web-contents',
|
||||
callback: (
|
||||
event: Event,
|
||||
webContents: WebContents,
|
||||
guestWebContents: WebContents,
|
||||
) => void,
|
||||
) => void),
|
||||
once: ((
|
||||
eventName: 'will-finish-launching',
|
||||
@@ -515,7 +564,7 @@ declare module 'electron' {
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'session-created',
|
||||
callback: (event: Event, session: Session) => void,
|
||||
callback: (session: Session) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'second-instance',
|
||||
@@ -524,6 +573,46 @@ declare module 'electron' {
|
||||
argv: Array<string>,
|
||||
workingDirectory: string,
|
||||
) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'remote-require',
|
||||
callback: (
|
||||
event: Event,
|
||||
webContents: WebContents,
|
||||
moduleName: string,
|
||||
) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'remote-get-global',
|
||||
callback: (
|
||||
event: Event,
|
||||
webContents: WebContents,
|
||||
globalName: string,
|
||||
) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'remote-get-builtin',
|
||||
callback: (
|
||||
event: Event,
|
||||
webContents: WebContents,
|
||||
moduleName: string,
|
||||
) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'remote-get-current-window',
|
||||
callback: (event: Event, webContents: WebContents) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'remote-get-current-web-contents',
|
||||
callback: (event: Event, webContents: WebContents) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'remote-get-guest-web-contents',
|
||||
callback: (
|
||||
event: Event,
|
||||
webContents: WebContents,
|
||||
guestWebContents: WebContents,
|
||||
) => void,
|
||||
) => void),
|
||||
isPackaged?: ?boolean,
|
||||
commandLine: {
|
||||
@@ -619,10 +708,7 @@ declare module 'electron' {
|
||||
contentTracing: {
|
||||
getCategories: (callback: Function) => void,
|
||||
startRecording: (
|
||||
options: {
|
||||
categoryFilter: string,
|
||||
traceOptions: string,
|
||||
},
|
||||
options: TraceCategoriesAndOptions | TraceConfig,
|
||||
callback: Function,
|
||||
) => void,
|
||||
stopRecording: (resultFilePath: string, callback: Function) => void,
|
||||
@@ -642,7 +728,7 @@ declare module 'electron' {
|
||||
},
|
||||
crashReporter: {
|
||||
start: (options: {
|
||||
companyName?: ?string,
|
||||
companyName: string,
|
||||
submitURL: string,
|
||||
productName?: ?string,
|
||||
uploadToServer?: ?boolean,
|
||||
@@ -864,6 +950,7 @@ declare module 'electron' {
|
||||
},
|
||||
process: {
|
||||
crash: () => void,
|
||||
getCreationTime: () => number | null,
|
||||
getCPUUsage: () => CPUUsage,
|
||||
getIOCounters: () => IOCounters,
|
||||
getHeapStatistics: () => {
|
||||
@@ -878,10 +965,9 @@ declare module 'electron' {
|
||||
doesZapGarbage: boolean,
|
||||
},
|
||||
getProcessMemoryInfo: () => {
|
||||
workingSetSize: number,
|
||||
peakWorkingSetSize: number,
|
||||
privateBytes: number,
|
||||
sharedBytes: number,
|
||||
residentSet: number,
|
||||
private: number,
|
||||
shared: number,
|
||||
},
|
||||
getSystemMemoryInfo: () => {
|
||||
total: number,
|
||||
@@ -889,6 +975,7 @@ declare module 'electron' {
|
||||
swapTotal: number,
|
||||
swapFree: number,
|
||||
},
|
||||
takeHeapSnapshot: (filePath: string) => boolean,
|
||||
hang: () => void,
|
||||
setFdLimit: (maxDescriptors: number) => void,
|
||||
on: (eventName: 'loaded', callback: () => void) => void,
|
||||
@@ -898,6 +985,7 @@ declare module 'electron' {
|
||||
noAsar?: ?boolean,
|
||||
noDeprecation?: ?boolean,
|
||||
resourcesPath?: ?string,
|
||||
sandboxed?: ?boolean,
|
||||
throwDeprecation?: ?boolean,
|
||||
traceDeprecation?: ?boolean,
|
||||
traceProcessWarnings?: ?boolean,
|
||||
@@ -978,8 +1066,14 @@ declare module 'electron' {
|
||||
getDisplayMatching: (rect: Rectangle) => Display,
|
||||
screenToDipPoint: (point: Point) => Point,
|
||||
dipToScreenPoint: (point: Point) => Point,
|
||||
screenToDipRect: (window: BrowserWindow, rect: Rectangle) => Rectangle,
|
||||
dipToScreenRect: (window: BrowserWindow, rect: Rectangle) => Rectangle,
|
||||
screenToDipRect: (
|
||||
window: BrowserWindow | null,
|
||||
rect: Rectangle,
|
||||
) => Rectangle,
|
||||
dipToScreenRect: (
|
||||
window: BrowserWindow | null,
|
||||
rect: Rectangle,
|
||||
) => Rectangle,
|
||||
on: ((
|
||||
eventName: 'display-added',
|
||||
callback: (event: Event, newDisplay: Display) => void,
|
||||
@@ -1028,7 +1122,8 @@ declare module 'electron' {
|
||||
openExternal: (
|
||||
url: string,
|
||||
options?: ?{
|
||||
activate: boolean,
|
||||
activate?: ?boolean,
|
||||
workingDirectory?: ?string,
|
||||
},
|
||||
callback?: ?Function,
|
||||
) => boolean,
|
||||
@@ -1047,8 +1142,11 @@ declare module 'electron' {
|
||||
postNotification: (event: string, userInfo: {}) => void,
|
||||
postLocalNotification: (event: string, userInfo: {}) => void,
|
||||
postWorkspaceNotification: (event: string, userInfo: {}) => void,
|
||||
subscribeNotification: (event: string, callback: Function) => void,
|
||||
subscribeLocalNotification: (event: string, callback: Function) => void,
|
||||
subscribeNotification: (event: string, callback: Function) => number,
|
||||
subscribeLocalNotification: (
|
||||
event: string,
|
||||
callback: Function,
|
||||
) => number,
|
||||
subscribeWorkspaceNotification: (
|
||||
event: string,
|
||||
callback: Function,
|
||||
@@ -1107,6 +1205,14 @@ declare module 'electron' {
|
||||
| 'window-text',
|
||||
) => string,
|
||||
isInvertedColorScheme: () => boolean,
|
||||
getEffectiveAppearance: () => 'dark' | 'light' | 'unknown',
|
||||
getAppLevelAppearance: () => 'dark' | 'light' | 'unknown',
|
||||
setAppLevelAppearance: (appearance: string | null) => void,
|
||||
isTrustedAccessibilityClient: (prompt: boolean) => boolean,
|
||||
getMediaAccessStatus: (
|
||||
mediaType: string,
|
||||
) => 'not-determined' | 'granted' | 'denied' | 'restricted' | 'unknown',
|
||||
askForMediaAccess: (mediaType: 'microphone' | 'camera') => Promise<any>,
|
||||
on: ((
|
||||
eventName: 'accent-color-changed',
|
||||
callback: (event: Event, newColor: string) => void,
|
||||
@@ -1118,6 +1224,10 @@ declare module 'electron' {
|
||||
((
|
||||
eventName: 'inverted-color-scheme-changed',
|
||||
callback: (event: Event, invertedColorScheme: boolean) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'appearance-changed',
|
||||
callback: (newAppearance: 'dark' | 'light') => void,
|
||||
) => void),
|
||||
once: ((
|
||||
eventName: 'accent-color-changed',
|
||||
@@ -1130,6 +1240,10 @@ declare module 'electron' {
|
||||
((
|
||||
eventName: 'inverted-color-scheme-changed',
|
||||
callback: (event: Event, invertedColorScheme: boolean) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'appearance-changed',
|
||||
callback: (newAppearance: 'dark' | 'light') => void,
|
||||
) => void),
|
||||
},
|
||||
webContents: {
|
||||
@@ -1162,8 +1276,14 @@ declare module 'electron' {
|
||||
getDisplayMatching: (rect: Rectangle) => Display,
|
||||
screenToDipPoint: (point: Point) => Point,
|
||||
dipToScreenPoint: (point: Point) => Point,
|
||||
screenToDipRect: (window: BrowserWindow, rect: Rectangle) => Rectangle,
|
||||
dipToScreenRect: (window: BrowserWindow, rect: Rectangle) => Rectangle,
|
||||
screenToDipRect: (
|
||||
window: BrowserWindow | null,
|
||||
rect: Rectangle,
|
||||
) => Rectangle,
|
||||
dipToScreenRect: (
|
||||
window: BrowserWindow | null,
|
||||
rect: Rectangle,
|
||||
) => Rectangle,
|
||||
on: ((
|
||||
eventName: 'display-added',
|
||||
callback: (event: Event, newDisplay: Display) => void,
|
||||
@@ -1203,7 +1323,8 @@ declare module 'electron' {
|
||||
openExternal: (
|
||||
url: string,
|
||||
options?: ?{
|
||||
activate: boolean,
|
||||
activate?: ?boolean,
|
||||
workingDirectory?: ?string,
|
||||
},
|
||||
callback?: ?Function,
|
||||
) => boolean,
|
||||
@@ -1273,6 +1394,7 @@ declare module 'electron' {
|
||||
) => void,
|
||||
getResourceUsage: () => {
|
||||
images: MemoryUsageDetails,
|
||||
scripts: MemoryUsageDetails,
|
||||
cssStyleSheets: MemoryUsageDetails,
|
||||
xslStyleSheets: MemoryUsageDetails,
|
||||
fonts: MemoryUsageDetails,
|
||||
@@ -1426,7 +1548,6 @@ declare module 'electron' {
|
||||
declare type ProcessMetric = {
|
||||
pid: number,
|
||||
type: string,
|
||||
memory: MemoryInfo,
|
||||
cpu: CPUUsage,
|
||||
};
|
||||
declare type Product = {
|
||||
@@ -1510,6 +1631,15 @@ declare module 'electron' {
|
||||
tooltip?: ?string,
|
||||
flags?: ?Array<string>,
|
||||
};
|
||||
declare type TraceCategoriesAndOptions = {
|
||||
categoryFilter: string,
|
||||
traceOptions: string,
|
||||
};
|
||||
declare type TraceConfig = {
|
||||
included_categories?: ?Array<string>,
|
||||
excluded_categories?: ?Array<string>,
|
||||
memory_dump_config?: ?{},
|
||||
};
|
||||
declare type Transaction = {
|
||||
transactionIdentifier: string,
|
||||
transactionDate: string,
|
||||
@@ -1566,9 +1696,11 @@ declare module 'electron' {
|
||||
baseURLForDataURL?: ?string,
|
||||
},
|
||||
) => void;
|
||||
downloadURL: (url: string) => void;
|
||||
getURL: () => string;
|
||||
getTitle: () => string;
|
||||
isLoading: () => boolean;
|
||||
isLoadingMainFrame: () => boolean;
|
||||
isWaitingForResponse: () => boolean;
|
||||
stop: () => void;
|
||||
reload: () => void;
|
||||
@@ -1598,6 +1730,7 @@ declare module 'electron' {
|
||||
inspectServiceWorker: () => void;
|
||||
setAudioMuted: (muted: boolean) => void;
|
||||
isAudioMuted: () => boolean;
|
||||
isCurrentlyAudible: () => boolean;
|
||||
undo: () => void;
|
||||
redo: () => void;
|
||||
cut: () => void;
|
||||
@@ -1633,7 +1766,7 @@ declare module 'electron' {
|
||||
printToPDF: (
|
||||
options: {
|
||||
marginsType?: ?number,
|
||||
pageSize?: ?string,
|
||||
pageSize?: ?string | Size,
|
||||
printBackground?: ?boolean,
|
||||
printSelectionOnly?: ?boolean,
|
||||
landscape?: ?boolean,
|
||||
@@ -1646,6 +1779,16 @@ declare module 'electron' {
|
||||
sendInputEvent: (event: {}) => void;
|
||||
setZoomFactor: (factor: number) => void;
|
||||
setZoomLevel: (level: number) => void;
|
||||
getZoomFactor: (callback: Function) => void;
|
||||
getZoomLevel: (callback: Function) => void;
|
||||
setVisualZoomLevelLimits: (
|
||||
minimumLevel: number,
|
||||
maximumLevel: number,
|
||||
) => void;
|
||||
setLayoutZoomLevelLimits: (
|
||||
minimumLevel: number,
|
||||
maximumLevel: number,
|
||||
) => void;
|
||||
showDefinitionForSelection: () => void;
|
||||
getWebContents: () => WebContents;
|
||||
on: ((
|
||||
@@ -1928,6 +2071,7 @@ declare module 'electron' {
|
||||
nodeIntegrationInWorker?: ?boolean,
|
||||
preload?: ?string,
|
||||
sandbox?: ?boolean,
|
||||
enableRemoteModule?: ?boolean,
|
||||
session?: ?Session,
|
||||
partition?: ?string,
|
||||
affinity?: ?string,
|
||||
@@ -1941,7 +2085,6 @@ declare module 'electron' {
|
||||
webaudio?: ?boolean,
|
||||
plugins?: ?boolean,
|
||||
experimentalFeatures?: ?boolean,
|
||||
experimentalCanvasFeatures?: ?boolean,
|
||||
scrollBounce?: ?boolean,
|
||||
enableBlinkFeatures?: ?string,
|
||||
disableBlinkFeatures?: ?string,
|
||||
@@ -2001,13 +2144,16 @@ declare module 'electron' {
|
||||
isFullScreen: () => boolean;
|
||||
setSimpleFullScreen: (flag: boolean) => void;
|
||||
isSimpleFullScreen: () => boolean;
|
||||
isNormal: () => boolean;
|
||||
setAspectRatio: (aspectRatio: number, extraSize: Size) => void;
|
||||
setBackgroundColor: (backgroundColor: string) => void;
|
||||
previewFile: (path: string, displayName?: ?string) => void;
|
||||
closeFilePreview: () => void;
|
||||
setBounds: (bounds: Rectangle, animate?: ?boolean) => void;
|
||||
getBounds: () => Rectangle;
|
||||
setContentBounds: (bounds: Rectangle, animate?: ?boolean) => void;
|
||||
getContentBounds: () => Rectangle;
|
||||
getNormalBounds: () => Rectangle;
|
||||
setEnabled: (enable: boolean) => void;
|
||||
setSize: (width: number, height: number, animate?: ?boolean) => void;
|
||||
getSize: () => Array<number>;
|
||||
@@ -2080,7 +2226,14 @@ declare module 'electron' {
|
||||
baseURLForDataURL?: ?string,
|
||||
},
|
||||
) => void;
|
||||
loadFile: (filePath: string) => void;
|
||||
loadFile: (
|
||||
filePath: string,
|
||||
options?: ?{
|
||||
query?: ?{},
|
||||
search?: ?string,
|
||||
hash?: ?string,
|
||||
},
|
||||
) => void;
|
||||
reload: () => void;
|
||||
setMenu: (menu: Menu | null) => void;
|
||||
setProgressBar: (
|
||||
@@ -2094,6 +2247,7 @@ declare module 'electron' {
|
||||
hasShadow: () => boolean;
|
||||
setOpacity: (opacity: number) => void;
|
||||
getOpacity: () => number;
|
||||
setShape: (rects: Array<Rectangle>) => void;
|
||||
setThumbarButtons: (buttons: Array<ThumbarButton>) => boolean;
|
||||
setThumbnailClip: (region: Rectangle) => void;
|
||||
setThumbnailToolTip: (toolTip: string) => void;
|
||||
@@ -2106,11 +2260,17 @@ declare module 'electron' {
|
||||
}) => void;
|
||||
showDefinitionForSelection: () => void;
|
||||
setIcon: (icon: NativeImage) => void;
|
||||
setWindowButtonVisibility: (visible: boolean) => void;
|
||||
setAutoHideMenuBar: (hide: boolean) => void;
|
||||
isMenuBarAutoHide: () => boolean;
|
||||
setMenuBarVisibility: (visible: boolean) => void;
|
||||
isMenuBarVisible: () => boolean;
|
||||
setVisibleOnAllWorkspaces: (visible: boolean) => void;
|
||||
setVisibleOnAllWorkspaces: (
|
||||
visible: boolean,
|
||||
options?: ?{
|
||||
visibleOnFullScreen?: ?boolean,
|
||||
},
|
||||
) => void;
|
||||
isVisibleOnAllWorkspaces: () => boolean;
|
||||
setIgnoreMouseEvents: (
|
||||
ignore: boolean,
|
||||
@@ -2166,13 +2326,25 @@ declare module 'electron' {
|
||||
((eventName: 'unmaximize', callback: () => void) => void) &
|
||||
((eventName: 'minimize', callback: () => void) => void) &
|
||||
((eventName: 'restore', callback: () => void) => void) &
|
||||
((
|
||||
eventName: 'will-resize',
|
||||
callback: (event: Event, newBounds: Rectangle) => void,
|
||||
) => void) &
|
||||
((eventName: 'resize', callback: () => void) => void) &
|
||||
((
|
||||
eventName: 'will-move',
|
||||
callback: (event: Event, newBounds: Rectangle) => void,
|
||||
) => void) &
|
||||
((eventName: 'move', callback: () => void) => void) &
|
||||
((eventName: 'moved', callback: () => void) => void) &
|
||||
((eventName: 'enter-full-screen', callback: () => void) => void) &
|
||||
((eventName: 'leave-full-screen', callback: () => void) => void) &
|
||||
((eventName: 'enter-html-full-screen', callback: () => void) => void) &
|
||||
((eventName: 'leave-html-full-screen', callback: () => void) => void) &
|
||||
((
|
||||
eventName: 'always-on-top-changed',
|
||||
callback: (event: Event, isAlwaysOnTop: boolean) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'app-command',
|
||||
callback: (event: Event, command: string) => void,
|
||||
@@ -2205,13 +2377,25 @@ declare module 'electron' {
|
||||
((eventName: 'unmaximize', callback: () => void) => void) &
|
||||
((eventName: 'minimize', callback: () => void) => void) &
|
||||
((eventName: 'restore', callback: () => void) => void) &
|
||||
((
|
||||
eventName: 'will-resize',
|
||||
callback: (event: Event, newBounds: Rectangle) => void,
|
||||
) => void) &
|
||||
((eventName: 'resize', callback: () => void) => void) &
|
||||
((
|
||||
eventName: 'will-move',
|
||||
callback: (event: Event, newBounds: Rectangle) => void,
|
||||
) => void) &
|
||||
((eventName: 'move', callback: () => void) => void) &
|
||||
((eventName: 'moved', callback: () => void) => void) &
|
||||
((eventName: 'enter-full-screen', callback: () => void) => void) &
|
||||
((eventName: 'leave-full-screen', callback: () => void) => void) &
|
||||
((eventName: 'enter-html-full-screen', callback: () => void) => void) &
|
||||
((eventName: 'leave-html-full-screen', callback: () => void) => void) &
|
||||
((
|
||||
eventName: 'always-on-top-changed',
|
||||
callback: (event: Event, isAlwaysOnTop: boolean) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'app-command',
|
||||
callback: (event: Event, command: string) => void,
|
||||
@@ -2259,6 +2443,12 @@ declare module 'electron' {
|
||||
((callback?: ?Function) => void));
|
||||
abort: () => void;
|
||||
followRedirect: () => void;
|
||||
getUploadProgress: () => {
|
||||
active: boolean,
|
||||
started: boolean,
|
||||
current: number,
|
||||
total: number,
|
||||
};
|
||||
chunkedEncoding: boolean;
|
||||
on: ((
|
||||
eventName: 'response',
|
||||
@@ -2470,13 +2660,15 @@ declare module 'electron' {
|
||||
static buildFromTemplate: (
|
||||
template: Array<MenuItemConstructorOptions>,
|
||||
) => Menu;
|
||||
popup: (options: {
|
||||
popup: (
|
||||
options?: ?{
|
||||
window?: ?BrowserWindow,
|
||||
x?: ?number,
|
||||
y?: ?number,
|
||||
positioningItem?: ?number,
|
||||
callback?: ?Function,
|
||||
}) => void;
|
||||
},
|
||||
) => void;
|
||||
closePopup: (browserWindow?: ?BrowserWindow) => void;
|
||||
append: (menuItem: MenuItem) => void;
|
||||
getMenuItemById: (id: string) => MenuItem;
|
||||
@@ -2511,9 +2703,13 @@ declare module 'electron' {
|
||||
enabled?: ?boolean,
|
||||
visible?: ?boolean,
|
||||
checked?: ?boolean,
|
||||
registerAccelerator?: ?boolean,
|
||||
submenu?: ?Array<MenuItemConstructorOptions> | Menu,
|
||||
id?: ?string,
|
||||
position?: ?string,
|
||||
before?: ?Array<string>,
|
||||
after?: ?Array<string>,
|
||||
beforeGroupContaining?: ?Array<string>,
|
||||
afterGroupContaining?: ?Array<string>,
|
||||
}): MenuItem;
|
||||
enabled: boolean;
|
||||
visible: boolean;
|
||||
@@ -2634,6 +2830,7 @@ declare module 'electron' {
|
||||
disableNetworkEmulation: () => void;
|
||||
setCertificateVerifyProc: (proc: Function) => void;
|
||||
setPermissionRequestHandler: (handler: Function | null) => void;
|
||||
setPermissionCheckHandler: (handler: Function | null) => void;
|
||||
clearHostResolverCache: (callback?: ?Function) => void;
|
||||
allowNTLMCredentialsForDomains: (domains: string) => void;
|
||||
setUserAgent: (userAgent: string, acceptLanguages?: ?string) => void;
|
||||
@@ -2658,6 +2855,7 @@ declare module 'electron' {
|
||||
cookies: Cookies;
|
||||
webRequest: WebRequest;
|
||||
protocol: Protocol;
|
||||
netLog: NetLog;
|
||||
on: (
|
||||
eventName: 'will-download',
|
||||
callback: (
|
||||
@@ -2728,7 +2926,7 @@ declare module 'electron' {
|
||||
}) => void;
|
||||
popUpContextMenu: ((menu?: ?Menu, position?: ?Point) => void) &
|
||||
((position?: ?Point) => void);
|
||||
setContextMenu: (menu: Menu) => void;
|
||||
setContextMenu: (menu: Menu | null) => void;
|
||||
getBounds: () => Rectangle;
|
||||
isDestroyed: () => boolean;
|
||||
on: ((
|
||||
@@ -2824,7 +3022,14 @@ declare module 'electron' {
|
||||
baseURLForDataURL?: ?string,
|
||||
},
|
||||
) => void;
|
||||
loadFile: (filePath: string) => void;
|
||||
loadFile: (
|
||||
filePath: string,
|
||||
options?: ?{
|
||||
query?: ?{},
|
||||
search?: ?string,
|
||||
hash?: ?string,
|
||||
},
|
||||
) => void;
|
||||
downloadURL: (url: string) => void;
|
||||
getURL: () => string;
|
||||
getTitle: () => string;
|
||||
@@ -2857,6 +3062,7 @@ declare module 'electron' {
|
||||
setIgnoreMenuShortcuts: (ignore: boolean) => void;
|
||||
setAudioMuted: (muted: boolean) => void;
|
||||
isAudioMuted: () => boolean;
|
||||
isCurrentlyAudible: () => boolean;
|
||||
setZoomFactor: (factor: number) => void;
|
||||
getZoomFactor: (callback: Function) => void;
|
||||
setZoomLevel: (level: number) => void;
|
||||
@@ -2912,7 +3118,7 @@ declare module 'electron' {
|
||||
printToPDF: (
|
||||
options: {
|
||||
marginsType?: ?number,
|
||||
pageSize?: ?string,
|
||||
pageSize?: ?string | Size,
|
||||
printBackground?: ?boolean,
|
||||
printSelectionOnly?: ?boolean,
|
||||
landscape?: ?boolean,
|
||||
@@ -2973,12 +3179,6 @@ declare module 'electron' {
|
||||
callback: Function,
|
||||
) => boolean;
|
||||
showDefinitionForSelection: () => void;
|
||||
setSize: (options: {
|
||||
enableAutoSize?: ?boolean,
|
||||
normal?: ?Size,
|
||||
min?: ?Size,
|
||||
max?: ?Size,
|
||||
}) => void;
|
||||
isOffscreen: () => boolean;
|
||||
startPainting: () => void;
|
||||
stopPainting: () => void;
|
||||
@@ -2996,6 +3196,15 @@ declare module 'electron' {
|
||||
) => void;
|
||||
getOSProcessId: () => number;
|
||||
getProcessId: () => number;
|
||||
takeHeapSnapshot: (filePath: string) => Promise<any>;
|
||||
setBackgroundThrottling: (allowed: boolean) => void;
|
||||
getType: () =>
|
||||
| 'backgroundPage'
|
||||
| 'window'
|
||||
| 'browserView'
|
||||
| 'remote'
|
||||
| 'webview'
|
||||
| 'offscreen';
|
||||
id: number;
|
||||
session: Session;
|
||||
hostWebContents: WebContents;
|
||||
@@ -3055,6 +3264,29 @@ declare module 'electron' {
|
||||
((
|
||||
eventName: 'did-start-navigation',
|
||||
callback: (
|
||||
event: Event,
|
||||
url: string,
|
||||
isInPlace: boolean,
|
||||
isMainFrame: boolean,
|
||||
frameProcessId: number,
|
||||
frameRoutingId: number,
|
||||
) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'will-redirect',
|
||||
callback: (
|
||||
event: Event,
|
||||
url: string,
|
||||
isInPlace: boolean,
|
||||
isMainFrame: boolean,
|
||||
frameProcessId: number,
|
||||
frameRoutingId: number,
|
||||
) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'did-redirect-navigation',
|
||||
callback: (
|
||||
event: Event,
|
||||
url: string,
|
||||
isInPlace: boolean,
|
||||
isMainFrame: boolean,
|
||||
@@ -3288,6 +3520,30 @@ declare module 'electron' {
|
||||
line: number,
|
||||
sourceId: string,
|
||||
) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'remote-require',
|
||||
callback: (event: Event, moduleName: string) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'remote-get-global',
|
||||
callback: (event: Event, globalName: string) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'remote-get-builtin',
|
||||
callback: (event: Event, moduleName: string) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'remote-get-current-window',
|
||||
callback: (event: Event) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'remote-get-current-web-contents',
|
||||
callback: (event: Event) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'remote-get-guest-web-contents',
|
||||
callback: (event: Event, guestWebContents: WebContents) => void,
|
||||
) => void);
|
||||
once: ((eventName: 'did-finish-load', callback: () => void) => void) &
|
||||
((
|
||||
@@ -3343,6 +3599,29 @@ declare module 'electron' {
|
||||
((
|
||||
eventName: 'did-start-navigation',
|
||||
callback: (
|
||||
event: Event,
|
||||
url: string,
|
||||
isInPlace: boolean,
|
||||
isMainFrame: boolean,
|
||||
frameProcessId: number,
|
||||
frameRoutingId: number,
|
||||
) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'will-redirect',
|
||||
callback: (
|
||||
event: Event,
|
||||
url: string,
|
||||
isInPlace: boolean,
|
||||
isMainFrame: boolean,
|
||||
frameProcessId: number,
|
||||
frameRoutingId: number,
|
||||
) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'did-redirect-navigation',
|
||||
callback: (
|
||||
event: Event,
|
||||
url: string,
|
||||
isInPlace: boolean,
|
||||
isMainFrame: boolean,
|
||||
@@ -3576,6 +3855,30 @@ declare module 'electron' {
|
||||
line: number,
|
||||
sourceId: string,
|
||||
) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'remote-require',
|
||||
callback: (event: Event, moduleName: string) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'remote-get-global',
|
||||
callback: (event: Event, globalName: string) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'remote-get-builtin',
|
||||
callback: (event: Event, moduleName: string) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'remote-get-current-window',
|
||||
callback: (event: Event) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'remote-get-current-web-contents',
|
||||
callback: (event: Event) => void,
|
||||
) => void) &
|
||||
((
|
||||
eventName: 'remote-get-guest-web-contents',
|
||||
callback: (event: Event, guestWebContents: WebContents) => void,
|
||||
) => void);
|
||||
}
|
||||
declare class WebRequest {
|
||||
@@ -3741,5 +4044,6 @@ declare module 'electron' {
|
||||
declare type ReadableStream = any;
|
||||
declare type MenuItemConstructorOptions = any;
|
||||
declare type Protocol = any;
|
||||
declare type NetLog = any;
|
||||
declare type TouchBarItem = any;
|
||||
}
|
||||
10457
package-lock.json
generated
10457
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
11
package.json
11
package.json
@@ -36,7 +36,7 @@
|
||||
]
|
||||
},
|
||||
"resolutions": {
|
||||
"@jest-runner/electron/electron": "3.0.0"
|
||||
"@jest-runner/electron/electron": "4.0.5"
|
||||
},
|
||||
"jest": {
|
||||
"transform": {
|
||||
@@ -47,10 +47,10 @@
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest-runner/electron": "^0.1.0",
|
||||
"@jest-runner/electron": "^1.0.3",
|
||||
"babel-eslint": "^10.0.1",
|
||||
"electron": "3.0.0",
|
||||
"electron-builder": "^19.49.0",
|
||||
"electron": "^4.0.5",
|
||||
"electron-builder": "^20.38.5",
|
||||
"eslint": "^5.12.1",
|
||||
"eslint-config-fbjs": "^2.0.1",
|
||||
"eslint-plugin-babel": "^5.3.0",
|
||||
@@ -62,7 +62,7 @@
|
||||
"eslint-plugin-relay": "^1.0.0",
|
||||
"flow-bin": "^0.91.0",
|
||||
"glob": "^7.1.2",
|
||||
"jest": "^23.6.0",
|
||||
"jest": "^24.1.0",
|
||||
"jest-fetch-mock": "^2.1.0",
|
||||
"prettier": "1.13.6",
|
||||
"redux-mock-store": "^1.5.3"
|
||||
@@ -119,6 +119,7 @@
|
||||
"yazl": "^2.5.1"
|
||||
},
|
||||
"scripts": {
|
||||
"preinstall": "yarn config set ignore-engines",
|
||||
"postinstall": "node scripts/yarn-install.js",
|
||||
"rm-dist": "rm -rf dist",
|
||||
"rm-modules": "rm -rf node_modules static/node_modules",
|
||||
|
||||
@@ -78,7 +78,6 @@ function buildDist(buildFolder) {
|
||||
|
||||
return builder
|
||||
.build({
|
||||
appDir: buildFolder,
|
||||
publish: 'never',
|
||||
config: {
|
||||
appId: `com.facebook.sonar`,
|
||||
|
||||
@@ -21,7 +21,7 @@ cd "$ROOT_DIR/xplat/sonar"
|
||||
# If `node_modules` exists, we can't tell if it was created with
|
||||
# `--ignore-scripts` or not, so we play it safe, and avoid touching it.
|
||||
if [[ ! -d "node_modules" ]]; then
|
||||
"$ROOT_DIR/xplat/third-party/yarn/install-node-modules.sh" --ignore-scripts
|
||||
"$ROOT_DIR/xplat/third-party/yarn/install-node-modules.sh" --ignore-scripts --ignore-engines
|
||||
fi
|
||||
|
||||
exec \
|
||||
|
||||
@@ -21,7 +21,7 @@ cd "$ROOT_DIR/xplat/sonar"
|
||||
# If `node_modules` exists, we can't tell if it was created with
|
||||
# `--ignore-scripts` or not, so we play it safe, and avoid touching it.
|
||||
if [[ ! -d "node_modules" ]]; then
|
||||
"$ROOT_DIR/xplat/third-party/yarn/install-node-modules.sh" --ignore-scripts
|
||||
"$ROOT_DIR/xplat/third-party/yarn/install-node-modules.sh" --ignore-scripts --ignore-engines
|
||||
fi
|
||||
|
||||
# Prefer the internal version of Flow, which should be in the PATH - but
|
||||
|
||||
@@ -61,7 +61,7 @@ exports[`Empty app state matches snapshot 1`] = `
|
||||
<span
|
||||
className="css-lli23c"
|
||||
>
|
||||
3.0.0
|
||||
4.0.5
|
||||
-dev
|
||||
</span>
|
||||
<div
|
||||
|
||||
@@ -100,22 +100,23 @@ compilePlugins(
|
||||
});
|
||||
|
||||
// check if we already have an instance of this app open
|
||||
const isSecondInstance = app.makeSingleInstance(
|
||||
(commandLine, workingDirectory) => {
|
||||
// someone tried to run a second instance, we should focus our window
|
||||
const gotTheLock = app.requestSingleInstanceLock();
|
||||
|
||||
if (!gotTheLock) {
|
||||
app.quit();
|
||||
} else {
|
||||
app.on('second-instance', (event, commandLine, workingDirectory) => {
|
||||
// Someone tried to run a second instance, we should focus our window.
|
||||
if (win) {
|
||||
if (win.isMinimized()) {
|
||||
win.restore();
|
||||
}
|
||||
|
||||
win.focus();
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
// if this is a second instance then quit the app to prevent collisions
|
||||
if (isSecondInstance) {
|
||||
app.quit();
|
||||
// Create myWindow, load the rest of the app, etc...
|
||||
app.on('ready', () => {});
|
||||
}
|
||||
|
||||
// quit app once all windows are closed
|
||||
|
||||
Reference in New Issue
Block a user