@nuux/sentry 0.6.0 → 0.8.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.
package/README.md
CHANGED
|
@@ -31,6 +31,7 @@ $ yarn add @nuux/sentry
|
|
|
31
31
|
Define `SENTRY_DSN` as environment variable.
|
|
32
32
|
|
|
33
33
|
#### Default configuration
|
|
34
|
+
|
|
34
35
|
```ruby
|
|
35
36
|
Nuux::Sentry.configure do |config|
|
|
36
37
|
config.environments = %w[staging production]
|
|
@@ -50,4 +51,5 @@ end
|
|
|
50
51
|
- Add `import "@nuux/sentry"` in `javascripts/packs/application.js` as first line.
|
|
51
52
|
|
|
52
53
|
## License
|
|
54
|
+
|
|
53
55
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import * as Sentry from "@sentry/browser"
|
|
2
2
|
|
|
3
3
|
import { config } from "./config"
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
const isObject = (value) => {
|
|
6
|
+
if (value == null) {
|
|
7
|
+
return false
|
|
8
|
+
} else {
|
|
9
|
+
return value instanceof Object && Object.keys(value).length > 0
|
|
10
|
+
}
|
|
11
|
+
}
|
|
5
12
|
|
|
6
13
|
export const init = () => {
|
|
7
14
|
if (isObject(config) && config.dsn) {
|
|
8
|
-
debug("@nuux/sentry: init", config)
|
|
9
15
|
Sentry.init(config)
|
|
10
16
|
}
|
|
11
17
|
}
|
|
12
18
|
|
|
13
|
-
if (Sentry.
|
|
19
|
+
if (!Sentry.isInitialized()) {
|
|
14
20
|
init()
|
|
15
21
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuux/sentry",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Initialize Sentry from a meta tag",
|
|
5
5
|
"main": "app/assets/javascript/nuux-sentry/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
"author": "nuux",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@sentry/browser": "^
|
|
13
|
-
"@sentry/cli": "^2.17.0"
|
|
12
|
+
"@sentry/browser": "^8.30.0"
|
|
14
13
|
},
|
|
15
14
|
"files": [
|
|
16
15
|
"app/assets/javascript/nuux-sentry/*.js"
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export const isObject = (value) => {
|
|
2
|
-
if (value == null) {
|
|
3
|
-
return false
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
return value instanceof Object && Object.keys(value).length > 0
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export const debug = (...attributes) => {
|
|
10
|
-
if (process.env.NODE_ENV == "development") {
|
|
11
|
-
console.debug(...attributes)
|
|
12
|
-
}
|
|
13
|
-
}
|