Simplify bundled plugin setup
Summary: Stop bundling plugins into Flipper Server bundles. In later diffs, we will start building all plugins even in dev mode which removes the need to bundle them. Reviewed By: lblasa Differential Revision: D39276249 fbshipit-source-id: 091405cfcf58aa7e1bd2b382da40f8d9841ae6b1
This commit is contained in:
committed by
Facebook GitHub Bot
parent
a67a4e5d0f
commit
a888e6affa
@@ -13,7 +13,6 @@ import tmp from 'tmp';
|
||||
import {promisify} from 'util';
|
||||
import {default as axios} from 'axios';
|
||||
import {
|
||||
BundledPluginDetails,
|
||||
DownloadablePluginDetails,
|
||||
ExecuteMessage,
|
||||
FlipperServerForServerAddOn,
|
||||
@@ -77,28 +76,6 @@ export class PluginManager {
|
||||
return await fs.readFile(path, 'utf8');
|
||||
}
|
||||
|
||||
async getBundledPlugins(): Promise<Array<BundledPluginDetails>> {
|
||||
if (
|
||||
process.env.NODE_ENV === 'test' ||
|
||||
process.env.FLIPPER_NO_BUNDLED_PLUGINS === 'true'
|
||||
) {
|
||||
return [];
|
||||
}
|
||||
// defaultPlugins that are included in the Flipper distributive.
|
||||
// List of default bundled plugins is written at build time to defaultPlugins/bundled.json.
|
||||
const pluginPath = getStaticPath(
|
||||
path.join('defaultPlugins', 'bundled.json'),
|
||||
{asarUnpacked: true},
|
||||
);
|
||||
let bundledPlugins: Array<BundledPluginDetails> = [];
|
||||
try {
|
||||
bundledPlugins = await fs.readJson(pluginPath);
|
||||
} catch (e) {
|
||||
console.error('Failed to load list of bundled plugins', e);
|
||||
}
|
||||
return bundledPlugins;
|
||||
}
|
||||
|
||||
async loadMarketplacePlugins() {
|
||||
console.info('Load available plugins from marketplace');
|
||||
return loadMarketplacePlugins(this.flipperServer, '');
|
||||
|
||||
Reference in New Issue
Block a user