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

Feat: v3 Refactor #361

Merged
merged 20 commits into from
Oct 7, 2021
Merged
Show file tree
Hide file tree
Changes from 19 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
15 changes: 14 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,20 @@ module.exports = {
ecmaVersion: 2018,
},
extends: ['@sentry-internal/sdk'],
ignorePatterns: ['build/**', '**/dist/**', 'esm/**', 'example/**', 'scripts/**', 'test/integration/**'],
ignorePatterns: [
'build/**',
'**/dist/**',
'esm/**',
'example/**',
'scripts/**',
'test/integration/**',
'preload/**',
'main/**',
'renderer/**',
'common/**',
'index.*',
'integrations.*',
],
overrides: [
{
files: ['*.ts', '*.tsx', '*.d.ts'],
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
path: |
.cache/**
**/node_modules
key: ${{ runner.os }}-${{ github.sha }}
key: ${{ runner.os }}
- name: Install
run: yarn install
- name: Build
Expand All @@ -46,7 +46,7 @@ jobs:
path: |
.cache/**
**/node_modules
key: ${{ runner.os }}-${{ github.sha }}
key: ${{ runner.os }}
- run: yarn install
- name: Run Linter
run: yarn lint
Expand All @@ -68,7 +68,7 @@ jobs:
path: |
.cache/**
**/node_modules
key: ${{ runner.os }}-${{ github.sha }}
key: ${{ runner.os }}
- run: yarn install
- name: Run Unit Tests
run: yarn test
Expand All @@ -84,7 +84,6 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
electron:
[
'1.8.8',
'2.0.18',
'3.1.13',
'4.2.12',
Expand All @@ -94,9 +93,11 @@ jobs:
'8.5.5',
'9.4.4',
'10.4.7',
'11.4.8',
'12.0.11',
'13.1.2',
'11.5.0',
'12.1.2',
'13.4.0',
'14.0.1',
'15.0.0',
timfish marked this conversation as resolved.
Show resolved Hide resolved
]
env:
ELECTRON_VERSION: ${{ matrix.electron }}
Expand All @@ -108,7 +109,7 @@ jobs:
path: |
.cache/**
**/node_modules
key: ${{ runner.os }}-${{ github.sha }}
key: ${{ runner.os }}
- run: yarn install
- name: Run E2E Tests
run: yarn e2e
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,11 @@ stats.json
# Eslint
.eslintcache
.vagrant

/preload
/renderer
/main
/common
/index.*
/integrations.*
/ipc.*
8 changes: 7 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
/*
/.*
!/dist/**/*

!/esm/**/*
!/preload/**/*
!/main/**/*
!/renderer/**/*
!/common/**/*
!/index.*
!/integrations.*
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@

# Official Sentry SDK for Electron

[![Travis](https://travis-ci.com/getsentry/sentry-electron.svg?branch=master)](https://travis-ci.com/getsentry/sentry-electron)
[![Build & Test](https://github.com/getsentry/sentry-electron/actions/workflows/build.yml/badge.svg)](https://github.com/getsentry/sentry-electron/actions/workflows/build.yml)
[![npm version](https://img.shields.io/npm/v/@sentry/electron.svg)](https://www.npmjs.com/package/@sentry/electron)
[![license](https://img.shields.io/github/license/getsentry/sentry-electron.svg)](https://github.com/getsentry/sentry-electron/blob/master/LICENSE)
[![Discord](https://img.shields.io/discord/621778831602221064)](https://discord.gg/SugnmRwkmV)

## Features

Expand All @@ -19,13 +20,12 @@
[`@sentry/browser`](https://github.com/getsentry/sentry-javascript/tree/master/packages/browser))
- Captures **native crashes** (Minidump crash reports) from renderers and the main process
- Collects **breadcrumbs and context** information along with events across renderers and the main process
- Support `electron` version >= `1.8.x`
- Supports `electron >= 2`

## Usage

To use this SDK, call `init(options)` as early as possible in the entry modules in the main process as well as all
renderer processes or further sub processees you spawn. This will initialize the SDK and hook into the environment. Note
that you can turn off almost all side effects using the respective options.
renderer processes or further sub processes you spawn. This will initialize the SDK and hook into the environment.

```javascript
import { init } from '@sentry/electron';
Expand All @@ -43,7 +43,7 @@ functions will not perform any action before you have called `init()`:
import * as Sentry from '@sentry/electron';

// Set user information, as well as tags and further extras
Sentry.configureScope(scope => {
Sentry.configureScope((scope) => {
scope.setExtra('battery', 0.7);
scope.setTag('user_mode', 'admin');
scope.setUser({ id: '4711' });
Expand Down
Loading