Skip to content

Commit 1a03eec

Browse files
committed
fix: N 7 update
1 parent cc971db commit 1a03eec

File tree

8 files changed

+40
-39
lines changed

8 files changed

+40
-39
lines changed

package.json

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,29 @@
1616
"plugin.watch": "npm run plugin.watch.tsc & npm run plugin.watch.android & npm run plugin.watch.ios"
1717
},
1818
"devDependencies": {
19-
"@commitlint/cli": "^9.1.2",
20-
"@commitlint/config-conventional": "^9.1.2",
21-
"@nativescript/core": "6.3.2",
22-
"@sentry/browser": "^5.22.3",
23-
"@sentry/core": "^5.22.3",
24-
"@sentry/hub": "^5.22.3",
25-
"@sentry/integrations": "^5.22.3",
26-
"@sentry/minimal": "^5.22.3",
27-
"@sentry/types": "^5.22.3",
28-
"@sentry/utils": "^5.22.3",
29-
"@types/node": "^13.5.0",
30-
"@typescript-eslint/eslint-plugin": "4.0.1",
31-
"@typescript-eslint/parser": "4.0.1",
32-
"eslint": "7.8.1",
33-
"husky": "^4.2.5",
19+
"@commitlint/cli": "^11.0.0",
20+
"@commitlint/config-conventional": "^11.0.0",
21+
"@nativescript/core": "7.0.13",
22+
"@nativescript/types-ios": "7.0.4",
23+
"@nativescript/types-android": "7.0.4",
24+
"@sentry/browser": "^5.27.2",
25+
"@sentry/core": "^5.27.2",
26+
"@sentry/hub": "^5.27.2",
27+
"@sentry/integrations": "^5.27.2",
28+
"@sentry/minimal": "^5.27.2",
29+
"@sentry/types": "^5.27.2",
30+
"@sentry/utils": "^5.27.2",
31+
"@types/node": "^14.14.6",
32+
"@typescript-eslint/eslint-plugin": "4.6.0",
33+
"@typescript-eslint/parser": "4.6.0",
34+
"eslint": "7.12.1",
35+
"husky": "^4.3.0",
3436
"lerna": "^3.22.1",
3537
"npm-watch": "^0.7.0",
3638
"prompt": "^1.0.0",
3739
"rimraf": "^3.0.2",
3840
"stacktrace-parser": "^0.1.10",
39-
"tns-platform-declarations": "^6.5.15",
40-
"typescript": "~4.0.2"
41+
"typescript": "~3.9.7"
4142
},
4243
"repository": {
4344
"type": "git",

plugin/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@
3030
},
3131
"homepage": "https://github.com/Akylas/nativescript-akylas-sentry#readme",
3232
"dependencies": {
33-
"@sentry/browser": "^5.22.3",
34-
"@sentry/core": "^5.22.3",
35-
"@sentry/hub": "^5.22.3",
36-
"@sentry/integrations": "^5.22.3",
37-
"@sentry/minimal": "^5.22.3",
38-
"@sentry/types": "^5.22.3",
39-
"@sentry/utils": "^5.22.3",
33+
"@sentry/browser": "^5.27.2",
34+
"@sentry/core": "^5.27.2",
35+
"@sentry/hub": "^5.27.2",
36+
"@sentry/integrations": "^5.27.2",
37+
"@sentry/minimal": "^5.27.2",
38+
"@sentry/types": "^5.27.2",
39+
"@sentry/utils": "^5.27.2",
4040
"@sentry/wizard": "^1.1.4",
4141
"stacktrace-parser": "0.1.10"
4242
},
4343
"gitHead": "1e799d9f3a3eeb19c0fc4188be82a6cded4ea727"
44-
}
44+
}

references.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
/// <reference path="./node_modules/tns-platform-declarations/ios.d.ts" />
2-
/// <reference path="./node_modules/tns-platform-declarations/android-26.d.ts" />
1+
/* eslint-disable spaced-comment */
2+
/// <reference path="./node_modules/@nativescript/types-ios/lib/ios.d.ts" />
3+
/// <reference path="./node_modules/@nativescript/types-android/lib/android-26.d.ts" />

src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
const misc = require('@sentry/utils/esm/misc');
21
import { logger } from '@sentry/utils';
32
logger.disable(); // this crashes for {N} for now
43
export { Breadcrumb, Request, SdkInfo, Event, Exception, Response, Severity, StackFrame, Stacktrace, Status, Thread, User } from '@sentry/types';

src/integrations/debugsymbolicator.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ export class DebugSymbolicator implements Integration {
9090
if (!self || hint === undefined || hint.originalException === undefined) {
9191
return event;
9292
}
93-
const error: NativescriptError = hint.originalException as any;
93+
// @ts-ignore
94+
const error: NativescriptError = hint.originalException;
9495

9596
// const parseErrorStack = require('react-native/Libraries/Core/Devtools/parseErrorStack');
9697
const stack = parseErrorStack(error);

src/integrations/nativescripterrorhandlers.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import { logger } from '@sentry/utils';
55

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

8-
import * as application from '@nativescript/core/application';
9-
import * as trace from '@nativescript/core/trace';
8+
import {Application, Trace} from '@nativescript/core';
109

1110
/** NativescriptErrorHandlers Options */
1211
export interface NativescriptErrorHandlersOptions {
@@ -53,7 +52,7 @@ export class NativescriptErrorHandlers implements Integration {
5352
*/
5453
private _handleUnhandledRejections(): void {
5554
if (this._options.uncaughtErrors) {
56-
application.on(application.uncaughtErrorEvent, this.globalHanderEvent, this);
55+
Application.on(Application.uncaughtErrorEvent, this.globalHanderEvent, this);
5756
// const tracking = require('promise/setimmediate/rejection-tracking');
5857
// tracking.disable();
5958
// tracking.enable({
@@ -110,6 +109,7 @@ export class NativescriptErrorHandlers implements Integration {
110109
// Just for a better dev experience
111110
if (client) {
112111
const timeout = client.getOptions().shutdownTimeout || 2000;
112+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
113113
(client.flush(timeout) as Promise<any>)
114114
.then(() => {
115115
// defaultHandler(error, isFatal);
@@ -129,9 +129,9 @@ export class NativescriptErrorHandlers implements Integration {
129129
private _handleOnError(): void {
130130
if (this._options.traceErrorHandler) {
131131
// let handlingFatal = false;
132-
application.on(application.discardedErrorEvent, this.globalHanderEvent, this);
132+
Application.on(Application.discardedErrorEvent, this.globalHanderEvent, this);
133133

134-
trace.setErrorHandler({
134+
Trace.setErrorHandler({
135135
handlerError: this.globalHander
136136
});
137137
// const defaultHandler = ErrorUtils.getGlobalHandler && ErrorUtils.getGlobalHandler();

src/nssentry.android.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { android as appAndroid } from '@nativescript/core/application';
1+
import { Application } from '@nativescript/core';
22
import { Event, Response, Status } from '@sentry/types';
33
import { NativescriptOptions } from './backend';
44
import { rewriteFrameIntegration } from './sdk';
@@ -9,7 +9,7 @@ export namespace NSSentry {
99
export const nativeTransport = true;
1010

1111
export function fetchRelease() {
12-
const ctx = appAndroid.context as android.content.Context;
12+
const ctx = Application.android.context as android.content.Context;
1313
const packageInfo = ctx.getPackageManager().getPackageInfo(ctx.getPackageName(), 0);
1414
return {
1515
id: packageInfo.packageName,
@@ -322,7 +322,7 @@ export namespace NSSentry {
322322

323323
try {
324324
io.sentry.android.core.SentryAndroid.init(
325-
appAndroid.context,
325+
Application.android.context,
326326
new io.sentry.core.Sentry.OptionsConfiguration({
327327
configure(config) {
328328
config.setLogger(new io.sentry.core.SystemOutLogger());

tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
"outDir": "./plugin",
2424
"rootDir": "src",
2525
"paths": {
26-
"nativescript-akylas-sentry": ["./src/index"],
27-
"*": ["./node_modules/tns-core-modules/*", "./node_modules/*"]
26+
"@nativescript-community/sentry": ["./src/index"]
2827
}
2928
},
3029
"include": ["src/**/*.ts", "references.d.ts", "src/references.d.ts"],

0 commit comments

Comments
 (0)