Commit Graph

10 Commits

Author SHA1 Message Date
Pritesh Nandgaonkar
af317eed2b Export and import all the nodes
Summary:
This diff does the following

- Support to export the entire view hierarchy for iOS
- Android is not supported yet
- This diff adds a call `getAllNodes` to the client side of iOS, which returns the entire view hierarchy
- Currently the search doesn't work on the imported layout plugin data. Also the imported layout plugin data doesn't expand the way it does when component is mounted, reason being the client passed to the plugin is not functional for the archived case

I will work on fixing the last points in the next diffs stacked on the current one.

For Android:
- Currently the export function will export whatever is currently displayed on the Flipper app, not the entire view hierarchy

Support for Android will also come up in later diffs.

Reviewed By: jknoxville

Differential Revision: D14209157

fbshipit-source-id: 3ad3e39edfd994913dc19cc239bfbbe011a9757c
2019-02-28 09:40:50 -08:00
John Knox
8ff4c4f56d Remove duplicate Logger in headless/index.js
Summary:
init() was being misused. This returns a Logger instance, so there's no need to create one as well.
This was a problem because different arguments were being passed to each (isHeadless in this case).

Reviewed By: passy

Differential Revision: D14083320

fbshipit-source-id: b0001a2b3cdd914609d54382575e3b0fa4b5f077
2019-02-14 09:23:41 -08:00
John Knox
c912dcaf48 Add isHeadless attribute to scribe messages
Summary:
So we can distinguish between humans and the machines.

We can redirect the traffic to different tables based on this attribute if necessary.

Reviewed By: danielbuechele

Differential Revision: D14025004

fbshipit-source-id: c3a24b5f8a30f24445eaee67843b78ddabfc9d51
2019-02-12 08:29:20 -08:00
Daniel Büchele
cb6c7bb137 yargs add .argv to fix CLI
Summary:
CLI was not working:
- setup now needs an object with arguments passed
- the `argv` property is needed by `yargs` to work in node: http://yargs.js.org/docs/#api-argv

Reviewed By: passy

Differential Revision: D13991958

fbshipit-source-id: a9432b27f3d4d24c1e43014b8fb87dca806a6e8a
2019-02-08 09:14:45 -08:00
Pascal Hartig
74a726aaf9 Use yargs for non-headless Flipper args parsing
Summary:
This seems like a better approach than ad-hoc lookup in
`electron.remove.argv`. Left a note to a task to provide
a better interface to this.

I also need this in order to ensure we're starting
Flipper through the launcher which needs to happen
before we start the Electron runtime.

Reviewed By: jknoxville

Differential Revision: D13881355

fbshipit-source-id: 69c70d71035a47084f789ddb4dc969b45ba4648b
2019-02-05 04:49:38 -08:00
Daniel Büchele
3b75fb092b output data on stdout
Summary: listening on `SIGINT` events and putting the serialized store to stdout.

Reviewed By: passy

Differential Revision: D13878051

fbshipit-source-id: 19c1d857a299ed9a474605169c54e5359e0515bd
2019-02-04 07:29:13 -08:00
Daniel Büchele
45d1a7b35c add command line options
Summary: Adding options for the CLI

Reviewed By: passy

Differential Revision: D13864405

fbshipit-source-id: 1900c32833c7d18a4806f2a839215b5b536cb44f
2019-02-04 07:29:13 -08:00
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