Skip to content
This repository has been archived by the owner on Feb 25, 2024. It is now read-only.

Commit

Permalink
Remove Bugsnag as it does not support CORS
Browse files Browse the repository at this point in the history
  • Loading branch information
ayltai committed Sep 18, 2022
1 parent 81e84c4 commit b96444a
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 54 deletions.
35 changes: 2 additions & 33 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,37 +61,6 @@ jobs:
with:
url: https://brewmymac.sh
expected_status: '[200]'
bugsnag:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Cache dependencies
id: cache-dependencies
uses: actions/cache@v3
with:
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}
path: |
node_modules
~/.npm
- name: Install dependencies
if: ${{ steps.cache-dependencies.outputs.cache-hit == false }}
run: npm i --legacy-peer-deps
- name: Restore the build
uses: actions/download-artifact@v3
with:
name: build
path: build/
- name: Upload source maps to Bugsnag
run: npx bugsnag-source-maps upload-browser --api-key ${{ secrets.REACT_APP_BUGSNAG_KEY }} --app-version ${{ github.event.release.tag_name }} --overwrite --directory build/static/js --base-url https://brewmymac.sh/static/js/
env:
REACT_APP_BUGSNAG_KEY: ${{ secrets.REACT_APP_BUGSNAG_KEY }}
sentry:
runs-on: ubuntu-latest
needs:
Expand Down Expand Up @@ -120,13 +89,13 @@ jobs:
name: build
path: build/
- name: Create a new Sentry release
run: ./node_modules/.bin/sentry-cli releases new 1.0.8
run: ./node_modules/.bin/sentry-cli releases new 1.0.9
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
- name: Upload source maps to Sentry
run: ./node_modules/.bin/sentry-cli releases files 1.0.8 upload-sourcemaps build --rewrite
run: ./node_modules/.bin/sentry-cli releases files 1.0.9 upload-sourcemaps build --rewrite
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ You need [Node.js](https://nodejs.org) and [npm](https://www.npmjs.com) installe
npm i --legacy-peer-deps
```
2. Change the homepage URL in `package.json` to `.`
3. This app uses [Bugsnag](https://www.bugsnag.com) and [Sentry](https://sentry.io) to track errors and [Mixpanel](https://mixpanel.com) to track usage. You can [create a `.env` file](https://create-react-app.dev/docs/adding-custom-environment-variables/#adding-development-environment-variables-in-env) and adding your own keys by setting the `REACT_APP_MIXPANEL_TOKEN`, `REACT_APP_BUGSNAG_KEY` and `REACT_APP_SENTRY_DSN` environment variables.
3. This app uses [Sentry](https://sentry.io) to track errors and [Mixpanel](https://mixpanel.com) to track usage. You can [create a `.env` file](https://create-react-app.dev/docs/adding-custom-environment-variables/#adding-development-environment-variables-in-env) and adding your own keys by setting the `REACT_APP_MIXPANEL_TOKEN` and `REACT_APP_SENTRY_DSN` environment variables.
4. Start the development server
```bash
npm start
Expand Down
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name" : "brew-my-mac",
"description" : "Possibly the coolest way to install apps and customize your Mac!",
"version" : "1.0.8",
"version" : "1.0.9",
"author" : {
"name" : "Alan Tai"
},
Expand Down Expand Up @@ -32,8 +32,6 @@
"update" : "npx npm-check-updates"
},
"dependencies" : {
"@bugsnag/js" : "^7.17.4",
"@bugsnag/plugin-react" : "^7.17.4",
"@emotion/react" : "^11.10.4",
"@emotion/styled" : "^11.10.4",
"@fontsource/inconsolata" : "^4.5.7",
Expand Down Expand Up @@ -63,7 +61,6 @@
"@babel/preset-env" : "^7.19.1",
"@babel/preset-typescript" : "^7.18.6",
"@babel/runtime" : "^7.19.0",
"@bugsnag/source-maps" : "^2.3.1",
"@sentry/cli" : "^2.5.2",
"@testing-library/jest-dom" : "^5.16.5",
"@testing-library/react" : "^13.4.0",
Expand Down
9 changes: 0 additions & 9 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import Bugsnag from '@bugsnag/js';
import BugsnagPluginReact from '@bugsnag/plugin-react';
import { Backdrop, Button, createTheme, CssBaseline, ThemeProvider, Typography, } from '@mui/material';
import * as Sentry from '@sentry/react';
import { BrowserTracing, } from '@sentry/tracing';
Expand All @@ -24,13 +22,6 @@ mixpanel.init(process.env.REACT_APP_MIXPANEL_TOKEN!, {
debug : process.env.NODE_ENV !== 'production',
});

Bugsnag.start({
apiKey : process.env.REACT_APP_BUGSNAG_KEY!,
plugins : [
new BugsnagPluginReact(),
],
});

Sentry.init({
dsn : process.env.REACT_APP_SENTRY_DSN,
environment : process.env.NODE_ENV,
Expand Down
5 changes: 0 additions & 5 deletions src/setupTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ import fetchMock from 'jest-fetch-mock';

fetchMock.enableMocks();

jest.mock('@bugsnag/js', () => ({
start : () => {},
notify : () => {},
}));

jest.mock('mixpanel-browser', () => ({
init : () => {},
track : () => {},
Expand Down
2 changes: 0 additions & 2 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import Bugsnag from '@bugsnag/js';
import * as Sentry from '@sentry/react';

export const handleError = (error : any) => {
if (process.env.NODE_ENV === 'production') {
Bugsnag.notify(error);
Sentry.captureException(error);
} else {
console.error(error);
Expand Down

0 comments on commit b96444a

Please sign in to comment.