Skip to content

Commit 82c0502

Browse files
committed
build: Update typescript from 3.8.3 to 4.9.5
1 parent 50ead24 commit 82c0502

File tree

77 files changed

+271
-138
lines changed

Some content is hidden

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

77 files changed

+271
-138
lines changed

Diff for: .github/workflows/build.yml

+17-2
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,9 @@ jobs:
654654
yarn test:package
655655
656656
job_node_integration_tests:
657-
name: Node (${{ matrix.node }}) Integration Tests
657+
name:
658+
Node (${{ matrix.node }})${{ (matrix.typescript && format(' (TS {0})', matrix.typescript)) || '' }} Integration
659+
Tests
658660
needs: [job_get_metadata, job_build]
659661
if: needs.job_get_metadata.outputs.changed_node == 'true' || github.event_name != 'pull_request'
660662
runs-on: ubuntu-20.04
@@ -663,6 +665,12 @@ jobs:
663665
fail-fast: false
664666
matrix:
665667
node: [10, 12, 14, 16, 18, 20]
668+
typescript:
669+
- false
670+
include:
671+
# Only check typescript for latest version (to streamline CI)
672+
- node: 20
673+
typescript: '3.8'
666674
steps:
667675
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
668676
uses: actions/checkout@v3
@@ -676,6 +684,11 @@ jobs:
676684
uses: ./.github/actions/restore-cache
677685
env:
678686
DEPENDENCY_CACHE_KEY: ${{ needs.job_build.outputs.dependency_cache_key }}
687+
688+
- name: Overwrite typescript version
689+
if: matrix.typescript
690+
run: yarn add --dev --ignore-workspace-root-check typescript@${{ matrix.typescript }}
691+
679692
- name: Run integration tests
680693
env:
681694
NODE_VERSION: ${{ matrix.node }}
@@ -714,7 +727,7 @@ jobs:
714727
yarn test:integration:ci
715728
716729
job_e2e_tests:
717-
name: E2E Tests (Shard ${{ matrix.shard }})
730+
name: E2E (Shard ${{ matrix.shard }}) Tests
718731
# We only run E2E tests for non-fork PRs because the E2E tests require secrets to work and they can't be accessed from forks
719732
# Dependabot PRs sadly also don't have access to secrets, so we skip them as well
720733
if:
@@ -727,6 +740,7 @@ jobs:
727740
fail-fast: false
728741
matrix:
729742
shard: [1, 2, 3]
743+
730744
steps:
731745
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
732746
uses: actions/checkout@v3
@@ -743,6 +757,7 @@ jobs:
743757
uses: ./.github/actions/restore-cache
744758
env:
745759
DEPENDENCY_CACHE_KEY: ${{ needs.job_build.outputs.dependency_cache_key }}
760+
746761
- name: Get node version
747762
id: versions
748763
run: |

Diff for: nx.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@
6464
],
6565
"outputs": [
6666
"{projectRoot}/build/types",
67-
"{projectRoot}/build/npm/types"
67+
"{projectRoot}/build/types-ts3.8",
68+
"{projectRoot}/build/npm/types",
69+
"{projectRoot}/build/npm/types-ts3.8"
6870
]
6971
},
7072
"lint:eslint": {

Diff for: package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
"chai": "^4.1.2",
9191
"codecov": "^3.6.5",
9292
"deepmerge": "^4.2.2",
93+
"downlevel-dts": "~0.11.0",
9394
"es-check": "7.1.0",
9495
"eslint": "7.32.0",
9596
"jest": "^27.5.1",
@@ -114,9 +115,9 @@
114115
"size-limit": "^4.5.5",
115116
"ts-jest": "^27.1.4",
116117
"ts-node": "10.9.1",
117-
"tslib": "^2.3.1",
118+
"tslib": "2.4.1",
118119
"typedoc": "^0.18.0",
119-
"typescript": "3.8.3",
120+
"typescript": "4.9.5",
120121
"vitest": "^0.29.2",
121122
"yalc": "^1.0.0-pre.53"
122123
},

Diff for: packages/angular-ivy/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"@sentry/browser": "7.56.0",
2525
"@sentry/types": "7.56.0",
2626
"@sentry/utils": "7.56.0",
27-
"tslib": "^2.3.0"
27+
"tslib": "^2.4.1"
2828
},
2929
"devDependencies": {
3030
"@angular-devkit/build-angular": "~12.2.18",
@@ -37,7 +37,6 @@
3737
"@angular/platform-browser-dynamic": "~12.2.0",
3838
"@angular/router": "~12.2.0",
3939
"ng-packagr": "^12.1.1",
40-
"typescript": "~4.3.5",
4140
"zone.js": "~0.11.4"
4241
},
4342
"scripts": {

Diff for: packages/angular/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"@sentry/browser": "7.56.0",
2525
"@sentry/types": "7.56.0",
2626
"@sentry/utils": "7.56.0",
27-
"tslib": "^2.0.0"
27+
"tslib": "^2.4.1"
2828
},
2929
"devDependencies": {
3030
"@angular-devkit/build-angular": "~0.1002.4",
@@ -38,7 +38,7 @@
3838
"@angular/router": "~10.2.5",
3939
"ng-packagr": "^10.1.0",
4040
"rxjs": "6.5.5",
41-
"typescript": "~4.0.2",
41+
"typescript": "4.0.2",
4242
"zone.js": "^0.11.8"
4343
},
4444
"scripts": {

Diff for: packages/angular/src/errorhandler.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { HttpErrorResponse } from '@angular/common/http';
22
import type { ErrorHandler as AngularErrorHandler } from '@angular/core';
33
import { Inject, Injectable } from '@angular/core';
44
import * as Sentry from '@sentry/browser';
5-
import { captureException } from '@sentry/browser';
5+
import type { Event, Scope } from '@sentry/types';
66
import { addExceptionMechanism, isString } from '@sentry/utils';
77

88
import { runOutsideAngular } from './zone';
@@ -101,7 +101,7 @@ class SentryErrorHandler implements AngularErrorHandler {
101101

102102
// Capture handled exception and send it to Sentry.
103103
const eventId = runOutsideAngular(() =>
104-
captureException(extractedError, scope => {
104+
Sentry.captureException(extractedError, (scope: Scope) => {
105105
scope.addEventProcessor(event => {
106106
addExceptionMechanism(event, {
107107
type: 'angular',
@@ -126,7 +126,7 @@ class SentryErrorHandler implements AngularErrorHandler {
126126
const client = Sentry.getCurrentHub().getClient();
127127

128128
if (client && client.on && !this._registeredAfterSendEventHandler) {
129-
client.on('afterSendEvent', event => {
129+
client.on('afterSendEvent', (event: Event) => {
130130
if (!event.type) {
131131
Sentry.showReportDialog({ ...this._options.dialogOptions, eventId: event.event_id });
132132
}

Diff for: packages/angular/test/errorhandler.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ describe('SentryErrorHandler', () => {
5757
describe('handleError method', () => {
5858
it('handleError method assigns the correct mechanism', () => {
5959
const addEventProcessorSpy = jest.spyOn(FakeScope, 'addEventProcessor').mockImplementationOnce(callback => {
60-
void callback({}, { event_id: 'fake-event-id' });
60+
void (callback as (event: any, hint: any) => void)({}, { event_id: 'fake-event-id' });
6161
return FakeScope;
6262
});
6363

Diff for: packages/browser-integration-tests/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
"html-webpack-plugin": "^5.5.0",
5454
"pako": "^2.1.0",
5555
"playwright": "^1.31.1",
56-
"typescript": "^4.5.2",
5756
"webpack": "^5.52.0"
5857
},
5958
"devDependencies": {

Diff for: packages/browser/package.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
"main": "build/npm/cjs/index.js",
1313
"module": "build/npm/esm/index.js",
1414
"types": "build/npm/types/index.d.ts",
15+
"typesVersions": {
16+
"<4.9": { "build/npm/types/index.d.ts": ["build/npm/types-ts3.8/index.d.ts"] }
17+
},
1518
"publishConfig": {
1619
"access": "public"
1720
},
@@ -21,7 +24,7 @@
2124
"@sentry/replay": "7.56.0",
2225
"@sentry/types": "7.56.0",
2326
"@sentry/utils": "7.56.0",
24-
"tslib": "^1.9.3"
27+
"tslib": "^2.4.1 || ^1.9.3"
2528
},
2629
"devDependencies": {
2730
"@sentry-internal/integration-shims": "7.56.0",
@@ -53,7 +56,9 @@
5356
"build:bundle:es5": "JS_VERSION=es5 rollup -c rollup.bundle.config.js",
5457
"build:bundle:es6": "JS_VERSION=es6 rollup -c rollup.bundle.config.js",
5558
"build:transpile": "rollup -c rollup.npm.config.js",
56-
"build:types": "tsc -p tsconfig.types.json",
59+
"build:types": "run-s build:types:core build:types:downlevel",
60+
"build:types:core": "tsc -p tsconfig.types.json",
61+
"build:types:downlevel": "yarn downlevel-dts build/npm/types build/npm/types-ts3.8 --to ts3.8",
5762
"build:watch": "run-p build:transpile:watch build:bundle:watch build:types:watch",
5863
"build:dev:watch": "yarn build:watch",
5964
"build:bundle:watch": "rollup -c rollup.bundle.config.js --watch",

Diff for: packages/browser/src/eventbuilder.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ export function eventFromUnknownInput(
208208
// https://developer.mozilla.org/en-US/docs/Web/API/DOMError
209209
// https://developer.mozilla.org/en-US/docs/Web/API/DOMException
210210
// https://webidl.spec.whatwg.org/#es-DOMException-specialness
211-
if (isDOMError(exception as DOMError) || isDOMException(exception as DOMException)) {
211+
if (isDOMError(exception) || isDOMException(exception as DOMException)) {
212212
const domException = exception as DOMException;
213213

214214
if ('stack' in (exception as Error)) {
@@ -220,6 +220,7 @@ export function eventFromUnknownInput(
220220
addExceptionTypeValue(event, message);
221221
}
222222
if ('code' in domException) {
223+
// eslint-disable-next-line deprecation/deprecation
223224
event.tags = { ...event.tags, 'DOMException.code': `${domException.code}` };
224225
}
225226

Diff for: packages/browser/src/integrations/breadcrumbs.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -348,5 +348,5 @@ function _historyBreadcrumb(handlerData: HandlerData & { from: string; to: strin
348348
}
349349

350350
function _isEvent(event: unknown): event is Event {
351-
return event && !!(event as Record<string, unknown>).target;
351+
return !!event && !!(event as Record<string, unknown>).target;
352352
}

Diff for: packages/browser/test/unit/integrations/helpers.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ describe('internal wrap()', () => {
157157
try {
158158
wrapped();
159159
} catch (error) {
160-
expect(error.message).toBe('boom');
160+
expect((error as Error).message).toBe('boom');
161161
}
162162
});
163163

Diff for: packages/browser/test/unit/transports/offline.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const createTestTransport = (...sendResults: MockResult<TransportMakeRequ
4747
reject(next);
4848
} else {
4949
sendCount += 1;
50-
resolve(next as TransportMakeRequestResponse | undefined);
50+
resolve(next as TransportMakeRequestResponse);
5151
}
5252
});
5353
}),

Diff for: packages/core/package.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,24 @@
1212
"main": "build/cjs/index.js",
1313
"module": "build/esm/index.js",
1414
"types": "build/types/index.d.ts",
15+
"typesVersions": {
16+
"<4.9": { "build/types/index.d.ts": ["build/types-ts3.8/index.d.ts"] }
17+
},
1518
"publishConfig": {
1619
"access": "public"
1720
},
1821
"dependencies": {
1922
"@sentry/types": "7.56.0",
2023
"@sentry/utils": "7.56.0",
21-
"tslib": "^1.9.3"
24+
"tslib": "^2.4.1 || ^1.9.3"
2225
},
2326
"scripts": {
2427
"build": "run-p build:transpile build:types",
2528
"build:dev": "yarn build",
2629
"build:transpile": "rollup -c rollup.npm.config.js",
27-
"build:types": "tsc -p tsconfig.types.json",
30+
"build:types": "run-s build:types:core build:types:downlevel",
31+
"build:types:core": "tsc -p tsconfig.types.json",
32+
"build:types:downlevel": "yarn downlevel-dts build/types build/types-ts3.8 --to ts3.8",
2833
"build:watch": "run-p build:transpile:watch build:types:watch",
2934
"build:dev:watch": "yarn build:watch",
3035
"build:transpile:watch": "rollup -c rollup.npm.config.js --watch",

Diff for: packages/core/src/transports/offline.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,10 @@ export function makeOfflineTransport<TO>(
131131
retryDelay = START_DELAY;
132132
return result;
133133
} catch (e) {
134-
if (store && (await shouldQueue(envelope, e, retryDelay))) {
134+
if (store && (await shouldQueue(envelope, e as Error, retryDelay))) {
135135
await store.insert(envelope);
136136
flushWithBackOff();
137-
log('Error sending. Event queued', e);
137+
log('Error sending. Event queued', e as Error);
138138
return {};
139139
} else {
140140
throw e;

Diff for: packages/core/test/lib/hint.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ describe('Hint', () => {
1616

1717
afterEach(() => {
1818
jest.clearAllMocks();
19+
// @ts-ignore for testing
1920
delete GLOBAL_OBJ.__SENTRY__;
2021
});
2122

Diff for: packages/core/test/lib/transports/offline.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ const createTestTransport = (
9898
reject(next);
9999
} else {
100100
sendCount += 1;
101-
resolve(next as TransportMakeRequestResponse | undefined);
101+
resolve(next as TransportMakeRequestResponse);
102102
}
103103
});
104104
}),

Diff for: packages/e2e-tests/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"fs-extra": "11.1.0",
2727
"glob": "8.0.3",
2828
"ts-node": "10.9.1",
29-
"typescript": "3.8.3",
3029
"yaml": "2.2.2"
3130
},
3231
"volta": {

Diff for: packages/e2e-tests/test-applications/create-next-app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"next": "13.0.7",
1717
"react": "18.2.0",
1818
"react-dom": "18.2.0",
19-
"typescript": "4.9.4"
19+
"typescript": "4.9.5"
2020
},
2121
"devDependencies": {
2222
"@playwright/test": "^1.27.1"

Diff for: packages/e2e-tests/test-applications/create-react-app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"react": "18.2.0",
1616
"react-dom": "18.2.0",
1717
"react-scripts": "5.0.1",
18-
"typescript": "4.4.2",
18+
"typescript": "4.9.5",
1919
"web-vitals": "2.1.0"
2020
},
2121
"scripts": {

Diff for: packages/e2e-tests/test-applications/create-react-app/test-recipe.json

+7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
"testApplicationName": "create-react-app",
44
"buildCommand": "pnpm install && pnpm build",
55
"tests": [],
6+
"versions": [
7+
{
8+
"dependencyOverrides": {
9+
"typescript": "3.8.3"
10+
}
11+
}
12+
],
613
"canaryVersions": [
714
{
815
"dependencyOverrides": {

Diff for: packages/e2e-tests/test-applications/nextjs-app-dir/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"next": "13.2.4",
1717
"react": "18.2.0",
1818
"react-dom": "18.2.0",
19-
"typescript": "4.9.4",
19+
"typescript": "4.9.5",
2020
"wait-port": "1.0.4",
2121
"ts-node": "10.9.1",
2222
"@playwright/test": "^1.27.1"

Diff for: packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"react-dom": "18.2.0",
1717
"react-router-dom": "^6.4.1",
1818
"react-scripts": "5.0.1",
19-
"typescript": "4.4.2",
19+
"typescript": "4.9.5",
2020
"web-vitals": "2.1.0"
2121
},
2222
"scripts": {

Diff for: packages/e2e-tests/test-applications/standard-frontend-react/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"react-dom": "18.2.0",
1616
"react-router-dom": "^6.4.1",
1717
"react-scripts": "5.0.1",
18-
"typescript": "4.4.2",
18+
"typescript": "4.9.5",
1919
"web-vitals": "2.1.0"
2020
},
2121
"scripts": {

Diff for: packages/e2e-tests/test-applications/standard-frontend-react/test-recipe.json

+7
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
"testCommand": "pnpm test"
99
}
1010
],
11+
"versions": [
12+
{
13+
"dependencyOverrides": {
14+
"typescript": "3.8.3"
15+
}
16+
}
17+
],
1118
"canaryVersions": [
1219
{
1320
"dependencyOverrides": {

Diff for: packages/e2e-tests/test-applications/sveltekit/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"svelte": "^3.54.0",
2323
"svelte-check": "^3.0.1",
2424
"ts-node": "10.9.1",
25-
"tslib": "^2.4.1",
25+
"tslib": "2.4.1",
2626
"typescript": "^5.0.0",
2727
"vite": "^4.2.0",
2828
"wait-port": "1.0.4"

Diff for: packages/ember/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@
7575
"loader.js": "~4.7.0",
7676
"qunit": "~2.19.2",
7777
"qunit-dom": "~2.0.0",
78-
"typescript": "~4.5.2",
7978
"webpack": "~5.74.0"
8079
},
8180
"engines": {

0 commit comments

Comments
 (0)