@nitra/vite-boot 1.0.0 → 1.0.4

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/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@nitra/vite-boot",
3
- "version": "1.0.0",
3
+ "version": "1.0.4",
4
4
  "description": "Vite boot",
5
5
  "type": "module",
6
6
  "exports": {
7
- "./apollo": "src/apollo.js",
8
- "./i18n": "src/i18n.js",
9
- "./pinia": "src/pinia.js"
7
+ "./apollo": "./src/apollo.js",
8
+ "./i18n": "./src/i18n.js",
9
+ "./pinia": "./src/pinia.js",
10
+ "./sentry": "./src/sentry.js"
10
11
  },
11
12
  "repository": {
12
13
  "type": "git",
@@ -29,6 +30,8 @@
29
30
  "dependencies": {
30
31
  "@apollo/client": "^3.5.6",
31
32
  "@nitra/consola": "^1.3.1",
33
+ "@sentry/tracing": "^6.16.1",
34
+ "@sentry/vue": "^6.16.1",
32
35
  "graphql": "^16.2.0",
33
36
  "graphql-ws": "^5.5.5",
34
37
  "petite-vue-i18n": "^9.2.0-beta.26",
package/src/apollo.js CHANGED
@@ -5,9 +5,13 @@ import { onError } from '@apollo/client/link/error'
5
5
  import { print } from 'graphql'
6
6
  import { createClient } from 'graphql-ws'
7
7
  import { createLogger } from '@nitra/consola/browser'
8
+ import { isDev, isProd } from '@nitra/isenv'
8
9
 
9
10
  const consola = createLogger(import.meta.url)
10
11
 
12
+ console.log('isDev', isDev)
13
+ console.log('isProd', isProd)
14
+
11
15
  class WebSocketLink extends ApolloLink {
12
16
  constructor(options) {
13
17
  super()
@@ -54,7 +58,7 @@ const wsLink = new WebSocketLink({
54
58
  return {
55
59
  headers: {
56
60
  Authorization: `Bearer ${token}`,
57
- 'x-hasura-role': import.meta.env.VITE_HASURA_ROLE
61
+ 'x-hasura-role': __HASURA_ROLE__
58
62
  }
59
63
  }
60
64
  }
package/src/sentry.js ADDED
@@ -0,0 +1,22 @@
1
+ import * as Sentry from '@sentry/browser'
2
+ import { Integrations } from '@sentry/tracing'
3
+
4
+ /**
5
+ * Ініціалізація Sentry
6
+ */
7
+ export const bootSentry = (app, router) => {
8
+ Sentry.init({
9
+ app,
10
+ dsn: import.meta.env.VITE_HASURA_PROTOCOL,
11
+ release: __GITHUB_SHA__,
12
+ integrations: [
13
+ new Integrations.BrowserTracing({
14
+ routingInstrumentation: Sentry.vueRouterInstrumentation(router)
15
+ })
16
+ ],
17
+ // Set tracesSampleRate to 1.0 to capture 100%
18
+ // of transactions for performance monitoring.
19
+ // We recommend adjusting this value in production
20
+ tracesSampleRate: 0.1
21
+ })
22
+ }