diff --git a/packages/core/src/api.ts b/packages/core/src/api.ts index 0c0e75176c61..9a83e0667476 100644 --- a/packages/core/src/api.ts +++ b/packages/core/src/api.ts @@ -1,5 +1,6 @@ import type { ReportDialogOptions } from './report-dialog'; -import type { DsnComponents, DsnLike, SdkInfo } from './types-hoist'; +import type { DsnComponents, DsnLike } from './types-hoist/dsn'; +import type { SdkInfo } from './types-hoist/sdkinfo'; import { dsnToString, makeDsn } from './utils-hoist/dsn'; const SENTRY_API_VERSION = '7'; diff --git a/packages/core/src/breadcrumbs.ts b/packages/core/src/breadcrumbs.ts index b4a167a6f4d3..5724de09be0a 100644 --- a/packages/core/src/breadcrumbs.ts +++ b/packages/core/src/breadcrumbs.ts @@ -1,5 +1,5 @@ import { getClient, getIsolationScope } from './currentScopes'; -import type { Breadcrumb, BreadcrumbHint } from './types-hoist'; +import type { Breadcrumb, BreadcrumbHint } from './types-hoist/breadcrumb'; import { consoleSandbox } from './utils-hoist/logger'; import { dateTimestampInSeconds } from './utils-hoist/time'; diff --git a/packages/core/src/checkin.ts b/packages/core/src/checkin.ts index c182c676117e..53dc95b81ae8 100644 --- a/packages/core/src/checkin.ts +++ b/packages/core/src/checkin.ts @@ -1,11 +1,7 @@ -import type { - CheckInEnvelope, - CheckInItem, - DsnComponents, - DynamicSamplingContext, - SdkMetadata, - SerializedCheckIn, -} from './types-hoist'; +import type { CheckInEnvelope, CheckInItem, DynamicSamplingContext } from './types-hoist/envelope'; +import type { DsnComponents } from './types-hoist/dsn'; +import type { SdkMetadata } from './types-hoist/sdkmetadata'; +import type { SerializedCheckIn } from './types-hoist/checkin'; import { dsnToString } from './utils-hoist/dsn'; import { createEnvelope } from './utils-hoist/envelope'; diff --git a/packages/core/src/client.ts b/packages/core/src/client.ts index 3599448abf4c..3558731f5636 100644 --- a/packages/core/src/client.ts +++ b/packages/core/src/client.ts @@ -1,40 +1,24 @@ /* eslint-disable max-lines */ -import type { - Breadcrumb, - BreadcrumbHint, - CheckIn, - ClientOptions, - DataCategory, - DsnComponents, - DynamicSamplingContext, - Envelope, - ErrorEvent, - Event, - EventDropReason, - EventHint, - EventProcessor, - FeedbackEvent, - FetchBreadcrumbHint, - Integration, - Log, - MonitorConfig, - Outcome, - ParameterizedString, - SdkMetadata, - Session, - SessionAggregates, - SeverityLevel, - Span, - SpanAttributes, - SpanContextData, - SpanJSON, - StartSpanOptions, - TraceContext, - TransactionEvent, - Transport, - TransportMakeRequestResponse, - XhrBreadcrumbHint, -} from './types-hoist'; +import type { Breadcrumb, BreadcrumbHint, FetchBreadcrumbHint, XhrBreadcrumbHint } from './types-hoist/breadcrumb'; +import type { CheckIn, MonitorConfig } from './types-hoist/checkin'; +import type { ClientOptions } from './types-hoist/options'; +import type { DataCategory } from './types-hoist/datacategory'; +import type { EventDropReason, Outcome } from './types-hoist/clientreport'; +import type { DsnComponents } from './types-hoist/dsn'; +import type { DynamicSamplingContext, Envelope } from './types-hoist/envelope'; +import type { ErrorEvent, Event, EventHint, TransactionEvent } from './types-hoist/event'; +import type { EventProcessor } from './types-hoist/eventprocessor'; +import type { FeedbackEvent } from './types-hoist/feedback'; +import type { Integration } from './types-hoist/integration'; +import type { Log } from './types-hoist/log'; +import type { ParameterizedString } from './types-hoist/parameterize'; +import type { SdkMetadata } from './types-hoist/sdkmetadata'; +import type { Session, SessionAggregates } from './types-hoist/session'; +import type { SeverityLevel } from './types-hoist/severity'; +import type { Span, SpanAttributes, SpanContextData, SpanJSON } from './types-hoist/span'; +import type { StartSpanOptions } from './types-hoist/startSpanOptions'; +import type { TraceContext } from './types-hoist/context'; +import type { Transport, TransportMakeRequestResponse } from './types-hoist/transport'; import { getEnvelopeEndpointWithUrlEncodedAuth } from './api'; import { DEFAULT_ENVIRONMENT } from './constants'; diff --git a/packages/core/src/currentScopes.ts b/packages/core/src/currentScopes.ts index 9dc1c164c387..b8d719098e49 100644 --- a/packages/core/src/currentScopes.ts +++ b/packages/core/src/currentScopes.ts @@ -2,7 +2,7 @@ import { getAsyncContextStrategy } from './asyncContext'; import { getGlobalSingleton, getMainCarrier } from './carrier'; import type { Client } from './client'; import { Scope } from './scope'; -import type { TraceContext } from './types-hoist'; +import type { TraceContext } from './types-hoist/context'; import { generateSpanId } from './utils-hoist/propagationContext'; /** diff --git a/packages/core/src/envelope.ts b/packages/core/src/envelope.ts index 89e231c305fc..7f4a477007e1 100644 --- a/packages/core/src/envelope.ts +++ b/packages/core/src/envelope.ts @@ -1,24 +1,23 @@ import type { Client } from './client'; import { getDynamicSamplingContextFromSpan } from './tracing/dynamicSamplingContext'; import type { SentrySpan } from './tracing/sentrySpan'; +import type { DsnComponents } from './types-hoist/dsn'; import type { - DsnComponents, DynamicSamplingContext, - Event, EventEnvelope, EventItem, - LegacyCSPReport, + SpanEnvelope, + SpanItem, RawSecurityEnvelope, RawSecurityItem, - SdkInfo, - SdkMetadata, - Session, - SessionAggregates, SessionEnvelope, SessionItem, - SpanEnvelope, - SpanItem, -} from './types-hoist'; +} from './types-hoist/envelope'; +import type { Event } from './types-hoist/event'; +import type { LegacyCSPReport } from './types-hoist/csp'; +import type { SdkInfo } from './types-hoist/sdkinfo'; +import type { SdkMetadata } from './types-hoist/sdkmetadata'; +import type { Session, SessionAggregates } from './types-hoist/session'; import { dsnToString } from './utils-hoist/dsn'; import { createEnvelope, diff --git a/packages/core/src/eventProcessors.ts b/packages/core/src/eventProcessors.ts index 0691fac89680..7ef62c0f604e 100644 --- a/packages/core/src/eventProcessors.ts +++ b/packages/core/src/eventProcessors.ts @@ -1,5 +1,7 @@ import { DEBUG_BUILD } from './debug-build'; -import type { Event, EventHint, EventProcessor } from './types-hoist'; +import type { Event } from './types-hoist/event'; +import type { EventHint } from './types-hoist/event'; +import type { EventProcessor } from './types-hoist/eventprocessor'; import { isThenable } from './utils-hoist/is'; import { logger } from './utils-hoist/logger'; import { SyncPromise } from './utils-hoist/syncpromise'; diff --git a/packages/core/src/exports.ts b/packages/core/src/exports.ts index 4854ee86efb8..3c1351dec88e 100644 --- a/packages/core/src/exports.ts +++ b/packages/core/src/exports.ts @@ -2,21 +2,14 @@ import { getClient, getCurrentScope, getIsolationScope, withIsolationScope } fro import { DEBUG_BUILD } from './debug-build'; import type { CaptureContext } from './scope'; import { closeSession, makeSession, updateSession } from './session'; -import type { - CheckIn, - Event, - EventHint, - EventProcessor, - Extra, - Extras, - FinishedCheckIn, - MonitorConfig, - Primitive, - Session, - SessionContext, - SeverityLevel, - User, -} from './types-hoist'; +import type { CheckIn, FinishedCheckIn, MonitorConfig } from './types-hoist/checkin'; +import type { Event, EventHint } from './types-hoist/event'; +import type { EventProcessor } from './types-hoist/eventprocessor'; +import type { Extra, Extras } from './types-hoist/extra'; +import type { Primitive } from './types-hoist/misc'; +import type { Session, SessionContext } from './types-hoist/session'; +import type { SeverityLevel } from './types-hoist/severity'; +import type { User } from './types-hoist/user'; import { isThenable } from './utils-hoist/is'; import { logger } from './utils-hoist/logger'; import { uuid4 } from './utils-hoist/misc'; diff --git a/packages/core/src/feedback.ts b/packages/core/src/feedback.ts index 7cfcd8b28654..ec0d0b58b71a 100644 --- a/packages/core/src/feedback.ts +++ b/packages/core/src/feedback.ts @@ -1,5 +1,6 @@ import { getClient, getCurrentScope } from './currentScopes'; -import type { EventHint, FeedbackEvent, SendFeedbackParams } from './types-hoist'; +import type { EventHint } from './types-hoist/event'; +import type { FeedbackEvent, SendFeedbackParams } from './types-hoist/feedback'; /** * Send user feedback to Sentry. diff --git a/packages/core/src/fetch.ts b/packages/core/src/fetch.ts index 379097936ef4..f6d3ab96486c 100644 --- a/packages/core/src/fetch.ts +++ b/packages/core/src/fetch.ts @@ -2,7 +2,9 @@ import { getClient } from './currentScopes'; import { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from './semanticAttributes'; import { SPAN_STATUS_ERROR, setHttpStatus, startInactiveSpan } from './tracing'; import { SentryNonRecordingSpan } from './tracing/sentryNonRecordingSpan'; -import type { FetchBreadcrumbHint, HandlerDataFetch, Span, SpanAttributes, SpanOrigin } from './types-hoist'; +import type { FetchBreadcrumbHint } from './types-hoist/breadcrumb'; +import type { HandlerDataFetch } from './types-hoist/instrument'; +import type { Span, SpanAttributes, SpanOrigin } from './types-hoist/span'; import { SENTRY_BAGGAGE_KEY_PREFIX } from './utils-hoist/baggage'; import { isInstanceOf, isRequest } from './utils-hoist/is'; import { getSanitizedUrlStringFromUrlObject, isURLObjectRelative, parseStringToURLObject } from './utils-hoist/url'; diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index be2feb94ff2e..5b25d9d8497e 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -1,3 +1,5 @@ +/* eslint-disable max-lines */ + export type { ClientClass as SentryCoreCurrentScopes } from './sdk'; export type { AsyncContextStrategy } from './asyncContext/types'; export type { Carrier } from './carrier'; @@ -120,9 +122,6 @@ export type { ReportDialogOptions } from './report-dialog'; export { _INTERNAL_captureLog, _INTERNAL_flushLogsBuffer } from './logs/exports'; export { consoleLoggingIntegration } from './logs/console-integration'; -// TODO: Make this structure pretty again and don't do "export *" -export * from './types-hoist/index'; - export type { FeatureFlag } from './featureFlags'; export { applyAggregateErrorsToEvent } from './utils-hoist/aggregate-errors'; @@ -272,3 +271,175 @@ export { vercelWaitUntil } from './utils-hoist/vercelWaitUntil'; export { SDK_VERSION } from './utils-hoist/version'; export { getDebugImagesForResources, getFilenameToDebugIdMap } from './utils-hoist/debug-ids'; export { escapeStringForRegex } from './utils-hoist/vendor/escapeStringForRegex'; + +export type { Attachment } from './types-hoist/attachment'; +export type { + Breadcrumb, + BreadcrumbHint, + FetchBreadcrumbData, + XhrBreadcrumbData, + FetchBreadcrumbHint, + XhrBreadcrumbHint, +} from './types-hoist/breadcrumb'; +export type { ClientReport, Outcome, EventDropReason } from './types-hoist/clientreport'; +export type { + Context, + Contexts, + DeviceContext, + OsContext, + AppContext, + CultureContext, + TraceContext, + CloudResourceContext, + MissingInstrumentationContext, +} from './types-hoist/context'; +export type { DataCategory } from './types-hoist/datacategory'; +export type { DsnComponents, DsnLike, DsnProtocol } from './types-hoist/dsn'; +export type { DebugImage, DebugMeta } from './types-hoist/debugMeta'; +export type { + AttachmentItem, + BaseEnvelopeHeaders, + BaseEnvelopeItemHeaders, + ClientReportEnvelope, + ClientReportItem, + DynamicSamplingContext, + Envelope, + EnvelopeItemType, + EnvelopeItem, + EventEnvelope, + EventEnvelopeHeaders, + EventItem, + ReplayEnvelope, + FeedbackItem, + SessionEnvelope, + SessionItem, + UserFeedbackItem, + CheckInItem, + CheckInEnvelope, + RawSecurityEnvelope, + RawSecurityItem, + ProfileItem, + ProfileChunkEnvelope, + ProfileChunkItem, + SpanEnvelope, + SpanItem, + OtelLogEnvelope, + OtelLogItem, +} from './types-hoist/envelope'; +export type { ExtendedError } from './types-hoist/error'; +export type { Event, EventHint, EventType, ErrorEvent, TransactionEvent } from './types-hoist/event'; +export type { EventProcessor } from './types-hoist/eventprocessor'; +export type { Exception } from './types-hoist/exception'; +export type { Extra, Extras } from './types-hoist/extra'; +export type { Integration, IntegrationFn } from './types-hoist/integration'; +export type { Mechanism } from './types-hoist/mechanism'; +export type { ExtractedNodeRequestData, HttpHeaderValue, Primitive, WorkerLocation } from './types-hoist/misc'; +export type { ClientOptions, Options } from './types-hoist/options'; +export type { Package } from './types-hoist/package'; +export type { PolymorphicEvent, PolymorphicRequest } from './types-hoist/polymorphics'; +export type { + ThreadId, + FrameId, + StackId, + ThreadCpuSample, + ThreadCpuStack, + ThreadCpuFrame, + ThreadCpuProfile, + ContinuousThreadCpuProfile, + Profile, + ProfileChunk, +} from './types-hoist/profiling'; +export type { ReplayEvent, ReplayRecordingData, ReplayRecordingMode } from './types-hoist/replay'; +export type { + FeedbackEvent, + FeedbackFormData, + FeedbackInternalOptions, + FeedbackModalIntegration, + FeedbackScreenshotIntegration, + SendFeedback, + SendFeedbackParams, + UserFeedback, +} from './types-hoist/feedback'; +export type { QueryParams, RequestEventData, SanitizedRequestData } from './types-hoist/request'; +export type { Runtime } from './types-hoist/runtime'; +export type { SdkInfo } from './types-hoist/sdkinfo'; +export type { SdkMetadata } from './types-hoist/sdkmetadata'; +export type { + SessionAggregates, + AggregationCounts, + Session, + SessionContext, + SessionStatus, + SerializedSession, +} from './types-hoist/session'; +export type { SeverityLevel } from './types-hoist/severity'; +export type { + Span, + SentrySpanArguments, + SpanOrigin, + SpanAttributeValue, + SpanAttributes, + SpanTimeInput, + SpanJSON, + SpanContextData, + TraceFlag, +} from './types-hoist/span'; +export type { SpanStatus } from './types-hoist/spanStatus'; +export type { + Log, + LogSeverityLevel, + SerializedOtelLog, + SerializedLogAttribute, + SerializedLogAttributeValueType, +} from './types-hoist/log'; +export type { TimedEvent } from './types-hoist/timedEvent'; +export type { StackFrame } from './types-hoist/stackframe'; +export type { Stacktrace, StackParser, StackLineParser, StackLineParserFn } from './types-hoist/stacktrace'; +export type { PropagationContext, TracePropagationTargets, SerializedTraceData } from './types-hoist/tracing'; +export type { StartSpanOptions } from './types-hoist/startSpanOptions'; +export type { TraceparentData, TransactionSource } from './types-hoist/transaction'; +export type { CustomSamplingContext, SamplingContext } from './types-hoist/samplingcontext'; +export type { + DurationUnit, + InformationUnit, + FractionUnit, + MeasurementUnit, + NoneUnit, + Measurements, +} from './types-hoist/measurement'; +export type { Thread } from './types-hoist/thread'; +export type { + Transport, + TransportRequest, + TransportMakeRequestResponse, + InternalBaseTransportOptions, + BaseTransportOptions, + TransportRequestExecutor, +} from './types-hoist/transport'; +export type { User } from './types-hoist/user'; +export type { WebFetchHeaders, WebFetchRequest } from './types-hoist/webfetchapi'; +export type { WrappedFunction } from './types-hoist/wrappedfunction'; +export type { + HandlerDataFetch, + HandlerDataXhr, + HandlerDataDom, + HandlerDataConsole, + HandlerDataHistory, + HandlerDataError, + HandlerDataUnhandledRejection, + ConsoleLevel, + SentryXhrData, + SentryWrappedXMLHttpRequest, +} from './types-hoist/instrument'; +export type { BrowserClientReplayOptions, BrowserClientProfilingOptions } from './types-hoist/browseroptions'; +export type { + CheckIn, + MonitorConfig, + FinishedCheckIn, + InProgressCheckIn, + SerializedCheckIn, +} from './types-hoist/checkin'; +export type { ParameterizedString } from './types-hoist/parameterize'; +export type { ContinuousProfiler, ProfilingIntegration, Profiler } from './types-hoist/profiling'; +export type { ViewHierarchyData, ViewHierarchyWindow } from './types-hoist/view-hierarchy'; +export type { LegacyCSPReport } from './types-hoist/csp'; diff --git a/packages/core/src/integration.ts b/packages/core/src/integration.ts index 31d5426d4fbc..c5636d002cc1 100644 --- a/packages/core/src/integration.ts +++ b/packages/core/src/integration.ts @@ -1,7 +1,9 @@ import type { Client } from './client'; import { getClient } from './currentScopes'; import { DEBUG_BUILD } from './debug-build'; -import type { Event, EventHint, Integration, IntegrationFn, Options } from './types-hoist'; +import type { Event, EventHint } from './types-hoist/event'; +import type { Integration, IntegrationFn } from './types-hoist/integration'; +import type { Options } from './types-hoist/options'; import { logger } from './utils-hoist/logger'; export const installedIntegrations: string[] = []; diff --git a/packages/core/src/integrations/captureconsole.ts b/packages/core/src/integrations/captureconsole.ts index 203b54180b25..e5dc43200dfe 100644 --- a/packages/core/src/integrations/captureconsole.ts +++ b/packages/core/src/integrations/captureconsole.ts @@ -2,7 +2,7 @@ import { getClient, withScope } from '../currentScopes'; import { captureException, captureMessage } from '../exports'; import { defineIntegration } from '../integration'; import type { CaptureContext } from '../scope'; -import type { IntegrationFn } from '../types-hoist'; +import type { IntegrationFn } from '../types-hoist/integration'; import { addConsoleInstrumentationHandler } from '../utils-hoist/instrument/console'; import { CONSOLE_LEVELS } from '../utils-hoist/logger'; import { addExceptionMechanism } from '../utils-hoist/misc'; diff --git a/packages/core/src/integrations/console.ts b/packages/core/src/integrations/console.ts index 110b94d5fcab..e995056a1f23 100644 --- a/packages/core/src/integrations/console.ts +++ b/packages/core/src/integrations/console.ts @@ -1,7 +1,7 @@ import { addBreadcrumb } from '../breadcrumbs'; import { getClient } from '../currentScopes'; import { defineIntegration } from '../integration'; -import type { ConsoleLevel } from '../types-hoist'; +import type { ConsoleLevel } from '../types-hoist/instrument'; import { addConsoleInstrumentationHandler } from '../utils-hoist/instrument/console'; import { CONSOLE_LEVELS } from '../utils-hoist/logger'; import { severityLevelFromString } from '../utils-hoist/severity'; diff --git a/packages/core/src/integrations/dedupe.ts b/packages/core/src/integrations/dedupe.ts index 5f6b249319aa..8473f9e68e93 100644 --- a/packages/core/src/integrations/dedupe.ts +++ b/packages/core/src/integrations/dedupe.ts @@ -1,5 +1,8 @@ import { defineIntegration } from '../integration'; -import type { Event, Exception, IntegrationFn, StackFrame } from '../types-hoist'; +import type { Event } from '../types-hoist/event'; +import type { Exception } from '../types-hoist/exception'; +import type { IntegrationFn } from '../types-hoist/integration'; +import type { StackFrame } from '../types-hoist/stackframe'; import { DEBUG_BUILD } from '../debug-build'; import { logger } from '../utils-hoist/logger'; diff --git a/packages/core/src/integrations/eventFilters.ts b/packages/core/src/integrations/eventFilters.ts index 8b571b19fb75..8da0ae671b71 100644 --- a/packages/core/src/integrations/eventFilters.ts +++ b/packages/core/src/integrations/eventFilters.ts @@ -1,4 +1,6 @@ -import type { Event, IntegrationFn, StackFrame } from '../types-hoist'; +import type { Event } from '../types-hoist/event'; +import type { IntegrationFn } from '../types-hoist/integration'; +import type { StackFrame } from '../types-hoist/stackframe'; import { DEBUG_BUILD } from '../debug-build'; import { defineIntegration } from '../integration'; diff --git a/packages/core/src/integrations/extraerrordata.ts b/packages/core/src/integrations/extraerrordata.ts index 9a74135db2a8..0bb3724816f8 100644 --- a/packages/core/src/integrations/extraerrordata.ts +++ b/packages/core/src/integrations/extraerrordata.ts @@ -1,5 +1,8 @@ import { defineIntegration } from '../integration'; -import type { Contexts, Event, EventHint, ExtendedError, IntegrationFn } from '../types-hoist'; +import type { Contexts } from '../types-hoist/context'; +import type { Event, EventHint } from '../types-hoist/event'; +import type { ExtendedError } from '../types-hoist/error'; +import type { IntegrationFn } from '../types-hoist/integration'; import { DEBUG_BUILD } from '../debug-build'; import { isError, isPlainObject } from '../utils-hoist/is'; diff --git a/packages/core/src/integrations/functiontostring.ts b/packages/core/src/integrations/functiontostring.ts index 9ce4a778c326..aef1b95795cd 100644 --- a/packages/core/src/integrations/functiontostring.ts +++ b/packages/core/src/integrations/functiontostring.ts @@ -1,7 +1,8 @@ import type { Client } from '../client'; import { getClient } from '../currentScopes'; import { defineIntegration } from '../integration'; -import type { IntegrationFn, WrappedFunction } from '../types-hoist'; +import type { IntegrationFn } from '../types-hoist/integration'; +import type { WrappedFunction } from '../types-hoist/wrappedfunction'; import { getOriginalFunction } from '../utils-hoist/object'; let originalFunctionToString: () => void; diff --git a/packages/core/src/integrations/linkederrors.ts b/packages/core/src/integrations/linkederrors.ts index e5a6b84918c2..c9263eba744d 100644 --- a/packages/core/src/integrations/linkederrors.ts +++ b/packages/core/src/integrations/linkederrors.ts @@ -1,5 +1,5 @@ import { defineIntegration } from '../integration'; -import type { IntegrationFn } from '../types-hoist'; +import type { IntegrationFn } from '../types-hoist/integration'; import { applyAggregateErrorsToEvent } from '../utils-hoist/aggregate-errors'; import { exceptionFromError } from '../utils-hoist/eventbuilder'; diff --git a/packages/core/src/integrations/metadata.ts b/packages/core/src/integrations/metadata.ts index dc1107d5d423..6c41a85d60bd 100644 --- a/packages/core/src/integrations/metadata.ts +++ b/packages/core/src/integrations/metadata.ts @@ -1,5 +1,5 @@ import { defineIntegration } from '../integration'; -import type { EventItem } from '../types-hoist'; +import type { EventItem } from '../types-hoist/envelope'; import { addMetadataToStackFrames, stripMetadataFromStackFrames } from '../metadata'; import { forEachEnvelopeItem } from '../utils-hoist/envelope'; diff --git a/packages/core/src/integrations/requestdata.ts b/packages/core/src/integrations/requestdata.ts index cc80bfe3b4b2..c8271043ece2 100644 --- a/packages/core/src/integrations/requestdata.ts +++ b/packages/core/src/integrations/requestdata.ts @@ -1,5 +1,7 @@ import { defineIntegration } from '../integration'; -import type { Event, IntegrationFn, RequestEventData } from '../types-hoist'; +import type { Event } from '../types-hoist/event'; +import type { IntegrationFn } from '../types-hoist/integration'; +import type { RequestEventData } from '../types-hoist/request'; import { parseCookie } from '../utils/cookie'; import { getClientIPAddress, ipHeaderNames } from '../vendor/getIpAddress'; diff --git a/packages/core/src/integrations/rewriteframes.ts b/packages/core/src/integrations/rewriteframes.ts index 3c4ab5aee464..8b7361e40d94 100644 --- a/packages/core/src/integrations/rewriteframes.ts +++ b/packages/core/src/integrations/rewriteframes.ts @@ -1,5 +1,7 @@ import { defineIntegration } from '../integration'; -import type { Event, StackFrame, Stacktrace } from '../types-hoist'; +import type { Event } from '../types-hoist/event'; +import type { StackFrame } from '../types-hoist/stackframe'; +import type { Stacktrace } from '../types-hoist/stacktrace'; import { basename, relative } from '../utils-hoist/path'; import { GLOBAL_OBJ } from '../utils-hoist/worldwide'; diff --git a/packages/core/src/integrations/supabase.ts b/packages/core/src/integrations/supabase.ts index 6cc6b5637c3e..be82ce1b1207 100644 --- a/packages/core/src/integrations/supabase.ts +++ b/packages/core/src/integrations/supabase.ts @@ -2,7 +2,7 @@ // https://github.com/supabase-community/sentry-integration-js /* eslint-disable max-lines */ -import type { IntegrationFn } from '../types-hoist'; +import type { IntegrationFn } from '../types-hoist/integration'; import { setHttpStatus, startSpan } from '../tracing'; import { addBreadcrumb } from '../breadcrumbs'; import { defineIntegration } from '../integration'; diff --git a/packages/core/src/integrations/third-party-errors-filter.ts b/packages/core/src/integrations/third-party-errors-filter.ts index 9e5e776a5b0f..201119589958 100644 --- a/packages/core/src/integrations/third-party-errors-filter.ts +++ b/packages/core/src/integrations/third-party-errors-filter.ts @@ -1,6 +1,7 @@ import { defineIntegration } from '../integration'; import { addMetadataToStackFrames, stripMetadataFromStackFrames } from '../metadata'; -import type { Event, EventItem } from '../types-hoist'; +import type { Event } from '../types-hoist/event'; +import type { EventItem } from '../types-hoist/envelope'; import { forEachEnvelopeItem } from '../utils-hoist/envelope'; import { getFramesFromEvent } from '../utils-hoist/stacktrace'; diff --git a/packages/core/src/integrations/zoderrors.ts b/packages/core/src/integrations/zoderrors.ts index 4859ca5167fa..315b24592096 100644 --- a/packages/core/src/integrations/zoderrors.ts +++ b/packages/core/src/integrations/zoderrors.ts @@ -1,5 +1,6 @@ import { defineIntegration } from '../integration'; -import type { Event, EventHint, IntegrationFn } from '../types-hoist'; +import type { Event, EventHint } from '../types-hoist/event'; +import type { IntegrationFn } from '../types-hoist/integration'; import { isError } from '../utils-hoist/is'; import { truncate } from '../utils-hoist/string'; diff --git a/packages/core/src/logs/console-integration.ts b/packages/core/src/logs/console-integration.ts index fe1c5babefa6..21512238caef 100644 --- a/packages/core/src/logs/console-integration.ts +++ b/packages/core/src/logs/console-integration.ts @@ -2,7 +2,8 @@ import { getClient } from '../currentScopes'; import { DEBUG_BUILD } from '../debug-build'; import { defineIntegration } from '../integration'; import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '../semanticAttributes'; -import type { ConsoleLevel, IntegrationFn } from '../types-hoist'; +import type { ConsoleLevel } from '../types-hoist/instrument'; +import type { IntegrationFn } from '../types-hoist/integration'; import { CONSOLE_LEVELS, logger } from '../utils-hoist/logger'; import { GLOBAL_OBJ } from '../utils-hoist/worldwide'; import { addConsoleInstrumentationHandler } from '../utils-hoist/instrument/console'; diff --git a/packages/core/src/logs/constants.ts b/packages/core/src/logs/constants.ts index d23a99ac95c7..b26f64c82006 100644 --- a/packages/core/src/logs/constants.ts +++ b/packages/core/src/logs/constants.ts @@ -1,4 +1,4 @@ -import type { LogSeverityLevel } from '../types-hoist'; +import type { LogSeverityLevel } from '../types-hoist/log'; /** * Maps a log severity level to a log severity number. diff --git a/packages/core/src/logs/envelope.ts b/packages/core/src/logs/envelope.ts index 706596a60dcb..cc748a0bb545 100644 --- a/packages/core/src/logs/envelope.ts +++ b/packages/core/src/logs/envelope.ts @@ -1,4 +1,6 @@ -import type { DsnComponents, SdkMetadata, SerializedOtelLog } from '../types-hoist'; +import type { DsnComponents } from '../types-hoist/dsn'; +import type { SdkMetadata } from '../types-hoist/sdkmetadata'; +import type { SerializedOtelLog } from '../types-hoist/log'; import type { OtelLogEnvelope, OtelLogItem } from '../types-hoist/envelope'; import { dsnToString } from '../utils-hoist/dsn'; import { createEnvelope } from '../utils-hoist/envelope'; diff --git a/packages/core/src/logs/exports.ts b/packages/core/src/logs/exports.ts index 62b37b2304f5..17e1b10ba041 100644 --- a/packages/core/src/logs/exports.ts +++ b/packages/core/src/logs/exports.ts @@ -3,7 +3,7 @@ import { _getTraceInfoFromScope } from '../client'; import { getClient, getCurrentScope } from '../currentScopes'; import { DEBUG_BUILD } from '../debug-build'; import { SEVERITY_TEXT_TO_SEVERITY_NUMBER } from './constants'; -import type { SerializedLogAttribute, SerializedOtelLog } from '../types-hoist'; +import type { SerializedLogAttribute, SerializedOtelLog } from '../types-hoist/log'; import type { Log } from '../types-hoist/log'; import { _getSpanForScope } from '../utils/spanOnScope'; import { createOtelLogEnvelope } from './envelope'; diff --git a/packages/core/src/metadata.ts b/packages/core/src/metadata.ts index a3933dc2a45f..8eec6542a7d4 100644 --- a/packages/core/src/metadata.ts +++ b/packages/core/src/metadata.ts @@ -1,4 +1,5 @@ -import type { Event, StackParser } from './types-hoist'; +import type { Event } from './types-hoist/event'; +import type { StackParser } from './types-hoist/stacktrace'; import { GLOBAL_OBJ } from './utils-hoist/worldwide'; /** Keys are source filename/url, values are metadata objects. */ diff --git a/packages/core/src/profiling.ts b/packages/core/src/profiling.ts index 9f55a3879b8d..d3f2a2ed13de 100644 --- a/packages/core/src/profiling.ts +++ b/packages/core/src/profiling.ts @@ -1,4 +1,4 @@ -import type { Profiler, ProfilingIntegration } from './types-hoist'; +import type { Profiler, ProfilingIntegration } from './types-hoist/profiling'; import { getClient } from './currentScopes'; import { DEBUG_BUILD } from './debug-build'; diff --git a/packages/core/src/scope.ts b/packages/core/src/scope.ts index d10b9dea08d6..7c8893ec80cb 100644 --- a/packages/core/src/scope.ts +++ b/packages/core/src/scope.ts @@ -1,25 +1,20 @@ /* eslint-disable max-lines */ import type { Client } from './client'; import { updateSession } from './session'; -import type { - Attachment, - Breadcrumb, - Context, - Contexts, - DynamicSamplingContext, - Event, - EventHint, - EventProcessor, - Extra, - Extras, - Primitive, - PropagationContext, - RequestEventData, - Session, - SeverityLevel, - Span, - User, -} from './types-hoist'; +import type { Attachment } from './types-hoist/attachment'; +import type { Breadcrumb } from './types-hoist/breadcrumb'; +import type { Context, Contexts } from './types-hoist/context'; +import type { DynamicSamplingContext } from './types-hoist/envelope'; +import type { Event, EventHint } from './types-hoist/event'; +import type { EventProcessor } from './types-hoist/eventprocessor'; +import type { Extra, Extras } from './types-hoist/extra'; +import type { Primitive } from './types-hoist/misc'; +import type { PropagationContext } from './types-hoist/tracing'; +import type { RequestEventData } from './types-hoist/request'; +import type { Session } from './types-hoist/session'; +import type { SeverityLevel } from './types-hoist/severity'; +import type { Span } from './types-hoist/span'; +import type { User } from './types-hoist/user'; import { isPlainObject } from './utils-hoist/is'; import { logger } from './utils-hoist/logger'; import { uuid4 } from './utils-hoist/misc'; diff --git a/packages/core/src/sdk.ts b/packages/core/src/sdk.ts index 2665e91ec938..fa3194d1ebc5 100644 --- a/packages/core/src/sdk.ts +++ b/packages/core/src/sdk.ts @@ -1,7 +1,7 @@ import type { Client } from './client'; import { getCurrentScope } from './currentScopes'; import { DEBUG_BUILD } from './debug-build'; -import type { ClientOptions } from './types-hoist'; +import type { ClientOptions } from './types-hoist/options'; import { consoleSandbox, logger } from './utils-hoist/logger'; /** A class object that can instantiate Client objects. */ diff --git a/packages/core/src/server-runtime-client.ts b/packages/core/src/server-runtime-client.ts index fde0dac07cc2..8f19dc2e17af 100644 --- a/packages/core/src/server-runtime-client.ts +++ b/packages/core/src/server-runtime-client.ts @@ -1,16 +1,12 @@ -import type { - BaseTransportOptions, - CheckIn, - ClientOptions, - Event, - EventHint, - Log, - MonitorConfig, - ParameterizedString, - Primitive, - SerializedCheckIn, - SeverityLevel, -} from './types-hoist'; +import type { BaseTransportOptions } from './types-hoist/transport'; +import type { CheckIn, SerializedCheckIn } from './types-hoist/checkin'; +import type { ClientOptions } from './types-hoist/options'; +import type { Event, EventHint } from './types-hoist/event'; +import type { Log } from './types-hoist/log'; +import type { MonitorConfig } from './types-hoist/checkin'; +import type { ParameterizedString } from './types-hoist/parameterize'; +import type { Primitive } from './types-hoist/misc'; +import type { SeverityLevel } from './types-hoist/severity'; import { createCheckInEnvelope } from './checkin'; import { Client, _getTraceInfoFromScope } from './client'; diff --git a/packages/core/src/session.ts b/packages/core/src/session.ts index 7f5d770603a8..116a00a9adbe 100644 --- a/packages/core/src/session.ts +++ b/packages/core/src/session.ts @@ -1,4 +1,4 @@ -import type { SerializedSession, Session, SessionContext, SessionStatus } from './types-hoist'; +import type { SerializedSession, Session, SessionContext, SessionStatus } from './types-hoist/session'; import { uuid4 } from './utils-hoist/misc'; import { timestampInSeconds } from './utils-hoist/time'; diff --git a/packages/core/src/tracing/dynamicSamplingContext.ts b/packages/core/src/tracing/dynamicSamplingContext.ts index 12cf4ca11ca6..e120f2820039 100644 --- a/packages/core/src/tracing/dynamicSamplingContext.ts +++ b/packages/core/src/tracing/dynamicSamplingContext.ts @@ -3,7 +3,8 @@ import { DEFAULT_ENVIRONMENT } from '../constants'; import { getClient } from '../currentScopes'; import type { Scope } from '../scope'; import { SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from '../semanticAttributes'; -import type { DynamicSamplingContext, Span } from '../types-hoist'; +import type { DynamicSamplingContext } from '../types-hoist/envelope'; +import type { Span } from '../types-hoist/span'; import { baggageHeaderToDynamicSamplingContext, dynamicSamplingContextToSentryBaggageHeader, diff --git a/packages/core/src/tracing/idleSpan.ts b/packages/core/src/tracing/idleSpan.ts index e96de0ef3c9d..041e67fc2bd8 100644 --- a/packages/core/src/tracing/idleSpan.ts +++ b/packages/core/src/tracing/idleSpan.ts @@ -1,5 +1,7 @@ import { getClient, getCurrentScope } from '../currentScopes'; -import type { DynamicSamplingContext, Span, StartSpanOptions } from '../types-hoist'; +import type { DynamicSamplingContext } from '../types-hoist/envelope'; +import type { Span } from '../types-hoist/span'; +import type { StartSpanOptions } from '../types-hoist/startSpanOptions'; import { DEBUG_BUILD } from '../debug-build'; import { SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON } from '../semanticAttributes'; diff --git a/packages/core/src/tracing/logSpans.ts b/packages/core/src/tracing/logSpans.ts index 669f0a4f2477..2bca01cbd702 100644 --- a/packages/core/src/tracing/logSpans.ts +++ b/packages/core/src/tracing/logSpans.ts @@ -1,5 +1,5 @@ import { DEBUG_BUILD } from '../debug-build'; -import type { Span } from '../types-hoist'; +import type { Span } from '../types-hoist/span'; import { logger } from '../utils-hoist/logger'; import { getRootSpan, spanIsSampled, spanToJSON } from '../utils/spanUtils'; diff --git a/packages/core/src/tracing/measurement.ts b/packages/core/src/tracing/measurement.ts index 1eed69b64333..ad4c94cf3789 100644 --- a/packages/core/src/tracing/measurement.ts +++ b/packages/core/src/tracing/measurement.ts @@ -3,7 +3,8 @@ import { SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT, SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE, } from '../semanticAttributes'; -import type { MeasurementUnit, Measurements, TimedEvent } from '../types-hoist'; +import type { MeasurementUnit, Measurements } from '../types-hoist/measurement'; +import type { TimedEvent } from '../types-hoist/timedEvent'; import { logger } from '../utils-hoist/logger'; import { getActiveSpan, getRootSpan } from '../utils/spanUtils'; diff --git a/packages/core/src/tracing/sampling.ts b/packages/core/src/tracing/sampling.ts index a09e04941304..ad6cd3692796 100644 --- a/packages/core/src/tracing/sampling.ts +++ b/packages/core/src/tracing/sampling.ts @@ -1,4 +1,5 @@ -import type { Options, SamplingContext } from '../types-hoist'; +import type { Options } from '../types-hoist/options'; +import type { SamplingContext } from '../types-hoist/samplingcontext'; import { DEBUG_BUILD } from '../debug-build'; import { logger } from '../utils-hoist/logger'; diff --git a/packages/core/src/tracing/sentryNonRecordingSpan.ts b/packages/core/src/tracing/sentryNonRecordingSpan.ts index b4a5a7c8cd61..577948c67292 100644 --- a/packages/core/src/tracing/sentryNonRecordingSpan.ts +++ b/packages/core/src/tracing/sentryNonRecordingSpan.ts @@ -1,12 +1,10 @@ -import type { - SentrySpanArguments, - Span, - SpanAttributeValue, - SpanAttributes, - SpanContextData, - SpanStatus, - SpanTimeInput, -} from '../types-hoist'; +import type { SentrySpanArguments } from '../types-hoist/span'; +import type { Span } from '../types-hoist/span'; +import type { SpanAttributeValue } from '../types-hoist/span'; +import type { SpanAttributes } from '../types-hoist/span'; +import type { SpanContextData } from '../types-hoist/span'; +import type { SpanStatus } from '../types-hoist/spanStatus'; +import type { SpanTimeInput } from '../types-hoist/span'; import { generateSpanId, generateTraceId } from '../utils-hoist/propagationContext'; import { TRACE_FLAG_NONE } from '../utils/spanUtils'; diff --git a/packages/core/src/tracing/sentrySpan.ts b/packages/core/src/tracing/sentrySpan.ts index f08d906dc1e0..729b5c68d40c 100644 --- a/packages/core/src/tracing/sentrySpan.ts +++ b/packages/core/src/tracing/sentrySpan.ts @@ -9,21 +9,19 @@ import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, } from '../semanticAttributes'; -import type { - SentrySpanArguments, - Span, - SpanAttributeValue, - SpanAttributes, - SpanContextData, - SpanEnvelope, - SpanJSON, - SpanOrigin, - SpanStatus, - SpanTimeInput, - TimedEvent, - TransactionEvent, - TransactionSource, -} from '../types-hoist'; +import type { SentrySpanArguments } from '../types-hoist/span'; +import type { Span } from '../types-hoist/span'; +import type { SpanAttributeValue } from '../types-hoist/span'; +import type { SpanAttributes } from '../types-hoist/span'; +import type { SpanContextData } from '../types-hoist/span'; +import type { SpanEnvelope } from '../types-hoist/envelope'; +import type { SpanJSON } from '../types-hoist/span'; +import type { SpanOrigin } from '../types-hoist/span'; +import type { SpanStatus } from '../types-hoist/spanStatus'; +import type { SpanTimeInput } from '../types-hoist/span'; +import type { TimedEvent } from '../types-hoist/timedEvent'; +import type { TransactionEvent } from '../types-hoist/event'; +import type { TransactionSource } from '../types-hoist/transaction'; import type { SpanLink } from '../types-hoist/link'; import { logger } from '../utils-hoist/logger'; import { generateSpanId, generateTraceId } from '../utils-hoist/propagationContext'; diff --git a/packages/core/src/tracing/spanstatus.ts b/packages/core/src/tracing/spanstatus.ts index 9cebe0f27284..6d353ae6a326 100644 --- a/packages/core/src/tracing/spanstatus.ts +++ b/packages/core/src/tracing/spanstatus.ts @@ -1,4 +1,5 @@ -import type { Span, SpanStatus } from '../types-hoist'; +import type { Span } from '../types-hoist/span'; +import type { SpanStatus } from '../types-hoist/spanStatus'; export const SPAN_STATUS_UNSET = 0; export const SPAN_STATUS_OK = 1; diff --git a/packages/core/src/tracing/trace.ts b/packages/core/src/tracing/trace.ts index 00e004a80131..379cb829107f 100644 --- a/packages/core/src/tracing/trace.ts +++ b/packages/core/src/tracing/trace.ts @@ -2,14 +2,12 @@ import type { AsyncContextStrategy } from '../asyncContext/types'; import { getMainCarrier } from '../carrier'; -import type { - ClientOptions, - DynamicSamplingContext, - SentrySpanArguments, - Span, - SpanTimeInput, - StartSpanOptions, -} from '../types-hoist'; +import type { ClientOptions } from '../types-hoist/options'; +import type { DynamicSamplingContext } from '../types-hoist/envelope'; +import type { SentrySpanArguments } from '../types-hoist/span'; +import type { Span } from '../types-hoist/span'; +import type { SpanTimeInput } from '../types-hoist/span'; +import type { StartSpanOptions } from '../types-hoist/startSpanOptions'; import { getClient, getCurrentScope, getIsolationScope, withScope } from '../currentScopes'; diff --git a/packages/core/src/tracing/utils.ts b/packages/core/src/tracing/utils.ts index 61e2dcce2bc1..f7e3d4924b35 100644 --- a/packages/core/src/tracing/utils.ts +++ b/packages/core/src/tracing/utils.ts @@ -1,5 +1,5 @@ import type { Scope } from '../scope'; -import type { Span } from '../types-hoist'; +import type { Span } from '../types-hoist/span'; import { addNonEnumerableProperty } from '../utils-hoist/object'; const SCOPE_ON_START_SPAN_FIELD = '_sentryScope'; diff --git a/packages/core/src/transports/base.ts b/packages/core/src/transports/base.ts index e928e5d856ce..f661bc6e0e09 100644 --- a/packages/core/src/transports/base.ts +++ b/packages/core/src/transports/base.ts @@ -1,13 +1,8 @@ import { DEBUG_BUILD } from '../debug-build'; -import type { - Envelope, - EnvelopeItem, - EventDropReason, - InternalBaseTransportOptions, - Transport, - TransportMakeRequestResponse, - TransportRequestExecutor, -} from '../types-hoist'; +import type { Envelope, EnvelopeItem } from '../types-hoist/envelope'; +import type { InternalBaseTransportOptions, Transport, TransportMakeRequestResponse } from '../types-hoist/transport'; +import type { EventDropReason } from '../types-hoist/clientreport'; +import type { TransportRequestExecutor } from '../types-hoist/transport'; import { createEnvelope, envelopeItemTypeToDataCategory, diff --git a/packages/core/src/transports/multiplexed.ts b/packages/core/src/transports/multiplexed.ts index 16d4da1cf859..ed9e87a32a6b 100644 --- a/packages/core/src/transports/multiplexed.ts +++ b/packages/core/src/transports/multiplexed.ts @@ -1,12 +1,6 @@ -import type { - BaseTransportOptions, - Envelope, - EnvelopeItemType, - Event, - EventItem, - Transport, - TransportMakeRequestResponse, -} from '../types-hoist'; +import type { Envelope, EnvelopeItemType, EventItem } from '../types-hoist/envelope'; +import type { Transport, TransportMakeRequestResponse, BaseTransportOptions } from '../types-hoist/transport'; +import type { Event } from '../types-hoist/event'; import { getEnvelopeEndpointWithUrlEncodedAuth } from '../api'; import { dsnFromString } from '../utils-hoist/dsn'; diff --git a/packages/core/src/transports/offline.ts b/packages/core/src/transports/offline.ts index 34f8c438529d..99966222113f 100644 --- a/packages/core/src/transports/offline.ts +++ b/packages/core/src/transports/offline.ts @@ -1,4 +1,5 @@ -import type { Envelope, InternalBaseTransportOptions, Transport, TransportMakeRequestResponse } from '../types-hoist'; +import type { Envelope } from '../types-hoist/envelope'; +import type { InternalBaseTransportOptions, Transport, TransportMakeRequestResponse } from '../types-hoist/transport'; import { DEBUG_BUILD } from '../debug-build'; import { envelopeContainsItemType } from '../utils-hoist/envelope'; diff --git a/packages/core/src/types-hoist/index.ts b/packages/core/src/types-hoist/index.ts deleted file mode 100644 index 1659aeda9bc0..000000000000 --- a/packages/core/src/types-hoist/index.ts +++ /dev/null @@ -1,167 +0,0 @@ -export type { Attachment } from './attachment'; -export type { - Breadcrumb, - BreadcrumbHint, - FetchBreadcrumbData, - XhrBreadcrumbData, - FetchBreadcrumbHint, - XhrBreadcrumbHint, -} from './breadcrumb'; -export type { ClientReport, Outcome, EventDropReason } from './clientreport'; -export type { - Context, - Contexts, - DeviceContext, - OsContext, - AppContext, - CultureContext, - TraceContext, - CloudResourceContext, - MissingInstrumentationContext, -} from './context'; -export type { DataCategory } from './datacategory'; -export type { DsnComponents, DsnLike, DsnProtocol } from './dsn'; -export type { DebugImage, DebugMeta } from './debugMeta'; -export type { - AttachmentItem, - BaseEnvelopeHeaders, - BaseEnvelopeItemHeaders, - ClientReportEnvelope, - ClientReportItem, - DynamicSamplingContext, - Envelope, - EnvelopeItemType, - EnvelopeItem, - EventEnvelope, - EventEnvelopeHeaders, - EventItem, - ReplayEnvelope, - FeedbackItem, - SessionEnvelope, - SessionItem, - UserFeedbackItem, - CheckInItem, - CheckInEnvelope, - RawSecurityEnvelope, - RawSecurityItem, - ProfileItem, - ProfileChunkEnvelope, - ProfileChunkItem, - SpanEnvelope, - SpanItem, - OtelLogEnvelope, - OtelLogItem, -} from './envelope'; -export type { ExtendedError } from './error'; -export type { Event, EventHint, EventType, ErrorEvent, TransactionEvent } from './event'; -export type { EventProcessor } from './eventprocessor'; -export type { Exception } from './exception'; -export type { Extra, Extras } from './extra'; -export type { Integration, IntegrationFn } from './integration'; -export type { Mechanism } from './mechanism'; -export type { ExtractedNodeRequestData, HttpHeaderValue, Primitive, WorkerLocation } from './misc'; -export type { ClientOptions, Options } from './options'; -export type { Package } from './package'; -export type { PolymorphicEvent, PolymorphicRequest } from './polymorphics'; -export type { - ThreadId, - FrameId, - StackId, - ThreadCpuSample, - ThreadCpuStack, - ThreadCpuFrame, - ThreadCpuProfile, - ContinuousThreadCpuProfile, - Profile, - ProfileChunk, -} from './profiling'; -export type { ReplayEvent, ReplayRecordingData, ReplayRecordingMode } from './replay'; -export type { - FeedbackEvent, - FeedbackFormData, - FeedbackInternalOptions, - FeedbackModalIntegration, - FeedbackScreenshotIntegration, - SendFeedback, - SendFeedbackParams, - UserFeedback, -} from './feedback'; -export type { QueryParams, RequestEventData, SanitizedRequestData } from './request'; -export type { Runtime } from './runtime'; -export type { SdkInfo } from './sdkinfo'; -export type { SdkMetadata } from './sdkmetadata'; -export type { - SessionAggregates, - AggregationCounts, - Session, - SessionContext, - SessionStatus, - SerializedSession, -} from './session'; - -export type { SeverityLevel } from './severity'; -export type { - Span, - SentrySpanArguments, - SpanOrigin, - SpanAttributeValue, - SpanAttributes, - SpanTimeInput, - SpanJSON, - SpanContextData, - TraceFlag, -} from './span'; -export type { SpanStatus } from './spanStatus'; -export type { - Log, - LogSeverityLevel, - SerializedOtelLog, - SerializedLogAttribute, - SerializedLogAttributeValueType, -} from './log'; -export type { TimedEvent } from './timedEvent'; -export type { StackFrame } from './stackframe'; -export type { Stacktrace, StackParser, StackLineParser, StackLineParserFn } from './stacktrace'; -export type { PropagationContext, TracePropagationTargets, SerializedTraceData } from './tracing'; -export type { StartSpanOptions } from './startSpanOptions'; -export type { TraceparentData, TransactionSource } from './transaction'; -export type { CustomSamplingContext, SamplingContext } from './samplingcontext'; -export type { - DurationUnit, - InformationUnit, - FractionUnit, - MeasurementUnit, - NoneUnit, - Measurements, -} from './measurement'; -export type { Thread } from './thread'; -export type { - Transport, - TransportRequest, - TransportMakeRequestResponse, - InternalBaseTransportOptions, - BaseTransportOptions, - TransportRequestExecutor, -} from './transport'; -export type { User } from './user'; -export type { WebFetchHeaders, WebFetchRequest } from './webfetchapi'; -export type { WrappedFunction } from './wrappedfunction'; -export type { - HandlerDataFetch, - HandlerDataXhr, - HandlerDataDom, - HandlerDataConsole, - HandlerDataHistory, - HandlerDataError, - HandlerDataUnhandledRejection, - ConsoleLevel, - SentryXhrData, - SentryWrappedXMLHttpRequest, -} from './instrument'; - -export type { BrowserClientReplayOptions, BrowserClientProfilingOptions } from './browseroptions'; -export type { CheckIn, MonitorConfig, FinishedCheckIn, InProgressCheckIn, SerializedCheckIn } from './checkin'; -export type { ParameterizedString } from './parameterize'; -export type { ContinuousProfiler, ProfilingIntegration, Profiler } from './profiling'; -export type { ViewHierarchyData, ViewHierarchyWindow } from './view-hierarchy'; -export type { LegacyCSPReport } from './csp'; diff --git a/packages/core/src/utils-hoist/aggregate-errors.ts b/packages/core/src/utils-hoist/aggregate-errors.ts index 33728c03edba..f2eed76dcb79 100644 --- a/packages/core/src/utils-hoist/aggregate-errors.ts +++ b/packages/core/src/utils-hoist/aggregate-errors.ts @@ -1,4 +1,7 @@ -import type { Event, EventHint, Exception, ExtendedError, StackParser } from '../types-hoist'; +import type { Event, EventHint } from '../types-hoist/event'; +import type { Exception } from '../types-hoist/exception'; +import type { ExtendedError } from '../types-hoist/error'; +import type { StackParser } from '../types-hoist/stacktrace'; import { isInstanceOf } from './is'; diff --git a/packages/core/src/utils-hoist/anr.ts b/packages/core/src/utils-hoist/anr.ts index 84cce09bb030..0c1e6a08b4bb 100644 --- a/packages/core/src/utils-hoist/anr.ts +++ b/packages/core/src/utils-hoist/anr.ts @@ -1,4 +1,4 @@ -import type { StackFrame } from '../types-hoist'; +import type { StackFrame } from '../types-hoist/stackframe'; import { filenameIsInApp } from './node-stack-trace'; import { UNKNOWN_FUNCTION } from './stacktrace'; diff --git a/packages/core/src/utils-hoist/baggage.ts b/packages/core/src/utils-hoist/baggage.ts index 84d1078b7583..efd038230213 100644 --- a/packages/core/src/utils-hoist/baggage.ts +++ b/packages/core/src/utils-hoist/baggage.ts @@ -1,4 +1,4 @@ -import type { DynamicSamplingContext } from '../types-hoist'; +import type { DynamicSamplingContext } from '../types-hoist/envelope'; import { DEBUG_BUILD } from './debug-build'; import { isString } from './is'; diff --git a/packages/core/src/utils-hoist/breadcrumb-log-level.ts b/packages/core/src/utils-hoist/breadcrumb-log-level.ts index 584e43d63364..0c7e301aadcc 100644 --- a/packages/core/src/utils-hoist/breadcrumb-log-level.ts +++ b/packages/core/src/utils-hoist/breadcrumb-log-level.ts @@ -1,4 +1,4 @@ -import type { SeverityLevel } from '../types-hoist'; +import type { SeverityLevel } from '../types-hoist/severity'; /** * Determine a breadcrumb's log level (only `warning` or `error`) based on an HTTP status code. diff --git a/packages/core/src/utils-hoist/clientreport.ts b/packages/core/src/utils-hoist/clientreport.ts index 65ca239a166d..9671a3c1912b 100644 --- a/packages/core/src/utils-hoist/clientreport.ts +++ b/packages/core/src/utils-hoist/clientreport.ts @@ -1,4 +1,5 @@ -import type { ClientReport, ClientReportEnvelope, ClientReportItem } from '../types-hoist'; +import type { ClientReport } from '../types-hoist/clientreport'; +import type { ClientReportEnvelope, ClientReportItem } from '../types-hoist/envelope'; import { createEnvelope } from './envelope'; import { dateTimestampInSeconds } from './time'; diff --git a/packages/core/src/utils-hoist/debug-ids.ts b/packages/core/src/utils-hoist/debug-ids.ts index 055d3aec9fba..f60e74c7cd26 100644 --- a/packages/core/src/utils-hoist/debug-ids.ts +++ b/packages/core/src/utils-hoist/debug-ids.ts @@ -1,4 +1,5 @@ -import type { DebugImage, StackParser } from '../types-hoist'; +import type { DebugImage } from '../types-hoist/debugMeta'; +import type { StackParser } from '../types-hoist/stacktrace'; import { GLOBAL_OBJ } from './worldwide'; type StackString = string; diff --git a/packages/core/src/utils-hoist/dsn.ts b/packages/core/src/utils-hoist/dsn.ts index abce9a5d6be7..1c240fb3fc10 100644 --- a/packages/core/src/utils-hoist/dsn.ts +++ b/packages/core/src/utils-hoist/dsn.ts @@ -1,4 +1,4 @@ -import type { DsnComponents, DsnLike, DsnProtocol } from '../types-hoist'; +import type { DsnComponents, DsnLike, DsnProtocol } from '../types-hoist/dsn'; import { DEBUG_BUILD } from './debug-build'; import { consoleSandbox, logger } from './logger'; diff --git a/packages/core/src/utils-hoist/envelope.ts b/packages/core/src/utils-hoist/envelope.ts index 450706fb9c2e..33f93511643f 100644 --- a/packages/core/src/utils-hoist/envelope.ts +++ b/packages/core/src/utils-hoist/envelope.ts @@ -1,20 +1,20 @@ import { getSentryCarrier } from '../carrier'; +import type { Attachment } from '../types-hoist/attachment'; import type { - Attachment, - AttachmentItem, BaseEnvelopeHeaders, BaseEnvelopeItemHeaders, - DataCategory, - DsnComponents, - Envelope, EnvelopeItemType, - Event, + Envelope, EventEnvelopeHeaders, - SdkInfo, - SdkMetadata, + AttachmentItem, SpanItem, - SpanJSON, -} from '../types-hoist'; +} from '../types-hoist/envelope'; +import type { DsnComponents } from '../types-hoist/dsn'; +import type { Event } from '../types-hoist/event'; +import type { SdkInfo } from '../types-hoist/sdkinfo'; +import type { SdkMetadata } from '../types-hoist/sdkmetadata'; +import type { SpanJSON } from '../types-hoist/span'; +import type { DataCategory } from '../types-hoist/datacategory'; import { dsnToString } from './dsn'; import { normalize } from './normalize'; diff --git a/packages/core/src/utils-hoist/error.ts b/packages/core/src/utils-hoist/error.ts index e15a52dcfc83..3fb6b1ef9291 100644 --- a/packages/core/src/utils-hoist/error.ts +++ b/packages/core/src/utils-hoist/error.ts @@ -1,4 +1,4 @@ -import type { ConsoleLevel } from '../types-hoist'; +import type { ConsoleLevel } from '../types-hoist/instrument'; /** * An error emitted by Sentry SDKs and related utilities. diff --git a/packages/core/src/utils-hoist/eventbuilder.ts b/packages/core/src/utils-hoist/eventbuilder.ts index 8aad56c229a3..7156a0227615 100644 --- a/packages/core/src/utils-hoist/eventbuilder.ts +++ b/packages/core/src/utils-hoist/eventbuilder.ts @@ -1,15 +1,12 @@ import type { Client } from '../client'; -import type { - Event, - EventHint, - Exception, - Extras, - Mechanism, - ParameterizedString, - SeverityLevel, - StackFrame, - StackParser, -} from '../types-hoist'; +import type { Event, EventHint } from '../types-hoist/event'; +import type { Exception } from '../types-hoist/exception'; +import type { Extras } from '../types-hoist/extra'; +import type { Mechanism } from '../types-hoist/mechanism'; +import type { ParameterizedString } from '../types-hoist/parameterize'; +import type { SeverityLevel } from '../types-hoist/severity'; +import type { StackFrame } from '../types-hoist/stackframe'; +import type { StackParser } from '../types-hoist/stacktrace'; import { isError, isErrorEvent, isParameterizedString, isPlainObject } from './is'; import { addExceptionMechanism, addExceptionTypeValue } from './misc'; import { normalizeToSize } from './normalize'; diff --git a/packages/core/src/utils-hoist/instrument/console.ts b/packages/core/src/utils-hoist/instrument/console.ts index 2fcb8e91b14a..80d236a2143a 100644 --- a/packages/core/src/utils-hoist/instrument/console.ts +++ b/packages/core/src/utils-hoist/instrument/console.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/ban-types */ -import type { ConsoleLevel, HandlerDataConsole } from '../../types-hoist'; +import type { ConsoleLevel, HandlerDataConsole } from '../../types-hoist/instrument'; import { CONSOLE_LEVELS, originalConsoleMethods } from '../logger'; import { fill } from '../object'; diff --git a/packages/core/src/utils-hoist/instrument/fetch.ts b/packages/core/src/utils-hoist/instrument/fetch.ts index 7d6185d00639..2d86b42aafda 100644 --- a/packages/core/src/utils-hoist/instrument/fetch.ts +++ b/packages/core/src/utils-hoist/instrument/fetch.ts @@ -1,5 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import type { HandlerDataFetch, WebFetchHeaders } from '../../types-hoist'; +import type { HandlerDataFetch } from '../../types-hoist/instrument'; +import type { WebFetchHeaders } from '../../types-hoist/webfetchapi'; import { isError, isRequest } from '../is'; import { addNonEnumerableProperty, fill } from '../object'; diff --git a/packages/core/src/utils-hoist/instrument/globalError.ts b/packages/core/src/utils-hoist/instrument/globalError.ts index bebb301b18d6..97572a2be405 100644 --- a/packages/core/src/utils-hoist/instrument/globalError.ts +++ b/packages/core/src/utils-hoist/instrument/globalError.ts @@ -1,4 +1,4 @@ -import type { HandlerDataError } from '../../types-hoist'; +import type { HandlerDataError } from '../../types-hoist/instrument'; import { GLOBAL_OBJ } from '../worldwide'; import { addHandler, maybeInstrument, triggerHandlers } from './handlers'; diff --git a/packages/core/src/utils-hoist/instrument/globalUnhandledRejection.ts b/packages/core/src/utils-hoist/instrument/globalUnhandledRejection.ts index 4b4173233a43..bbf43c949394 100644 --- a/packages/core/src/utils-hoist/instrument/globalUnhandledRejection.ts +++ b/packages/core/src/utils-hoist/instrument/globalUnhandledRejection.ts @@ -1,4 +1,4 @@ -import type { HandlerDataUnhandledRejection } from '../../types-hoist'; +import type { HandlerDataUnhandledRejection } from '../../types-hoist/instrument'; import { GLOBAL_OBJ } from '../worldwide'; import { addHandler, maybeInstrument, triggerHandlers } from './handlers'; diff --git a/packages/core/src/utils-hoist/is.ts b/packages/core/src/utils-hoist/is.ts index ab5e150e2394..a1c7be2c235a 100644 --- a/packages/core/src/utils-hoist/is.ts +++ b/packages/core/src/utils-hoist/is.ts @@ -1,6 +1,8 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import type { ParameterizedString, PolymorphicEvent, Primitive } from '../types-hoist'; +import type { ParameterizedString } from '../types-hoist/parameterize'; +import type { PolymorphicEvent } from '../types-hoist/polymorphics'; +import type { Primitive } from '../types-hoist/misc'; // eslint-disable-next-line @typescript-eslint/unbound-method const objectToString = Object.prototype.toString; diff --git a/packages/core/src/utils-hoist/logger.ts b/packages/core/src/utils-hoist/logger.ts index ee642d44582d..8eefa9f96c39 100644 --- a/packages/core/src/utils-hoist/logger.ts +++ b/packages/core/src/utils-hoist/logger.ts @@ -1,5 +1,5 @@ import { getGlobalSingleton } from '../carrier'; -import type { ConsoleLevel } from '../types-hoist'; +import type { ConsoleLevel } from '../types-hoist/instrument'; import { DEBUG_BUILD } from './debug-build'; import { GLOBAL_OBJ } from './worldwide'; diff --git a/packages/core/src/utils-hoist/misc.ts b/packages/core/src/utils-hoist/misc.ts index 8a7d26775462..adc41acc8a40 100644 --- a/packages/core/src/utils-hoist/misc.ts +++ b/packages/core/src/utils-hoist/misc.ts @@ -1,4 +1,7 @@ -import type { Event, Exception, Mechanism, StackFrame } from '../types-hoist'; +import type { Event } from '../types-hoist/event'; +import type { Exception } from '../types-hoist/exception'; +import type { Mechanism } from '../types-hoist/mechanism'; +import type { StackFrame } from '../types-hoist/stackframe'; import { addNonEnumerableProperty } from './object'; import { snipLine } from './string'; diff --git a/packages/core/src/utils-hoist/node-stack-trace.ts b/packages/core/src/utils-hoist/node-stack-trace.ts index 56e94a0457f5..9184d3bac53d 100644 --- a/packages/core/src/utils-hoist/node-stack-trace.ts +++ b/packages/core/src/utils-hoist/node-stack-trace.ts @@ -21,7 +21,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import type { StackLineParser, StackLineParserFn } from '../types-hoist'; +import type { StackLineParser, StackLineParserFn } from '../types-hoist/stacktrace'; import { UNKNOWN_FUNCTION } from './stacktrace'; export type GetModuleFn = (filename: string | undefined) => string | undefined; diff --git a/packages/core/src/utils-hoist/normalize.ts b/packages/core/src/utils-hoist/normalize.ts index 0c57355ba3fe..9cf0fd52362a 100644 --- a/packages/core/src/utils-hoist/normalize.ts +++ b/packages/core/src/utils-hoist/normalize.ts @@ -1,4 +1,4 @@ -import type { Primitive } from '../types-hoist'; +import type { Primitive } from '../types-hoist/misc'; import { isSyntheticEvent, isVueViewModel } from './is'; import { convertToPlainObject } from './object'; diff --git a/packages/core/src/utils-hoist/object.ts b/packages/core/src/utils-hoist/object.ts index d1a1ba82aa99..bdcf12ba99b0 100644 --- a/packages/core/src/utils-hoist/object.ts +++ b/packages/core/src/utils-hoist/object.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import type { WrappedFunction } from '../types-hoist'; +import type { WrappedFunction } from '../types-hoist/wrappedfunction'; import { htmlTreeAsString } from './browser'; import { DEBUG_BUILD } from './debug-build'; diff --git a/packages/core/src/utils-hoist/ratelimit.ts b/packages/core/src/utils-hoist/ratelimit.ts index 501621245dd0..4cb8cb9d07a5 100644 --- a/packages/core/src/utils-hoist/ratelimit.ts +++ b/packages/core/src/utils-hoist/ratelimit.ts @@ -1,4 +1,5 @@ -import type { DataCategory, TransportMakeRequestResponse } from '../types-hoist'; +import type { DataCategory } from '../types-hoist/datacategory'; +import type { TransportMakeRequestResponse } from '../types-hoist/transport'; // Intentionally keeping the key broad, as we don't know for sure what rate limit headers get returned from backend export type RateLimits = Record; diff --git a/packages/core/src/utils-hoist/severity.ts b/packages/core/src/utils-hoist/severity.ts index 8b20a03e7ac8..51bc6d580ef8 100644 --- a/packages/core/src/utils-hoist/severity.ts +++ b/packages/core/src/utils-hoist/severity.ts @@ -1,4 +1,4 @@ -import type { SeverityLevel } from '../types-hoist'; +import type { SeverityLevel } from '../types-hoist/severity'; /** * Converts a string-based level into a `SeverityLevel`, normalizing it along the way. diff --git a/packages/core/src/utils-hoist/stacktrace.ts b/packages/core/src/utils-hoist/stacktrace.ts index 5a1a6b33435f..2c95280d0407 100644 --- a/packages/core/src/utils-hoist/stacktrace.ts +++ b/packages/core/src/utils-hoist/stacktrace.ts @@ -1,4 +1,6 @@ -import type { Event, StackFrame, StackLineParser, StackParser } from '../types-hoist'; +import type { Event } from '../types-hoist/event'; +import type { StackFrame } from '../types-hoist/stackframe'; +import type { StackLineParser, StackParser } from '../types-hoist/stacktrace'; const STACKTRACE_FRAME_LIMIT = 50; export const UNKNOWN_FUNCTION = '?'; diff --git a/packages/core/src/utils-hoist/tracing.ts b/packages/core/src/utils-hoist/tracing.ts index 35b71fda472a..2f1be61a0ef5 100644 --- a/packages/core/src/utils-hoist/tracing.ts +++ b/packages/core/src/utils-hoist/tracing.ts @@ -1,4 +1,6 @@ -import type { DynamicSamplingContext, PropagationContext, TraceparentData } from '../types-hoist'; +import type { DynamicSamplingContext } from '../types-hoist/envelope'; +import type { PropagationContext } from '../types-hoist/tracing'; +import type { TraceparentData } from '../types-hoist/transaction'; import { parseSampleRate } from '../utils/parseSampleRate'; import { baggageHeaderToDynamicSamplingContext } from './baggage'; diff --git a/packages/core/src/utils/applyScopeDataToEvent.ts b/packages/core/src/utils/applyScopeDataToEvent.ts index 1366fceef540..5fcce32be2ba 100644 --- a/packages/core/src/utils/applyScopeDataToEvent.ts +++ b/packages/core/src/utils/applyScopeDataToEvent.ts @@ -1,6 +1,8 @@ import type { ScopeData } from '../scope'; import { getDynamicSamplingContextFromSpan } from '../tracing/dynamicSamplingContext'; -import type { Breadcrumb, Event, Span } from '../types-hoist'; +import type { Breadcrumb } from '../types-hoist/breadcrumb'; +import type { Event } from '../types-hoist/event'; +import type { Span } from '../types-hoist/span'; import { merge } from './merge'; import { getRootSpan, spanToJSON, spanToTraceContext } from './spanUtils'; diff --git a/packages/core/src/utils/eventUtils.ts b/packages/core/src/utils/eventUtils.ts index 716d12d2f4f8..3b474548a300 100644 --- a/packages/core/src/utils/eventUtils.ts +++ b/packages/core/src/utils/eventUtils.ts @@ -1,4 +1,4 @@ -import type { Event } from '../types-hoist'; +import type { Event } from '../types-hoist/event'; /** * Get a list of possible event messages from a Sentry event. diff --git a/packages/core/src/utils/hasSpansEnabled.ts b/packages/core/src/utils/hasSpansEnabled.ts index 9b7126318379..dc59ec770271 100644 --- a/packages/core/src/utils/hasSpansEnabled.ts +++ b/packages/core/src/utils/hasSpansEnabled.ts @@ -1,5 +1,5 @@ import { getClient } from '../currentScopes'; -import type { Options } from '../types-hoist'; +import type { Options } from '../types-hoist/options'; // Treeshakable guard to remove all code related to tracing declare const __SENTRY_TRACING__: boolean | undefined; diff --git a/packages/core/src/utils/ipAddress.ts b/packages/core/src/utils/ipAddress.ts index 8ca389dc68a1..3499bdc3a055 100644 --- a/packages/core/src/utils/ipAddress.ts +++ b/packages/core/src/utils/ipAddress.ts @@ -1,4 +1,6 @@ -import type { Session, SessionAggregates, User } from '../types-hoist'; +import type { Session } from '../types-hoist/session'; +import type { SessionAggregates } from '../types-hoist/session'; +import type { User } from '../types-hoist/user'; // By default, we want to infer the IP address, unless this is explicitly set to `null` // We do this after all other processing is done diff --git a/packages/core/src/utils/isSentryRequestUrl.ts b/packages/core/src/utils/isSentryRequestUrl.ts index 07fde7e29288..e93f61a5919a 100644 --- a/packages/core/src/utils/isSentryRequestUrl.ts +++ b/packages/core/src/utils/isSentryRequestUrl.ts @@ -1,5 +1,5 @@ import type { Client } from '../client'; -import type { DsnComponents } from '../types-hoist'; +import type { DsnComponents } from '../types-hoist/dsn'; /** * Checks whether given url points to Sentry server diff --git a/packages/core/src/utils/parameterize.ts b/packages/core/src/utils/parameterize.ts index 2ada1f4ec2d9..e4136356d74c 100644 --- a/packages/core/src/utils/parameterize.ts +++ b/packages/core/src/utils/parameterize.ts @@ -1,4 +1,4 @@ -import type { ParameterizedString } from '../types-hoist'; +import type { ParameterizedString } from '../types-hoist/parameterize'; /** * Tagged template function which returns parameterized representation of the message diff --git a/packages/core/src/utils/prepareEvent.ts b/packages/core/src/utils/prepareEvent.ts index edb4e8d2eac4..a1330fa5a932 100644 --- a/packages/core/src/utils/prepareEvent.ts +++ b/packages/core/src/utils/prepareEvent.ts @@ -4,7 +4,10 @@ import { getGlobalScope } from '../currentScopes'; import { notifyEventProcessors } from '../eventProcessors'; import type { CaptureContext, ScopeContext } from '../scope'; import { Scope } from '../scope'; -import type { ClientOptions, Event, EventHint, StackParser } from '../types-hoist'; +import type { ClientOptions } from '../types-hoist/options'; +import type { Event } from '../types-hoist/event'; +import type { EventHint } from '../types-hoist/event'; +import type { StackParser } from '../types-hoist/stacktrace'; import { getFilenameToDebugIdMap } from '../utils-hoist/debug-ids'; import { addExceptionMechanism, uuid4 } from '../utils-hoist/misc'; import { normalize } from '../utils-hoist/normalize'; diff --git a/packages/core/src/utils/request.ts b/packages/core/src/utils/request.ts index 91a965484d8c..6c62f422207a 100644 --- a/packages/core/src/utils/request.ts +++ b/packages/core/src/utils/request.ts @@ -1,4 +1,5 @@ -import type { PolymorphicRequest, RequestEventData } from '../types-hoist'; +import type { PolymorphicRequest } from '../types-hoist/polymorphics'; +import type { RequestEventData } from '../types-hoist/request'; import type { WebFetchHeaders, WebFetchRequest } from '../types-hoist/webfetchapi'; /** diff --git a/packages/core/src/utils/sdkMetadata.ts b/packages/core/src/utils/sdkMetadata.ts index 74c2f2e75e1c..9235efbe8c0c 100644 --- a/packages/core/src/utils/sdkMetadata.ts +++ b/packages/core/src/utils/sdkMetadata.ts @@ -1,4 +1,4 @@ -import type { Options } from '../types-hoist'; +import type { Options } from '../types-hoist/options'; import { SDK_VERSION } from '../utils-hoist/version'; /** diff --git a/packages/core/src/utils/spanOnScope.ts b/packages/core/src/utils/spanOnScope.ts index 33d0ff80dd12..29eec0a2574b 100644 --- a/packages/core/src/utils/spanOnScope.ts +++ b/packages/core/src/utils/spanOnScope.ts @@ -1,5 +1,5 @@ import type { Scope } from '../scope'; -import type { Span } from '../types-hoist'; +import type { Span } from '../types-hoist/span'; import { addNonEnumerableProperty } from '../utils-hoist/object'; const SCOPE_SPAN_FIELD = '_sentrySpan'; diff --git a/packages/core/src/utils/spanUtils.ts b/packages/core/src/utils/spanUtils.ts index cbfcde2a2576..8d01c1f62609 100644 --- a/packages/core/src/utils/spanUtils.ts +++ b/packages/core/src/utils/spanUtils.ts @@ -10,15 +10,9 @@ import { import type { SentrySpan } from '../tracing/sentrySpan'; import { SPAN_STATUS_OK, SPAN_STATUS_UNSET } from '../tracing/spanstatus'; import { getCapturedScopesOnSpan } from '../tracing/utils'; -import type { - Span, - SpanAttributes, - SpanJSON, - SpanOrigin, - SpanStatus, - SpanTimeInput, - TraceContext, -} from '../types-hoist'; +import type { Span, SpanAttributes, SpanJSON, SpanOrigin, SpanTimeInput } from '../types-hoist/span'; +import type { SpanStatus } from '../types-hoist/spanStatus'; +import type { TraceContext } from '../types-hoist/context'; import type { SpanLink, SpanLinkJSON } from '../types-hoist/link'; import { consoleSandbox } from '../utils-hoist/logger'; import { addNonEnumerableProperty } from '../utils-hoist/object'; diff --git a/packages/core/src/utils/traceData.ts b/packages/core/src/utils/traceData.ts index 56968a27c357..a869186d0c3b 100644 --- a/packages/core/src/utils/traceData.ts +++ b/packages/core/src/utils/traceData.ts @@ -4,7 +4,8 @@ import { getClient, getCurrentScope } from '../currentScopes'; import { isEnabled } from '../exports'; import type { Scope } from '../scope'; import { getDynamicSamplingContextFromScope, getDynamicSamplingContextFromSpan } from '../tracing'; -import type { SerializedTraceData, Span } from '../types-hoist'; +import type { SerializedTraceData } from '../types-hoist/tracing'; +import type { Span } from '../types-hoist/span'; import { dynamicSamplingContextToSentryBaggageHeader } from '../utils-hoist/baggage'; import { logger } from '../utils-hoist/logger'; import { TRACEPARENT_REGEXP, generateSentryTraceHeader } from '../utils-hoist/tracing'; diff --git a/packages/core/src/utils/transactionEvent.ts b/packages/core/src/utils/transactionEvent.ts index 195c31a66966..c47362f42d42 100644 --- a/packages/core/src/utils/transactionEvent.ts +++ b/packages/core/src/utils/transactionEvent.ts @@ -1,5 +1,6 @@ import { SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME, SEMANTIC_ATTRIBUTE_PROFILE_ID } from '../semanticAttributes'; -import type { SpanJSON, TransactionEvent } from '../types-hoist'; +import type { SpanJSON } from '../types-hoist/span'; +import type { TransactionEvent } from '../types-hoist/event'; /** * Converts a transaction event to a span JSON object. diff --git a/packages/core/test/lib/api.test.ts b/packages/core/test/lib/api.test.ts index beca401e4858..647095a98842 100644 --- a/packages/core/test/lib/api.test.ts +++ b/packages/core/test/lib/api.test.ts @@ -1,6 +1,7 @@ import { describe, expect, it, test } from 'vitest'; import { getEnvelopeEndpointWithUrlEncodedAuth, getReportDialogEndpoint } from '../../src/api'; -import type { DsnComponents, SdkInfo } from '../../src/types-hoist'; +import type { DsnComponents } from '../../src/types-hoist/dsn'; +import type { SdkInfo } from '../../src/types-hoist/sdkinfo'; import { makeDsn } from '../../src/utils-hoist/dsn'; const ingestDsn = 'https://abc@xxxx.ingest.sentry.io:1234/subpath/123'; diff --git a/packages/core/test/lib/checkin.test.ts b/packages/core/test/lib/checkin.test.ts index a4cdc434ac94..f3b15ed31c36 100644 --- a/packages/core/test/lib/checkin.test.ts +++ b/packages/core/test/lib/checkin.test.ts @@ -1,4 +1,4 @@ -import type { SerializedCheckIn } from '../../src/types-hoist'; +import type { SerializedCheckIn } from '../../src/types-hoist/checkin'; import { createCheckInEnvelope } from '../../src/checkin'; diff --git a/packages/core/test/lib/client.test.ts b/packages/core/test/lib/client.test.ts index 03907285f6cb..2731d5c30929 100644 --- a/packages/core/test/lib/client.test.ts +++ b/packages/core/test/lib/client.test.ts @@ -13,7 +13,11 @@ import { } from '../../src'; import type { BaseClient, Client } from '../../src/client'; import * as integrationModule from '../../src/integration'; -import type { Envelope, ErrorEvent, Event, SpanJSON, TransactionEvent } from '../../src/types-hoist'; +import type { Envelope } from '../../src/types-hoist/envelope'; +import type { ErrorEvent } from '../../src/types-hoist/event'; +import type { Event } from '../../src/types-hoist/event'; +import type { SpanJSON } from '../../src/types-hoist/span'; +import type { TransactionEvent } from '../../src/types-hoist/event'; import * as loggerModule from '../../src/utils-hoist/logger'; import * as miscModule from '../../src/utils-hoist/misc'; import * as stringModule from '../../src/utils-hoist/string'; diff --git a/packages/core/test/lib/envelope.test.ts b/packages/core/test/lib/envelope.test.ts index 5eb45a495b32..fecd1951a443 100644 --- a/packages/core/test/lib/envelope.test.ts +++ b/packages/core/test/lib/envelope.test.ts @@ -9,8 +9,10 @@ import { setCurrentClient, } from '../../src'; import { createEventEnvelope, createSpanEnvelope } from '../../src/envelope'; -import type { DsnComponents, DynamicSamplingContext, Event } from '../../src/types-hoist'; +import type { Event } from '../../src/types-hoist/event'; import { TestClient, getDefaultTestClientOptions } from '../mocks/client'; +import type { DsnComponents } from '../../build/types/types-hoist/dsn'; +import type { DynamicSamplingContext } from '../../build/types/types-hoist/envelope'; const testDsn: DsnComponents = { protocol: 'https', projectId: 'abc', host: 'testry.io', publicKey: 'pubKey123' }; diff --git a/packages/core/test/lib/feedback.test.ts b/packages/core/test/lib/feedback.test.ts index e82814437d2b..1d2af6422275 100644 --- a/packages/core/test/lib/feedback.test.ts +++ b/packages/core/test/lib/feedback.test.ts @@ -9,7 +9,7 @@ import { withScope, } from '../../src'; import { captureFeedback } from '../../src/feedback'; -import type { Span } from '../../src/types-hoist'; +import type { Span } from '../../src/types-hoist/span'; import { TestClient, getDefaultTestClientOptions } from '../mocks/client'; describe('captureFeedback', () => { diff --git a/packages/core/test/lib/integration.test.ts b/packages/core/test/lib/integration.test.ts index b495c73b85e4..85ddcc5e40f5 100644 --- a/packages/core/test/lib/integration.test.ts +++ b/packages/core/test/lib/integration.test.ts @@ -1,11 +1,12 @@ import { getCurrentScope } from '../../src/currentScopes'; -import type { Integration, Options } from '../../src/types-hoist'; import { afterEach, beforeEach, describe, expect, it, test, vi } from 'vitest'; import { addIntegration, getIntegrationsToSetup, installedIntegrations, setupIntegration } from '../../src/integration'; import { setCurrentClient } from '../../src/sdk'; import { logger } from '../../src/utils-hoist/logger'; import { TestClient, getDefaultTestClientOptions } from '../mocks/client'; +import type { Integration } from '../../src/types-hoist/integration'; +import type { Options } from '../../src/types-hoist/options'; function getTestClient(): TestClient { return new TestClient( diff --git a/packages/core/test/lib/integrations/captureconsole.test.ts b/packages/core/test/lib/integrations/captureconsole.test.ts index b64e6bdd4cac..d4da66bf3788 100644 --- a/packages/core/test/lib/integrations/captureconsole.test.ts +++ b/packages/core/test/lib/integrations/captureconsole.test.ts @@ -1,11 +1,12 @@ /* eslint-disable @typescript-eslint/unbound-method */ -import { type Mock, afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; +import { afterEach, beforeEach, describe, expect, it, vi, type Mock } from 'vitest'; import type { Client } from '../../../src'; import * as CurrentScopes from '../../../src/currentScopes'; import * as SentryCore from '../../../src/exports'; import { captureConsoleIntegration } from '../../../src/integrations/captureconsole'; -import type { ConsoleLevel, Event } from '../../../src/types-hoist'; +import type { Event } from '../../../src/types-hoist/event'; +import type { ConsoleLevel } from '../../../src/types/types-hoist/instrument'; import { addConsoleInstrumentationHandler } from '../../../src/utils-hoist/instrument/console'; import { resetInstrumentationHandlers } from '../../../src/utils-hoist/instrument/handlers'; import { CONSOLE_LEVELS, originalConsoleMethods } from '../../../src/utils-hoist/logger'; diff --git a/packages/core/test/lib/integrations/dedupe.test.ts b/packages/core/test/lib/integrations/dedupe.test.ts index ea42d99ab3e5..722d9c3bb158 100644 --- a/packages/core/test/lib/integrations/dedupe.test.ts +++ b/packages/core/test/lib/integrations/dedupe.test.ts @@ -1,7 +1,8 @@ -import type { Event as SentryEvent, Exception, StackFrame, Stacktrace } from '../../../src/types-hoist'; - +import type { Event as SentryEvent } from '../../../src/types-hoist/event'; +import type { Exception } from '../../../src/types-hoist/exception'; +import type { StackFrame } from '../../../src/types-hoist/stackframe'; +import type { Stacktrace } from '../../../src/types-hoist/stacktrace'; import { _shouldDropEvent, dedupeIntegration } from '../../../src/integrations/dedupe'; - import { describe, expect, it } from 'vitest'; type EventWithException = SentryEvent & { diff --git a/packages/core/test/lib/integrations/eventFilters.test.ts b/packages/core/test/lib/integrations/eventFilters.test.ts index 924711ce8662..f25984ee342b 100644 --- a/packages/core/test/lib/integrations/eventFilters.test.ts +++ b/packages/core/test/lib/integrations/eventFilters.test.ts @@ -1,5 +1,6 @@ -import type { Event, EventProcessor, Integration } from '../../../src/types-hoist'; - +import type { Event } from '../../../src/types-hoist/event'; +import type { EventProcessor } from '../../../src/types-hoist/eventprocessor'; +import type { Integration } from '../../../src/types-hoist/integration'; import { describe, expect, it } from 'vitest'; import type { EventFiltersOptions } from '../../../src/integrations/eventFilters'; import { eventFiltersIntegration } from '../../../src/integrations/eventFilters'; diff --git a/packages/core/test/lib/integrations/extraerrordata.test.ts b/packages/core/test/lib/integrations/extraerrordata.test.ts index 33f1f1debe8e..b0ece956e0cc 100644 --- a/packages/core/test/lib/integrations/extraerrordata.test.ts +++ b/packages/core/test/lib/integrations/extraerrordata.test.ts @@ -1,12 +1,11 @@ -import type { Event as SentryEvent, ExtendedError } from '../../../src/types-hoist'; - +import type { Event } from '../../../src/types-hoist/event'; +import type { ExtendedError } from '../../../src/types-hoist/error'; import { extraErrorDataIntegration } from '../../../src/integrations/extraerrordata'; - import { beforeEach, describe, expect, it } from 'vitest'; import { TestClient, getDefaultTestClientOptions } from '../../mocks/client'; const extraErrorData = extraErrorDataIntegration(); -let event: SentryEvent; +let event: Event; describe('ExtraErrorData()', () => { const testClient = new TestClient(getDefaultTestClientOptions({ maxValueLength: 250 })); @@ -25,7 +24,7 @@ describe('ExtraErrorData()', () => { originalException: error, }, testClient, - ) as SentryEvent; + ) as Event; expect(enhancedEvent.contexts).toEqual({ TypeError: { @@ -46,7 +45,7 @@ describe('ExtraErrorData()', () => { originalException: error, }, testClient, - ) as SentryEvent; + ) as Event; expect(enhancedEvent.contexts).toEqual({ TypeError: { @@ -66,7 +65,7 @@ describe('ExtraErrorData()', () => { originalException: error, }, testClient, - ) as SentryEvent; + ) as Event; expect(enhancedEvent.contexts).toEqual({ TypeError: { @@ -91,7 +90,7 @@ describe('ExtraErrorData()', () => { originalException: error, }, testClient, - ) as SentryEvent; + ) as Event; expect(enhancedEvent.contexts).toEqual({ TypeError: { @@ -119,7 +118,7 @@ describe('ExtraErrorData()', () => { originalException: error, }, testClient, - ) as SentryEvent; + ) as Event; expect(enhancedEvent.contexts).toEqual({ TypeError: { @@ -138,7 +137,7 @@ describe('ExtraErrorData()', () => { originalException: error, }, testClient, - ) as SentryEvent; + ) as Event; expect(enhancedEvent).toEqual(event); }); @@ -179,7 +178,7 @@ describe('ExtraErrorData()', () => { originalException: error, }, testClient, - ) as SentryEvent; + ) as Event; expect(enhancedEvent.contexts).toEqual({ TypeError: { @@ -206,7 +205,7 @@ describe('ExtraErrorData()', () => { originalException: error, }, testClient, - ) as SentryEvent; + ) as Event; expect(enhancedEvent.contexts).toEqual({ TypeError: { @@ -230,7 +229,7 @@ describe('ExtraErrorData()', () => { originalException: error, }, testClient, - ) as SentryEvent; + ) as Event; expect(enhancedEvent.contexts).toEqual({ TypeError: { @@ -258,7 +257,7 @@ describe('ExtraErrorData()', () => { originalException: error, }, testClient, - ) as SentryEvent; + ) as Event; expect(enhancedEvent.contexts).toEqual({ Error: { @@ -287,7 +286,7 @@ describe('ExtraErrorData()', () => { originalException: error, }, testClient, - ) as SentryEvent; + ) as Event; expect(enhancedEvent.contexts).not.toEqual({ Error: { diff --git a/packages/core/test/lib/integrations/metadata.test.ts b/packages/core/test/lib/integrations/metadata.test.ts index 5f685843a640..06af1258ec6e 100644 --- a/packages/core/test/lib/integrations/metadata.test.ts +++ b/packages/core/test/lib/integrations/metadata.test.ts @@ -1,4 +1,4 @@ -import type { Event } from '../../../src/types-hoist'; +import type { Event } from '../../../src/types-hoist/event'; import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest'; import { diff --git a/packages/core/test/lib/integrations/rewriteframes.test.ts b/packages/core/test/lib/integrations/rewriteframes.test.ts index 250f2bac4dc8..19784db1bd48 100644 --- a/packages/core/test/lib/integrations/rewriteframes.test.ts +++ b/packages/core/test/lib/integrations/rewriteframes.test.ts @@ -1,7 +1,7 @@ -import type { Event, StackFrame } from '../../../src/types-hoist'; - import { afterAll, beforeAll, beforeEach, describe, expect, it } from 'vitest'; import { generateIteratee, rewriteFramesIntegration } from '../../../src/integrations/rewriteframes'; +import type { Event } from '../../../src/types-hoist/event'; +import type { StackFrame } from '../../../src/types-hoist/stackframe'; let rewriteFrames: ReturnType; let exceptionEvent: Event; diff --git a/packages/core/test/lib/integrations/third-party-errors-filter.test.ts b/packages/core/test/lib/integrations/third-party-errors-filter.test.ts index dd5dab174fce..b9b705cc5cac 100644 --- a/packages/core/test/lib/integrations/third-party-errors-filter.test.ts +++ b/packages/core/test/lib/integrations/third-party-errors-filter.test.ts @@ -2,7 +2,7 @@ import { beforeEach, describe, expect, it } from 'vitest'; import type { Client } from '../../../src/client'; import { thirdPartyErrorFilterIntegration } from '../../../src/integrations/third-party-errors-filter'; import { addMetadataToStackFrames } from '../../../src/metadata'; -import type { Event } from '../../../src/types-hoist'; +import type { Event } from '../../../src/types-hoist/event'; import { nodeStackLineParser } from '../../../src/utils-hoist/node-stack-trace'; import { createStackParser } from '../../../src/utils-hoist/stacktrace'; import { GLOBAL_OBJ } from '../../../src/utils-hoist/worldwide'; diff --git a/packages/core/test/lib/integrations/zoderrrors.test.ts b/packages/core/test/lib/integrations/zoderrrors.test.ts index b29bb09845e8..68141d2b4fc9 100644 --- a/packages/core/test/lib/integrations/zoderrrors.test.ts +++ b/packages/core/test/lib/integrations/zoderrrors.test.ts @@ -1,13 +1,12 @@ -import { z } from 'zod'; -import type { Event, EventHint } from '../../../src/types-hoist'; - import { describe, expect, it, test } from 'vitest'; +import { z } from 'zod'; import { applyZodErrorsToEvent, flattenIssue, flattenIssuePath, formatIssueMessage, } from '../../../src/integrations/zoderrors'; +import type { Event, EventHint } from '../../../src/types-hoist/event'; // Simplified type definition interface ZodIssue { diff --git a/packages/core/test/lib/logs/envelope.test.ts b/packages/core/test/lib/logs/envelope.test.ts index b50ca60c9a1c..9ce44370500d 100644 --- a/packages/core/test/lib/logs/envelope.test.ts +++ b/packages/core/test/lib/logs/envelope.test.ts @@ -1,6 +1,8 @@ import { describe, expect, it, vi, beforeEach, afterEach } from 'vitest'; import { createOtelLogEnvelope, createOtelLogEnvelopeItem } from '../../../src/logs/envelope'; -import type { DsnComponents, SdkMetadata, SerializedOtelLog } from '../../../src/types-hoist'; +import type { DsnComponents } from '../../../src/types-hoist/dsn'; +import type { SdkMetadata } from '../../../src/types-hoist/sdkmetadata'; +import type { SerializedOtelLog } from '../../../src/types-hoist/log'; import * as utilsDsn from '../../../src/utils-hoist/dsn'; import * as utilsEnvelope from '../../../src/utils-hoist/envelope'; diff --git a/packages/core/test/lib/metadata.test.ts b/packages/core/test/lib/metadata.test.ts index 7e402bbee0b1..6c50d60f4cc4 100644 --- a/packages/core/test/lib/metadata.test.ts +++ b/packages/core/test/lib/metadata.test.ts @@ -1,5 +1,4 @@ -import type { Event } from '../../src/types-hoist'; - +import type { Event } from '../../src/types-hoist/event'; import { beforeEach, describe, expect, it } from 'vitest'; import { addMetadataToStackFrames, getMetadataForUrl, stripMetadataFromStackFrames } from '../../src/metadata'; import { nodeStackLineParser } from '../../src/utils-hoist/node-stack-trace'; diff --git a/packages/core/test/lib/prepareEvent.test.ts b/packages/core/test/lib/prepareEvent.test.ts index 2e7f5880413d..5d71bd38bad5 100644 --- a/packages/core/test/lib/prepareEvent.test.ts +++ b/packages/core/test/lib/prepareEvent.test.ts @@ -1,9 +1,12 @@ +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import type { Client, ScopeContext } from '../../src'; import { GLOBAL_OBJ, createStackParser, getGlobalScope, getIsolationScope } from '../../src'; -import type { Attachment, Breadcrumb, ClientOptions, Event, EventHint, EventProcessor } from '../../src/types-hoist'; - -import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { Scope } from '../../src/scope'; +import type { Event, EventHint } from '../../src/types-hoist/event'; +import type { EventProcessor } from '../../src/types-hoist/eventprocessor'; +import type { Attachment } from '../../src/types/types-hoist/attachment'; +import type { Breadcrumb } from '../../src/types/types-hoist/breadcrumb'; +import type { ClientOptions } from '../../src/types/types-hoist/options'; import { applyClientOptions, applyDebugIds, diff --git a/packages/core/test/lib/scope.test.ts b/packages/core/test/lib/scope.test.ts index 87dcf9315ba9..51e319fbb435 100644 --- a/packages/core/test/lib/scope.test.ts +++ b/packages/core/test/lib/scope.test.ts @@ -1,15 +1,16 @@ import { beforeEach, describe, expect, it, test, vi } from 'vitest'; -import type { Client } from '../../src'; +import type { Client } from '../../src/client'; +import { applyScopeDataToEvent } from '../../src/utils/applyScopeDataToEvent'; import { - applyScopeDataToEvent, getCurrentScope, getGlobalScope, getIsolationScope, withIsolationScope, withScope, -} from '../../src'; +} from '../../src/currentScopes'; import { Scope } from '../../src/scope'; -import type { Breadcrumb, Event } from '../../src/types-hoist'; +import type { Breadcrumb } from '../../src/types-hoist/breadcrumb'; +import type { Event } from '../../src/types-hoist/event'; import { TestClient, getDefaultTestClientOptions } from '../mocks/client'; import { clearGlobalScope } from './clear-global-scope'; diff --git a/packages/core/test/lib/sdk.test.ts b/packages/core/test/lib/sdk.test.ts index 03404ce911f6..658304fdc822 100644 --- a/packages/core/test/lib/sdk.test.ts +++ b/packages/core/test/lib/sdk.test.ts @@ -1,9 +1,11 @@ import { type Mock, beforeEach, describe, expect, it, test, vi } from 'vitest'; -import type { Client } from '../../src'; -import { captureCheckIn, getCurrentScope, setCurrentClient } from '../../src'; +import type { Client } from '../../src/client'; +import { captureCheckIn } from '../../src/exports'; +import { getCurrentScope } from '../../src/currentScopes'; +import { setCurrentClient } from '../../src/sdk'; import { installedIntegrations } from '../../src/integration'; import { initAndBind } from '../../src/sdk'; -import type { Integration } from '../../src/types-hoist'; +import type { Integration } from '../../src/types-hoist/integration'; import { TestClient, getDefaultTestClientOptions } from '../mocks/client'; // eslint-disable-next-line no-var diff --git a/packages/core/test/lib/server-runtime-client.test.ts b/packages/core/test/lib/server-runtime-client.test.ts index 4aaf77a06fb2..2e527ae6888d 100644 --- a/packages/core/test/lib/server-runtime-client.test.ts +++ b/packages/core/test/lib/server-runtime-client.test.ts @@ -1,10 +1,9 @@ -import type { Event, EventHint } from '../../src/types-hoist'; - import { describe, expect, it, test, vi } from 'vitest'; import { Scope, createTransport } from '../../src'; +import { _INTERNAL_captureLog, _INTERNAL_flushLogsBuffer } from '../../src/logs/exports'; import type { ServerRuntimeClientOptions } from '../../src/server-runtime-client'; import { ServerRuntimeClient } from '../../src/server-runtime-client'; -import { _INTERNAL_captureLog, _INTERNAL_flushLogsBuffer } from '../../src/logs/exports'; +import type { Event, EventHint } from '../../src/types-hoist/event'; const PUBLIC_DSN = 'https://username@domain/123'; diff --git a/packages/core/test/lib/session.test.ts b/packages/core/test/lib/session.test.ts index 4864ea4623a1..72d54dd841cb 100644 --- a/packages/core/test/lib/session.test.ts +++ b/packages/core/test/lib/session.test.ts @@ -1,4 +1,4 @@ -import type { SessionContext } from '../../src/types-hoist'; +import type { SessionContext } from '../../src/types-hoist/session'; import { describe, expect, it, test } from 'vitest'; import { closeSession, makeSession, updateSession } from '../../src/session'; diff --git a/packages/core/test/lib/tracing/dynamicSamplingContext.test.ts b/packages/core/test/lib/tracing/dynamicSamplingContext.test.ts index 2b7a030734bb..e4df2801284f 100644 --- a/packages/core/test/lib/tracing/dynamicSamplingContext.test.ts +++ b/packages/core/test/lib/tracing/dynamicSamplingContext.test.ts @@ -7,7 +7,8 @@ import { } from '../../../src'; import { SentrySpan, getDynamicSamplingContextFromSpan, startInactiveSpan } from '../../../src/tracing'; import { freezeDscOnSpan } from '../../../src/tracing/dynamicSamplingContext'; -import type { Span, SpanContextData, TransactionSource } from '../../../src/types-hoist'; +import type { Span, SpanContextData } from '../../../src/types-hoist/span'; +import type { TransactionSource } from '../../../src/types-hoist/transaction'; import { TestClient, getDefaultTestClientOptions } from '../../mocks/client'; describe('getDynamicSamplingContextFromSpan', () => { diff --git a/packages/core/test/lib/tracing/errors.test.ts b/packages/core/test/lib/tracing/errors.test.ts index 46717cae2459..44af29433b9f 100644 --- a/packages/core/test/lib/tracing/errors.test.ts +++ b/packages/core/test/lib/tracing/errors.test.ts @@ -1,8 +1,7 @@ -import { setCurrentClient, spanToJSON, startInactiveSpan, startSpan } from '../../../src'; -import type { HandlerDataError, HandlerDataUnhandledRejection } from '../../../src/types-hoist'; - import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { setCurrentClient, spanToJSON, startInactiveSpan, startSpan } from '../../../src'; import { _resetErrorsInstrumented, registerSpanErrorInstrumentation } from '../../../src/tracing/errors'; +import type { HandlerDataError, HandlerDataUnhandledRejection } from '../../../src/types-hoist/instrument'; import * as globalErrorModule from '../../../src/utils-hoist/instrument/globalError'; import * as globalUnhandledRejectionModule from '../../../src/utils-hoist/instrument/globalUnhandledRejection'; import { TestClient, getDefaultTestClientOptions } from '../../mocks/client'; diff --git a/packages/core/test/lib/tracing/idleSpan.test.ts b/packages/core/test/lib/tracing/idleSpan.test.ts index 35f9d59063fe..9cefebb76096 100644 --- a/packages/core/test/lib/tracing/idleSpan.test.ts +++ b/packages/core/test/lib/tracing/idleSpan.test.ts @@ -1,5 +1,3 @@ -import { TestClient, getDefaultTestClientOptions } from '../../mocks/client'; - import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON, @@ -18,7 +16,9 @@ import { startSpanManual, } from '../../../src'; import { TRACING_DEFAULTS, startIdleSpan } from '../../../src/tracing/idleSpan'; -import type { Event, Span } from '../../../src/types-hoist'; +import type { Event } from '../../../src/types-hoist/event'; +import type { Span } from '../../../src/types-hoist/span'; +import { TestClient, getDefaultTestClientOptions } from '../../mocks/client'; const dsn = 'https://123@sentry.io/42'; diff --git a/packages/core/test/lib/tracing/sentryNonRecordingSpan.test.ts b/packages/core/test/lib/tracing/sentryNonRecordingSpan.test.ts index 95a9591ed443..5ca07bcd271e 100644 --- a/packages/core/test/lib/tracing/sentryNonRecordingSpan.test.ts +++ b/packages/core/test/lib/tracing/sentryNonRecordingSpan.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest'; import { SPAN_STATUS_ERROR } from '../../../src/tracing'; import { SentryNonRecordingSpan } from '../../../src/tracing/sentryNonRecordingSpan'; -import type { Span } from '../../../src/types-hoist'; +import type { Span } from '../../../src/types-hoist/span'; import { TRACE_FLAG_NONE, spanIsSampled, spanToJSON } from '../../../src/utils/spanUtils'; describe('SentryNonRecordingSpan', () => { diff --git a/packages/core/test/lib/tracing/sentrySpan.test.ts b/packages/core/test/lib/tracing/sentrySpan.test.ts index 726f30790c5b..9f3819dc644f 100644 --- a/packages/core/test/lib/tracing/sentrySpan.test.ts +++ b/packages/core/test/lib/tracing/sentrySpan.test.ts @@ -1,6 +1,9 @@ import { describe, expect, it, test, vi } from 'vitest'; -import type { SpanJSON } from '../../../src'; -import { SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, getCurrentScope, setCurrentClient, timestampInSeconds } from '../../../src'; +import type { SpanJSON } from '../../../src/types-hoist/span'; +import { getCurrentScope } from '../../../src/currentScopes'; +import { setCurrentClient } from '../../../src/sdk'; +import { timestampInSeconds } from '../../../src/utils-hoist/time'; +import { SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from '../../../src/semanticAttributes'; import { SentrySpan } from '../../../src/tracing/sentrySpan'; import { SPAN_STATUS_ERROR } from '../../../src/tracing/spanstatus'; import { TRACE_FLAG_NONE, TRACE_FLAG_SAMPLED, spanToJSON } from '../../../src/utils/spanUtils'; diff --git a/packages/core/test/lib/tracing/trace.test.ts b/packages/core/test/lib/tracing/trace.test.ts index 81d1258517d3..bc241086468c 100644 --- a/packages/core/test/lib/tracing/trace.test.ts +++ b/packages/core/test/lib/tracing/trace.test.ts @@ -26,7 +26,9 @@ import { } from '../../../src/tracing'; import { SentryNonRecordingSpan } from '../../../src/tracing/sentryNonRecordingSpan'; import { startNewTrace } from '../../../src/tracing/trace'; -import type { Event, Span, StartSpanOptions } from '../../../src/types-hoist'; +import type { Event } from '../../../src/types-hoist/event'; +import type { Span } from '../../../src/types-hoist/span'; +import type { StartSpanOptions } from '../../../src/types-hoist/startSpanOptions'; import { _setSpanForScope } from '../../../src/utils/spanOnScope'; import { getActiveSpan, getRootSpan, getSpanDescendants, spanIsSampled } from '../../../src/utils/spanUtils'; import { TestClient, getDefaultTestClientOptions } from '../../mocks/client'; diff --git a/packages/core/test/lib/transports/base.test.ts b/packages/core/test/lib/transports/base.test.ts index 3d9ba19e0455..e751914cde35 100644 --- a/packages/core/test/lib/transports/base.test.ts +++ b/packages/core/test/lib/transports/base.test.ts @@ -1,4 +1,5 @@ -import type { AttachmentItem, EventEnvelope, EventItem, TransportMakeRequestResponse } from '../../../src/types-hoist'; +import type { AttachmentItem, EventEnvelope, EventItem } from '../../../src/types-hoist/envelope'; +import type { TransportMakeRequestResponse } from '../../../src/types-hoist/transport'; import { describe, expect, it, vi } from 'vitest'; import { createTransport } from '../../../src/transports/base'; diff --git a/packages/core/test/lib/transports/multiplexed.test.ts b/packages/core/test/lib/transports/multiplexed.test.ts index 99e150f8bc66..0395bb010232 100644 --- a/packages/core/test/lib/transports/multiplexed.test.ts +++ b/packages/core/test/lib/transports/multiplexed.test.ts @@ -1,12 +1,7 @@ -import type { - BaseTransportOptions, - ClientReport, - Envelope, - EventEnvelope, - EventItem, - TransactionEvent, - Transport, -} from '../../../src/types-hoist'; +import type { BaseTransportOptions, Transport } from '../../../src/types-hoist/transport'; +import type { ClientReport } from '../../../src/types-hoist/clientreport'; +import type { Envelope, EventEnvelope, EventItem } from '../../../src/types-hoist/envelope'; +import type { TransactionEvent } from '../../../src/types-hoist/event'; import { describe, expect, it, vi } from 'vitest'; import { diff --git a/packages/core/test/lib/transports/offline.test.ts b/packages/core/test/lib/transports/offline.test.ts index cf3b414c0d0e..c1d7918e3d2e 100644 --- a/packages/core/test/lib/transports/offline.test.ts +++ b/packages/core/test/lib/transports/offline.test.ts @@ -1,13 +1,7 @@ -import type { - ClientReport, - Envelope, - EventEnvelope, - EventItem, - InternalBaseTransportOptions, - ReplayEnvelope, - ReplayEvent, - TransportMakeRequestResponse, -} from '../../../src/types-hoist'; +import type { ClientReport } from '../../../src/types-hoist/clientreport'; +import type { Envelope, EventEnvelope, EventItem, ReplayEnvelope } from '../../../src/types-hoist/envelope'; +import type { ReplayEvent } from '../../../src/types-hoist/replay'; +import type { InternalBaseTransportOptions, TransportMakeRequestResponse } from '../../../src/types-hoist/transport'; import { describe, expect, it } from 'vitest'; import { diff --git a/packages/core/test/lib/utils/applyScopeDataToEvent.test.ts b/packages/core/test/lib/utils/applyScopeDataToEvent.test.ts index 5803ab1d3468..f85fa0f02617 100644 --- a/packages/core/test/lib/utils/applyScopeDataToEvent.test.ts +++ b/packages/core/test/lib/utils/applyScopeDataToEvent.test.ts @@ -1,7 +1,10 @@ import { describe, expect, it } from 'vitest'; import type { ScopeData } from '../../../src'; import { startInactiveSpan } from '../../../src'; -import type { Attachment, Breadcrumb, Event, EventProcessor, EventType } from '../../../src/types-hoist'; +import type { Attachment } from '../../../src/types-hoist/attachment'; +import type { Breadcrumb } from '../../../src/types-hoist/breadcrumb'; +import type { Event, EventType } from '../../../src/types-hoist/event'; +import type { EventProcessor } from '../../../src/types-hoist/eventprocessor'; import { applyScopeDataToEvent, mergeAndOverwriteScopeData, diff --git a/packages/core/test/lib/utils/parameterize.test.ts b/packages/core/test/lib/utils/parameterize.test.ts index e79e48e84afa..8d1c0d082431 100644 --- a/packages/core/test/lib/utils/parameterize.test.ts +++ b/packages/core/test/lib/utils/parameterize.test.ts @@ -1,6 +1,5 @@ -import type { ParameterizedString } from '../../../src/types-hoist'; - import { describe, expect, test } from 'vitest'; +import type { ParameterizedString } from '../../../src/types-hoist/parameterize'; import { parameterize } from '../../../src/utils/parameterize'; describe('parameterize()', () => { diff --git a/packages/core/test/lib/utils/spanUtils.test.ts b/packages/core/test/lib/utils/spanUtils.test.ts index 55d54c3d269e..46391ed75b6a 100644 --- a/packages/core/test/lib/utils/spanUtils.test.ts +++ b/packages/core/test/lib/utils/spanUtils.test.ts @@ -15,11 +15,13 @@ import { startSpan, timestampInSeconds, } from '../../../src'; -import type { Span, SpanAttributes, SpanStatus, SpanTimeInput } from '../../../src/types-hoist'; import type { SpanLink } from '../../../src/types-hoist/link'; +import type { Span, SpanAttributes, SpanTimeInput } from '../../../src/types-hoist/span'; +import type { SpanStatus } from '../../../src/types-hoist/spanStatus'; import type { OpenTelemetrySdkTraceBaseSpan } from '../../../src/utils/spanUtils'; -import { TRACE_FLAG_NONE, TRACE_FLAG_SAMPLED } from '../../../src/utils/spanUtils'; import { + TRACE_FLAG_NONE, + TRACE_FLAG_SAMPLED, getRootSpan, spanIsSampled, spanTimeInputToSeconds, diff --git a/packages/core/test/lib/utils/traceData.test.ts b/packages/core/test/lib/utils/traceData.test.ts index a7a0c218f069..f39b3b87851c 100644 --- a/packages/core/test/lib/utils/traceData.test.ts +++ b/packages/core/test/lib/utils/traceData.test.ts @@ -13,7 +13,7 @@ import { } from '../../../src/'; import { getAsyncContextStrategy } from '../../../src/asyncContext'; import { freezeDscOnSpan } from '../../../src/tracing/dynamicSamplingContext'; -import type { Span } from '../../../src/types-hoist'; +import type { Span } from '../../../src/types-hoist/span'; import type { TestClientOptions } from '../../mocks/client'; import { TestClient, getDefaultTestClientOptions } from '../../mocks/client'; diff --git a/packages/core/test/lib/utils/transactionEvent.test.ts b/packages/core/test/lib/utils/transactionEvent.test.ts index fb49067ff273..6fdf4e6cb274 100644 --- a/packages/core/test/lib/utils/transactionEvent.test.ts +++ b/packages/core/test/lib/utils/transactionEvent.test.ts @@ -1,7 +1,7 @@ import { describe, expect, it } from 'vitest'; import { SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME, SEMANTIC_ATTRIBUTE_PROFILE_ID } from '../../../src/semanticAttributes'; -import type { SpanJSON, TransactionEvent } from '../../../src/types-hoist'; -import {} from '../../../src/types-hoist'; +import type { TransactionEvent } from '../../../src/types-hoist/event'; +import type { SpanJSON } from '../../../src/types-hoist/span'; import { convertSpanJsonToTransactionEvent, convertTransactionEventToSpanJson, diff --git a/packages/core/test/mocks/client.ts b/packages/core/test/mocks/client.ts index eee8a1a6dfe4..811046972675 100644 --- a/packages/core/test/mocks/client.ts +++ b/packages/core/test/mocks/client.ts @@ -1,17 +1,13 @@ -import type { - ClientOptions, - Event, - EventHint, - Integration, - Outcome, - ParameterizedString, - Session, - SeverityLevel, -} from '../../src/types-hoist'; - import { Client } from '../../src/client'; import { initAndBind } from '../../src/sdk'; import { createTransport } from '../../src/transports/base'; +import type { Outcome } from '../../src/types-hoist/clientreport'; +import type { Event, EventHint } from '../../src/types-hoist/event'; +import type { Integration } from '../../src/types-hoist/integration'; +import type { ClientOptions } from '../../src/types-hoist/options'; +import type { ParameterizedString } from '../../src/types-hoist/parameterize'; +import type { Session } from '../../src/types-hoist/session'; +import type { SeverityLevel } from '../../src/types-hoist/severity'; import { resolvedSyncPromise } from '../../src/utils-hoist/syncpromise'; export function getDefaultTestClientOptions(options: Partial = {}): TestClientOptions { diff --git a/packages/core/test/mocks/integration.ts b/packages/core/test/mocks/integration.ts index d9c031ee927b..72a18dabe7b3 100644 --- a/packages/core/test/mocks/integration.ts +++ b/packages/core/test/mocks/integration.ts @@ -1,6 +1,8 @@ import type { Client } from '../../src'; import { getClient, getCurrentScope } from '../../src'; -import type { Event, EventProcessor, Integration } from '../../src/types-hoist'; +import type { Event } from '../../src/types-hoist/event'; +import type { EventProcessor } from '../../src/types-hoist/eventprocessor'; +import type { Integration } from '../../src/types-hoist/integration'; export class TestIntegration implements Integration { public static id: string = 'TestIntegration'; diff --git a/packages/core/test/mocks/transport.ts b/packages/core/test/mocks/transport.ts index a0670700076a..ba49025ce5d7 100644 --- a/packages/core/test/mocks/transport.ts +++ b/packages/core/test/mocks/transport.ts @@ -1,6 +1,5 @@ -import type { Transport } from '../../src/types-hoist'; - import { createTransport } from '../../src/transports/base'; +import type { Transport } from '../../src/types-hoist/transport'; import { SyncPromise } from '../../src/utils-hoist/syncpromise'; async function sleep(delay: number): Promise { diff --git a/packages/core/test/utils-hoist/aggregate-errors.test.ts b/packages/core/test/utils-hoist/aggregate-errors.test.ts index 2ec932cbd3a9..90c351ccc0fc 100644 --- a/packages/core/test/utils-hoist/aggregate-errors.test.ts +++ b/packages/core/test/utils-hoist/aggregate-errors.test.ts @@ -1,5 +1,8 @@ import { describe, expect, test } from 'vitest'; -import type { Event, EventHint, Exception, ExtendedError, StackParser } from '../../src/types-hoist'; +import type { Event, EventHint } from '../../src/types-hoist/event'; +import type { Exception } from '../../src/types-hoist/exception'; +import type { ExtendedError } from '../../src/types-hoist/error'; +import type { StackParser } from '../../src/types-hoist/stacktrace'; import { applyAggregateErrorsToEvent } from '../../src/utils-hoist/aggregate-errors'; import { createStackParser } from '../../src/utils-hoist/stacktrace'; diff --git a/packages/core/test/utils-hoist/clientreport.test.ts b/packages/core/test/utils-hoist/clientreport.test.ts index 371047b2ebad..e7f163502d66 100644 --- a/packages/core/test/utils-hoist/clientreport.test.ts +++ b/packages/core/test/utils-hoist/clientreport.test.ts @@ -1,4 +1,4 @@ -import type { ClientReport } from '../../src/types-hoist'; +import type { ClientReport } from '../../src/types-hoist/clientreport'; import { describe, expect, it } from 'vitest'; import { createClientReportEnvelope } from '../../src/utils-hoist/clientreport'; diff --git a/packages/core/test/utils-hoist/envelope.test.ts b/packages/core/test/utils-hoist/envelope.test.ts index 4a5264978e5f..62907f2730e7 100644 --- a/packages/core/test/utils-hoist/envelope.test.ts +++ b/packages/core/test/utils-hoist/envelope.test.ts @@ -1,4 +1,6 @@ -import type { Event, EventEnvelope, SpanAttributes } from '../../src/types-hoist'; +import type { Event } from '../../src/types-hoist/event'; +import type { EventEnvelope } from '../../src/types-hoist/envelope'; +import type { SpanAttributes } from '../../src/types-hoist/span'; import { SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME, @@ -111,12 +113,8 @@ describe('envelope', () => { before: () => { GLOBAL_OBJ.__SENTRY__ = {}; - getSentryCarrier(GLOBAL_OBJ).encodePolyfill = vi.fn((input: string) => - new TextEncoder().encode(input), - ); - getSentryCarrier(GLOBAL_OBJ).decodePolyfill = vi.fn((input: Uint8Array) => - new TextDecoder().decode(input), - ); + getSentryCarrier(GLOBAL_OBJ).encodePolyfill = vi.fn((input: string) => new TextEncoder().encode(input)); + getSentryCarrier(GLOBAL_OBJ).decodePolyfill = vi.fn((input: Uint8Array) => new TextDecoder().decode(input)); }, after: () => { expect(getSentryCarrier(GLOBAL_OBJ).encodePolyfill).toHaveBeenCalled(); diff --git a/packages/core/test/utils-hoist/misc.test.ts b/packages/core/test/utils-hoist/misc.test.ts index 0bcc317a017c..dbf32b0d2db9 100644 --- a/packages/core/test/utils-hoist/misc.test.ts +++ b/packages/core/test/utils-hoist/misc.test.ts @@ -1,4 +1,6 @@ -import type { Event, Mechanism, StackFrame } from '../../src/types-hoist'; +import type { Event } from '../../src/types-hoist/event'; +import type { Mechanism } from '../../src/types-hoist/mechanism'; +import type { StackFrame } from '../../src/types-hoist/stackframe'; import { describe, expect, it, test } from 'vitest'; import { diff --git a/packages/core/test/utils-hoist/object.test.ts b/packages/core/test/utils-hoist/object.test.ts index bda0a53e3a5c..a083b74e800d 100644 --- a/packages/core/test/utils-hoist/object.test.ts +++ b/packages/core/test/utils-hoist/object.test.ts @@ -2,7 +2,7 @@ * @vitest-environment jsdom */ -import type { WrappedFunction } from '../../src/types-hoist'; +import type { WrappedFunction } from '../../src/types-hoist/wrappedfunction'; import { describe, expect, it, test, vi } from 'vitest'; import {