fix(sdk): Derive the published SentryOptions type from its source - #1500
Merged
Conversation
`bundle.ts` restated `SentryOptions` as a hand-written string, so the published `.d.cts`/`.d.mts` could drift from `src/lib/sdk-types.ts` with nothing failing. That is what happened to `headers`: it works at runtime in 0.44.0, but consumers passing it get "does not exist in type 'SentryOptions'". Lift the declaration out of the source file instead, so the two cannot diverge, and guard it with a test. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
BYK
approved these changes
Aug 28, 2026
Member
|
Jared, take over the PR, get it ready for merging, fix all your and other bots' findings and then merge when PR is green. |
Replaces the fragile indexOf + "\n};" search with a regex + brace-depth scanner so the extractor does not stop early when a nested object literal is added to the type. Fixes the sentry bot finding on sdk-declarations.ts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In #759 I added the headers and missed that there is also a
bundle.tsthat has stringified types in it. With that we 1. add the missingheaderstype and 2. derive the types directly fromsrc/lib/sdk-types.ts- not sure if you're ok with the latter. I could also trim down the PR to just add theheaderstype as string