Merge pull request #302 from jorilallo/jori/bugsnag-url

Bugsnag token
This commit is contained in:
Jori Lallo
2017-10-15 18:37:06 -07:00
committed by GitHub
6 changed files with 15 additions and 18 deletions

View File

@ -6,10 +6,7 @@
"plugin:import/warnings",
"plugin:flowtype/recommended"
],
"plugins": [
"prettier",
"flowtype"
],
"plugins": ["prettier", "flowtype"],
"rules": {
"eqeqeq": 2,
"no-unused-vars": 2,
@ -22,7 +19,7 @@
"import/no-unresolved": [
"error",
{
"ignore": [ "slate-drop-or-paste-images" ]
"ignore": ["slate-drop-or-paste-images"]
}
],
// Flow
@ -33,14 +30,8 @@
"annotationStyle": "line"
}
],
"flowtype/space-after-type-colon": [
2,
"always"
],
"flowtype/space-before-type-colon": [
2,
"never"
],
"flowtype/space-after-type-colon": [2, "always"],
"flowtype/space-before-type-colon": [2, "never"],
// Enforce that code is formatted with prettier.
"prettier/prettier": [
"error",
@ -65,7 +56,8 @@
"SLACK_REDIRECT_URI": true,
"DEPLOYMENT": true,
"BASE_URL": true,
"BUGSNAG_KEY": true,
"afterAll": true,
"Bugsnag": true
}
}
}

View File

@ -45,6 +45,9 @@
},
"URL": {
"required": true
},
"BUGSNAG_KEY": {
"required": true
}
},
"formation": {},

View File

@ -3,5 +3,6 @@ declare var __DEV__: string;
declare var SLACK_REDIRECT_URI: string;
declare var SLACK_KEY: string;
declare var BASE_URL: string;
declare var BUGSNAG_KEY: ?string;
declare var DEPLOYMENT: string;
declare var Bugsnag: any;

View File

@ -65,8 +65,8 @@ if (process.env.NODE_ENV === 'development') {
app.use(logger());
}
if (process.env.NODE_ENV === 'production') {
bugsnag.register('ad7a85f99b1b9324a31e16732cdf3192');
if (process.env.NODE_ENV === 'production' && process.env.BUGSNAG_KEY) {
bugsnag.register(process.env.BUGSNAG_KEY);
app.on('error', bugsnag.koaHandler);
}

View File

@ -26,6 +26,6 @@
<body>
<div id="root"></div>
</body>
<script src="//d2wy8f7a9ursnm.cloudfront.net/bugsnag-3.min.js" data-apikey="8165e2069605bc20ccd0792dbbfae7bf"></script>
<script src="//d2wy8f7a9ursnm.cloudfront.net/bugsnag-3.min.js" data-apikey="<%= BUGSNAG_KEY %>"></script>
</html>
</html>

View File

@ -13,6 +13,7 @@ const definePlugin = new webpack.DefinePlugin({
SLACK_REDIRECT_URI: JSON.stringify(process.env.SLACK_REDIRECT_URI),
SLACK_KEY: JSON.stringify(process.env.SLACK_KEY),
BASE_URL: JSON.stringify(process.env.URL),
BUGSNAG_KEY: JSON.stringify(process.env.BUGSNAG_KEY),
DEPLOYMENT: JSON.stringify(process.env.DEPLOYMENT || 'hosted'),
});