Install plugin from package file
Summary: Adding a way to install plugins directly from package files. This is required for testing after packaging format changes. Stage 1: refactored the plugin manager component file layout, no functional changes. Reviewed By: jknoxville Differential Revision: D19741085 fbshipit-source-id: bd9d72382ddc4894de5b3cd9a71877c799886fbf
This commit is contained in:
committed by
Facebook Github Bot
parent
9280b3178d
commit
07bc0088ef
@@ -41,7 +41,7 @@ import {Logger} from './fb-interfaces/Logger';
|
|||||||
import BugReporter from './fb-stubs/BugReporter';
|
import BugReporter from './fb-stubs/BugReporter';
|
||||||
import {State as Store} from './reducers/index';
|
import {State as Store} from './reducers/index';
|
||||||
import {StaticView, FlipperError} from './reducers/connections';
|
import {StaticView, FlipperError} from './reducers/connections';
|
||||||
import PluginManager from './chrome/PluginManager';
|
import PluginManager from './chrome/plugin-manager/PluginManager';
|
||||||
import StatusBar from './chrome/StatusBar';
|
import StatusBar from './chrome/StatusBar';
|
||||||
import SettingsSheet from './chrome/SettingsSheet';
|
import SettingsSheet from './chrome/SettingsSheet';
|
||||||
import DoctorSheet from './chrome/DoctorSheet';
|
import DoctorSheet from './chrome/DoctorSheet';
|
||||||
|
|||||||
@@ -7,9 +7,9 @@
|
|||||||
* @format
|
* @format
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {PluginDefinition} from '../dispatcher/plugins';
|
import {PluginDefinition} from '../../dispatcher/plugins';
|
||||||
import Client from '../Client';
|
import Client from '../../Client';
|
||||||
import {TableBodyRow} from '../ui/components/table/types';
|
import {TableBodyRow} from '../../ui/components/table/types';
|
||||||
import React, {Component, Fragment} from 'react';
|
import React, {Component, Fragment} from 'react';
|
||||||
import {connect} from 'react-redux';
|
import {connect} from 'react-redux';
|
||||||
import {
|
import {
|
||||||
@@ -22,8 +22,8 @@ import {
|
|||||||
FlipperDevicePlugin,
|
FlipperDevicePlugin,
|
||||||
Bordered,
|
Bordered,
|
||||||
} from 'flipper';
|
} from 'flipper';
|
||||||
import StatusIndicator from '../ui/components/StatusIndicator';
|
import StatusIndicator from '../../ui/components/StatusIndicator';
|
||||||
import {State as Store} from '../reducers';
|
import {State as Store} from '../../reducers';
|
||||||
|
|
||||||
const InfoText = styled(Text)({
|
const InfoText = styled(Text)({
|
||||||
lineHeight: '130%',
|
lineHeight: '130%',
|
||||||
@@ -31,13 +31,13 @@ import {SearchIndex} from 'algoliasearch';
|
|||||||
import {SearchResponse} from '@algolia/client-search';
|
import {SearchResponse} from '@algolia/client-search';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import fs from 'fs-extra';
|
import fs from 'fs-extra';
|
||||||
import {reportPlatformFailures, reportUsage} from '../utils/metrics';
|
import {reportPlatformFailures, reportUsage} from '../../utils/metrics';
|
||||||
import restartFlipper from '../utils/restartFlipper';
|
import restartFlipper from '../../utils/restartFlipper';
|
||||||
import {
|
import {
|
||||||
PluginMap,
|
PluginMap,
|
||||||
PluginDefinition,
|
PluginDefinition,
|
||||||
registerInstalledPlugins,
|
registerInstalledPlugins,
|
||||||
} from '../reducers/pluginManager';
|
} from '../../reducers/pluginManager';
|
||||||
import {
|
import {
|
||||||
PLUGIN_DIR,
|
PLUGIN_DIR,
|
||||||
readInstalledPlugins,
|
readInstalledPlugins,
|
||||||
@@ -45,8 +45,8 @@ import {
|
|||||||
provideSearchIndex,
|
provideSearchIndex,
|
||||||
findPluginUpdates as _findPluginUpdates,
|
findPluginUpdates as _findPluginUpdates,
|
||||||
UpdateResult,
|
UpdateResult,
|
||||||
} from '../utils/pluginManager';
|
} from '../../utils/pluginManager';
|
||||||
import {State as AppState} from '../reducers';
|
import {State as AppState} from '../../reducers';
|
||||||
import {connect} from 'react-redux';
|
import {connect} from 'react-redux';
|
||||||
import {Dispatch, Action} from 'redux';
|
import {Dispatch, Action} from 'redux';
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {annotatePluginsWithUpdates} from '../PluginInstaller';
|
import {annotatePluginsWithUpdates} from '../PluginInstaller';
|
||||||
import {UpdateResult} from '../../utils/pluginManager';
|
import {UpdateResult} from '../../../utils/pluginManager';
|
||||||
|
|
||||||
test('annotatePluginsWithUpdates', async () => {
|
test('annotatePluginsWithUpdates', async () => {
|
||||||
const installedPlugins = new Map([
|
const installedPlugins = new Map([
|
||||||
@@ -34,7 +34,6 @@ test('dispatcher dispatches REGISTER_PLUGINS', () => {
|
|||||||
test('getDynamicPlugins returns empty array on errors', () => {
|
test('getDynamicPlugins returns empty array on errors', () => {
|
||||||
ipcRenderer.sendSync = jest.fn();
|
ipcRenderer.sendSync = jest.fn();
|
||||||
ipcRenderer.sendSync.mockImplementation(() => {
|
ipcRenderer.sendSync.mockImplementation(() => {
|
||||||
console.log('aaa');
|
|
||||||
throw new Error('ooops');
|
throw new Error('ooops');
|
||||||
});
|
});
|
||||||
const res = getDynamicPlugins();
|
const res = getDynamicPlugins();
|
||||||
|
|||||||
Reference in New Issue
Block a user