Skip to content

Commit 42379bf

Browse files
authored
feat(bundler-plugins): Frameworks use @sentry/bundler-plugins (#22392)
Changes all dependencies and references from `@sentry/*-plugin` to the local `@sentry/bundler-plugins`.
1 parent efb304c commit 42379bf

43 files changed

Lines changed: 92 additions & 128 deletions

Some content is hidden

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

packages/astro/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"@sentry/core": "10.67.0",
6161
"@sentry/conventions": "^0.16.0",
6262
"@sentry/node": "10.67.0",
63-
"@sentry/vite-plugin": "^5.3.0"
63+
"@sentry/bundler-plugins": "10.67.0"
6464
},
6565
"devDependencies": {
6666
"astro": "^3.5.0",

packages/astro/src/integration/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { sentryVitePlugin } from '@sentry/vite-plugin';
1+
import { sentryVitePlugin } from '@sentry/bundler-plugins/vite';
22
import type { AstroConfig, AstroIntegration, AstroIntegrationLogger } from 'astro';
33
import * as fs from 'fs';
44
import { createRequire } from 'module';

packages/astro/src/integration/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { BuildTimeOptionsBase, UnstableVitePluginOptions } from '@sentry/core';
2-
import type { SentryVitePluginOptions } from '@sentry/vite-plugin';
2+
import type { SentryVitePluginOptions } from '@sentry/bundler-plugins/vite';
33
import type { RouteData } from 'astro';
44

55
type SdkInitPaths = {
@@ -101,7 +101,7 @@ type SourceMapsOptions = {
101101
filesToDeleteAfterUpload?: string | Array<string>;
102102

103103
/**
104-
* Options to further customize the Sentry Vite Plugin (@sentry/vite-plugin) behavior directly.
104+
* Options to further customize the Sentry Vite Plugin (@sentry/bundler-plugins/vite) behavior directly.
105105
* Options specified in this object take precedence over all other options.
106106
*
107107
* @see https://www.npmjs.com/package/@sentry/vite-plugin/v/2.14.2#options which lists all available options.

packages/astro/test/integration/cloudflare.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ vi.mock('fs', async requireActual => {
2525
};
2626
});
2727

28-
vi.mock('@sentry/vite-plugin', () => ({
28+
vi.mock('@sentry/bundler-plugins/vite', () => ({
2929
sentryVitePlugin: vi.fn(() => 'sentryVitePlugin'),
3030
}));
3131

packages/astro/test/integration/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { SentryOptions } from '../../src/integration/types';
55

66
const sentryVitePluginSpy = vi.fn(() => 'sentryVitePlugin');
77

8-
vi.mock('@sentry/vite-plugin', () => ({
8+
vi.mock('@sentry/bundler-plugins/vite', () => ({
99
// @ts-expect-error - just mocking around
1010
sentryVitePlugin: vi.fn(args => sentryVitePluginSpy(args)),
1111
}));

packages/bundler-plugins/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@
116116
"dotenv": "^17.4.2",
117117
"find-up": "^5.0.0",
118118
"glob": "^13.0.6",
119-
"magic-string": "~0.30.8"
119+
"magic-string": "~0.30.8",
120+
"supports-color": "^8.1.1"
120121
},
121122
"peerDependencies": {
122123
"rollup": ">=3.2.0",

packages/core/src/build-time-plugins/buildTimeOptionsBase.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* @example
1111
* ```typescript
1212
* import type { BuildTimeOptionsBase, UnstableVitePluginOptions } from '@sentry/core';
13-
* import type { SentryVitePluginOptions } from '@sentry/vite-plugin';
13+
* import type { SentryVitePluginOptions } from '@sentry/bundler-plugins/vite';
1414
*
1515
* // Example of how a framework SDK would define its build-time options
1616
* type MyFrameworkBuildOptions =
@@ -152,7 +152,7 @@ export interface BuildTimeOptionsBase {
152152
*/
153153
export type UnstableVitePluginOptions<PluginOptionsType> = {
154154
/**
155-
* Options to be passed directly to the Sentry Vite Plugin (`@sentry/vite-plugin`) that ships with the Sentry SDK.
155+
* Options to be passed directly to the Sentry Vite Plugin (`@sentry/bundler-plugins/vite`) that ships with the Sentry SDK.
156156
* You can use this option to override any options the SDK passes to the Vite plugin.
157157
*
158158
* Please note that this option is unstable and may change in a breaking way in any release.
@@ -176,7 +176,7 @@ export type UnstableVitePluginOptions<PluginOptionsType> = {
176176
*/
177177
export type UnstableWebpackPluginOptions<PluginOptionsType> = {
178178
/**
179-
* Options to be passed directly to the Sentry Webpack Plugin (`@sentry/webpack-plugin`) that ships with the Sentry SDK.
179+
* Options to be passed directly to the Sentry Webpack Plugin (`@sentry/bundler-plugins/webpack`) that ships with the Sentry SDK.
180180
* You can use this option to override any options the SDK passes to the Webpack plugin.
181181
*
182182
* Please note that this option is unstable and may change in a breaking way in any release.
@@ -200,7 +200,7 @@ export type UnstableWebpackPluginOptions<PluginOptionsType> = {
200200
*/
201201
export type UnstableRollupPluginOptions<PluginOptionsType> = {
202202
/**
203-
* Options to be passed directly to the Sentry Rollup Plugin (`@sentry/rollup-plugin`) that ships with the Sentry SDK.
203+
* Options to be passed directly to the Sentry Rollup Plugin (`@sentry/bundler-plugins/rollup`) that ships with the Sentry SDK.
204204
* You can use this option to override any options the SDK passes to the Rollup plugin.
205205
*
206206
* Please note that this option is unstable and may change in a breaking way in any release.

packages/gatsby/gatsby-node.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const fs = require('fs');
22

3-
const { sentryWebpackPlugin } = require('@sentry/webpack-plugin');
3+
const { sentryWebpackPlugin } = require('@sentry/bundler-plugins/webpack');
44

55
const SENTRY_USER_CONFIG = ['./sentry.config.js', './sentry.config.ts'];
66

packages/gatsby/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"dependencies": {
4848
"@sentry/core": "10.67.0",
4949
"@sentry/react": "10.67.0",
50-
"@sentry/webpack-plugin": "^5.3.0"
50+
"@sentry/bundler-plugins": "10.67.0"
5151
},
5252
"peerDependencies": {
5353
"gatsby": "^3.0.0 || ^4.0.0 || ^5.0.0",

packages/gatsby/test/gatsby-node.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import { onCreateWebpackConfig } from '../gatsby-node';
33

44
vi.hoisted(
55
() =>
6-
void mock('@sentry/webpack-plugin', {
6+
void mock('@sentry/bundler-plugins/webpack', {
77
sentryWebpackPlugin: vi.fn().mockReturnValue({}),
88
}),
99
);
1010

11-
// Need to override mock because `gatsby-node.js` loads `@sentry/webpack-plugin` as a CJS file.
11+
// Need to override mock because `gatsby-node.js` loads `@sentry/bundler-plugins/webpack` as a CJS file.
1212
async function mock(mockedUri: string, stub: any) {
1313
const { Module } = await import('module');
1414

@@ -24,7 +24,7 @@ async function mock(mockedUri: string, stub: any) {
2424

2525
describe('onCreateWebpackConfig', () => {
2626
// eslint-disable-next-line @typescript-eslint/no-var-requires
27-
const { sentryWebpackPlugin } = require('@sentry/webpack-plugin');
27+
const { sentryWebpackPlugin } = require('@sentry/bundler-plugins/webpack');
2828
let originalNodeEnv: string | undefined;
2929

3030
beforeAll(() => {

0 commit comments

Comments
 (0)