Skip to content
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
2 changes: 1 addition & 1 deletion packages/node-core/src/common-exports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export { getSentryRelease, defaultStackParser } from './sdk/api';
export { createGetModuleFromFilename } from './utils/module';
export { addOriginToSpan } from './utils/addOriginToSpan';
export { initializeEsmLoader } from './sdk/esmLoader';
export { isCjs } from './utils/detection';
export { isCjs } from './utils/isCjs';
export { createMissingInstrumentationContext } from './utils/createMissingInstrumentationContext';
export { makeNodeTransport, type NodeTransportOptions } from './transports';
export type { HTTPModuleRequestIncomingMessage } from './transports/http-module';
Expand Down
2 changes: 1 addition & 1 deletion packages/node-core/src/integrations/modules.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { existsSync, readFileSync } from 'node:fs';
import { dirname, join } from 'node:path';
import { GLOBAL_OBJ, type IntegrationFn } from '@sentry/core';
import { isCjs } from '../utils/detection';
import { isCjs } from '../utils/isCjs';

type ModuleInfo = Record<string, string>;

Expand Down
2 changes: 1 addition & 1 deletion packages/node-core/src/light/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { systemErrorIntegration } from '../integrations/systemError';
import { defaultStackParser, getSentryRelease } from '../sdk/api';
import { makeNodeTransport } from '../transports';
import type { NodeClientOptions, NodeOptions } from '../types';
import { isCjs } from '../utils/detection';
import { isCjs } from '../utils/isCjs';
import { getSpotlightConfig } from '../utils/spotlight';
import { setAsyncLocalStorageAsyncContextStrategy } from './asyncLocalStorageStrategy';
import { LightNodeClient } from './client';
Expand Down
2 changes: 1 addition & 1 deletion packages/node-core/src/sdk/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import { consoleIntegration } from '../integrations/console';
import { systemErrorIntegration } from '../integrations/systemError';
import { makeNodeTransport } from '../transports';
import type { NodeClientOptions, NodeOptions } from '../types';
import { isCjs } from '../utils/detection';
import { isCjs } from '../utils/isCjs';
import { getSpotlightConfig } from '../utils/spotlight';
import { defaultStackParser, getSentryRelease } from './api';
import { NodeClient } from './client';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { MissingInstrumentationContext } from '@sentry/core';
import { isCjs } from './detection';
import { isCjs } from './isCjs';

export const createMissingInstrumentationContext = (pkg: string): MissingInstrumentationContext => ({
package: pkg,
Expand Down
12 changes: 1 addition & 11 deletions packages/node-core/src/utils/detection.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
import { consoleSandbox } from '@sentry/core';
import { NODE_MAJOR, NODE_MINOR } from '../nodeVersion';

/** Detect CommonJS. */
export function isCjs(): boolean {
/*! rollup-include-cjs-only */
return true;
/*! rollup-include-cjs-only-end */

/*! rollup-include-esm-only */
return false;
/*! rollup-include-esm-only-end */
}
import { isCjs } from './isCjs';

let hasWarnedAboutNodeVersion: boolean | undefined;

Expand Down
2 changes: 1 addition & 1 deletion packages/node-core/src/utils/ensureIsWrapped.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from '@sentry/core';
import type { NodeClient } from '../sdk/client';
import { createMissingInstrumentationContext } from './createMissingInstrumentationContext';
import { isCjs } from './detection';
import { isCjs } from './isCjs';

/**
* Checks and warns if a framework isn't wrapped by opentelemetry.
Expand Down
10 changes: 10 additions & 0 deletions packages/node-core/src/utils/isCjs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/** Detect CommonJS. */
export function isCjs(): boolean {
/*! rollup-include-cjs-only */
return true;
/*! rollup-include-cjs-only-end */

/*! rollup-include-esm-only */
return false;
/*! rollup-include-esm-only-end */
}
Loading