diff --git a/packages/astro/package.json b/packages/astro/package.json index 2d4bd8331c5f..c8977282394f 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -60,7 +60,7 @@ "@sentry/core": "10.67.0", "@sentry/conventions": "^0.16.0", "@sentry/node": "10.67.0", - "@sentry/vite-plugin": "^5.3.0" + "@sentry/bundler-plugins": "10.67.0" }, "devDependencies": { "astro": "^3.5.0", diff --git a/packages/astro/src/integration/index.ts b/packages/astro/src/integration/index.ts index 2565ec9e75f1..f45e5acecacd 100644 --- a/packages/astro/src/integration/index.ts +++ b/packages/astro/src/integration/index.ts @@ -1,4 +1,4 @@ -import { sentryVitePlugin } from '@sentry/vite-plugin'; +import { sentryVitePlugin } from '@sentry/bundler-plugins/vite'; import type { AstroConfig, AstroIntegration, AstroIntegrationLogger } from 'astro'; import * as fs from 'fs'; import { createRequire } from 'module'; diff --git a/packages/astro/src/integration/types.ts b/packages/astro/src/integration/types.ts index 638c4faff2bf..75cf77683415 100644 --- a/packages/astro/src/integration/types.ts +++ b/packages/astro/src/integration/types.ts @@ -1,5 +1,5 @@ import type { BuildTimeOptionsBase, UnstableVitePluginOptions } from '@sentry/core'; -import type { SentryVitePluginOptions } from '@sentry/vite-plugin'; +import type { SentryVitePluginOptions } from '@sentry/bundler-plugins/vite'; import type { RouteData } from 'astro'; type SdkInitPaths = { @@ -101,7 +101,7 @@ type SourceMapsOptions = { filesToDeleteAfterUpload?: string | Array; /** - * Options to further customize the Sentry Vite Plugin (@sentry/vite-plugin) behavior directly. + * Options to further customize the Sentry Vite Plugin (@sentry/bundler-plugins/vite) behavior directly. * Options specified in this object take precedence over all other options. * * @see https://www.npmjs.com/package/@sentry/vite-plugin/v/2.14.2#options which lists all available options. diff --git a/packages/astro/test/integration/cloudflare.test.ts b/packages/astro/test/integration/cloudflare.test.ts index e928e556ca4b..8eed4d1a8bb3 100644 --- a/packages/astro/test/integration/cloudflare.test.ts +++ b/packages/astro/test/integration/cloudflare.test.ts @@ -25,7 +25,7 @@ vi.mock('fs', async requireActual => { }; }); -vi.mock('@sentry/vite-plugin', () => ({ +vi.mock('@sentry/bundler-plugins/vite', () => ({ sentryVitePlugin: vi.fn(() => 'sentryVitePlugin'), })); diff --git a/packages/astro/test/integration/index.test.ts b/packages/astro/test/integration/index.test.ts index a7b4d68f16c3..0738e4fb74d4 100644 --- a/packages/astro/test/integration/index.test.ts +++ b/packages/astro/test/integration/index.test.ts @@ -5,7 +5,7 @@ import type { SentryOptions } from '../../src/integration/types'; const sentryVitePluginSpy = vi.fn(() => 'sentryVitePlugin'); -vi.mock('@sentry/vite-plugin', () => ({ +vi.mock('@sentry/bundler-plugins/vite', () => ({ // @ts-expect-error - just mocking around sentryVitePlugin: vi.fn(args => sentryVitePluginSpy(args)), })); diff --git a/packages/bundler-plugins/package.json b/packages/bundler-plugins/package.json index 8312bfee4fa8..64f790a62870 100644 --- a/packages/bundler-plugins/package.json +++ b/packages/bundler-plugins/package.json @@ -116,7 +116,8 @@ "dotenv": "^17.4.2", "find-up": "^5.0.0", "glob": "^13.0.6", - "magic-string": "~0.30.8" + "magic-string": "~0.30.8", + "supports-color": "^8.1.1" }, "peerDependencies": { "rollup": ">=3.2.0", diff --git a/packages/core/src/build-time-plugins/buildTimeOptionsBase.ts b/packages/core/src/build-time-plugins/buildTimeOptionsBase.ts index c87ce1198df4..91ef3eaced37 100644 --- a/packages/core/src/build-time-plugins/buildTimeOptionsBase.ts +++ b/packages/core/src/build-time-plugins/buildTimeOptionsBase.ts @@ -10,7 +10,7 @@ * @example * ```typescript * import type { BuildTimeOptionsBase, UnstableVitePluginOptions } from '@sentry/core'; - * import type { SentryVitePluginOptions } from '@sentry/vite-plugin'; + * import type { SentryVitePluginOptions } from '@sentry/bundler-plugins/vite'; * * // Example of how a framework SDK would define its build-time options * type MyFrameworkBuildOptions = @@ -152,7 +152,7 @@ export interface BuildTimeOptionsBase { */ export type UnstableVitePluginOptions = { /** - * Options to be passed directly to the Sentry Vite Plugin (`@sentry/vite-plugin`) that ships with the Sentry SDK. + * Options to be passed directly to the Sentry Vite Plugin (`@sentry/bundler-plugins/vite`) that ships with the Sentry SDK. * You can use this option to override any options the SDK passes to the Vite plugin. * * Please note that this option is unstable and may change in a breaking way in any release. @@ -176,7 +176,7 @@ export type UnstableVitePluginOptions = { */ export type UnstableWebpackPluginOptions = { /** - * Options to be passed directly to the Sentry Webpack Plugin (`@sentry/webpack-plugin`) that ships with the Sentry SDK. + * Options to be passed directly to the Sentry Webpack Plugin (`@sentry/bundler-plugins/webpack`) that ships with the Sentry SDK. * You can use this option to override any options the SDK passes to the Webpack plugin. * * Please note that this option is unstable and may change in a breaking way in any release. @@ -200,7 +200,7 @@ export type UnstableWebpackPluginOptions = { */ export type UnstableRollupPluginOptions = { /** - * Options to be passed directly to the Sentry Rollup Plugin (`@sentry/rollup-plugin`) that ships with the Sentry SDK. + * Options to be passed directly to the Sentry Rollup Plugin (`@sentry/bundler-plugins/rollup`) that ships with the Sentry SDK. * You can use this option to override any options the SDK passes to the Rollup plugin. * * Please note that this option is unstable and may change in a breaking way in any release. diff --git a/packages/gatsby/gatsby-node.js b/packages/gatsby/gatsby-node.js index 85b968d1771e..f6fb559f68d8 100644 --- a/packages/gatsby/gatsby-node.js +++ b/packages/gatsby/gatsby-node.js @@ -1,6 +1,6 @@ const fs = require('fs'); -const { sentryWebpackPlugin } = require('@sentry/webpack-plugin'); +const { sentryWebpackPlugin } = require('@sentry/bundler-plugins/webpack'); const SENTRY_USER_CONFIG = ['./sentry.config.js', './sentry.config.ts']; diff --git a/packages/gatsby/package.json b/packages/gatsby/package.json index 452ca5cc2a56..b417b650bcf1 100644 --- a/packages/gatsby/package.json +++ b/packages/gatsby/package.json @@ -47,7 +47,7 @@ "dependencies": { "@sentry/core": "10.67.0", "@sentry/react": "10.67.0", - "@sentry/webpack-plugin": "^5.3.0" + "@sentry/bundler-plugins": "10.67.0" }, "peerDependencies": { "gatsby": "^3.0.0 || ^4.0.0 || ^5.0.0", diff --git a/packages/gatsby/test/gatsby-node.test.ts b/packages/gatsby/test/gatsby-node.test.ts index 76e04f60cd14..4247cba110df 100644 --- a/packages/gatsby/test/gatsby-node.test.ts +++ b/packages/gatsby/test/gatsby-node.test.ts @@ -3,12 +3,12 @@ import { onCreateWebpackConfig } from '../gatsby-node'; vi.hoisted( () => - void mock('@sentry/webpack-plugin', { + void mock('@sentry/bundler-plugins/webpack', { sentryWebpackPlugin: vi.fn().mockReturnValue({}), }), ); -// Need to override mock because `gatsby-node.js` loads `@sentry/webpack-plugin` as a CJS file. +// Need to override mock because `gatsby-node.js` loads `@sentry/bundler-plugins/webpack` as a CJS file. async function mock(mockedUri: string, stub: any) { const { Module } = await import('module'); @@ -24,7 +24,7 @@ async function mock(mockedUri: string, stub: any) { describe('onCreateWebpackConfig', () => { // eslint-disable-next-line @typescript-eslint/no-var-requires - const { sentryWebpackPlugin } = require('@sentry/webpack-plugin'); + const { sentryWebpackPlugin } = require('@sentry/bundler-plugins/webpack'); let originalNodeEnv: string | undefined; beforeAll(() => { diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index cf82bff37cbd..ed8569f88d5b 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -79,7 +79,7 @@ "@opentelemetry/api": "^1.9.1", "@rollup/plugin-commonjs": "28.0.1", "@sentry/browser-utils": "10.67.0", - "@sentry/bundler-plugin-core": "^5.3.0", + "@sentry/bundler-plugins": "10.67.0", "@sentry/conventions": "^0.16.0", "@sentry/core": "10.67.0", "@sentry/node": "10.67.0", @@ -87,7 +87,6 @@ "@sentry/react": "10.67.0", "@sentry/server-utils": "10.67.0", "@sentry/vercel-edge": "10.67.0", - "@sentry/webpack-plugin": "^5.3.0", "rollup": "^4.60.3", "stacktrace-parser": "^0.1.11" }, diff --git a/packages/nextjs/src/config/getBuildPluginOptions.ts b/packages/nextjs/src/config/getBuildPluginOptions.ts index 3d7cc7711762..2e9ab466f439 100644 --- a/packages/nextjs/src/config/getBuildPluginOptions.ts +++ b/packages/nextjs/src/config/getBuildPluginOptions.ts @@ -1,4 +1,4 @@ -import type { Options as SentryBuildPluginOptions } from '@sentry/bundler-plugin-core'; +import type { Options as SentryBuildPluginOptions } from '@sentry/bundler-plugins/core'; import * as fs from 'fs'; import * as path from 'path'; import type { SentryBuildOptions } from './types'; diff --git a/packages/nextjs/src/config/handleRunAfterProductionCompile.ts b/packages/nextjs/src/config/handleRunAfterProductionCompile.ts index d5d0b98efbad..cbd6b20e5970 100644 --- a/packages/nextjs/src/config/handleRunAfterProductionCompile.ts +++ b/packages/nextjs/src/config/handleRunAfterProductionCompile.ts @@ -1,4 +1,4 @@ -import type { createSentryBuildPluginManager as createSentryBuildPluginManagerType } from '@sentry/bundler-plugin-core'; +import type { createSentryBuildPluginManager as createSentryBuildPluginManagerType } from '@sentry/bundler-plugins/core'; import { loadModule } from '@sentry/core'; import * as fs from 'fs'; import * as path from 'path'; @@ -32,7 +32,7 @@ export async function handleRunAfterProductionCompile( const { createSentryBuildPluginManager } = loadModule<{ createSentryBuildPluginManager: typeof createSentryBuildPluginManagerType }>( - '@sentry/bundler-plugin-core', + '@sentry/bundler-plugins/core', module, ) ?? {}; diff --git a/packages/nextjs/src/config/loaders/componentAnnotationLoader.ts b/packages/nextjs/src/config/loaders/componentAnnotationLoader.ts index b2b943302419..1a5c44109e78 100644 --- a/packages/nextjs/src/config/loaders/componentAnnotationLoader.ts +++ b/packages/nextjs/src/config/loaders/componentAnnotationLoader.ts @@ -1,4 +1,4 @@ -import { createComponentNameAnnotateHooks } from '@sentry/bundler-plugin-core'; +import { createComponentNameAnnotateHooks } from '@sentry/bundler-plugins/core'; import type { LoaderThis } from './types'; export type ComponentAnnotationLoaderOptions = { @@ -9,7 +9,7 @@ export type ComponentAnnotationLoaderOptions = { * Turbopack loader that annotates React components with `data-sentry-component`, * `data-sentry-element`, and `data-sentry-source-file` attributes. * - * This is the Turbopack equivalent of what `@sentry/webpack-plugin` does + * This is the Turbopack equivalent of what `@sentry/bundler-plugins/webpack` does * via the `reactComponentAnnotation` option and `@sentry/babel-plugin-component-annotate`. * * Options: diff --git a/packages/nextjs/src/config/loaders/moduleMetadataInjectionLoader.ts b/packages/nextjs/src/config/loaders/moduleMetadataInjectionLoader.ts index b26eb452e13b..7e8315b51831 100644 --- a/packages/nextjs/src/config/loaders/moduleMetadataInjectionLoader.ts +++ b/packages/nextjs/src/config/loaders/moduleMetadataInjectionLoader.ts @@ -10,7 +10,7 @@ export type ModuleMetadataInjectionLoaderOptions = { * `thirdPartyErrorFilterIntegration` can tell first-party code from * third-party code. * - * This is the Turbopack equivalent of what `@sentry/webpack-plugin` does + * This is the Turbopack equivalent of what `@sentry/bundler-plugins/webpack` does * via its `moduleMetadata` option. * * Options: @@ -25,7 +25,7 @@ export default function moduleMetadataInjectionLoader( // We do not want to cache injected values across builds this.cacheable(false); - // The snippet mirrors what @sentry/webpack-plugin injects for moduleMetadata. + // The snippet mirrors what @sentry/bundler-plugins/webpack injects for moduleMetadata. // It is wrapped in a try-catch IIFE (matching the webpack plugin's CodeInjection pattern) // so that injection failures in node_modules or unusual environments never break the module. // The IIFE resolves the global object and stores metadata keyed by (new Error).stack diff --git a/packages/nextjs/src/config/types.ts b/packages/nextjs/src/config/types.ts index 1ca30de85804..19dec1d43cff 100644 --- a/packages/nextjs/src/config/types.ts +++ b/packages/nextjs/src/config/types.ts @@ -1,5 +1,5 @@ import type { GLOBAL_OBJ } from '@sentry/core'; -import type { SentryWebpackPluginOptions } from '@sentry/webpack-plugin'; +import type { SentryWebpackPluginOptions } from '@sentry/bundler-plugins/webpack'; // The first argument to `withSentryConfig` (which is the user's next config). export type ExportedNextConfig = NextConfigObject | NextConfigFunction; @@ -147,7 +147,7 @@ export type SentryBuildWebpackOptions = { }; /** - * Options to be passed directly to the Sentry Webpack Plugin (`@sentry/webpack-plugin`) that ships with the Sentry SDK. + * Options to be passed directly to the Sentry Webpack Plugin (`@sentry/bundler-plugins/webpack`) that ships with the Sentry SDK. * You can use this option to override any options the SDK passes to the Webpack plugin. * * Please note that this option is unstable and may change in a breaking way in any release. @@ -469,7 +469,7 @@ export type SentryBuildOptions = { * This key is used by the `thirdPartyErrorFilterIntegration` to filter out errors * originating from third-party scripts. * - * For webpack builds, this is forwarded to the `@sentry/webpack-plugin`. + * For webpack builds, this is forwarded to the `@sentry/bundler-plugins/webpack`. * For Turbopack builds, this injects module metadata via a custom loader. * * @see https://docs.sentry.io/platforms/javascript/configuration/filtering/#using-thirdpartyerrorfilterintegration @@ -542,7 +542,7 @@ export type SentryBuildOptions = { }; // TODO(v11): remove this option /** - * Options to be passed directly to the Sentry Webpack Plugin (`@sentry/webpack-plugin`) that ships with the Sentry Next.js SDK. + * Options to be passed directly to the Sentry Webpack Plugin (`@sentry/bundler-plugins/webpack`) that ships with the Sentry Next.js SDK. * You can use this option to override any options the SDK passes to the webpack plugin. * * Please note that this option is unstable and may change in a breaking way in any release. @@ -747,7 +747,7 @@ export type SentryBuildOptions = { * first-party code from third-party code in Turbopack builds. * * When set, a Turbopack loader injects `_sentryModuleMetadata` into every - * first-party module, mirroring what `@sentry/webpack-plugin` does for + * first-party module, mirroring what `@sentry/bundler-plugins/webpack` does for * webpack builds via its `moduleMetadata` / `applicationKey` option. * * Requires Next.js 16+ diff --git a/packages/nextjs/src/config/webpack.ts b/packages/nextjs/src/config/webpack.ts index 30532b354360..08c874250d96 100644 --- a/packages/nextjs/src/config/webpack.ts +++ b/packages/nextjs/src/config/webpack.ts @@ -358,8 +358,9 @@ export function constructWebpackConfigFunction({ // We don't want to do any webpack plugin stuff OR any source maps stuff in dev mode or for the server on static-only builds. // Symbolication for dev-mode errors is done elsewhere. if (!(isDev || (isStaticExport && isServer))) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const { sentryWebpackPlugin } = loadModule<{ sentryWebpackPlugin: any }>('@sentry/webpack-plugin', module) ?? {}; + const { sentryWebpackPlugin } = + // eslint-disable-next-line @typescript-eslint/no-explicit-any + loadModule<{ sentryWebpackPlugin: any }>('@sentry/bundler-plugins/webpack', module) ?? {}; if (sentryWebpackPlugin) { if (!userSentryOptions.sourcemaps?.disable) { diff --git a/packages/nextjs/test/config/loaders/componentAnnotationLoader.test.ts b/packages/nextjs/test/config/loaders/componentAnnotationLoader.test.ts index f12a49f8e24a..f086d89f3ae2 100644 --- a/packages/nextjs/test/config/loaders/componentAnnotationLoader.test.ts +++ b/packages/nextjs/test/config/loaders/componentAnnotationLoader.test.ts @@ -9,7 +9,7 @@ const { mockTransform, mockCreateHooks } = vi.hoisted(() => { return { mockTransform, mockCreateHooks }; }); -vi.mock('@sentry/bundler-plugin-core', () => ({ +vi.mock('@sentry/bundler-plugins/core', () => ({ createComponentNameAnnotateHooks: mockCreateHooks, })); diff --git a/packages/nitro/package.json b/packages/nitro/package.json index 149f3f334a62..a90e973000e4 100644 --- a/packages/nitro/package.json +++ b/packages/nitro/package.json @@ -35,7 +35,7 @@ "nitro": ">=3.0.0-0 <4.0.0 || 3.0.260311-beta || 3.0.260415-beta" }, "dependencies": { - "@sentry/bundler-plugin-core": "^5.3.0", + "@sentry/bundler-plugins": "^10.67.0", "@sentry/core": "10.67.0", "@sentry/node": "10.67.0", "@sentry/server-utils": "10.67.0" diff --git a/packages/nitro/src/sourceMaps.ts b/packages/nitro/src/sourceMaps.ts index 9aa470a88d90..ea68b33f282f 100644 --- a/packages/nitro/src/sourceMaps.ts +++ b/packages/nitro/src/sourceMaps.ts @@ -1,5 +1,5 @@ -import type { Options as BundlerPluginOptions } from '@sentry/bundler-plugin-core'; -import { createSentryBuildPluginManager } from '@sentry/bundler-plugin-core'; +import type { Options as BundlerPluginOptions } from '@sentry/bundler-plugins/core'; +import { createSentryBuildPluginManager } from '@sentry/bundler-plugins/core'; import type { Nitro, NitroConfig } from 'nitro/types'; import type { SentryNitroOptions } from './config'; diff --git a/packages/nuxt/package.json b/packages/nuxt/package.json index beb446967056..286cddf7a71a 100644 --- a/packages/nuxt/package.json +++ b/packages/nuxt/package.json @@ -59,9 +59,8 @@ "@sentry/core": "10.67.0", "@sentry/node": "10.67.0", "@sentry/node-core": "10.67.0", - "@sentry/rollup-plugin": "^5.3.0", + "@sentry/bundler-plugins": "10.67.0", "@sentry/server-utils": "10.67.0", - "@sentry/vite-plugin": "^5.3.0", "@sentry/vue": "10.67.0", "local-pkg": "^1.1.2" }, diff --git a/packages/nuxt/src/common/types.ts b/packages/nuxt/src/common/types.ts index fbc9604cb310..0e8992386bb4 100644 --- a/packages/nuxt/src/common/types.ts +++ b/packages/nuxt/src/common/types.ts @@ -1,7 +1,7 @@ import type { BuildTimeOptionsBase } from '@sentry/core'; import type { init as initNode } from '@sentry/node'; -import type { SentryRollupPluginOptions } from '@sentry/rollup-plugin'; -import type { SentryVitePluginOptions } from '@sentry/vite-plugin'; +import type { SentryRollupPluginOptions } from '@sentry/bundler-plugins/rollup'; +import type { SentryVitePluginOptions } from '@sentry/bundler-plugins/vite'; import type { init as initVue } from '@sentry/vue'; // Omitting Vue 'app' as the Nuxt SDK will add the app instance in the client plugin (users do not have to provide this) @@ -272,7 +272,7 @@ export type SentryNuxtModuleOptions = BuildTimeOptionsBase & { experimental_entrypointWrappedFunctions?: string[]; /** - * Options to be passed directly to the Sentry Rollup Plugin (`@sentry/rollup-plugin`) and Sentry Vite Plugin (`@sentry/vite-plugin`) that ship with the Sentry Nuxt SDK. + * Options to be passed directly to the Sentry Rollup Plugin (`@sentry/bundler-plugins/rollup`) and Sentry Vite Plugin (`@sentry/bundler-plugins/vite`) that ship with the Sentry Nuxt SDK. * You can use this option to override any options the SDK passes to the Vite (for Nuxt) and Rollup (for Nitro) plugin. * * Please note that this option is unstable and may change in a breaking way in any release. diff --git a/packages/nuxt/src/vite/sourceMaps.ts b/packages/nuxt/src/vite/sourceMaps.ts index bba2e6440c46..faf68b2bc37d 100644 --- a/packages/nuxt/src/vite/sourceMaps.ts +++ b/packages/nuxt/src/vite/sourceMaps.ts @@ -1,6 +1,6 @@ import type { Nuxt } from '@nuxt/schema'; -import { sentryRollupPlugin, type SentryRollupPluginOptions } from '@sentry/rollup-plugin'; -import { sentryVitePlugin, type SentryVitePluginOptions } from '@sentry/vite-plugin'; +import { sentryRollupPlugin, type SentryRollupPluginOptions } from '@sentry/bundler-plugins/rollup'; +import { sentryVitePlugin, type SentryVitePluginOptions } from '@sentry/bundler-plugins/vite'; import type { NitroConfig } from 'nitropack'; import type { Plugin } from 'vite'; import type { SentryNuxtModuleOptions } from '../common/types'; diff --git a/packages/nuxt/test/vite/sourceMaps-nuxtHooks.test.ts b/packages/nuxt/test/vite/sourceMaps-nuxtHooks.test.ts index e0b4956219c3..a9edb03fb1ed 100644 --- a/packages/nuxt/test/vite/sourceMaps-nuxtHooks.test.ts +++ b/packages/nuxt/test/vite/sourceMaps-nuxtHooks.test.ts @@ -54,10 +54,10 @@ describe('setupSourceMaps hooks', () => { const consoleWarnSpy = vi.spyOn(console, 'warn'); beforeAll(() => { - vi.doMock('@sentry/vite-plugin', () => ({ + vi.doMock('@sentry/bundler-plugins/vite', () => ({ sentryVitePlugin: mockSentryVitePlugin, })); - vi.doMock('@sentry/rollup-plugin', () => ({ + vi.doMock('@sentry/bundler-plugins/rollup', () => ({ sentryRollupPlugin: mockSentryRollupPlugin, })); }); @@ -65,8 +65,8 @@ describe('setupSourceMaps hooks', () => { afterAll(() => { consoleLogSpy.mockRestore(); consoleWarnSpy.mockRestore(); - vi.doUnmock('@sentry/vite-plugin'); - vi.doUnmock('@sentry/rollup-plugin'); + vi.doUnmock('@sentry/bundler-plugins/vite'); + vi.doUnmock('@sentry/bundler-plugins/rollup'); }); beforeEach(() => { diff --git a/packages/nuxt/test/vite/sourceMaps.test.ts b/packages/nuxt/test/vite/sourceMaps.test.ts index ea80f32efd89..28ed1338e510 100644 --- a/packages/nuxt/test/vite/sourceMaps.test.ts +++ b/packages/nuxt/test/vite/sourceMaps.test.ts @@ -10,9 +10,14 @@ import { validateNitroSourceMapSettings, } from '../../src/vite/sourceMaps'; -vi.mock('@sentry/core', () => ({ - consoleSandbox: (callback: () => void) => callback(), -})); +vi.mock('@sentry/core', async importOriginal => { + const actual = await importOriginal(); + return { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + ...(actual as any), + consoleSandbox: (callback: () => void) => callback(), + }; +}); describe('getPluginOptions', () => { beforeEach(() => { diff --git a/packages/react-router/package.json b/packages/react-router/package.json index b60854c84117..4248f9eeb040 100644 --- a/packages/react-router/package.json +++ b/packages/react-router/package.json @@ -53,7 +53,7 @@ "@sentry/core": "10.67.0", "@sentry/node": "10.67.0", "@sentry/react": "10.67.0", - "@sentry/vite-plugin": "^5.3.0", + "@sentry/bundler-plugins": "10.67.0", "glob": "^13.0.6" }, "devDependencies": { diff --git a/packages/react-router/src/vite/buildEnd/handleOnBuildEnd.ts b/packages/react-router/src/vite/buildEnd/handleOnBuildEnd.ts index 9364875fd9a6..2cdd2c5cd09b 100644 --- a/packages/react-router/src/vite/buildEnd/handleOnBuildEnd.ts +++ b/packages/react-router/src/vite/buildEnd/handleOnBuildEnd.ts @@ -1,7 +1,7 @@ import { rm } from 'node:fs/promises'; import type { Config } from '@react-router/dev/config'; import SentryCli from '@sentry/cli'; -import type { SentryVitePluginOptions } from '@sentry/vite-plugin'; +import type { SentryVitePluginOptions } from '@sentry/bundler-plugins/vite'; import { glob } from 'glob'; import type { SentryReactRouterBuildOptions } from '../types'; diff --git a/packages/react-router/src/vite/makeCustomSentryVitePlugins.ts b/packages/react-router/src/vite/makeCustomSentryVitePlugins.ts index 69b07e1da28f..b2d41378db33 100644 --- a/packages/react-router/src/vite/makeCustomSentryVitePlugins.ts +++ b/packages/react-router/src/vite/makeCustomSentryVitePlugins.ts @@ -1,4 +1,4 @@ -import { sentryVitePlugin } from '@sentry/vite-plugin'; +import { sentryVitePlugin } from '@sentry/bundler-plugins/vite'; import { type Plugin } from 'vite'; import type { SentryReactRouterBuildOptions } from './types'; diff --git a/packages/react-router/src/vite/types.ts b/packages/react-router/src/vite/types.ts index c7555630c4fa..3f0ab34879b6 100644 --- a/packages/react-router/src/vite/types.ts +++ b/packages/react-router/src/vite/types.ts @@ -1,5 +1,5 @@ import type { BuildTimeOptionsBase, UnstableVitePluginOptions } from '@sentry/core'; -import type { SentryVitePluginOptions } from '@sentry/vite-plugin'; +import type { SentryVitePluginOptions } from '@sentry/bundler-plugins/vite'; type SourceMapsOptions = { /** diff --git a/packages/react-router/test/vite/makeCustomSentryVitePlugins.test.ts b/packages/react-router/test/vite/makeCustomSentryVitePlugins.test.ts index c38e80ef72df..2434d7592c5e 100644 --- a/packages/react-router/test/vite/makeCustomSentryVitePlugins.test.ts +++ b/packages/react-router/test/vite/makeCustomSentryVitePlugins.test.ts @@ -1,8 +1,8 @@ -import { sentryVitePlugin } from '@sentry/vite-plugin'; +import { sentryVitePlugin } from '@sentry/bundler-plugins/vite'; import { describe, expect, it, vi } from 'vitest'; import { makeCustomSentryVitePlugins } from '../../src/vite/makeCustomSentryVitePlugins'; -vi.mock('@sentry/vite-plugin', () => ({ +vi.mock('@sentry/bundler-plugins/vite', () => ({ sentryVitePlugin: vi.fn().mockReturnValue([{ name: 'sentry-vite-plugin' }]), })); diff --git a/packages/react-router/test/vite/sourceMaps.test.ts b/packages/react-router/test/vite/sourceMaps.test.ts index 5e2850b2240d..ae73ef43f5c4 100644 --- a/packages/react-router/test/vite/sourceMaps.test.ts +++ b/packages/react-router/test/vite/sourceMaps.test.ts @@ -1,4 +1,4 @@ -import type { SentryVitePluginOptions } from '@sentry/vite-plugin'; +import type { SentryVitePluginOptions } from '@sentry/bundler-plugins/vite'; import { beforeEach, describe, expect, it, vi } from 'vitest'; import { getUpdatedSourceMapSettings, makeEnableSourceMapsPlugin } from '../../src/vite/makeEnableSourceMapsPlugin'; @@ -9,8 +9,8 @@ const mockedSentryVitePlugin = { const sentryVitePluginSpy = vi.fn((_options: SentryVitePluginOptions) => [mockedSentryVitePlugin]); -vi.mock('@sentry/vite-plugin', async () => { - const original = (await vi.importActual('@sentry/vite-plugin')) as any; +vi.mock('@sentry/bundler-plugins/vite', async () => { + const original = (await vi.importActual('@sentry/bundler-plugins/vite')) as any; return { ...original, diff --git a/packages/solidstart/package.json b/packages/solidstart/package.json index 7627a6259721..ac54823eb596 100644 --- a/packages/solidstart/package.json +++ b/packages/solidstart/package.json @@ -69,7 +69,7 @@ "@sentry/core": "10.67.0", "@sentry/node": "10.67.0", "@sentry/solid": "10.67.0", - "@sentry/vite-plugin": "^5.3.0" + "@sentry/bundler-plugins": "10.67.0" }, "devDependencies": { "@solidjs/router": "^0.15.0", diff --git a/packages/solidstart/src/vite/sourceMaps.ts b/packages/solidstart/src/vite/sourceMaps.ts index 8d10e6a16112..95ccfe3a658e 100644 --- a/packages/solidstart/src/vite/sourceMaps.ts +++ b/packages/solidstart/src/vite/sourceMaps.ts @@ -1,9 +1,9 @@ -import { sentryVitePlugin } from '@sentry/vite-plugin'; +import { sentryVitePlugin } from '@sentry/bundler-plugins/vite'; import type { Plugin, UserConfig } from 'vite'; import type { SentrySolidStartPluginOptions } from './types'; /** - * A Sentry plugin for adding the @sentry/vite-plugin to automatically upload source maps to Sentry. + * A Sentry plugin for adding the @sentry/bundler-plugins/vite plugin to automatically upload source maps to Sentry. */ export function makeAddSentryVitePlugin(options: SentrySolidStartPluginOptions, viteConfig: UserConfig): Plugin[] { const { authToken, debug, org, project, sourceMapsUploadOptions } = options; diff --git a/packages/solidstart/src/vite/types.ts b/packages/solidstart/src/vite/types.ts index 1ae73777c6a4..a01e2bde2685 100644 --- a/packages/solidstart/src/vite/types.ts +++ b/packages/solidstart/src/vite/types.ts @@ -1,4 +1,4 @@ -import type { SentryVitePluginOptions } from '@sentry/vite-plugin'; +import type { SentryVitePluginOptions } from '@sentry/bundler-plugins/vite'; type SourceMapsOptions = { /** @@ -28,7 +28,7 @@ type SourceMapsOptions = { filesToDeleteAfterUpload?: string | Array; /** - * Options to further customize the Sentry Vite Plugin (@sentry/vite-plugin) behavior directly. + * Options to further customize the Sentry Vite Plugin (@sentry/bundler-plugins/vite) behavior directly. * Options specified in this object take precedence over the options specified in * the `sourcemaps` and `release` objects. * diff --git a/packages/solidstart/test/vite/sourceMaps.test.ts b/packages/solidstart/test/vite/sourceMaps.test.ts index a3fba62c1eda..7cf240c7003e 100644 --- a/packages/solidstart/test/vite/sourceMaps.test.ts +++ b/packages/solidstart/test/vite/sourceMaps.test.ts @@ -1,4 +1,4 @@ -import type { SentryVitePluginOptions } from '@sentry/vite-plugin'; +import type { SentryVitePluginOptions } from '@sentry/bundler-plugins/vite'; import { beforeEach, describe, expect, it, vi } from 'vitest'; import { getUpdatedSourceMapSettings, @@ -13,8 +13,8 @@ const mockedSentryVitePlugin = { const sentryVitePluginSpy = vi.fn((_options: SentryVitePluginOptions) => [mockedSentryVitePlugin]); -vi.mock('@sentry/vite-plugin', async () => { - const original = (await vi.importActual('@sentry/vite-plugin')) as any; +vi.mock('@sentry/bundler-plugins/vite', async () => { + const original = (await vi.importActual('@sentry/bundler-plugins/vite')) as any; return { ...original, diff --git a/packages/sveltekit/package.json b/packages/sveltekit/package.json index 00fa86d61542..b61b9df48341 100644 --- a/packages/sveltekit/package.json +++ b/packages/sveltekit/package.json @@ -61,7 +61,7 @@ "@sentry/conventions": "^0.16.0", "@sentry/node": "10.67.0", "@sentry/svelte": "10.67.0", - "@sentry/vite-plugin": "^5.3.0", + "@sentry/bundler-plugins": "10.67.0", "@sveltejs/acorn-typescript": "^1.0.9", "acorn": "^8.14.0", "magic-string": "~0.30.0", diff --git a/packages/sveltekit/src/vite/sourceMaps.ts b/packages/sveltekit/src/vite/sourceMaps.ts index ac29d436c43d..25b6b3865212 100644 --- a/packages/sveltekit/src/vite/sourceMaps.ts +++ b/packages/sveltekit/src/vite/sourceMaps.ts @@ -1,7 +1,7 @@ import { escapeStringForRegex, uuid4 } from '@sentry/core'; import { getSentryRelease } from '@sentry/node'; -import type { SentryVitePluginOptions } from '@sentry/vite-plugin'; -import { sentryVitePlugin } from '@sentry/vite-plugin'; +import type { SentryVitePluginOptions } from '@sentry/bundler-plugins/vite'; +import { sentryVitePlugin } from '@sentry/bundler-plugins/vite'; import * as child_process from 'child_process'; import * as fs from 'fs'; import * as path from 'path'; @@ -93,7 +93,7 @@ export async function makeCustomSentryVitePlugins( debug && // eslint-disable-next-line no-console console.warn( - 'sentry-vite-plugin not found in sentryPlugins! Cannot modify plugin - returning default Sentry Vite plugins', + '@sentry/bundler-plugins/vite not found in sentryPlugins! Cannot modify plugin - returning default Sentry Vite plugins', ); _resolveFilesToDeleteAfterUpload?.(undefined); diff --git a/packages/sveltekit/src/vite/types.ts b/packages/sveltekit/src/vite/types.ts index 5f623cc876ad..6994df980d16 100644 --- a/packages/sveltekit/src/vite/types.ts +++ b/packages/sveltekit/src/vite/types.ts @@ -1,5 +1,5 @@ import type { BuildTimeOptionsBase, UnstableVitePluginOptions } from '@sentry/core'; -import type { SentryVitePluginOptions } from '@sentry/vite-plugin'; +import type { SentryVitePluginOptions } from '@sentry/bundler-plugins/vite'; import type { AutoInstrumentSelection } from './autoInstrument'; import type { SupportedSvelteKitAdapters } from './detectAdapter'; @@ -134,7 +134,7 @@ type SourceMapsUploadOptions = { url?: string; /** - * Options to further customize the Sentry Vite Plugin (@sentry/vite-plugin) behavior directly. + * Options to further customize the Sentry Vite Plugin (@sentry/bundler-plugins/vite) behavior directly. * Options specified in this object take precedence over the options specified in * the `sourcemaps` and `release` objects. * diff --git a/packages/sveltekit/test/vite/sourceMaps.test.ts b/packages/sveltekit/test/vite/sourceMaps.test.ts index 6c411d6274a9..f38e7e38fd45 100644 --- a/packages/sveltekit/test/vite/sourceMaps.test.ts +++ b/packages/sveltekit/test/vite/sourceMaps.test.ts @@ -1,4 +1,4 @@ -import { sentryVitePlugin } from '@sentry/vite-plugin'; +import { sentryVitePlugin } from '@sentry/bundler-plugins/vite'; import type { Plugin } from 'vite'; import * as vite from 'vite'; import { beforeEach, describe, expect, it, vi } from 'vitest'; @@ -10,8 +10,8 @@ const mockedMainPlugin = { writeBundle: vi.fn(), }; -vi.mock('@sentry/vite-plugin', async () => { - const original = (await vi.importActual('@sentry/vite-plugin')) as any; +vi.mock('@sentry/bundler-plugins/vite', async () => { + const original = (await vi.importActual('@sentry/bundler-plugins/vite')) as any; return { ...original, @@ -299,8 +299,8 @@ describe('deleteFilesAfterUpload', () => { it('works with defauts', async () => { const viteConfig: ViteUserConfig = {}; - vi.mock('@sentry/vite-plugin', async () => { - const original = (await vi.importActual('@sentry/vite-plugin')) as any; + vi.mock('@sentry/bundler-plugins/vite', async () => { + const original = (await vi.importActual('@sentry/bundler-plugins/vite')) as any; return { ...original, @@ -377,8 +377,8 @@ describe('deleteFilesAfterUpload', () => { }, }; - vi.mock('@sentry/vite-plugin', async () => { - const original = (await vi.importActual('@sentry/vite-plugin')) as any; + vi.mock('@sentry/bundler-plugins/vite', async () => { + const original = (await vi.importActual('@sentry/bundler-plugins/vite')) as any; return { ...original, diff --git a/packages/tanstackstart-react/package.json b/packages/tanstackstart-react/package.json index 7067dd86f9f7..a20da27a1a5d 100644 --- a/packages/tanstackstart-react/package.json +++ b/packages/tanstackstart-react/package.json @@ -69,7 +69,7 @@ "@sentry/core": "10.67.0", "@sentry/node": "10.67.0", "@sentry/react": "10.67.0", - "@sentry/vite-plugin": "^5.3.0" + "@sentry/bundler-plugins": "10.67.0" }, "devDependencies": { "vite": "^6.4.3" diff --git a/packages/tanstackstart-react/src/vite/sourceMaps.ts b/packages/tanstackstart-react/src/vite/sourceMaps.ts index 7842789081a2..c331617f403d 100644 --- a/packages/tanstackstart-react/src/vite/sourceMaps.ts +++ b/packages/tanstackstart-react/src/vite/sourceMaps.ts @@ -1,11 +1,11 @@ -import { sentryVitePlugin } from '@sentry/vite-plugin'; +import { sentryVitePlugin } from '@sentry/bundler-plugins/vite'; import type { Plugin, UserConfig } from 'vite'; import type { SentryTanstackStartOptions } from './sentryTanstackStart'; type FilesToDeleteAfterUpload = string | string[] | undefined; /** - * A Sentry plugin for adding the @sentry/vite-plugin to automatically upload source maps to Sentry. + * A Sentry plugin for adding the @sentry/bundler-plugins/vite to automatically upload source maps to Sentry. */ export function makeAddSentryVitePlugin(options: SentryTanstackStartOptions): Plugin[] { const { diff --git a/packages/tanstackstart-react/test/vite/sourceMaps.test.ts b/packages/tanstackstart-react/test/vite/sourceMaps.test.ts index 74dd086878c2..e1abdd8865ed 100644 --- a/packages/tanstackstart-react/test/vite/sourceMaps.test.ts +++ b/packages/tanstackstart-react/test/vite/sourceMaps.test.ts @@ -1,4 +1,4 @@ -import type { SentryVitePluginOptions } from '@sentry/vite-plugin'; +import type { SentryVitePluginOptions } from '@sentry/bundler-plugins/vite'; import type { UserConfig } from 'vite'; import { beforeEach, describe, expect, it, vi } from 'vitest'; import { @@ -14,7 +14,7 @@ const mockedSentryVitePlugin = { const sentryVitePluginSpy = vi.fn((_options: SentryVitePluginOptions) => [mockedSentryVitePlugin]); -vi.mock('@sentry/vite-plugin', () => ({ +vi.mock('@sentry/bundler-plugins/vite', () => ({ sentryVitePlugin: (options: SentryVitePluginOptions) => sentryVitePluginSpy(options), })); diff --git a/yarn.lock b/yarn.lock index 381e90c80f85..608e64cd3374 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7348,24 +7348,6 @@ resolved "https://registry.yarnpkg.com/@sec-ant/readable-stream/-/readable-stream-0.4.1.tgz#60de891bb126abfdc5410fdc6166aca065f10a0c" integrity sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg== -"@sentry/babel-plugin-component-annotate@5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@sentry/babel-plugin-component-annotate/-/babel-plugin-component-annotate-5.3.0.tgz#356218f747969f9af970987dcf0f17ec81d6e50c" - integrity sha512-p4q8gn8wcFqZGP/s2MnJCAAd8fTikaU6A0mM97RDHQgStcrYiaS0Sc5zUNfb1V+UOLPuvdEdL6MwyxfzjYJQTA== - -"@sentry/bundler-plugin-core@5.3.0", "@sentry/bundler-plugin-core@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@sentry/bundler-plugin-core/-/bundler-plugin-core-5.3.0.tgz#2772866dcb076c36721d2acab1010a6fc0b3ff2f" - integrity sha512-L5T60sWdAI3qWwdg3Ptwek/0TY59PERrxyqp4XMUkroayQvGd9r5dIW9Q1kSeXX9iJ442nXbFZKAOyCKV4Z13Q== - dependencies: - "@babel/core" "^7.18.5" - "@sentry/babel-plugin-component-annotate" "5.3.0" - "@sentry/cli" "^2.58.5" - dotenv "^16.3.1" - find-up "^5.0.0" - glob "^13.0.6" - magic-string "~0.30.8" - "@sentry/cli-darwin@2.58.6": version "2.58.6" resolved "https://registry.yarnpkg.com/@sentry/cli-darwin/-/cli-darwin-2.58.6.tgz#38fd82751014b287e58e99ef948d01ca1e09f41d" @@ -7406,7 +7388,7 @@ resolved "https://registry.yarnpkg.com/@sentry/cli-win32-x64/-/cli-win32-x64-2.58.6.tgz#8d0e70b5660cc82a7763a4bbe9346cf18e49e07e" integrity sha512-R35WJ17oF4D2eqI1DR2sQQqr0fjRTt5xoP16WrTu91XM2lndRMFsnjh+/GttbxapLCBNlrjzia99MJ0PZHZpgA== -"@sentry/cli@^2.58.5", "@sentry/cli@^2.58.6": +"@sentry/cli@^2.58.6": version "2.58.6" resolved "https://registry.yarnpkg.com/@sentry/cli/-/cli-2.58.6.tgz#72edb4977d822757511b279e006b00f139e24945" integrity sha512-baBcNPLLfUi9WuL+Tpri9BFaAdvugZIKelC5X0tt0Zdy+K0K+PCVSrnNmwMWU/HyaF/SEv6b6UHnXIdqanBlcg== @@ -7447,14 +7429,6 @@ detect-libc "^2.0.4" node-abi "^3.89.0" -"@sentry/rollup-plugin@5.3.0", "@sentry/rollup-plugin@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@sentry/rollup-plugin/-/rollup-plugin-5.3.0.tgz#1dbfbee8d5d2a0f6acc245f4dd05e46c66291710" - integrity sha512-hgPGPYdQJ/G1cGYOxAb7d4z3V+/k/E5/P/5TFPEEBLuIbFFk+JG0CISUDJdzXJjO382Lb99PBJuXGbueBmO79w== - dependencies: - "@sentry/bundler-plugin-core" "5.3.0" - magic-string "~0.30.8" - "@sentry/rrdom@2.43.2": version "2.43.2" resolved "https://registry.yarnpkg.com/@sentry/rrdom/-/rrdom-2.43.2.tgz#24e20c5f9ffb085af9527fb5dbbcf30536322e8b" @@ -7489,21 +7463,6 @@ fflate "^0.4.4" mitt "^3.0.0" -"@sentry/vite-plugin@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@sentry/vite-plugin/-/vite-plugin-5.3.0.tgz#6cb63bfc1b0d1613a151de456b9c66f6cb21b1d2" - integrity sha512-qcoSzo4n2MulVQ70UUPLq6dTleb2a2HwL2wuwvAgWhPChrYTuk6A6mDg6aQb9fairPAwFPiU9PzOANpoDJcz1A== - dependencies: - "@sentry/bundler-plugin-core" "5.3.0" - "@sentry/rollup-plugin" "5.3.0" - -"@sentry/webpack-plugin@^5.3.0": - version "5.3.0" - resolved "https://registry.yarnpkg.com/@sentry/webpack-plugin/-/webpack-plugin-5.3.0.tgz#7c28fbc3f4fbfe07c51f63f4a403c9c7a28ca9d7" - integrity sha512-i3OQUrS0FZlXLgq57RIKDp+vHHzuvYKPCKewAPXULWKMsBXFGhP6veGRQ+6To/pmZkkXjEX5ofVNDy9C3jEPKQ== - dependencies: - "@sentry/bundler-plugin-core" "5.3.0" - "@shikijs/core@1.29.2": version "1.29.2" resolved "https://registry.yarnpkg.com/@shikijs/core/-/core-1.29.2.tgz#9c051d3ac99dd06ae46bd96536380c916e552bf3" @@ -14514,7 +14473,7 @@ dotenv@17.4.2, dotenv@^17.3.1, dotenv@^17.4.2: resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-17.4.2.tgz#c07e54a746e11eba021dd9e1047ced5afdc1c034" integrity sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw== -dotenv@^16.3.1, dotenv@^16.4.5, dotenv@^16.6.1: +dotenv@^16.4.5, dotenv@^16.6.1: version "16.6.1" resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.6.1.tgz#773f0e69527a8315c7285d5ee73c4459d20a8020" integrity sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==