@commercetools-frontend/sentry 25.0.0 → 25.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
6
6
|
var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
7
7
|
var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
8
|
-
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
9
8
|
var Sentry = require('@sentry/react');
|
|
10
9
|
var browser = require('@sentry/browser');
|
|
11
10
|
var history = require('@commercetools-frontend/browser-history');
|
|
@@ -40,13 +39,12 @@ function _interopNamespace(e) {
|
|
|
40
39
|
var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
41
40
|
var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
|
|
42
41
|
var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
|
|
43
|
-
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
44
42
|
var Sentry__namespace = /*#__PURE__*/_interopNamespace(Sentry);
|
|
45
43
|
var history__default = /*#__PURE__*/_interopDefault(history);
|
|
46
44
|
var _Reflect$construct__default = /*#__PURE__*/_interopDefault(_Reflect$construct);
|
|
47
45
|
|
|
48
46
|
// NOTE: This string will be replaced on build time with the package version.
|
|
49
|
-
var version = "25.
|
|
47
|
+
var version = "25.1.0";
|
|
50
48
|
|
|
51
49
|
const makeErrorToCapture = error => {
|
|
52
50
|
if (error instanceof Error) return error;
|
|
@@ -93,11 +91,10 @@ const redactUnsafeEventFields = event => {
|
|
|
93
91
|
};
|
|
94
92
|
const boot = () => {
|
|
95
93
|
if (window.app.trackingSentry && window.app.trackingSentry !== 'null') {
|
|
96
|
-
var _context2;
|
|
97
94
|
Sentry__namespace.init({
|
|
98
95
|
dsn: window.app.trackingSentry,
|
|
99
96
|
release: window.app.revision,
|
|
100
|
-
environment:
|
|
97
|
+
environment: `${window.app.env}-${window.app.location}`,
|
|
101
98
|
// In order to reduce the noise in sentry we only track errors that come
|
|
102
99
|
// from our code and ignore errors that come from other services
|
|
103
100
|
// https://blog.sentry.io/2017/03/27/tips-for-reducing-javascript-error-noise.html
|
|
@@ -126,7 +123,7 @@ const boot = () => {
|
|
|
126
123
|
const sentryScope = Sentry__namespace.getCurrentScope();
|
|
127
124
|
sentryScope.setTag('role', 'frontend');
|
|
128
125
|
sentryScope.setTag('applicationName', window.app.applicationName);
|
|
129
|
-
sentryScope.setTag('service',
|
|
126
|
+
sentryScope.setTag('service', `merchant-center-frontend-${window.app.applicationName}`);
|
|
130
127
|
}
|
|
131
128
|
};
|
|
132
129
|
const isExtraAsObject = extrasOrExtra => typeof extrasOrExtra === 'object';
|
|
@@ -136,7 +133,7 @@ const reportErrorToSentry = (error, extraInfo, getIsEnabled) => {
|
|
|
136
133
|
console.warn('[SENTRY]: You called "reportErrorToSentry" with a string argument. ' + '"Error" objects should be preferred so that a stack-trace can be made available in Sentry. ' + 'See: https://docs.sentry.io/clients/javascript/usage/#try-catch');
|
|
137
134
|
}
|
|
138
135
|
if (isEnabled) {
|
|
139
|
-
if (extraInfo
|
|
136
|
+
if (extraInfo?.extra) {
|
|
140
137
|
if (isExtraAsObject(extraInfo.extra)) {
|
|
141
138
|
// See https://docs.sentry.io/platforms/javascript/react/
|
|
142
139
|
Sentry__namespace.setExtras(extraInfo.extra);
|
|
@@ -157,7 +154,7 @@ const reportErrorToSentry = (error, extraInfo, getIsEnabled) => {
|
|
|
157
154
|
// The error stack should be available in Sentry, so there is no
|
|
158
155
|
// need to print it in the console as well.
|
|
159
156
|
// We just notify that an error occurred and provide the error ID.
|
|
160
|
-
console.error(
|
|
157
|
+
console.error(`[SENTRY]: An error occurred (ID: ${errorId}).`);
|
|
161
158
|
return errorId;
|
|
162
159
|
}
|
|
163
160
|
console.error('[SENTRY]:', error);
|
|
@@ -184,7 +181,7 @@ let SentryUserTracker = /*#__PURE__*/function (_PureComponent) {
|
|
|
184
181
|
// by only sending the domain part or the email
|
|
185
182
|
const emailTld = _this.props.user.email.split('@')[1];
|
|
186
183
|
Sentry__namespace.setUser({
|
|
187
|
-
email:
|
|
184
|
+
email: `xxx@${emailTld}`,
|
|
188
185
|
id: _this.props.user.id
|
|
189
186
|
});
|
|
190
187
|
}
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
|
|
6
6
|
var _includesInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/includes');
|
|
7
7
|
var _Object$keys = require('@babel/runtime-corejs3/core-js-stable/object/keys');
|
|
8
|
-
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
9
8
|
var Sentry = require('@sentry/react');
|
|
10
9
|
var browser = require('@sentry/browser');
|
|
11
10
|
var history = require('@commercetools-frontend/browser-history');
|
|
@@ -40,13 +39,12 @@ function _interopNamespace(e) {
|
|
|
40
39
|
var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
|
|
41
40
|
var _includesInstanceProperty__default = /*#__PURE__*/_interopDefault(_includesInstanceProperty);
|
|
42
41
|
var _Object$keys__default = /*#__PURE__*/_interopDefault(_Object$keys);
|
|
43
|
-
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
44
42
|
var Sentry__namespace = /*#__PURE__*/_interopNamespace(Sentry);
|
|
45
43
|
var history__default = /*#__PURE__*/_interopDefault(history);
|
|
46
44
|
var _Reflect$construct__default = /*#__PURE__*/_interopDefault(_Reflect$construct);
|
|
47
45
|
|
|
48
46
|
// NOTE: This string will be replaced on build time with the package version.
|
|
49
|
-
var version = "25.
|
|
47
|
+
var version = "25.1.0";
|
|
50
48
|
|
|
51
49
|
const makeErrorToCapture = error => {
|
|
52
50
|
if (error instanceof Error) return error;
|
|
@@ -93,11 +91,10 @@ const redactUnsafeEventFields = event => {
|
|
|
93
91
|
};
|
|
94
92
|
const boot = () => {
|
|
95
93
|
if (window.app.trackingSentry && window.app.trackingSentry !== 'null') {
|
|
96
|
-
var _context2;
|
|
97
94
|
Sentry__namespace.init({
|
|
98
95
|
dsn: window.app.trackingSentry,
|
|
99
96
|
release: window.app.revision,
|
|
100
|
-
environment:
|
|
97
|
+
environment: `${window.app.env}-${window.app.location}`,
|
|
101
98
|
// In order to reduce the noise in sentry we only track errors that come
|
|
102
99
|
// from our code and ignore errors that come from other services
|
|
103
100
|
// https://blog.sentry.io/2017/03/27/tips-for-reducing-javascript-error-noise.html
|
|
@@ -126,7 +123,7 @@ const boot = () => {
|
|
|
126
123
|
const sentryScope = Sentry__namespace.getCurrentScope();
|
|
127
124
|
sentryScope.setTag('role', 'frontend');
|
|
128
125
|
sentryScope.setTag('applicationName', window.app.applicationName);
|
|
129
|
-
sentryScope.setTag('service',
|
|
126
|
+
sentryScope.setTag('service', `merchant-center-frontend-${window.app.applicationName}`);
|
|
130
127
|
}
|
|
131
128
|
};
|
|
132
129
|
const isExtraAsObject = extrasOrExtra => typeof extrasOrExtra === 'object';
|
|
@@ -136,7 +133,7 @@ const reportErrorToSentry = (error, extraInfo, getIsEnabled) => {
|
|
|
136
133
|
console.warn('[SENTRY]: You called "reportErrorToSentry" with a string argument. ' + '"Error" objects should be preferred so that a stack-trace can be made available in Sentry. ' + 'See: https://docs.sentry.io/clients/javascript/usage/#try-catch');
|
|
137
134
|
}
|
|
138
135
|
if (isEnabled) {
|
|
139
|
-
if (extraInfo
|
|
136
|
+
if (extraInfo?.extra) {
|
|
140
137
|
if (isExtraAsObject(extraInfo.extra)) {
|
|
141
138
|
// See https://docs.sentry.io/platforms/javascript/react/
|
|
142
139
|
Sentry__namespace.setExtras(extraInfo.extra);
|
|
@@ -157,7 +154,7 @@ const reportErrorToSentry = (error, extraInfo, getIsEnabled) => {
|
|
|
157
154
|
// The error stack should be available in Sentry, so there is no
|
|
158
155
|
// need to print it in the console as well.
|
|
159
156
|
// We just notify that an error occurred and provide the error ID.
|
|
160
|
-
console.error(
|
|
157
|
+
console.error(`[SENTRY]: An error occurred (ID: ${errorId}).`);
|
|
161
158
|
return errorId;
|
|
162
159
|
}
|
|
163
160
|
console.error('[SENTRY]:', error);
|
|
@@ -184,7 +181,7 @@ let SentryUserTracker = /*#__PURE__*/function (_PureComponent) {
|
|
|
184
181
|
// by only sending the domain part or the email
|
|
185
182
|
const emailTld = _this.props.user.email.split('@')[1];
|
|
186
183
|
Sentry__namespace.setUser({
|
|
187
|
-
email:
|
|
184
|
+
email: `xxx@${emailTld}`,
|
|
188
185
|
id: _this.props.user.id
|
|
189
186
|
});
|
|
190
187
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _JSON$stringify from '@babel/runtime-corejs3/core-js-stable/json/stringify';
|
|
2
2
|
import _includesInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/includes';
|
|
3
3
|
import _Object$keys from '@babel/runtime-corejs3/core-js-stable/object/keys';
|
|
4
|
-
import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
|
|
5
4
|
import * as Sentry from '@sentry/react';
|
|
6
5
|
import { globalHandlersIntegration } from '@sentry/browser';
|
|
7
6
|
import history from '@commercetools-frontend/browser-history';
|
|
@@ -14,7 +13,7 @@ import _inherits from '@babel/runtime-corejs3/helpers/esm/inherits';
|
|
|
14
13
|
import { PureComponent, Component } from 'react';
|
|
15
14
|
|
|
16
15
|
// NOTE: This string will be replaced on build time with the package version.
|
|
17
|
-
var version = "25.
|
|
16
|
+
var version = "25.1.0";
|
|
18
17
|
|
|
19
18
|
const makeErrorToCapture = error => {
|
|
20
19
|
if (error instanceof Error) return error;
|
|
@@ -61,11 +60,10 @@ const redactUnsafeEventFields = event => {
|
|
|
61
60
|
};
|
|
62
61
|
const boot = () => {
|
|
63
62
|
if (window.app.trackingSentry && window.app.trackingSentry !== 'null') {
|
|
64
|
-
var _context2;
|
|
65
63
|
Sentry.init({
|
|
66
64
|
dsn: window.app.trackingSentry,
|
|
67
65
|
release: window.app.revision,
|
|
68
|
-
environment:
|
|
66
|
+
environment: `${window.app.env}-${window.app.location}`,
|
|
69
67
|
// In order to reduce the noise in sentry we only track errors that come
|
|
70
68
|
// from our code and ignore errors that come from other services
|
|
71
69
|
// https://blog.sentry.io/2017/03/27/tips-for-reducing-javascript-error-noise.html
|
|
@@ -94,7 +92,7 @@ const boot = () => {
|
|
|
94
92
|
const sentryScope = Sentry.getCurrentScope();
|
|
95
93
|
sentryScope.setTag('role', 'frontend');
|
|
96
94
|
sentryScope.setTag('applicationName', window.app.applicationName);
|
|
97
|
-
sentryScope.setTag('service',
|
|
95
|
+
sentryScope.setTag('service', `merchant-center-frontend-${window.app.applicationName}`);
|
|
98
96
|
}
|
|
99
97
|
};
|
|
100
98
|
const isExtraAsObject = extrasOrExtra => typeof extrasOrExtra === 'object';
|
|
@@ -104,7 +102,7 @@ const reportErrorToSentry = (error, extraInfo, getIsEnabled) => {
|
|
|
104
102
|
console.warn('[SENTRY]: You called "reportErrorToSentry" with a string argument. ' + '"Error" objects should be preferred so that a stack-trace can be made available in Sentry. ' + 'See: https://docs.sentry.io/clients/javascript/usage/#try-catch');
|
|
105
103
|
}
|
|
106
104
|
if (isEnabled) {
|
|
107
|
-
if (extraInfo
|
|
105
|
+
if (extraInfo?.extra) {
|
|
108
106
|
if (isExtraAsObject(extraInfo.extra)) {
|
|
109
107
|
// See https://docs.sentry.io/platforms/javascript/react/
|
|
110
108
|
Sentry.setExtras(extraInfo.extra);
|
|
@@ -125,7 +123,7 @@ const reportErrorToSentry = (error, extraInfo, getIsEnabled) => {
|
|
|
125
123
|
// The error stack should be available in Sentry, so there is no
|
|
126
124
|
// need to print it in the console as well.
|
|
127
125
|
// We just notify that an error occurred and provide the error ID.
|
|
128
|
-
console.error(
|
|
126
|
+
console.error(`[SENTRY]: An error occurred (ID: ${errorId}).`);
|
|
129
127
|
return errorId;
|
|
130
128
|
}
|
|
131
129
|
console.error('[SENTRY]:', error);
|
|
@@ -152,7 +150,7 @@ let SentryUserTracker = /*#__PURE__*/function (_PureComponent) {
|
|
|
152
150
|
// by only sending the domain part or the email
|
|
153
151
|
const emailTld = _this.props.user.email.split('@')[1];
|
|
154
152
|
Sentry.setUser({
|
|
155
|
-
email:
|
|
153
|
+
email: `xxx@${emailTld}`,
|
|
156
154
|
id: _this.props.user.id
|
|
157
155
|
});
|
|
158
156
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercetools-frontend/sentry",
|
|
3
|
-
"version": "25.
|
|
3
|
+
"version": "25.1.0",
|
|
4
4
|
"description": "Components to set up Sentry for a MC application",
|
|
5
5
|
"bugs": "https://github.com/commercetools/merchant-center-application-kit/issues",
|
|
6
6
|
"repository": {
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@babel/runtime": "^7.22.15",
|
|
32
32
|
"@babel/runtime-corejs3": "^7.22.15",
|
|
33
|
-
"@commercetools-frontend/browser-history": "25.
|
|
34
|
-
"@commercetools-frontend/constants": "25.
|
|
33
|
+
"@commercetools-frontend/browser-history": "25.1.0",
|
|
34
|
+
"@commercetools-frontend/constants": "25.1.0",
|
|
35
35
|
"@sentry/browser": "8.55.0",
|
|
36
36
|
"@sentry/react": "8.55.0",
|
|
37
37
|
"@sentry/types": "8.55.0",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@types/jest": "^29.5.14",
|
|
45
45
|
"jest": "30.2.0",
|
|
46
46
|
"react": "19.0.0",
|
|
47
|
-
"sentry-testkit": "
|
|
47
|
+
"sentry-testkit": "6.2.2",
|
|
48
48
|
"wait-for-expect": "3.0.2"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|