@tramvai/module-micro-sentry 4.8.3 → 4.8.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/lib/browser.js +2 -21
- package/lib/providers.browser.js +27 -5
- package/lib/providers.es.js +27 -5
- package/lib/providers.js +26 -4
- package/lib/tokens.browser.js +1 -1
- package/lib/tokens.d.ts +1 -1
- package/lib/tokens.es.js +1 -1
- package/lib/tokens.js +1 -1
- package/package.json +4 -4
package/lib/browser.js
CHANGED
|
@@ -1,29 +1,10 @@
|
|
|
1
|
-
import { declareModule
|
|
2
|
-
import { ENV_MANAGER_TOKEN } from '@tramvai/module-common';
|
|
1
|
+
import { declareModule } from '@tramvai/core';
|
|
3
2
|
import { browserProviders } from './providers.browser.js';
|
|
4
|
-
import { MICRO_SENTRY_OPTIONS_TOKEN } from './tokens.browser.js';
|
|
5
3
|
export { MICRO_SENTRY_INLINE_ERROR_INTERCEPTOR_KEY_TOKEN, MICRO_SENTRY_INLINE_ERROR_INTERCEPTOR_TOKEN, MICRO_SENTRY_INSTANCE_TOKEN, MICRO_SENTRY_OPTIONS_TOKEN } from './tokens.browser.js';
|
|
6
4
|
|
|
7
5
|
const TramvaiMicroSentryModule = declareModule({
|
|
8
6
|
name: 'TramvaiMicroSentryModule',
|
|
9
|
-
providers:
|
|
10
|
-
...browserProviders,
|
|
11
|
-
provide({
|
|
12
|
-
provide: MICRO_SENTRY_OPTIONS_TOKEN,
|
|
13
|
-
useFactory: ({ envManager }) => {
|
|
14
|
-
var _a;
|
|
15
|
-
const defaultOptions = {
|
|
16
|
-
environment: (_a = envManager.get('SENTRY_ENVIRONMENT')) !== null && _a !== void 0 ? _a : process.env.NODE_ENV,
|
|
17
|
-
release: envManager.get('SENTRY_RELEASE'),
|
|
18
|
-
dsn: envManager.get('SENTRY_DSN'),
|
|
19
|
-
};
|
|
20
|
-
return defaultOptions;
|
|
21
|
-
},
|
|
22
|
-
deps: {
|
|
23
|
-
envManager: ENV_MANAGER_TOKEN,
|
|
24
|
-
},
|
|
25
|
-
}),
|
|
26
|
-
],
|
|
7
|
+
providers: browserProviders,
|
|
27
8
|
imports: [],
|
|
28
9
|
});
|
|
29
10
|
|
package/lib/providers.browser.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { provide, commandLineListTokens } from '@tramvai/core';
|
|
2
|
-
import { ENV_USED_TOKEN } from '@tramvai/module-common';
|
|
2
|
+
import { ENV_USED_TOKEN, ENV_MANAGER_TOKEN } from '@tramvai/module-common';
|
|
3
3
|
import { BrowserMicroSentryClient } from '@micro-sentry/browser';
|
|
4
4
|
import { MICRO_SENTRY_INLINE_ERROR_INTERCEPTOR_KEY_TOKEN, MICRO_SENTRY_INSTANCE_TOKEN, MICRO_SENTRY_OPTIONS_TOKEN } from './tokens.browser.js';
|
|
5
5
|
|
|
@@ -13,15 +13,37 @@ const browserProviders = [
|
|
|
13
13
|
...sharedProviders,
|
|
14
14
|
provide({
|
|
15
15
|
provide: ENV_USED_TOKEN,
|
|
16
|
-
useValue: [
|
|
16
|
+
useValue: [
|
|
17
|
+
{ key: 'SENTRY_DSN' },
|
|
18
|
+
{
|
|
19
|
+
key: 'SENTRY_ENVIRONMENT',
|
|
20
|
+
optional: true,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
key: 'SENTRY_RELEASE',
|
|
24
|
+
optional: true,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
17
27
|
}),
|
|
18
28
|
provide({
|
|
19
29
|
provide: MICRO_SENTRY_INSTANCE_TOKEN,
|
|
20
|
-
useFactory: ({ microSentryOptions }) => {
|
|
21
|
-
|
|
30
|
+
useFactory: ({ microSentryOptions, envManager }) => {
|
|
31
|
+
const defaultOptions = {
|
|
32
|
+
environment: envManager.get('SENTRY_ENVIRONMENT'),
|
|
33
|
+
release: envManager.get('SENTRY_RELEASE'),
|
|
34
|
+
dsn: envManager.get('SENTRY_DSN'),
|
|
35
|
+
};
|
|
36
|
+
const options = (microSentryOptions !== null && microSentryOptions !== void 0 ? microSentryOptions : []).reduce((previousOptions, microSentryOptionsItem) => {
|
|
37
|
+
return {
|
|
38
|
+
...previousOptions,
|
|
39
|
+
...microSentryOptionsItem,
|
|
40
|
+
};
|
|
41
|
+
}, defaultOptions);
|
|
42
|
+
return new BrowserMicroSentryClient(options);
|
|
22
43
|
},
|
|
23
44
|
deps: {
|
|
24
|
-
|
|
45
|
+
envManager: ENV_MANAGER_TOKEN,
|
|
46
|
+
microSentryOptions: { token: MICRO_SENTRY_OPTIONS_TOKEN, optional: true },
|
|
25
47
|
},
|
|
26
48
|
}),
|
|
27
49
|
provide({
|
package/lib/providers.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { provide, commandLineListTokens } from '@tramvai/core';
|
|
2
|
-
import { ENV_USED_TOKEN } from '@tramvai/module-common';
|
|
2
|
+
import { ENV_USED_TOKEN, ENV_MANAGER_TOKEN } from '@tramvai/module-common';
|
|
3
3
|
import { BrowserMicroSentryClient } from '@micro-sentry/browser';
|
|
4
4
|
import { MICRO_SENTRY_INLINE_ERROR_INTERCEPTOR_KEY_TOKEN, MICRO_SENTRY_INSTANCE_TOKEN, MICRO_SENTRY_OPTIONS_TOKEN } from './tokens.es.js';
|
|
5
5
|
|
|
@@ -13,15 +13,37 @@ const sharedProviders = [
|
|
|
13
13
|
...sharedProviders,
|
|
14
14
|
provide({
|
|
15
15
|
provide: ENV_USED_TOKEN,
|
|
16
|
-
useValue: [
|
|
16
|
+
useValue: [
|
|
17
|
+
{ key: 'SENTRY_DSN' },
|
|
18
|
+
{
|
|
19
|
+
key: 'SENTRY_ENVIRONMENT',
|
|
20
|
+
optional: true,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
key: 'SENTRY_RELEASE',
|
|
24
|
+
optional: true,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
17
27
|
}),
|
|
18
28
|
provide({
|
|
19
29
|
provide: MICRO_SENTRY_INSTANCE_TOKEN,
|
|
20
|
-
useFactory: ({ microSentryOptions }) => {
|
|
21
|
-
|
|
30
|
+
useFactory: ({ microSentryOptions, envManager }) => {
|
|
31
|
+
const defaultOptions = {
|
|
32
|
+
environment: envManager.get('SENTRY_ENVIRONMENT'),
|
|
33
|
+
release: envManager.get('SENTRY_RELEASE'),
|
|
34
|
+
dsn: envManager.get('SENTRY_DSN'),
|
|
35
|
+
};
|
|
36
|
+
const options = (microSentryOptions !== null && microSentryOptions !== void 0 ? microSentryOptions : []).reduce((previousOptions, microSentryOptionsItem) => {
|
|
37
|
+
return {
|
|
38
|
+
...previousOptions,
|
|
39
|
+
...microSentryOptionsItem,
|
|
40
|
+
};
|
|
41
|
+
}, defaultOptions);
|
|
42
|
+
return new BrowserMicroSentryClient(options);
|
|
22
43
|
},
|
|
23
44
|
deps: {
|
|
24
|
-
|
|
45
|
+
envManager: ENV_MANAGER_TOKEN,
|
|
46
|
+
microSentryOptions: { token: MICRO_SENTRY_OPTIONS_TOKEN, optional: true },
|
|
25
47
|
},
|
|
26
48
|
}),
|
|
27
49
|
provide({
|
package/lib/providers.js
CHANGED
|
@@ -17,15 +17,37 @@ const sharedProviders = [
|
|
|
17
17
|
...sharedProviders,
|
|
18
18
|
core.provide({
|
|
19
19
|
provide: moduleCommon.ENV_USED_TOKEN,
|
|
20
|
-
useValue: [
|
|
20
|
+
useValue: [
|
|
21
|
+
{ key: 'SENTRY_DSN' },
|
|
22
|
+
{
|
|
23
|
+
key: 'SENTRY_ENVIRONMENT',
|
|
24
|
+
optional: true,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
key: 'SENTRY_RELEASE',
|
|
28
|
+
optional: true,
|
|
29
|
+
},
|
|
30
|
+
],
|
|
21
31
|
}),
|
|
22
32
|
core.provide({
|
|
23
33
|
provide: tokens.MICRO_SENTRY_INSTANCE_TOKEN,
|
|
24
|
-
useFactory: ({ microSentryOptions }) => {
|
|
25
|
-
|
|
34
|
+
useFactory: ({ microSentryOptions, envManager }) => {
|
|
35
|
+
const defaultOptions = {
|
|
36
|
+
environment: envManager.get('SENTRY_ENVIRONMENT'),
|
|
37
|
+
release: envManager.get('SENTRY_RELEASE'),
|
|
38
|
+
dsn: envManager.get('SENTRY_DSN'),
|
|
39
|
+
};
|
|
40
|
+
const options = (microSentryOptions !== null && microSentryOptions !== void 0 ? microSentryOptions : []).reduce((previousOptions, microSentryOptionsItem) => {
|
|
41
|
+
return {
|
|
42
|
+
...previousOptions,
|
|
43
|
+
...microSentryOptionsItem,
|
|
44
|
+
};
|
|
45
|
+
}, defaultOptions);
|
|
46
|
+
return new browser.BrowserMicroSentryClient(options);
|
|
26
47
|
},
|
|
27
48
|
deps: {
|
|
28
|
-
|
|
49
|
+
envManager: moduleCommon.ENV_MANAGER_TOKEN,
|
|
50
|
+
microSentryOptions: { token: tokens.MICRO_SENTRY_OPTIONS_TOKEN, optional: true },
|
|
29
51
|
},
|
|
30
52
|
}),
|
|
31
53
|
core.provide({
|
package/lib/tokens.browser.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createToken } from '@tramvai/core';
|
|
2
2
|
|
|
3
3
|
const MICRO_SENTRY_INSTANCE_TOKEN = createToken('MICRO_SENTRY_INSTANCE_TOKEN');
|
|
4
|
-
const MICRO_SENTRY_OPTIONS_TOKEN = createToken('MICRO_SENTRY_OPTIONS_TOKEN');
|
|
4
|
+
const MICRO_SENTRY_OPTIONS_TOKEN = createToken('MICRO_SENTRY_OPTIONS_TOKEN', { multi: true });
|
|
5
5
|
const MICRO_SENTRY_INLINE_ERROR_INTERCEPTOR_KEY_TOKEN = createToken('MICRO_SENTRY_INLINE_ERROR_INTERCEPTOR_KEY_TOKEN');
|
|
6
6
|
const MICRO_SENTRY_INLINE_ERROR_INTERCEPTOR_TOKEN = createToken('MICRO_SENTRY_INLINE_ERROR_INTERCEPTOR_TOKEN');
|
|
7
7
|
|
package/lib/tokens.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export declare const MICRO_SENTRY_INSTANCE_TOKEN: (BrowserMicroSentryClient & {
|
|
|
3
3
|
__type?: "base token" | undefined;
|
|
4
4
|
}) | null;
|
|
5
5
|
export declare const MICRO_SENTRY_OPTIONS_TOKEN: BrowserSentryClientOptions & {
|
|
6
|
-
__type?: "
|
|
6
|
+
__type?: "multi token" | undefined;
|
|
7
7
|
};
|
|
8
8
|
export declare const MICRO_SENTRY_INLINE_ERROR_INTERCEPTOR_KEY_TOKEN: string & {
|
|
9
9
|
__type?: "base token" | undefined;
|
package/lib/tokens.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createToken } from '@tramvai/core';
|
|
2
2
|
|
|
3
3
|
const MICRO_SENTRY_INSTANCE_TOKEN = createToken('MICRO_SENTRY_INSTANCE_TOKEN');
|
|
4
|
-
const MICRO_SENTRY_OPTIONS_TOKEN = createToken('MICRO_SENTRY_OPTIONS_TOKEN');
|
|
4
|
+
const MICRO_SENTRY_OPTIONS_TOKEN = createToken('MICRO_SENTRY_OPTIONS_TOKEN', { multi: true });
|
|
5
5
|
const MICRO_SENTRY_INLINE_ERROR_INTERCEPTOR_KEY_TOKEN = createToken('MICRO_SENTRY_INLINE_ERROR_INTERCEPTOR_KEY_TOKEN');
|
|
6
6
|
const MICRO_SENTRY_INLINE_ERROR_INTERCEPTOR_TOKEN = createToken('MICRO_SENTRY_INLINE_ERROR_INTERCEPTOR_TOKEN');
|
|
7
7
|
|
package/lib/tokens.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var core = require('@tramvai/core');
|
|
6
6
|
|
|
7
7
|
const MICRO_SENTRY_INSTANCE_TOKEN = core.createToken('MICRO_SENTRY_INSTANCE_TOKEN');
|
|
8
|
-
const MICRO_SENTRY_OPTIONS_TOKEN = core.createToken('MICRO_SENTRY_OPTIONS_TOKEN');
|
|
8
|
+
const MICRO_SENTRY_OPTIONS_TOKEN = core.createToken('MICRO_SENTRY_OPTIONS_TOKEN', { multi: true });
|
|
9
9
|
const MICRO_SENTRY_INLINE_ERROR_INTERCEPTOR_KEY_TOKEN = core.createToken('MICRO_SENTRY_INLINE_ERROR_INTERCEPTOR_KEY_TOKEN');
|
|
10
10
|
const MICRO_SENTRY_INLINE_ERROR_INTERCEPTOR_TOKEN = core.createToken('MICRO_SENTRY_INLINE_ERROR_INTERCEPTOR_TOKEN');
|
|
11
11
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/module-micro-sentry",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.4",
|
|
4
4
|
"description": "Micro-sentry module",
|
|
5
5
|
"browser": "lib/browser.js",
|
|
6
6
|
"main": "lib/server.js",
|
|
@@ -22,9 +22,9 @@
|
|
|
22
22
|
"@micro-sentry/browser": "^7.0.1"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@tramvai/tokens-render": "4.8.
|
|
26
|
-
"@tramvai/core": "4.8.
|
|
27
|
-
"@tramvai/module-common": "4.8.
|
|
25
|
+
"@tramvai/tokens-render": "4.8.4",
|
|
26
|
+
"@tramvai/core": "4.8.4",
|
|
27
|
+
"@tramvai/module-common": "4.8.4"
|
|
28
28
|
},
|
|
29
29
|
"module": "lib/server.es.js"
|
|
30
30
|
}
|