Skip to content
Merged
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
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8

[*.json]
indent_style = space
indent_size = 4

[*.js,*.jsx,*.ts]
indent_style = space
indent_size = 2

[{package.json,.travis.yml}]
indent_style = space
indent_size = 2
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ branches:
- master
matrix:
include:
- language: node_js
node_js:
- "8"
env:
- LANE='node'
cache:
yarn: true
script:
- .travis/run.sh
- language: android
os: linux
jdk: oraclejdk8
Expand Down Expand Up @@ -30,6 +39,8 @@ matrix:
- extra-google-google_play_services
- extra-google-m2repository
- addon-google_apis-google-16
env:
- LANE='android'
script:
- .travis/run.sh
- language: objective-c
Expand Down
15 changes: 15 additions & 0 deletions .travis/run.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
#!/bin/sh

if [ "$LANE" = "node" ];
then
yarn install
npm run test-typescript
cd appium
npm install -g react-native-cli
make install
cd example
npm run test
else

cd appium
bundle install
pip wheel --wheel-dir wheelhouse -r requirements.txt
npm install -g react-native-cli
react-native -v

if [ "$LANE" = "ios" ];
then
make test
else
make test-android
fi

fi
10 changes: 6 additions & 4 deletions appium/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,22 @@ copy-local-files-to-example:
cp -r ../android/* example/node_modules/react-native-sentry/android/
cp -r ../ios/Sentry/Sources/Sentry/* example/node_modules/react-native-sentry/ios/Sentry/Sources/Sentry/

test: create-test-bundle new-demo-project copy-local-files-to-example
install: new-demo-project copy-local-files-to-example

test: create-test-bundle install
fastlane build_for_device_farm
fastlane aws_ios_upload_and_run
ruby check_run_failues.rb

test-android: create-android-test-bundle new-demo-project copy-local-files-to-example
test-android: create-android-test-bundle install
fastlane build_android_for_device_farm
fastlane aws_android_upload_and_run
ANDROID=1 ruby check_run_failues.rb

local-android-test: create-android-test-bundle new-demo-project copy-local-files-to-example
local-android-test: create-android-test-bundle install
fastlane build_android_for_device_farm
ANDROID=1 pytest -vv tests/test_android.py

local-test: create-test-bundle new-demo-project copy-local-files-to-example
local-test: create-test-bundle install
fastlane build_for_local_appium
pytest -vv tests/test_ios.py
4 changes: 2 additions & 2 deletions lib/NativeClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ export class NativeClient {
RNSentry.addExtra(key, value);
}

captureBreadcrumb(crumb) {
RNSentry.captureBreadcrumb(crumb);
captureBreadcrumb(breadcrumb) {
RNSentry.captureBreadcrumb(breadcrumb);
}

clearContext() {
Expand Down
4 changes: 2 additions & 2 deletions lib/RavenClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ export class RavenClient {
Raven.captureException(ex, options);
}

captureBreadcrumb(msg, options) {
Raven.captureBreadcrumb(msg, options);
captureBreadcrumb(breadcrumb) {
Raven.captureBreadcrumb(breadcrumb);
}

captureMessage(message, options) {
Expand Down
96 changes: 96 additions & 0 deletions lib/Sentry.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
// Type definitions for react-native-sentry
// Project: https://sentry.io
// Definitions by: Daniel Griesser <https://github.com/hazat>
// Definitions: https://github.com/getsentry/react-native-sentry
// TypeScript Version: 2.3

type SentryBreadcrumbType = "navigation" | "http";

interface SentryBreadcrumb {
message?: string;
category?: string;
level?: SentrySeverity;
data?: object;
type?: SentryBreadcrumbType;
}

export enum SentrySeverity {
Fatal = "fatal",
Error = "error",
Warning = "warning",
Info = "info",
Debug = "debug",
Critical = "critical"
}

export enum SentryLog {
None = 0,
Error = 1,
Debug = 2,
Verbose = 3
}

interface SentryOptions {
logLevel?: SentryLog;
instrument?: boolean;
disableNativeIntegration?: boolean;
ignoreModulesExclude?: [string];
ignoreModulesInclude?: [string];
}

export default Sentry;

export class Sentry {
install(): void;

static config(dsn: string, options?: SentryOptions): Sentry;

static isNativeClientAvailable(): boolean;

static crash(): void;

static nativeCrash(): void;

static setEventSentSuccessfully(callback: Function): void;

static setDataCallback(callback: Function): void;

static setUserContext(user: {
id?: string;
username?: string;
email?: string;
extra?: object;
}): void;

static setTagsContext(tags: Object): void;

static setExtraContext(extra: Object): void;

static captureMessage(message: string, options?: object): void;

static captureException(ex: Error, options?: object): void;

static captureBreadcrumb(breadcrumb: SentryBreadcrumb): void;

static clearContext(): Promise<void>;

static context(func: Function, ...args: any[]): void;
static context(options: object, func: Function, ...args: any[]): void;

static wrap(func: Function): Function;
static wrap(options: object, func: Function): Function;
static wrap<T extends Function>(func: T): T;
static wrap<T extends Function>(options: object, func: T): T;

static lastException(): object;
static lastException(): null;

static lastEventId(): object;
static lastEventId(): null;

static setRelease(release: string): void;

static setDist(dist: string): void;

static setVersion(version: string): void;
}
Loading