Load either installed or bundled version of plugin depending on which is newer

Summary: Load either installed or bundled version of plugin depending on which is newer.

Reviewed By: mweststrate

Differential Revision: D21858965

fbshipit-source-id: aa46eafe0b5137134fadad827749672441f2c9e5
This commit is contained in:
Anton Nikolaev
2020-06-03 07:37:11 -07:00
committed by Facebook GitHub Bot
parent e31ddbc648
commit e65b355fb6
8 changed files with 76 additions and 27 deletions

View File

@@ -25,8 +25,8 @@ import MetroResolver from 'metro-resolver';
import {staticDir, appDir, babelTransformationsDir} from './paths';
import isFB from './isFB';
import getAppWatchFolders from './get-app-watch-folders';
import getPlugins from '../static/getPlugins';
import getPluginFolders from '../static/getPluginFolders';
import {getSourcePlugins} from '../static/getPlugins';
import {getPluginSourceFolders} from '../static/getPluginFolders';
import startWatchPlugins from '../static/startWatchPlugins';
import ensurePluginFoldersWatchable from '../static/ensurePluginFoldersWatchable';
@@ -88,7 +88,7 @@ function launchElectron(port: number) {
async function startMetroServer(app: Express, server: http.Server) {
const watchFolders = (await getAppWatchFolders()).concat(
await getPluginFolders(),
await getPluginSourceFolders(),
);
const baseConfig = await Metro.loadConfig();
const config = Object.assign({}, baseConfig, {
@@ -206,7 +206,7 @@ async function startWatchChanges(io: socketIo.Server) {
),
),
);
const plugins = await getPlugins();
const plugins = await getSourcePlugins();
await startWatchPlugins(plugins, () => {
io.emit('refresh');
});