fix(sentry): widen SentryLike so official SDKs assign without adapters
ci/woodpecker/push/ci Pipeline failed
ci/woodpecker/push/publish unknown status

This commit is contained in:
2026-08-07 16:05:09 -03:00
parent 19de8db119
commit 3c468dbf44
6 changed files with 507 additions and 10 deletions
+30
View File
@@ -0,0 +1,30 @@
/**
* Compile-time regression: official Sentry SDKs must assign to {@link SentryLike}
* without casts or consumer adapters. Checked by `pnpm check` (`tsc --noEmit`).
*/
import * as Sentry from "@sentry/node";
import { createSentrySink, type SentryLike } from "../src/sentry";
const _sdk: SentryLike = Sentry;
createSentrySink(Sentry);
createSentrySink(Sentry, { logs: true });
const stub: SentryLike = {
withScope: (callback) =>
callback({
setLevel: () => undefined,
setTag: () => undefined,
setExtras: () => undefined,
}),
captureException: () => undefined,
captureMessage: () => undefined,
logger: {
trace: () => undefined,
debug: () => undefined,
info: () => undefined,
warn: () => undefined,
error: () => undefined,
},
};
createSentrySink(stub);
createSentrySink(stub, { logs: true });