Skip to content

Commit

Permalink
Set up Flipper decapitated packages
Browse files Browse the repository at this point in the history
Summary:
This diff introduces the packages necessary for Flipper decapitated.

* flipper-common: utilities & types shared between client, server, flipper-plugin
* flipper-server-core: all device & client management goes in here. Basically flipper's backend
* flipper-ui-core: all UI goes in here, as far as it doesn't depend on Electron
* desktop: the Electron app, will load server-core and ui-core, and glue them together, providing implementations for some electron specific stuff like dialgos
* flipper-server: A node process hosting flipper-server-core, that can be connected to over websockets. And probably can serve a browser version of the UI as well.
* flipper-ui-browser: thin wrapper around flipper-ui-core, providing some browser specific behavior / stubs.
* flipper-dump: (might remove later), but want to hack a quick and dirt flipper dump in here, as alternative way to test flipper-server-core.

This diff just creates the packages, but doesn't move any code, so it can be summarized as:

restoftheowl

Reviewed By: nikoant

Differential Revision: D30218646

fbshipit-source-id: 735598a1261a98e584f52504b5eba01ec0afa162
  • Loading branch information
mweststrate authored and facebook-github-bot committed Oct 8, 2021
1 parent 99acd76 commit c3ff0ff
Show file tree
Hide file tree
Showing 32 changed files with 401 additions and 5 deletions.
41 changes: 41 additions & 0 deletions desktop/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Flipper Desktop

This folder contains everything to run the Flipper 'Desktop', that is, the UI which you use to interact with the device / app under debug.

### Packages provided here:

* flipper-common: utilities & types shared between client, server, flipper-plugin
* flipper-server-core: all device & client management goes in here. Basically flipper's backend
* flipper-ui-core: all UI goes in here, as far as it doesn't depend on Electron
* flipper-ui-electron: the Electron app, will load server-core and ui-core, and glue them together, providing implementations for some electron * specific stuff like dialgos
* flipper-server: A node process hosting flipper-server-core, that can be connected to over websockets. And probably can serve a browser version of the UI as well.
* flipper-ui-browser: thin wrapper around flipper-ui-core, providing some browser specific behavior / stubs.
* flipper-dump: (might remove later), but want to hack a quick and dirt flipper dump in here, as alternative way to test flipper-server-core.
* flipper-plugin: The flipper SDK used by plugins. Exposes all API's that can be used by plugins
* pkg: CLI tool to manage building flipper plugins
* pkg-lib
* plugin-lib
* babel-transformer
* doctor
* eslint-plugin-flipper

### Packages overview

```
flipper-ui-electron:
- flipper-server-core (directly embedded)
- flipper-ui-core
- plugins (prebundled)
- plugins (installable)
- flipper-plugin
flipper-server
- flipper-server-core
- flipper-ui-browser (served by webserver)
- flipper-ui-core (communicates using WebSocket with server-core)
- plugins (prebundled)
- plugins (installable)?
flipper-dump
- flipper-server-core
```
2 changes: 2 additions & 0 deletions desktop/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
"flipper-doctor": "0.0.0",
"flipper-plugin": "0.0.0",
"flipper-plugin-lib": "0.0.0",
"flipper-server-core": "0.0.0",
"flipper-ui-core": "0.0.0",
"fs-extra": "^10.0.0",
"immer": "^9.0.6",
"invariant": "^2.2.2",
Expand Down
3 changes: 3 additions & 0 deletions desktop/app/src/init.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ import {getVersionString} from './utils/versionString';
import {PersistGate} from 'redux-persist/integration/react';
// eslint-disable-next-line flipper/no-electron-remote-imports
import {ipcRenderer, remote} from 'electron';
import {helloWorld} from 'flipper-server-core';

helloWorld();

if (process.env.NODE_ENV === 'development' && os.platform() === 'darwin') {
// By default Node.JS has its internal certificate storage and doesn't use
Expand Down
15 changes: 10 additions & 5 deletions desktop/app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,18 @@
{
"path": "../doctor"
},
{
"path": "../flipper-common"
},
{
"path": "../flipper-plugin"
},
{
"path": "../flipper-server-core"
},
{
"path": "../flipper-ui-core"
},
{
"path": "../plugin-lib"
},
Expand All @@ -23,9 +32,5 @@
"path": "../plugins/public/navigation"
}
],
"exclude": [
"**/node_modules/",
"**/__tests__/",
"**/lib/"
]
"exclude": ["**/node_modules/", "**/__tests__/", "**/lib/"]
}
3 changes: 3 additions & 0 deletions desktop/flipper-common/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# flipper-common

Utilities that are shared between flipper-ui, flipper-server and flipper-plugin.
27 changes: 27 additions & 0 deletions desktop/flipper-common/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "flipper-common",
"version": "0.0.0",
"description": "Server & UI shared Flipper utilities",
"repository": "facebook/flipper",
"main": "lib/index.js",
"flipperBundlerEntry": "src",
"types": "lib/index.d.ts",
"license": "MIT",
"bugs": "https://github.com/facebook/flipper/issues",
"dependencies": {},
"devDependencies": {},
"peerDependencies": {},
"scripts": {
"reset": "rimraf lib *.tsbuildinfo",
"build": "tsc -b",
"prepack": "yarn reset && yarn build"
},
"files": [
"lib/**/*"
],
"homepage": "https://github.com/facebook/flipper",
"keywords": [
"Flipper"
],
"author": "Facebook, Inc"
}
12 changes: 12 additions & 0 deletions desktop/flipper-common/src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/

export function helloWorld() {
return true;
}
8 changes: 8 additions & 0 deletions desktop/flipper-common/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "lib",
"rootDir": "src"
},
"references": []
}
3 changes: 3 additions & 0 deletions desktop/flipper-dump/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# flipper-dump (TBD)

Stand alone Flipper command, that uses flipper-server-core to connect to apps and dump all incoming messages.
28 changes: 28 additions & 0 deletions desktop/flipper-dump/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "flipper-dump",
"private": true,
"version": "0.0.0",
"description": "Flipper tool to dump data from clients",
"repository": "facebook/flipper",
"main": "lib/index.js",
"flipperBundlerEntry": "src",
"types": "lib/index.d.ts",
"license": "MIT",
"bugs": "https://github.com/facebook/flipper/issues",
"dependencies": {},
"devDependencies": {},
"peerDependencies": {},
"scripts": {
"reset": "rimraf lib *.tsbuildinfo",
"build": "tsc -b",
"prepack": "yarn reset && yarn build"
},
"files": [
"lib/**/*"
],
"homepage": "https://github.com/facebook/flipper",
"keywords": [
"Flipper"
],
"author": "Facebook, Inc"
}
12 changes: 12 additions & 0 deletions desktop/flipper-dump/src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/

export function helloWorld() {
return true;
}
12 changes: 12 additions & 0 deletions desktop/flipper-dump/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "lib",
"rootDir": "src"
},
"references": [
{
"path": "../flipper-server-core"
}
]
}
3 changes: 3 additions & 0 deletions desktop/flipper-plugin/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"references": [
{
"path": "../plugin-lib"
},
{
"path": "../flipper-common"
}
]
}
5 changes: 5 additions & 0 deletions desktop/flipper-server-core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# flipper-server-core

Package that manages connections with flipper clients, queries for adb/idb clients, accepts incoming websocket / rsocket connections and takes care of certificate exchange.

Used by Flipper desktop, flipper-server and flipper-dump
28 changes: 28 additions & 0 deletions desktop/flipper-server-core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "flipper-server-core",
"private": true,
"version": "0.0.0",
"description": "Flipper server connection SDK",
"repository": "facebook/flipper",
"main": "lib/index.js",
"flipperBundlerEntry": "src",
"types": "lib/index.d.ts",
"license": "MIT",
"bugs": "https://github.com/facebook/flipper/issues",
"dependencies": {},
"devDependencies": {},
"peerDependencies": {},
"scripts": {
"reset": "rimraf lib *.tsbuildinfo",
"build": "tsc -b",
"prepack": "yarn reset && yarn build"
},
"files": [
"lib/**/*"
],
"homepage": "https://github.com/facebook/flipper",
"keywords": [
"Flipper"
],
"author": "Facebook, Inc"
}
12 changes: 12 additions & 0 deletions desktop/flipper-server-core/src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/

export function helloWorld() {
return true;
}
12 changes: 12 additions & 0 deletions desktop/flipper-server-core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "lib",
"rootDir": "src"
},
"references": [
{
"path": "../flipper-common"
}
]
}
5 changes: 5 additions & 0 deletions desktop/flipper-server/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# flipper-server (TBD)

Stand alone Flipper server as NodeJS process, that uses flipper-server-core for device communication and also provides a webserver to serve flipper-ui.

Flipper-server can be used as background process, for example on CI servers or to power IDE plugins.
28 changes: 28 additions & 0 deletions desktop/flipper-server/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "flipper-server",
"private": true,
"version": "0.0.0",
"description": "Standalone nodeJS based Flipper server",
"repository": "facebook/flipper",
"main": "lib/index.js",
"flipperBundlerEntry": "src",
"types": "lib/index.d.ts",
"license": "MIT",
"bugs": "https://github.com/facebook/flipper/issues",
"dependencies": {},
"devDependencies": {},
"peerDependencies": {},
"scripts": {
"reset": "rimraf lib *.tsbuildinfo",
"build": "tsc -b",
"prepack": "yarn reset && yarn build"
},
"files": [
"lib/**/*"
],
"homepage": "https://github.com/facebook/flipper",
"keywords": [
"Flipper"
],
"author": "Facebook, Inc"
}
12 changes: 12 additions & 0 deletions desktop/flipper-server/src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/

export function helloWorld() {
return true;
}
12 changes: 12 additions & 0 deletions desktop/flipper-server/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "lib",
"rootDir": "src"
},
"references": [
{
"path": "../flipper-server-core"
}
]
}
3 changes: 3 additions & 0 deletions desktop/flipper-ui-browser/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# flipper-ui-browser (TBD)

Flippers UI, ready to be served to a webbrowser. Typically served by flipper-server. Leverages flipper-ui-core and binds the necessary features to the browser, such as file dialogs or menu's.
28 changes: 28 additions & 0 deletions desktop/flipper-ui-browser/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "flipper-ui-browser",
"private": true,
"version": "0.0.0",
"description": "Flipper's UI, packaged for the browser",
"repository": "facebook/flipper",
"main": "lib/index.js",
"flipperBundlerEntry": "src",
"types": "lib/index.d.ts",
"license": "MIT",
"bugs": "https://github.com/facebook/flipper/issues",
"dependencies": {},
"devDependencies": {},
"peerDependencies": {},
"scripts": {
"reset": "rimraf lib *.tsbuildinfo",
"build": "tsc -b",
"prepack": "yarn reset && yarn build"
},
"files": [
"lib/**/*"
],
"homepage": "https://github.com/facebook/flipper",
"keywords": [
"Flipper"
],
"author": "Facebook, Inc"
}
12 changes: 12 additions & 0 deletions desktop/flipper-ui-browser/src/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/

export function helloWorld() {
return true;
}
12 changes: 12 additions & 0 deletions desktop/flipper-ui-browser/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"outDir": "lib",
"rootDir": "src"
},
"references": [
{
"path": "../flipper-ui-core"
}
]
}
3 changes: 3 additions & 0 deletions desktop/flipper-ui-core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# flipper-ui-core (TBD)

Flipper's UI, agnostic of Electron vs Browser.
Loading

0 comments on commit c3ff0ff

Please sign in to comment.