Skip to content

Commit 572c984

Browse files
author
Luca Forstner
committed
type interface
1 parent 1003d16 commit 572c984

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

packages/bundler-plugin-core/src/options-mapping.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Logger } from "./sentry/logger";
2-
import { Options as UserOptions } from "./types";
2+
import { Options as UserOptions, SetCommitsOptions } from "./types";
33
import { determineReleaseName } from "./utils";
44

55
export type NormalizedOptions = ReturnType<typeof normalizeUserOptions>;
@@ -26,7 +26,10 @@ export function normalizeUserOptions(userOptions: UserOptions) {
2626
create: userOptions.release?.create ?? true,
2727
finalize: userOptions.release?.finalize ?? true,
2828
vcsRemote: userOptions.release?.vcsRemote ?? process.env["SENTRY_VSC_REMOTE"] ?? "origin",
29-
setCommits: userOptions.release?.setCommits,
29+
setCommits: userOptions.release?.setCommits as
30+
| (SetCommitsOptions & { shouldNotThrowOnFailure?: boolean })
31+
| false
32+
| undefined,
3033
},
3134
bundleSizeOptimizations: userOptions.bundleSizeOptimizations,
3235
reactComponentAnnotation: userOptions.reactComponentAnnotation,
@@ -48,7 +51,6 @@ export function normalizeUserOptions(userOptions: UserOptions) {
4851
process.env["VERCEL_GIT_REPO_OWNER"]
4952
) {
5053
options.release.setCommits = {
51-
// @ts-expect-error This is fine
5254
shouldNotThrowOnFailure: true,
5355
commit: process.env["VERCEL_GIT_COMMIT_SHA"],
5456
previousCommit: process.env["VERCEL_GIT_PREVIOUS_SHA"],
@@ -59,7 +61,6 @@ export function normalizeUserOptions(userOptions: UserOptions) {
5961
} else {
6062
options.release.setCommits = {
6163
shouldNotThrowOnFailure: true,
62-
// @ts-expect-error This is fine
6364
auto: true,
6465
ignoreEmpty: true,
6566
ignoreMissing: true,

packages/bundler-plugin-core/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ export interface SentrySDKBuildFlags extends Record<string, boolean | undefined>
460460
__SENTRY_EXCLUDE_REPLAY_WORKER__?: boolean;
461461
}
462462

463-
type SetCommitsOptions = (AutoSetCommitsOptions | ManualSetCommitsOptions) & {
463+
export type SetCommitsOptions = (AutoSetCommitsOptions | ManualSetCommitsOptions) & {
464464
/**
465465
* The commit before the beginning of this release (in other words,
466466
* the last commit of the previous release).

0 commit comments

Comments
 (0)