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,
|
genMercurialRevision,
|
||||||
getVersionNumber,
|
getVersionNumber,
|
||||||
prepareDefaultPlugins,
|
prepareDefaultPlugins,
|
||||||
buildHeadlessPlugins,
|
|
||||||
moveServerSourceMaps,
|
moveServerSourceMaps,
|
||||||
buildServerAddOns,
|
|
||||||
} from './build-utils';
|
} from './build-utils';
|
||||||
import {defaultPluginsDir, distDir, serverDir, staticDir} from './paths';
|
import {defaultPluginsDir, distDir, serverDir, staticDir} from './paths';
|
||||||
import isFB from './isFB';
|
import isFB from './isFB';
|
||||||
@@ -354,8 +352,6 @@ async function buildServerRelease() {
|
|||||||
await fs.mkdirp(path.join(dir, 'static', 'defaultPlugins'));
|
await fs.mkdirp(path.join(dir, 'static', 'defaultPlugins'));
|
||||||
|
|
||||||
await prepareDefaultPlugins(argv.channel === 'insiders');
|
await prepareDefaultPlugins(argv.channel === 'insiders');
|
||||||
await buildServerAddOns(false);
|
|
||||||
await buildHeadlessPlugins(false);
|
|
||||||
await compileServerMain(false);
|
await compileServerMain(false);
|
||||||
await copyStaticResources(dir, versionNumber);
|
await copyStaticResources(dir, versionNumber);
|
||||||
await downloadIcons(path.join(dir, 'static'));
|
await downloadIcons(path.join(dir, 'static'));
|
||||||
|
|||||||
@@ -27,8 +27,6 @@ import {
|
|||||||
genMercurialRevision,
|
genMercurialRevision,
|
||||||
prepareDefaultPlugins,
|
prepareDefaultPlugins,
|
||||||
moveSourceMaps,
|
moveSourceMaps,
|
||||||
buildServerAddOns,
|
|
||||||
buildHeadlessPlugins,
|
|
||||||
} from './build-utils';
|
} from './build-utils';
|
||||||
import isFB from './isFB';
|
import isFB from './isFB';
|
||||||
import copyPackageWithDependencies from './copy-package-with-dependencies';
|
import copyPackageWithDependencies from './copy-package-with-dependencies';
|
||||||
@@ -313,8 +311,6 @@ async function copyStaticFolder(buildFolder: string) {
|
|||||||
|
|
||||||
await compileMain();
|
await compileMain();
|
||||||
await prepareDefaultPlugins(argv.channel === 'insiders');
|
await prepareDefaultPlugins(argv.channel === 'insiders');
|
||||||
await buildServerAddOns(false);
|
|
||||||
await buildHeadlessPlugins(false);
|
|
||||||
await copyStaticFolder(dir);
|
await copyStaticFolder(dir);
|
||||||
await downloadIcons(dir);
|
await downloadIcons(dir);
|
||||||
await compileRenderer(dir);
|
await compileRenderer(dir);
|
||||||
|
|||||||
@@ -90,30 +90,15 @@ export async function prepareDefaultPlugins(isInsidersBuild: boolean = false) {
|
|||||||
? []
|
? []
|
||||||
: await getSourcePlugins();
|
: await getSourcePlugins();
|
||||||
const defaultPlugins = sourcePlugins
|
const defaultPlugins = sourcePlugins
|
||||||
// we only include predefined set of plugins into insiders release
|
// we only include headless plugins and a predefined set of regular plugins into insiders release
|
||||||
.filter((p) => !isInsidersBuild || hardcodedPlugins.has(p.id));
|
.filter(
|
||||||
if (process.env.FLIPPER_NO_BUNDLED_PLUGINS) {
|
(p) => !isInsidersBuild || hardcodedPlugins.has(p.id) || p.headless,
|
||||||
|
);
|
||||||
await buildDefaultPlugins(defaultPlugins);
|
await buildDefaultPlugins(defaultPlugins);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
console.log('✅ Prepared default plugins.');
|
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[]) {
|
async function buildDefaultPlugins(defaultPlugins: InstalledPluginDetails[]) {
|
||||||
if (process.env.FLIPPER_NO_REBUILD_PLUGINS) {
|
if (process.env.FLIPPER_NO_REBUILD_PLUGINS) {
|
||||||
console.log(
|
console.log(
|
||||||
|
|||||||
@@ -20,12 +20,7 @@ import http from 'http';
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
import fs from 'fs-extra';
|
import fs from 'fs-extra';
|
||||||
import {hostname} from 'os';
|
import {hostname} from 'os';
|
||||||
import {
|
import {compileMain, prepareDefaultPlugins} from './build-utils';
|
||||||
compileMain,
|
|
||||||
prepareDefaultPlugins,
|
|
||||||
buildHeadlessPlugins,
|
|
||||||
buildServerAddOns,
|
|
||||||
} from './build-utils';
|
|
||||||
import Watchman from './watchman';
|
import Watchman from './watchman';
|
||||||
// @ts-ignore no typings for metro
|
// @ts-ignore no typings for metro
|
||||||
import Metro from 'metro';
|
import Metro from 'metro';
|
||||||
@@ -446,8 +441,6 @@ function checkDevServer() {
|
|||||||
await prepareDefaultPlugins(
|
await prepareDefaultPlugins(
|
||||||
process.env.FLIPPER_RELEASE_CHANNEL === 'insiders',
|
process.env.FLIPPER_RELEASE_CHANNEL === 'insiders',
|
||||||
);
|
);
|
||||||
await buildServerAddOns(true);
|
|
||||||
await buildHeadlessPlugins(true);
|
|
||||||
await ensurePluginFoldersWatchable();
|
await ensurePluginFoldersWatchable();
|
||||||
const port = await detect(DEFAULT_PORT);
|
const port = await detect(DEFAULT_PORT);
|
||||||
const {app, server} = await startAssetServer(port);
|
const {app, server} = await startAssetServer(port);
|
||||||
|
|||||||
@@ -14,8 +14,6 @@ import {
|
|||||||
compileServerMain,
|
compileServerMain,
|
||||||
launchServer,
|
launchServer,
|
||||||
prepareDefaultPlugins,
|
prepareDefaultPlugins,
|
||||||
buildHeadlessPlugins,
|
|
||||||
buildServerAddOns,
|
|
||||||
} from './build-utils';
|
} from './build-utils';
|
||||||
import Watchman from './watchman';
|
import Watchman from './watchman';
|
||||||
import isFB from './isFB';
|
import isFB from './isFB';
|
||||||
@@ -187,8 +185,6 @@ async function startWatchChanges() {
|
|||||||
await prepareDefaultPlugins(
|
await prepareDefaultPlugins(
|
||||||
process.env.FLIPPER_RELEASE_CHANNEL === 'insiders',
|
process.env.FLIPPER_RELEASE_CHANNEL === 'insiders',
|
||||||
);
|
);
|
||||||
await buildServerAddOns(true);
|
|
||||||
await buildHeadlessPlugins(true);
|
|
||||||
|
|
||||||
await ensurePluginFoldersWatchable();
|
await ensurePluginFoldersWatchable();
|
||||||
// builds and starts
|
// builds and starts
|
||||||
|
|||||||
Reference in New Issue
Block a user