From 09a93cd9e6647b015b2f75a2f497d3fbfb2a6295 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Fri, 1 Feb 2019 06:42:40 -0800 Subject: [PATCH] Upgrading flow and fixing lint errors Summary: Upgrading to flow 0.91, fixing a bunch of `$FloxFixMe`s that were introduced by upgrading to 0.86. Also fixing some linting issues. Reviewed By: priteshrnandgaonkar Differential Revision: D13900794 fbshipit-source-id: 5d0a1b62371f3b5d34b909bae0876583acb6f977 --- .eslintignore | 1 + .flowconfig | 2 +- flow-typed/npm/react-redux_v5.x.x.js | 360 ++++++++++++------ .../npm/{redux_v3.x.x.js => redux_v4.x.x.js} | 6 +- package.json | 4 +- src/App.js | 15 +- src/NotificationsHub.js | 31 +- src/PluginContainer.js | 22 +- src/chrome/AutoUpdateVersion.js | 1 - src/chrome/DetailSidebar.js | 20 +- src/chrome/DevicesButton.js | 30 +- src/chrome/MainSidebar.js | 13 +- src/chrome/PluginDebugger.js | 8 +- src/chrome/ScreenCaptureButtons.js | 12 +- src/chrome/Sheet.js | 13 +- src/chrome/TitleBar.js | 12 +- src/createTablePlugin.js | 1 - src/devices/AndroidDevice.js | 3 +- src/fb-stubs/Logger.js | 1 + src/plugins/logs/LogWatcher.js | 8 +- src/plugins/shared_preferences/index.js | 2 +- src/reducers/index.js | 22 +- .../components/elements-inspector/sidebar.js | 8 +- src/ui/components/table/ManagedTable.js | 4 +- src/utils/CertificateProvider.js | 2 - src/utils/metrics.js | 12 +- static/package.json | 4 +- static/transforms/index.js | 2 +- static/yarn.lock | 20 + yarn.lock | 176 +++++---- 30 files changed, 477 insertions(+), 338 deletions(-) rename flow-typed/npm/{redux_v3.x.x.js => redux_v4.x.x.js} (91%) diff --git a/.eslintignore b/.eslintignore index 71caa58fe..f2f968172 100644 --- a/.eslintignore +++ b/.eslintignore @@ -6,3 +6,4 @@ node_modules flow-typed lib !.eslintrc.js +dist diff --git a/.flowconfig b/.flowconfig index 2aad84c5e..e18ea6b43 100644 --- a/.flowconfig +++ b/.flowconfig @@ -33,4 +33,4 @@ untyped-import untyped-type-import [version] -^0.86.0 +^0.91.0 diff --git a/flow-typed/npm/react-redux_v5.x.x.js b/flow-typed/npm/react-redux_v5.x.x.js index ac2894267..dfe47254f 100644 --- a/flow-typed/npm/react-redux_v5.x.x.js +++ b/flow-typed/npm/react-redux_v5.x.x.js @@ -1,157 +1,273 @@ -// flow-typed signature: 16b40ff613d36712444ef20fb107de7c -// flow-typed version: be6cfc6753/react-redux_v5.x.x/flow_>=v0.62.0 +/** +The order of type arguments for connect() is as follows: -import type { Dispatch, Store } from "redux"; +connect(…) -declare module "react-redux" { - import type { ComponentType, ElementConfig } from 'react'; +In Flow v0.89 only the first two are mandatory to specify. Other 4 can be repaced with the new awesome type placeholder: - declare export class Provider extends React$Component<{ - store: Store, - children?: any - }> {} +connect(…) - declare export function createProvider( - storeKey?: string, - subKey?: string - ): Provider<*, *>; - - /* +But beware, in case of weird type errors somewhere in random places +just type everything and get to a green field and only then try to +remove the definitions you see bogus. +Decrypting the abbreviations: + WC = Component being wrapped S = State - A = Action + D = Dispatch OP = OwnProps SP = StateProps DP = DispatchProps MP = Merge props - MDP = Map dispatch to props object RSP = Returned state props RDP = Returned dispatch props RMP = Returned merge props CP = Props for returned component Com = React Component - */ + ST = Static properties of Com + EFO = Extra factory options (used only in connectAdvanced) +*/ - declare type MapStateToProps = (state: S, props: SP) => RSP; +declare module "react-redux" { + // ------------------------------------------------------------ + // Typings for connect() + // ------------------------------------------------------------ - declare type MapDispatchToProps = (dispatch: Dispatch, ownProps: OP) => RDP; - - declare type MergeProps = ( - stateProps: SP, - dispatchProps: DP, - ownProps: MP - ) => RMP; - - declare type ConnectOptions = {| + declare export type Options = {| pure?: boolean, withRef?: boolean, areStatesEqual?: (next: S, prev: S) => boolean, areOwnPropsEqual?: (next: OP, prev: OP) => boolean, - areStatePropsEqual?: (next: RSP, prev: RSP) => boolean, - areMergedPropsEqual?: (next: RMP, prev: RMP) => boolean, - storeKey?: string + areStatePropsEqual?: (next: SP, prev: SP) => boolean, + areMergedPropsEqual?: (next: MP, prev: MP) => boolean, + storeKey?: string, |}; - declare type OmitDispatch = $Diff}>; + declare type MapStateToProps<-S, -OP, +SP> = + | ((state: S, ownProps: OP) => SP) + // If you want to use the factory function but get a strange error + // like "function is not an object" then just type the factory function + // like this: + // const factory: (State, OwnProps) => (State, OwnProps) => StateProps + // and provide the StateProps type to the SP type parameter. + | ((state: S, ownProps: OP) => (state: S, ownProps: OP) => SP); - declare export function connect< - Com: ComponentType<*>, + declare type Bind = ((...A) => R) => (...A) => $Call; + + declare type MapDispatchToPropsFn = + | ((dispatch: D, ownProps: OP) => DP) + // If you want to use the factory function but get a strange error + // like "function is not an object" then just type the factory function + // like this: + // const factory: (Dispatch, OwnProps) => (Dispatch, OwnProps) => DispatchProps + // and provide the DispatchProps type to the DP type parameter. + | ((dispatch: D, ownProps: OP) => (dispatch: D, ownProps: OP) => DP); + + declare class ConnectedComponent extends React$Component { + static +WrappedComponent: WC; + getWrappedInstance(): React$ElementRef; + } + // The connection of the Wrapped Component and the Connected Component + // happens here in `MP: P`. It means that type wise MP belongs to P, + // so to say MP >= P. + declare type Connector = >( + WC, + ) => Class> & WC; + + // No `mergeProps` argument + + // Got error like inexact OwnProps is incompatible with exact object type? + // Just make the OP parameter for `connect()` an exact object. + declare type MergeOP = {| ...$Exact, dispatch: D |}; + declare type MergeOPSP = {| ...$Exact, ...SP |}; + declare type MergeOPDP = {| ...$Exact, ...DP |}; + declare type MergeOPSPDP = {| ...$Exact, ...SP, ...DP |}; + + declare export function connect<-P, -OP, -SP, -DP, -S, -D>( + mapStateToProps?: null | void, + mapDispatchToProps?: null | void, + mergeProps?: null | void, + options?: ?Options>, + ): Connector>; + + declare export function connect<-P, -OP, -SP, -DP, -S, -D>( + // If you get error here try adding return type to your mapStateToProps function + mapStateToProps: MapStateToProps, + mapDispatchToProps?: null | void, + mergeProps?: null | void, + options?: ?Options>, + ): Connector>; + + // In this case DP is an object of functions which has been bound to dispatch + // by the given mapDispatchToProps function. + declare export function connect<-P, -OP, -SP, -DP, S, D>( + mapStateToProps: null | void, + mapDispatchToProps: MapDispatchToPropsFn, + mergeProps?: null | void, + options?: ?Options>, + ): Connector>; + + // In this case DP is an object of action creators not yet bound to dispatch, + // this difference is not important in the vanila redux, + // but in case of usage with redux-thunk, the return type may differ. + declare export function connect<-P, -OP, -SP, -DP, S, D>( + mapStateToProps: null | void, + mapDispatchToProps: DP, + mergeProps?: null | void, + options?: ?Options>, + ): Connector>>>; + + declare export function connect<-P, -OP, -SP, -DP, S, D>( + // If you get error here try adding return type to your mapStateToProps function + mapStateToProps: MapStateToProps, + mapDispatchToProps: MapDispatchToPropsFn, + mergeProps?: null | void, + options?: ?Options, + ): Connector; + + declare export function connect<-P, -OP, -SP, -DP, S, D>( + // If you get error here try adding return type to your mapStateToProps function + mapStateToProps: MapStateToProps, + mapDispatchToProps: DP, + mergeProps?: null | void, + options?: ?Options>, + ): Connector>>>; + + // With `mergeProps` argument + + declare type MergeProps<+P, -OP, -SP, -DP> = ( + stateProps: SP, + dispatchProps: DP, + ownProps: OP, + ) => P; + + declare export function connect<-P, -OP, -SP: {||}, -DP: {||}, S, D>( + mapStateToProps: null | void, + mapDispatchToProps: null | void, + // If you get error here try adding return type to you mapStateToProps function + mergeProps: MergeProps, + options?: ?Options, + ): Connector; + + declare export function connect<-P, -OP, -SP, -DP: {||}, S, D>( + mapStateToProps: MapStateToProps, + mapDispatchToProps: null | void, + // If you get error here try adding return type to you mapStateToProps function + mergeProps: MergeProps, + options?: ?Options, + ): Connector; + + // In this case DP is an object of functions which has been bound to dispatch + // by the given mapDispatchToProps function. + declare export function connect<-P, -OP, -SP: {||}, -DP, S, D>( + mapStateToProps: null | void, + mapDispatchToProps: MapDispatchToPropsFn, + mergeProps: MergeProps, + options?: ?Options, + ): Connector; + + // In this case DP is an object of action creators not yet bound to dispatch, + // this difference is not important in the vanila redux, + // but in case of usage with redux-thunk, the return type may differ. + declare export function connect<-P, -OP, -SP: {||}, -DP, S, D>( + mapStateToProps: null | void, + mapDispatchToProps: DP, + mergeProps: MergeProps>>, + options?: ?Options, + ): Connector; + + // In this case DP is an object of functions which has been bound to dispatch + // by the given mapDispatchToProps function. + declare export function connect<-P, -OP, -SP, -DP, S, D>( + mapStateToProps: MapStateToProps, + mapDispatchToProps: MapDispatchToPropsFn, + mergeProps: MergeProps, + options?: ?Options, + ): Connector; + + // In this case DP is an object of action creators not yet bound to dispatch, + // this difference is not important in the vanila redux, + // but in case of usage with redux-thunk, the return type may differ. + declare export function connect<-P, -OP, -SP, -DP, S, D>( + mapStateToProps: MapStateToProps, + mapDispatchToProps: DP, + mergeProps: MergeProps>>, + options?: ?Options, + ): Connector; + + // ------------------------------------------------------------ + // Typings for Provider + // ------------------------------------------------------------ + + declare export class Provider extends React$Component<{ + store: Store, + children?: React$Node, + }> {} + + declare export function createProvider( + storeKey?: string, + subKey?: string, + ): Class>; + + // ------------------------------------------------------------ + // Typings for connectAdvanced() + // ------------------------------------------------------------ + + declare type ConnectAdvancedOptions = { + getDisplayName?: (name: string) => string, + methodName?: string, + renderCountProp?: string, + shouldHandleStateChanges?: boolean, + storeKey?: string, + withRef?: boolean, + }; + + declare type SelectorFactoryOptions = { + getDisplayName: (name: string) => string, + methodName: string, + renderCountProp: ?string, + shouldHandleStateChanges: boolean, + storeKey: string, + withRef: boolean, + displayName: string, + wrappedComponentName: string, + WrappedComponent: Com, + }; + + declare type MapStateToPropsEx = ( + state: S, + props: SP, + ) => RSP; + + declare type SelectorFactory< + Com: React$ComponentType<*>, + Dispatch, S: Object, - DP: Object, - RSP: Object, - CP: $Diff>, RSP> - >( - mapStateToProps: MapStateToProps, - mapDispatchToProps?: null - ): (component: Com) => ComponentType; - - declare export function connect>( - mapStateToProps?: null, - mapDispatchToProps?: null - ): (component: Com) => ComponentType>>; - - declare export function connect< - Com: ComponentType<*>, - A, - S: Object, - DP: Object, - SP: Object, - RSP: Object, - RDP: Object, - CP: $Diff<$Diff, RSP>, RDP> - >( - mapStateToProps: MapStateToProps, - mapDispatchToProps: MapDispatchToProps - ): (component: Com) => ComponentType; - - declare export function connect< - Com: ComponentType<*>, - A, OP: Object, - DP: Object, - PR: Object, - CP: $Diff, DP> - >( - mapStateToProps?: null, - mapDispatchToProps: MapDispatchToProps - ): (Com) => ComponentType; + EFO: Object, + CP: Object, + > = ( + dispatch: Dispatch, + factoryOptions: SelectorFactoryOptions & EFO, + ) => MapStateToPropsEx; - declare export function connect< - Com: ComponentType<*>, - MDP: Object - >( - mapStateToProps?: null, - mapDispatchToProps: MDP - ): (component: Com) => ComponentType<$Diff, MDP>>; - - declare export function connect< - Com: ComponentType<*>, + declare export function connectAdvanced< + Com: React$ComponentType<*>, + D, S: Object, - SP: Object, - RSP: Object, - MDP: Object, - CP: $Diff, RSP> - >( - mapStateToProps: MapStateToProps, - mapDispatchToPRops: MDP - ): (component: Com) => ComponentType<$Diff & SP>; - - declare export function connect< - Com: ComponentType<*>, - A, - S: Object, - DP: Object, - SP: Object, - RSP: Object, - RDP: Object, - MP: Object, - RMP: Object, - CP: $Diff, RMP> - >( - mapStateToProps: MapStateToProps, - mapDispatchToProps: ?MapDispatchToProps, - mergeProps: MergeProps - ): (component: Com) => ComponentType; - - declare export function connect, - A, - S: Object, - DP: Object, - SP: Object, - RSP: Object, - RDP: Object, - MP: Object, - RMP: Object - >( - mapStateToProps: ?MapStateToProps, - mapDispatchToProps: ?MapDispatchToProps, - mergeProps: ?MergeProps, - options: ConnectOptions - ): (component: Com) => ComponentType<$Diff, RMP> & SP & DP & MP>; + OP: Object, + CP: Object, + EFO: Object, + ST: { [_: $Keys]: any }, + >( + selectorFactory: SelectorFactory, + connectAdvancedOptions: ?(ConnectAdvancedOptions & EFO), + ): (component: Com) => React$ComponentType & $Shape; declare export default { Provider: typeof Provider, createProvider: typeof createProvider, connect: typeof connect, + connectAdvanced: typeof connectAdvanced, }; } diff --git a/flow-typed/npm/redux_v3.x.x.js b/flow-typed/npm/redux_v4.x.x.js similarity index 91% rename from flow-typed/npm/redux_v3.x.x.js rename to flow-typed/npm/redux_v4.x.x.js index 9c2edf841..d7a909d56 100644 --- a/flow-typed/npm/redux_v3.x.x.js +++ b/flow-typed/npm/redux_v4.x.x.js @@ -1,5 +1,5 @@ -// flow-typed signature: cca4916b0213065533df8335c3285a4a -// flow-typed version: cab04034e7/redux_v3.x.x/flow_>=v0.55.x +// flow-typed signature: df80bdd535bfed9cf3223e077f3b4543 +// flow-typed version: c4c8963c9c/redux_v4.x.x/flow_>=v0.55.x declare module 'redux' { @@ -12,7 +12,7 @@ declare module 'redux' { */ declare export type DispatchAPI = (action: A) => A; - declare export type Dispatch = DispatchAPI; + declare export type Dispatch }> = DispatchAPI; declare export type MiddlewareAPI> = { dispatch: D; diff --git a/package.json b/package.json index 0bce99c32..01309810a 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ }, "devDependencies": { "@jest-runner/electron": "^0.1.0", - "babel-eslint": "8.2.1", + "babel-eslint": "^10.0.1", "electron": "3.0.0", "electron-builder": "^19.49.0", "eslint": "^5.12.1", @@ -47,7 +47,7 @@ "eslint-plugin-prettier": "^3.0.1", "eslint-plugin-react": "^7.5.1", "eslint-plugin-relay": "^1.0.0", - "flow-bin": "^0.86.0", + "flow-bin": "^0.91.0", "glob": "^7.1.2", "jest": "^23.6.0", "prettier": "1.13.6", diff --git a/src/App.js b/src/App.js index 387b3faf8..376c821c9 100644 --- a/src/App.js +++ b/src/App.js @@ -29,14 +29,18 @@ import type {ActiveSheet} from './reducers/application.js'; const version = remote.app.getVersion(); -type Props = { +type OwnProps = {| logger: Logger, bugReporter: BugReporter, +|}; + +type Props = {| + ...OwnProps, leftSidebarVisible: boolean, selectedDevice: ?BaseDevice, error: ?string, activeSheet: ActiveSheet, -}; +|}; export class App extends React.Component { componentDidMount() { @@ -88,11 +92,8 @@ export class App extends React.Component { ); } } -/* $FlowFixMe(>=0.86.0) This - * comment suppresses an error found when Flow v0.86 was - * deployed. To see the error, delete this comment and - * run Flow. */ -export default connect( + +export default connect( ({ application: {leftSidebarVisible, activeSheet}, connections: {selectedDevice, error}, diff --git a/src/NotificationsHub.js b/src/NotificationsHub.js index 40acf7855..c09ff8994 100644 --- a/src/NotificationsHub.js +++ b/src/NotificationsHub.js @@ -98,24 +98,28 @@ export default class Notifications extends FlipperDevicePlugin<{}> { } } -type Props = {| +type OwnProps = {| ...SearchableProps, + onClear: () => void, + selectedID: ?string, + logger: Logger, +|}; + +type Props = {| + ...OwnProps, activeNotifications: Array, invalidatedNotifications: Array, blacklistedPlugins: Array, blacklistedCategories: Array, devicePlugins: Map>>, clientPlugins: Map>>, - onClear: () => void, updatePluginBlacklist: (blacklist: Array) => mixed, updateCategoryBlacklist: (blacklist: Array) => mixed, - selectPlugin: ({ + selectPlugin: (payload: {| selectedPlugin: ?string, selectedApp: ?string, - deepLinkPayload?: ?string, - }) => mixed, - selectedID: ?string, - logger: Logger, + deepLinkPayload: ?string, + |}) => mixed, |}; type State = {| @@ -322,11 +326,7 @@ class NotificationsTable extends Component { } } -/* $FlowFixMe(>=0.86.0) This - * comment suppresses an error found when Flow v0.86 was - * deployed. To see the error, delete this comment and - * run Flow. */ -const ConnectedNotificationsTable = connect( +const ConnectedNotificationsTable = connect( ({ notifications: { activeNotifications, @@ -343,6 +343,7 @@ const ConnectedNotificationsTable = connect( devicePlugins, clientPlugins, }), + // $FlowFixMe { updatePluginBlacklist, updateCategoryBlacklist, @@ -453,11 +454,11 @@ type ItemProps = { onHideCategory?: () => mixed, isSelected?: boolean, inactive?: boolean, - selectPlugin?: ({ + selectPlugin?: (payload: {| selectedPlugin: ?string, selectedApp: ?string, - deepLinkPayload?: ?string, - }) => mixed, + deepLinkPayload: ?string, + |}) => mixed, logger?: Logger, plugin: ?Class>, }; diff --git a/src/PluginContainer.js b/src/PluginContainer.js index 063880daa..2894cb96f 100644 --- a/src/PluginContainer.js +++ b/src/PluginContainer.js @@ -38,8 +38,19 @@ const SidebarContainer = styled(FlexRow)({ overflow: 'scroll', }); -type Props = { +/* +pluginState: pluginStates[pluginKey], +activePlugin, +target, +deepLinkPayload, +pluginKey, +*/ +type OwnProps = {| logger: LogManager, +|}; + +type Props = {| + ...OwnProps, pluginState: Object, activePlugin: ?Class | FlipperDevicePlugin<>>, target: Client | BaseDevice | null, @@ -55,7 +66,7 @@ type Props = { pluginKey: string, state: Object, }) => void, -}; +|}; class PluginContainer extends PureComponent { plugin: ?FlipperPlugin<> | FlipperDevicePlugin<>; @@ -132,11 +143,7 @@ class PluginContainer extends PureComponent { } } -/* $FlowFixMe(>=0.86.0) This - * comment suppresses an error found when Flow v0.86 was - * deployed. To see the error, delete this comment and - * run Flow. */ -export default connect( +export default connect( ({ application: {rightSidebarVisible, rightSidebarAvailable}, connections: { @@ -182,6 +189,7 @@ export default connect( pluginKey, }; }, + // $FlowFixMe { setPluginState, selectPlugin, diff --git a/src/chrome/AutoUpdateVersion.js b/src/chrome/AutoUpdateVersion.js index 0d25611ce..599275439 100644 --- a/src/chrome/AutoUpdateVersion.js +++ b/src/chrome/AutoUpdateVersion.js @@ -7,7 +7,6 @@ import { FlexRow, - Text, colors, LoadingIndicator, Glyph, diff --git a/src/chrome/DetailSidebar.js b/src/chrome/DetailSidebar.js index ff07f2924..016e81497 100644 --- a/src/chrome/DetailSidebar.js +++ b/src/chrome/DetailSidebar.js @@ -11,12 +11,17 @@ import Sidebar from '../ui/components/Sidebar'; import {connect} from 'react-redux'; import {toggleRightSidebarAvailable} from '../reducers/application.js'; -type Props = { +type OwnProps = {| children: any, + width?: number, + minWidth?: number, +|}; + +type Props = { + ...OwnProps, rightSidebarVisible: boolean, rightSidebarAvailable: boolean, toggleRightSidebarAvailable: (visible?: boolean) => any, - width?: number, }; class DetailSidebar extends React.Component { @@ -42,7 +47,10 @@ class DetailSidebar extends React.Component { this.props.rightSidebarVisible && domNode && ReactDOM.createPortal( - + {this.props.children} , domNode, @@ -51,11 +59,7 @@ class DetailSidebar extends React.Component { } } -/* $FlowFixMe(>=0.86.0) This - * comment suppresses an error found when Flow v0.86 was - * deployed. To see the error, delete this comment and - * run Flow. */ -export default connect( +export default connect( ({application: {rightSidebarVisible, rightSidebarAvailable}}) => ({ rightSidebarVisible, rightSidebarAvailable, diff --git a/src/chrome/DevicesButton.js b/src/chrome/DevicesButton.js index 35f6fea15..4a3209ed8 100644 --- a/src/chrome/DevicesButton.js +++ b/src/chrome/DevicesButton.js @@ -28,22 +28,22 @@ const DropdownButton = styled(Button)({ fontSize: 11, }); -// Remove this if the flow fixme at the bottom is addressed (or has already been removed). -/* eslint-disable prettier/prettier */ class DevicesButton extends Component { launchEmulator = (name: string) => { // On Linux, you must run the emulator from the directory it's in because // reasons ... - whichPromise('emulator').then(emulatorPath => { - const child = spawn(emulatorPath, [`@${name}`], { - detached: true, - cwd: dirname(emulatorPath), - }); - child.stderr.on('data', data => { - console.error(`Android emulator error: ${data}`); - }); - child.on('error', console.error); - }).catch(console.error); + whichPromise('emulator') + .then(emulatorPath => { + const child = spawn(emulatorPath, [`@${name}`], { + detached: true, + cwd: dirname(emulatorPath), + }); + child.stderr.on('data', data => { + console.error(`Android emulator error: ${data}`); + }); + child.on('error', console.error); + }) + .catch(console.error); this.props.preferDevice(name); }; @@ -109,10 +109,8 @@ class DevicesButton extends Component { ); } -} /* $FlowFixMe(>=0.86.0) This comment suppresses an error found when Flow v0.86 - * was deployed. To see the error, delete this comment and run Flow. - */ -export default connect( +} +export default connect( ({connections: {devices, androidEmulators, selectedDevice}}) => ({ devices, androidEmulators, diff --git a/src/chrome/MainSidebar.js b/src/chrome/MainSidebar.js index 540972b99..c632a676a 100644 --- a/src/chrome/MainSidebar.js +++ b/src/chrome/MainSidebar.js @@ -10,6 +10,7 @@ import type BaseDevice from '../devices/BaseDevice.js'; import type Client from '../Client.js'; import type {UninitializedClient} from '../UninitializedClient.js'; import type {PluginNotification} from '../reducers/notifications'; +import type {ActiveSheet} from '../reducers/application'; import { PureComponent, @@ -190,11 +191,11 @@ type MainSidebarProps = {| selectedApp: ?string, selectedDevice: ?BaseDevice, windowIsFocused: boolean, - selectPlugin: (payload: { + selectPlugin: (payload: {| selectedPlugin: ?string, selectedApp: ?string, deepLinkPayload: ?string, - }) => void, + |}) => void, clients: Array, uninitializedClients: Array<{ client: UninitializedClient, @@ -204,7 +205,7 @@ type MainSidebarProps = {| numNotifications: number, devicePlugins: Map>>, clientPlugins: Map>>, - setActiveSheet: (activeSheet: ?string) => any, + setActiveSheet: (activeSheet: ActiveSheet) => void, |}; class MainSidebar extends PureComponent { @@ -348,11 +349,7 @@ class MainSidebar extends PureComponent { } } -/* $FlowFixMe(>=0.86.0) This - * comment suppresses an error found when Flow v0.86 was - * deployed. To see the error, delete this comment and - * run Flow. */ -export default connect( +export default connect( ({ application: {windowIsFocused}, connections: { diff --git a/src/chrome/PluginDebugger.js b/src/chrome/PluginDebugger.js index 6a57d1672..9dbe34593 100644 --- a/src/chrome/PluginDebugger.js +++ b/src/chrome/PluginDebugger.js @@ -8,6 +8,7 @@ import type {FlipperDevicePlugin, FlipperPlugin} from '../plugin'; import type {PluginDefinition} from '../dispatcher/plugins'; import type Client from '../Client'; +import type {TableBodyRow} from '../ui/components/table/types'; import {Component, Fragment} from 'react'; import {connect} from 'react-redux'; @@ -20,7 +21,6 @@ import { colors, Link, } from 'flipper'; -import {remote} from 'electron'; const Container = styled(FlexColumn)({ padding: 10, @@ -118,7 +118,7 @@ class PluginDebugger extends Component { GKname: ?string, GKpassing: ?boolean, pluginPath: ?string, - ) { + ): TableBodyRow { return { key: name.toLowerCase(), columns: { @@ -165,8 +165,8 @@ class PluginDebugger extends Component { .join(', '); } - getRows() { - let rows = []; + getRows(): Array { + let rows: Array = []; // bundled plugins are loaded from the defaultPlugins directory within // Flipper's package. diff --git a/src/chrome/ScreenCaptureButtons.js b/src/chrome/ScreenCaptureButtons.js index ee303c31a..178ef57dd 100644 --- a/src/chrome/ScreenCaptureButtons.js +++ b/src/chrome/ScreenCaptureButtons.js @@ -302,10 +302,8 @@ class ScreenCaptureButtons extends Component { } } -/* $FlowFixMe(>=0.86.0) This - * comment suppresses an error found when Flow v0.86 was - * deployed. To see the error, delete this comment and - * run Flow. */ -export default connect(({connections: {selectedDevice}}) => ({ - selectedDevice, -}))(ScreenCaptureButtons); +export default connect( + ({connections: {selectedDevice}}) => ({ + selectedDevice, + }), +)(ScreenCaptureButtons); diff --git a/src/chrome/Sheet.js b/src/chrome/Sheet.js index 1dce8fcaa..0262bd48f 100644 --- a/src/chrome/Sheet.js +++ b/src/chrome/Sheet.js @@ -35,10 +35,14 @@ const DialogContainer = styled('div')(({state}) => ({ boxShadow: '0 5px 13px rgba(0, 0, 0, 0.2)', })); +type OwnProps = {| + children: (onHide: () => mixed) => any, +|}; + type Props = {| + ...OwnProps, activeSheet: ActiveSheet, onHideSheet: () => void, - children: (onHide: () => mixed) => any, |}; type State = {| @@ -105,11 +109,8 @@ class Sheet extends Component { ); } } -/* $FlowFixMe(>=0.86.0) This - * comment suppresses an error found when Flow v0.86 was - * deployed. To see the error, delete this comment and - * run Flow. */ -export default connect( + +export default connect( ({application: {activeSheet}}) => ({ activeSheet, }), diff --git a/src/chrome/TitleBar.js b/src/chrome/TitleBar.js index b6e5de3a7..cc9c20385 100644 --- a/src/chrome/TitleBar.js +++ b/src/chrome/TitleBar.js @@ -51,7 +51,12 @@ const AppTitleBar = styled(FlexRow)(({focused}) => ({ zIndex: 4, })); +type OwnProps = {| + version: string, +|}; + type Props = {| + ...OwnProps, windowIsFocused: boolean, leftSidebarVisible: boolean, rightSidebarVisible: boolean, @@ -59,7 +64,6 @@ type Props = {| toggleLeftSidebarVisible: (visible?: boolean) => void, toggleRightSidebarVisible: (visible?: boolean) => void, setActiveSheet: (sheet: ActiveSheet) => void, - version: string, |}; const VersionText = styled(Text)({ @@ -114,23 +118,19 @@ class TitleBar extends Component { } } -/* $FlowFixMe(>=0.86.0) This comment suppresses an error found when Flow v0.86 - * was deployed. To see the error, delete this comment and run Flow. */ -export default connect( +export default connect( ({ application: { windowIsFocused, leftSidebarVisible, rightSidebarVisible, rightSidebarAvailable, - pluginManagerVisible, }, }) => ({ windowIsFocused, leftSidebarVisible, rightSidebarVisible, rightSidebarAvailable, - pluginManagerVisible, }), { setActiveSheet, diff --git a/src/createTablePlugin.js b/src/createTablePlugin.js index fdaf69e87..0c4f93d74 100644 --- a/src/createTablePlugin.js +++ b/src/createTablePlugin.js @@ -58,7 +58,6 @@ type State = {| * the client in an unknown state. */ export function createTablePlugin(props: Props) { - // $FlowFixMe persistedStateReducer is fine to accept payload of type T, because it is of type RowData return class extends FlipperPlugin> { static keyboardActions = ['clear', 'createPaste']; diff --git a/src/devices/AndroidDevice.js b/src/devices/AndroidDevice.js index 77b912e4b..2dd79417c 100644 --- a/src/devices/AndroidDevice.js +++ b/src/devices/AndroidDevice.js @@ -6,7 +6,6 @@ */ import type {DeviceType, DeviceShell} from './BaseDevice.js'; -import type {Store} from '../reducers/index'; import {Priority} from 'adbkit-logcat-fb'; import child_process from 'child_process'; @@ -69,7 +68,7 @@ export default class AndroidDevice extends BaseDevice { return ['date', 'pid', 'tid', 'tag', 'message', 'type', 'time']; } - reverse(ports: [number]): Promise { + reverse(ports: [number, number]): Promise { return Promise.all( ports.map(port => this.adb.reverse(this.serial, `tcp:${port}`, `tcp:${port}`), diff --git a/src/fb-stubs/Logger.js b/src/fb-stubs/Logger.js index b8d00a431..6ef9e3e61 100644 --- a/src/fb-stubs/Logger.js +++ b/src/fb-stubs/Logger.js @@ -7,6 +7,7 @@ export type LogTypes = 'error' | 'warn' | 'info' | 'debug'; export type TrackType = 'duration' | 'usage' | 'performance' | 'success-rate'; +import type {Store} from '../reducers/index'; import ScribeLogger from './ScribeLogger'; var instance: ?LogManager = null; diff --git a/src/plugins/logs/LogWatcher.js b/src/plugins/logs/LogWatcher.js index 9a7286713..73e7194b4 100644 --- a/src/plugins/logs/LogWatcher.js +++ b/src/plugins/logs/LogWatcher.js @@ -5,6 +5,8 @@ * @format */ +import type {TableBodyRow} from 'flipper'; + import { PureComponent, FlexColumn, @@ -129,11 +131,7 @@ export default class LogWatcher extends PureComponent { this.props.onChange(newCounters); }; - buildRows = () => { - /* $FlowFixMe(>=0.86.0) This - * comment suppresses an error found when Flow v0.86 was - * deployed. To see the error, delete this comment and - * run Flow. */ + buildRows = (): Array => { return this.props.counters.map(({label, count, notify}, i) => ({ columns: { expression: { diff --git a/src/plugins/shared_preferences/index.js b/src/plugins/shared_preferences/index.js index 5a5808855..a7e4e06ee 100644 --- a/src/plugins/shared_preferences/index.js +++ b/src/plugins/shared_preferences/index.js @@ -104,7 +104,7 @@ export default class extends FlipperPlugin { const change = event.change; const entry = state.sharedPreferences[change.preferences]; if (entry == null) { - return; + return state; } if (change.deleted) { delete entry.preferences[change.name]; diff --git a/src/reducers/index.js b/src/reducers/index.js index 3f06bfb19..119b11a21 100644 --- a/src/reducers/index.js +++ b/src/reducers/index.js @@ -37,7 +37,14 @@ import type { } from './plugins.js'; import type {Store as ReduxStore} from 'redux'; -// $FlowFixMe introduced when removing $Subtype/$Supertype +type Actions = + | ApplicationAction + | DevicesAction + | PluginStatesAction + | NotificationsAction + | PluginsAction + | {|type: 'INIT'|}; + export type Store = ReduxStore< {| application: ApplicationState, @@ -46,19 +53,10 @@ export type Store = ReduxStore< notifications: NotificationsState, plugins: PluginsState, |}, - | ApplicationAction - | DevicesAction - | PluginStatesAction - | NotificationsAction - | PluginsAction - | {|type: 'INIT'|}, + Actions, >; -/* $FlowFixMe(>=0.86.0) This - * comment suppresses an error found when Flow v0.86 was - * deployed. To see the error, delete this comment and - * run Flow. */ -export default combineReducers({ +export default combineReducers<_, Actions>({ application, connections: persistReducer( { diff --git a/src/ui/components/elements-inspector/sidebar.js b/src/ui/components/elements-inspector/sidebar.js index 9217a4fdf..7b4b57b50 100644 --- a/src/ui/components/elements-inspector/sidebar.js +++ b/src/ui/components/elements-inspector/sidebar.js @@ -81,7 +81,7 @@ type Props = {| client: PluginClient, realClient: Client, logger: Logger, - extensions?: Array, + extensions?: Array, |}; type State = {| @@ -118,12 +118,8 @@ export class InspectorSidebar extends Component { return null; } - const sections = + const sections: Array = (extensions && - /* $FlowFixMe(>=0.86.0) This - * comment suppresses an error found when Flow v0.86 was - * deployed. To see the error, delete this comment and - * run Flow. */ extensions.map(ext => ext( this.props.client, diff --git a/src/ui/components/table/ManagedTable.js b/src/ui/components/table/ManagedTable.js index 44c1ca507..1bf58b955 100644 --- a/src/ui/components/table/ManagedTable.js +++ b/src/ui/components/table/ManagedTable.js @@ -156,9 +156,7 @@ class ManagedTable extends React.Component< shouldScrollToBottom: Boolean(this.props.stickyBottom), }; - tableRef: { - current: null | List, - } = React.createRef(); + tableRef = React.createRef(); scrollRef: { current: null | HTMLDivElement, diff --git a/src/utils/CertificateProvider.js b/src/utils/CertificateProvider.js index 9892377d4..8f61efb88 100644 --- a/src/utils/CertificateProvider.js +++ b/src/utils/CertificateProvider.js @@ -8,8 +8,6 @@ import LogManager from '../fb-stubs/Logger'; import {RecurringError} from './errors'; import {promisify} from 'util'; -import child_process from 'child_process'; -const exec = promisify(child_process.exec); const fs = require('fs'); const adb = require('adbkit-fb'); import { diff --git a/src/utils/metrics.js b/src/utils/metrics.js index c6a7493e2..073882b4b 100644 --- a/src/utils/metrics.js +++ b/src/utils/metrics.js @@ -14,10 +14,10 @@ import {getInstance} from '../fb-stubs/Logger'; Use this variant to report failures in core platform (Flipper) code. */ -export function reportPlatformFailures( - promise: Promise<*>, +export function reportPlatformFailures( + promise: Promise, name: string, -): Promise<*> { +): Promise { return promise.then( fulfilledValue => { getInstance().track('success-rate', name, 1); @@ -37,11 +37,11 @@ export function reportPlatformFailures( Use this variant to report failures in plugin code. */ -export function reportPluginFailures( - promise: Promise<*>, +export function reportPluginFailures( + promise: Promise, name: string, plugin: string, -): Promise<*> { +): Promise { return promise.then( fulfilledValue => { getInstance().track('success-rate', name, 1, plugin); diff --git a/static/package.json b/static/package.json index 39a518319..8813d0fe9 100644 --- a/static/package.json +++ b/static/package.json @@ -6,11 +6,11 @@ "dependencies": { "@babel/core": "^7.1.0", "@babel/generator": "^7.1.0", - "@babel/parser": "^7.1.0", + "@babel/parser": "^7.3.1", "@babel/plugin-proposal-class-properties": "^7.1.0", "@babel/plugin-proposal-object-rest-spread": "^7.0.0", "@babel/plugin-proposal-optional-chaining": "^7.0.0", - "@babel/plugin-transform-flow-strip-types": "^7.0.0", + "@babel/plugin-transform-flow-strip-types": "^7.2.3", "@babel/plugin-transform-modules-commonjs": "^7.1.0", "@babel/preset-react": "^7.0.0", "metro": "^0.49.0", diff --git a/static/transforms/index.js b/static/transforms/index.js index eab3bb451..ad5b27387 100644 --- a/static/transforms/index.js +++ b/static/transforms/index.js @@ -20,7 +20,7 @@ function transform({filename, options, src}) { filename, plugins: [ 'jsx', - 'flow', + ['flow', {all: true}], 'classProperties', 'objectRestSpread', 'optionalChaining', diff --git a/static/yarn.lock b/static/yarn.lock index bf03f0e38..0d713a595 100644 --- a/static/yarn.lock +++ b/static/yarn.lock @@ -216,6 +216,11 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.1.0.tgz#a7cd42cb3c12aec52e24375189a47b39759b783e" integrity sha512-SmjnXCuPAlai75AFtzv+KCBcJ3sDDWbIn+WytKw1k+wAtEy6phqI2RqKh/zAnw53i1NR8su3Ep/UoqaKcimuLg== +"@babel/parser@^7.3.1": + version "7.3.1" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.3.1.tgz#8f4ffd45f779e6132780835ffa7a215fa0b2d181" + integrity sha512-ATz6yX/L8LEnC3dtLQnIx4ydcPxhLcoy9Vl6re00zb2w5lG6itY6Vhnr1KFRPq/FHNsgl/gh2mjNN20f9iJTTA== + "@babel/plugin-check-constants@^7.0.0-beta.38": version "7.0.0-beta.38" resolved "https://registry.yarnpkg.com/@babel/plugin-check-constants/-/plugin-check-constants-7.0.0-beta.38.tgz#bbda6306d45a4f097ccb416c0b52d6503f6502cf" @@ -308,6 +313,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" +"@babel/plugin-syntax-flow@^7.2.0": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.2.0.tgz#a765f061f803bc48f240c26f8747faf97c26bf7c" + integrity sha512-r6YMuZDWLtLlu0kqIim5o/3TNRAlWb073HwT3e2nKf9I8IIvOggPrnILYPsrrKilmn/mYEMCf/Z07w3yQJF6dg== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-jsx@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.0.0.tgz#034d5e2b4e14ccaea2e4c137af7e4afb39375ffd" @@ -416,6 +428,14 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-flow" "^7.0.0" +"@babel/plugin-transform-flow-strip-types@^7.2.3": + version "7.2.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.2.3.tgz#e3ac2a594948454e7431c7db33e1d02d51b5cd69" + integrity sha512-xnt7UIk9GYZRitqCnsVMjQK1O2eKZwFB3CvvHjf5SGx6K6vr/MScCKQDnf1DxRaj501e3pXjti+inbSXX2ZUoQ== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-syntax-flow" "^7.2.0" + "@babel/plugin-transform-for-of@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.0.0.tgz#f2ba4eadb83bd17dc3c7e9b30f4707365e1c3e39" diff --git a/yarn.lock b/yarn.lock index 65ca0ed9f..e55bd3ad4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14,15 +14,6 @@ version "0.0.6" resolved "https://registry.yarnpkg.com/7zip/-/7zip-0.0.6.tgz#9cafb171af82329490353b4816f03347aa150a30" -"@babel/code-frame@7.0.0-beta.36": - version "7.0.0-beta.36" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.36.tgz#2349d7ec04b3a06945ae173280ef8579b63728e4" - integrity sha512-sW77BFwJ48YvQp3Gzz5xtAUiXuYOL2aMJKDwiaY3OcvdqBFurtYfOpSa4QrNyDxmOGRFSYzUpabU2m9QrlWE7w== - dependencies: - chalk "^2.0.0" - esutils "^2.0.2" - js-tokens "^3.0.0" - "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.0.0-beta.35": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0.tgz#06e2ab19bdb535385559aabb5ba59729482800f8" @@ -30,21 +21,32 @@ dependencies: "@babel/highlight" "^7.0.0" -"@babel/helper-function-name@7.0.0-beta.36": - version "7.0.0-beta.36" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.36.tgz#366e3bc35147721b69009f803907c4d53212e88d" - integrity sha512-/SGPOyifPf20iTrMN+WdlY2MbKa7/o4j7B/4IAsdOusASp2icT+Wcdjf4tjJHaXNX8Pe9bpgVxLNxhRvcf8E5w== +"@babel/generator@^7.2.2": + version "7.3.0" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.3.0.tgz#f663838cd7b542366de3aa608a657b8ccb2a99eb" + integrity sha512-dZTwMvTgWfhmibq4V9X+LMf6Bgl7zAodRn9PvcPdhlzFMbvUutx74dbEv7Atz3ToeEpevYEJtAwfxq/bDCzHWg== dependencies: - "@babel/helper-get-function-arity" "7.0.0-beta.36" - "@babel/template" "7.0.0-beta.36" - "@babel/types" "7.0.0-beta.36" + "@babel/types" "^7.3.0" + jsesc "^2.5.1" + lodash "^4.17.10" + source-map "^0.5.0" + trim-right "^1.0.1" -"@babel/helper-get-function-arity@7.0.0-beta.36": - version "7.0.0-beta.36" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.36.tgz#f5383bac9a96b274828b10d98900e84ee43e32b8" - integrity sha512-vPPcx2vsSoDbcyWr9S3nd0FM3B4hEXnt0p1oKpwa08GwK0fSRxa98MyaRGf8suk8frdQlG1P3mDrz5p/Rr3pbA== +"@babel/helper-function-name@^7.1.0": + version "7.1.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz#a0ceb01685f73355d4360c1247f582bfafc8ff53" + integrity sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw== dependencies: - "@babel/types" "7.0.0-beta.36" + "@babel/helper-get-function-arity" "^7.0.0" + "@babel/template" "^7.1.0" + "@babel/types" "^7.0.0" + +"@babel/helper-get-function-arity@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz#83572d4320e2a4657263734113c42868b64e49c3" + integrity sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ== + dependencies: + "@babel/types" "^7.0.0" "@babel/helper-module-imports@7.0.0-beta.51": version "7.0.0-beta.51" @@ -53,6 +55,13 @@ "@babel/types" "7.0.0-beta.51" lodash "^4.17.5" +"@babel/helper-split-export-declaration@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0.tgz#3aae285c0311c2ab095d997b8c9a94cad547d813" + integrity sha512-MXkOJqva62dfC0w85mEf/LucPPS/1+04nmmRMPEBUB++hiiThQ2zPtX/mEWQ3mtzCEjIJvPY8nuwxXtQeQwUag== + dependencies: + "@babel/types" "^7.0.0" + "@babel/highlight@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.0.0.tgz#f710c38c8d458e6dd9a201afb637fcb781ce99e4" @@ -62,6 +71,11 @@ esutils "^2.0.2" js-tokens "^4.0.0" +"@babel/parser@^7.0.0", "@babel/parser@^7.2.2", "@babel/parser@^7.2.3": + version "7.3.1" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.3.1.tgz#8f4ffd45f779e6132780835ffa7a215fa0b2d181" + integrity sha512-ATz6yX/L8LEnC3dtLQnIx4ydcPxhLcoy9Vl6re00zb2w5lG6itY6Vhnr1KFRPq/FHNsgl/gh2mjNN20f9iJTTA== + "@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.2.0.tgz#b03e42eeddf5898e00646e4c840fa07ba8dcad7f" @@ -69,38 +83,29 @@ dependencies: regenerator-runtime "^0.12.0" -"@babel/template@7.0.0-beta.36": - version "7.0.0-beta.36" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.0.0-beta.36.tgz#02e903de5d68bd7899bce3c5b5447e59529abb00" - integrity sha512-mUBi90WRyZ9iVvlWLEdeo8gn/tROyJdjKNC4W5xJTSZL+9MS89rTJSqiaJKXIkxk/YRDL/g/8snrG/O0xl33uA== +"@babel/template@^7.1.0": + version "7.2.2" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.2.2.tgz#005b3fdf0ed96e88041330379e0da9a708eb2907" + integrity sha512-zRL0IMM02AUDwghf5LMSSDEz7sBCO2YnNmpg3uWTZj/v1rcG2BmQUvaGU8GhU8BvfMh1k2KIAYZ7Ji9KXPUg7g== dependencies: - "@babel/code-frame" "7.0.0-beta.36" - "@babel/types" "7.0.0-beta.36" - babylon "7.0.0-beta.36" - lodash "^4.2.0" + "@babel/code-frame" "^7.0.0" + "@babel/parser" "^7.2.2" + "@babel/types" "^7.2.2" -"@babel/traverse@7.0.0-beta.36": - version "7.0.0-beta.36" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.0.0-beta.36.tgz#1dc6f8750e89b6b979de5fe44aa993b1a2192261" - integrity sha512-OTUb6iSKVR/98dGThRJ1BiyfwbuX10BVnkz89IpaerjTPRhDfMBfLsqmzxz5MiywUOW4M0Clta0o7rSxkfcuzw== +"@babel/traverse@^7.0.0": + version "7.2.3" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.2.3.tgz#7ff50cefa9c7c0bd2d81231fdac122f3957748d8" + integrity sha512-Z31oUD/fJvEWVR0lNZtfgvVt512ForCTNKYcJBGbPb1QZfve4WGH8Wsy7+Mev33/45fhP/hwQtvgusNdcCMgSw== dependencies: - "@babel/code-frame" "7.0.0-beta.36" - "@babel/helper-function-name" "7.0.0-beta.36" - "@babel/types" "7.0.0-beta.36" - babylon "7.0.0-beta.36" - debug "^3.0.1" + "@babel/code-frame" "^7.0.0" + "@babel/generator" "^7.2.2" + "@babel/helper-function-name" "^7.1.0" + "@babel/helper-split-export-declaration" "^7.0.0" + "@babel/parser" "^7.2.3" + "@babel/types" "^7.2.2" + debug "^4.1.0" globals "^11.1.0" - invariant "^2.2.0" - lodash "^4.2.0" - -"@babel/types@7.0.0-beta.36": - version "7.0.0-beta.36" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.0.0-beta.36.tgz#64f2004353de42adb72f9ebb4665fc35b5499d23" - integrity sha512-PyAORDO9um9tfnrddXgmWN9e6Sq9qxraQIt5ynqBOSXKA5qvK1kUr+Q3nSzKFdzorsiK+oqcUnAFvEoKxv9D+Q== - dependencies: - esutils "^2.0.2" - lodash "^4.2.0" - to-fast-properties "^2.0.0" + lodash "^4.17.10" "@babel/types@7.0.0-beta.51": version "7.0.0-beta.51" @@ -110,6 +115,15 @@ lodash "^4.17.5" to-fast-properties "^2.0.0" +"@babel/types@^7.0.0", "@babel/types@^7.2.2", "@babel/types@^7.3.0": + version "7.3.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.3.0.tgz#61dc0b336a93badc02bf5f69c4cd8e1353f2ffc0" + integrity sha512-QkFPw68QqWU1/RVPyBe8SO7lXbPfjtqAxRYQKpFpaB8yMq7X2qAqfwK5LKoQufEkSmO5NQ70O6Kc3Afk03RwXw== + dependencies: + esutils "^2.0.2" + lodash "^4.17.10" + to-fast-properties "^2.0.0" + "@emotion/babel-utils@^0.6.4": version "0.6.9" resolved "https://registry.yarnpkg.com/@emotion/babel-utils/-/babel-utils-0.6.9.tgz#bb074fadad65c443a575d3379488415fd194fc75" @@ -583,16 +597,16 @@ babel-core@^6.0.0, babel-core@^6.26.0, babel-core@^6.26.3: slash "^1.0.0" source-map "^0.5.7" -babel-eslint@8.2.1: - version "8.2.1" - resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-8.2.1.tgz#136888f3c109edc65376c23ebf494f36a3e03951" - integrity sha512-RzdVOyWKQRUnLXhwLk+eKb4oyW+BykZSkpYwFhM4tnfzAG5OWfvG0w/uyzMp5XKEU0jN82+JefHr39bG2+KhRQ== +babel-eslint@^10.0.1: + version "10.0.1" + resolved "https://registry.yarnpkg.com/babel-eslint/-/babel-eslint-10.0.1.tgz#919681dc099614cd7d31d45c8908695092a1faed" + integrity sha512-z7OT1iNV+TjOwHNLLyJk+HN+YVWX+CLE6fPD2SymJZOZQBs+QIexFjhm4keGTm8MW9xr4EC9Q0PbaLB24V5GoQ== dependencies: - "@babel/code-frame" "7.0.0-beta.36" - "@babel/traverse" "7.0.0-beta.36" - "@babel/types" "7.0.0-beta.36" - babylon "7.0.0-beta.36" - eslint-scope "~3.7.1" + "@babel/code-frame" "^7.0.0" + "@babel/parser" "^7.0.0" + "@babel/traverse" "^7.0.0" + "@babel/types" "^7.0.0" + eslint-scope "3.7.1" eslint-visitor-keys "^1.0.0" babel-generator@^6.18.0, babel-generator@^6.26.0: @@ -1264,11 +1278,6 @@ babel-types@^6.0.0, babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.24. lodash "^4.17.4" to-fast-properties "^1.0.3" -babylon@7.0.0-beta.36: - version "7.0.0-beta.36" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-7.0.0-beta.36.tgz#3a3683ba6a9a1e02b0aa507c8e63435e39305b9e" - integrity sha512-rw4YdadGwajAMMRl6a5swhQ0JCOOFyaYCfJ0AsmNBD8uBD/r4J8mux7wBaqavvFKqUKQYWOzA1Speams4YDzsQ== - babylon@^6.18.0: version "6.18.0" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" @@ -1922,14 +1931,7 @@ debug@^3.0.0, debug@^3.1.0, debug@~3.1.0: dependencies: ms "2.0.0" -debug@^3.0.1: - version "3.2.5" - resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.5.tgz#c2418fbfd7a29f4d4f70ff4cea604d4b64c46407" - integrity sha512-D61LaDQPQkxJ5AUM2mbSJRbPkNs/TmdmOeLAi1hgDkpDfIfetSrjmWhccwtuResSwMbACjx/xXQofvM9CE/aeg== - dependencies: - ms "^2.1.1" - -debug@^4.0.1: +debug@^4.0.1, debug@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== @@ -2440,17 +2442,18 @@ eslint-rule-composer@^0.3.0: resolved "https://registry.yarnpkg.com/eslint-rule-composer/-/eslint-rule-composer-0.3.0.tgz#79320c927b0c5c0d3d3d2b76c8b4a488f25bbaf9" integrity sha512-bt+Sh8CtDmn2OajxvNO+BX7Wn4CIWMpTRm3MaiKPCQcnnlm0CS2mhui6QaoeQugs+3Kj2ESKEEGJUdVafwhiCg== -eslint-scope@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.0.tgz#50bf3071e9338bcdc43331794a0cb533f0136172" - integrity sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA== +eslint-scope@3.7.1: + version "3.7.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" + integrity sha1-PWPD7f2gLgbgGkUq2IyqzHzctug= dependencies: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-scope@~3.7.1: - version "3.7.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" +eslint-scope@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.0.tgz#50bf3071e9338bcdc43331794a0cb533f0136172" + integrity sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA== dependencies: esrecurse "^4.1.0" estraverse "^4.1.1" @@ -2881,10 +2884,10 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -flow-bin@^0.86.0: - version "0.86.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.86.0.tgz#153a28722b4dc13b7200c74b644dd4d9f4969a11" - integrity sha512-ulRvFH3ewGIYwg+qPk/OJXoe3Nhqi0RyR0wqgK0b1NzUDEC6O99zU39MBTickXvlrr6iwRO6Wm4lVGeDmnzbew== +flow-bin@^0.91.0: + version "0.91.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.91.0.tgz#f5c89729f74b2ccbd47df6fbfadbdcc89cc1e478" + integrity sha512-j+L+xNiUYnZZ27MjVI0y2c9474ZHOvdSQq0Tjwh56mEA7tfxYqp5Dcb6aZSwvs3tGMTjCrZow9aUlZf3OoRyDQ== flow-parser@^0.*: version "0.81.0" @@ -3394,7 +3397,7 @@ inquirer@^6.1.0: strip-ansi "^5.0.0" through "^2.3.6" -invariant@^2.0.0, invariant@^2.2.0, invariant@^2.2.2, invariant@^2.2.4: +invariant@^2.0.0, invariant@^2.2.2, invariant@^2.2.4: version "2.2.4" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" dependencies: @@ -4198,6 +4201,11 @@ jsesc@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" +jsesc@^2.5.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== + jsesc@~0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" @@ -6261,7 +6269,7 @@ source-map-url@^0.4.0: resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= -source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7: +source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@^0.5.7: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"