Migrate constants

Summary: We can't `*`-export as the symbols are invisible but being explicit about this seems like a good improvement anyway.

Reviewed By: danielbuechele

Differential Revision: D16666637

fbshipit-source-id: 8f9a14ed41f4d8ad93b4bab8dd54f3b6c9e24824
This commit is contained in:
Pascal Hartig
2019-08-09 03:16:42 -07:00
committed by Facebook Github Bot
parent e602e1ccae
commit 798d6d2ed4
5 changed files with 31 additions and 29 deletions

View File

@@ -15,7 +15,7 @@ import {
} from './reducers/application.tsx';
import type {Store} from './reducers/index.tsx';
import electron from 'electron';
import {ENABLE_SHAREABLE_LINK} from 'flipper';
import {constants} from 'flipper';
export type DefaultKeyboardAction = 'clear' | 'goToBottom' | 'createPaste';
export type TopLevelMenu = 'Edit' | 'View' | 'Window' | 'Help';
const {dialog} = electron.remote;
@@ -210,7 +210,7 @@ function getTemplate(
},
},
];
if (ENABLE_SHAREABLE_LINK) {
if (constants.ENABLE_SHAREABLE_LINK) {
exportSubmenu.push({
label: 'Sharable Link',
accelerator: 'CommandOrControl+Shift+E',

View File

@@ -1,24 +0,0 @@
/**
* Copyright 2018-present Facebook.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
* @format
*/
export const GRAPH_APP_ID = '';
export const GRAPH_CLIENT_TOKEN = '';
export const GRAPH_ACCESS_TOKEN = '';
// this provides elevated access to scribe. we really shouldn't be exposing this.
// need to investigate how to abstract the scribe logging so it's safe.
export const GRAPH_SECRET = '';
export const GRAPH_SECRET_ACCESS_TOKEN = '';
// Provides access to Insights Validation ednpoint on interngraph
export const INSIGHT_INTERN_APP_ID = '';
export const INSIGHT_INTERN_APP_TOKEN = '';
// Enables the flipper data to be exported through shareabale link
export const ENABLE_SHAREABLE_LINK = false;
export const IS_PUBLIC_BUILD = true;

View File

@@ -0,0 +1,26 @@
/**
* Copyright 2018-present Facebook.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
* @format
*/
export default Object.freeze({
GRAPH_APP_ID: '',
GRAPH_CLIENT_TOKEN: '',
GRAPH_ACCESS_TOKEN: '',
// this provides elevated access to scribe. we really shouldn't be exposing this.
// need to investigate how to abstract the scribe logging so it's safe.
GRAPH_SECRET: '',
GRAPH_SECRET_ACCESS_TOKEN: '',
// Provides access to Insights Validation endpoint on interngraph
INSIGHT_INTERN_APP_ID: '',
INSIGHT_INTERN_APP_TOKEN: '',
// Enables the flipper data to be exported through shareabale link
ENABLE_SHAREABLE_LINK: false,
IS_PUBLIC_BUILD: true,
});

View File

@@ -21,7 +21,7 @@ export type {PluginClient, Props} from './plugin.tsx';
export type {MetricType} from './utils/exportMetrics.js';
export {default as Client} from './Client.tsx';
export {clipboard} from 'electron';
export * from './fb-stubs/constants.js';
export {default as constants} from './fb-stubs/constants.tsx';
export {connect} from 'react-redux';
export {selectPlugin} from './reducers/connections.tsx';
export {getPluginKey, getPersistedState} from './utils/pluginUtils.js';

View File

@@ -9,7 +9,7 @@ import {exists, mkdir} from 'fs';
import {promisify} from 'util';
import {crashReporter, remote} from 'electron';
import isProduction from '../utils/isProduction.js';
import {IS_PUBLIC_BUILD} from '../fb-stubs/constants';
import constants from '../fb-stubs/constants.tsx';
import {tmpName} from 'tmp';
import {resolve} from 'path';
@@ -35,7 +35,7 @@ export default function initCrashReporter(sessionId: string): Promise<void> {
productName: 'Flipper',
companyName: 'Facebook',
submitURL: 'https://www.facebook.com/intern/flipper/crash_upload',
uploadToServer: isProduction() && !IS_PUBLIC_BUILD,
uploadToServer: isProduction() && !constants.IS_PUBLIC_BUILD,
ignoreSystemCrashHandler: true,
extra: {
flipper_version: flipperVersion,