Initial commit 🎉

fbshipit-source-id: b6fc29740c6875d2e78953b8a7123890a67930f2
Co-authored-by: Sebastian McKenzie <sebmck@fb.com>
Co-authored-by: John Knox <jknox@fb.com>
Co-authored-by: Emil Sjölander <emilsj@fb.com>
Co-authored-by: Pritesh Nandgaonkar <prit91@fb.com>
This commit is contained in:
Daniel Büchele
2018-04-13 08:38:06 -07:00
committed by Daniel Buchele
commit fbbf8cf16b
659 changed files with 87130 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
/**
* 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
*/
import LogManager from './Logger';
export default class BugReporter {
constructor(logManager: LogManager) {}
async report(title: string, body: string): Promise<number> {
return Promise.resolve(-1);
}
}

View File

@@ -0,0 +1,21 @@
/**
* 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 function cleanStack(stack: string, loc: ?string) {}
import type ScribeLogger from './ScribeLogger';
export type ObjectError =
| Error
| {
message: string,
stack?: string,
};
export default class ErrorReporter {
constructor(scribeLogger: ScribeLogger) {}
report(err: ObjectError) {}
}

16
src/fb-stubs/GK.js Normal file
View File

@@ -0,0 +1,16 @@
/**
* 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 type GKID = string;
export default class GK {
static init() {}
static get(id: GKID): boolean {
return false;
}
}

40
src/fb-stubs/Logger.js Normal file
View File

@@ -0,0 +1,40 @@
/**
* 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 type LogTypes = 'error' | 'warn' | 'info' | 'debug';
export type TrackType = 'duration' | 'usage' | 'performance';
import ScribeLogger from './ScribeLogger';
export default class LogManager {
constructor() {
this.scribeLogger = new ScribeLogger(this);
}
scribeLogger: ScribeLogger;
track(type: TrackType, event: string, data: ?any) {}
trackTimeSince(mark: string, eventName: ?string) {}
info(data: any, category: string) {
// eslint-disable-next-line
console.info(data, category);
}
warn(data: any, category: string) {
console.warn(data, category);
}
error(data: any, category: string) {
console.error(data, category);
}
debug(data: any, category: string) {
// eslint-disable-next-line
console.debug(data, category);
}
}

View File

@@ -0,0 +1,18 @@
/**
* 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 type ScribeMessage = {|
category: string,
message: string,
|};
import type Logger from './Logger.js';
export default class ScribeLogger {
constructor(logger: Logger) {}
send(message: ScribeMessage) {}
}

11
src/fb-stubs/config.js Normal file
View File

@@ -0,0 +1,11 @@
/**
* 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 {
updateServer: 'https://www.facebook.com/sonar/public/latest.json',
bugReportButtonVisible: false,
};

19
src/fb-stubs/constants.js Normal file
View File

@@ -0,0 +1,19 @@
/**
* 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 = '';