Remove plugin bundling
Summary: Remove the notion of bundled plugins Reviewed By: lblasa Differential Revision: D39308888 fbshipit-source-id: aa88ddbf2801ad1da95f89e4c761259b697b0d66
This commit is contained in:
committed by
Facebook GitHub Bot
parent
f835e07c46
commit
650ff4bcfb
@@ -55,7 +55,6 @@ Object {
|
||||
|
||||
exports[`can create a Fake flipper with legacy wrapper 2`] = `
|
||||
Object {
|
||||
"bundledPlugins": Map {},
|
||||
"clientPlugins": Map {
|
||||
"TestPlugin" => SandyPluginDefinition {
|
||||
"details": Object {
|
||||
@@ -63,7 +62,6 @@ Object {
|
||||
"entry": "./test/index.js",
|
||||
"id": "TestPlugin",
|
||||
"isActivatable": true,
|
||||
"isBundled": false,
|
||||
"main": "dist/bundle.js",
|
||||
"name": "flipper-plugin-hello",
|
||||
"pluginType": "client",
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
PlusOutlined,
|
||||
} from '@ant-design/icons';
|
||||
import {Alert, Button} from 'antd';
|
||||
import {BundledPluginDetails, DownloadablePluginDetails} from 'flipper-common';
|
||||
import {DownloadablePluginDetails} from 'flipper-common';
|
||||
import React, {useMemo} from 'react';
|
||||
import {useCallback} from 'react';
|
||||
import {useDispatch, useSelector} from 'react-redux';
|
||||
@@ -86,16 +86,12 @@ function InstallButton({
|
||||
plugin,
|
||||
type = 'primary',
|
||||
}: {
|
||||
plugin: DownloadablePluginDetails | BundledPluginDetails;
|
||||
plugin: DownloadablePluginDetails;
|
||||
type: 'link' | 'primary';
|
||||
}) {
|
||||
const dispatch = useDispatch();
|
||||
const installPlugin = useCallback(() => {
|
||||
if (plugin.isBundled) {
|
||||
dispatch(loadPlugin({plugin, enable: true, notifyIfFailed: true}));
|
||||
} else {
|
||||
dispatch(startPluginDownload({plugin, startedByUser: true}));
|
||||
}
|
||||
dispatch(startPluginDownload({plugin, startedByUser: true}));
|
||||
}, [plugin, dispatch]);
|
||||
const downloads = useSelector(getPluginDownloadStatusMap);
|
||||
const downloadStatus = useMemo(
|
||||
|
||||
@@ -140,7 +140,7 @@ class PluginDebugger extends Component<Props> {
|
||||
getRows(): Array<TableBodyRow> {
|
||||
const rows: Array<TableBodyRow> = [];
|
||||
|
||||
const externalPluginPath = (p: any) => (p.isBundled ? 'bundled' : p.entry);
|
||||
const externalPluginPath = (p: any) => p.entry;
|
||||
|
||||
this.props.gatekeepedPlugins.forEach((plugin) =>
|
||||
rows.push(
|
||||
|
||||
@@ -43,7 +43,6 @@ const samplePluginDetails1: UpdatablePluginDetails = {
|
||||
id: 'Hello',
|
||||
title: 'Hello',
|
||||
description: 'World?',
|
||||
isBundled: false,
|
||||
isActivatable: true,
|
||||
updateStatus: {
|
||||
kind: 'not-installed',
|
||||
@@ -63,7 +62,6 @@ const samplePluginDetails2: UpdatablePluginDetails = {
|
||||
id: 'World',
|
||||
title: 'World',
|
||||
description: 'Hello?',
|
||||
isBundled: false,
|
||||
isActivatable: true,
|
||||
updateStatus: {
|
||||
kind: 'not-installed',
|
||||
|
||||
@@ -168,34 +168,6 @@ test('uninstall plugin', async () => {
|
||||
expect(mockClient.sandyPluginStates.has('plugin1')).toBeFalsy();
|
||||
});
|
||||
|
||||
test('uninstall bundled plugin', async () => {
|
||||
const pluginDetails = TestUtils.createMockBundledPluginDetails({
|
||||
id: 'bundled-plugin',
|
||||
name: 'flipper-bundled-plugin',
|
||||
version: '0.43.0',
|
||||
});
|
||||
const pluginDefinition = new SandyPluginDefinition(pluginDetails, TestPlugin);
|
||||
mockedRequirePlugin.mockReturnValue(Promise.resolve(pluginDefinition));
|
||||
mockFlipper.dispatch(
|
||||
loadPlugin({plugin: pluginDetails, enable: true, notifyIfFailed: false}),
|
||||
);
|
||||
mockFlipper.dispatch(uninstallPlugin({plugin: pluginDefinition}));
|
||||
|
||||
await awaitPluginCommandQueueEmpty(mockFlipper.store);
|
||||
expect(
|
||||
mockFlipper.getState().plugins.clientPlugins.has('bundled-plugin'),
|
||||
).toBeFalsy();
|
||||
expect(
|
||||
mockFlipper.getState().plugins.loadedPlugins.has('bundled-plugin'),
|
||||
).toBeFalsy();
|
||||
expect(
|
||||
mockFlipper
|
||||
.getState()
|
||||
.plugins.uninstalledPluginNames.has('flipper-bundled-plugin'),
|
||||
).toBeTruthy();
|
||||
expect(mockClient.sandyPluginStates.has('bundled-plugin')).toBeFalsy();
|
||||
});
|
||||
|
||||
test('star plugin', async () => {
|
||||
mockFlipper.dispatch(
|
||||
loadPlugin({plugin: pluginDetails1, enable: false, notifyIfFailed: false}),
|
||||
|
||||
@@ -38,7 +38,6 @@ const sampleInstalledPluginDetails: InstalledPluginDetails = {
|
||||
title: 'Sample',
|
||||
dir: '/Users/mock/.flipper/thirdparty/flipper-plugin-sample',
|
||||
entry: 'this/path/does not/exist',
|
||||
isBundled: false,
|
||||
isActivatable: true,
|
||||
};
|
||||
|
||||
@@ -112,7 +111,6 @@ test('requirePluginInternal loads valid Sandy plugin', async () => {
|
||||
expect(plugin.details).toMatchObject({
|
||||
flipperSDKVersion: '0.0.0',
|
||||
id: 'Sample',
|
||||
isBundled: false,
|
||||
main: 'dist/bundle.js',
|
||||
name: 'pluginID',
|
||||
source: 'src/index.js',
|
||||
@@ -170,7 +168,6 @@ test('requirePluginInternal loads valid Sandy Device plugin', async () => {
|
||||
expect(plugin.details).toMatchObject({
|
||||
flipperSDKVersion: '0.0.0',
|
||||
id: 'Sample',
|
||||
isBundled: false,
|
||||
main: 'dist/bundle.js',
|
||||
name: 'pluginID',
|
||||
source: 'src/index.js',
|
||||
|
||||
@@ -367,11 +367,6 @@ async function verifyPluginStatus(
|
||||
return [false, status];
|
||||
}
|
||||
break;
|
||||
case 'bundle_installable': {
|
||||
// For convenience, don't ask user to install bundled plugins, handle it directly
|
||||
await installBundledPlugin(store, pluginId, title);
|
||||
break;
|
||||
}
|
||||
case 'marketplace_installable': {
|
||||
if (!(await installMarketPlacePlugin(store, pluginId, title))) {
|
||||
return [false, status];
|
||||
@@ -384,30 +379,6 @@ async function verifyPluginStatus(
|
||||
}
|
||||
}
|
||||
|
||||
async function installBundledPlugin(
|
||||
store: Store,
|
||||
pluginId: string,
|
||||
title: string,
|
||||
) {
|
||||
const plugin = store.getState().plugins.bundledPlugins.get(pluginId);
|
||||
if (!plugin || !plugin.isBundled) {
|
||||
throw new Error(`Failed to find bundled plugin '${pluginId}'`);
|
||||
}
|
||||
const loadingDialog = Dialog.loading({
|
||||
title,
|
||||
message: `Loading plugin '${pluginId}'...`,
|
||||
});
|
||||
store.dispatch(loadPlugin({plugin, enable: true, notifyIfFailed: true}));
|
||||
try {
|
||||
await waitFor(
|
||||
store,
|
||||
() => getPluginStatus(store, pluginId)[0] !== 'bundle_installable',
|
||||
);
|
||||
} finally {
|
||||
loadingDialog.close();
|
||||
}
|
||||
}
|
||||
|
||||
async function installMarketPlacePlugin(
|
||||
store: Store,
|
||||
pluginId: string,
|
||||
|
||||
@@ -183,9 +183,7 @@ function uninstallPlugin(store: Store, {plugin}: UninstallPluginActionPayload) {
|
||||
clients.forEach((client) => {
|
||||
stopPlugin(client, plugin.id);
|
||||
});
|
||||
if (!plugin.details.isBundled) {
|
||||
unloadPluginModule(plugin.details);
|
||||
}
|
||||
unloadPluginModule(plugin.details);
|
||||
store.dispatch(pluginUninstalled(plugin.details));
|
||||
} catch (err) {
|
||||
console.error(
|
||||
@@ -368,9 +366,5 @@ function stopPlugin(
|
||||
}
|
||||
|
||||
function unloadPluginModule(plugin: ActivatablePluginDetails) {
|
||||
if (plugin.isBundled) {
|
||||
// We cannot unload bundled plugin.
|
||||
return;
|
||||
}
|
||||
getRenderHostInstance().unloadModule?.(plugin.entry);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ import {
|
||||
addDisabledPlugins,
|
||||
addFailedPlugins,
|
||||
registerLoadedPlugins,
|
||||
registerBundledPlugins,
|
||||
registerMarketplacePlugins,
|
||||
pluginsInitialized,
|
||||
} from '../reducers/plugins';
|
||||
@@ -73,7 +72,6 @@ class UIPluginInitializer extends AbstractPluginInitializer {
|
||||
);
|
||||
}
|
||||
|
||||
this.store.dispatch(registerBundledPlugins(this.bundledPlugins));
|
||||
this.store.dispatch(registerLoadedPlugins(this.loadedPlugins));
|
||||
this.store.dispatch(addGatekeepedPlugins(this.gatekeepedPlugins));
|
||||
this.store.dispatch(addDisabledPlugins(this.disabledPlugins));
|
||||
|
||||
@@ -110,7 +110,6 @@ export abstract class FlipperBasePlugin<
|
||||
static version: string = '';
|
||||
static icon: string | null = null;
|
||||
static gatekeeper: string | null = null;
|
||||
static isBundled: boolean;
|
||||
static details: ActivatablePluginDetails;
|
||||
static keyboardActions: KeyboardActions | null;
|
||||
static screenshot: string | null;
|
||||
|
||||
@@ -37,7 +37,6 @@ test('add clientPlugin', () => {
|
||||
devicePlugins: new Map(),
|
||||
clientPlugins: new Map(),
|
||||
loadedPlugins: new Map(),
|
||||
bundledPlugins: new Map(),
|
||||
gatekeepedPlugins: [],
|
||||
failedPlugins: [],
|
||||
disabledPlugins: [],
|
||||
@@ -58,7 +57,6 @@ test('add devicePlugin', () => {
|
||||
devicePlugins: new Map(),
|
||||
clientPlugins: new Map(),
|
||||
loadedPlugins: new Map(),
|
||||
bundledPlugins: new Map(),
|
||||
gatekeepedPlugins: [],
|
||||
failedPlugins: [],
|
||||
disabledPlugins: [],
|
||||
@@ -79,7 +77,6 @@ test('do not add plugin twice', () => {
|
||||
devicePlugins: new Map(),
|
||||
clientPlugins: new Map(),
|
||||
loadedPlugins: new Map(),
|
||||
bundledPlugins: new Map(),
|
||||
gatekeepedPlugins: [],
|
||||
failedPlugins: [],
|
||||
disabledPlugins: [],
|
||||
@@ -103,7 +100,6 @@ test('add gatekeeped plugin', () => {
|
||||
specVersion: 2,
|
||||
pluginType: 'client',
|
||||
source: 'src/index.ts',
|
||||
isBundled: false,
|
||||
isActivatable: true,
|
||||
main: 'lib/index.js',
|
||||
title: 'test',
|
||||
@@ -116,7 +112,6 @@ test('add gatekeeped plugin', () => {
|
||||
devicePlugins: new Map(),
|
||||
clientPlugins: new Map(),
|
||||
loadedPlugins: new Map(),
|
||||
bundledPlugins: new Map(),
|
||||
gatekeepedPlugins: [],
|
||||
failedPlugins: [],
|
||||
disabledPlugins: [],
|
||||
@@ -143,7 +138,6 @@ const EXAMPLE_PLUGIN = {
|
||||
dir: '/plugins/test',
|
||||
specVersion: 2,
|
||||
source: 'src/index.ts',
|
||||
isBundled: false,
|
||||
isActivatable: true,
|
||||
main: 'lib/index.js',
|
||||
title: 'test',
|
||||
|
||||
@@ -15,7 +15,6 @@ import type {
|
||||
import type {
|
||||
DownloadablePluginDetails,
|
||||
ActivatablePluginDetails,
|
||||
BundledPluginDetails,
|
||||
InstalledPluginDetails,
|
||||
MarketplacePluginDetails,
|
||||
} from 'flipper-common';
|
||||
@@ -30,7 +29,6 @@ type StateV1 = {
|
||||
devicePlugins: DevicePluginMap;
|
||||
clientPlugins: ClientPluginMap;
|
||||
loadedPlugins: Map<string, ActivatablePluginDetails>;
|
||||
bundledPlugins: Map<string, BundledPluginDetails>;
|
||||
gatekeepedPlugins: Array<ActivatablePluginDetails>;
|
||||
disabledPlugins: Array<ActivatablePluginDetails>;
|
||||
failedPlugins: Array<[ActivatablePluginDetails, string]>;
|
||||
@@ -88,10 +86,6 @@ export type Action =
|
||||
type: 'REGISTER_LOADED_PLUGINS';
|
||||
payload: Array<ActivatablePluginDetails>;
|
||||
}
|
||||
| {
|
||||
type: 'REGISTER_BUNDLED_PLUGINS';
|
||||
payload: Array<BundledPluginDetails>;
|
||||
}
|
||||
| {
|
||||
type: 'REGISTER_INSTALLED_PLUGINS';
|
||||
payload: InstalledPluginDetails[];
|
||||
@@ -116,7 +110,6 @@ const INITIAL_STATE: State = {
|
||||
devicePlugins: new Map(),
|
||||
clientPlugins: new Map(),
|
||||
loadedPlugins: new Map(),
|
||||
bundledPlugins: new Map(),
|
||||
gatekeepedPlugins: [],
|
||||
disabledPlugins: [],
|
||||
failedPlugins: [],
|
||||
@@ -175,11 +168,6 @@ export default function reducer(
|
||||
...state,
|
||||
loadedPlugins: new Map(action.payload.map((p) => [p.id, p])),
|
||||
};
|
||||
} else if (action.type === 'REGISTER_BUNDLED_PLUGINS') {
|
||||
return {
|
||||
...state,
|
||||
bundledPlugins: new Map(action.payload.map((p) => [p.id, p])),
|
||||
};
|
||||
} else if (action.type === 'REGISTER_INSTALLED_PLUGINS') {
|
||||
return produce(state, (draft) => {
|
||||
draft.installedPlugins.clear();
|
||||
@@ -270,13 +258,6 @@ export const registerLoadedPlugins = (
|
||||
payload,
|
||||
});
|
||||
|
||||
export const registerBundledPlugins = (
|
||||
payload: Array<BundledPluginDetails>,
|
||||
): Action => ({
|
||||
type: 'REGISTER_BUNDLED_PLUGINS',
|
||||
payload,
|
||||
});
|
||||
|
||||
export const registerInstalledPlugins = (
|
||||
payload: InstalledPluginDetails[],
|
||||
): Action => ({
|
||||
|
||||
@@ -35,7 +35,6 @@ import {
|
||||
switchPlugin,
|
||||
uninstallPlugin,
|
||||
} from '../../reducers/pluginManager';
|
||||
import {BundledPluginDetails} from 'flipper-common';
|
||||
import {reportUsage} from 'flipper-common';
|
||||
import ConnectivityStatus from './fb-stubs/ConnectivityStatus';
|
||||
import {useSelector} from 'react-redux';
|
||||
@@ -73,14 +72,8 @@ export const PluginList = memo(function PluginList({
|
||||
const isArchived = activeDevice?.isArchived;
|
||||
|
||||
const annotatedDownloadablePlugins = useMemoize<
|
||||
[
|
||||
Record<string, DownloadablePluginState>,
|
||||
(DownloadablePluginDetails | BundledPluginDetails)[],
|
||||
],
|
||||
[
|
||||
plugin: DownloadablePluginDetails | BundledPluginDetails,
|
||||
downloadStatus?: PluginDownloadStatus,
|
||||
][]
|
||||
[Record<string, DownloadablePluginState>, DownloadablePluginDetails[]],
|
||||
[plugin: DownloadablePluginDetails, downloadStatus?: PluginDownloadStatus][]
|
||||
>(
|
||||
(downloads, downloadablePlugins) => {
|
||||
const downloadMap = new Map(
|
||||
@@ -137,11 +130,7 @@ export const PluginList = memo(function PluginList({
|
||||
(id: string) => {
|
||||
const plugin = downloadablePlugins.find((p) => p.id === id)!;
|
||||
reportUsage('plugin:install', {version: plugin.version}, plugin.id);
|
||||
if (plugin.isBundled) {
|
||||
dispatch(loadPlugin({plugin, enable: true, notifyIfFailed: true}));
|
||||
} else {
|
||||
dispatch(startPluginDownload({plugin, startedByUser: true}));
|
||||
}
|
||||
dispatch(startPluginDownload({plugin, startedByUser: true}));
|
||||
},
|
||||
[downloadablePlugins, dispatch],
|
||||
);
|
||||
|
||||
@@ -86,7 +86,6 @@ export const getPluginLists = createSelector(
|
||||
plugins: {
|
||||
clientPlugins,
|
||||
devicePlugins,
|
||||
bundledPlugins,
|
||||
marketplacePlugins,
|
||||
loadedPlugins,
|
||||
disabledPlugins,
|
||||
@@ -96,7 +95,6 @@ export const getPluginLists = createSelector(
|
||||
}: State) => ({
|
||||
clientPlugins,
|
||||
devicePlugins,
|
||||
bundledPlugins,
|
||||
marketplacePlugins,
|
||||
loadedPlugins,
|
||||
disabledPlugins,
|
||||
|
||||
@@ -776,7 +776,6 @@ test('test determinePluginsToProcess for mutilple clients having plugins present
|
||||
['RandomPlugin', TestPlugin.details],
|
||||
['TestDevicePlugin', TestDevicePlugin.details],
|
||||
]),
|
||||
bundledPlugins: new Map(),
|
||||
gatekeepedPlugins: [],
|
||||
disabledPlugins: [],
|
||||
failedPlugins: [],
|
||||
@@ -851,7 +850,6 @@ test('test determinePluginsToProcess for no selected plugin present in any clien
|
||||
['RandomPlugin', TestPlugin.details],
|
||||
['TestDevicePlugin', TestDevicePlugin.details],
|
||||
]),
|
||||
bundledPlugins: new Map(),
|
||||
gatekeepedPlugins: [],
|
||||
disabledPlugins: [],
|
||||
failedPlugins: [],
|
||||
@@ -905,7 +903,6 @@ test('test determinePluginsToProcess for multiple clients on same device', async
|
||||
['TestPlugin', TestPlugin.details],
|
||||
['TestDevicePlugin', TestDevicePlugin.details],
|
||||
]),
|
||||
bundledPlugins: new Map(),
|
||||
gatekeepedPlugins: [],
|
||||
disabledPlugins: [],
|
||||
failedPlugins: [],
|
||||
@@ -998,7 +995,6 @@ test('test determinePluginsToProcess for multiple clients on different device',
|
||||
['TestPlugin', TestPlugin.details],
|
||||
['TestDevicePlugin', TestDevicePlugin.details],
|
||||
]),
|
||||
bundledPlugins: new Map(),
|
||||
gatekeepedPlugins: [],
|
||||
disabledPlugins: [],
|
||||
failedPlugins: [],
|
||||
@@ -1085,7 +1081,6 @@ test('test determinePluginsToProcess to ignore archived clients', async () => {
|
||||
['TestPlugin', TestPlugin.details],
|
||||
['TestDevicePlugin', TestDevicePlugin.details],
|
||||
]),
|
||||
bundledPlugins: new Map(),
|
||||
gatekeepedPlugins: [],
|
||||
disabledPlugins: [],
|
||||
failedPlugins: [],
|
||||
|
||||
@@ -26,13 +26,6 @@ export function isPluginVersionMoreRecent(
|
||||
if (semver.gt(versionDetails.version, otherVersionDetails.version)) {
|
||||
return true;
|
||||
}
|
||||
if (
|
||||
semver.eq(versionDetails.version, otherVersionDetails.version) &&
|
||||
versionDetails.isBundled
|
||||
) {
|
||||
// prefer bundled versions
|
||||
return true;
|
||||
}
|
||||
if (
|
||||
semver.eq(versionDetails.version, otherVersionDetails.version) &&
|
||||
versionDetails.isActivatable &&
|
||||
|
||||
@@ -17,7 +17,6 @@ import {
|
||||
import type Client from '../Client';
|
||||
import type {
|
||||
ActivatablePluginDetails,
|
||||
BundledPluginDetails,
|
||||
DownloadablePluginDetails,
|
||||
PluginDetails,
|
||||
} from 'flipper-common';
|
||||
@@ -30,7 +29,7 @@ export type PluginLists = {
|
||||
enabledPlugins: PluginDefinition[];
|
||||
disabledPlugins: PluginDefinition[];
|
||||
unavailablePlugins: [plugin: PluginDetails, reason: string][];
|
||||
downloadablePlugins: (DownloadablePluginDetails | BundledPluginDetails)[];
|
||||
downloadablePlugins: DownloadablePluginDetails[];
|
||||
};
|
||||
|
||||
export type ActivePluginListItem =
|
||||
@@ -46,7 +45,7 @@ export type ActivePluginListItem =
|
||||
}
|
||||
| {
|
||||
status: 'uninstalled';
|
||||
details: DownloadablePluginDetails | BundledPluginDetails;
|
||||
details: DownloadablePluginDetails;
|
||||
}
|
||||
| {
|
||||
status: 'unavailable';
|
||||
@@ -162,7 +161,6 @@ export function computePluginLists(
|
||||
>,
|
||||
plugins: Pick<
|
||||
State['plugins'],
|
||||
| 'bundledPlugins'
|
||||
| 'marketplacePlugins'
|
||||
| 'loadedPlugins'
|
||||
| 'devicePlugins'
|
||||
@@ -180,12 +178,12 @@ export function computePluginLists(
|
||||
enabledPlugins: PluginDefinition[];
|
||||
disabledPlugins: PluginDefinition[];
|
||||
unavailablePlugins: [plugin: PluginDetails, reason: string][];
|
||||
downloadablePlugins: (DownloadablePluginDetails | BundledPluginDetails)[];
|
||||
downloadablePlugins: DownloadablePluginDetails[];
|
||||
} {
|
||||
const enabledDevicePluginsState = connections.enabledDevicePlugins;
|
||||
const enabledPluginsState = connections.enabledPlugins;
|
||||
const uninstalledMarketplacePlugins = getLatestCompatibleVersionOfEachPlugin(
|
||||
[...plugins.bundledPlugins.values(), ...plugins.marketplacePlugins],
|
||||
[...plugins.marketplacePlugins],
|
||||
getAppVersion(),
|
||||
).filter((p) => !plugins.loadedPlugins.has(p.id));
|
||||
const devicePlugins: PluginDefinition[] = [...plugins.devicePlugins.values()]
|
||||
@@ -205,10 +203,7 @@ export function computePluginLists(
|
||||
)
|
||||
.filter((p) => !enabledDevicePluginsState.has(p.id));
|
||||
const unavailablePlugins: [plugin: PluginDetails, reason: string][] = [];
|
||||
const downloadablePlugins: (
|
||||
| DownloadablePluginDetails
|
||||
| BundledPluginDetails
|
||||
)[] = [];
|
||||
const downloadablePlugins: DownloadablePluginDetails[] = [];
|
||||
|
||||
if (device) {
|
||||
// find all device plugins that aren't part of the current device / metro
|
||||
@@ -431,7 +426,6 @@ export type PluginStatus =
|
||||
| 'unknown'
|
||||
| 'failed'
|
||||
| 'gatekeeped'
|
||||
| 'bundle_installable'
|
||||
| 'marketplace_installable';
|
||||
|
||||
export function getPluginStatus(
|
||||
@@ -452,9 +446,6 @@ export function getPluginStatus(
|
||||
if (failedPluginEntry) {
|
||||
return ['failed', failedPluginEntry[1]];
|
||||
}
|
||||
if (state.bundledPlugins.has(id)) {
|
||||
return ['bundle_installable'];
|
||||
}
|
||||
if (state.marketplacePlugins.find((d) => d.id === id)) {
|
||||
return ['marketplace_installable'];
|
||||
}
|
||||
|
||||
@@ -56,7 +56,6 @@ export function createMockDownloadablePluginDetails(
|
||||
version: version,
|
||||
downloadUrl: `http://localhost/${lowercasedID}/${version}`,
|
||||
lastUpdated: lastUpdated,
|
||||
isBundled: false,
|
||||
isActivatable: false,
|
||||
isEnabledByDefault: false,
|
||||
};
|
||||
@@ -69,7 +68,6 @@ export function createMockActivatablePluginDetails(
|
||||
return {
|
||||
id: 'Hello',
|
||||
specVersion: 2,
|
||||
isBundled: false,
|
||||
isActivatable: true,
|
||||
dir: '/Users/mock/.flipper/thirdparty/flipper-plugin-sample1',
|
||||
entry: './test/index.js',
|
||||
|
||||
Reference in New Issue
Block a user