Skip to content

Commit 6b15512

Browse files
committed
Move @sentry/hub code to @sentry/core
1 parent a5bfa80 commit 6b15512

Some content is hidden

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

69 files changed

+104
-110
lines changed

packages/browser/test/unit/sdk.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ function getDefaultBrowserOptions(options: Partial<BrowserOptions> = {}): Browse
2121
};
2222
}
2323

24-
jest.mock('@sentry/hub', () => {
25-
const original = jest.requireActual('@sentry/hub');
24+
jest.mock('@sentry/core', () => {
25+
const original = jest.requireActual('@sentry/core');
2626
return {
2727
...original,
2828
getCurrentHub(): {

packages/core/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"access": "public"
1717
},
1818
"dependencies": {
19-
"@sentry/hub": "7.13.0",
2019
"@sentry/types": "7.13.0",
2120
"@sentry/utils": "7.13.0",
2221
"tslib": "^1.9.3"

packages/core/src/baseclient.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* eslint-disable max-lines */
2-
import { Scope, updateSession } from '@sentry/hub';
32
import {
43
Client,
54
ClientOptions,
@@ -40,6 +39,8 @@ import {
4039
import { getEnvelopeEndpointWithUrlEncodedAuth } from './api';
4140
import { createEventEnvelope, createSessionEnvelope } from './envelope';
4241
import { IntegrationIndex, setupIntegrations } from './integration';
42+
import { Scope } from './scope';
43+
import { updateSession } from './session';
4344

4445
const ALREADY_SEEN_ERROR = "Not capturing exception because it's already been captured.";
4546

File renamed without changes.
File renamed without changes.

packages/core/src/index.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export type { ClientClass } from './sdk';
2+
export type { Carrier, Layer } from './hub';
23

34
export {
45
addBreadcrumb,
@@ -14,13 +15,11 @@ export {
1415
setTags,
1516
setUser,
1617
withScope,
17-
addGlobalEventProcessor,
18-
getCurrentHub,
19-
getHubFromCarrier,
20-
Hub,
21-
makeMain,
22-
Scope,
23-
} from '@sentry/hub';
18+
} from './exports';
19+
export { getCurrentHub, getHubFromCarrier, Hub, makeMain, getMainCarrier, setHubOnCarrier } from './hub';
20+
export { makeSession, closeSession, updateSession } from './session';
21+
export { SessionFlusher } from './sessionflusher';
22+
export { addGlobalEventProcessor, Scope } from './scope';
2423
export { getEnvelopeEndpointWithUrlEncodedAuth, getReportDialogEndpoint } from './api';
2524
export { BaseClient } from './baseclient';
2625
export { initAndBind } from './sdk';

packages/core/src/integration.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
import { addGlobalEventProcessor, getCurrentHub } from '@sentry/hub';
21
import { Integration, Options } from '@sentry/types';
32
import { arrayify, logger } from '@sentry/utils';
43

4+
import { getCurrentHub } from './hub';
5+
import { addGlobalEventProcessor } from './scope';
6+
57
declare module '@sentry/types' {
68
interface Integration {
79
isDefaultInstance?: boolean;
File renamed without changes.

packages/core/src/sdk.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import { getCurrentHub } from '@sentry/hub';
21
import { Client, ClientOptions } from '@sentry/types';
32
import { logger } from '@sentry/utils';
43

4+
import { getCurrentHub } from './hub';
5+
56
/** A class object that can instantiate Client objects. */
67
export type ClientClass<F extends Client, O extends ClientOptions> = new (options: O) => F;
78

File renamed without changes.

0 commit comments

Comments
 (0)