Summary: This sets up the initial infra that is to be used by plugin devs to test plugins. There is not much yet to see, as there is no state or message sending yet. But at least the life cycle of plugins can be test, things are strongly typed and everything is in the place where it should be :) N.b. the import difference with these utils and the createFlipperMock utilities in Flipper are 1. this testing infra is entirely inside flipper-plugin package, so that plugin devs don't need flipper as a dependency 2. this testing infra doesn't provide abstractions for plugin / device / client switching; it tests plugins purely in isolation of the rest of the world (except for firing `onConnect` / `onDisconnect` which is normally the effect of switching plugins) Reviewed By: nikoant Differential Revision: D22255262 fbshipit-source-id: b94ccbab720d2b49428a646aed3c55af71a5bc80
flipper-plugin
flipper-plugin is the dependency used by all modern Flipper plugins (project "Tommy").
For background: https://fb.quip.com/YHOGAnaPqAVJ
flipper-plugin is to be used as dev and peer dependency of all Flipper plugins. It provides:
- (TODO) Standard API's to interact with Flipper, such as the client connection.
- (TODO) Standard components to organize the UI
- (TODO) Testing utilities
API's provided by flipper-plugin are documented at fbflipper.com (TODO).
There should normally be no need to install flipper-plugin as dependency.
Rather, plugins should be scaffolded using npx flipper-pkg init (TODO) as documented here