Skip to content

Commit 0bae2bd

Browse files
authored
fix: Remove angular types (#1986)
1 parent 38ea918 commit 0bae2bd

File tree

8 files changed

+17
-15
lines changed

8 files changed

+17
-15
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 5.0.4
4+
5+
- [integrations] fix: Not requiring angular types
6+
37
## 5.0.3
48

59
- [hub] fix: Don't reset registry when there is no hub on the carrier #1969

packages/integrations/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"@sentry/utils": "5.0.0"
2222
},
2323
"devDependencies": {
24-
"@types/angular": "^1.6.54",
2524
"chai": "^4.1.2",
2625
"jest": "^24.5.0",
2726
"npm-run-all": "^4.1.2",

packages/integrations/src/angular.ts

+9-5
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export class Angular implements Integration {
2828
/**
2929
* Angular's instance
3030
*/
31-
private readonly _angular: ng.IAngularStatic;
31+
private readonly _angular: any;
3232

3333
/**
3434
* Returns current hub.
@@ -38,9 +38,9 @@ export class Angular implements Integration {
3838
/**
3939
* @inheritDoc
4040
*/
41-
public constructor(options: { angular?: ng.IAngularStatic } = {}) {
41+
public constructor(options: { angular?: any } = {}) {
4242
// tslint:disable-next-line: no-unsafe-any
43-
this._angular = options.angular || (getGlobalObject().angular as ng.IAngularStatic);
43+
this._angular = options.angular || getGlobalObject().angular;
4444
}
4545

4646
/**
@@ -54,18 +54,21 @@ export class Angular implements Integration {
5454

5555
this._getCurrentHub = getCurrentHub;
5656

57+
// tslint:disable: no-unsafe-any
5758
this._angular.module(Angular.moduleName, []).config([
5859
'$provide',
59-
($provide: ng.auto.IProvideService) => {
60+
($provide: any) => {
6061
$provide.decorator('$exceptionHandler', ['$delegate', this._$exceptionHandlerDecorator.bind(this)]);
6162
},
6263
]);
64+
// tslint:enable: no-unsafe-any
6365
}
6466

6567
/**
6668
* Angular's exceptionHandler for Sentry integration
6769
*/
68-
private _$exceptionHandlerDecorator($delegate: ng.IExceptionHandlerService): ng.IExceptionHandlerService {
70+
// tslint:disable-next-line: no-unsafe-any
71+
private _$exceptionHandlerDecorator($delegate: any): any {
6972
return (exception: Error, cause?: string) => {
7073
const hub = this._getCurrentHub && this._getCurrentHub();
7174

@@ -100,6 +103,7 @@ export class Angular implements Integration {
100103
hub.captureException(exception);
101104
});
102105
}
106+
// tslint:disable-next-line: no-unsafe-any
103107
$delegate(exception, cause);
104108
};
105109
}

packages/integrations/tsconfig.build.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"compilerOptions": {
44
"baseUrl": ".",
55
"outDir": "dist",
6-
"types": ["node", "angular"]
6+
"types": ["node"]
77
},
88
"include": ["src/**/*.ts"]
99
}

packages/integrations/tsconfig.esm.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"compilerOptions": {
44
"baseUrl": ".",
55
"outDir": "esm",
6-
"types": ["node", "angular"]
6+
"types": ["node"]
77
},
88
"include": ["src/**/*"]
99
}

packages/integrations/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"exclude": ["dist"],
55
"compilerOptions": {
66
"rootDir": ".",
7-
"types": ["node", "jest", "angular"]
7+
"types": ["node", "jest"]
88
}
99
}

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"extends": "./packages/typescript/tsconfig.json",
33
"compilerOptions": {
44
"baseUrl": "packages",
5-
"types": ["node", "angular"],
5+
"types": ["node"],
66
"paths": {
77
"@sentry/*": ["*/src"],
88
"raven-js": ["raven-js/src/singleton.js"],

yarn.lock

-5
Original file line numberDiff line numberDiff line change
@@ -1140,11 +1140,6 @@
11401140
highlight.js "^9.15.6"
11411141
marked "^0.6.1"
11421142

1143-
"@types/angular@^1.6.54":
1144-
version "1.6.54"
1145-
resolved "https://registry.yarnpkg.com/@types/angular/-/angular-1.6.54.tgz#f9d5a03e4da7b021a6dabe5d63e899ed4567a5bd"
1146-
integrity sha512-xA1FuozWXeRQ7FClUbvk8ePL+dydBeDoCWRPFTHU5+8uvVtIIfLGiHA8CMkwsbddFCYnTDVbLxG85a/HBx7LtA==
1147-
11481143
"@types/babel__core@^7.1.0":
11491144
version "7.1.0"
11501145
resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.0.tgz#710f2487dda4dcfd010ca6abb2b4dc7394365c51"

0 commit comments

Comments
 (0)