Typescriptify the main process code (1/N)

Summary:
As a first step I've configured bundling for the main process code using Metro. For now I haven't converted anything to ts, just made that possible.

The bundle is just produced into the "static" directory. To avoid too many changes I kept the "static" folder as it is, but probably non-static code should be moved from there.

Also installed modules from "node_modules" for the main process are not bundled to avoid potential issues with node native modules.

Reviewed By: mweststrate

Differential Revision: D19960982

fbshipit-source-id: efbd426254e2b37c913c5f5f75f042c50ccee2f3
This commit is contained in:
Anton Nikolaev
2020-02-24 05:17:16 -08:00
committed by Facebook Github Bot
parent b5256abd0c
commit 18c259dc22
16 changed files with 868 additions and 364 deletions

View File

@@ -15,6 +15,7 @@ const cp = require('promisify-child-process');
const {
buildFolder,
compile,
compileMain,
die,
compileDefaultPlugins,
getVersionNumber,
@@ -168,6 +169,7 @@ function downloadIcons(buildFolder) {
const dir = await buildFolder();
// eslint-disable-next-line no-console
console.log('Created build directory', dir);
await compileMain();
copyStaticFolder(dir);
await downloadIcons(dir);
await compileDefaultPlugins(path.join(dir, 'defaultPlugins'));