Skip to content

test(api): Typecheck the README examples against the packed package - #131217

Merged
BYK merged 1 commit into
masterfrom
test/api-readme-examples
Nov 16, 2026
Merged

BYK merged 1 commit into
masterfrom
test/api-readme-examples

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

The @sentry/api README is the package's main documentation, and nothing kept its TypeScript examples in step with the API. They now have to compile against the published entry points, so renaming an export or changing an argument type means updating the README in the same change.

The README's Development section explains how examples that depend on earlier ones get their context.

Part of #131204.

via @BYK.

--

View Session [Sentry]

Each ts example in the package README is now typechecked as its own module against the packed tarball, so an example that uses a renamed or removed API, or the wrong argument types, fails the tests. Names the examples use without defining them are declared in the test.

Co-Authored-By: BYK <[email protected]>
@sentry-junior
sentry-junior Bot requested review from a team as code owners November 16, 2026 11:36
@sentry-junior
sentry-junior Bot requested a review from BYK November 16, 2026 11:36
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Nov 16, 2026
@BYK
BYK merged commit 10542c9 into master Nov 16, 2026
88 checks passed
@BYK
BYK deleted the test/api-readme-examples branch November 16, 2026 13:19
BYK added a commit that referenced this pull request Nov 16, 2026
#131228 changed the `@sentry/api` README's routing example to read
`regionUrls`. #131217 merged a minute later with declarations for the
README examples that still define `regionUrlFor`, which no example uses
anymore, so the README example on master references an undeclared name.
This swaps that declaration for `regionUrls: Map<string, string>`.

<!-- junior-request-attribution:start -->
via @BYK.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3A69da19b385017e68b7f9eace56e9477f -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3A69da19b385017e68b7f9eace56e9477f)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A69da19b385017e68b7f9eace56e9477f/?project=4510944073809921)

<!-- junior-session-footer:end -->

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: BYK <[email protected]>

This branch was successfully deployed

1 active deployment
Preview — 785efd08 Deployed Nov 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant