Move FlipperServer initialisation out of flipper-core
Summary: This diff makes sure flipper-ui-core no longer depends on flipper-server-core. Currently server config is still transferred from UI to server, which doesn't really make sense in future scenarios where server might start before client, but will address that separately Reviewed By: timur-valiev, aigoncharov Differential Revision: D32462835 fbshipit-source-id: 498a944256ba1aabbf963b896953e64d11e27214
This commit is contained in:
committed by
Facebook GitHub Bot
parent
d48f22b8dc
commit
eed19b3a3d
@@ -10,8 +10,9 @@
|
||||
import type {NotificationEvents} from './dispatcher/notifications';
|
||||
import type {PluginNotification} from './reducers/notifications';
|
||||
import type {NotificationConstructorOptions} from 'electron';
|
||||
import type {FlipperLib} from 'flipper-plugin';
|
||||
import {FlipperLib, TestUtils} from 'flipper-plugin';
|
||||
import path from 'path';
|
||||
import {FlipperServer, Logger} from 'flipper-common';
|
||||
|
||||
type ENVIRONMENT_VARIABLES = 'NODE_ENV' | 'DEV_SERVER_URL' | 'CONFIG';
|
||||
type ENVIRONMENT_PATHS =
|
||||
@@ -106,6 +107,16 @@ export interface RenderHost {
|
||||
paths: Record<ENVIRONMENT_PATHS, string>;
|
||||
openLink(url: string): void;
|
||||
loadDefaultPlugins(): Record<string, any>;
|
||||
startFlipperServer(config: {
|
||||
// TODO: this config is temporarily, settings should be loaded/stored by server, not client
|
||||
logger: Logger;
|
||||
enableAndroid: boolean;
|
||||
androidHome: string;
|
||||
enableIOS: boolean;
|
||||
enablePhysicalIOS: boolean;
|
||||
idbPath: string;
|
||||
validWebSocketOrigins: string[];
|
||||
}): FlipperServer;
|
||||
}
|
||||
|
||||
export function getRenderHostInstance(): RenderHost {
|
||||
@@ -154,5 +165,6 @@ if (process.env.NODE_ENV === 'test') {
|
||||
loadDefaultPlugins() {
|
||||
return {};
|
||||
},
|
||||
startFlipperServer: () => TestUtils.createFlipperServerMock(),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user