Skip to content

Commit d1dab5e

Browse files
committed
fix: types in SourceMapsOptions
1 parent bb2fc7c commit d1dab5e

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

packages/nuxt/src/common/types.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type SourceMapsOptions = {
1313
*
1414
* @default false
1515
*/
16-
silent?: SentryVitePluginOptions['silent'];
16+
silent?: boolean;
1717

1818
/**
1919
* When an error occurs during release creation or sourcemaps upload, the plugin will call this function.
@@ -30,14 +30,27 @@ type SourceMapsOptions = {
3030
* }
3131
* ```
3232
*/
33-
errorHandler?: SentryVitePluginOptions['errorHandler'];
33+
errorHandler?: (err: Error) => void;
3434

3535
/**
3636
* Options related to managing the Sentry releases for a build.
3737
*
3838
* More info: https://docs.sentry.io/product/releases/
3939
*/
40-
release?: SentryVitePluginOptions['release'];
40+
release?: {
41+
/**
42+
* Unique identifier for the release you want to create.
43+
*
44+
* This value can also be specified via the `SENTRY_RELEASE` environment variable.
45+
*
46+
* Defaults to automatically detecting a value for your environment.
47+
* This includes values for Cordova, Heroku, AWS CodeBuild, CircleCI, Xcode, and Gradle, and otherwise uses the git `HEAD`'s commit SHA.
48+
* (the latter requires access to git CLI and for the root directory to be a valid repository)
49+
*
50+
* If you didn't provide a value and the plugin can't automatically detect one, no release will be created.
51+
*/
52+
name?: string;
53+
};
4154

4255
/**
4356
* If this flag is `true`, and an auth token is detected, the Sentry SDK will

packages/nuxt/src/vite/sourceMaps.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ export function getPluginOptions(
9595
debug: moduleOptions.debug ?? false,
9696
silent: sourceMapsUploadOptions.silent ?? false,
9797
errorHandler: sourceMapsUploadOptions.errorHandler,
98-
release: sourceMapsUploadOptions.release,
98+
release: {
99+
name: sourceMapsUploadOptions.release?.name,
100+
},
99101
_metaOptions: {
100102
telemetry: {
101103
metaFramework: 'nuxt',

0 commit comments

Comments
 (0)