Create flipper-server-client package

Summary:
FlipperServerClient is a useful abstraction for any JS-based client of headless Flipper. No need to bundle it with flipper-frontend-core, as the rest is not useful for external clients.
Currently, I am planning to add it to jest-e2e to send commands to Flipper

Reviewed By: lblasa

Differential Revision: D40765668

fbshipit-source-id: af48710bb15444ac1ecd649fe9a2ab252f3088f3
This commit is contained in:
Andrey Goncharov
2022-10-31 04:26:43 -07:00
committed by Facebook GitHub Bot
parent 0f5ba32736
commit 226ccf91f6
14 changed files with 74 additions and 6 deletions

View File

@@ -17,7 +17,7 @@ import {
import {
createFlipperServerWithSocket,
FlipperServerState,
} from 'flipper-frontend-core';
} from 'flipper-server-client';
import {
FlipperServerImpl,
getEnvironmentInfo,
@@ -89,7 +89,7 @@ async function getExternalServer(url: string) {
};
const socket = new ReconnectingWebSocket(url, [], options);
const server = await createFlipperServerWithSocket(
socket,
socket as WebSocket,
(_state: FlipperServerState) => {},
);
return server;