1
+ import type { BuildTimeOptionsBase , UnstableVitePluginOptions } from '@sentry/core' ;
1
2
import type { SentryVitePluginOptions } from '@sentry/vite-plugin' ;
2
3
import type { AutoInstrumentSelection } from './autoInstrument' ;
3
4
import type { SupportedSvelteKitAdapters } from './detectAdapter' ;
@@ -19,18 +20,24 @@ type SourceMapsUploadOptions = {
19
20
*
20
21
* To create an auth token, follow this guide:
21
22
* @see https://docs.sentry.io/product/accounts/auth-tokens/#organization-auth-tokens
23
+ *
24
+ * @deprecated Use option `authToken` instead of `sourceMapsUploadOptions.authToken`
22
25
*/
23
26
authToken ?: string ;
24
27
25
28
/**
26
29
* The organization slug of your Sentry organization.
27
30
* Instead of specifying this option, you can also set the `SENTRY_ORG` environment variable.
31
+ *
32
+ * @deprecated Use option `org` instead of `sourceMapsUploadOptions.org`
28
33
*/
29
34
org ?: string ;
30
35
31
36
/**
32
37
* The project slug of your Sentry project.
33
38
* Instead of specifying this option, you can also set the `SENTRY_PROJECT` environment variable.
39
+ *
40
+ * @deprecated Use option `project` instead of `sourceMapsUploadOptions.project`
34
41
*/
35
42
project ?: string ;
36
43
@@ -39,11 +46,13 @@ type SourceMapsUploadOptions = {
39
46
* It will not collect any sensitive or user-specific data.
40
47
*
41
48
* @default true
49
+ * @deprecated Use option `telemetry` instead of `sourceMapsUploadOptions.telemetry`
42
50
*/
43
51
telemetry ?: boolean ;
44
52
45
53
/**
46
54
* Options related to sourcemaps
55
+ * @deprecated Use `sourcemaps` instead of `sourceMapsUploadOptions.sourcemaps`
47
56
*/
48
57
sourcemaps ?: {
49
58
/**
@@ -55,6 +64,7 @@ type SourceMapsUploadOptions = {
55
64
*
56
65
* The globbing patterns must follow the implementation of the `glob` package.
57
66
* @see https://www.npmjs.com/package/glob#glob-primer
67
+ * @deprecated Use `sourcemaps.assets` instead of `sourceMapsUploadOptions.sourcemaps.assets`
58
68
*/
59
69
assets ?: string | Array < string > ;
60
70
@@ -65,6 +75,8 @@ type SourceMapsUploadOptions = {
65
75
* or the default value for `assets` are uploaded.
66
76
*
67
77
* The globbing patterns follow the implementation of the glob package. (https://www.npmjs.com/package/glob)
78
+ *
79
+ * @deprecated Use `sourcemaps.ignore` instead of `sourceMapsUploadOptions.sourcemaps.ignore`
68
80
*/
69
81
ignore ?: string | Array < string > ;
70
82
@@ -75,6 +87,8 @@ type SourceMapsUploadOptions = {
75
87
* @default [] - By default no files are deleted.
76
88
*
77
89
* The globbing patterns follow the implementation of the glob package. (https://www.npmjs.com/package/glob)
90
+ *
91
+ * @deprecated Use `sourcemaps.filesToDeleteAfterUpload` instead of `sourceMapsUploadOptions.sourcemaps.filesToDeleteAfterUpload`
78
92
*/
79
93
filesToDeleteAfterUpload ?: string | Array < string > ;
80
94
} ;
@@ -83,6 +97,8 @@ type SourceMapsUploadOptions = {
83
97
* Options related to managing the Sentry releases for a build.
84
98
*
85
99
* Note: Managing releases is optional and not required for uploading source maps.
100
+ *
101
+ * @deprecated Use `release` instead of `sourceMapsUploadOptions.release`
86
102
*/
87
103
release ?: {
88
104
/**
@@ -94,6 +110,8 @@ type SourceMapsUploadOptions = {
94
110
* access to git CLI and for the root directory to be a valid repository).
95
111
*
96
112
* If you didn't provide a value and the plugin can't automatically detect one, no release will be created.
113
+ *
114
+ * @deprecated Use `release.name` instead of `sourceMapsUploadOptions.release.name`
97
115
*/
98
116
name ?: string ;
99
117
@@ -102,12 +120,16 @@ type SourceMapsUploadOptions = {
102
120
* sending events.
103
121
*
104
122
* Defaults to `true`.
123
+ *
124
+ * @deprecated Use `release.inject` instead of `sourceMapsUploadOptions.release.inject`
105
125
*/
106
126
inject ?: boolean ;
107
127
} ;
108
128
109
129
/**
110
130
* The URL of the Sentry instance to upload the source maps to.
131
+ *
132
+ * @deprecated Use `sentryUrl` instead of `sourceMapsUploadOptions.url`
111
133
*/
112
134
url ?: string ;
113
135
@@ -123,105 +145,54 @@ type SourceMapsUploadOptions = {
123
145
* changes can occur at any time within a major SDK version.
124
146
*
125
147
* Furthermore, some options are untested with SvelteKit specifically. Use with caution.
126
- */
127
- unstable_sentryVitePluginOptions ?: Partial < SentryVitePluginOptions > ;
128
- } ;
129
-
130
- type BundleSizeOptimizationOptions = {
131
- /**
132
- * If set to `true`, the plugin will attempt to tree-shake (remove) any debugging code within the Sentry SDK.
133
- * Note that the success of this depends on tree shaking being enabled in your build tooling.
134
148
*
135
- * Setting this option to `true` will disable features like the SDK's `debug` option.
136
- */
137
- excludeDebugStatements ?: boolean ;
138
-
139
- /**
140
- * If set to true, the plugin will try to tree-shake tracing statements out.
141
- * Note that the success of this depends on tree shaking generally being enabled in your build.
142
- * Attention: DO NOT enable this when you're using any performance monitoring-related SDK features (e.g. Sentry.startSpan()).
149
+ * @deprecated Use `unstable_sentryVitePluginOptions` instead of `sourceMapsUploadOptions.unstable_sentryVitePluginOptions`
143
150
*/
144
- excludeTracing ?: boolean ;
145
-
146
- /**
147
- * If set to `true`, the plugin will attempt to tree-shake (remove) code related to the Sentry SDK's Session Replay Shadow DOM recording functionality.
148
- * Note that the success of this depends on tree shaking being enabled in your build tooling.
149
- *
150
- * This option is safe to be used when you do not want to capture any Shadow DOM activity via Sentry Session Replay.
151
- */
152
- excludeReplayShadowDom ?: boolean ;
153
-
154
- /**
155
- * If set to `true`, the plugin will attempt to tree-shake (remove) code related to the Sentry SDK's Session Replay `iframe` recording functionality.
156
- * Note that the success of this depends on tree shaking being enabled in your build tooling.
157
- *
158
- * You can safely do this when you do not want to capture any `iframe` activity via Sentry Session Replay.
159
- */
160
- excludeReplayIframe ?: boolean ;
161
-
162
- /**
163
- * If set to `true`, the plugin will attempt to tree-shake (remove) code related to the Sentry SDK's Session Replay's Compression Web Worker.
164
- * Note that the success of this depends on tree shaking being enabled in your build tooling.
165
- *
166
- * **Notice:** You should only do use this option if you manually host a compression worker and configure it in your Sentry Session Replay integration config via the `workerUrl` option.
167
- */
168
- excludeReplayWorker ?: boolean ;
151
+ unstable_sentryVitePluginOptions ?: Partial < SentryVitePluginOptions > ;
169
152
} ;
170
153
171
154
/** Options for the Sentry SvelteKit plugin */
172
- export type SentrySvelteKitPluginOptions = {
173
- /**
174
- * If this flag is `true`, the Sentry plugins will log some useful debug information.
175
- * @default false.
176
- */
177
- debug ?: boolean ;
178
-
179
- /**
180
- * The Sentry plugin will automatically instrument certain parts of your SvelteKit application at build time.
181
- * Set this option to `false` to disable this behavior or what is intrumented by passing an object.
182
- *
183
- * Auto instrumentation includes:
184
- * - Universal `load` functions in `+page.(js|ts)` files
185
- * - Server-only `load` functions in `+page.server.(js|ts)` files
186
- *
187
- * @default true (meaning, the plugin will instrument all of the above)
188
- */
189
- autoInstrument ?: boolean | AutoInstrumentSelection ;
190
-
191
- /**
192
- * Specify which SvelteKit adapter you're using.
193
- * By default, the SDK will attempt auto-detect the used adapter at build time and apply the
194
- * correct config for source maps upload or auto-instrumentation.
195
- *
196
- * Currently, the SDK supports the following adapters:
197
- * - node (@sveltejs/adapter-node)
198
- * - auto (@sveltejs/adapter-auto) only Vercel
199
- * - vercel (@sveltejs/adapter-auto) only Serverless functions, no edge runtime
200
- *
201
- * Set this option, if the SDK detects the wrong adapter or you want to use an adapter
202
- * that is not in this list. If you specify 'other', you'll most likely need to configure
203
- * source maps upload yourself.
204
- *
205
- * @default {} the SDK attempts to auto-detect the used adapter at build time
206
- */
207
- adapter ?: SupportedSvelteKitAdapters ;
155
+ export type SentrySvelteKitPluginOptions = BuildTimeOptionsBase &
156
+ UnstableVitePluginOptions < Partial < SentryVitePluginOptions > > & {
157
+ /**
158
+ * The Sentry plugin will automatically instrument certain parts of your SvelteKit application at build time.
159
+ * Set this option to `false` to disable this behavior or what is intrumented by passing an object.
160
+ *
161
+ * Auto instrumentation includes:
162
+ * - Universal `load` functions in `+page.(js|ts)` files
163
+ * - Server-only `load` functions in `+page.server.(js|ts)` files
164
+ *
165
+ * @default true (meaning, the plugin will instrument all of the above)
166
+ */
167
+ autoInstrument ?: boolean | AutoInstrumentSelection ;
208
168
209
- /**
210
- * Options for the Sentry Vite plugin to customize bundle size optimizations.
211
- *
212
- * These options are always read from the `sentryAstro` integration.
213
- * Do not define them in the `sentry.client.config.(js|ts)` or `sentry.server.config.(js|ts)` files.
214
- */
215
- bundleSizeOptimizations ?: BundleSizeOptimizationOptions ;
169
+ /**
170
+ * Specify which SvelteKit adapter you're using.
171
+ * By default, the SDK will attempt auto-detect the used adapter at build time and apply the
172
+ * correct config for source maps upload or auto-instrumentation.
173
+ *
174
+ * Currently, the SDK supports the following adapters:
175
+ * - node (@sveltejs/adapter-node)
176
+ * - auto (@sveltejs/adapter-auto) only Vercel
177
+ * - vercel (@sveltejs/adapter-auto) only Serverless functions, no edge runtime
178
+ *
179
+ * Set this option, if the SDK detects the wrong adapter or you want to use an adapter
180
+ * that is not in this list. If you specify 'other', you'll most likely need to configure
181
+ * source maps upload yourself.
182
+ *
183
+ * @default {} the SDK attempts to auto-detect the used adapter at build time
184
+ */
185
+ adapter ?: SupportedSvelteKitAdapters ;
216
186
217
- /**
218
- * If this flag is `true`, the Sentry plugins will automatically upload source maps to Sentry.
219
- * @default true`.
220
- */
221
- autoUploadSourceMaps ?: boolean ;
187
+ /**
188
+ * If this flag is `true`, the Sentry plugins will automatically upload source maps to Sentry.
189
+ * @default true`.
190
+ */
191
+ autoUploadSourceMaps ?: boolean ;
222
192
223
- /**
224
- * Options related to source maps upload to Sentry
225
- */
226
- sourceMapsUploadOptions ?: SourceMapsUploadOptions ;
227
- } ;
193
+ /** * Options related to source maps upload to Sentry
194
+ *
195
+ * @deprecated This option was deprecated as it adds unnecessary nesting. Put the options one level higher to the root-level of the Sentry Svelte plugin options.
196
+ */
197
+ sourceMapsUploadOptions ?: SourceMapsUploadOptions ;
198
+ } ;
0 commit comments