@sentry/gatsby 7.0.0-beta.0 → 7.0.0-rc.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
@@ -1,8 +1,7 @@
1
1
  <p align="center">
2
- <a href="https://sentry.io" target="_blank" align="center">
3
- <img src="https://sentry-brand.storage.googleapis.com/sentry-logo-black.png" width="280">
2
+ <a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
3
+ <img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Sentry" width="280" height="84">
4
4
  </a>
5
- <br />
6
5
  </p>
7
6
 
8
7
  # Official Sentry SDK for GatsbyJS
package/cjs/index.js CHANGED
@@ -1,8 +1,14 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- const tslib_1 = require("tslib");
3
- tslib_1.__exportStar(require("@sentry/react"), exports);
4
- var tracing_1 = require("@sentry/tracing");
5
- exports.Integrations = tracing_1.Integrations;
6
- var sdk_1 = require("./sdk");
7
- exports.init = sdk_1.init;
8
- //# sourceMappingURL=index.js.map
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+
3
+ var react = require('@sentry/react');
4
+ var Tracing = require('@sentry/tracing');
5
+ var sdk = require('./sdk.js');
6
+
7
+
8
+
9
+ exports.Integrations = Tracing.Integrations;
10
+ exports.init = sdk.init;
11
+ for (var k in react) {
12
+ if (k !== 'default' && !exports.hasOwnProperty(k)) exports[k] = react[k];
13
+ }
14
+ //# sourceMappingURL=index.js.map
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;AAAA,wDAA8B;AAC9B,2CAA+C;AAAtC,iCAAA,YAAY,CAAA;AAErB,6BAA6B;AAApB,qBAAA,IAAI,CAAA","sourcesContent":["export * from '@sentry/react';\nexport { Integrations } from '@sentry/tracing';\n\nexport { init } from './sdk';\n"]}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
package/cjs/sdk.js CHANGED
@@ -1,23 +1,30 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- const react_1 = require("@sentry/react");
3
- const integrations_1 = require("./utils/integrations");
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+
3
+ var react = require('@sentry/react');
4
+ var integrations = require('./utils/integrations.js');
5
+
4
6
  /**
5
7
  * Inits the Sentry Gatsby SDK.
6
8
  */
7
9
  function init(options) {
8
- options._metadata = options._metadata || {};
9
- options._metadata.sdk = options._metadata.sdk || {
10
- name: 'sentry.javascript.gatsby',
11
- packages: [
12
- {
13
- name: 'npm:@sentry/gatsby',
14
- version: react_1.SDK_VERSION,
15
- },
16
- ],
17
- version: react_1.SDK_VERSION,
18
- };
19
- const integrations = integrations_1.getIntegrationsFromOptions(options);
20
- react_1.init(Object.assign(Object.assign({}, options), { integrations }));
10
+ options._metadata = options._metadata || {};
11
+ options._metadata.sdk = options._metadata.sdk || {
12
+ name: 'sentry.javascript.gatsby',
13
+ packages: [
14
+ {
15
+ name: 'npm:@sentry/gatsby',
16
+ version: react.SDK_VERSION,
17
+ },
18
+ ],
19
+ version: react.SDK_VERSION,
20
+ };
21
+
22
+ var integrations$1 = integrations.getIntegrationsFromOptions(options);
23
+ react.init({
24
+ ...options,
25
+ integrations: integrations$1,
26
+ });
21
27
  }
28
+
22
29
  exports.init = init;
23
- //# sourceMappingURL=sdk.js.map
30
+ //# sourceMappingURL=sdk.js.map
package/cjs/sdk.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":";AAAA,yCAA+D;AAE/D,uDAAkE;AAGlE;;GAEG;AACH,SAAgB,IAAI,CAAC,OAAsB;IACzC,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC;IAC5C,OAAO,CAAC,SAAS,CAAC,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI;QAC/C,IAAI,EAAE,0BAA0B;QAChC,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,oBAAoB;gBAC1B,OAAO,EAAE,mBAAW;aACrB;SACF;QACD,OAAO,EAAE,mBAAW;KACrB,CAAC;IAEF,MAAM,YAAY,GAAG,yCAA0B,CAAC,OAAO,CAAC,CAAC;IACzD,YAAS,iCACJ,OAAO,KACV,YAAY,IACZ,CAAC;AACL,CAAC;AAlBD,oBAkBC","sourcesContent":["import { init as reactInit, SDK_VERSION } from '@sentry/react';\n\nimport { getIntegrationsFromOptions } from './utils/integrations';\nimport { GatsbyOptions } from './utils/types';\n\n/**\n * Inits the Sentry Gatsby SDK.\n */\nexport function init(options: GatsbyOptions): void {\n options._metadata = options._metadata || {};\n options._metadata.sdk = options._metadata.sdk || {\n name: 'sentry.javascript.gatsby',\n packages: [\n {\n name: 'npm:@sentry/gatsby',\n version: SDK_VERSION,\n },\n ],\n version: SDK_VERSION,\n };\n\n const integrations = getIntegrationsFromOptions(options);\n reactInit({\n ...options,\n integrations,\n });\n}\n"]}
1
+ {"version":3,"file":"sdk.js","sources":["../../src/sdk.ts"],"sourcesContent":["import { init as reactInit, SDK_VERSION } from '@sentry/react';\n\nimport { getIntegrationsFromOptions } from './utils/integrations';\nimport { GatsbyOptions } from './utils/types';\n\n/**\n * Inits the Sentry Gatsby SDK.\n */\nexport function init(options: GatsbyOptions): void {\n options._metadata = options._metadata || {};\n options._metadata.sdk = options._metadata.sdk || {\n name: 'sentry.javascript.gatsby',\n packages: [\n {\n name: 'npm:@sentry/gatsby',\n version: SDK_VERSION,\n },\n ],\n version: SDK_VERSION,\n };\n\n const integrations = getIntegrationsFromOptions(options);\n reactInit({\n ...options,\n integrations,\n });\n}\n"],"names":[],"mappings":";;;;;AAKA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;"}
@@ -1,5 +1,7 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- const Tracing = require("@sentry/tracing");
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+
3
+ var Tracing = require('@sentry/tracing');
4
+
3
5
  /**
4
6
  * Returns the integrations to add to the SDK.
5
7
  * If tracing is enabled, `BrowserTracing` is always present.
@@ -7,18 +9,16 @@ const Tracing = require("@sentry/tracing");
7
9
  * @param options The options users have defined.
8
10
  */
9
11
  function getIntegrationsFromOptions(options) {
10
- const isTracingEnabled = Tracing.hasTracingEnabled(options);
11
- if (options.integrations === undefined) {
12
- return getIntegrationsFromArray([], isTracingEnabled);
13
- }
14
- else if (Array.isArray(options.integrations)) {
15
- return getIntegrationsFromArray(options.integrations, isTracingEnabled);
16
- }
17
- else {
18
- return getIntegrationsFromFunction(options.integrations, isTracingEnabled);
19
- }
12
+ var isTracingEnabled = Tracing.hasTracingEnabled(options);
13
+ if (options.integrations === undefined) {
14
+ return getIntegrationsFromArray([], isTracingEnabled);
15
+ } else if (Array.isArray(options.integrations)) {
16
+ return getIntegrationsFromArray(options.integrations, isTracingEnabled);
17
+ } else {
18
+ return getIntegrationsFromFunction(options.integrations, isTracingEnabled);
19
+ }
20
20
  }
21
- exports.getIntegrationsFromOptions = getIntegrationsFromOptions;
21
+
22
22
  /**
23
23
  * Returns the integrations to add to the SDK, from the given integrations array.
24
24
  *
@@ -26,22 +26,30 @@ exports.getIntegrationsFromOptions = getIntegrationsFromOptions;
26
26
  * @param isTracingEnabled Whether the user has enabled tracing.
27
27
  */
28
28
  function getIntegrationsFromArray(userIntegrations, isTracingEnabled) {
29
- if (isTracingEnabled &&
30
- !userIntegrations.some(integration => integration.name === Tracing.Integrations.BrowserTracing.name)) {
31
- userIntegrations.push(new Tracing.Integrations.BrowserTracing());
32
- }
33
- return userIntegrations;
29
+ if (
30
+ isTracingEnabled &&
31
+ !userIntegrations.some(integration => integration.name === Tracing.Integrations.BrowserTracing.name)
32
+ ) {
33
+ userIntegrations.push(new Tracing.Integrations.BrowserTracing());
34
+ }
35
+ return userIntegrations;
34
36
  }
37
+
35
38
  /**
36
39
  * Returns the integrations to add to the SDK, from the given function.
37
40
  *
38
41
  * @param userIntegrations Function returning the user's integrations.
39
42
  * @param isTracingEnabled Whether the user has enabled tracing.
40
43
  */
41
- function getIntegrationsFromFunction(userIntegrations, isTracingEnabled) {
42
- const wrapper = (defaultIntegrations) => {
43
- return getIntegrationsFromArray(userIntegrations(defaultIntegrations), isTracingEnabled);
44
- };
45
- return wrapper;
44
+ function getIntegrationsFromFunction(
45
+ userIntegrations,
46
+ isTracingEnabled,
47
+ ) {
48
+ var wrapper = (defaultIntegrations) => {
49
+ return getIntegrationsFromArray(userIntegrations(defaultIntegrations), isTracingEnabled);
50
+ };
51
+ return wrapper;
46
52
  }
47
- //# sourceMappingURL=integrations.js.map
53
+
54
+ exports.getIntegrationsFromOptions = getIntegrationsFromOptions;
55
+ //# sourceMappingURL=integrations.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"integrations.js","sourceRoot":"","sources":["../../../src/utils/integrations.ts"],"names":[],"mappings":";AAAA,2CAA2C;AAQ3C;;;;;GAKG;AACH,SAAgB,0BAA0B,CAAC,OAAsB;IAC/D,MAAM,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAC5D,IAAI,OAAO,CAAC,YAAY,KAAK,SAAS,EAAE;QACtC,OAAO,wBAAwB,CAAC,EAAE,EAAE,gBAAgB,CAAC,CAAC;KACvD;SAAM,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;QAC9C,OAAO,wBAAwB,CAAC,OAAO,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC;KACzE;SAAM;QACL,OAAO,2BAA2B,CAAC,OAAO,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC;KAC5E;AACH,CAAC;AATD,gEASC;AAED;;;;;GAKG;AACH,SAAS,wBAAwB,CAAC,gBAA+B,EAAE,gBAAyB;IAC1F,IACE,gBAAgB;QAChB,CAAC,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,IAAI,KAAK,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,IAAI,CAAC,EACpG;QACA,gBAAgB,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,YAAY,CAAC,cAAc,EAAE,CAAC,CAAC;KAClE;IACD,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED;;;;;GAKG;AACH,SAAS,2BAA2B,CAClC,gBAAoC,EACpC,gBAAyB;IAEzB,MAAM,OAAO,GAAuB,CAAC,mBAAkC,EAAE,EAAE;QACzE,OAAO,wBAAwB,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,EAAE,gBAAgB,CAAC,CAAC;IAC3F,CAAC,CAAC;IACF,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["import * as Tracing from '@sentry/tracing';\nimport { Integration } from '@sentry/types';\n\nimport { GatsbyOptions } from './types';\n\ntype UserFnIntegrations = (integrations: Integration[]) => Integration[];\nexport type UserIntegrations = Integration[] | UserFnIntegrations;\n\n/**\n * Returns the integrations to add to the SDK.\n * If tracing is enabled, `BrowserTracing` is always present.\n *\n * @param options The options users have defined.\n */\nexport function getIntegrationsFromOptions(options: GatsbyOptions): UserIntegrations {\n const isTracingEnabled = Tracing.hasTracingEnabled(options);\n if (options.integrations === undefined) {\n return getIntegrationsFromArray([], isTracingEnabled);\n } else if (Array.isArray(options.integrations)) {\n return getIntegrationsFromArray(options.integrations, isTracingEnabled);\n } else {\n return getIntegrationsFromFunction(options.integrations, isTracingEnabled);\n }\n}\n\n/**\n * Returns the integrations to add to the SDK, from the given integrations array.\n *\n * @param userIntegrations Array of user's integrations.\n * @param isTracingEnabled Whether the user has enabled tracing.\n */\nfunction getIntegrationsFromArray(userIntegrations: Integration[], isTracingEnabled: boolean): Integration[] {\n if (\n isTracingEnabled &&\n !userIntegrations.some(integration => integration.name === Tracing.Integrations.BrowserTracing.name)\n ) {\n userIntegrations.push(new Tracing.Integrations.BrowserTracing());\n }\n return userIntegrations;\n}\n\n/**\n * Returns the integrations to add to the SDK, from the given function.\n *\n * @param userIntegrations Function returning the user's integrations.\n * @param isTracingEnabled Whether the user has enabled tracing.\n */\nfunction getIntegrationsFromFunction(\n userIntegrations: UserFnIntegrations,\n isTracingEnabled: boolean,\n): UserFnIntegrations {\n const wrapper: UserFnIntegrations = (defaultIntegrations: Integration[]) => {\n return getIntegrationsFromArray(userIntegrations(defaultIntegrations), isTracingEnabled);\n };\n return wrapper;\n}\n"]}
1
+ {"version":3,"file":"integrations.js","sources":["../../../src/utils/integrations.ts"],"sourcesContent":["import * as Tracing from '@sentry/tracing';\nimport { Integration } from '@sentry/types';\n\nimport { GatsbyOptions } from './types';\n\ntype UserFnIntegrations = (integrations: Integration[]) => Integration[];\nexport type UserIntegrations = Integration[] | UserFnIntegrations;\n\n/**\n * Returns the integrations to add to the SDK.\n * If tracing is enabled, `BrowserTracing` is always present.\n *\n * @param options The options users have defined.\n */\nexport function getIntegrationsFromOptions(options: GatsbyOptions): UserIntegrations {\n const isTracingEnabled = Tracing.hasTracingEnabled(options);\n if (options.integrations === undefined) {\n return getIntegrationsFromArray([], isTracingEnabled);\n } else if (Array.isArray(options.integrations)) {\n return getIntegrationsFromArray(options.integrations, isTracingEnabled);\n } else {\n return getIntegrationsFromFunction(options.integrations, isTracingEnabled);\n }\n}\n\n/**\n * Returns the integrations to add to the SDK, from the given integrations array.\n *\n * @param userIntegrations Array of user's integrations.\n * @param isTracingEnabled Whether the user has enabled tracing.\n */\nfunction getIntegrationsFromArray(userIntegrations: Integration[], isTracingEnabled: boolean): Integration[] {\n if (\n isTracingEnabled &&\n !userIntegrations.some(integration => integration.name === Tracing.Integrations.BrowserTracing.name)\n ) {\n userIntegrations.push(new Tracing.Integrations.BrowserTracing());\n }\n return userIntegrations;\n}\n\n/**\n * Returns the integrations to add to the SDK, from the given function.\n *\n * @param userIntegrations Function returning the user's integrations.\n * @param isTracingEnabled Whether the user has enabled tracing.\n */\nfunction getIntegrationsFromFunction(\n userIntegrations: UserFnIntegrations,\n isTracingEnabled: boolean,\n): UserFnIntegrations {\n const wrapper: UserFnIntegrations = (defaultIntegrations: Integration[]) => {\n return getIntegrationsFromArray(userIntegrations(defaultIntegrations), isTracingEnabled);\n };\n return wrapper;\n}\n"],"names":[],"mappings":";;;;AAQA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;"}
package/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  export * from '@sentry/react';
2
2
  export { Integrations } from '@sentry/tracing';
3
- export { init } from './sdk';
4
- //# sourceMappingURL=index.js.map
3
+ export { init } from './sdk.js';
4
+ //# sourceMappingURL=index.js.map
package/esm/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC","sourcesContent":["export * from '@sentry/react';\nexport { Integrations } from '@sentry/tracing';\n\nexport { init } from './sdk';\n"]}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
package/esm/sdk.js CHANGED
@@ -1,21 +1,28 @@
1
- import { init as reactInit, SDK_VERSION } from '@sentry/react';
2
- import { getIntegrationsFromOptions } from './utils/integrations';
1
+ import { SDK_VERSION, init as init$1 } from '@sentry/react';
2
+ import { getIntegrationsFromOptions } from './utils/integrations.js';
3
+
3
4
  /**
4
5
  * Inits the Sentry Gatsby SDK.
5
6
  */
6
- export function init(options) {
7
- options._metadata = options._metadata || {};
8
- options._metadata.sdk = options._metadata.sdk || {
9
- name: 'sentry.javascript.gatsby',
10
- packages: [
11
- {
12
- name: 'npm:@sentry/gatsby',
13
- version: SDK_VERSION,
14
- },
15
- ],
7
+ function init(options) {
8
+ options._metadata = options._metadata || {};
9
+ options._metadata.sdk = options._metadata.sdk || {
10
+ name: 'sentry.javascript.gatsby',
11
+ packages: [
12
+ {
13
+ name: 'npm:@sentry/gatsby',
16
14
  version: SDK_VERSION,
17
- };
18
- const integrations = getIntegrationsFromOptions(options);
19
- reactInit(Object.assign(Object.assign({}, options), { integrations }));
15
+ },
16
+ ],
17
+ version: SDK_VERSION,
18
+ };
19
+
20
+ var integrations = getIntegrationsFromOptions(options);
21
+ init$1({
22
+ ...options,
23
+ integrations,
24
+ });
20
25
  }
21
- //# sourceMappingURL=sdk.js.map
26
+
27
+ export { init };
28
+ //# sourceMappingURL=sdk.js.map
package/esm/sdk.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"sdk.js","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE/D,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAGlE;;GAEG;AACH,MAAM,UAAU,IAAI,CAAC,OAAsB;IACzC,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC;IAC5C,OAAO,CAAC,SAAS,CAAC,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI;QAC/C,IAAI,EAAE,0BAA0B;QAChC,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,oBAAoB;gBAC1B,OAAO,EAAE,WAAW;aACrB;SACF;QACD,OAAO,EAAE,WAAW;KACrB,CAAC;IAEF,MAAM,YAAY,GAAG,0BAA0B,CAAC,OAAO,CAAC,CAAC;IACzD,SAAS,iCACJ,OAAO,KACV,YAAY,IACZ,CAAC;AACL,CAAC","sourcesContent":["import { init as reactInit, SDK_VERSION } from '@sentry/react';\n\nimport { getIntegrationsFromOptions } from './utils/integrations';\nimport { GatsbyOptions } from './utils/types';\n\n/**\n * Inits the Sentry Gatsby SDK.\n */\nexport function init(options: GatsbyOptions): void {\n options._metadata = options._metadata || {};\n options._metadata.sdk = options._metadata.sdk || {\n name: 'sentry.javascript.gatsby',\n packages: [\n {\n name: 'npm:@sentry/gatsby',\n version: SDK_VERSION,\n },\n ],\n version: SDK_VERSION,\n };\n\n const integrations = getIntegrationsFromOptions(options);\n reactInit({\n ...options,\n integrations,\n });\n}\n"]}
1
+ {"version":3,"file":"sdk.js","sources":["../../src/sdk.ts"],"sourcesContent":["import { init as reactInit, SDK_VERSION } from '@sentry/react';\n\nimport { getIntegrationsFromOptions } from './utils/integrations';\nimport { GatsbyOptions } from './utils/types';\n\n/**\n * Inits the Sentry Gatsby SDK.\n */\nexport function init(options: GatsbyOptions): void {\n options._metadata = options._metadata || {};\n options._metadata.sdk = options._metadata.sdk || {\n name: 'sentry.javascript.gatsby',\n packages: [\n {\n name: 'npm:@sentry/gatsby',\n version: SDK_VERSION,\n },\n ],\n version: SDK_VERSION,\n };\n\n const integrations = getIntegrationsFromOptions(options);\n reactInit({\n ...options,\n integrations,\n });\n}\n"],"names":[],"mappings":";;;AAKA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
@@ -1,22 +1,22 @@
1
1
  import * as Tracing from '@sentry/tracing';
2
+
2
3
  /**
3
4
  * Returns the integrations to add to the SDK.
4
5
  * If tracing is enabled, `BrowserTracing` is always present.
5
6
  *
6
7
  * @param options The options users have defined.
7
8
  */
8
- export function getIntegrationsFromOptions(options) {
9
- const isTracingEnabled = Tracing.hasTracingEnabled(options);
10
- if (options.integrations === undefined) {
11
- return getIntegrationsFromArray([], isTracingEnabled);
12
- }
13
- else if (Array.isArray(options.integrations)) {
14
- return getIntegrationsFromArray(options.integrations, isTracingEnabled);
15
- }
16
- else {
17
- return getIntegrationsFromFunction(options.integrations, isTracingEnabled);
18
- }
9
+ function getIntegrationsFromOptions(options) {
10
+ var isTracingEnabled = Tracing.hasTracingEnabled(options);
11
+ if (options.integrations === undefined) {
12
+ return getIntegrationsFromArray([], isTracingEnabled);
13
+ } else if (Array.isArray(options.integrations)) {
14
+ return getIntegrationsFromArray(options.integrations, isTracingEnabled);
15
+ } else {
16
+ return getIntegrationsFromFunction(options.integrations, isTracingEnabled);
17
+ }
19
18
  }
19
+
20
20
  /**
21
21
  * Returns the integrations to add to the SDK, from the given integrations array.
22
22
  *
@@ -24,22 +24,30 @@ export function getIntegrationsFromOptions(options) {
24
24
  * @param isTracingEnabled Whether the user has enabled tracing.
25
25
  */
26
26
  function getIntegrationsFromArray(userIntegrations, isTracingEnabled) {
27
- if (isTracingEnabled &&
28
- !userIntegrations.some(integration => integration.name === Tracing.Integrations.BrowserTracing.name)) {
29
- userIntegrations.push(new Tracing.Integrations.BrowserTracing());
30
- }
31
- return userIntegrations;
27
+ if (
28
+ isTracingEnabled &&
29
+ !userIntegrations.some(integration => integration.name === Tracing.Integrations.BrowserTracing.name)
30
+ ) {
31
+ userIntegrations.push(new Tracing.Integrations.BrowserTracing());
32
+ }
33
+ return userIntegrations;
32
34
  }
35
+
33
36
  /**
34
37
  * Returns the integrations to add to the SDK, from the given function.
35
38
  *
36
39
  * @param userIntegrations Function returning the user's integrations.
37
40
  * @param isTracingEnabled Whether the user has enabled tracing.
38
41
  */
39
- function getIntegrationsFromFunction(userIntegrations, isTracingEnabled) {
40
- const wrapper = (defaultIntegrations) => {
41
- return getIntegrationsFromArray(userIntegrations(defaultIntegrations), isTracingEnabled);
42
- };
43
- return wrapper;
42
+ function getIntegrationsFromFunction(
43
+ userIntegrations,
44
+ isTracingEnabled,
45
+ ) {
46
+ var wrapper = (defaultIntegrations) => {
47
+ return getIntegrationsFromArray(userIntegrations(defaultIntegrations), isTracingEnabled);
48
+ };
49
+ return wrapper;
44
50
  }
45
- //# sourceMappingURL=integrations.js.map
51
+
52
+ export { getIntegrationsFromOptions };
53
+ //# sourceMappingURL=integrations.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"integrations.js","sourceRoot":"","sources":["../../../src/utils/integrations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAQ3C;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B,CAAC,OAAsB;IAC/D,MAAM,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAC5D,IAAI,OAAO,CAAC,YAAY,KAAK,SAAS,EAAE;QACtC,OAAO,wBAAwB,CAAC,EAAE,EAAE,gBAAgB,CAAC,CAAC;KACvD;SAAM,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;QAC9C,OAAO,wBAAwB,CAAC,OAAO,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC;KACzE;SAAM;QACL,OAAO,2BAA2B,CAAC,OAAO,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAC;KAC5E;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAS,wBAAwB,CAAC,gBAA+B,EAAE,gBAAyB;IAC1F,IACE,gBAAgB;QAChB,CAAC,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,IAAI,KAAK,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,IAAI,CAAC,EACpG;QACA,gBAAgB,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,YAAY,CAAC,cAAc,EAAE,CAAC,CAAC;KAClE;IACD,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED;;;;;GAKG;AACH,SAAS,2BAA2B,CAClC,gBAAoC,EACpC,gBAAyB;IAEzB,MAAM,OAAO,GAAuB,CAAC,mBAAkC,EAAE,EAAE;QACzE,OAAO,wBAAwB,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,EAAE,gBAAgB,CAAC,CAAC;IAC3F,CAAC,CAAC;IACF,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["import * as Tracing from '@sentry/tracing';\nimport { Integration } from '@sentry/types';\n\nimport { GatsbyOptions } from './types';\n\ntype UserFnIntegrations = (integrations: Integration[]) => Integration[];\nexport type UserIntegrations = Integration[] | UserFnIntegrations;\n\n/**\n * Returns the integrations to add to the SDK.\n * If tracing is enabled, `BrowserTracing` is always present.\n *\n * @param options The options users have defined.\n */\nexport function getIntegrationsFromOptions(options: GatsbyOptions): UserIntegrations {\n const isTracingEnabled = Tracing.hasTracingEnabled(options);\n if (options.integrations === undefined) {\n return getIntegrationsFromArray([], isTracingEnabled);\n } else if (Array.isArray(options.integrations)) {\n return getIntegrationsFromArray(options.integrations, isTracingEnabled);\n } else {\n return getIntegrationsFromFunction(options.integrations, isTracingEnabled);\n }\n}\n\n/**\n * Returns the integrations to add to the SDK, from the given integrations array.\n *\n * @param userIntegrations Array of user's integrations.\n * @param isTracingEnabled Whether the user has enabled tracing.\n */\nfunction getIntegrationsFromArray(userIntegrations: Integration[], isTracingEnabled: boolean): Integration[] {\n if (\n isTracingEnabled &&\n !userIntegrations.some(integration => integration.name === Tracing.Integrations.BrowserTracing.name)\n ) {\n userIntegrations.push(new Tracing.Integrations.BrowserTracing());\n }\n return userIntegrations;\n}\n\n/**\n * Returns the integrations to add to the SDK, from the given function.\n *\n * @param userIntegrations Function returning the user's integrations.\n * @param isTracingEnabled Whether the user has enabled tracing.\n */\nfunction getIntegrationsFromFunction(\n userIntegrations: UserFnIntegrations,\n isTracingEnabled: boolean,\n): UserFnIntegrations {\n const wrapper: UserFnIntegrations = (defaultIntegrations: Integration[]) => {\n return getIntegrationsFromArray(userIntegrations(defaultIntegrations), isTracingEnabled);\n };\n return wrapper;\n}\n"]}
1
+ {"version":3,"file":"integrations.js","sources":["../../../src/utils/integrations.ts"],"sourcesContent":["import * as Tracing from '@sentry/tracing';\nimport { Integration } from '@sentry/types';\n\nimport { GatsbyOptions } from './types';\n\ntype UserFnIntegrations = (integrations: Integration[]) => Integration[];\nexport type UserIntegrations = Integration[] | UserFnIntegrations;\n\n/**\n * Returns the integrations to add to the SDK.\n * If tracing is enabled, `BrowserTracing` is always present.\n *\n * @param options The options users have defined.\n */\nexport function getIntegrationsFromOptions(options: GatsbyOptions): UserIntegrations {\n const isTracingEnabled = Tracing.hasTracingEnabled(options);\n if (options.integrations === undefined) {\n return getIntegrationsFromArray([], isTracingEnabled);\n } else if (Array.isArray(options.integrations)) {\n return getIntegrationsFromArray(options.integrations, isTracingEnabled);\n } else {\n return getIntegrationsFromFunction(options.integrations, isTracingEnabled);\n }\n}\n\n/**\n * Returns the integrations to add to the SDK, from the given integrations array.\n *\n * @param userIntegrations Array of user's integrations.\n * @param isTracingEnabled Whether the user has enabled tracing.\n */\nfunction getIntegrationsFromArray(userIntegrations: Integration[], isTracingEnabled: boolean): Integration[] {\n if (\n isTracingEnabled &&\n !userIntegrations.some(integration => integration.name === Tracing.Integrations.BrowserTracing.name)\n ) {\n userIntegrations.push(new Tracing.Integrations.BrowserTracing());\n }\n return userIntegrations;\n}\n\n/**\n * Returns the integrations to add to the SDK, from the given function.\n *\n * @param userIntegrations Function returning the user's integrations.\n * @param isTracingEnabled Whether the user has enabled tracing.\n */\nfunction getIntegrationsFromFunction(\n userIntegrations: UserFnIntegrations,\n isTracingEnabled: boolean,\n): UserFnIntegrations {\n const wrapper: UserFnIntegrations = (defaultIntegrations: Integration[]) => {\n return getIntegrationsFromArray(userIntegrations(defaultIntegrations), isTracingEnabled);\n };\n return wrapper;\n}\n"],"names":[],"mappings":";;AAQA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/gatsby",
3
- "version": "7.0.0-beta.0",
3
+ "version": "7.0.0-rc.0",
4
4
  "description": "Official Sentry SDK for Gatsby.js",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/gatsby",
@@ -20,8 +20,10 @@
20
20
  "access": "public"
21
21
  },
22
22
  "dependencies": {
23
- "@sentry/react": "7.0.0-beta.0",
24
- "@sentry/tracing": "7.0.0-beta.0",
23
+ "@sentry/react": "7.0.0-rc.0",
24
+ "@sentry/tracing": "7.0.0-rc.0",
25
+ "@sentry/types": "7.0.0-rc.0",
26
+ "@sentry/utils": "7.0.0-rc.0",
25
27
  "@sentry/webpack-plugin": "1.18.9"
26
28
  },
27
29
  "peerDependencies": {
@@ -29,7 +31,6 @@
29
31
  "react": "15.x || 16.x || 17.x || 18.x"
30
32
  },
31
33
  "devDependencies": {
32
- "@sentry/types": "7.0.0-beta.0",
33
34
  "@testing-library/react": "^13.0.0",
34
35
  "react": "^18.0.0"
35
36
  },
package/cjs/index.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export * from '@sentry/react';
2
- export { Integrations } from '@sentry/tracing';
3
- export { init } from './sdk';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC"}
package/cjs/sdk.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import { GatsbyOptions } from './utils/types';
2
- /**
3
- * Inits the Sentry Gatsby SDK.
4
- */
5
- export declare function init(options: GatsbyOptions): void;
6
- //# sourceMappingURL=sdk.d.ts.map
package/cjs/sdk.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAkBjD"}
@@ -1,13 +0,0 @@
1
- import { Integration } from '@sentry/types';
2
- import { GatsbyOptions } from './types';
3
- declare type UserFnIntegrations = (integrations: Integration[]) => Integration[];
4
- export declare type UserIntegrations = Integration[] | UserFnIntegrations;
5
- /**
6
- * Returns the integrations to add to the SDK.
7
- * If tracing is enabled, `BrowserTracing` is always present.
8
- *
9
- * @param options The options users have defined.
10
- */
11
- export declare function getIntegrationsFromOptions(options: GatsbyOptions): UserIntegrations;
12
- export {};
13
- //# sourceMappingURL=integrations.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../../../src/utils/integrations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,aAAK,kBAAkB,GAAG,CAAC,YAAY,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,CAAC;AACzE,oBAAY,gBAAgB,GAAG,WAAW,EAAE,GAAG,kBAAkB,CAAC;AAElE;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,aAAa,GAAG,gBAAgB,CASnF"}
@@ -1,3 +0,0 @@
1
- import { BrowserOptions } from '@sentry/react';
2
- export declare type GatsbyOptions = BrowserOptions;
3
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,oBAAY,aAAa,GAAG,cAAc,CAAC"}
@@ -1,2 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/utils/types.ts"],"names":[],"mappings":"","sourcesContent":["import { BrowserOptions } from '@sentry/react';\n\nexport type GatsbyOptions = BrowserOptions;\n"]}
package/esm/index.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export * from '@sentry/react';
2
- export { Integrations } from '@sentry/tracing';
3
- export { init } from './sdk';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC"}
package/esm/sdk.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import { GatsbyOptions } from './utils/types';
2
- /**
3
- * Inits the Sentry Gatsby SDK.
4
- */
5
- export declare function init(options: GatsbyOptions): void;
6
- //# sourceMappingURL=sdk.d.ts.map
package/esm/sdk.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAkBjD"}
@@ -1,13 +0,0 @@
1
- import { Integration } from '@sentry/types';
2
- import { GatsbyOptions } from './types';
3
- declare type UserFnIntegrations = (integrations: Integration[]) => Integration[];
4
- export declare type UserIntegrations = Integration[] | UserFnIntegrations;
5
- /**
6
- * Returns the integrations to add to the SDK.
7
- * If tracing is enabled, `BrowserTracing` is always present.
8
- *
9
- * @param options The options users have defined.
10
- */
11
- export declare function getIntegrationsFromOptions(options: GatsbyOptions): UserIntegrations;
12
- export {};
13
- //# sourceMappingURL=integrations.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../../../src/utils/integrations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,aAAK,kBAAkB,GAAG,CAAC,YAAY,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,CAAC;AACzE,oBAAY,gBAAgB,GAAG,WAAW,EAAE,GAAG,kBAAkB,CAAC;AAElE;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,aAAa,GAAG,gBAAgB,CASnF"}
@@ -1,3 +0,0 @@
1
- import { BrowserOptions } from '@sentry/react';
2
- export declare type GatsbyOptions = BrowserOptions;
3
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,oBAAY,aAAa,GAAG,cAAc,CAAC"}
@@ -1 +0,0 @@
1
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/utils/types.ts"],"names":[],"mappings":"","sourcesContent":["import { BrowserOptions } from '@sentry/react';\n\nexport type GatsbyOptions = BrowserOptions;\n"]}