@sentry/bundler-plugins 10.69.0 → 11.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/build/cjs/core/build-plugin-manager.js +8 -2
  2. package/build/cjs/core/build-plugin-manager.js.map +1 -1
  3. package/build/cjs/core/debug-id-upload.js +20 -16
  4. package/build/cjs/core/debug-id-upload.js.map +1 -1
  5. package/build/cjs/core/options-mapping.js +1 -0
  6. package/build/cjs/core/options-mapping.js.map +1 -1
  7. package/build/cjs/core/sentry/telemetry.js +3 -0
  8. package/build/cjs/core/sentry/telemetry.js.map +1 -1
  9. package/build/cjs/core/version.js +1 -1
  10. package/build/cjs/core/version.js.map +1 -1
  11. package/build/esm/core/build-plugin-manager.js +8 -2
  12. package/build/esm/core/build-plugin-manager.js.map +1 -1
  13. package/build/esm/core/debug-id-upload.js +20 -16
  14. package/build/esm/core/debug-id-upload.js.map +1 -1
  15. package/build/esm/core/options-mapping.js +1 -0
  16. package/build/esm/core/options-mapping.js.map +1 -1
  17. package/build/esm/core/sentry/telemetry.js +3 -0
  18. package/build/esm/core/sentry/telemetry.js.map +1 -1
  19. package/build/esm/core/version.js +1 -1
  20. package/build/esm/core/version.js.map +1 -1
  21. package/build/esm/package.json +1 -1
  22. package/build/types/core/build-plugin-manager.d.ts.map +1 -1
  23. package/build/types/core/debug-id-upload.d.ts.map +1 -1
  24. package/build/types/core/index.d.ts +1 -1
  25. package/build/types/core/index.d.ts.map +1 -1
  26. package/build/types/core/options-mapping.d.ts.map +1 -1
  27. package/build/types/core/sentry/telemetry.d.ts.map +1 -1
  28. package/build/types/core/utils.d.ts.map +1 -1
  29. package/build/types/core/version.d.ts +1 -1
  30. package/build/types/core/version.d.ts.map +1 -1
  31. package/build/types/esbuild/index.d.ts.map +1 -1
  32. package/build/types/rollup/index.d.ts +2 -2
  33. package/build/types/rollup/index.d.ts.map +1 -1
  34. package/build/types/vite/index.d.ts.map +1 -1
  35. package/build/types/webpack/webpack4and5.d.ts.map +1 -1
  36. package/package.json +9 -10
  37. package/build/types-ts3.8/babel-plugin/component-annotation.d.ts +0 -27
  38. package/build/types-ts3.8/babel-plugin/constants.d.ts +0 -27
  39. package/build/types-ts3.8/babel-plugin/experimental.d.ts +0 -51
  40. package/build/types-ts3.8/babel-plugin/index.d.ts +0 -56
  41. package/build/types-ts3.8/core/build-plugin-manager.d.ts +0 -82
  42. package/build/types-ts3.8/core/component-annotation-vite-ast.d.ts +0 -57
  43. package/build/types-ts3.8/core/component-annotation-vite-fragments.d.ts +0 -3
  44. package/build/types-ts3.8/core/component-annotation-vite-jsx.d.ts +0 -16
  45. package/build/types-ts3.8/core/component-annotation-vite-walk.d.ts +0 -3
  46. package/build/types-ts3.8/core/component-annotation-vite.d.ts +0 -6
  47. package/build/types-ts3.8/core/debug-id-upload.d.ts +0 -17
  48. package/build/types-ts3.8/core/glob.d.ts +0 -5
  49. package/build/types-ts3.8/core/index.d.ts +0 -53
  50. package/build/types-ts3.8/core/logger.d.ts +0 -14
  51. package/build/types-ts3.8/core/options-mapping.d.ts +0 -82
  52. package/build/types-ts3.8/core/sentry/telemetry.d.ts +0 -14
  53. package/build/types-ts3.8/core/sentry/transports.d.ts +0 -5
  54. package/build/types-ts3.8/core/types.d.ts +0 -570
  55. package/build/types-ts3.8/core/utils.d.ts +0 -87
  56. package/build/types-ts3.8/core/version.d.ts +0 -2
  57. package/build/types-ts3.8/esbuild/index.d.ts +0 -6
  58. package/build/types-ts3.8/rollup/index.d.ts +0 -67
  59. package/build/types-ts3.8/vite/index.d.ts +0 -9
  60. package/build/types-ts3.8/webpack/component-annotation-transform.d.ts +0 -11
  61. package/build/types-ts3.8/webpack/index.d.ts +0 -5
  62. package/build/types-ts3.8/webpack/webpack4and5.d.ts +0 -99
  63. package/build/types-ts3.8/webpack/webpack5.d.ts +0 -5
@@ -1,82 +0,0 @@
1
- import { Logger } from './logger';
2
- import { Options as UserOptions, SetCommitsOptions, RewriteSourcesHook, ResolveSourceMapHook, IncludeEntry, ModuleMetadata, ModuleMetadataCallback } from './types';
3
- export type NormalizedOptions = {
4
- org: string | undefined;
5
- project: string | string[] | undefined;
6
- authToken: string | undefined;
7
- url: string;
8
- headers: Record<string, string> | undefined;
9
- debug: boolean;
10
- silent: boolean;
11
- errorHandler: ((err: Error) => void) | undefined;
12
- telemetry: boolean;
13
- disable: boolean;
14
- sourcemaps: {
15
- disable?: boolean | 'disable-upload';
16
- assets?: string | string[];
17
- ignore?: string | string[];
18
- rewriteSources?: RewriteSourcesHook;
19
- resolveSourceMap?: ResolveSourceMapHook;
20
- filesToDeleteAfterUpload?: string | string[] | Promise<string | string[] | undefined>;
21
- } | undefined;
22
- release: {
23
- name: string | undefined;
24
- inject: boolean;
25
- create: boolean;
26
- finalize: boolean;
27
- vcsRemote: string;
28
- setCommits: (SetCommitsOptions & {
29
- shouldNotThrowOnFailure?: boolean;
30
- }) | false | undefined;
31
- dist?: string;
32
- deploy?: {
33
- env: string;
34
- started?: number | string;
35
- finished?: number | string;
36
- time?: number;
37
- name?: string;
38
- url?: string;
39
- } | false;
40
- uploadLegacySourcemaps?: string | IncludeEntry | Array<string | IncludeEntry>;
41
- };
42
- bundleSizeOptimizations: {
43
- excludeDebugStatements?: boolean;
44
- excludeTracing?: boolean;
45
- excludeReplayCanvas?: boolean;
46
- excludeReplayShadowDom?: boolean;
47
- excludeReplayIframe?: boolean;
48
- excludeReplayWorker?: boolean;
49
- } | undefined;
50
- reactComponentAnnotation: {
51
- enabled?: boolean;
52
- ignoredComponents?: string[];
53
- _experimentalInjectIntoHtml?: boolean;
54
- } | undefined;
55
- _metaOptions: {
56
- telemetry: {
57
- metaFramework: string | undefined;
58
- bundlerMajorVersion: string | undefined;
59
- };
60
- };
61
- applicationKey: string | undefined;
62
- moduleMetadata: ModuleMetadata | ModuleMetadataCallback | undefined;
63
- _experiments: {
64
- injectBuildInformation?: boolean;
65
- } & Record<string, unknown>;
66
- };
67
- export declare const SENTRY_SAAS_URL = "https://sentry.io";
68
- export declare function normalizeUserOptions(userOptions: UserOptions): NormalizedOptions;
69
- /**
70
- * Validates a few combinations of options that are not checked by Sentry CLI.
71
- *
72
- * For all other options, we can rely on Sentry CLI to validate them. In fact,
73
- * we can't validate them in the plugin because Sentry CLI might pick up options from
74
- * its config file.
75
- *
76
- * @param options the internal options
77
- * @param logger the logger
78
- *
79
- * @returns `true` if the options are valid, `false` otherwise
80
- */
81
- export declare function validateOptions(options: NormalizedOptions, logger: Logger): boolean;
82
- //# sourceMappingURL=options-mapping.d.ts.map
@@ -1,14 +0,0 @@
1
- import { Client } from '@sentry/core';
2
- import { NormalizedOptions } from '../options-mapping';
3
- import { Scope } from '@sentry/core';
4
- export declare function createSentryInstance(options: NormalizedOptions, shouldSendTelemetry: Promise<boolean>, buildTool: string, buildToolMajorVersion: string | undefined): {
5
- sentryScope: Scope;
6
- sentryClient: Client;
7
- };
8
- export declare function setTelemetryDataOnScope(options: NormalizedOptions, scope: Scope, buildTool: string, buildToolMajorVersion?: string): void;
9
- export declare function allowedToSendTelemetry(options: NormalizedOptions): Promise<boolean>;
10
- /**
11
- * Flushing the SDK client can fail. We never want to crash the plugin because of telemetry.
12
- */
13
- export declare function safeFlushTelemetry(sentryClient: Client): Promise<void>;
14
- //# sourceMappingURL=telemetry.d.ts.map
@@ -1,5 +0,0 @@
1
- import { BaseTransportOptions, Transport } from '@sentry/core';
2
- /** A transport that can be optionally enabled as a later time than it's
3
- * creation */
4
- export declare function makeOptionallyEnabledNodeTransport(shouldSendTelemetry: Promise<boolean>): (options: BaseTransportOptions) => Transport;
5
- //# sourceMappingURL=transports.d.ts.map
@@ -1,570 +0,0 @@
1
- export interface Options {
2
- /**
3
- * The slug of the Sentry organization associated with the app.
4
- *
5
- * This value can also be specified via the `SENTRY_ORG` environment variable.
6
- */
7
- org?: string;
8
- /**
9
- * The slug of the Sentry project associated with the app.
10
- *
11
- * When uploading source maps, you can specify multiple projects (as an array) to upload
12
- * the same source maps to multiple projects. This is useful in monorepo environments
13
- * where multiple projects share the same release.
14
- *
15
- * This value can also be specified via the `SENTRY_PROJECT` environment variable.
16
- */
17
- project?: string | string[];
18
- /**
19
- * The authentication token to use for all communication with Sentry.
20
- * Can be obtained from https://sentry.io/orgredirect/organizations/:orgslug/settings/auth-tokens/.
21
- *
22
- * This value can also be specified via the `SENTRY_AUTH_TOKEN` environment variable.
23
- *
24
- * @see https://docs.sentry.io/product/accounts/auth-tokens/#organization-auth-tokens
25
- */
26
- authToken?: string | undefined;
27
- /**
28
- * The base URL of your Sentry instance. Use this if you are using a self-hosted
29
- * or Sentry instance other than sentry.io.
30
- *
31
- * This value can also be set via the `SENTRY_URL` environment variable.
32
- *
33
- * @default "https://sentry.io" (correct value for SaaS customers)
34
- */
35
- url?: string;
36
- /**
37
- * Additional headers to send with every outgoing request to Sentry.
38
- */
39
- headers?: Record<string, string>;
40
- /**
41
- * Enable debug information logs during build-time.
42
- * Enabling this will give you, for example, logs about source maps.
43
- *
44
- * This option also propagates the debug flag to the Sentry CLI by setting
45
- * the `SENTRY_LOG_LEVEL` environment variable to `"debug"` if it's not already set.
46
- * If you have explicitly set `SENTRY_LOG_LEVEL`, this option will be ignored.
47
- *
48
- * @default false
49
- */
50
- debug?: boolean;
51
- /**
52
- * Suppresses all build logs (all log levels, including errors).
53
- *
54
- * @default false
55
- */
56
- silent?: boolean;
57
- /**
58
- * When an error occurs during release creation or sourcemaps upload, the plugin will call this function.
59
- *
60
- * By default, the plugin will simply throw an error, thereby stopping the bundling process.
61
- * If an `errorHandler` callback is provided, compilation will continue, unless an error is
62
- * thrown in the provided callback.
63
- *
64
- * To allow compilation to continue but still emit a warning, set this option to the following:
65
- *
66
- * ```js
67
- * (err) => {
68
- * console.warn(err);
69
- * }
70
- * ```
71
- */
72
- errorHandler?: (err: Error) => void;
73
- /**
74
- * If this flag is `true`, internal plugin errors and performance data will be sent to Sentry.
75
- * It will not collect any sensitive or user-specific data.
76
- *
77
- * At Sentry, we like to use Sentry ourselves to deliver faster and more stable products.
78
- * We're very careful of what we're sending. We won't collect anything other than error
79
- * and high-level performance data. We will never collect your code or any details of the
80
- * projects in which you're using this plugin.
81
- *
82
- * @default true
83
- */
84
- telemetry?: boolean;
85
- /**
86
- * Completely disables all functionality of the plugin.
87
- *
88
- * Defaults to `false`.
89
- */
90
- disable?: boolean;
91
- /**
92
- * Options related to source maps upload and processing.
93
- */
94
- sourcemaps?: {
95
- /**
96
- * Disables all functionality related to sourcemaps if set to `true`.
97
- *
98
- * If set to `"disable-upload"`, the plugin will not upload sourcemaps to Sentry, but will inject debug IDs into the build artifacts.
99
- * This is useful if you want to manually upload sourcemaps to Sentry at a later point in time.
100
- *
101
- * @default false
102
- */
103
- disable?: boolean | 'disable-upload';
104
- /**
105
- * A glob or an array of globs that specify the build artifacts and source maps that will be uploaded to Sentry.
106
- *
107
- * The globbing patterns must follow the implementation of the `glob` package: https://www.npmjs.com/package/glob#glob-primer
108
- *
109
- * If this option is not specified, the plugin will try to upload all JavaScript files and source map files that are created during build.
110
- *
111
- * Use the `debug` option to print information about which files end up being uploaded.
112
- *
113
- */
114
- assets?: string | string[];
115
- /**
116
- * A glob or an array of globs that specifies which build artifacts should not be uploaded to Sentry.
117
- *
118
- * The globbing patterns must follow the implementation of the `glob` package: https://www.npmjs.com/package/glob#glob-primer
119
- *
120
- * Use the `debug` option to print information about which files end up being uploaded.
121
- *
122
- * @default []
123
- */
124
- ignore?: string | string[];
125
- /**
126
- * Hook to rewrite the `sources` field inside the source map before being uploaded to Sentry. Does not modify the actual source map.
127
- *
128
- * The hook receives the source path, the parsed source map object, and a context object containing `mapDir` -
129
- * the directory of the source map file, useful for resolving relative source paths.
130
- *
131
- * Defaults to making all sources relative to `process.cwd()` while building.
132
- */
133
- rewriteSources?: RewriteSourcesHook;
134
- /**
135
- * Hook to customize source map file resolution.
136
- *
137
- * The hook is called with the absolute path of the build artifact and the value of the `//# sourceMappingURL=`
138
- * comment, if present. The hook should then return an absolute path (or a promise that resolves to one) indicating
139
- * where to find the artifact's corresponding source map file. If no path is returned or the returned path doesn't
140
- * exist, the standard source map resolution process will be used.
141
- *
142
- * The standard process first tries to resolve based on the `//# sourceMappingURL=` value (it supports `file://`
143
- * urls and absolute/relative paths). If that path doesn't exist, it then looks for a file named
144
- * `${artifactName}.map` in the same directory as the artifact.
145
- *
146
- * Note: This is mostly helpful for complex builds with custom source map generation. For example, if you put source
147
- * maps into a separate directory and rewrite the `//# sourceMappingURL=` comment to something other than a relative
148
- * directory, sentry will be unable to locate the source maps for a given build artifact. This hook allows you to
149
- * implement the resolution process yourself.
150
- *
151
- * Use the `debug` option to print information about source map resolution.
152
- */
153
- resolveSourceMap?: ResolveSourceMapHook;
154
- /**
155
- * A glob or an array of globs that specifies the build artifacts that should be deleted after the artifact upload to Sentry has been completed.
156
- *
157
- * Note: If you pass in a Promise that resolves to a string or array, the plugin will await the Promise and use
158
- * the resolved value globs. This is useful if you need to dynamically determine the files to delete. Some
159
- * higher-level Sentry SDKs or options use this feature (e.g., SvelteKit).
160
- *
161
- * The globbing patterns must follow the implementation of the `glob` package: https://www.npmjs.com/package/glob#glob-primer
162
- *
163
- * Use the `debug` option to print information about which files end up being deleted.
164
- */
165
- filesToDeleteAfterUpload?: string | string[] | Promise<string | string[] | undefined>;
166
- };
167
- /**
168
- * Options related to managing the Sentry releases for a build.
169
- *
170
- * More info: https://docs.sentry.io/product/releases/
171
- */
172
- release?: {
173
- /**
174
- * Unique identifier for the release you want to create.
175
- *
176
- * This value can also be specified via the `SENTRY_RELEASE` environment variable.
177
- *
178
- * Defaults to automatically detecting a value for your environment.
179
- * This includes values for Cordova, Heroku, AWS CodeBuild, CircleCI, Xcode, and Gradle, and otherwise uses the git `HEAD`'s commit SHA
180
- * (the latter requires access to git CLI and for the root directory to be a valid repository).
181
- *
182
- * If no `name` is provided and the plugin can't automatically detect one, no release will be created.
183
- */
184
- name?: string;
185
- /**
186
- * Whether the plugin should inject release information into the build for the SDK to pick it up when sending events. (recommended)
187
- *
188
- * Defaults to `true`.
189
- */
190
- inject?: boolean;
191
- /**
192
- * Whether the plugin should create a release on Sentry during the build.
193
- *
194
- * Note that a release may still appear in Sentry even if this value is `false`. Any Sentry event that has a release value attached
195
- * will automatically create a release (for example, via the `inject` option).
196
- *
197
- * @default true
198
- */
199
- create?: boolean;
200
- /**
201
- * Whether to automatically finalize the release. The release is finalized by adding an end timestamp after the build ends.
202
- *
203
- * @default true
204
- */
205
- finalize?: boolean;
206
- /**
207
- * Unique distribution identifier for the release. Used to further segment the release.
208
- *
209
- * Usually your build number.
210
- */
211
- dist?: string;
212
- /**
213
- * Version control system (VCS) remote name.
214
- *
215
- * This value can also be specified via the `SENTRY_VSC_REMOTE` environment variable.
216
- *
217
- * @default "origin"
218
- */
219
- vcsRemote?: string;
220
- /**
221
- * Configuration for associating the release with its commits in Sentry.
222
- *
223
- * Set to `false` to disable commit association.
224
- *
225
- * @default { auto: true }
226
- */
227
- setCommits?: SetCommitsOptions | false;
228
- /**
229
- * Configuration for adding deployment information to the release in Sentry.
230
- *
231
- * Set to `false` to disable automatic deployment detection and creation.
232
- */
233
- deploy?: DeployOptions | false;
234
- /**
235
- * Legacy method of uploading source maps. (not recommended unless necessary)
236
- *
237
- * One or more paths that should be scanned recursively for sources.
238
- *
239
- * Each path can be given as a string or an object with more specific options.
240
- *
241
- * The modern version of doing source maps upload is more robust and way easier to get working but has to inject a very small snippet of JavaScript into your output bundles.
242
- * In situations where this leads to problems (e.g subresource integrity) you can use this option as a fallback.
243
- */
244
- uploadLegacySourcemaps?: string | IncludeEntry | Array<string | IncludeEntry>;
245
- };
246
- /**
247
- * Options for bundle size optimizations by excluding certain features.
248
- */
249
- bundleSizeOptimizations?: {
250
- /**
251
- * Exclude debug statements from the bundle, thus disabling features like the SDK's `debug` option.
252
- *
253
- * If set to `true`, the plugin will attempt to tree-shake (remove) any debugging code within the Sentry SDK during the build.
254
- * Note that the success of this depends on tree-shaking being enabled in your build tooling.
255
- *
256
- * @default false
257
- */
258
- excludeDebugStatements?: boolean;
259
- /**
260
- * Exclude tracing functionality from the bundle, thus disabling features like performance monitoring.
261
- *
262
- * If set to `true`, the plugin will attempt to tree-shake (remove) code within the Sentry SDK that is related to tracing and performance monitoring.
263
- * Note that the success of this depends on tree-shaking being enabled in your build tooling.
264
- *
265
- * **Notice:** Do not enable this when you're using any performance monitoring-related SDK features (e.g. `Sentry.startTransaction()`).
266
-
267
- * @default false
268
- */
269
- excludeTracing?: boolean;
270
- /**
271
- * If set to `true`, the plugin will attempt to tree-shake (remove) code related to the Sentry SDK's Session Replay Canvas recording functionality.
272
- * Note that the success of this depends on tree-shaking being enabled in your build tooling.
273
- *
274
- * You can safely do this when you do not want to capture any Canvas activity via Sentry Session Replay.
275
- *
276
- * @deprecated In versions v7.78.0 and later of the Sentry JavaScript SDKs, canvas recording is opt-in making this option redundant.
277
- */
278
- excludeReplayCanvas?: boolean;
279
- /**
280
- * Exclude Replay Shadow DOM functionality from the bundle.
281
- *
282
- * 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.
283
- * Note that the success of this depends on tree-shaking being enabled in your build tooling.
284
- *
285
- * This option is safe to be used when you do not want to capture any Shadow DOM activity via Sentry Session Replay.
286
- *
287
- * @default false
288
- */
289
- excludeReplayShadowDom?: boolean;
290
- /**
291
- * Exclude Replay iFrame functionality from the bundle.
292
- *
293
- * If set to `true`, the Sentry SDK will attempt to tree-shake (remove) code related to the Sentry SDK's Session Replay `iframe` recording functionality.
294
- * Note that the success of this depends on tree-shaking being enabled in your build tooling.
295
- *
296
- * You can safely do this when you do not want to capture any `iframe` activity via Sentry Session Replay.
297
- *
298
- * @default false
299
- */
300
- excludeReplayIframe?: boolean;
301
- /**
302
- * Exclude Replay worker functionality from the bundle.
303
- *
304
- * If set to `true`, the Sentry SDK will attempt to tree-shake (remove) code related to the Sentry SDK's Session Replay's Compression Web Worker.
305
- * Note that the success of this depends on tree-shaking being enabled in your build tooling.
306
- *
307
- * **Notice:** You should only use this option if you manually host a compression worker and configure it in your Sentry Session Replay integration config via the `workerUrl` option.
308
- *
309
- * @default false
310
- */
311
- excludeReplayWorker?: boolean;
312
- };
313
- /**
314
- * Options related to react component name annotations.
315
- * Disabled by default, unless a value is set for this option.
316
- * When enabled, your app's DOM will automatically be annotated during build-time with their respective component names.
317
- * This will unlock the capability to search for Replays in Sentry by component name, as well as see component names in breadcrumbs and performance monitoring.
318
- * Please note that this feature is not currently supported by the esbuild bundler plugins, and will only annotate React components
319
- */
320
- reactComponentAnnotation?: {
321
- /**
322
- * Whether the component name annotate plugin should be enabled or not.
323
- */
324
- enabled?: boolean;
325
- /**
326
- * A list of strings representing the names of components to ignore. The plugin will not apply `data-sentry` annotations on the DOM element for these components.
327
- */
328
- ignoredComponents?: string[];
329
- /**
330
- * An experimental component annotation injection mode that injects
331
- * annotations into HTML rather than React components.
332
- */
333
- _experimentalInjectIntoHtml?: boolean;
334
- };
335
- /**
336
- * Metadata that should be associated with the built application.
337
- *
338
- * The metadata is serialized and can be looked up at runtime from within the SDK (for example in the `beforeSend`,
339
- * event processors, or the transport), allowing for custom event filtering logic or routing of events.
340
- *
341
- * Metadata can either be passed directly or alternatively a callback can be provided that will be
342
- * called with the following parameters:
343
- * - `org`: The organization slug.
344
- * - `project`: The project slug (when multiple projects are configured, this is the first project).
345
- * - `projects`: An array of all project slugs (available when multiple projects are configured).
346
- * - `release`: The release name.
347
- */
348
- moduleMetadata?: ModuleMetadata | ModuleMetadataCallback;
349
- /**
350
- * A key which will embedded in all the bundled files. The SDK will be able to use the key to apply filtering
351
- * rules, for example using the `thirdPartyErrorFilterIntegration`.
352
- */
353
- applicationKey?: string;
354
- /**
355
- * Options that are considered experimental and subject to change.
356
- *
357
- * @experimental API that does not follow semantic versioning and may change in any release
358
- */
359
- _experiments?: {
360
- /**
361
- * If set to true, the plugin will inject an additional `SENTRY_BUILD_INFO` variable.
362
- * This contains information about the build, e.g. dependencies, node version and other useful data.
363
- *
364
- * Defaults to `false`.
365
- */
366
- injectBuildInformation?: boolean;
367
- } & Record<string, unknown>;
368
- /**
369
- * Options that are useful for building wrappers around the plugin. You likely don't need these options unless you
370
- * are distributing a tool that depends on this plugin
371
- */
372
- _metaOptions?: {
373
- /**
374
- * Overrides the prefix that come before logger messages. (e.g. `[some-prefix] Info: Some log message`)
375
- *
376
- * Example value: `[sentry-webpack-plugin (client)]`
377
- */
378
- loggerPrefixOverride?: string;
379
- /**
380
- * Arbitrary telemetry items.
381
- */
382
- telemetry?: {
383
- /**
384
- * The meta framework using the plugin.
385
- */
386
- metaFramework?: string;
387
- /**
388
- * The major version of the bundler (e.g., "4" or "5" for webpack).
389
- */
390
- bundlerMajorVersion?: string;
391
- };
392
- };
393
- }
394
- export type RewriteSourcesHook = (source: string, map: any, context?: {
395
- mapDir: string;
396
- }) => string;
397
- export type ResolveSourceMapHook = (artifactPath: string, sourceMappingUrl: string | undefined) => string | undefined | Promise<string | undefined>;
398
- export interface ModuleMetadata {
399
- [key: string]: any;
400
- }
401
- export interface ModuleMetadataCallbackArgs {
402
- org?: string;
403
- project?: string;
404
- projects?: string[];
405
- release?: string;
406
- }
407
- export type ModuleMetadataCallback = (args: ModuleMetadataCallbackArgs) => ModuleMetadata;
408
- export type IncludeEntry = {
409
- /**
410
- * One or more paths to scan for files to upload.
411
- */
412
- paths: string[];
413
- /**
414
- * One or more paths to ignore during upload.
415
- * Overrides entries in ignoreFile file.
416
- *
417
- * Defaults to `['node_modules']` if neither `ignoreFile` nor `ignore` is set.
418
- */
419
- ignore?: string | string[];
420
- /**
421
- * Path to a file containing list of files/directories to ignore.
422
- *
423
- * Can point to `.gitignore` or anything with the same format.
424
- */
425
- ignoreFile?: string;
426
- /**
427
- * Array of file extensions of files to be collected for the file upload.
428
- *
429
- * By default the following file extensions are processed: js, map, jsbundle and bundle.
430
- */
431
- ext?: string[];
432
- /**
433
- * URL prefix to add to the beginning of all filenames.
434
- * Defaults to '~/' but you might want to set this to the full URL.
435
- *
436
- * This is also useful if your files are stored in a sub folder. eg: url-prefix '~/static/js'.
437
- */
438
- urlPrefix?: string;
439
- /**
440
- * URL suffix to add to the end of all filenames.
441
- * Useful for appending query parameters.
442
- */
443
- urlSuffix?: string;
444
- /**
445
- * When paired with the `rewrite` option, this will remove a prefix from filename references inside of
446
- * sourcemaps. For instance you can use this to remove a path that is build machine specific.
447
- * Note that this will NOT change the names of uploaded files.
448
- */
449
- stripPrefix?: string[];
450
- /**
451
- * When paired with the `rewrite` option, this will add `~` to the `stripPrefix` array.
452
- *
453
- * Defaults to `false`.
454
- */
455
- stripCommonPrefix?: boolean;
456
- /**
457
- * Determines whether sentry-cli should attempt to link minified files with their corresponding maps.
458
- * By default, it will match files and maps based on name, and add a Sourcemap header to each minified file
459
- * for which it finds a map. Can be disabled if all minified files contain sourceMappingURL.
460
- *
461
- * Defaults to true.
462
- */
463
- sourceMapReference?: boolean;
464
- /**
465
- * Enables rewriting of matching source maps so that indexed maps are flattened and missing sources
466
- * are inlined if possible.
467
- *
468
- * Defaults to true
469
- */
470
- rewrite?: boolean;
471
- /**
472
- * When `true`, attempts source map validation before upload if rewriting is not enabled.
473
- * It will spot a variety of issues with source maps and cancel the upload if any are found.
474
- *
475
- * Defaults to `false` as this can cause false positives.
476
- */
477
- validate?: boolean;
478
- };
479
- export interface SentrySDKBuildFlags extends Record<string, boolean | undefined> {
480
- __SENTRY_DEBUG__?: boolean;
481
- __SENTRY_TRACING__?: boolean;
482
- __RRWEB_EXCLUDE_CANVAS__?: boolean;
483
- __RRWEB_EXCLUDE_IFRAME__?: boolean;
484
- __RRWEB_EXCLUDE_SHADOW_DOM__?: boolean;
485
- __SENTRY_EXCLUDE_REPLAY_WORKER__?: boolean;
486
- }
487
- export type SetCommitsOptions = (AutoSetCommitsOptions | ManualSetCommitsOptions) & {
488
- /**
489
- * The commit before the beginning of this release (in other words,
490
- * the last commit of the previous release).
491
- *
492
- * Defaults to the last commit of the previous release in Sentry.
493
- *
494
- * If there was no previous release, the last 10 commits will be used.
495
- */
496
- previousCommit?: string;
497
- /**
498
- * If the flag is to `true` and the previous release commit was not found
499
- * in the repository, the plugin creates a release with the default commits
500
- * count instead of failing the command.
501
- *
502
- * Defaults to `false`.
503
- */
504
- ignoreMissing?: boolean;
505
- /**
506
- * If this flag is set, the setCommits step will not fail and just exit
507
- * silently if no new commits for a given release have been found.
508
- *
509
- * Defaults to `false`.
510
- */
511
- ignoreEmpty?: boolean;
512
- };
513
- type AutoSetCommitsOptions = {
514
- /**
515
- * Automatically sets `commit` and `previousCommit`. Sets `commit` to `HEAD`
516
- * and `previousCommit` as described in the option's documentation.
517
- *
518
- * If you set this to `true`, manually specified `commit` and `previousCommit`
519
- * options will be overridden. It is best to not specify them at all if you
520
- * set this option to `true`.
521
- */
522
- auto: true;
523
- repo?: undefined;
524
- commit?: undefined;
525
- };
526
- type ManualSetCommitsOptions = {
527
- auto?: false | undefined;
528
- /**
529
- * The full repo name as defined in Sentry.
530
- *
531
- * Required if the `auto` option is not set to `true`.
532
- */
533
- repo: string;
534
- /**
535
- * The current (last) commit in the release.
536
- *
537
- * Required if the `auto` option is not set to `true`.
538
- */
539
- commit: string;
540
- };
541
- type DeployOptions = {
542
- /**
543
- * Environment for this release. Values that make sense here would
544
- * be `production` or `staging`.
545
- */
546
- env: string;
547
- /**
548
- * Deployment start time in Unix timestamp (in seconds) or ISO 8601 format.
549
- */
550
- started?: number | string;
551
- /**
552
- * Deployment finish time in Unix timestamp (in seconds) or ISO 8601 format.
553
- */
554
- finished?: number | string;
555
- /**
556
- * Deployment duration (in seconds). Can be used instead of started and finished.
557
- */
558
- time?: number;
559
- /**
560
- * Human-readable name for the deployment.
561
- */
562
- name?: string;
563
- /**
564
- * URL that points to the deployment.
565
- */
566
- url?: string;
567
- };
568
- export type HandleRecoverableErrorFn = (error: unknown, throwByDefault: boolean) => void;
569
- export {};
570
- //# sourceMappingURL=types.d.ts.map