FR-742: Add sentry (#9)

This commit is contained in:
Rinat Arsaev 2021-09-15 14:50:12 +03:00 committed by GitHub
parent 7c26b87012
commit 79e050b2b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 697 additions and 18 deletions

4
.gitignore vendored
View File

@ -1,14 +1,14 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist
**/dist
/tmp
/out-tsc
# Only exists if Bazel was run
/bazel-out
# dependencies
/node_modules
**/node_modules
# profiling files
chrome-profiler-events*.json

View File

@ -2,4 +2,3 @@ package.json
package-lock.json
node_modules
CHANGELOG.md

View File

@ -33,6 +33,37 @@
}
}
}
},
"sentry": {
"projectType": "library",
"root": "projects/sentry",
"sourceRoot": "projects/sentry/src",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"project": "projects/sentry/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "projects/sentry/tsconfig.lib.prod.json"
},
"development": {
"tsConfig": "projects/sentry/tsconfig.lib.json"
}
},
"defaultConfiguration": "production"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "projects/sentry/src/test.ts",
"tsConfig": "projects/sentry/tsconfig.spec.json",
"karmaConfig": "projects/sentry/karma.conf.js"
}
}
}
}
},
"defaultProject": "id-generator"

396
package-lock.json generated
View File

@ -4129,6 +4129,10 @@
"resolved": "projects/id-generator",
"link": true
},
"node_modules/@rbkmoney/sentry": {
"resolved": "projects/sentry",
"link": true
},
"node_modules/@rollup/plugin-commonjs": {
"version": "19.0.2",
"resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-19.0.2.tgz",
@ -4221,6 +4225,145 @@
"yarn": ">= 1.13.0"
}
},
"node_modules/@sentry/browser": {
"version": "6.12.0",
"resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-6.12.0.tgz",
"integrity": "sha512-wsJi1NLOmfwtPNYxEC50dpDcVY7sdYckzwfqz1/zHrede1mtxpqSw+7iP4bHADOJXuF+ObYYTHND0v38GSXznQ==",
"dependencies": {
"@sentry/core": "6.12.0",
"@sentry/types": "6.12.0",
"@sentry/utils": "6.12.0",
"tslib": "^1.9.3"
},
"engines": {
"node": ">=6"
}
},
"node_modules/@sentry/browser/node_modules/tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
},
"node_modules/@sentry/core": {
"version": "6.12.0",
"resolved": "https://registry.npmjs.org/@sentry/core/-/core-6.12.0.tgz",
"integrity": "sha512-mU/zdjlzFHzdXDZCPZm8OeCw7c9xsbL49Mq0TrY0KJjLt4CJBkiq5SDTGfRsenBLgTedYhe5Z/J8Z+xVVq+MfQ==",
"dependencies": {
"@sentry/hub": "6.12.0",
"@sentry/minimal": "6.12.0",
"@sentry/types": "6.12.0",
"@sentry/utils": "6.12.0",
"tslib": "^1.9.3"
},
"engines": {
"node": ">=6"
}
},
"node_modules/@sentry/core/node_modules/tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
},
"node_modules/@sentry/hub": {
"version": "6.12.0",
"resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-6.12.0.tgz",
"integrity": "sha512-yR/UQVU+ukr42bSYpeqvb989SowIXlKBanU0cqLFDmv5LPCnaQB8PGeXwJAwWhQgx44PARhmB82S6Xor8gYNxg==",
"dependencies": {
"@sentry/types": "6.12.0",
"@sentry/utils": "6.12.0",
"tslib": "^1.9.3"
},
"engines": {
"node": ">=6"
}
},
"node_modules/@sentry/hub/node_modules/tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
},
"node_modules/@sentry/integrations": {
"version": "6.12.0",
"resolved": "https://registry.npmjs.org/@sentry/integrations/-/integrations-6.12.0.tgz",
"integrity": "sha512-M9gsVdWZp5fAFFpTjK2IBuWzW4SBxGAI3tVbYZvVx16S/BY0GsPC1dYpjJx9OTBS/8CmCWdGxnUmjACo/8w1LA==",
"dependencies": {
"@sentry/types": "6.12.0",
"@sentry/utils": "6.12.0",
"localforage": "^1.8.1",
"tslib": "^1.9.3"
},
"engines": {
"node": ">=6"
}
},
"node_modules/@sentry/integrations/node_modules/tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
},
"node_modules/@sentry/minimal": {
"version": "6.12.0",
"resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-6.12.0.tgz",
"integrity": "sha512-r3C54Q1KN+xIqUvcgX9DlcoWE7ezWvFk2pSu1Ojx9De81hVqR9u5T3sdSAP2Xma+um0zr6coOtDJG4WtYlOtsw==",
"dependencies": {
"@sentry/hub": "6.12.0",
"@sentry/types": "6.12.0",
"tslib": "^1.9.3"
},
"engines": {
"node": ">=6"
}
},
"node_modules/@sentry/minimal/node_modules/tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
},
"node_modules/@sentry/tracing": {
"version": "6.12.0",
"resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-6.12.0.tgz",
"integrity": "sha512-u10QHNknPBzbWSUUNMkvuH53sQd5NaBo6YdNPj4p5b7sE7445Sh0PwBpRbY3ZiUUiwyxV59fx9UQ4yVnPGxZQA==",
"dependencies": {
"@sentry/hub": "6.12.0",
"@sentry/minimal": "6.12.0",
"@sentry/types": "6.12.0",
"@sentry/utils": "6.12.0",
"tslib": "^1.9.3"
},
"engines": {
"node": ">=6"
}
},
"node_modules/@sentry/tracing/node_modules/tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
},
"node_modules/@sentry/types": {
"version": "6.12.0",
"resolved": "https://registry.npmjs.org/@sentry/types/-/types-6.12.0.tgz",
"integrity": "sha512-urtgLzE4EDMAYQHYdkgC0Ei9QvLajodK1ntg71bGn0Pm84QUpaqpPDfHRU+i6jLeteyC7kWwa5O5W1m/jrjGXA==",
"engines": {
"node": ">=6"
}
},
"node_modules/@sentry/utils": {
"version": "6.12.0",
"resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-6.12.0.tgz",
"integrity": "sha512-oRHQ7TH5TSsJqoP9Gqq25Jvn9LKexXfAh/OoKwjMhYCGKGhqpDNUIZVgl9DWsGw5A5N5xnQyLOxDfyRV5RshdA==",
"dependencies": {
"@sentry/types": "6.12.0",
"tslib": "^1.9.3"
},
"engines": {
"node": ">=6"
}
},
"node_modules/@sentry/utils/node_modules/tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
},
"node_modules/@tootallnate/once": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz",
@ -6579,9 +6722,9 @@
}
},
"node_modules/conventional-changelog-conventionalcommits": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.6.0.tgz",
"integrity": "sha512-sj9tj3z5cnHaSJCYObA9nISf7eq/YjscLPoq6nmew4SiOjxqL2KRpK20fjnjVbpNDjJ2HR3MoVcWKXwbVvzS0A==",
"version": "4.6.1",
"resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.6.1.tgz",
"integrity": "sha512-lzWJpPZhbM1R0PIzkwzGBCnAkH5RKJzJfFQZcl/D+2lsJxAwGnDKBqn/F4C1RD31GJNn8NuKWQzAZDAVXPp2Mw==",
"dev": true,
"dependencies": {
"compare-func": "^2.0.0",
@ -9579,6 +9722,7 @@
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/flatten/-/flatten-1.0.3.tgz",
"integrity": "sha512-dVsPA/UwQ8+2uoFe5GHtiBMu48dWLTdsuEd7CKGlZlD78r1TTWBvDuFaFGKCo/ZfEr95Uk56vZoX86OsHkUeIg==",
"deprecated": "flatten is deprecated in favor of utility frameworks such as lodash.",
"dev": true
},
"node_modules/follow-redirects": {
@ -10874,8 +11018,7 @@
"node_modules/immediate": {
"version": "3.0.6",
"resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz",
"integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=",
"dev": true
"integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps="
},
"node_modules/import-fresh": {
"version": "3.3.0",
@ -12567,6 +12710,22 @@
"node": ">=8.9.0"
}
},
"node_modules/localforage": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/localforage/-/localforage-1.10.0.tgz",
"integrity": "sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg==",
"dependencies": {
"lie": "3.1.1"
}
},
"node_modules/localforage/node_modules/lie": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz",
"integrity": "sha1-mkNrLMd0bKWd56QfpGmz77dr2H4=",
"dependencies": {
"immediate": "~3.0.5"
}
},
"node_modules/locate-path": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
@ -23404,7 +23563,7 @@
},
"projects/id-generator": {
"name": "@rbkmoney/id-generator",
"version": "0.1.3",
"version": "0.2.0",
"dependencies": {
"short-uuid": "^4.2.0",
"tslib": "^2.2.0"
@ -23413,6 +23572,45 @@
"@angular/common": "^12.1.0",
"@angular/core": "^12.1.0"
}
},
"projects/sentry": {
"name": "@rbkmoney/sentry",
"version": "0.0.0",
"dependencies": {
"@sentry/angular": "^6.12.0",
"@sentry/integrations": "^6.12.0",
"@sentry/tracing": "^6.12.0",
"tslib": "^2.2.0"
},
"peerDependencies": {
"@angular/common": "^12.1.0",
"@angular/core": "^12.1.0"
}
},
"projects/sentry/node_modules/@sentry/angular": {
"version": "6.12.0",
"resolved": "https://registry.npmjs.org/@sentry/angular/-/angular-6.12.0.tgz",
"integrity": "sha512-s51kWUJkXm0nVLnV7kU6z82NJN0DACiCK7Su8P9/xf178eORFBe9CHGS4Zi0LxYYHRZ+bc+u8lLLAzT2u1bkjw==",
"dependencies": {
"@sentry/browser": "6.12.0",
"@sentry/types": "6.12.0",
"@sentry/utils": "6.12.0",
"rxjs": "^6.6.0",
"tslib": "^1.9.3"
},
"engines": {
"node": ">=6"
},
"peerDependencies": {
"@angular/common": "10.x || 11.x || 12.x",
"@angular/core": "10.x || 11.x || 12.x",
"@angular/router": "10.x || 11.x || 12.x"
}
},
"projects/sentry/node_modules/@sentry/angular/node_modules/tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
}
},
"dependencies": {
@ -26412,6 +26610,36 @@
"tslib": "^2.2.0"
}
},
"@rbkmoney/sentry": {
"version": "file:projects/sentry",
"requires": {
"@sentry/angular": "^6.12.0",
"@sentry/integrations": "^6.12.0",
"@sentry/tracing": "^6.12.0",
"tslib": "^2.2.0"
},
"dependencies": {
"@sentry/angular": {
"version": "6.12.0",
"resolved": "https://registry.npmjs.org/@sentry/angular/-/angular-6.12.0.tgz",
"integrity": "sha512-s51kWUJkXm0nVLnV7kU6z82NJN0DACiCK7Su8P9/xf178eORFBe9CHGS4Zi0LxYYHRZ+bc+u8lLLAzT2u1bkjw==",
"requires": {
"@sentry/browser": "6.12.0",
"@sentry/types": "6.12.0",
"@sentry/utils": "6.12.0",
"rxjs": "^6.6.0",
"tslib": "^1.9.3"
},
"dependencies": {
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
}
}
}
}
},
"@rollup/plugin-commonjs": {
"version": "19.0.2",
"resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-19.0.2.tgz",
@ -26480,6 +26708,135 @@
"jsonc-parser": "3.0.0"
}
},
"@sentry/browser": {
"version": "6.12.0",
"resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-6.12.0.tgz",
"integrity": "sha512-wsJi1NLOmfwtPNYxEC50dpDcVY7sdYckzwfqz1/zHrede1mtxpqSw+7iP4bHADOJXuF+ObYYTHND0v38GSXznQ==",
"requires": {
"@sentry/core": "6.12.0",
"@sentry/types": "6.12.0",
"@sentry/utils": "6.12.0",
"tslib": "^1.9.3"
},
"dependencies": {
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
}
}
},
"@sentry/core": {
"version": "6.12.0",
"resolved": "https://registry.npmjs.org/@sentry/core/-/core-6.12.0.tgz",
"integrity": "sha512-mU/zdjlzFHzdXDZCPZm8OeCw7c9xsbL49Mq0TrY0KJjLt4CJBkiq5SDTGfRsenBLgTedYhe5Z/J8Z+xVVq+MfQ==",
"requires": {
"@sentry/hub": "6.12.0",
"@sentry/minimal": "6.12.0",
"@sentry/types": "6.12.0",
"@sentry/utils": "6.12.0",
"tslib": "^1.9.3"
},
"dependencies": {
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
}
}
},
"@sentry/hub": {
"version": "6.12.0",
"resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-6.12.0.tgz",
"integrity": "sha512-yR/UQVU+ukr42bSYpeqvb989SowIXlKBanU0cqLFDmv5LPCnaQB8PGeXwJAwWhQgx44PARhmB82S6Xor8gYNxg==",
"requires": {
"@sentry/types": "6.12.0",
"@sentry/utils": "6.12.0",
"tslib": "^1.9.3"
},
"dependencies": {
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
}
}
},
"@sentry/integrations": {
"version": "6.12.0",
"resolved": "https://registry.npmjs.org/@sentry/integrations/-/integrations-6.12.0.tgz",
"integrity": "sha512-M9gsVdWZp5fAFFpTjK2IBuWzW4SBxGAI3tVbYZvVx16S/BY0GsPC1dYpjJx9OTBS/8CmCWdGxnUmjACo/8w1LA==",
"requires": {
"@sentry/types": "6.12.0",
"@sentry/utils": "6.12.0",
"localforage": "^1.8.1",
"tslib": "^1.9.3"
},
"dependencies": {
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
}
}
},
"@sentry/minimal": {
"version": "6.12.0",
"resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-6.12.0.tgz",
"integrity": "sha512-r3C54Q1KN+xIqUvcgX9DlcoWE7ezWvFk2pSu1Ojx9De81hVqR9u5T3sdSAP2Xma+um0zr6coOtDJG4WtYlOtsw==",
"requires": {
"@sentry/hub": "6.12.0",
"@sentry/types": "6.12.0",
"tslib": "^1.9.3"
},
"dependencies": {
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
}
}
},
"@sentry/tracing": {
"version": "6.12.0",
"resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-6.12.0.tgz",
"integrity": "sha512-u10QHNknPBzbWSUUNMkvuH53sQd5NaBo6YdNPj4p5b7sE7445Sh0PwBpRbY3ZiUUiwyxV59fx9UQ4yVnPGxZQA==",
"requires": {
"@sentry/hub": "6.12.0",
"@sentry/minimal": "6.12.0",
"@sentry/types": "6.12.0",
"@sentry/utils": "6.12.0",
"tslib": "^1.9.3"
},
"dependencies": {
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
}
}
},
"@sentry/types": {
"version": "6.12.0",
"resolved": "https://registry.npmjs.org/@sentry/types/-/types-6.12.0.tgz",
"integrity": "sha512-urtgLzE4EDMAYQHYdkgC0Ei9QvLajodK1ntg71bGn0Pm84QUpaqpPDfHRU+i6jLeteyC7kWwa5O5W1m/jrjGXA=="
},
"@sentry/utils": {
"version": "6.12.0",
"resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-6.12.0.tgz",
"integrity": "sha512-oRHQ7TH5TSsJqoP9Gqq25Jvn9LKexXfAh/OoKwjMhYCGKGhqpDNUIZVgl9DWsGw5A5N5xnQyLOxDfyRV5RshdA==",
"requires": {
"@sentry/types": "6.12.0",
"tslib": "^1.9.3"
},
"dependencies": {
"tslib": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
}
}
},
"@tootallnate/once": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz",
@ -28420,9 +28777,9 @@
}
},
"conventional-changelog-conventionalcommits": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.6.0.tgz",
"integrity": "sha512-sj9tj3z5cnHaSJCYObA9nISf7eq/YjscLPoq6nmew4SiOjxqL2KRpK20fjnjVbpNDjJ2HR3MoVcWKXwbVvzS0A==",
"version": "4.6.1",
"resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.6.1.tgz",
"integrity": "sha512-lzWJpPZhbM1R0PIzkwzGBCnAkH5RKJzJfFQZcl/D+2lsJxAwGnDKBqn/F4C1RD31GJNn8NuKWQzAZDAVXPp2Mw==",
"dev": true,
"requires": {
"compare-func": "^2.0.0",
@ -31775,8 +32132,7 @@
"immediate": {
"version": "3.0.6",
"resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz",
"integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=",
"dev": true
"integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps="
},
"import-fresh": {
"version": "3.3.0",
@ -33087,6 +33443,24 @@
"json5": "^2.1.2"
}
},
"localforage": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/localforage/-/localforage-1.10.0.tgz",
"integrity": "sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg==",
"requires": {
"lie": "3.1.1"
},
"dependencies": {
"lie": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz",
"integrity": "sha1-mkNrLMd0bKWd56QfpGmz77dr2H4=",
"requires": {
"immediate": "~3.0.5"
}
}
}
},
"locate-path": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",

View File

@ -3,7 +3,7 @@
"version": "0.0.0",
"scripts": {
"prepare": "husky install",
"build": "ng build",
"build": "ng build id-generator && ng build sentry",
"test": "ng test --browsers=ChromeHeadless --watch=false",
"fix": "npm run prettier-fix",
"parallel-cmd": "concurrently --prefix-colors magenta,green",
@ -42,6 +42,7 @@
"@angular-eslint/eslint-plugin": "^12.3.1",
"@angular/cli": "~12.1.4",
"@angular/compiler-cli": "~12.1.4",
"@commitlint/config-conventional": "^13.1.0",
"@types/jasmine": "~3.6.0",
"@types/node": "^12.11.1",
"codelyzer": "^6.0.0",

View File

@ -1 +0,0 @@
**/dist/

View File

@ -1,6 +1,6 @@
{
"name": "@rbkmoney/id-generator",
"version": "0.2.0",
"version": "0.2.1-pr9.0",
"description": "ID generator",
"author": "rbkmoney",
"scripts": {

1
projects/sentry/.npmrc Normal file
View File

@ -0,0 +1 @@
@rbkmoney:registry=https://npm.pkg.github.com/

25
projects/sentry/README.md Normal file
View File

@ -0,0 +1,25 @@
# Sentry
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 12.1.0.
## Code scaffolding
Run `ng generate component component-name --project sentry` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project sentry`.
> Note: Don't forget to add `--project sentry` or else it will be added to the default project in your `angular.json` file.
## Build
Run `ng build sentry` to build the project. The build artifacts will be stored in the `dist/` directory.
## Publishing
After building your library with `ng build sentry`, go to the dist folder `cd dist/sentry` and run `npm publish`.
## Running unit tests
Run `ng test sentry` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.

View File

@ -0,0 +1,41 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma'),
],
client: {
jasmine: {
// you can add configuration options for Jasmine here
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
// for example, you can disable the random execution with `random: false`
// or set a specific seed with `seed: 4321`
},
clearContext: false, // leave Jasmine Spec Runner output visible in browser
},
jasmineHtmlReporter: {
suppressAll: true, // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, '../../coverage/sentry'),
subdir: '.',
reporters: [{ type: 'html' }, { type: 'text-summary' }],
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true,
});
};

View File

@ -0,0 +1,8 @@
{
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "dist",
"allowedNonPeerDependencies": ["@sentry/angular", "@sentry/integrations", "@sentry/tracing"],
"lib": {
"entryFile": "src/public-api.ts"
}
}

View File

@ -0,0 +1,25 @@
{
"name": "@rbkmoney/sentry",
"version": "0.0.1-pr9.0",
"scripts": {
"build": "ng build",
"postpublish": "rm -rf dist/"
},
"repository": {
"type": "git",
"url": "https://github.com/rbkmoney/ng-core"
},
"publishConfig": {
"registry": "https://npm.pkg.github.com/@rbkmoney"
},
"peerDependencies": {
"@angular/common": "^12.1.0",
"@angular/core": "^12.1.0"
},
"dependencies": {
"@sentry/angular": "^6.12.0",
"@sentry/integrations": "^6.12.0",
"@sentry/tracing": "^6.12.0",
"tslib": "^2.2.0"
}
}

View File

@ -0,0 +1,15 @@
import { ErrorHandler, Provider } from '@angular/core';
import { Router } from '@angular/router';
import { ErrorHandlerOptions, TraceService } from '@sentry/angular';
import { ErrorHandlerService as CustomErrorHandlerService } from './error-handler.service';
export function createSentryProviders(options?: ErrorHandlerOptions): Provider[] {
return [
{
provide: ErrorHandler,
useFactory: () => new CustomErrorHandlerService(options),
},
{ provide: TraceService, deps: [Router] },
];
}

View File

@ -0,0 +1,19 @@
import { TestBed } from '@angular/core/testing';
import { ErrorHandlerService } from './error-handler.service';
import { ErrorHandler } from '@angular/core';
describe('ErrorHandlerService', () => {
let service: ErrorHandler;
beforeEach(() => {
TestBed.configureTestingModule({
providers: [{ provide: ErrorHandler, useFactory: () => new ErrorHandlerService() }],
});
service = TestBed.inject(ErrorHandler);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});

View File

@ -0,0 +1,20 @@
import { Injectable } from '@angular/core';
import { captureException, SentryErrorHandler } from '@sentry/angular';
import { runOutsideAngular } from '@sentry/angular/dist/zone';
import { isChunkLoadError } from './utils';
@Injectable({ providedIn: 'root' })
export class ErrorHandlerService extends SentryErrorHandler {
handleError(error: unknown): void {
this.handleChunkLoadError(error);
super.handleError(error);
}
private handleChunkLoadError(error: unknown): void {
if (isChunkLoadError(error)) {
runOutsideAngular(() => captureException('Chunk load error captured'));
window.location.reload();
}
}
}

View File

@ -0,0 +1,4 @@
export * from './init-sentry';
export * from './error-handler.service';
export * from './sentry-http-interceptor';
export * from './create-sentry-providers';

View File

@ -0,0 +1,24 @@
import * as Sentry from '@sentry/angular';
import { BrowserOptions } from '@sentry/browser/dist/backend';
import { Integrations } from '@sentry/tracing';
export type InitSentryOptions = BrowserOptions;
export const initSentry = (options: InitSentryOptions): void => {
if (!options.dsn) {
return null;
}
Sentry.init({
integrations: [
new Integrations.BrowserTracing({
routingInstrumentation: Sentry.routingInstrumentation,
}),
],
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
tracesSampleRate: 1,
autoSessionTracking: true,
...options,
});
};

View File

@ -0,0 +1,24 @@
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { setTag } from '@sentry/angular';
import { Observable, throwError } from 'rxjs';
import { catchError } from 'rxjs/operators';
@Injectable({ providedIn: 'root' })
export class SentryHttpInterceptor implements HttpInterceptor {
intercept(req: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {
return next.handle(req).pipe(
catchError((resp) => {
this.interceptRequest(req);
return throwError(resp);
})
);
}
private interceptRequest(req: HttpRequest<unknown>): void {
const xRequestId = req.headers.get('x-request-id');
if (!xRequestId) {
setTag('x-request-id', xRequestId);
}
}
}

View File

@ -0,0 +1 @@
export * from './is-chunk-load-error';

View File

@ -0,0 +1,4 @@
export function isChunkLoadError(error: unknown): boolean {
const message = (error as { message?: string })?.message;
return !!message && (/Loading chunk [\d]+ failed/.test(message) || /ChunkLoadError [\d]+ failed/.test(message));
}

View File

@ -0,0 +1,5 @@
/*
* Public API Surface of sentry
*/
export * from './lib';

View File

@ -0,0 +1,24 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
import 'zone.js';
import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
declare const require: {
context(
path: string,
deep?: boolean,
filter?: RegExp
): {
keys(): string[];
<T>(id: string): T;
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);

View File

@ -0,0 +1,14 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/lib",
"target": "es2015",
"declaration": true,
"declarationMap": true,
"inlineSources": true,
"types": [],
"lib": ["dom", "es2018"]
},
"exclude": ["src/test.ts", "**/*.spec.ts"]
}

View File

@ -0,0 +1,10 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "./tsconfig.lib.json",
"compilerOptions": {
"declarationMap": false
},
"angularCompilerOptions": {
"compilationMode": "partial"
}
}

View File

@ -0,0 +1,10 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/spec",
"types": ["jasmine"]
},
"files": ["src/test.ts"],
"include": ["**/*.spec.ts", "**/*.d.ts"]
}

View File

@ -6,7 +6,8 @@
"sourceMap": true,
"declaration": false,
"paths": {
"id-generator": ["dist/id-generator/id-generator", "dist/id-generator"]
"id-generator": ["dist/id-generator/id-generator", "dist/id-generator"],
"sentry": ["dist/sentry/sentry", "dist/sentry"]
},
"downlevelIteration": true,
"experimentalDecorators": true,