@sentry/gatsby 7.0.0-alpha.1 → 7.0.0-beta.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/cjs/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, "__esModule", { value: true });
2
- var tslib_1 = require("tslib");
2
+ const tslib_1 = require("tslib");
3
3
  tslib_1.__exportStar(require("@sentry/react"), exports);
4
4
  var tracing_1 = require("@sentry/tracing");
5
5
  exports.Integrations = tracing_1.Integrations;
package/cjs/sdk.js CHANGED
@@ -1,7 +1,6 @@
1
1
  Object.defineProperty(exports, "__esModule", { value: true });
2
- var tslib_1 = require("tslib");
3
- var react_1 = require("@sentry/react");
4
- var integrations_1 = require("./utils/integrations");
2
+ const react_1 = require("@sentry/react");
3
+ const integrations_1 = require("./utils/integrations");
5
4
  /**
6
5
  * Inits the Sentry Gatsby SDK.
7
6
  */
@@ -17,8 +16,8 @@ function init(options) {
17
16
  ],
18
17
  version: react_1.SDK_VERSION,
19
18
  };
20
- var integrations = integrations_1.getIntegrationsFromOptions(options);
21
- react_1.init(tslib_1.__assign(tslib_1.__assign({}, options), { integrations: integrations }));
19
+ const integrations = integrations_1.getIntegrationsFromOptions(options);
20
+ react_1.init(Object.assign(Object.assign({}, options), { integrations }));
22
21
  }
23
22
  exports.init = init;
24
23
  //# 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,uCAA+D;AAE/D,qDAAkE;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,IAAM,YAAY,GAAG,yCAA0B,CAAC,OAAO,CAAC,CAAC;IACzD,YAAS,uCACJ,OAAO,KACV,YAAY,cAAA,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","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,6 +1,5 @@
1
1
  Object.defineProperty(exports, "__esModule", { value: true });
2
- var tslib_1 = require("tslib");
3
- var Tracing = tslib_1.__importStar(require("@sentry/tracing"));
2
+ const Tracing = require("@sentry/tracing");
4
3
  /**
5
4
  * Returns the integrations to add to the SDK.
6
5
  * If tracing is enabled, `BrowserTracing` is always present.
@@ -8,7 +7,7 @@ var Tracing = tslib_1.__importStar(require("@sentry/tracing"));
8
7
  * @param options The options users have defined.
9
8
  */
10
9
  function getIntegrationsFromOptions(options) {
11
- var isTracingEnabled = Tracing.hasTracingEnabled(options);
10
+ const isTracingEnabled = Tracing.hasTracingEnabled(options);
12
11
  if (options.integrations === undefined) {
13
12
  return getIntegrationsFromArray([], isTracingEnabled);
14
13
  }
@@ -28,7 +27,7 @@ exports.getIntegrationsFromOptions = getIntegrationsFromOptions;
28
27
  */
29
28
  function getIntegrationsFromArray(userIntegrations, isTracingEnabled) {
30
29
  if (isTracingEnabled &&
31
- !userIntegrations.some(function (integration) { return integration.name === Tracing.Integrations.BrowserTracing.name; })) {
30
+ !userIntegrations.some(integration => integration.name === Tracing.Integrations.BrowserTracing.name)) {
32
31
  userIntegrations.push(new Tracing.Integrations.BrowserTracing());
33
32
  }
34
33
  return userIntegrations;
@@ -40,7 +39,7 @@ function getIntegrationsFromArray(userIntegrations, isTracingEnabled) {
40
39
  * @param isTracingEnabled Whether the user has enabled tracing.
41
40
  */
42
41
  function getIntegrationsFromFunction(userIntegrations, isTracingEnabled) {
43
- var wrapper = function (defaultIntegrations) {
42
+ const wrapper = (defaultIntegrations) => {
44
43
  return getIntegrationsFromArray(userIntegrations(defaultIntegrations), isTracingEnabled);
45
44
  };
46
45
  return wrapper;
@@ -1 +1 @@
1
- {"version":3,"file":"integrations.js","sourceRoot":"","sources":["../../../src/utils/integrations.ts"],"names":[],"mappings":";;AAAA,+DAA2C;AAQ3C;;;;;GAKG;AACH,SAAgB,0BAA0B,CAAC,OAAsB;IAC/D,IAAM,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,UAAA,WAAW,IAAI,OAAA,WAAW,CAAC,IAAI,KAAK,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,IAAI,EAA7D,CAA6D,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,IAAM,OAAO,GAAuB,UAAC,mBAAkC;QACrE,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","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"]}
package/esm/sdk.js CHANGED
@@ -1,4 +1,3 @@
1
- import { __assign } from "tslib";
2
1
  import { init as reactInit, SDK_VERSION } from '@sentry/react';
3
2
  import { getIntegrationsFromOptions } from './utils/integrations';
4
3
  /**
@@ -16,7 +15,7 @@ export function init(options) {
16
15
  ],
17
16
  version: SDK_VERSION,
18
17
  };
19
- var integrations = getIntegrationsFromOptions(options);
20
- reactInit(__assign(__assign({}, options), { integrations: integrations }));
18
+ const integrations = getIntegrationsFromOptions(options);
19
+ reactInit(Object.assign(Object.assign({}, options), { integrations }));
21
20
  }
22
21
  //# 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,IAAM,YAAY,GAAG,0BAA0B,CAAC,OAAO,CAAC,CAAC;IACzD,SAAS,uBACJ,OAAO,KACV,YAAY,cAAA,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","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"]}
@@ -6,7 +6,7 @@ import * as Tracing from '@sentry/tracing';
6
6
  * @param options The options users have defined.
7
7
  */
8
8
  export function getIntegrationsFromOptions(options) {
9
- var isTracingEnabled = Tracing.hasTracingEnabled(options);
9
+ const isTracingEnabled = Tracing.hasTracingEnabled(options);
10
10
  if (options.integrations === undefined) {
11
11
  return getIntegrationsFromArray([], isTracingEnabled);
12
12
  }
@@ -25,7 +25,7 @@ export function getIntegrationsFromOptions(options) {
25
25
  */
26
26
  function getIntegrationsFromArray(userIntegrations, isTracingEnabled) {
27
27
  if (isTracingEnabled &&
28
- !userIntegrations.some(function (integration) { return integration.name === Tracing.Integrations.BrowserTracing.name; })) {
28
+ !userIntegrations.some(integration => integration.name === Tracing.Integrations.BrowserTracing.name)) {
29
29
  userIntegrations.push(new Tracing.Integrations.BrowserTracing());
30
30
  }
31
31
  return userIntegrations;
@@ -37,7 +37,7 @@ function getIntegrationsFromArray(userIntegrations, isTracingEnabled) {
37
37
  * @param isTracingEnabled Whether the user has enabled tracing.
38
38
  */
39
39
  function getIntegrationsFromFunction(userIntegrations, isTracingEnabled) {
40
- var wrapper = function (defaultIntegrations) {
40
+ const wrapper = (defaultIntegrations) => {
41
41
  return getIntegrationsFromArray(userIntegrations(defaultIntegrations), isTracingEnabled);
42
42
  };
43
43
  return wrapper;
@@ -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,IAAM,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,UAAA,WAAW,IAAI,OAAA,WAAW,CAAC,IAAI,KAAK,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,IAAI,EAA7D,CAA6D,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,IAAM,OAAO,GAAuB,UAAC,mBAAkC;QACrE,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","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"]}
@@ -0,0 +1 @@
1
+ export function onClientEntry(_: any, pluginParams: any): void;
@@ -0,0 +1,5 @@
1
+ export function onCreateWebpackConfig({ plugins, getConfig, actions }: {
2
+ plugins: any;
3
+ getConfig: any;
4
+ actions: any;
5
+ }): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/gatsby",
3
- "version": "7.0.0-alpha.1",
3
+ "version": "7.0.0-beta.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,16 +20,16 @@
20
20
  "access": "public"
21
21
  },
22
22
  "dependencies": {
23
- "@sentry/react": "7.0.0-alpha.1",
24
- "@sentry/tracing": "7.0.0-alpha.1",
25
- "@sentry/webpack-plugin": "1.18.8"
23
+ "@sentry/react": "7.0.0-beta.0",
24
+ "@sentry/tracing": "7.0.0-beta.0",
25
+ "@sentry/webpack-plugin": "1.18.9"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "gatsby": "^2.0.0 || ^3.0.0 || ^4.0.0",
29
29
  "react": "15.x || 16.x || 17.x || 18.x"
30
30
  },
31
31
  "devDependencies": {
32
- "@sentry/types": "7.0.0-alpha.1",
32
+ "@sentry/types": "7.0.0-beta.0",
33
33
  "@testing-library/react": "^13.0.0",
34
34
  "react": "^18.0.0"
35
35
  },