change server build process to respect babel transforms

Summary:
The build process for the server was a simple ts-node that compiled all deps. However, that didn't do any source transformations we need, like replacing `fb-stubs` with `fb` in facebook builds.

This diff works out the dev build process to align more with how other parts of the code base is build, by starting metro to build and bundle the server (only the sources of flipper-server, flipper-server-core and other flipper packages are bundled, node-deps are left as is).

To achieve this, since metro doesn't have support for 'external' packages like any arbitrarily other bundler, we recycle the electronRequire work around that is used in the desktop app as well

Reviewed By: aigoncharov

Differential Revision: D32949677

fbshipit-source-id: 00d326bb17b68aece6fb43af98d0def13b335e74
This commit is contained in:
Michel Weststrate
2021-12-13 05:46:42 -08:00
committed by Facebook GitHub Bot
parent 1ffd845fb2
commit ae56f2b62f
15 changed files with 352 additions and 153 deletions

View File

@@ -38,11 +38,11 @@ export function initializeRenderHost(
hasFocus() {
return document.hasFocus();
},
onIpcEvent(event) {
console.warn('onIpcEvent not available', event);
onIpcEvent(_event) {
// no-op
},
sendIpcEvent(event, ..._args: any[]) {
console.warn('sendIpcEvent not available', event);
sendIpcEvent(_event, ..._args: any[]) {
// no-op
},
shouldUseDarkColors() {
return !!(