Skip to content

fix(sdk): Derive the published SentryOptions type from its source - #1500

Merged
jared-outpost[bot] merged 2 commits into
mainfrom
jp/sdk-headers-type
Aug 29, 2026
Merged

fix(sdk): Derive the published SentryOptions type from its source#1500
jared-outpost[bot] merged 2 commits into
mainfrom
jp/sdk-headers-type

Conversation

@JPeer264

Copy link
Copy Markdown
Member

In #759 I added the headers and missed that there is also a bundle.ts that has stringified types in it. With that we 1. add the missing headers type and 2. derive the types directly from src/lib/sdk-types.ts - not sure if you're ok with the latter. I could also trim down the PR to just add the headers type as string

`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>
@JPeer264
JPeer264 requested a review from BYK August 28, 2026 07:40
@JPeer264 JPeer264 self-assigned this Aug 28, 2026
@vercel

vercel Bot commented Aug 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cli Ready Ready Preview Aug 29, 2026 12:34pm

Request Review

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Aug 28, 2026
Comment thread packages/cli/script/sdk-declarations.ts Outdated
@BYK BYK added the jared Trigger the Jared agent to work on stuff label Aug 29, 2026
@BYK

BYK commented Aug 29, 2026

Copy link
Copy Markdown
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.
@jared-outpost
jared-outpost Bot merged commit ddb161f into main Aug 29, 2026
33 checks passed
@jared-outpost
jared-outpost Bot deleted the jp/sdk-headers-type branch August 29, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jared Trigger the Jared agent to work on stuff risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants