Skip to content

Commit cbf64ef

Browse files
authored
feat(node-experimental): Add missing re-exports (#10679)
Noticed these were not exported yet there.
1 parent 4ef3bd5 commit cbf64ef

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

packages/node-experimental/src/index.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const Integrations = {
2121
...NodeExperimentalIntegrations,
2222
};
2323

24-
export { init } from './sdk/init';
24+
export { init, getDefaultIntegrations } from './sdk/init';
2525
export { getAutoPerformanceIntegrations } from './integrations/getAutoPerformanceIntegrations';
2626
export * as Handlers from './sdk/handlers';
2727
export type { Span } from './types';
@@ -40,7 +40,8 @@ export {
4040
setIsolationScope,
4141
setCurrentScope,
4242
} from './sdk/api';
43-
export { getCurrentHub, makeMain } from './sdk/hub';
43+
// eslint-disable-next-line deprecation/deprecation
44+
export { getCurrentHub } from './sdk/hub';
4445

4546
export {
4647
addBreadcrumb,
@@ -88,6 +89,14 @@ export {
8889
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
8990
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
9091
SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,
92+
setCurrentClient,
93+
Scope,
94+
setMeasurement,
95+
continueTrace,
96+
cron,
97+
parameterize,
98+
// eslint-disable-next-line deprecation/deprecation
99+
makeMain,
91100
} from '@sentry/node';
92101

93102
export type {
@@ -108,4 +117,5 @@ export type {
108117
Stacktrace,
109118
Thread,
110119
User,
120+
NodeOptions,
111121
} from '@sentry/node';

packages/node-experimental/src/otel/contextManager.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export class SentryContextManager extends AsyncLocalStorageContextManager {
3434
const scopes: CurrentScopes = { scope: newCurrentScope, isolationScope };
3535

3636
// We also need to "mock" the hub on the context, as the original @sentry/opentelemetry uses that...
37+
// eslint-disable-next-line deprecation/deprecation
3738
const mockHub = { ...getCurrentHub(), getScope: () => scopes.scope };
3839

3940
const ctx1 = setHubOnContext(context, mockHub);

packages/node-experimental/src/sdk/hub.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,13 @@ import type { SentryCarrier } from './types';
2929
/** Ensure the global hub is our proxied hub. */
3030
export function setupGlobalHub(): void {
3131
const carrier = getGlobalCarrier();
32+
// eslint-disable-next-line deprecation/deprecation
3233
carrier.hub = getCurrentHub();
3334
}
3435

3536
/**
3637
* This is for legacy reasons, and returns a proxy object instead of a hub to be used.
38+
* @deprecated Use the methods directly.
3739
*/
3840
export function getCurrentHub(): Hub {
3941
return {
@@ -124,17 +126,6 @@ export function getCurrentHub(): Hub {
124126
};
125127
}
126128

127-
/**
128-
* Replaces the current main hub with the passed one on the global object
129-
*
130-
* @returns The old replaced hub
131-
*/
132-
export function makeMain(hub: Hub): Hub {
133-
// eslint-disable-next-line no-console
134-
console.warn('makeMain is a noop in @sentry/node-experimental. Use `setCurrentClient` instead.');
135-
return hub;
136-
}
137-
138129
/**
139130
* Sends the current Session on the scope
140131
*/
@@ -152,6 +143,7 @@ function _sendSessionUpdate(): void {
152143
* Set a mocked hub on the current carrier.
153144
*/
154145
export function setLegacyHubOnCarrier(carrier: SentryCarrier): boolean {
146+
// eslint-disable-next-line deprecation/deprecation
155147
carrier.hub = getCurrentHub();
156148
return true;
157149
}

0 commit comments

Comments
 (0)