Extract environment config initialisation to server-core
Summary: This diff makes most stuff that is read from the `os` package, and version info etc available from the `serverConfig` object, so that flipper-ui-core no longer needs the `os` package. Reviewed By: passy Differential Revision: D32694848 fbshipit-source-id: 93af1e95d898da9aaf351a6970b5a7652ee835c8
This commit is contained in:
committed by
Facebook GitHub Bot
parent
de59bbedd2
commit
2a4fe77404
@@ -20,6 +20,7 @@ import type {RenderHost} from 'flipper-ui-core';
|
||||
import os from 'os';
|
||||
import {
|
||||
FlipperServerImpl,
|
||||
getEnvironmentInfo,
|
||||
getGatekeepers,
|
||||
loadLauncherSettings,
|
||||
loadProcessConfig,
|
||||
@@ -30,6 +31,7 @@ import {
|
||||
getLogger,
|
||||
isTest,
|
||||
Logger,
|
||||
parseEnvironmentVariables,
|
||||
setLoggerInstance,
|
||||
Settings,
|
||||
} from 'flipper-common';
|
||||
@@ -61,9 +63,10 @@ async function start() {
|
||||
const app = remote.app;
|
||||
const execPath = process.execPath || remote.process.execPath;
|
||||
const appPath = app.getAppPath();
|
||||
const staticPath = getStaticDir();
|
||||
const isProduction = !/node_modules[\\/]electron[\\/]/.test(execPath);
|
||||
const env = process.env;
|
||||
|
||||
const environmentInfo = await getEnvironmentInfo(staticPath, isProduction);
|
||||
const logger = createDelegatedLogger();
|
||||
setLoggerInstance(logger);
|
||||
|
||||
@@ -80,14 +83,15 @@ async function start() {
|
||||
|
||||
const flipperServer = new FlipperServerImpl(
|
||||
{
|
||||
env,
|
||||
gatekeepers: getGatekeepers(),
|
||||
isProduction,
|
||||
environmentInfo,
|
||||
env: parseEnvironmentVariables(env),
|
||||
// TODO: make userame parameterizable
|
||||
gatekeepers: getGatekeepers(environmentInfo.os.unixname),
|
||||
paths: {
|
||||
appPath,
|
||||
homePath: app.getPath('home'),
|
||||
execPath,
|
||||
staticPath: getStaticDir(),
|
||||
staticPath,
|
||||
tempPath: app.getPath('temp'),
|
||||
desktopPath: app.getPath('desktop'),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user