Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Justin/sentry #55

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
AIRTABLE_BASE_ID='your-API-key-here'
AIRTABLE_API_KEY='keyioENo5dwh9Czt9'
IMG_API_KEY='image-API-key-here'
IMG_API_KEY='image-API-key-here'
SENTRY_ORG='calblueprint'
SENTRY_PROJECT='dccentralkitchen'
SENTRY_AUTH_TOKEN='7156d22756444307981c94cf70ef094a61783b1959344a29866c55aeb29cfbb1'
26 changes: 13 additions & 13 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
module.exports = {
env: {
es6: true
es6: true,
},
extends: ['eslint:recommended', 'airbnb', 'plugin:prettier/recommended'],
parser: 'babel-eslint',
parserOptions: {
ecmaFeatures: {
jsx: true
jsx: true,
},
ecmaVersion: 2018,
sourceType: 'module'
sourceType: 'module',
},
plugins: ['react-native', 'prettier'],
rules: {
Expand All @@ -19,23 +19,23 @@ module.exports = {
paths: [
{
name: 'airtable',
message: 'Do not use the airtable module outside of airtable.js'
message: 'Do not use the airtable module outside of airtable.js',
},
{
name: './airtable',
message: 'Do not use airtable.js outside of request.js'
message: 'Do not use airtable.js outside of request.js',
},
{
name: '../../lib/airtable',
message: 'Do not use airtable.js outside of request.js'
message: 'Do not use airtable.js outside of request.js',
},
{
name: '../../../lib/airtable',
message: 'Do not use airtable.js outside of request.js'
}
]
}
],
message: 'Do not use airtable.js outside of request.js',
},
],
},
],
'no-underscore-dangle': ['error', { allowAfterThis: true }],
'no-use-before-define': ['error', { variables: false }],
'no-const-assign': 'warn',
Expand All @@ -47,6 +47,6 @@ module.exports = {
'valid-typeof': 'warn',
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
'prettier/prettier': ['error'],
'react/destructuring-assignment': ['enabled', 'never']
}
'react/destructuring-assignment': 'warn',
},
};
2 changes: 1 addition & 1 deletion .expo-shared/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
"e997a5256149a4b76e6bfd6cbf519c5e5a0f1d278a3d8fa1253022b03c90473b": true,
"af683c96e0ffd2cf81287651c9433fa44debc1220ca7cb431fe482747f34a505": true,
"e7fc0741cc6562975a990e3d9ef820571588dab20aba97032df9f00caa9cd57a": true
}
}
32 changes: 27 additions & 5 deletions App.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,30 @@ import { Asset } from 'expo-asset';
import * as Font from 'expo-font';
import React, { useState } from 'react';
import { Platform, StatusBar, StyleSheet, View } from 'react-native';
import * as Sentry from 'sentry-expo';
import AppNavigator from './navigation/AppNavigator';

Sentry.init({
dsn: 'https://[email protected]/5172575',
enableInExpoDevelopment: true,
debug: true,
});

// from https://forum.sentry.io/t/set-release-after-init/6759/2
// may be able to turn this code block off in production
setTimeout(async () => {
Sentry.configureScope((scope) => {
scope.addEventProcessor((event) => {
event.release = 'newRelease';
return event;
});
});
await Sentry.captureMessage('Something Broke');
}, 1000);

// turn this on in production
// Sentry.setRelease(Constants.manifest.revisionId);

export default function App(props) {
const [isLoadingComplete, setLoadingComplete] = useState(false);

Expand All @@ -30,7 +52,7 @@ async function loadResourcesAsync() {
await Promise.all([
Asset.loadAsync([
require('./assets/images/robot-dev.png'),
require('./assets/images/robot-prod.png')
require('./assets/images/robot-prod.png'),
]),
Font.loadAsync({
// This is the font that we are using for our tab bar
Expand All @@ -41,8 +63,8 @@ async function loadResourcesAsync() {
// Used across application
'poppins-regular': require('./assets/fonts/Poppins-Regular.ttf'),
'poppins-semibold': require('./assets/fonts/Poppins-SemiBold.ttf'),
'poppins-medium': require('./assets/fonts/Poppins-Medium.ttf')
})
'poppins-medium': require('./assets/fonts/Poppins-Medium.ttf'),
}),
]);
}

Expand All @@ -59,6 +81,6 @@ function handleFinishLoading(setLoadingComplete) {
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff'
}
backgroundColor: '#fff',
},
});
22 changes: 12 additions & 10 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
"slug": "frontend",
"privacy": "public",
"sdkVersion": "35.0.0",
"platforms": [
"ios",
"android",
"web"
],
"platforms": ["ios", "android", "web"],
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/images/icon.png",
Expand All @@ -20,16 +16,22 @@
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"assetBundlePatterns": ["**/*"],
"ios": {
"supportsTablet": true
},
"android": {
"package": "com.blueprint.dc",
"googleServicesFile": "./google-services.json",
"permissions": ["ACCESS_COARSE_LOCATION", "ACCESS_FINE_LOCATION"]
}
},
"hooks": {
"postPublish": [
{
"file": "sentry-expo/upload-sourcemaps"
}
]
},
"description": ""
}
}
}
2 changes: 1 addition & 1 deletion lib/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const apiKey = process.env.AIRTABLE_API_KEY;
const baseId = process.env.AIRTABLE_BASE_ID;

const BASE = new Airtable({
apiKey
apiKey,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries about the trailing comma diffs - it gets updated in #53 (but odd that your prettier is using a different config; I added a workspace settings.json in the same PR so hopefully that fixes it)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should I leave them as is then?

}).base(baseId);

export default BASE;
Expand Down
18 changes: 10 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"@react-native-community/masked-view": "^0.1.1",
"@react-navigation/core": "^3.0.0-alpha.13",
"@react-navigation/web": "^1.0.0-alpha.9",
"@sentry/browser": "^5.15.0",
JustinMi marked this conversation as resolved.
Show resolved Hide resolved
"airtable": "^0.7.1",
"babel-plugin-inline-dotenv": "^1.5.0",
"expo": "^35.0.0",
Expand Down Expand Up @@ -81,26 +82,27 @@
"react-navigation-tabs": "^2.7.0",
"react-phone-number-input": "^2.3.24",
"reanimated-bottom-sheet": "^1.0.0-alpha.15",
"sentry-expo": "^2.0.3",
"styled-components": "^5.0.1",
"validate.js": "^0.13.1"
},
"devDependencies": {
"airtable-schema-generator": "^1.2.5",
"babel-eslint": "^10.0.3",
"babel-eslint": "^10.1.0",
"babel-preset-expo": "^7.0.0",
"eslint": "^5.16.0",
"eslint-config-airbnb": "^18.0.1",
"eslint-config-prettier": "^6.9.0",
"eslint-plugin-import": "^2.18.2",
"eslint": "^6.8.0",
"eslint-config-airbnb": "^18.1.0",
"eslint-config-prettier": "^6.10.1",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-prettier": "^3.1.2",
"eslint-plugin-react": "^7.16.0",
"eslint-plugin-react-hooks": "^1.7.0",
"eslint-plugin-react": "^7.19.0",
"eslint-plugin-react-hooks": "^2.5.1",
"eslint-plugin-react-native": "^3.8.1",
"husky": "^4.2.1",
"jest-expo": "^35.0.0",
"lint-staged": "^10.0.6",
"prettier": "^1.18.2",
"prettier": "^2.0.1",
"yarnhook": "^0.4.3"
},
"private": true,
Expand Down
Loading