Skip to content

Commit

Permalink
fix: N 7 update
Browse files Browse the repository at this point in the history
  • Loading branch information
farfromrefug committed Nov 2, 2020
1 parent cc971db commit 1a03eec
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 39 deletions.
35 changes: 18 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,29 @@
"plugin.watch": "npm run plugin.watch.tsc & npm run plugin.watch.android & npm run plugin.watch.ios"
},
"devDependencies": {
"@commitlint/cli": "^9.1.2",
"@commitlint/config-conventional": "^9.1.2",
"@nativescript/core": "6.3.2",
"@sentry/browser": "^5.22.3",
"@sentry/core": "^5.22.3",
"@sentry/hub": "^5.22.3",
"@sentry/integrations": "^5.22.3",
"@sentry/minimal": "^5.22.3",
"@sentry/types": "^5.22.3",
"@sentry/utils": "^5.22.3",
"@types/node": "^13.5.0",
"@typescript-eslint/eslint-plugin": "4.0.1",
"@typescript-eslint/parser": "4.0.1",
"eslint": "7.8.1",
"husky": "^4.2.5",
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@nativescript/core": "7.0.13",
"@nativescript/types-ios": "7.0.4",
"@nativescript/types-android": "7.0.4",
"@sentry/browser": "^5.27.2",
"@sentry/core": "^5.27.2",
"@sentry/hub": "^5.27.2",
"@sentry/integrations": "^5.27.2",
"@sentry/minimal": "^5.27.2",
"@sentry/types": "^5.27.2",
"@sentry/utils": "^5.27.2",
"@types/node": "^14.14.6",
"@typescript-eslint/eslint-plugin": "4.6.0",
"@typescript-eslint/parser": "4.6.0",
"eslint": "7.12.1",
"husky": "^4.3.0",
"lerna": "^3.22.1",
"npm-watch": "^0.7.0",
"prompt": "^1.0.0",
"rimraf": "^3.0.2",
"stacktrace-parser": "^0.1.10",
"tns-platform-declarations": "^6.5.15",
"typescript": "~4.0.2"
"typescript": "~3.9.7"
},
"repository": {
"type": "git",
Expand Down
16 changes: 8 additions & 8 deletions plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@
},
"homepage": "https://github.com/Akylas/nativescript-akylas-sentry#readme",
"dependencies": {
"@sentry/browser": "^5.22.3",
"@sentry/core": "^5.22.3",
"@sentry/hub": "^5.22.3",
"@sentry/integrations": "^5.22.3",
"@sentry/minimal": "^5.22.3",
"@sentry/types": "^5.22.3",
"@sentry/utils": "^5.22.3",
"@sentry/browser": "^5.27.2",
"@sentry/core": "^5.27.2",
"@sentry/hub": "^5.27.2",
"@sentry/integrations": "^5.27.2",
"@sentry/minimal": "^5.27.2",
"@sentry/types": "^5.27.2",
"@sentry/utils": "^5.27.2",
"@sentry/wizard": "^1.1.4",
"stacktrace-parser": "0.1.10"
},
"gitHead": "1e799d9f3a3eeb19c0fc4188be82a6cded4ea727"
}
}
5 changes: 3 additions & 2 deletions references.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/// <reference path="./node_modules/tns-platform-declarations/ios.d.ts" />
/// <reference path="./node_modules/tns-platform-declarations/android-26.d.ts" />
/* eslint-disable spaced-comment */
/// <reference path="./node_modules/@nativescript/types-ios/lib/ios.d.ts" />
/// <reference path="./node_modules/@nativescript/types-android/lib/android-26.d.ts" />
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const misc = require('@sentry/utils/esm/misc');
import { logger } from '@sentry/utils';
logger.disable(); // this crashes for {N} for now
export { Breadcrumb, Request, SdkInfo, Event, Exception, Response, Severity, StackFrame, Stacktrace, Status, Thread, User } from '@sentry/types';
Expand Down
3 changes: 2 additions & 1 deletion src/integrations/debugsymbolicator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ export class DebugSymbolicator implements Integration {
if (!self || hint === undefined || hint.originalException === undefined) {
return event;
}
const error: NativescriptError = hint.originalException as any;
// @ts-ignore
const error: NativescriptError = hint.originalException;

// const parseErrorStack = require('react-native/Libraries/Core/Devtools/parseErrorStack');
const stack = parseErrorStack(error);
Expand Down
10 changes: 5 additions & 5 deletions src/integrations/nativescripterrorhandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { logger } from '@sentry/utils';

import { NativescriptClient } from '../client';

import * as application from '@nativescript/core/application';
import * as trace from '@nativescript/core/trace';
import {Application, Trace} from '@nativescript/core';

/** NativescriptErrorHandlers Options */
export interface NativescriptErrorHandlersOptions {
Expand Down Expand Up @@ -53,7 +52,7 @@ export class NativescriptErrorHandlers implements Integration {
*/
private _handleUnhandledRejections(): void {
if (this._options.uncaughtErrors) {
application.on(application.uncaughtErrorEvent, this.globalHanderEvent, this);
Application.on(Application.uncaughtErrorEvent, this.globalHanderEvent, this);
// const tracking = require('promise/setimmediate/rejection-tracking');
// tracking.disable();
// tracking.enable({
Expand Down Expand Up @@ -110,6 +109,7 @@ export class NativescriptErrorHandlers implements Integration {
// Just for a better dev experience
if (client) {
const timeout = client.getOptions().shutdownTimeout || 2000;
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
(client.flush(timeout) as Promise<any>)
.then(() => {
// defaultHandler(error, isFatal);
Expand All @@ -129,9 +129,9 @@ export class NativescriptErrorHandlers implements Integration {
private _handleOnError(): void {
if (this._options.traceErrorHandler) {
// let handlingFatal = false;
application.on(application.discardedErrorEvent, this.globalHanderEvent, this);
Application.on(Application.discardedErrorEvent, this.globalHanderEvent, this);

trace.setErrorHandler({
Trace.setErrorHandler({
handlerError: this.globalHander
});
// const defaultHandler = ErrorUtils.getGlobalHandler && ErrorUtils.getGlobalHandler();
Expand Down
6 changes: 3 additions & 3 deletions src/nssentry.android.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { android as appAndroid } from '@nativescript/core/application';
import { Application } from '@nativescript/core';
import { Event, Response, Status } from '@sentry/types';
import { NativescriptOptions } from './backend';
import { rewriteFrameIntegration } from './sdk';
Expand All @@ -9,7 +9,7 @@ export namespace NSSentry {
export const nativeTransport = true;

export function fetchRelease() {
const ctx = appAndroid.context as android.content.Context;
const ctx = Application.android.context as android.content.Context;
const packageInfo = ctx.getPackageManager().getPackageInfo(ctx.getPackageName(), 0);
return {
id: packageInfo.packageName,
Expand Down Expand Up @@ -322,7 +322,7 @@ export namespace NSSentry {

try {
io.sentry.android.core.SentryAndroid.init(
appAndroid.context,
Application.android.context,
new io.sentry.core.Sentry.OptionsConfiguration({
configure(config) {
config.setLogger(new io.sentry.core.SystemOutLogger());
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
"outDir": "./plugin",
"rootDir": "src",
"paths": {
"nativescript-akylas-sentry": ["./src/index"],
"*": ["./node_modules/tns-core-modules/*", "./node_modules/*"]
"@nativescript-community/sentry": ["./src/index"]
}
},
"include": ["src/**/*.ts", "references.d.ts", "src/references.d.ts"],
Expand Down

0 comments on commit 1a03eec

Please sign in to comment.