Skip to content

Commit 687cccf

Browse files
committed
add to the plugins
1 parent 063f0ad commit 687cccf

File tree

17 files changed

+151
-10
lines changed

17 files changed

+151
-10
lines changed

packages/astro-plugin/src/astro-bundle-analysis/__tests__/astroBundleAnalysisPlugin.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ describe("astroBundleAnalysisPlugin", () => {
2020
enableBundleAnalysis: true,
2121
retryCount: 1,
2222
uploadToken: "test-token",
23+
telemetry: false,
2324
}),
2425
pluginName: PLUGIN_NAME,
2526
pluginVersion: PLUGIN_VERSION,

packages/astro-plugin/src/index.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import {
55
checkNodeVersion,
66
Output,
77
handleErrors,
8+
createSentryInstance,
9+
telemetryPlugin,
810
} from "@codecov/bundler-plugin-core";
911
import { _internal_viteBundleAnalysisPlugin } from "@codecov/vite-plugin";
1012
import { type AstroIntegration } from "astro";
@@ -39,10 +41,23 @@ const astroPluginFactory = createVitePlugin<AstroPluginFactoryOptions, true>(
3941
}
4042

4143
const plugins: UnpluginOptions[] = [];
42-
const output = new Output(normalizedOptions.options);
4344
const options = normalizedOptions.options;
45+
const output = new Output(options);
46+
const sentryConfig = createSentryInstance({
47+
enableTelemetry: options.telemetry,
48+
isDryRun: options.dryRun,
49+
pluginName: PLUGIN_NAME,
50+
pluginVersion: PLUGIN_VERSION,
51+
options,
52+
});
53+
4454
if (options.enableBundleAnalysis) {
4555
plugins.push(
56+
telemetryPlugin({
57+
sentryClient: sentryConfig.sentryClient,
58+
sentryScope: sentryConfig.sentryScope,
59+
shouldSendTelemetry: options.telemetry,
60+
}),
4661
astroBundleAnalysisPlugin({
4762
output,
4863
target,

packages/nextjs-webpack-plugin/src/index.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import {
1111
checkNodeVersion,
1212
Output,
1313
handleErrors,
14+
createSentryInstance,
15+
telemetryPlugin,
1416
} from "@codecov/bundler-plugin-core";
1517

1618
import { nextJSWebpackBundleAnalysisPlugin } from "./nextjs-webpack-bundle-analysis/nextJSWebpackBundleAnalysisPlugin.ts";
@@ -43,10 +45,23 @@ const codecovNextJSWebpackPluginFactory = createWebpackPlugin<
4345
}
4446

4547
const plugins: UnpluginOptions[] = [];
46-
const output = new Output(normalizedOptions.options);
4748
const options = normalizedOptions.options;
49+
const output = new Output(options);
50+
const sentryConfig = createSentryInstance({
51+
enableTelemetry: options.telemetry,
52+
isDryRun: options.dryRun,
53+
pluginName: PLUGIN_NAME,
54+
pluginVersion: PLUGIN_VERSION,
55+
options,
56+
});
57+
4858
if (options.enableBundleAnalysis) {
4959
plugins.push(
60+
telemetryPlugin({
61+
sentryClient: sentryConfig.sentryClient,
62+
sentryScope: sentryConfig.sentryScope,
63+
shouldSendTelemetry: options.telemetry,
64+
}),
5065
nextJSWebpackBundleAnalysisPlugin({
5166
output,
5267
options: {

packages/nextjs-webpack-plugin/src/nextjs-webpack-bundle-analysis/__tests__/nextJSWebpackBundleAnalysisPlugin.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ describe("webpackBundleAnalysisPlugin", () => {
2020
enableBundleAnalysis: true,
2121
retryCount: 1,
2222
uploadToken: "test-token",
23+
telemetry: false,
2324
}),
2425
options: {
2526
webpack: webpack,

packages/nuxt-plugin/src/index.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import {
66
checkNodeVersion,
77
Output,
88
handleErrors,
9+
createSentryInstance,
10+
telemetryPlugin,
911
} from "@codecov/bundler-plugin-core";
1012
import { _internal_viteBundleAnalysisPlugin } from "@codecov/vite-plugin";
1113
import { addVitePlugin, defineNuxtModule } from "@nuxt/kit";
@@ -35,10 +37,23 @@ const codecovNuxtPluginFactory = createVitePlugin<Options, true>(
3537
}
3638

3739
const plugins: UnpluginOptions[] = [];
38-
const output = new Output(normalizedOptions.options);
3940
const options = normalizedOptions.options;
41+
const output = new Output(options);
42+
const sentryConfig = createSentryInstance({
43+
enableTelemetry: options.telemetry,
44+
isDryRun: options.dryRun,
45+
pluginName: PLUGIN_NAME,
46+
pluginVersion: PLUGIN_VERSION,
47+
options,
48+
});
49+
4050
if (options.enableBundleAnalysis) {
4151
plugins.push(
52+
telemetryPlugin({
53+
sentryClient: sentryConfig.sentryClient,
54+
sentryScope: sentryConfig.sentryScope,
55+
shouldSendTelemetry: options.telemetry,
56+
}),
4257
nuxtBundleAnalysisPlugin({
4358
output,
4459
pluginName: PLUGIN_NAME,

packages/nuxt-plugin/src/nuxt-bundle-analysis/__tests__/nuxtBundleAnalysisPlugin.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ describe("nuxtBundleAnalysisPlugin", () => {
1919
enableBundleAnalysis: true,
2020
retryCount: 1,
2121
uploadToken: "test-token",
22+
telemetry: false,
2223
}),
2324
pluginName: PLUGIN_NAME,
2425
pluginVersion: PLUGIN_VERSION,

packages/remix-vite-plugin/src/index.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import {
1010
checkNodeVersion,
1111
Output,
1212
handleErrors,
13+
createSentryInstance,
14+
telemetryPlugin,
1315
} from "@codecov/bundler-plugin-core";
1416
import { _internal_viteBundleAnalysisPlugin } from "@codecov/vite-plugin";
1517

@@ -37,10 +39,23 @@ const codecovRemixVitePluginFactory = createVitePlugin<Options, true>(
3739
}
3840

3941
const plugins: UnpluginOptions[] = [];
40-
const output = new Output(normalizedOptions.options);
4142
const options = normalizedOptions.options;
43+
const output = new Output(options);
44+
const sentryConfig = createSentryInstance({
45+
enableTelemetry: options.telemetry,
46+
isDryRun: options.dryRun,
47+
pluginName: PLUGIN_NAME,
48+
pluginVersion: PLUGIN_VERSION,
49+
options,
50+
});
51+
4252
if (options.enableBundleAnalysis) {
4353
plugins.push(
54+
telemetryPlugin({
55+
sentryClient: sentryConfig.sentryClient,
56+
sentryScope: sentryConfig.sentryScope,
57+
shouldSendTelemetry: options.telemetry,
58+
}),
4459
remixBundleAnalysisPlugin({
4560
output,
4661
pluginName: PLUGIN_NAME,

packages/remix-vite-plugin/src/remix-bundle-analysis/__tests__/remixBundleAnalysisPlugin.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ describe("remixBundleAnalysisPlugin", () => {
1919
enableBundleAnalysis: true,
2020
retryCount: 1,
2121
uploadToken: "test-token",
22+
telemetry: false,
2223
}),
2324
pluginName: PLUGIN_NAME,
2425
pluginVersion: PLUGIN_VERSION,

packages/rollup-plugin/src/index.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import {
1010
checkNodeVersion,
1111
Output,
1212
handleErrors,
13+
createSentryInstance,
14+
telemetryPlugin,
1315
} from "@codecov/bundler-plugin-core";
1416

1517
import { rollupBundleAnalysisPlugin } from "./rollup-bundle-analysis/rollupBundleAnalysisPlugin";
@@ -36,10 +38,23 @@ const codecovRollupPluginFactory = createRollupPlugin<Options, true>(
3638
}
3739

3840
const plugins: UnpluginOptions[] = [];
39-
const output = new Output(normalizedOptions.options);
4041
const options = normalizedOptions.options;
42+
const output = new Output(options);
43+
const sentryConfig = createSentryInstance({
44+
enableTelemetry: options.telemetry,
45+
isDryRun: options.dryRun,
46+
pluginName: PLUGIN_NAME,
47+
pluginVersion: PLUGIN_VERSION,
48+
options,
49+
});
50+
4151
if (options.enableBundleAnalysis) {
4252
plugins.push(
53+
telemetryPlugin({
54+
sentryClient: sentryConfig.sentryClient,
55+
sentryScope: sentryConfig.sentryScope,
56+
shouldSendTelemetry: options.telemetry,
57+
}),
4358
rollupBundleAnalysisPlugin({
4459
output,
4560
pluginName: PLUGIN_NAME,

packages/rollup-plugin/src/rollup-bundle-analysis/__tests__/rollupBundleAnalysisPlugin.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ describe("rollupBundleAnalysisPlugin", () => {
1919
enableBundleAnalysis: true,
2020
retryCount: 1,
2121
uploadToken: "test-token",
22+
telemetry: false,
2223
}),
2324
pluginName: PLUGIN_NAME,
2425
pluginVersion: PLUGIN_VERSION,

0 commit comments

Comments
 (0)