Skip to content

Commit d1ddb53

Browse files
authored
ref(core): Remove internal types-hoist re-export (#16116)
We can get rid of this barrel file.
1 parent 2e5f6b6 commit d1ddb53

File tree

129 files changed

+552
-537
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+552
-537
lines changed

packages/core/src/api.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { ReportDialogOptions } from './report-dialog';
2-
import type { DsnComponents, DsnLike, SdkInfo } from './types-hoist';
2+
import type { DsnComponents, DsnLike } from './types-hoist/dsn';
3+
import type { SdkInfo } from './types-hoist/sdkinfo';
34
import { dsnToString, makeDsn } from './utils-hoist/dsn';
45

56
const SENTRY_API_VERSION = '7';

packages/core/src/breadcrumbs.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getClient, getIsolationScope } from './currentScopes';
2-
import type { Breadcrumb, BreadcrumbHint } from './types-hoist';
2+
import type { Breadcrumb, BreadcrumbHint } from './types-hoist/breadcrumb';
33
import { consoleSandbox } from './utils-hoist/logger';
44
import { dateTimestampInSeconds } from './utils-hoist/time';
55

packages/core/src/checkin.ts

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
import type {
2-
CheckInEnvelope,
3-
CheckInItem,
4-
DsnComponents,
5-
DynamicSamplingContext,
6-
SdkMetadata,
7-
SerializedCheckIn,
8-
} from './types-hoist';
1+
import type { CheckInEnvelope, CheckInItem, DynamicSamplingContext } from './types-hoist/envelope';
2+
import type { DsnComponents } from './types-hoist/dsn';
3+
import type { SdkMetadata } from './types-hoist/sdkmetadata';
4+
import type { SerializedCheckIn } from './types-hoist/checkin';
95
import { dsnToString } from './utils-hoist/dsn';
106
import { createEnvelope } from './utils-hoist/envelope';
117

packages/core/src/client.ts

+20-36
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,24 @@
11
/* eslint-disable max-lines */
2-
import type {
3-
Breadcrumb,
4-
BreadcrumbHint,
5-
CheckIn,
6-
ClientOptions,
7-
DataCategory,
8-
DsnComponents,
9-
DynamicSamplingContext,
10-
Envelope,
11-
ErrorEvent,
12-
Event,
13-
EventDropReason,
14-
EventHint,
15-
EventProcessor,
16-
FeedbackEvent,
17-
FetchBreadcrumbHint,
18-
Integration,
19-
Log,
20-
MonitorConfig,
21-
Outcome,
22-
ParameterizedString,
23-
SdkMetadata,
24-
Session,
25-
SessionAggregates,
26-
SeverityLevel,
27-
Span,
28-
SpanAttributes,
29-
SpanContextData,
30-
SpanJSON,
31-
StartSpanOptions,
32-
TraceContext,
33-
TransactionEvent,
34-
Transport,
35-
TransportMakeRequestResponse,
36-
XhrBreadcrumbHint,
37-
} from './types-hoist';
2+
import type { Breadcrumb, BreadcrumbHint, FetchBreadcrumbHint, XhrBreadcrumbHint } from './types-hoist/breadcrumb';
3+
import type { CheckIn, MonitorConfig } from './types-hoist/checkin';
4+
import type { ClientOptions } from './types-hoist/options';
5+
import type { DataCategory } from './types-hoist/datacategory';
6+
import type { EventDropReason, Outcome } from './types-hoist/clientreport';
7+
import type { DsnComponents } from './types-hoist/dsn';
8+
import type { DynamicSamplingContext, Envelope } from './types-hoist/envelope';
9+
import type { ErrorEvent, Event, EventHint, TransactionEvent } from './types-hoist/event';
10+
import type { EventProcessor } from './types-hoist/eventprocessor';
11+
import type { FeedbackEvent } from './types-hoist/feedback';
12+
import type { Integration } from './types-hoist/integration';
13+
import type { Log } from './types-hoist/log';
14+
import type { ParameterizedString } from './types-hoist/parameterize';
15+
import type { SdkMetadata } from './types-hoist/sdkmetadata';
16+
import type { Session, SessionAggregates } from './types-hoist/session';
17+
import type { SeverityLevel } from './types-hoist/severity';
18+
import type { Span, SpanAttributes, SpanContextData, SpanJSON } from './types-hoist/span';
19+
import type { StartSpanOptions } from './types-hoist/startSpanOptions';
20+
import type { TraceContext } from './types-hoist/context';
21+
import type { Transport, TransportMakeRequestResponse } from './types-hoist/transport';
3822

3923
import { getEnvelopeEndpointWithUrlEncodedAuth } from './api';
4024
import { DEFAULT_ENVIRONMENT } from './constants';

packages/core/src/currentScopes.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { getAsyncContextStrategy } from './asyncContext';
22
import { getGlobalSingleton, getMainCarrier } from './carrier';
33
import type { Client } from './client';
44
import { Scope } from './scope';
5-
import type { TraceContext } from './types-hoist';
5+
import type { TraceContext } from './types-hoist/context';
66
import { generateSpanId } from './utils-hoist/propagationContext';
77

88
/**

packages/core/src/envelope.ts

+9-10
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
import type { Client } from './client';
22
import { getDynamicSamplingContextFromSpan } from './tracing/dynamicSamplingContext';
33
import type { SentrySpan } from './tracing/sentrySpan';
4+
import type { DsnComponents } from './types-hoist/dsn';
45
import type {
5-
DsnComponents,
66
DynamicSamplingContext,
7-
Event,
87
EventEnvelope,
98
EventItem,
10-
LegacyCSPReport,
9+
SpanEnvelope,
10+
SpanItem,
1111
RawSecurityEnvelope,
1212
RawSecurityItem,
13-
SdkInfo,
14-
SdkMetadata,
15-
Session,
16-
SessionAggregates,
1713
SessionEnvelope,
1814
SessionItem,
19-
SpanEnvelope,
20-
SpanItem,
21-
} from './types-hoist';
15+
} from './types-hoist/envelope';
16+
import type { Event } from './types-hoist/event';
17+
import type { LegacyCSPReport } from './types-hoist/csp';
18+
import type { SdkInfo } from './types-hoist/sdkinfo';
19+
import type { SdkMetadata } from './types-hoist/sdkmetadata';
20+
import type { Session, SessionAggregates } from './types-hoist/session';
2221
import { dsnToString } from './utils-hoist/dsn';
2322
import {
2423
createEnvelope,

packages/core/src/eventProcessors.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { DEBUG_BUILD } from './debug-build';
2-
import type { Event, EventHint, EventProcessor } from './types-hoist';
2+
import type { Event } from './types-hoist/event';
3+
import type { EventHint } from './types-hoist/event';
4+
import type { EventProcessor } from './types-hoist/eventprocessor';
35
import { isThenable } from './utils-hoist/is';
46
import { logger } from './utils-hoist/logger';
57
import { SyncPromise } from './utils-hoist/syncpromise';

packages/core/src/exports.ts

+8-15
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,14 @@ import { getClient, getCurrentScope, getIsolationScope, withIsolationScope } fro
22
import { DEBUG_BUILD } from './debug-build';
33
import type { CaptureContext } from './scope';
44
import { closeSession, makeSession, updateSession } from './session';
5-
import type {
6-
CheckIn,
7-
Event,
8-
EventHint,
9-
EventProcessor,
10-
Extra,
11-
Extras,
12-
FinishedCheckIn,
13-
MonitorConfig,
14-
Primitive,
15-
Session,
16-
SessionContext,
17-
SeverityLevel,
18-
User,
19-
} from './types-hoist';
5+
import type { CheckIn, FinishedCheckIn, MonitorConfig } from './types-hoist/checkin';
6+
import type { Event, EventHint } from './types-hoist/event';
7+
import type { EventProcessor } from './types-hoist/eventprocessor';
8+
import type { Extra, Extras } from './types-hoist/extra';
9+
import type { Primitive } from './types-hoist/misc';
10+
import type { Session, SessionContext } from './types-hoist/session';
11+
import type { SeverityLevel } from './types-hoist/severity';
12+
import type { User } from './types-hoist/user';
2013
import { isThenable } from './utils-hoist/is';
2114
import { logger } from './utils-hoist/logger';
2215
import { uuid4 } from './utils-hoist/misc';

packages/core/src/feedback.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { getClient, getCurrentScope } from './currentScopes';
2-
import type { EventHint, FeedbackEvent, SendFeedbackParams } from './types-hoist';
2+
import type { EventHint } from './types-hoist/event';
3+
import type { FeedbackEvent, SendFeedbackParams } from './types-hoist/feedback';
34

45
/**
56
* Send user feedback to Sentry.

packages/core/src/fetch.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ import { getClient } from './currentScopes';
22
import { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from './semanticAttributes';
33
import { SPAN_STATUS_ERROR, setHttpStatus, startInactiveSpan } from './tracing';
44
import { SentryNonRecordingSpan } from './tracing/sentryNonRecordingSpan';
5-
import type { FetchBreadcrumbHint, HandlerDataFetch, Span, SpanAttributes, SpanOrigin } from './types-hoist';
5+
import type { FetchBreadcrumbHint } from './types-hoist/breadcrumb';
6+
import type { HandlerDataFetch } from './types-hoist/instrument';
7+
import type { Span, SpanAttributes, SpanOrigin } from './types-hoist/span';
68
import { SENTRY_BAGGAGE_KEY_PREFIX } from './utils-hoist/baggage';
79
import { isInstanceOf, isRequest } from './utils-hoist/is';
810
import { getSanitizedUrlStringFromUrlObject, isURLObjectRelative, parseStringToURLObject } from './utils-hoist/url';

packages/core/src/index.ts

+174-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-disable max-lines */
2+
13
export type { ClientClass as SentryCoreCurrentScopes } from './sdk';
24
export type { AsyncContextStrategy } from './asyncContext/types';
35
export type { Carrier } from './carrier';
@@ -120,9 +122,6 @@ export type { ReportDialogOptions } from './report-dialog';
120122
export { _INTERNAL_captureLog, _INTERNAL_flushLogsBuffer } from './logs/exports';
121123
export { consoleLoggingIntegration } from './logs/console-integration';
122124

123-
// TODO: Make this structure pretty again and don't do "export *"
124-
export * from './types-hoist/index';
125-
126125
export type { FeatureFlag } from './featureFlags';
127126

128127
export { applyAggregateErrorsToEvent } from './utils-hoist/aggregate-errors';
@@ -272,3 +271,175 @@ export { vercelWaitUntil } from './utils-hoist/vercelWaitUntil';
272271
export { SDK_VERSION } from './utils-hoist/version';
273272
export { getDebugImagesForResources, getFilenameToDebugIdMap } from './utils-hoist/debug-ids';
274273
export { escapeStringForRegex } from './utils-hoist/vendor/escapeStringForRegex';
274+
275+
export type { Attachment } from './types-hoist/attachment';
276+
export type {
277+
Breadcrumb,
278+
BreadcrumbHint,
279+
FetchBreadcrumbData,
280+
XhrBreadcrumbData,
281+
FetchBreadcrumbHint,
282+
XhrBreadcrumbHint,
283+
} from './types-hoist/breadcrumb';
284+
export type { ClientReport, Outcome, EventDropReason } from './types-hoist/clientreport';
285+
export type {
286+
Context,
287+
Contexts,
288+
DeviceContext,
289+
OsContext,
290+
AppContext,
291+
CultureContext,
292+
TraceContext,
293+
CloudResourceContext,
294+
MissingInstrumentationContext,
295+
} from './types-hoist/context';
296+
export type { DataCategory } from './types-hoist/datacategory';
297+
export type { DsnComponents, DsnLike, DsnProtocol } from './types-hoist/dsn';
298+
export type { DebugImage, DebugMeta } from './types-hoist/debugMeta';
299+
export type {
300+
AttachmentItem,
301+
BaseEnvelopeHeaders,
302+
BaseEnvelopeItemHeaders,
303+
ClientReportEnvelope,
304+
ClientReportItem,
305+
DynamicSamplingContext,
306+
Envelope,
307+
EnvelopeItemType,
308+
EnvelopeItem,
309+
EventEnvelope,
310+
EventEnvelopeHeaders,
311+
EventItem,
312+
ReplayEnvelope,
313+
FeedbackItem,
314+
SessionEnvelope,
315+
SessionItem,
316+
UserFeedbackItem,
317+
CheckInItem,
318+
CheckInEnvelope,
319+
RawSecurityEnvelope,
320+
RawSecurityItem,
321+
ProfileItem,
322+
ProfileChunkEnvelope,
323+
ProfileChunkItem,
324+
SpanEnvelope,
325+
SpanItem,
326+
OtelLogEnvelope,
327+
OtelLogItem,
328+
} from './types-hoist/envelope';
329+
export type { ExtendedError } from './types-hoist/error';
330+
export type { Event, EventHint, EventType, ErrorEvent, TransactionEvent } from './types-hoist/event';
331+
export type { EventProcessor } from './types-hoist/eventprocessor';
332+
export type { Exception } from './types-hoist/exception';
333+
export type { Extra, Extras } from './types-hoist/extra';
334+
export type { Integration, IntegrationFn } from './types-hoist/integration';
335+
export type { Mechanism } from './types-hoist/mechanism';
336+
export type { ExtractedNodeRequestData, HttpHeaderValue, Primitive, WorkerLocation } from './types-hoist/misc';
337+
export type { ClientOptions, Options } from './types-hoist/options';
338+
export type { Package } from './types-hoist/package';
339+
export type { PolymorphicEvent, PolymorphicRequest } from './types-hoist/polymorphics';
340+
export type {
341+
ThreadId,
342+
FrameId,
343+
StackId,
344+
ThreadCpuSample,
345+
ThreadCpuStack,
346+
ThreadCpuFrame,
347+
ThreadCpuProfile,
348+
ContinuousThreadCpuProfile,
349+
Profile,
350+
ProfileChunk,
351+
} from './types-hoist/profiling';
352+
export type { ReplayEvent, ReplayRecordingData, ReplayRecordingMode } from './types-hoist/replay';
353+
export type {
354+
FeedbackEvent,
355+
FeedbackFormData,
356+
FeedbackInternalOptions,
357+
FeedbackModalIntegration,
358+
FeedbackScreenshotIntegration,
359+
SendFeedback,
360+
SendFeedbackParams,
361+
UserFeedback,
362+
} from './types-hoist/feedback';
363+
export type { QueryParams, RequestEventData, SanitizedRequestData } from './types-hoist/request';
364+
export type { Runtime } from './types-hoist/runtime';
365+
export type { SdkInfo } from './types-hoist/sdkinfo';
366+
export type { SdkMetadata } from './types-hoist/sdkmetadata';
367+
export type {
368+
SessionAggregates,
369+
AggregationCounts,
370+
Session,
371+
SessionContext,
372+
SessionStatus,
373+
SerializedSession,
374+
} from './types-hoist/session';
375+
export type { SeverityLevel } from './types-hoist/severity';
376+
export type {
377+
Span,
378+
SentrySpanArguments,
379+
SpanOrigin,
380+
SpanAttributeValue,
381+
SpanAttributes,
382+
SpanTimeInput,
383+
SpanJSON,
384+
SpanContextData,
385+
TraceFlag,
386+
} from './types-hoist/span';
387+
export type { SpanStatus } from './types-hoist/spanStatus';
388+
export type {
389+
Log,
390+
LogSeverityLevel,
391+
SerializedOtelLog,
392+
SerializedLogAttribute,
393+
SerializedLogAttributeValueType,
394+
} from './types-hoist/log';
395+
export type { TimedEvent } from './types-hoist/timedEvent';
396+
export type { StackFrame } from './types-hoist/stackframe';
397+
export type { Stacktrace, StackParser, StackLineParser, StackLineParserFn } from './types-hoist/stacktrace';
398+
export type { PropagationContext, TracePropagationTargets, SerializedTraceData } from './types-hoist/tracing';
399+
export type { StartSpanOptions } from './types-hoist/startSpanOptions';
400+
export type { TraceparentData, TransactionSource } from './types-hoist/transaction';
401+
export type { CustomSamplingContext, SamplingContext } from './types-hoist/samplingcontext';
402+
export type {
403+
DurationUnit,
404+
InformationUnit,
405+
FractionUnit,
406+
MeasurementUnit,
407+
NoneUnit,
408+
Measurements,
409+
} from './types-hoist/measurement';
410+
export type { Thread } from './types-hoist/thread';
411+
export type {
412+
Transport,
413+
TransportRequest,
414+
TransportMakeRequestResponse,
415+
InternalBaseTransportOptions,
416+
BaseTransportOptions,
417+
TransportRequestExecutor,
418+
} from './types-hoist/transport';
419+
export type { User } from './types-hoist/user';
420+
export type { WebFetchHeaders, WebFetchRequest } from './types-hoist/webfetchapi';
421+
export type { WrappedFunction } from './types-hoist/wrappedfunction';
422+
export type {
423+
HandlerDataFetch,
424+
HandlerDataXhr,
425+
HandlerDataDom,
426+
HandlerDataConsole,
427+
HandlerDataHistory,
428+
HandlerDataError,
429+
HandlerDataUnhandledRejection,
430+
ConsoleLevel,
431+
SentryXhrData,
432+
SentryWrappedXMLHttpRequest,
433+
} from './types-hoist/instrument';
434+
export type { BrowserClientReplayOptions, BrowserClientProfilingOptions } from './types-hoist/browseroptions';
435+
export type {
436+
CheckIn,
437+
MonitorConfig,
438+
FinishedCheckIn,
439+
InProgressCheckIn,
440+
SerializedCheckIn,
441+
} from './types-hoist/checkin';
442+
export type { ParameterizedString } from './types-hoist/parameterize';
443+
export type { ContinuousProfiler, ProfilingIntegration, Profiler } from './types-hoist/profiling';
444+
export type { ViewHierarchyData, ViewHierarchyWindow } from './types-hoist/view-hierarchy';
445+
export type { LegacyCSPReport } from './types-hoist/csp';

packages/core/src/integration.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import type { Client } from './client';
22
import { getClient } from './currentScopes';
33
import { DEBUG_BUILD } from './debug-build';
4-
import type { Event, EventHint, Integration, IntegrationFn, Options } from './types-hoist';
4+
import type { Event, EventHint } from './types-hoist/event';
5+
import type { Integration, IntegrationFn } from './types-hoist/integration';
6+
import type { Options } from './types-hoist/options';
57
import { logger } from './utils-hoist/logger';
68

79
export const installedIntegrations: string[] = [];

0 commit comments

Comments
 (0)