Skip to content

Commit

Permalink
feat: Make options argument optional (#502)
Browse files Browse the repository at this point in the history
  • Loading branch information
lforst committed Mar 12, 2024
1 parent fe6169b commit 998df09
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/bundler-plugin-core/src/index.ts
Expand Up @@ -70,7 +70,7 @@ export function sentryUnpluginFactory({
debugIdUploadPlugin,
bundleSizeOptimizationsPlugin,
}: SentryUnpluginFactoryOptions) {
return createUnplugin<Options, true>((userOptions, unpluginMetaContext) => {
return createUnplugin<Options | undefined, true>((userOptions = {}, unpluginMetaContext) => {
const logger = createLogger({
prefix: `[sentry-${unpluginMetaContext.framework}-plugin]`,
silent: userOptions.silent ?? false,
Expand Down
2 changes: 1 addition & 1 deletion packages/esbuild-plugin/src/index.ts
Expand Up @@ -258,7 +258,7 @@ const sentryUnplugin = sentryUnpluginFactory({
});

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const sentryEsbuildPlugin: (options: Options) => any = sentryUnplugin.esbuild;
export const sentryEsbuildPlugin: (options?: Options) => any = sentryUnplugin.esbuild;

export type { Options as SentryEsbuildPluginOptions } from "@sentry/bundler-plugin-core";
export { sentryCliBinaryExists } from "@sentry/bundler-plugin-core";
2 changes: 1 addition & 1 deletion packages/rollup-plugin/src/index.ts
Expand Up @@ -67,7 +67,7 @@ const sentryUnplugin = sentryUnpluginFactory({
});

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const sentryRollupPlugin: (options: Options) => any = sentryUnplugin.rollup;
export const sentryRollupPlugin: (options?: Options) => any = sentryUnplugin.rollup;

export type { Options as SentryRollupPluginOptions } from "@sentry/bundler-plugin-core";
export { sentryCliBinaryExists } from "@sentry/bundler-plugin-core";
2 changes: 1 addition & 1 deletion packages/vite-plugin/src/index.ts
Expand Up @@ -69,7 +69,7 @@ const sentryUnplugin = sentryUnpluginFactory({
});

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const sentryVitePlugin: (options: Options) => any = sentryUnplugin.vite;
export const sentryVitePlugin: (options?: Options) => any = sentryUnplugin.vite;

export type { Options as SentryVitePluginOptions } from "@sentry/bundler-plugin-core";
export { sentryCliBinaryExists } from "@sentry/bundler-plugin-core";
2 changes: 1 addition & 1 deletion packages/webpack-plugin/src/index.ts
Expand Up @@ -174,7 +174,7 @@ const sentryUnplugin = sentryUnpluginFactory({
});

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const sentryWebpackPlugin: (options: Options) => any = sentryUnplugin.webpack;
export const sentryWebpackPlugin: (options?: Options) => any = sentryUnplugin.webpack;

export { sentryCliBinaryExists } from "@sentry/bundler-plugin-core";
export type { Options as SentryWebpackPluginOptions } from "@sentry/bundler-plugin-core";

0 comments on commit 998df09

Please sign in to comment.