Summary:
Follow up of D32665064, this diff moves all plugin management logic from flipper-ui to flipper-server. Things like downloading, installing, querying new plugins.
Loading plugins is handled separately in the next diff.
Reviewed By: nikoant
Differential Revision: D32666537
fbshipit-source-id: 9786b82987f00180bb26200e38735b334dc4d5c3
Summary: Moved all types related to plugin descriptions from plugin-lib (which handles downloads and such) to flipper-common. The goal of that is to remove all plugin-lib usage from ui-core to server-core, so that the UI itself doesn't do any file operations anymore related to plugins. That will be done in next diffs, this just moves types but no code.
Reviewed By: nikoant, aigoncharov
Differential Revision: D32665064
fbshipit-source-id: 86d908e7264569b0229b09290a891171876c8e00
Summary:
When publishing a new flipper plugin, I realized my plugin wasn't showing up in the Plugin Installer search. This was due to a bug where we are only grabbing 50 plugins from NPM and filtering through them locally, instead of passing the search term to the search query. There are 59 plugins that match the keyword filter on npm so 9 plugins never get surfaced.
## Changelog
Fix missing plugins in plugin manager's NPM search
Pull Request resolved: https://github.com/facebook/flipper/pull/2377
Test Plan:
Test the search feature in Plugin Manager
Search for the previously missing package:

Previously working searches continue to work:

Reviewed By: nikoant
Differential Revision: D28831054
Pulled By: passy
fbshipit-source-id: 84442459cd760c3f593b3df5bb3d89d51852e1c4
Summary:
I've re-designed interfaces describing plugins as I found that mental overhead working with them became too expensive because of slightly flawed design. However this cascaded changes in many files so you can see how extensively these interfaces used in our codebase.
Before this change we had one interface PluginDetails which described three different entities: 1) plugins installed on the disk 2) plugins bundled into Flipper 3) plugins available on Marketplace. It's hard to use this "general" PluginDetails interface because of this as you always need to think about all three use cases everywhere.
After this change we have 3 separate interfaces: InstalledPluginDetails, BundledPluginDetails and DownloadablePluginDetails and things became much type-safer now.
Reviewed By: mweststrate
Differential Revision: D25530383
fbshipit-source-id: b93593916a980c04e36dc6ffa168797645a0ff9c
Summary:
This diff changes directory structure for installed plugins to allow installation of multiple versions simultaneously, e.g. to to allow downloading new plugin version while user is still using the previous one, and to have possibility of fast rollback to the previous installed if necessary. The new folder for installed plugins is located in `~/.flipper/installed-plugins` and has the following structure:
flipper-plugin-reactotron
1.0.0
...
package.json
1.0.1
...
package.json
flipper-plugin-network
0.67.1
...
package.json
0.67.2
...
package.json
The tricky part here is that we also need to migrate already installed plugins from the old folder `~/.flipper/thirdparty` to the new folder and maintain the new structure for them.
Another tricky part is that we need to periodically cleanup old versions. For now we will just keep 2 versions of each plugin. Cleanup is performed in background right after Flipper startup.
Reviewed By: mweststrate
Differential Revision: D25393474
fbshipit-source-id: 26617ac26114148f797cc3d6765a42242edc205e
Summary: Extracted plugin marketplace API to a separate file and updated it to load full plugin manifests.
Reviewed By: passy
Differential Revision: D25181759
fbshipit-source-id: a63f9ce16249ccc170df148cef5c209fdc6d4d6d
Summary: I accidently broke search by query in a previous diff, so fixing it here
Reviewed By: passy
Differential Revision: D23842187
fbshipit-source-id: 9fcc7a46048ff99e1bf26c8a70ef0240b38018cb
Summary:
Do not list plugins packaged with format v1 in Plugin Manager.
Changelog: removed support for plugins packaged using legacy format (v1), so they won't appear in Plugin Manager anymore.
Reviewed By: passy
Differential Revision: D23681402
fbshipit-source-id: 1c9496ba6b739069d67228a0f4250f2f01aabd4d
Summary:
Sorry for so long diff, but actually there are no functional changes, just refactoring to make further changes of Plugin Manager easier to understand.
I've de-coupled the code related to plugin management from UI code and moved it from PluginInstaller UI component (which will be replaced soon by new UI) to "flipper-plugin-lib". So pretty much everything related to plugin discovery and installation now consolidated in this package.
Additionally, this refactoring enables re-using of plugin management code in "flipper-pkg", e.g. to create CLI command for plugin installation from NPM, e.g.: `flipper-pkg install flipper-plugin-reactotron`.
Reviewed By: passy
Differential Revision: D23679346
fbshipit-source-id: 82e7b9de9afa08c508c1b228c2038b4ba423571c