Build all plugins before start
Summary: prepareDefaultPlugins builds all plugins now. We no longer need extra helpers Reviewed By: lblasa Differential Revision: D39308098 fbshipit-source-id: 4f12a0bdbc2afd2b306565fff3494daa630e1a20
This commit is contained in:
committed by
Facebook GitHub Bot
parent
642a3ebf81
commit
f835e07c46
@@ -16,9 +16,7 @@ import {
|
||||
genMercurialRevision,
|
||||
getVersionNumber,
|
||||
prepareDefaultPlugins,
|
||||
buildHeadlessPlugins,
|
||||
moveServerSourceMaps,
|
||||
buildServerAddOns,
|
||||
} from './build-utils';
|
||||
import {defaultPluginsDir, distDir, serverDir, staticDir} from './paths';
|
||||
import isFB from './isFB';
|
||||
@@ -354,8 +352,6 @@ async function buildServerRelease() {
|
||||
await fs.mkdirp(path.join(dir, 'static', 'defaultPlugins'));
|
||||
|
||||
await prepareDefaultPlugins(argv.channel === 'insiders');
|
||||
await buildServerAddOns(false);
|
||||
await buildHeadlessPlugins(false);
|
||||
await compileServerMain(false);
|
||||
await copyStaticResources(dir, versionNumber);
|
||||
await downloadIcons(path.join(dir, 'static'));
|
||||
|
||||
@@ -27,8 +27,6 @@ import {
|
||||
genMercurialRevision,
|
||||
prepareDefaultPlugins,
|
||||
moveSourceMaps,
|
||||
buildServerAddOns,
|
||||
buildHeadlessPlugins,
|
||||
} from './build-utils';
|
||||
import isFB from './isFB';
|
||||
import copyPackageWithDependencies from './copy-package-with-dependencies';
|
||||
@@ -313,8 +311,6 @@ async function copyStaticFolder(buildFolder: string) {
|
||||
|
||||
await compileMain();
|
||||
await prepareDefaultPlugins(argv.channel === 'insiders');
|
||||
await buildServerAddOns(false);
|
||||
await buildHeadlessPlugins(false);
|
||||
await copyStaticFolder(dir);
|
||||
await downloadIcons(dir);
|
||||
await compileRenderer(dir);
|
||||
|
||||
@@ -90,30 +90,15 @@ export async function prepareDefaultPlugins(isInsidersBuild: boolean = false) {
|
||||
? []
|
||||
: await getSourcePlugins();
|
||||
const defaultPlugins = sourcePlugins
|
||||
// we only include predefined set of plugins into insiders release
|
||||
.filter((p) => !isInsidersBuild || hardcodedPlugins.has(p.id));
|
||||
if (process.env.FLIPPER_NO_BUNDLED_PLUGINS) {
|
||||
// we only include headless plugins and a predefined set of regular plugins into insiders release
|
||||
.filter(
|
||||
(p) => !isInsidersBuild || hardcodedPlugins.has(p.id) || p.headless,
|
||||
);
|
||||
await buildDefaultPlugins(defaultPlugins);
|
||||
}
|
||||
}
|
||||
console.log('✅ Prepared default plugins.');
|
||||
}
|
||||
|
||||
export async function buildHeadlessPlugins(dev: boolean) {
|
||||
console.log(`⚙️ Building headless plugins...`);
|
||||
const sourcePlugins = await getSourcePlugins();
|
||||
const headlessPlugins = sourcePlugins.filter((p) => p.headless);
|
||||
await Promise.all(headlessPlugins.map((p) => runBuild(p.dir, dev)));
|
||||
console.log('✅ Built headless plugins.');
|
||||
}
|
||||
|
||||
export async function buildServerAddOns(dev: boolean) {
|
||||
console.log(`⚙️ Building plugins with server add-ons plugins...`);
|
||||
const sourcePlugins = await getSourcePlugins();
|
||||
const serverAddOns = sourcePlugins.filter((p) => p.serverAddOnSource);
|
||||
await Promise.all(serverAddOns.map((p) => runBuild(p.dir, dev)));
|
||||
console.log('✅ Built plugins with server add-ons plugins.');
|
||||
}
|
||||
async function buildDefaultPlugins(defaultPlugins: InstalledPluginDetails[]) {
|
||||
if (process.env.FLIPPER_NO_REBUILD_PLUGINS) {
|
||||
console.log(
|
||||
|
||||
@@ -20,12 +20,7 @@ import http from 'http';
|
||||
import path from 'path';
|
||||
import fs from 'fs-extra';
|
||||
import {hostname} from 'os';
|
||||
import {
|
||||
compileMain,
|
||||
prepareDefaultPlugins,
|
||||
buildHeadlessPlugins,
|
||||
buildServerAddOns,
|
||||
} from './build-utils';
|
||||
import {compileMain, prepareDefaultPlugins} from './build-utils';
|
||||
import Watchman from './watchman';
|
||||
// @ts-ignore no typings for metro
|
||||
import Metro from 'metro';
|
||||
@@ -446,8 +441,6 @@ function checkDevServer() {
|
||||
await prepareDefaultPlugins(
|
||||
process.env.FLIPPER_RELEASE_CHANNEL === 'insiders',
|
||||
);
|
||||
await buildServerAddOns(true);
|
||||
await buildHeadlessPlugins(true);
|
||||
await ensurePluginFoldersWatchable();
|
||||
const port = await detect(DEFAULT_PORT);
|
||||
const {app, server} = await startAssetServer(port);
|
||||
|
||||
@@ -14,8 +14,6 @@ import {
|
||||
compileServerMain,
|
||||
launchServer,
|
||||
prepareDefaultPlugins,
|
||||
buildHeadlessPlugins,
|
||||
buildServerAddOns,
|
||||
} from './build-utils';
|
||||
import Watchman from './watchman';
|
||||
import isFB from './isFB';
|
||||
@@ -187,8 +185,6 @@ async function startWatchChanges() {
|
||||
await prepareDefaultPlugins(
|
||||
process.env.FLIPPER_RELEASE_CHANNEL === 'insiders',
|
||||
);
|
||||
await buildServerAddOns(true);
|
||||
await buildHeadlessPlugins(true);
|
||||
|
||||
await ensurePluginFoldersWatchable();
|
||||
// builds and starts
|
||||
|
||||
Reference in New Issue
Block a user