diff --git a/packages/browser-integration-tests/suites/integrations/ContextLines/init.js b/packages/browser-integration-tests/suites/integrations/ContextLines/init.js index 93d8362fbac0..4461826e0214 100644 --- a/packages/browser-integration-tests/suites/integrations/ContextLines/init.js +++ b/packages/browser-integration-tests/suites/integrations/ContextLines/init.js @@ -1,8 +1,9 @@ import * as Sentry from '@sentry/browser'; +import { ContextLines } from '@sentry/integrations'; window.Sentry = Sentry; Sentry.init({ dsn: 'https://public@dsn.ingest.sentry.io/1337', - integrations: [new Sentry.Integrations.ContextLines()], + integrations: [new ContextLines()], }); diff --git a/packages/browser/src/integrations/index.ts b/packages/browser/src/integrations/index.ts index ec826b561000..e029422f363c 100644 --- a/packages/browser/src/integrations/index.ts +++ b/packages/browser/src/integrations/index.ts @@ -4,4 +4,3 @@ export { Breadcrumbs } from './breadcrumbs'; export { LinkedErrors } from './linkederrors'; export { HttpContext } from './httpcontext'; export { Dedupe } from './dedupe'; -export { ContextLines } from './contextlines'; diff --git a/packages/browser/src/integrations/contextlines.ts b/packages/integrations/src/contextlines.ts similarity index 96% rename from packages/browser/src/integrations/contextlines.ts rename to packages/integrations/src/contextlines.ts index 98dad4269d62..f234e809f3a6 100644 --- a/packages/browser/src/integrations/contextlines.ts +++ b/packages/integrations/src/contextlines.ts @@ -1,7 +1,7 @@ import type { Event, EventProcessor, Integration, StackFrame } from '@sentry/types'; -import { stripUrlQueryAndFragment } from '@sentry/utils'; +import { GLOBAL_OBJ, stripUrlQueryAndFragment } from '@sentry/utils'; -import { WINDOW } from '../helpers'; +const WINDOW = GLOBAL_OBJ as typeof GLOBAL_OBJ & Window; interface ContextLinesOptions { /** diff --git a/packages/integrations/src/index.ts b/packages/integrations/src/index.ts index 372a730e3a5c..b7dcc1f4716a 100644 --- a/packages/integrations/src/index.ts +++ b/packages/integrations/src/index.ts @@ -9,3 +9,4 @@ export { RewriteFrames } from './rewriteframes'; export { SessionTiming } from './sessiontiming'; export { Transaction } from './transaction'; export { HttpClient } from './httpclient'; +export { ContextLines } from './contextlines'; diff --git a/packages/browser/test/unit/integrations/contextlines.test.ts b/packages/integrations/test/contextlines.test.ts similarity index 97% rename from packages/browser/test/unit/integrations/contextlines.test.ts rename to packages/integrations/test/contextlines.test.ts index 34b7641517b4..2c5d03bcf5bd 100644 --- a/packages/browser/test/unit/integrations/contextlines.test.ts +++ b/packages/integrations/test/contextlines.test.ts @@ -1,6 +1,6 @@ import type { StackFrame } from '@sentry/types'; -import { applySourceContextToFrame } from '../../../src/integrations/contextlines'; +import { applySourceContextToFrame } from '../src/contextlines'; const lines = ['line1', 'line2', 'line3', 'line4', 'line5', 'line6', 'line7', 'line8', 'line9']; describe('ContextLines', () => {