Commit Graph

3 Commits

Author SHA1 Message Date
Daniel Büchele
db9bc985eb redirecting console to stderr
Summary:
Wrapping console to send all console.logs to stderr, as we are planning to use stdout for the actual data.
By default only console.error messages are logged. I will add a `-v` argument to show all.

Also, displaying some ASCII-art and the version number when starting flipper CLI.

Reviewed By: passy

Differential Revision: D13843675

fbshipit-source-id: acaa70d16f12965a8426abca506049dbafb7962c
2019-02-04 07:29:13 -08:00
Daniel Büchele
5b68c59b5c package bundle
Summary:
For the electron build, plugins are bundled with the app and loaded from there at launch. The headless version can't require from its binary, so plugins need to be required from another path.

This diff makes the path where bundled plugins are loaded from adjustable via an environment variable: `BUNDLED_PLUGIN_PATH`. If it's set, the plugins are loaded from this path, otherwise we default to the old behaviour of including them from `./defaultPlugins`.

For the headless version we expect the plugins to be in a folder called `plugins` next to the executable. This should later be configurable via an argument passed to the CLI.

Reviewed By: passy

Differential Revision: D13843676

fbshipit-source-id: 04237ae6631b4f2ba56887fe992a56f860724edc
2019-02-04 07:29:13 -08:00
Daniel Büchele
dab50ec5c4 add headless entry point
Summary:
Adding `headless/index.js` This is the entry point to the headless version of Flipper.

This creates a redux store, and initializes the dispatchers. As all business logic (adb connections, etc.) are managed by dispatchers, this spins up a working version of Flipper, listening on our ports, allowing connections to devices.

For APIs not available in node.js, we are adding polyfills. `WebSocket` is used by redux-devtools, `fetch` is used in a couple of places throughout the application. These polyfills are added to the global namespace, so the app can run the same as in the browser.

Reviewed By: passy

Differential Revision: D13786573

fbshipit-source-id: 685f67e1c0d2948de7c43b8a1e2dc10dc69aa743
2019-01-25 12:19:07 -08:00