setup webserver for flipper-server

Summary:
This sets up the metro bundler for flipper-server, to be able to serve the front end.

Note that this is a setup that is only relevant for development purposes

Done in this diff:

* setup metro
* setup fast refresh
* setup nodemon to be able to refresh on server changes

Not done in this diff

* Setup FlipperServerImpl in the flipper-server
* Load flipper-ui-core in flipper-ui-browser
* Load plugins
* Support options, env vars etc etc
* Make flipper-server stand alone (it is largely self contained, but still requires some static resources like theming)

Reviewed By: passy, aigoncharov

Differential Revision: D32626137

fbshipit-source-id: 47f580356ddf0993392d3b583082b187661727e9
This commit is contained in:
Michel Weststrate
2021-12-08 04:25:28 -08:00
committed by Facebook GitHub Bot
parent 2b81be6c29
commit 0dfc73da93
10 changed files with 759 additions and 18 deletions

View File

@@ -9,13 +9,27 @@
"types": "lib/index.d.ts",
"license": "MIT",
"bugs": "https://github.com/facebook/flipper/issues",
"dependencies": {},
"devDependencies": {},
"dependencies": {
"chalk": "^4.1.2",
"express": "^4.15.2",
"flipper-pkg-lib": "0.0.0",
"fs-extra": "^9.0.0",
"p-filter": "^2.1.0",
"socket.io": "^4.3.1"
},
"devDependencies": {
"@types/express": "^4.17.13",
"metro": "^0.66.2",
"nodemon": "^2.0.15",
"ts-node": "^9.1.1",
"typescript": "^4.4.4"
},
"peerDependencies": {},
"scripts": {
"reset": "rimraf lib *.tsbuildinfo",
"build": "tsc -b",
"prepack": "yarn reset && yarn build"
"prepack": "yarn reset && yarn build",
"start": "cross-env NODE_ENV=development nodemon --watch './src/*.tsx' --exec '../ts-node' src/index.tsx"
},
"files": [
"lib/**/*"