diff --git a/package.json b/package.json index a77d4f3a4202..567fb3e1ac5e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "scripts": { - "build": "node ./scripts/verify-packages-versions.js && lerna run build:transpile,build:types,build:bundle", + "build": "lerna run build:transpile,build:types,build:bundle", "build:bundle": "lerna run build:bundle", "build:dev": "lerna run build:types,build:transpile", "build:dev:filter": "lerna run build:dev --include-filtered-dependencies --include-filtered-dependents --scope", @@ -130,7 +130,7 @@ "ts-jest": "^27.1.4", "ts-node": "10.9.1", "typedoc": "^0.18.0", - "typescript": "4.9.5", + "typescript": "5.5.3", "vitest": "^1.6.0", "yalc": "^1.0.0-pre.53" }, diff --git a/packages/aws-serverless/package.json b/packages/aws-serverless/package.json index ed8d7ad25b8c..3643d3e4983b 100644 --- a/packages/aws-serverless/package.json +++ b/packages/aws-serverless/package.json @@ -51,7 +51,7 @@ } }, "typesVersions": { - "<4.9": { + "<5.5": { "build/npm/types/index.d.ts": [ "build/npm/types-ts3.8/index.d.ts" ] diff --git a/packages/browser-utils/package.json b/packages/browser-utils/package.json index 9b20781ab91c..a0519e7bc744 100644 --- a/packages/browser-utils/package.json +++ b/packages/browser-utils/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<4.9": { + "<5.5": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/browser-utils/src/metrics/web-vitals/types.ts b/packages/browser-utils/src/metrics/web-vitals/types.ts index 41793221311b..98ee519560d2 100644 --- a/packages/browser-utils/src/metrics/web-vitals/types.ts +++ b/packages/browser-utils/src/metrics/web-vitals/types.ts @@ -97,11 +97,11 @@ declare global { // https://w3c.github.io/largest-contentful-paint/#sec-largest-contentful-paint-interface interface LargestContentfulPaint extends PerformanceEntry { - renderTime: DOMHighResTimeStamp; - loadTime: DOMHighResTimeStamp; - size: number; - id: string; - url: string; - element?: Element; + readonly renderTime: DOMHighResTimeStamp; + readonly loadTime: DOMHighResTimeStamp; + readonly size: number; + readonly id: string; + readonly url: string; + readonly element: Element | null; } } diff --git a/packages/browser/package.json b/packages/browser/package.json index 9ce34f51e70b..9ab3f9679b8a 100644 --- a/packages/browser/package.json +++ b/packages/browser/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<4.9": { + "<5.5": { "build/npm/types/index.d.ts": [ "build/npm/types-ts3.8/index.d.ts" ] diff --git a/packages/bun/package.json b/packages/bun/package.json index c1c82bf63125..e719a2a2e8ea 100644 --- a/packages/bun/package.json +++ b/packages/bun/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<4.9": { + "<5.5": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/core/package.json b/packages/core/package.json index 607c7b45be87..af948f767113 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<4.9": { + "<5.5": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/core/test/lib/prepareEvent.test.ts b/packages/core/test/lib/prepareEvent.test.ts index 0698aa15e447..276fc1950f2d 100644 --- a/packages/core/test/lib/prepareEvent.test.ts +++ b/packages/core/test/lib/prepareEvent.test.ts @@ -175,8 +175,8 @@ describe('parseEventHintOrCaptureContext', () => { it('triggers a TS error if trying to mix ScopeContext & EventHint', () => { const actual = parseEventHintOrCaptureContext({ - // @ts-expect-error We are specifically testing that this errors! user: { id: 'xxx' }, + // @ts-expect-error We are specifically testing that this errors! mechanism: { handled: false }, }); diff --git a/packages/ember/tsconfig.json b/packages/ember/tsconfig.json index 95bb38c78628..65f76bfa6347 100644 --- a/packages/ember/tsconfig.json +++ b/packages/ember/tsconfig.json @@ -6,7 +6,6 @@ "moduleResolution": "node", "allowSyntheticDefaultImports": true, "alwaysStrict": true, - "noImplicitUseStrict": false, "strictNullChecks": true, "strictPropertyInitialization": true, "noEmitOnError": false, diff --git a/packages/feedback/package.json b/packages/feedback/package.json index 8d9cdeb1334e..fead9820194d 100644 --- a/packages/feedback/package.json +++ b/packages/feedback/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<4.9": { + "<5.5": { "build/npm/types/index.d.ts": [ "build/npm/types-ts3.8/index.d.ts" ] diff --git a/packages/gatsby/package.json b/packages/gatsby/package.json index dc0faa464c3a..3e35402ea646 100644 --- a/packages/gatsby/package.json +++ b/packages/gatsby/package.json @@ -35,7 +35,7 @@ } }, "typesVersions": { - "<4.9": { + "<5.5": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/google-cloud-serverless/package.json b/packages/google-cloud-serverless/package.json index c6d2418f41a0..6ce5b33ab464 100644 --- a/packages/google-cloud-serverless/package.json +++ b/packages/google-cloud-serverless/package.json @@ -38,7 +38,7 @@ } }, "typesVersions": { - "<4.9": { + "<5.5": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/integration-shims/package.json b/packages/integration-shims/package.json index 6dac04539438..c953f9998cee 100644 --- a/packages/integration-shims/package.json +++ b/packages/integration-shims/package.json @@ -22,7 +22,7 @@ } }, "typesVersions": { - "<4.9": { + "<5.5": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/integration-shims/src/metrics.ts b/packages/integration-shims/src/metrics.ts index 3f2414742501..4aaa6e72c79b 100644 --- a/packages/integration-shims/src/metrics.ts +++ b/packages/integration-shims/src/metrics.ts @@ -18,5 +18,6 @@ export const metricsShim: Metrics = { if (typeof value === 'function') { return value(); } + return; }, }; diff --git a/packages/nestjs/package.json b/packages/nestjs/package.json index 322c44d937f9..b8800dcd7044 100644 --- a/packages/nestjs/package.json +++ b/packages/nestjs/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<4.9": { + "<5.5": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index 29ef2fba8ccc..112c0c6dd854 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -58,7 +58,7 @@ } }, "typesVersions": { - "<4.9": { + "<5.5": { "build/npm/types/index.d.ts": [ "build/npm/types-ts3.8/index.d.ts" ] diff --git a/packages/nextjs/test/integration/package.json b/packages/nextjs/test/integration/package.json index f4c547b5b687..502ddb271445 100644 --- a/packages/nextjs/test/integration/package.json +++ b/packages/nextjs/test/integration/package.json @@ -21,7 +21,7 @@ "@types/react": "17.0.47", "@types/react-dom": "17.0.17", "nock": "^13.1.0", - "typescript": "4.9.5", + "typescript": "5.5.3", "yargs": "^16.2.0" }, "resolutions": { diff --git a/packages/node/package.json b/packages/node/package.json index 752639ed21d8..9091a8f081f4 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -55,7 +55,7 @@ } }, "typesVersions": { - "<4.9": { + "<5.5": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/node/test/sdk/preload.test.ts b/packages/node/test/sdk/preload.test.ts index fedba139b0f6..512440736642 100644 --- a/packages/node/test/sdk/preload.test.ts +++ b/packages/node/test/sdk/preload.test.ts @@ -14,7 +14,7 @@ describe('preload', () => { it('works without env vars', async () => { const logSpy = jest.spyOn(console, 'log'); - await import('../../src/preload'); + require('../../src/preload'); expect(logSpy).toHaveBeenCalledTimes(0); }); @@ -26,7 +26,7 @@ describe('preload', () => { process.env.SENTRY_DEBUG = '1'; - await import('../../src/preload'); + require('../../src/preload'); expect(logSpy).toHaveBeenCalledWith('Sentry Logger [log]:', '[Sentry] Preloaded Http instrumentation'); expect(logSpy).toHaveBeenCalledWith('Sentry Logger [log]:', '[Sentry] Preloaded Express instrumentation'); @@ -41,7 +41,7 @@ describe('preload', () => { process.env.SENTRY_DEBUG = '1'; process.env.SENTRY_PRELOAD_INTEGRATIONS = 'Http,Express'; - await import('../../src/preload'); + require('../../src/preload'); expect(logSpy).toHaveBeenCalledWith('Sentry Logger [log]:', '[Sentry] Preloaded Http instrumentation'); expect(logSpy).toHaveBeenCalledWith('Sentry Logger [log]:', '[Sentry] Preloaded Express instrumentation'); diff --git a/packages/node/tsconfig.json b/packages/node/tsconfig.json index 8f38d240197e..89b1d625800e 100644 --- a/packages/node/tsconfig.json +++ b/packages/node/tsconfig.json @@ -5,6 +5,7 @@ "compilerOptions": { "lib": ["es2018"], - "module": "Node16" + "module": "Node16", + "moduleResolution": "Node16" } } diff --git a/packages/opentelemetry/package.json b/packages/opentelemetry/package.json index 188cbc02ffbf..1b859ae58c12 100644 --- a/packages/opentelemetry/package.json +++ b/packages/opentelemetry/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<4.9": { + "<5.5": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/profiling-node/package.json b/packages/profiling-node/package.json index 87a22d5cfbd2..f044a01dada6 100644 --- a/packages/profiling-node/package.json +++ b/packages/profiling-node/package.json @@ -22,7 +22,7 @@ } }, "typesVersions": { - "<4.9": { + "<5.5": { "lib/types/index.d.ts": [ "lib/types-ts3.8/index.d.ts" ] @@ -87,8 +87,7 @@ "@types/node-abi": "^3.0.3", "clang-format": "^1.8.0", "cross-env": "^7.0.3", - "node-gyp": "^9.4.1", - "typescript": "^4.9.5" + "node-gyp": "^9.4.1" }, "volta": { "extends": "../../package.json" diff --git a/packages/react/package.json b/packages/react/package.json index 663a466e3474..e4ab87fe1bf9 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<4.9": { + "<5.5": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/remix/package.json b/packages/remix/package.json index e12944dd191f..dafb5535b126 100644 --- a/packages/remix/package.json +++ b/packages/remix/package.json @@ -42,7 +42,7 @@ } }, "typesVersions": { - "<4.9": { + "<5.5": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/remix/test/integration/package.json b/packages/remix/test/integration/package.json index dba3c023903a..85fcfbf5f31b 100644 --- a/packages/remix/test/integration/package.json +++ b/packages/remix/test/integration/package.json @@ -20,7 +20,7 @@ "@types/react": "^17.0.47", "@types/react-dom": "^17.0.17", "nock": "^13.1.0", - "typescript": "4.9.5" + "typescript": "5.5.3" }, "resolutions": { "@sentry/browser": "file:../../../browser", diff --git a/packages/replay-canvas/package.json b/packages/replay-canvas/package.json index 6221badf159e..120c5e597a77 100644 --- a/packages/replay-canvas/package.json +++ b/packages/replay-canvas/package.json @@ -19,7 +19,7 @@ } }, "typesVersions": { - "<4.9": { + "<5.5": { "build/npm/types/index.d.ts": [ "build/npm/types-ts3.8/index.d.ts" ] diff --git a/packages/replay-internal/package.json b/packages/replay-internal/package.json index b36cf27718be..fcf7fef23215 100644 --- a/packages/replay-internal/package.json +++ b/packages/replay-internal/package.json @@ -19,7 +19,7 @@ } }, "typesVersions": { - "<4.9": { + "<5.5": { "build/npm/types/index.d.ts": [ "build/npm/types-ts3.8/index.d.ts" ] diff --git a/packages/replay-worker/package.json b/packages/replay-worker/package.json index 5c801f154a47..fd6b95b06b38 100644 --- a/packages/replay-worker/package.json +++ b/packages/replay-worker/package.json @@ -6,7 +6,7 @@ "module": "build/esm/index.js", "types": "build/types/index.d.ts", "typesVersions": { - "<4.9": { + "<5.5": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/svelte/package.json b/packages/svelte/package.json index 5fc543e348ea..17cbc4cd17fb 100644 --- a/packages/svelte/package.json +++ b/packages/svelte/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<4.9": { + "<5.5": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/types/package.json b/packages/types/package.json index 66e7df0040cd..f6f411680dd5 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<4.9": { + "<5.5": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/typescript/package.json b/packages/typescript/package.json index 1c49db6d7de5..c01e7e222b78 100644 --- a/packages/typescript/package.json +++ b/packages/typescript/package.json @@ -14,7 +14,7 @@ "tsconfig.json" ], "peerDependencies": { - "typescript": "4.9.5" + "typescript": "5.5.3" }, "scripts": { "clean": "yarn rimraf sentry-internal-typescript-*.tgz", diff --git a/packages/typescript/tsconfig.json b/packages/typescript/tsconfig.json index bee7b140cf96..f30d0da5fbb2 100644 --- a/packages/typescript/tsconfig.json +++ b/packages/typescript/tsconfig.json @@ -12,7 +12,6 @@ "noErrorTruncation": true, "noFallthroughCasesInSwitch": true, "noImplicitReturns": true, - "noImplicitUseStrict": true, "noUnusedLocals": false, "noUnusedParameters": false, "preserveWatchOutput": true, diff --git a/packages/utils/package.json b/packages/utils/package.json index c0085deee68d..2e669775ef3b 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<4.9": { + "<5.5": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/utils/src/browser.ts b/packages/utils/src/browser.ts index ce00f2556d05..6848fbb80d12 100644 --- a/packages/utils/src/browser.ts +++ b/packages/utils/src/browser.ts @@ -158,6 +158,7 @@ export function getLocationHref(): string { */ // eslint-disable-next-line @typescript-eslint/no-explicit-any export function getDomElement(selector: string): E | null { + // eslint-disable-next-line deprecation/deprecation if (WINDOW.document && WINDOW.document.querySelector) { return WINDOW.document.querySelector(selector) as unknown as E; } diff --git a/packages/vercel-edge/package.json b/packages/vercel-edge/package.json index ca9794b48031..d605b248434d 100644 --- a/packages/vercel-edge/package.json +++ b/packages/vercel-edge/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<4.9": { + "<5.5": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/vue/package.json b/packages/vue/package.json index 9e243a41d6da..5c0efdc75998 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<4.9": { + "<5.5": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/wasm/package.json b/packages/wasm/package.json index 56a2efc9c74d..c3a7a49282bc 100644 --- a/packages/wasm/package.json +++ b/packages/wasm/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<4.9": { + "<5.5": { "build/npm/types/index.d.ts": [ "build/npm/types-ts3.8/index.d.ts" ] diff --git a/scripts/verify-packages-versions.js b/scripts/verify-packages-versions.js deleted file mode 100644 index 9c54cf2020c4..000000000000 --- a/scripts/verify-packages-versions.js +++ /dev/null @@ -1,27 +0,0 @@ -const pkg = require('../package.json'); - -const TYPESCRIPT_VERSION = '4.9.5'; - -if (pkg.devDependencies.typescript !== TYPESCRIPT_VERSION) { - console.error(` -[INCORRECT PACKAGE VERSION]: Expected TypeScript v${TYPESCRIPT_VERSION}, got v${pkg.devDependencies.typescript} - -Starting version 3.9, TypeScript emits module exports using \`Object.defineProperty\`, -with \`configurable: false\`, instead of \`exports.thing = module.thing;\` as it always used to do. -This means, that any object mutation after the initial compilation are impossible and makes -the package slightly less open for modifications, and prevent users from experimenting with it, -and from implementing some of their scenarios. - -If you REALLY know what you are doing, and you REALLY want to use a different version of TypeScript, -modify \`TYPESCRIPT_VERSION\` constant at the top of this file (\`scripts/verify-packages-versions.js\`). - -change: https://github.com/getsentry/sentry-javascript/pull/2848 -ref: https://github.com/getsentry/sentry-javascript/issues/2845 -ref: https://twitter.com/wesleytodd/status/1297974661574262784 - -"Never upgrade a TypeScript version without a major package bump. Just don't." — Kamil -`); - process.exit(1); -} - -process.exit(0); diff --git a/yarn.lock b/yarn.lock index 676d0b52bbf0..20c9cdce1149 100644 --- a/yarn.lock +++ b/yarn.lock @@ -32932,11 +32932,16 @@ typescript@4.6.4: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.4.tgz#caa78bbc3a59e6a5c510d35703f6a09877ce45e9" integrity sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg== -typescript@4.9.5, typescript@^4.9.5: +typescript@4.9.5: version "4.9.5" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== +typescript@5.5.3: + version "5.5.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.5.3.tgz#e1b0a3c394190838a0b168e771b0ad56a0af0faa" + integrity sha512-/hreyEujaB0w76zKo6717l3L0o/qEUtRgdvUBvlkhoWeOVMjMuHNHk0BRBzikzuGDqNmPQbg5ifMEqsHLiIUcQ== + "typescript@>=3 < 6": version "5.1.6" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.6.tgz#02f8ac202b6dad2c0dd5e0913745b47a37998274"