sentry-vir 1.1.0 → 2.0.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.
@@ -11,22 +11,27 @@ export declare enum EventSeverityEnum {
11
11
  export type InfoEventSeverity = EventSeverityEnum.Debug | EventSeverityEnum.Info | EventSeverityEnum.Warning;
12
12
  /** Maps severities to the console methods used to log them. */
13
13
  export declare const consoleLogMethodPerSeverity: {
14
+ /** Maps to `console.warn`. */
14
15
  readonly warning: {
15
16
  (...data: any[]): void;
16
17
  (message?: any, ...optionalParams: any[]): void;
17
18
  };
19
+ /** Maps to `console.info`. */
18
20
  readonly info: {
19
21
  (...data: any[]): void;
20
22
  (message?: any, ...optionalParams: any[]): void;
21
23
  };
24
+ /** Maps to `console.debug`. */
22
25
  readonly debug: {
23
26
  (...data: any[]): void;
24
27
  (message?: any, ...optionalParams: any[]): void;
25
28
  };
29
+ /** Maps to `console.error`. */
26
30
  readonly fatal: {
27
31
  (...data: any[]): void;
28
32
  (message?: any, ...optionalParams: any[]): void;
29
33
  };
34
+ /** Maps to `console.error`. */
30
35
  readonly error: {
31
36
  (...data: any[]): void;
32
37
  (message?: any, ...optionalParams: any[]): void;
@@ -13,10 +13,15 @@ var EventSeverityEnum;
13
13
  })(EventSeverityEnum || (exports.EventSeverityEnum = EventSeverityEnum = {}));
14
14
  /** Maps severities to the console methods used to log them. */
15
15
  exports.consoleLogMethodPerSeverity = {
16
+ /** Maps to `console.warn`. */
16
17
  [EventSeverityEnum.Warning]: console.warn,
18
+ /** Maps to `console.info`. */
17
19
  [EventSeverityEnum.Info]: console.info,
20
+ /** Maps to `console.debug`. */
18
21
  [EventSeverityEnum.Debug]: console.debug,
22
+ /** Maps to `console.error`. */
19
23
  [EventSeverityEnum.Fatal]: console.error,
24
+ /** Maps to `console.error`. */
20
25
  [EventSeverityEnum.Error]: console.error,
21
26
  };
22
27
  /** Extracts the severity level from a sentry event while defaulting to an info level severity. */
@@ -1,8 +1,10 @@
1
- import type { Options } from '@sentry/types';
2
- import { SentryBrowserDep, SentryDepByEnv, SentryExecutionEnvEnum, SentryNodeDep } from '../env/execution-env';
1
+ import { type BrowserOptions } from '@sentry/browser';
2
+ import type { NodeOptions } from '@sentry/node';
3
+ import { type Options } from '@sentry/types';
4
+ import { SentryDepByEnv, SentryExecutionEnvEnum } from '../env/execution-env';
3
5
  /** Optional UserOverrides of Sentry config values. */
4
6
  export type UserOverrides = Omit<Partial<Options>, keyof RequiredSentryOptions> | undefined;
5
7
  /** Sentry config options that are required. */
6
8
  export type RequiredSentryOptions = Pick<Required<Options>, 'dsn' | 'environment' | 'release'>;
7
9
  /** Creates the sentry config used internally by sentry-vir. */
8
- export declare function createSentryConfig<const ExecutionEnv extends SentryExecutionEnvEnum>(executionEnv: ExecutionEnv, sentryDep: SentryDepByEnv<ExecutionEnv>, requiredSentryOptions: RequiredSentryOptions, userOverrides: UserOverrides, isDev: boolean): Promise<SentryBrowserDep | SentryNodeDep>;
10
+ export declare function createSentryConfig<const ExecutionEnv extends SentryExecutionEnvEnum>(executionEnv: ExecutionEnv, sentryDep: SentryDepByEnv<ExecutionEnv>, requiredSentryOptions: RequiredSentryOptions, userOverrides: UserOverrides, isDev: boolean): Promise<BrowserOptions | NodeOptions>;
@@ -11,6 +11,7 @@ async function createSentryConfig(executionEnv, sentryDep, requiredSentryOptions
11
11
  beforeSendTransaction: (0, handle_sentry_send_1.createSentryHandler)(isDev),
12
12
  defaultIntegrations: false,
13
13
  enabled: true,
14
+ maxValueLength: 10_000,
14
15
  };
15
16
  const envSentryConfig = sentryConfigByEnv[executionEnv](
16
17
  /**
@@ -27,11 +28,11 @@ const sentryConfigByEnv = {
27
28
  [execution_env_1.SentryExecutionEnvEnum.Browser](BrowserSentry) {
28
29
  const options = {
29
30
  integrations: [
30
- new BrowserSentry.HttpContext(),
31
- new BrowserSentry.Dedupe(),
32
- new BrowserSentry.InboundFilters(),
33
- new BrowserSentry.FunctionToString(),
34
- new BrowserSentry.GlobalHandlers(),
31
+ BrowserSentry.httpContextIntegration(),
32
+ BrowserSentry.dedupeIntegration(),
33
+ BrowserSentry.inboundFiltersIntegration(),
34
+ BrowserSentry.functionToStringIntegration(),
35
+ BrowserSentry.globalHandlersIntegration(),
35
36
  ],
36
37
  };
37
38
  return options;
@@ -39,11 +40,11 @@ const sentryConfigByEnv = {
39
40
  [execution_env_1.SentryExecutionEnvEnum.Node](NodeSentry) {
40
41
  const options = {
41
42
  integrations: [
42
- new NodeSentry.Integrations.OnUncaughtException(),
43
- new NodeSentry.Integrations.OnUnhandledRejection(),
44
- new NodeSentry.Integrations.ContextLines(),
45
- new NodeSentry.Integrations.Context(),
46
- new NodeSentry.Integrations.FunctionToString(),
43
+ NodeSentry.onUncaughtExceptionIntegration(),
44
+ NodeSentry.onUnhandledRejectionIntegration(),
45
+ NodeSentry.contextLinesIntegration(),
46
+ NodeSentry.nodeContextIntegration(),
47
+ NodeSentry.functionToStringIntegration(),
47
48
  ],
48
49
  };
49
50
  return options;
@@ -1,6 +1,6 @@
1
1
  import type { EventHint } from '@sentry/browser';
2
2
  import type { ErrorEvent, TransactionEvent } from '@sentry/types';
3
3
  /** Creates a handler for Sentry events based on the given env. */
4
- export declare function createSentryHandler(
4
+ export declare function createSentryHandler<T extends TransactionEvent | ErrorEvent>(
5
5
  /** If in dev, events won't be sent to Sentry. They will only be logged in the console. */
6
- isDev: boolean): (event: TransactionEvent | ErrorEvent, hint: EventHint) => TransactionEvent | ErrorEvent | null;
6
+ isDev: boolean): (event: T, hint: EventHint) => T | null;
@@ -11,22 +11,27 @@ export declare enum EventSeverityEnum {
11
11
  export type InfoEventSeverity = EventSeverityEnum.Debug | EventSeverityEnum.Info | EventSeverityEnum.Warning;
12
12
  /** Maps severities to the console methods used to log them. */
13
13
  export declare const consoleLogMethodPerSeverity: {
14
+ /** Maps to `console.warn`. */
14
15
  readonly warning: {
15
16
  (...data: any[]): void;
16
17
  (message?: any, ...optionalParams: any[]): void;
17
18
  };
19
+ /** Maps to `console.info`. */
18
20
  readonly info: {
19
21
  (...data: any[]): void;
20
22
  (message?: any, ...optionalParams: any[]): void;
21
23
  };
24
+ /** Maps to `console.debug`. */
22
25
  readonly debug: {
23
26
  (...data: any[]): void;
24
27
  (message?: any, ...optionalParams: any[]): void;
25
28
  };
29
+ /** Maps to `console.error`. */
26
30
  readonly fatal: {
27
31
  (...data: any[]): void;
28
32
  (message?: any, ...optionalParams: any[]): void;
29
33
  };
34
+ /** Maps to `console.error`. */
30
35
  readonly error: {
31
36
  (...data: any[]): void;
32
37
  (message?: any, ...optionalParams: any[]): void;
@@ -10,10 +10,15 @@ export var EventSeverityEnum;
10
10
  })(EventSeverityEnum || (EventSeverityEnum = {}));
11
11
  /** Maps severities to the console methods used to log them. */
12
12
  export const consoleLogMethodPerSeverity = {
13
+ /** Maps to `console.warn`. */
13
14
  [EventSeverityEnum.Warning]: console.warn,
15
+ /** Maps to `console.info`. */
14
16
  [EventSeverityEnum.Info]: console.info,
17
+ /** Maps to `console.debug`. */
15
18
  [EventSeverityEnum.Debug]: console.debug,
19
+ /** Maps to `console.error`. */
16
20
  [EventSeverityEnum.Fatal]: console.error,
21
+ /** Maps to `console.error`. */
17
22
  [EventSeverityEnum.Error]: console.error,
18
23
  };
19
24
  /** Extracts the severity level from a sentry event while defaulting to an info level severity. */
@@ -1,8 +1,10 @@
1
- import type { Options } from '@sentry/types';
2
- import { SentryBrowserDep, SentryDepByEnv, SentryExecutionEnvEnum, SentryNodeDep } from '../env/execution-env';
1
+ import { type BrowserOptions } from '@sentry/browser';
2
+ import type { NodeOptions } from '@sentry/node';
3
+ import { type Options } from '@sentry/types';
4
+ import { SentryDepByEnv, SentryExecutionEnvEnum } from '../env/execution-env';
3
5
  /** Optional UserOverrides of Sentry config values. */
4
6
  export type UserOverrides = Omit<Partial<Options>, keyof RequiredSentryOptions> | undefined;
5
7
  /** Sentry config options that are required. */
6
8
  export type RequiredSentryOptions = Pick<Required<Options>, 'dsn' | 'environment' | 'release'>;
7
9
  /** Creates the sentry config used internally by sentry-vir. */
8
- export declare function createSentryConfig<const ExecutionEnv extends SentryExecutionEnvEnum>(executionEnv: ExecutionEnv, sentryDep: SentryDepByEnv<ExecutionEnv>, requiredSentryOptions: RequiredSentryOptions, userOverrides: UserOverrides, isDev: boolean): Promise<SentryBrowserDep | SentryNodeDep>;
10
+ export declare function createSentryConfig<const ExecutionEnv extends SentryExecutionEnvEnum>(executionEnv: ExecutionEnv, sentryDep: SentryDepByEnv<ExecutionEnv>, requiredSentryOptions: RequiredSentryOptions, userOverrides: UserOverrides, isDev: boolean): Promise<BrowserOptions | NodeOptions>;
@@ -8,6 +8,7 @@ export async function createSentryConfig(executionEnv, sentryDep, requiredSentry
8
8
  beforeSendTransaction: createSentryHandler(isDev),
9
9
  defaultIntegrations: false,
10
10
  enabled: true,
11
+ maxValueLength: 10_000,
11
12
  };
12
13
  const envSentryConfig = sentryConfigByEnv[executionEnv](
13
14
  /**
@@ -23,11 +24,11 @@ const sentryConfigByEnv = {
23
24
  [SentryExecutionEnvEnum.Browser](BrowserSentry) {
24
25
  const options = {
25
26
  integrations: [
26
- new BrowserSentry.HttpContext(),
27
- new BrowserSentry.Dedupe(),
28
- new BrowserSentry.InboundFilters(),
29
- new BrowserSentry.FunctionToString(),
30
- new BrowserSentry.GlobalHandlers(),
27
+ BrowserSentry.httpContextIntegration(),
28
+ BrowserSentry.dedupeIntegration(),
29
+ BrowserSentry.inboundFiltersIntegration(),
30
+ BrowserSentry.functionToStringIntegration(),
31
+ BrowserSentry.globalHandlersIntegration(),
31
32
  ],
32
33
  };
33
34
  return options;
@@ -35,11 +36,11 @@ const sentryConfigByEnv = {
35
36
  [SentryExecutionEnvEnum.Node](NodeSentry) {
36
37
  const options = {
37
38
  integrations: [
38
- new NodeSentry.Integrations.OnUncaughtException(),
39
- new NodeSentry.Integrations.OnUnhandledRejection(),
40
- new NodeSentry.Integrations.ContextLines(),
41
- new NodeSentry.Integrations.Context(),
42
- new NodeSentry.Integrations.FunctionToString(),
39
+ NodeSentry.onUncaughtExceptionIntegration(),
40
+ NodeSentry.onUnhandledRejectionIntegration(),
41
+ NodeSentry.contextLinesIntegration(),
42
+ NodeSentry.nodeContextIntegration(),
43
+ NodeSentry.functionToStringIntegration(),
43
44
  ],
44
45
  };
45
46
  return options;
@@ -1,6 +1,6 @@
1
1
  import type { EventHint } from '@sentry/browser';
2
2
  import type { ErrorEvent, TransactionEvent } from '@sentry/types';
3
3
  /** Creates a handler for Sentry events based on the given env. */
4
- export declare function createSentryHandler(
4
+ export declare function createSentryHandler<T extends TransactionEvent | ErrorEvent>(
5
5
  /** If in dev, events won't be sent to Sentry. They will only be logged in the console. */
6
- isDev: boolean): (event: TransactionEvent | ErrorEvent, hint: EventHint) => TransactionEvent | ErrorEvent | null;
6
+ isDev: boolean): (event: T, hint: EventHint) => T | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sentry-vir",
3
- "version": "1.1.0",
3
+ "version": "2.0.0",
4
4
  "keywords": [
5
5
  "config",
6
6
  "helper",
@@ -39,42 +39,42 @@
39
39
  "test:types": "tsc --noEmit"
40
40
  },
41
41
  "dependencies": {
42
- "@augment-vir/common": "^23.3.2",
43
- "@sentry/browser": "^7.101.1",
44
- "@sentry/core": "^7.101.1",
45
- "@sentry/node": "^7.101.1",
46
- "@sentry/types": "^7.101.1",
47
- "type-fest": "^4.10.2"
42
+ "@augment-vir/common": "^28.2.2",
43
+ "@sentry/browser": "^8.10.0",
44
+ "@sentry/core": "^8.10.0",
45
+ "@sentry/node": "^8.10.0",
46
+ "@sentry/types": "^8.10.0",
47
+ "type-fest": "^4.20.1"
48
48
  },
49
49
  "devDependencies": {
50
- "@augment-vir/browser-testing": "^23.3.2",
51
- "@augment-vir/node-js": "^23.3.2",
50
+ "@augment-vir/browser-testing": "^28.2.2",
51
+ "@augment-vir/node-js": "^28.2.2",
52
52
  "@open-wc/testing": "^4.0.0",
53
53
  "@types/mocha": "^10.0.6",
54
54
  "@web/dev-server-esbuild": "^1.0.2",
55
- "@web/test-runner": "^0.18.0",
55
+ "@web/test-runner": "^0.18.2",
56
56
  "@web/test-runner-commands": "^0.9.0",
57
57
  "@web/test-runner-playwright": "^0.11.0",
58
58
  "@web/test-runner-visual-regression": "^0.9.0",
59
- "cspell": "^8.3.2",
60
- "dependency-cruiser": "^16.2.0",
61
- "esbuild": "^0.20.0",
62
- "istanbul-smart-text-reporter": "^1.1.3",
63
- "markdown-code-example-inserter": "^0.3.3",
59
+ "cspell": "^8.9.0",
60
+ "dependency-cruiser": "^16.3.3",
61
+ "esbuild": "^0.21.5",
62
+ "istanbul-smart-text-reporter": "^1.1.4",
63
+ "markdown-code-example-inserter": "^1.0.0",
64
64
  "npm-check-updates": "~16.12.3",
65
- "prettier": "^3.2.2",
66
- "prettier-plugin-interpolated-html-tags": "^1.0.3",
65
+ "prettier": "^3.3.2",
66
+ "prettier-plugin-interpolated-html-tags": "^1.0.5",
67
67
  "prettier-plugin-jsdoc": "^1.3.0",
68
- "prettier-plugin-multiline-arrays": "^3.0.3",
68
+ "prettier-plugin-multiline-arrays": "^3.0.6",
69
69
  "prettier-plugin-organize-imports": "^3.2.4",
70
- "prettier-plugin-packagejson": "^2.4.11",
71
- "prettier-plugin-sort-json": "^3.1.0",
70
+ "prettier-plugin-packagejson": "^2.5.0",
71
+ "prettier-plugin-sort-json": "^4.0.0",
72
72
  "prettier-plugin-toml": "^2.0.1",
73
- "run-time-assertions": "^0.3.0",
74
- "typedoc": "^0.25.8",
75
- "typescript": "^5.3.3",
76
- "virmator": "^11.3.2",
73
+ "run-time-assertions": "^1.5.1",
74
+ "typedoc": "^0.25.13",
75
+ "typescript": "^5.4.5",
76
+ "virmator": "^12.0.1",
77
77
  "vite": "^4.5.2",
78
- "vite-tsconfig-paths": "^4.3.1"
78
+ "vite-tsconfig-paths": "^4.3.2"
79
79
  }
80
80
  }