@sentry/ember 7.17.2 → 7.17.3
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.
- package/index.js +53 -4
- package/package.json +5 -5
package/index.js
CHANGED
|
@@ -27,10 +27,22 @@ module.exports = {
|
|
|
27
27
|
},
|
|
28
28
|
},
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
included() {
|
|
31
|
+
const app = this._findHost();
|
|
32
|
+
const config = app.project.config(app.env);
|
|
33
|
+
const addonConfig = config['@sentry/ember'] || {};
|
|
34
|
+
|
|
35
|
+
if (!isSerializable(addonConfig)) {
|
|
36
|
+
console.warn(
|
|
37
|
+
`Warning: You passed a non-serializable config to \`ENV['@sentry/ember'].sentry\`.
|
|
38
|
+
Non-serializable config (e.g. RegExp, ...) can only be passed directly to \`Sentry.init()\`, which is usually defined in app/app.js.
|
|
39
|
+
The reason for this is that @embroider/macros, which is used under the hood to handle environment config, requires serializable configuration.`,
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
this.options['@embroider/macros'].setOwnConfig.sentryConfig = addonConfig;
|
|
44
|
+
|
|
45
|
+
this._super.included.apply(this, arguments);
|
|
34
46
|
},
|
|
35
47
|
|
|
36
48
|
contentFor(type, config) {
|
|
@@ -50,3 +62,40 @@ module.exports = {
|
|
|
50
62
|
|
|
51
63
|
injectedScriptHashes: [initialLoadHeadSnippetHash, initialLoadBodySnippetHash],
|
|
52
64
|
};
|
|
65
|
+
|
|
66
|
+
function isSerializable(obj) {
|
|
67
|
+
if (isScalar(obj)) {
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (Array.isArray(obj)) {
|
|
72
|
+
return !obj.some(arrayItem => !isSerializable(arrayItem));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (isPlainObject(obj)) {
|
|
76
|
+
for (let property in obj) {
|
|
77
|
+
let value = obj[property];
|
|
78
|
+
if (!isSerializable(value)) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function isScalar(val) {
|
|
90
|
+
return (
|
|
91
|
+
typeof val === 'undefined' ||
|
|
92
|
+
typeof val === 'string' ||
|
|
93
|
+
typeof val === 'boolean' ||
|
|
94
|
+
typeof val === 'number' ||
|
|
95
|
+
val === null
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function isPlainObject(obj) {
|
|
100
|
+
return typeof obj === 'object' && obj.constructor === Object && obj.toString() === '[object Object]';
|
|
101
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/ember",
|
|
3
|
-
"version": "7.17.
|
|
3
|
+
"version": "7.17.3",
|
|
4
4
|
"description": "Official Sentry SDK for Ember.js",
|
|
5
5
|
"repository": "git://github.com/getsentry/sentry-javascript.git",
|
|
6
6
|
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/ember",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@embroider/macros": "^1.9.0",
|
|
34
|
-
"@sentry/browser": "7.17.
|
|
35
|
-
"@sentry/tracing": "7.17.
|
|
36
|
-
"@sentry/types": "7.17.
|
|
37
|
-
"@sentry/utils": "7.17.
|
|
34
|
+
"@sentry/browser": "7.17.3",
|
|
35
|
+
"@sentry/tracing": "7.17.3",
|
|
36
|
+
"@sentry/types": "7.17.3",
|
|
37
|
+
"@sentry/utils": "7.17.3",
|
|
38
38
|
"ember-auto-import": "^1.12.1 || ^2.4.3",
|
|
39
39
|
"ember-cli-babel": "^7.26.11",
|
|
40
40
|
"ember-cli-htmlbars": "^6.1.1",
|