Skip to content

Commit e148da9

Browse files
committed
chore: Upgrade to TypeScript 7.0
Bump typescript to ~7.0.2 and apply the changes TS 7 requires: - remove downlevelIteration and baseUrl (both removed in TS 7) - set explicit rootDir on all emitting tsconfigs (now required) - add DOM lib and node types to the shared base config - scope DOM out of cloudflare (conflicts with workers-types) - source fixes: BodyInit casts on transports, readonly web-vitals globals, WebAssembly.Exception ts-expect-error removal, elysia trace handler generic, replay paint entry ts-expect-error
1 parent 30858f5 commit e148da9

73 files changed

Lines changed: 266 additions & 68 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

dev-packages/browser-integration-tests/suites/sessions/page-lifecycle/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect } from '@playwright/test';
2-
import type { SerializedSession } from '@sentry/core/src';
2+
import type { SerializedSession } from '@sentry/core';
33
import { sentryTest } from '../../../utils/fixtures';
44
import {
55
envelopeRequestParser,

dev-packages/browser-integration-tests/suites/tracing/browserTracingIntegration/linked-traces-streamed/consistent-sampling/meta-negative/test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { expect } from '@playwright/test';
2-
import type { ClientReport } from '@sentry/core';
2+
import type { ClientReport, SerializedStreamedSpan } from '@sentry/core';
33
import { extractTraceparentData, parseBaggageHeader } from '@sentry/core';
4-
import type { SerializedStreamedSpan } from '@sentry/core/src';
54
import { sentryTest } from '../../../../../../utils/fixtures';
65
import {
76
envelopeRequestParser,

dev-packages/browser-integration-tests/tsconfig.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@
33

44
"compilerOptions": {
55
"lib": ["dom", "ES2020"],
6-
"moduleResolution": "node",
6+
"moduleResolution": "bundler",
77
"noEmit": true,
88
"strict": true,
99
"allowSyntheticDefaultImports": true,
10-
"noUncheckedIndexedAccess": false
10+
"noUncheckedIndexedAccess": false,
11+
// These tests white-box internal replay state, whose types aren't published. `bundler`
12+
// resolution honors `exports` (unlike the removed `node10`), so map the deep build path to source.
13+
"paths": {
14+
"@sentry/replay/build/npm/types/types": ["../../packages/replay-internal/src/types"]
15+
}
1116
},
1217
"include": ["**/*.ts"],
1318
"exclude": ["node_modules"]

dev-packages/bundler-plugin-integration-tests/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
},
1717
"devDependencies": {
1818
"premove": "^4.0.0",
19+
"typescript": "~6.0.3",
1920
"vitest": "^3.2.6"
2021
},
2122
"volta": {

dev-packages/node-core-integration-tests/tsconfig.types.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"declaration": true,
66
"declarationMap": true,
77
"emitDeclarationOnly": true,
8-
"outDir": "build/types"
8+
"outDir": "build/types",
9+
"rootDir": "."
910
}
1011
}

dev-packages/node-integration-tests/tsconfig.types.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"declaration": true,
66
"declarationMap": true,
77
"emitDeclarationOnly": true,
8-
"outDir": "build/types"
8+
"outDir": "build/types",
9+
"rootDir": "."
910
}
1011
}

dev-packages/test-utils/tsconfig.types.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"declaration": true,
66
"declarationMap": true,
77
"emitDeclarationOnly": true,
8-
"outDir": "build/types"
8+
"outDir": "build/types",
9+
"rootDir": "./src"
910
}
1011
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
"rollup-plugin-license": "^3.7.1",
145145
"size-limit": "~12.1.0",
146146
"tsx": "^4.23.0",
147-
"typescript": "~5.8.0",
147+
"typescript": "~7.0.2",
148148
"vitest": "^3.2.6",
149149
"yalc": "^1.0.0-pre.53",
150150
"yarn-deduplicate": "6.0.2"

packages/astro/tsconfig.types.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"declaration": true,
66
"declarationMap": true,
77
"emitDeclarationOnly": true,
8-
"outDir": "build/types"
8+
"outDir": "build/types",
9+
"rootDir": "./src"
910
}
1011
}

packages/aws-serverless/src/lambda-extension/aws-lambda-extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export class AwsLambdaExtension {
153153

154154
fetch(upstreamSentryUrl, {
155155
method: 'POST',
156-
body: envelopeBytes,
156+
body: envelopeBytes as BodyInit,
157157
}).catch(err => {
158158
DEBUG_BUILD && debug.error('Error sending envelope to Sentry', err);
159159
});

0 commit comments

Comments
 (0)