@sentry/gatsby 6.19.4 → 7.0.0-alpha.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.
Files changed (42) hide show
  1. package/{build/types → cjs}/index.d.ts +0 -0
  2. package/{build/types → cjs}/index.d.ts.map +0 -0
  3. package/{dist → cjs}/index.js +0 -0
  4. package/cjs/index.js.map +1 -0
  5. package/{build/types → cjs}/sdk.d.ts +0 -0
  6. package/{build/types → cjs}/sdk.d.ts.map +0 -0
  7. package/{dist → cjs}/sdk.js +0 -0
  8. package/cjs/sdk.js.map +1 -0
  9. package/{build/types → cjs}/utils/integrations.d.ts +0 -0
  10. package/{build/types → cjs}/utils/integrations.d.ts.map +0 -0
  11. package/{dist → cjs}/utils/integrations.js +0 -0
  12. package/cjs/utils/integrations.js.map +1 -0
  13. package/{build/types → cjs}/utils/types.d.ts +0 -0
  14. package/{build/types → cjs}/utils/types.d.ts.map +0 -0
  15. package/{dist → cjs}/utils/types.js +0 -0
  16. package/cjs/utils/types.js.map +1 -0
  17. package/esm/index.d.ts.map +1 -1
  18. package/esm/index.js.map +1 -1
  19. package/esm/sdk.d.ts.map +1 -1
  20. package/esm/sdk.js.map +1 -1
  21. package/esm/utils/integrations.d.ts.map +1 -1
  22. package/esm/utils/integrations.js.map +1 -1
  23. package/esm/utils/types.d.ts.map +1 -1
  24. package/esm/utils/types.js.map +1 -1
  25. package/gatsby-browser.js +3 -5
  26. package/package.json +8 -63
  27. package/{dist → types}/index.d.ts +0 -0
  28. package/types/index.d.ts.map +1 -0
  29. package/{dist → types}/sdk.d.ts +0 -0
  30. package/types/sdk.d.ts.map +1 -0
  31. package/{dist → types}/utils/integrations.d.ts +0 -0
  32. package/types/utils/integrations.d.ts.map +1 -0
  33. package/{dist → types}/utils/types.d.ts +0 -0
  34. package/types/utils/types.d.ts.map +1 -0
  35. package/dist/index.d.ts.map +0 -1
  36. package/dist/index.js.map +0 -1
  37. package/dist/sdk.d.ts.map +0 -1
  38. package/dist/sdk.js.map +0 -1
  39. package/dist/utils/integrations.d.ts.map +0 -1
  40. package/dist/utils/integrations.js.map +0 -1
  41. package/dist/utils/types.d.ts.map +0 -1
  42. package/dist/utils/types.js.map +0 -1
File without changes
File without changes
File without changes
@@ -0,0 +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"]}
File without changes
File without changes
File without changes
package/cjs/sdk.js.map ADDED
@@ -0,0 +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"]}
File without changes
File without changes
File without changes
@@ -0,0 +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"]}
File without changes
File without changes
File without changes
@@ -0,0 +1 @@
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"]}
@@ -1 +1 @@
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"}
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/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","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"]}
package/esm/sdk.d.ts.map CHANGED
@@ -1 +1 @@
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
+ {"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"}
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,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 +1 @@
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
+ {"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 +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,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 +1 @@
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
+ {"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 +1 @@
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"]}
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/gatsby-browser.js CHANGED
@@ -6,12 +6,11 @@ exports.onClientEntry = function (_, pluginParams) {
6
6
  const areOptionsDefined = areSentryOptionsDefined(pluginParams);
7
7
 
8
8
  if (isIntialized) {
9
- window.Sentry = Sentry; // For backwards compatibility
10
9
  if (areOptionsDefined) {
11
10
  console.warn(
12
11
  'Sentry Logger [Warn]: The SDK was initialized in the Sentry config file, but options were found in the Gatsby config. ' +
13
- 'These have been ignored, merge them to the Sentry config if you want to use them.\n' +
14
- 'Learn more about the Gatsby SDK on https://docs.sentry.io/platforms/javascript/guides/gatsby/',
12
+ 'These have been ignored, merge them to the Sentry config if you want to use them.\n' +
13
+ 'Learn more about the Gatsby SDK on https://docs.sentry.io/platforms/javascript/guides/gatsby/',
15
14
  );
16
15
  }
17
16
  return;
@@ -20,7 +19,7 @@ exports.onClientEntry = function (_, pluginParams) {
20
19
  if (!areOptionsDefined) {
21
20
  console.error(
22
21
  'Sentry Logger [Error]: No config for the Gatsby SDK was found.\n' +
23
- 'Learn how to configure it on https://docs.sentry.io/platforms/javascript/guides/gatsby/',
22
+ 'Learn how to configure it on https://docs.sentry.io/platforms/javascript/guides/gatsby/',
24
23
  );
25
24
  return;
26
25
  }
@@ -32,7 +31,6 @@ exports.onClientEntry = function (_, pluginParams) {
32
31
  dsn: __SENTRY_DSN__,
33
32
  ...pluginParams,
34
33
  });
35
- window.Sentry = Sentry; // For backwards compatibility
36
34
  };
37
35
 
38
36
  function isSentryInitialized() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/gatsby",
3
- "version": "6.19.4",
3
+ "version": "7.0.0-alpha.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",
@@ -11,17 +11,17 @@
11
11
  "gatsby-plugin"
12
12
  ],
13
13
  "engines": {
14
- "node": ">=6"
14
+ "node": ">=8"
15
15
  },
16
- "main": "dist/index.js",
16
+ "main": "cjs/index.js",
17
17
  "module": "esm/index.js",
18
- "types": "build/types/index.d.ts",
18
+ "types": "types/index.d.ts",
19
19
  "publishConfig": {
20
20
  "access": "public"
21
21
  },
22
22
  "dependencies": {
23
- "@sentry/react": "6.19.4",
24
- "@sentry/tracing": "6.19.4",
23
+ "@sentry/react": "7.0.0-alpha.0",
24
+ "@sentry/tracing": "7.0.0-alpha.0",
25
25
  "@sentry/webpack-plugin": "1.18.8"
26
26
  },
27
27
  "peerDependencies": {
@@ -29,64 +29,9 @@
29
29
  "react": "15.x || 16.x || 17.x || 18.x"
30
30
  },
31
31
  "devDependencies": {
32
- "@sentry/types": "6.19.4",
32
+ "@sentry/types": "7.0.0-alpha.0",
33
33
  "@testing-library/react": "^13.0.0",
34
34
  "react": "^18.0.0"
35
35
  },
36
- "scripts": {
37
- "build": "run-p build:cjs build:esm build:types",
38
- "build:cjs": "tsc -p tsconfig.cjs.json",
39
- "build:dev": "run-s build",
40
- "build:es5": "yarn build:cjs # *** backwards compatibility - remove in v7 ***",
41
- "build:esm": "tsc -p tsconfig.esm.json",
42
- "build:types": "tsc -p tsconfig.types.json",
43
- "build:watch": "run-p build:cjs:watch build:esm:watch build:types:watch",
44
- "build:cjs:watch": "tsc -p tsconfig.cjs.json --watch",
45
- "build:dev:watch": "run-s build:watch",
46
- "build:es5:watch": "yarn build:cjs:watch # *** backwards compatibility - remove in v7 ***",
47
- "build:esm:watch": "tsc -p tsconfig.esm.json --watch",
48
- "build:types:watch": "tsc -p tsconfig.types.json --watch",
49
- "build:npm": "npm pack",
50
- "circularDepCheck": "madge --circular src/index.ts",
51
- "clean": "rimraf dist esm build coverage",
52
- "fix": "run-s fix:eslint fix:prettier",
53
- "fix:eslint": "eslint . --format stylish --fix",
54
- "fix:prettier": "prettier --write \"{src,test,scripts}/**/*.ts\"",
55
- "link:yarn": "yarn link",
56
- "lint": "run-s lint:prettier lint:eslint",
57
- "lint:eslint": "eslint . --cache --cache-location '../../eslintcache/' --format stylish",
58
- "lint:prettier": "prettier --check \"{src,test,scripts}/**/*.ts\"",
59
- "test": "jest",
60
- "test:watch": "jest --watch"
61
- },
62
- "volta": {
63
- "extends": "../../package.json"
64
- },
65
- "jest": {
66
- "collectCoverage": true,
67
- "transform": {
68
- "^.+\\.ts$": "ts-jest",
69
- "^.+\\.tsx$": "ts-jest"
70
- },
71
- "moduleFileExtensions": [
72
- "js",
73
- "ts",
74
- "tsx"
75
- ],
76
- "testEnvironment": "jsdom",
77
- "testMatch": [
78
- "**/*.test.ts",
79
- "**/*.test.tsx"
80
- ],
81
- "globals": {
82
- "ts-jest": {
83
- "tsConfig": "./tsconfig.json",
84
- "diagnostics": false
85
- }
86
- },
87
- "setupFiles": [
88
- "<rootDir>/test/setEnvVars.ts"
89
- ]
90
- },
91
36
  "sideEffects": false
92
- }
37
+ }
File without changes
@@ -0,0 +1 @@
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"}
File without changes
@@ -0,0 +1 @@
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"}
File without changes
@@ -0,0 +1 @@
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"}
File without changes
@@ -0,0 +1 @@
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
- {"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/dist/index.js.map DELETED
@@ -1 +0,0 @@
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"]}
package/dist/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"}
package/dist/sdk.js.map DELETED
@@ -1 +0,0 @@
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 +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 +0,0 @@
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 +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
- {"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"]}