Skip to content

Commit ceb003c

Browse files
authored
ref(core): Remove utils-hoist folder (#16639)
This was a leftover from migrating of the `@sentry/utils` package to core. This PR merges the former utils together into the `core/src/utils` directory, which should make this a bit easier to follow/find.
1 parent a34ad66 commit ceb003c

File tree

151 files changed

+320
-334
lines changed

Some content is hidden

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

151 files changed

+320
-334
lines changed

packages/core/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = {
22
extends: ['../../.eslintrc.js'],
3-
ignorePatterns: ['rollup.npm.config.mjs', 'test/utils-hoist/buildPolyfills/originals.js'],
3+
ignorePatterns: ['rollup.npm.config.mjs'],
44
};

packages/core/src/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { ReportDialogOptions } from './report-dialog';
22
import type { DsnComponents, DsnLike } from './types-hoist/dsn';
33
import type { SdkInfo } from './types-hoist/sdkinfo';
4-
import { dsnToString, makeDsn } from './utils-hoist/dsn';
4+
import { dsnToString, makeDsn } from './utils/dsn';
55

66
const SENTRY_API_VERSION = '7';
77

packages/core/src/asyncContext/stackStrategy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Client } from '../client';
22
import { getDefaultCurrentScope, getDefaultIsolationScope } from '../defaultScopes';
33
import { Scope } from '../scope';
4-
import { isThenable } from '../utils-hoist/is';
4+
import { isThenable } from '../utils/is';
55
import { getMainCarrier, getSentryCarrier } from './../carrier';
66
import type { AsyncContextStrategy } from './types';
77

packages/core/src/breadcrumbs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { getClient, getIsolationScope } from './currentScopes';
22
import type { Breadcrumb, BreadcrumbHint } from './types-hoist/breadcrumb';
3-
import { consoleSandbox } from './utils-hoist/logger';
4-
import { dateTimestampInSeconds } from './utils-hoist/time';
3+
import { consoleSandbox } from './utils/logger';
4+
import { dateTimestampInSeconds } from './utils/time';
55

66
/**
77
* Default maximum number of breadcrumbs added to an event. Can be overwritten

packages/core/src/carrier.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import type { AsyncContextStack } from './asyncContext/stackStrategy';
22
import type { AsyncContextStrategy } from './asyncContext/types';
33
import type { Scope } from './scope';
4-
import type { Logger } from './utils-hoist/logger';
5-
import { SDK_VERSION } from './utils-hoist/version';
6-
import { GLOBAL_OBJ } from './utils-hoist/worldwide';
4+
import type { Logger } from './utils/logger';
5+
import { SDK_VERSION } from './utils/version';
6+
import { GLOBAL_OBJ } from './utils/worldwide';
77

88
/**
99
* An object that contains globally accessible properties and maintains a scope stack.

packages/core/src/checkin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import type { SerializedCheckIn } from './types-hoist/checkin';
22
import type { DsnComponents } from './types-hoist/dsn';
33
import type { CheckInEnvelope, CheckInItem, DynamicSamplingContext } from './types-hoist/envelope';
44
import type { SdkMetadata } from './types-hoist/sdkmetadata';
5-
import { dsnToString } from './utils-hoist/dsn';
6-
import { createEnvelope } from './utils-hoist/envelope';
5+
import { dsnToString } from './utils/dsn';
6+
import { createEnvelope } from './utils/envelope';
77

88
/**
99
* Create envelope from check in item.

packages/core/src/client.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,19 @@ import type { SeverityLevel } from './types-hoist/severity';
3232
import type { Span, SpanAttributes, SpanContextData, SpanJSON } from './types-hoist/span';
3333
import type { StartSpanOptions } from './types-hoist/startSpanOptions';
3434
import type { Transport, TransportMakeRequestResponse } from './types-hoist/transport';
35+
import { createClientReportEnvelope } from './utils/clientreport';
36+
import { dsnToString, makeDsn } from './utils/dsn';
37+
import { addItemToEnvelope, createAttachmentEnvelopeItem } from './utils/envelope';
3538
import { getPossibleEventMessages } from './utils/eventUtils';
39+
import { isParameterizedString, isPlainObject, isPrimitive, isThenable } from './utils/is';
40+
import { logger } from './utils/logger';
3641
import { merge } from './utils/merge';
42+
import { checkOrSetAlreadyCaught, uuid4 } from './utils/misc';
3743
import { parseSampleRate } from './utils/parseSampleRate';
3844
import { prepareEvent } from './utils/prepareEvent';
3945
import { getActiveSpan, showSpanDropWarning, spanToTraceContext } from './utils/spanUtils';
46+
import { rejectedSyncPromise, resolvedSyncPromise, SyncPromise } from './utils/syncpromise';
4047
import { convertSpanJsonToTransactionEvent, convertTransactionEventToSpanJson } from './utils/transactionEvent';
41-
import { createClientReportEnvelope } from './utils-hoist/clientreport';
42-
import { dsnToString, makeDsn } from './utils-hoist/dsn';
43-
import { addItemToEnvelope, createAttachmentEnvelopeItem } from './utils-hoist/envelope';
44-
import { isParameterizedString, isPlainObject, isPrimitive, isThenable } from './utils-hoist/is';
45-
import { logger } from './utils-hoist/logger';
46-
import { checkOrSetAlreadyCaught, uuid4 } from './utils-hoist/misc';
47-
import { rejectedSyncPromise, resolvedSyncPromise, SyncPromise } from './utils-hoist/syncpromise';
4848

4949
const ALREADY_SEEN_ERROR = "Not capturing exception because it's already been captured.";
5050
const MISSING_RELEASE_FOR_SESSION_ERROR = 'Discarded session because of missing or non-string release';

packages/core/src/currentScopes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { getGlobalSingleton, getMainCarrier } from './carrier';
33
import type { Client } from './client';
44
import { Scope } from './scope';
55
import type { TraceContext } from './types-hoist/context';
6-
import { generateSpanId } from './utils-hoist/propagationContext';
6+
import { generateSpanId } from './utils/propagationContext';
77

88
/**
99
* Get the currently active scope.

packages/core/src/envelope.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ import type { Event } from './types-hoist/event';
1818
import type { SdkInfo } from './types-hoist/sdkinfo';
1919
import type { SdkMetadata } from './types-hoist/sdkmetadata';
2020
import type { Session, SessionAggregates } from './types-hoist/session';
21-
import { showSpanDropWarning, spanToJSON } from './utils/spanUtils';
22-
import { dsnToString } from './utils-hoist/dsn';
21+
import { dsnToString } from './utils/dsn';
2322
import {
2423
createEnvelope,
2524
createEventEnvelopeHeaders,
2625
createSpanEnvelopeItem,
2726
getSdkMetadataForEnvelopeHeader,
28-
} from './utils-hoist/envelope';
29-
import { uuid4 } from './utils-hoist/misc';
27+
} from './utils/envelope';
28+
import { uuid4 } from './utils/misc';
29+
import { showSpanDropWarning, spanToJSON } from './utils/spanUtils';
3030

3131
/**
3232
* Apply SdkInfo (name, version, packages, integrations) to the corresponding event key.

packages/core/src/eventProcessors.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { DEBUG_BUILD } from './debug-build';
22
import type { Event, EventHint } from './types-hoist/event';
33
import type { EventProcessor } from './types-hoist/eventprocessor';
4-
import { isThenable } from './utils-hoist/is';
5-
import { logger } from './utils-hoist/logger';
6-
import { SyncPromise } from './utils-hoist/syncpromise';
4+
import { isThenable } from './utils/is';
5+
import { logger } from './utils/logger';
6+
import { SyncPromise } from './utils/syncpromise';
77

88
/**
99
* Process an array of event processors, returning the processed event (or `null` if the event was dropped).

0 commit comments

Comments
 (0)