diff --git a/dev-packages/e2e-tests/test-applications/node-exports-test-app/scripts/consistentExports.ts b/dev-packages/e2e-tests/test-applications/node-exports-test-app/scripts/consistentExports.ts index 0635b129442b..99d2ed614d2b 100644 --- a/dev-packages/e2e-tests/test-applications/node-exports-test-app/scripts/consistentExports.ts +++ b/dev-packages/e2e-tests/test-applications/node-exports-test-app/scripts/consistentExports.ts @@ -53,21 +53,13 @@ const DEPENDENTS: Dependent[] = [ }, { package: '@sentry/bun', - compareWith: nodeExperimentalExports, + compareWith: nodeExports, exports: Object.keys(SentryBun), ignoreExports: [ // not supported in bun: - 'Handlers', 'NodeClient', - 'hapiErrorPlugin', - 'makeNodeTransport', - // TODO: remove these when we switch exports from nodeExperimentalExports to nodeExports - 'Integrations', - 'addGlobalEventProcessor', - 'getActiveTransaction', - 'getCurrentHub', + // legacy, to be removed... 'makeMain', - 'startTransaction', ], }, { diff --git a/packages/bun/package.json b/packages/bun/package.json index ff7bdf6c5147..034c0cd0b948 100644 --- a/packages/bun/package.json +++ b/packages/bun/package.json @@ -15,7 +15,7 @@ "types", "types-ts3.8" ], - "main": "build/esm/index.js", + "main": "build/cjs/index.js", "module": "build/esm/index.js", "types": "build/types/index.d.ts", "exports": { @@ -33,8 +33,8 @@ }, "typesVersions": { "<4.9": { - "build/npm/types/index.d.ts": [ - "build/npm/types-ts3.8/index.d.ts" + "build/types/index.d.ts": [ + "build/types-ts3.8/index.d.ts" ] } }, @@ -43,7 +43,7 @@ }, "dependencies": { "@sentry/core": "8.0.0-alpha.2", - "@sentry/node-experimental": "8.0.0-alpha.2", + "@sentry/node": "8.0.0-alpha.2", "@sentry/types": "8.0.0-alpha.2", "@sentry/utils": "8.0.0-alpha.2" }, diff --git a/packages/bun/rollup.npm.config.mjs b/packages/bun/rollup.npm.config.mjs index 19f01d8cb3f8..84a06f2fb64a 100644 --- a/packages/bun/rollup.npm.config.mjs +++ b/packages/bun/rollup.npm.config.mjs @@ -1,6 +1,3 @@ import { makeBaseNPMConfig, makeNPMConfigVariants } from '@sentry-internal/rollup-utils'; -const config = makeNPMConfigVariants(makeBaseNPMConfig()); - -// remove cjs from config array config[0].output.format == cjs -export default [config[1]]; +export default makeNPMConfigVariants(makeBaseNPMConfig()); diff --git a/packages/bun/src/client.ts b/packages/bun/src/client.ts index 7b3a350f2821..40e430dc2545 100644 --- a/packages/bun/src/client.ts +++ b/packages/bun/src/client.ts @@ -1,7 +1,6 @@ import * as os from 'os'; import type { ServerRuntimeClientOptions } from '@sentry/core'; -import { applySdkMetadata } from '@sentry/core'; -import { ServerRuntimeClient } from '@sentry/core'; +import { ServerRuntimeClient, applySdkMetadata } from '@sentry/core'; import type { BunClientOptions } from './types'; diff --git a/packages/bun/src/index.ts b/packages/bun/src/index.ts index 30bb42eff92c..da25f6cb08bd 100644 --- a/packages/bun/src/index.ts +++ b/packages/bun/src/index.ts @@ -18,9 +18,6 @@ export type { } from '@sentry/types'; export type { AddRequestDataToEventOptions } from '@sentry/utils'; -export type { TransactionNamingScheme } from '@sentry/node-experimental'; -export type { BunOptions } from './types'; - export { addEventProcessor, addBreadcrumb, @@ -28,9 +25,14 @@ export { captureException, captureEvent, captureMessage, - close, + captureCheckIn, + startSession, + captureSession, + endSession, + withMonitor, createTransport, - flush, + // eslint-disable-next-line deprecation/deprecation + getCurrentHub, getClient, isInitialized, getCurrentScope, @@ -50,64 +52,80 @@ export { setHttpStatus, withScope, withIsolationScope, - captureCheckIn, - withMonitor, + makeNodeTransport, + NodeClient, + defaultStackParser, + flush, + close, + getSentryRelease, + addRequestDataToEvent, + DEFAULT_USER_INCLUDES, + extractRequestData, + createGetModuleFromFilename, + anrIntegration, + consoleIntegration, + httpIntegration, + nativeNodeFetchIntegration, + onUncaughtExceptionIntegration, + onUnhandledRejectionIntegration, + modulesIntegration, + contextLinesIntegration, + nodeContextIntegration, + localVariablesIntegration, + requestDataIntegration, + functionToStringIntegration, + inboundFiltersIntegration, + linkedErrorsIntegration, setMeasurement, getActiveSpan, - getRootSpan, startSpan, startInactiveSpan, startSpanManual, withActiveSpan, + getRootSpan, getSpanDescendants, continueTrace, - metricsDefault as metrics, - functionToStringIntegration, - inboundFiltersIntegration, - linkedErrorsIntegration, - requestDataIntegration, + getAutoPerformanceIntegrations, + cron, + metrics, + parameterize, + SEMANTIC_ATTRIBUTE_SENTRY_OP, + SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, + SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, + SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, + expressIntegration, + expressErrorHandler, + setupExpressErrorHandler, + fastifyIntegration, + setupFastifyErrorHandler, + graphqlIntegration, + mongoIntegration, + mongooseIntegration, + mysqlIntegration, + mysql2Integration, + nestIntegration, + postgresIntegration, + prismaIntegration, + hapiIntegration, + setupHapiErrorHandler, + spotlightIntegration, +} from '@sentry/node'; + +export { captureConsoleIntegration, debugIntegration, dedupeIntegration, extraErrorDataIntegration, rewriteFramesIntegration, sessionTimingIntegration, - parameterize, - startSession, - captureSession, - endSession, } from '@sentry/core'; -export { - DEFAULT_USER_INCLUDES, - autoDiscoverNodePerformanceMonitoringIntegrations, - cron, - createGetModuleFromFilename, - defaultStackParser, - extractRequestData, - getSentryRelease, - addRequestDataToEvent, - anrIntegration, - consoleIntegration, - contextLinesIntegration, - hapiIntegration, - httpIntegration, - localVariablesIntegration, - modulesIntegration, - nativeNodeFetchintegration, - nodeContextIntegration, - onUncaughtExceptionIntegration, - onUnhandledRejectionIntegration, - spotlightIntegration, - SEMANTIC_ATTRIBUTE_SENTRY_OP, - SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, - SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, - SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, -} from '@sentry/node-experimental'; + +export type { BunOptions } from './types'; export { BunClient } from './client'; export { getDefaultIntegrations, init, } from './sdk'; - export { bunServerIntegration } from './integrations/bunserver'; +export { makeFetchTransport } from './transports'; diff --git a/packages/bun/src/sdk.ts b/packages/bun/src/sdk.ts index b7eddfed9c73..51099eb814b2 100644 --- a/packages/bun/src/sdk.ts +++ b/packages/bun/src/sdk.ts @@ -1,4 +1,3 @@ -/* eslint-disable max-lines */ import { functionToStringIntegration, inboundFiltersIntegration, @@ -11,9 +10,9 @@ import { httpIntegration, init as initNode, modulesIntegration, - nativeNodeFetchintegration, + nativeNodeFetchIntegration, nodeContextIntegration, -} from '@sentry/node-experimental'; +} from '@sentry/node'; import type { Integration, Options } from '@sentry/types'; import { BunClient } from './client'; @@ -33,7 +32,7 @@ export function getDefaultIntegrations(_options: Options): Integration[] { // Native Wrappers consoleIntegration(), httpIntegration(), - nativeNodeFetchintegration(), + nativeNodeFetchIntegration(), // Global Handlers # TODO (waiting for https://github.com/oven-sh/bun/issues/5091) // new NodeIntegrations.OnUncaughtException(), // new NodeIntegrations.OnUnhandledRejection(), diff --git a/packages/bun/tsconfig.json b/packages/bun/tsconfig.json index 70c4bde02040..dcbef254b942 100644 --- a/packages/bun/tsconfig.json +++ b/packages/bun/tsconfig.json @@ -4,21 +4,7 @@ "include": ["src/**/*"], "compilerOptions": { - "types": ["bun-types"], - "lib": ["esnext"], - "module": "esnext", - "target": "esnext", - - // if TS 4.x or earlier - "moduleResolution": "nodenext", - - "jsx": "react-jsx", // support JSX - "allowJs": true, // allow importing `.js` from `.ts` - "esModuleInterop": true, // allow default imports for CommonJS modules - - // best practices - "strict": true, - "forceConsistentCasingInFileNames": true, - "skipLibCheck": true + // package-specific options + "types": ["bun-types"] } }