Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(build): Turn on isolatedModules TS option #4896

Merged
merged 2 commits into from
Apr 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/angular/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
export type { ErrorHandlerOptions } from './errorhandler';

export * from '@sentry/browser';

export { init } from './sdk';
export { createErrorHandler, ErrorHandlerOptions, SentryErrorHandler } from './errorhandler';
export { createErrorHandler, SentryErrorHandler } from './errorhandler';
export {
getActiveTransaction,
// TODO `instrumentAngularRouting` is just an alias for `routingInstrumentation`; deprecate the latter at some point
Expand Down
10 changes: 6 additions & 4 deletions packages/browser/src/exports.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export {
export type {
Breadcrumb,
BreadcrumbHint,
Request,
Expand All @@ -17,6 +17,9 @@ export {
User,
} from '@sentry/types';

export type { BrowserOptions } from './client';
export type { ReportDialogOptions } from './helpers';

export {
addGlobalEventProcessor,
addBreadcrumb,
Expand All @@ -41,8 +44,7 @@ export {
withScope,
} from '@sentry/core';

export { BrowserClient, BrowserOptions } from './client';

export { BrowserClient } from './client';
export {
defaultStackParsers,
chromeStackParser,
Expand All @@ -51,6 +53,6 @@ export {
opera11StackParser,
winjsStackParser,
} from './stack-parsers';
export { injectReportDialog, ReportDialogOptions } from './helpers';
export { injectReportDialog } from './helpers';
export { defaultIntegrations, forceLoad, init, lastEventId, onLoad, showReportDialog, flush, close, wrap } from './sdk';
export { SDK_NAME } from './version';
22 changes: 12 additions & 10 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
export type { APIDetails } from './api';
export type { ClientClass } from './sdk';
export type {
BaseTransportOptions,
NewTransport,
TransportMakeRequestResponse,
TransportRequest,
TransportRequestExecutor,
} from './transports/base';

export {
addBreadcrumb,
captureException,
Expand All @@ -15,7 +25,6 @@ export {
} from '@sentry/minimal';
export { addGlobalEventProcessor, getCurrentHub, getHubFromCarrier, Hub, makeMain, Scope, Session } from '@sentry/hub';
export {
APIDetails,
getEnvelopeEndpointWithUrlEncodedAuth,
getStoreEndpointWithUrlEncodedAuth,
getRequestHeaders,
Expand All @@ -24,16 +33,9 @@ export {
} from './api';
export { BaseClient } from './baseclient';
export { eventToSentryRequest, sessionToSentryRequest } from './request';
export { initAndBind, ClientClass } from './sdk';
export { initAndBind } from './sdk';
export { NoopTransport } from './transports/noop';
export {
BaseTransportOptions,
createTransport,
NewTransport,
TransportMakeRequestResponse,
TransportRequest,
TransportRequestExecutor,
} from './transports/base';
export { createTransport } from './transports/base';
export { SDK_VERSION } from './version';

import * as Integrations from './integrations';
Expand Down
13 changes: 3 additions & 10 deletions packages/hub/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
export type { Carrier, Layer } from './hub';

export { addGlobalEventProcessor, Scope } from './scope';
export { Session } from './session';
export { SessionFlusher } from './sessionflusher';
export {
getCurrentHub,
getHubFromCarrier,
getMainCarrier,
Hub,
makeMain,
setHubOnCarrier,
Carrier,
Layer,
} from './hub';
export { getCurrentHub, getHubFromCarrier, getMainCarrier, Hub, makeMain, setHubOnCarrier } from './hub';
2 changes: 1 addition & 1 deletion packages/nextjs/src/index.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ function filterTransactions(event: Event): Event | null {
return event.type === 'transaction' && event.transaction === '/404' ? null : event;
}

export type { SentryWebpackPluginOptions } from './config/types';
export { withSentryConfig } from './config';
export { SentryWebpackPluginOptions } from './config/types';
export { withSentry } from './utils/withSentry';

// Wrap various server methods to enable error monitoring and tracing. (Note: This only happens for non-Vercel
Expand Down
5 changes: 3 additions & 2 deletions packages/node/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export {
export type {
Breadcrumb,
BreadcrumbHint,
Request,
Expand All @@ -17,6 +17,8 @@ export {
User,
} from '@sentry/types';

export type { NodeOptions } from './types';

export {
addGlobalEventProcessor,
addBreadcrumb,
Expand All @@ -41,7 +43,6 @@ export {
withScope,
} from '@sentry/core';

export { NodeOptions } from './types';
export { NodeClient } from './client';
export { defaultIntegrations, init, lastEventId, flush, close, getSentryRelease } from './sdk';
export { deepReadDirSync } from './utils';
Expand Down
4 changes: 3 additions & 1 deletion packages/node/src/transports/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export type { NodeTransportOptions } from './new';

export { BaseTransport } from './base';
export { HTTPTransport } from './http';
export { HTTPSTransport } from './https';
export { makeNodeTransport, NodeTransportOptions } from './new';
export { makeNodeTransport } from './new';
2 changes: 1 addition & 1 deletion packages/serverless/src/gcpfunction/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ export function configureScopeWithContext(scope: Scope, context: Context): void
scope.setContext('gcp.function.context', { ...context } as SentryContext);
}

export { Request, Response };
export type { Request, Response };
8 changes: 3 additions & 5 deletions packages/tracing/src/browser/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
export type { RequestInstrumentationOptions } from './request';

export { BrowserTracing } from './browsertracing';
export {
instrumentOutgoingRequests,
RequestInstrumentationOptions,
defaultRequestInstrumentationOptions,
} from './request';
export { instrumentOutgoingRequests, defaultRequestInstrumentationOptions } from './request';
7 changes: 4 additions & 3 deletions packages/tracing/src/index.bundle.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export {
export type {
Breadcrumb,
Request,
SdkInfo,
Expand All @@ -15,6 +15,8 @@ export {
User,
} from '@sentry/types';

export type { BrowserOptions, ReportDialogOptions } from '@sentry/browser';

export {
addGlobalEventProcessor,
addBreadcrumb,
Expand All @@ -37,8 +39,7 @@ export {
withScope,
} from '@sentry/browser';

export { BrowserOptions } from '@sentry/browser';
export { BrowserClient, ReportDialogOptions } from '@sentry/browser';
export { BrowserClient } from '@sentry/browser';
export {
defaultIntegrations,
forceLoad,
Expand Down
11 changes: 5 additions & 6 deletions packages/tracing/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { addExtensionMethods } from './hubextensions';
import * as Integrations from './integrations';

export type { RequestInstrumentationOptions } from './browser';
export type { SpanStatusType } from './span';

export { Integrations };

// This is already exported as part of `Integrations` above (and for the moment will remain so for
Expand All @@ -21,15 +24,11 @@ export { Integrations };
// For an example of of the new usage of BrowserTracing, see @sentry/nextjs index.client.ts
export { BrowserTracing } from './browser';

export { Span, SpanStatusType, spanStatusfromHttpCode } from './span';
export { Span, spanStatusfromHttpCode } from './span';
// eslint-disable-next-line deprecation/deprecation
export { SpanStatus } from './spanstatus';
export { Transaction } from './transaction';
export {
instrumentOutgoingRequests,
RequestInstrumentationOptions,
defaultRequestInstrumentationOptions,
} from './browser';
export { instrumentOutgoingRequests, defaultRequestInstrumentationOptions } from './browser';
export { IdleTransaction } from './idletransaction';
export { startIdleTransaction } from './hubextensions';

Expand Down
70 changes: 35 additions & 35 deletions packages/types/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export { Breadcrumb, BreadcrumbHint } from './breadcrumb';
export { Client } from './client';
export { ClientReport } from './clientreport';
export { Context, Contexts } from './context';
export { DsnComponents, DsnLike, DsnProtocol } from './dsn';
export { DebugImage, DebugImageType, DebugMeta } from './debugMeta';
export {
export type { Breadcrumb, BreadcrumbHint } from './breadcrumb';
export type { Client } from './client';
export type { ClientReport } from './clientreport';
export type { Context, Contexts } from './context';
export type { DsnComponents, DsnLike, DsnProtocol } from './dsn';
export type { DebugImage, DebugImageType, DebugMeta } from './debugMeta';
export type {
AttachmentItem,
BaseEnvelopeHeaders,
BaseEnvelopeItemHeaders,
Expand All @@ -17,25 +17,25 @@ export {
SessionItem,
UserFeedbackItem,
} from './envelope';
export { ExtendedError } from './error';
export { Event, EventHint } from './event';
export { EventStatus } from './eventstatus';
export { EventProcessor } from './eventprocessor';
export { Exception } from './exception';
export { Extra, Extras } from './extra';
export { Hub } from './hub';
export { Integration, IntegrationClass } from './integration';
export { Mechanism } from './mechanism';
export { ExtractedNodeRequestData, Primitive, WorkerLocation } from './misc';
export { Options } from './options';
export { Package } from './package';
export { QueryParams, Request, SentryRequest, SentryRequestType } from './request';
export { Response } from './response';
export { Runtime } from './runtime';
export { CaptureContext, Scope, ScopeContext } from './scope';
export { SdkInfo } from './sdkinfo';
export { SdkMetadata } from './sdkmetadata';
export {
export type { ExtendedError } from './error';
export type { Event, EventHint } from './event';
export type { EventStatus } from './eventstatus';
export type { EventProcessor } from './eventprocessor';
export type { Exception } from './exception';
export type { Extra, Extras } from './extra';
export type { Hub } from './hub';
export type { Integration, IntegrationClass } from './integration';
export type { Mechanism } from './mechanism';
export type { ExtractedNodeRequestData, Primitive, WorkerLocation } from './misc';
export type { Options } from './options';
export type { Package } from './package';
export type { QueryParams, Request, SentryRequest, SentryRequestType } from './request';
export type { Response } from './response';
export type { Runtime } from './runtime';
export type { CaptureContext, Scope, ScopeContext } from './scope';
export type { SdkInfo } from './sdkinfo';
export type { SdkMetadata } from './sdkmetadata';
export type {
SessionAggregates,
AggregationCounts,
Session,
Expand All @@ -47,11 +47,11 @@ export {
} from './session';

// eslint-disable-next-line deprecation/deprecation
export { Severity, SeverityLevel } from './severity';
export { Span, SpanContext } from './span';
export { StackFrame } from './stackframe';
export { Stacktrace, StackParser, StackLineParser, StackLineParserFn } from './stacktrace';
export {
export type { Severity, SeverityLevel } from './severity';
export type { Span, SpanContext } from './span';
export type { StackFrame } from './stackframe';
export type { Stacktrace, StackParser, StackLineParser, StackLineParserFn } from './stacktrace';
export type {
CustomSamplingContext,
Measurements,
SamplingContext,
Expand All @@ -61,7 +61,7 @@ export {
TransactionMetadata,
TransactionSamplingMethod,
} from './transaction';
export { Thread } from './thread';
export { Outcome, Transport, TransportOptions, TransportClass } from './transport';
export { User, UserFeedback } from './user';
export { WrappedFunction } from './wrappedfunction';
export type { Thread } from './thread';
export type { Outcome, Transport, TransportOptions, TransportClass } from './transport';
export type { User, UserFeedback } from './user';
export type { WrappedFunction } from './wrappedfunction';
1 change: 1 addition & 0 deletions packages/typescript/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"downlevelIteration": true,
"importHelpers": true,
"inlineSources": true,
"isolatedModules": true,
"lib": ["es6", "dom"],
// "module": "commonjs", // implied by "target" : "es5"
"moduleResolution": "node",
Expand Down
6 changes: 3 additions & 3 deletions packages/vue/src/index.bundle.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export {
export type {
Breadcrumb,
Request,
SdkInfo,
Expand All @@ -13,9 +13,10 @@ export {
User,
} from '@sentry/types';

export type { BrowserOptions, ReportDialogOptions } from '@sentry/browser';

export {
BrowserClient,
BrowserOptions,
defaultIntegrations,
forceLoad,
lastEventId,
Expand All @@ -24,7 +25,6 @@ export {
flush,
close,
wrap,
ReportDialogOptions,
addGlobalEventProcessor,
addBreadcrumb,
captureException,
Expand Down