move plugin management from ui-core to server-core
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
This commit is contained in:
committed by
Facebook GitHub Bot
parent
f9b72ac69e
commit
64747dc417
@@ -7,29 +7,21 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import {InstalledPluginDetails} from 'flipper-common';
|
||||
import {
|
||||
UpdatablePluginDetails,
|
||||
UpdateResult,
|
||||
getPluginDetails,
|
||||
} from 'flipper-common';
|
||||
import {getInstalledPlugins} from './pluginInstaller';
|
||||
import semver from 'semver';
|
||||
import {getNpmHostedPlugins, NpmPackageDescriptor} from './getNpmHostedPlugins';
|
||||
import NpmApi from 'npm-api';
|
||||
import {getInstalledPluginDetails, getPluginDetails} from './getPluginDetails';
|
||||
import {getInstalledPluginDetails} from './getPluginDetails';
|
||||
import {getPluginVersionInstallationDir} from './pluginPaths';
|
||||
import pmap from 'p-map';
|
||||
import {notNull} from './typeUtils';
|
||||
const npmApi = new NpmApi();
|
||||
|
||||
export type UpdateResult =
|
||||
| {kind: 'not-installed'; version: string}
|
||||
| {kind: 'up-to-date'}
|
||||
| {kind: 'error'; error: Error}
|
||||
| {kind: 'update-available'; version: string};
|
||||
|
||||
export type UpdatablePlugin = {
|
||||
updateStatus: UpdateResult;
|
||||
};
|
||||
|
||||
export type UpdatablePluginDetails = InstalledPluginDetails & UpdatablePlugin;
|
||||
|
||||
export async function getUpdatablePlugins(
|
||||
query?: string,
|
||||
): Promise<UpdatablePluginDetails[]> {
|
||||
|
||||
Reference in New Issue
Block a user