Commit 5881009
fix(core): Include subpath type shims in published package (#20835)
## Summary
- Adds `browser.d.ts` and `server.d.ts` to the `files` list in
`@sentry/core` `package.json` so they are included in the published npm
tarball
- Adds `typesVersions` entries for `browser` and `server` subpaths to
support TypeScript < 5.0
## Context
PR [#20435](#20435)
introduced `@sentry/core/browser` and `@sentry/core/server` subpath
exports and added root-level `.d.ts` shim files for compatibility with
TypeScript compilers that don't support the `exports` field (e.g.
`moduleResolution: "node"`). However, the `.d.ts` shims were not added
to the `files` list, so they were excluded from the published `10.53.0`
tarball.
This breaks downstream consumers like `@sentry/react-native`
([getsentry/sentry-react-native#6139](getsentry/sentry-react-native#6139))
— their TS compiler can't resolve `@sentry/core/browser`, causing
`BaseTransportOptions` to become unresolvable and
`ReactNativeTransportOptions` to fail the type constraint check:
```
error TS2344: Type 'ReactNativeTransportOptions' does not satisfy the constraint 'BaseTransportOptions'.
Type 'ReactNativeTransportOptions' is missing the following properties from type 'BaseTransportOptions': url, recordDroppedEvent
```
## Test plan
- [ ] Verify `npm pack --dry-run` includes `browser.d.ts` and
`server.d.ts` at the package root
- [ ] Verify `@sentry/react-native` builds successfully against a
patched `@sentry/core`
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.6 <[email protected]>1 parent 6a7d179 commit 5881009
3 files changed
Lines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
54 | 56 | | |
55 | 57 | | |
56 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
57 | 65 | | |
58 | 66 | | |
59 | 67 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
0 commit comments