Skip to content

Commit 3198d12

Browse files
committed
Flatten options, remove fields that will get auto-picked up
1 parent eebbda1 commit 3198d12

File tree

3 files changed

+11
-36
lines changed

3 files changed

+11
-36
lines changed

packages/solidstart/src/vite/sourceMaps.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ export function makeSourceMapsVitePlugin(options: SourceMapsOptions): Plugin[] {
1818
if (options.debug && sourceMapsPreviouslyNotEnabled) {
1919
// eslint-disable-next-line no-console
2020
console.log('[Sentry SolidStart Plugin] Enabling source map generation');
21-
if (!options.sourcemaps?.filesToDeleteAfterUpload) {
21+
if (!options.filesToDeleteAfterUpload) {
2222
// eslint-disable-next-line no-console
2323
console.warn(
24-
`[Sentry SolidStart PLugin] We recommend setting the \`sourceMapsUploadOptions.sourcemaps.filesToDeleteAfterUpload\` option to clean up source maps after uploading.
24+
`[Sentry SolidStart PLugin] We recommend setting the \`sourceMapsUploadOptions.filesToDeleteAfterUpload\` option to clean up source maps after uploading.
2525
[Sentry SolidStart Plugin] Otherwise, source maps might be deployed to production, depending on your configuration`,
2626
);
2727
}
@@ -41,9 +41,7 @@ export function makeSourceMapsVitePlugin(options: SourceMapsOptions): Plugin[] {
4141
authToken: options.authToken ?? process.env.SENTRY_AUTH_TOKEN,
4242
telemetry: options.telemetry ?? true,
4343
sourcemaps: {
44-
assets: options.sourcemaps?.assets ?? undefined,
45-
ignore: options.sourcemaps?.ignore ?? undefined,
46-
filesToDeleteAfterUpload: options.sourcemaps?.filesToDeleteAfterUpload ?? undefined,
44+
filesToDeleteAfterUpload: options.filesToDeleteAfterUpload ?? undefined,
4745
...options.unstable_sentryVitePluginOptions?.sourcemaps,
4846
},
4947
_metaOptions: {

packages/solidstart/src/vite/types.ts

+7-30
Original file line numberDiff line numberDiff line change
@@ -40,37 +40,14 @@ export type SourceMapsOptions = {
4040
telemetry?: boolean;
4141

4242
/**
43-
* Options related to sourcemaps
43+
* A glob or an array of globs that specifies the build artifacts that should be deleted after the artifact
44+
* upload to Sentry has been completed.
45+
*
46+
* @default [] - By default no files are deleted.
47+
*
48+
* The globbing patterns follow the implementation of the glob package. (https://www.npmjs.com/package/glob)
4449
*/
45-
sourcemaps?: {
46-
/**
47-
* A glob or an array of globs that specify the build artifacts and source maps that will be uploaded to Sentry.
48-
*
49-
* The globbing patterns must follow the implementation of the `glob` package.
50-
* @see https://www.npmjs.com/package/glob#glob-primer
51-
*/
52-
assets?: string | Array<string>;
53-
54-
/**
55-
* A glob or an array of globs that specifies which build artifacts should not be uploaded to Sentry.
56-
*
57-
* @default [] - By default no files are ignored. Thus, all files matching the `assets` glob
58-
* or the default value for `assets` are uploaded.
59-
*
60-
* The globbing patterns follow the implementation of the glob package. (https://www.npmjs.com/package/glob)
61-
*/
62-
ignore?: string | Array<string>;
63-
64-
/**
65-
* A glob or an array of globs that specifies the build artifacts that should be deleted after the artifact
66-
* upload to Sentry has been completed.
67-
*
68-
* @default [] - By default no files are deleted.
69-
*
70-
* The globbing patterns follow the implementation of the glob package. (https://www.npmjs.com/package/glob)
71-
*/
72-
filesToDeleteAfterUpload?: string | Array<string>;
73-
};
50+
filesToDeleteAfterUpload?: string | Array<string>;
7451

7552
/**
7653
* Options to further customize the Sentry Vite Plugin (@sentry/vite-plugin) behavior directly.

packages/solidstart/test/vite/sourceMaps.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { SentryVitePluginOptions } from '@sentry/vite-plugin';
1+
import type { SentryVitePluginOptions } from '@sentry/vite-plugin';
22
import { beforeEach, describe, expect, it, vi } from 'vitest';
33
import { makeSourceMapsVitePlugin } from '../../src/vite/sourceMaps';
44

0 commit comments

Comments
 (0)