From e3eb92b547df49fadd3f614e33fd80591b4d1d27 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Fri, 19 Sep 2025 14:25:11 +0200 Subject: [PATCH 1/9] build: Update to typescript 5.8.0 --- package.json | 2 +- packages/browser/src/profiling/utils.ts | 6 ++++-- packages/core/src/instrument/handlers.ts | 2 +- packages/core/src/utils/debug-ids.ts | 2 +- packages/core/src/utils/lru.ts | 5 ++++- packages/nextjs/tsconfig.test.json | 1 + packages/node-core/tsconfig.json | 3 ++- packages/node/tsconfig.json | 3 ++- .../nuxt/src/runtime/plugins/sentry-cloudflare.server.ts | 4 ++-- packages/remix/src/vendor/instrumentation.ts | 6 +----- packages/remix/test/integration/package.json | 2 +- packages/remix/tsconfig.test.json | 1 + packages/sveltekit/src/worker/cloudflare.ts | 2 +- packages/tanstackstart-react/tsconfig.json | 3 ++- packages/tanstackstart/tsconfig.json | 3 ++- packages/typescript/package.json | 2 +- scripts/verify-packages-versions.js | 2 +- yarn.lock | 7 +------ 18 files changed, 29 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index edbd645b3c97..de0b46add91b 100644 --- a/package.json +++ b/package.json @@ -135,7 +135,7 @@ "size-limit": "~11.1.6", "sucrase": "^3.35.0", "ts-node": "10.9.1", - "typescript": "~5.0.0", + "typescript": "~5.8.0", "vitest": "^3.2.4", "yalc": "^1.0.0-pre.53", "yarn-deduplicate": "6.0.2" diff --git a/packages/browser/src/profiling/utils.ts b/packages/browser/src/profiling/utils.ts index 66b202c8517f..691d43a2a5a2 100644 --- a/packages/browser/src/profiling/utils.ts +++ b/packages/browser/src/profiling/utils.ts @@ -564,7 +564,9 @@ export function addProfileToGlobalCache(profile_id: string, profile: JSSelfProfi PROFILE_MAP.set(profile_id, profile); if (PROFILE_MAP.size > 30) { - const last: string = PROFILE_MAP.keys().next().value; - PROFILE_MAP.delete(last); + const last = PROFILE_MAP.keys().next().value; + if (last) { + PROFILE_MAP.delete(last); + } } } diff --git a/packages/core/src/instrument/handlers.ts b/packages/core/src/instrument/handlers.ts index 86c5a90b7c52..74dbc9902348 100644 --- a/packages/core/src/instrument/handlers.ts +++ b/packages/core/src/instrument/handlers.ts @@ -21,7 +21,7 @@ const instrumented: { [key in InstrumentHandlerType]?: boolean } = {}; /** Add a handler function. */ export function addHandler(type: InstrumentHandlerType, handler: InstrumentHandlerCallback): void { handlers[type] = handlers[type] || []; - (handlers[type] as InstrumentHandlerCallback[]).push(handler); + handlers[type].push(handler); } /** diff --git a/packages/core/src/utils/debug-ids.ts b/packages/core/src/utils/debug-ids.ts index 97f30bbe816a..fd31009ae32d 100644 --- a/packages/core/src/utils/debug-ids.ts +++ b/packages/core/src/utils/debug-ids.ts @@ -105,7 +105,7 @@ export function getDebugImagesForResources( images.push({ type: 'sourcemap', code_file: path, - debug_id: filenameDebugIdMap[path] as string, + debug_id: filenameDebugIdMap[path], }); } } diff --git a/packages/core/src/utils/lru.ts b/packages/core/src/utils/lru.ts index 2a3b7bfc8ac0..20cbc31e4bf5 100644 --- a/packages/core/src/utils/lru.ts +++ b/packages/core/src/utils/lru.ts @@ -27,7 +27,10 @@ export class LRUMap { public set(key: K, value: V): void { if (this._cache.size >= this._maxSize) { // keys() returns an iterator in insertion order so keys().next() gives us the oldest key - this._cache.delete(this._cache.keys().next().value); + const nextKey = this._cache.keys().next().value; + if (nextKey) { + this._cache.delete(nextKey); + } } this._cache.set(key, value); } diff --git a/packages/nextjs/tsconfig.test.json b/packages/nextjs/tsconfig.test.json index 633c4212a0e9..be787654b1a0 100644 --- a/packages/nextjs/tsconfig.test.json +++ b/packages/nextjs/tsconfig.test.json @@ -9,6 +9,7 @@ // require for top-level await "module": "Node16", + "moduleResolution": "Node16", "target": "es2020", // other package-specific, test-specific options diff --git a/packages/node-core/tsconfig.json b/packages/node-core/tsconfig.json index 07c7602c1fdd..28abec410557 100644 --- a/packages/node-core/tsconfig.json +++ b/packages/node-core/tsconfig.json @@ -5,6 +5,7 @@ "compilerOptions": { "lib": ["ES2020", "ES2021.WeakRef"], - "module": "Node16" + "module": "Node16", + "moduleResolution": "Node16" } } diff --git a/packages/node/tsconfig.json b/packages/node/tsconfig.json index 64d6f3a1b9e0..d5f034ad1048 100644 --- a/packages/node/tsconfig.json +++ b/packages/node/tsconfig.json @@ -5,6 +5,7 @@ "compilerOptions": { "lib": ["es2020"], - "module": "Node16" + "module": "Node16", + "moduleResolution": "Node16" } } diff --git a/packages/nuxt/src/runtime/plugins/sentry-cloudflare.server.ts b/packages/nuxt/src/runtime/plugins/sentry-cloudflare.server.ts index 5438ac829d8a..d45d45d0d4ed 100644 --- a/packages/nuxt/src/runtime/plugins/sentry-cloudflare.server.ts +++ b/packages/nuxt/src/runtime/plugins/sentry-cloudflare.server.ts @@ -1,4 +1,3 @@ -import type { IncomingRequestCfProperties } from '@cloudflare/workers-types'; import type { CloudflareOptions } from '@sentry/cloudflare'; import { setAsyncLocalStorageAsyncContextStrategy, wrapRequestHandler } from '@sentry/cloudflare'; import { debug, getDefaultIsolationScope, getIsolationScope, getTraceData } from '@sentry/core'; @@ -64,8 +63,9 @@ export const sentryCloudflareNitroPlugin = const request = new Request(url, { method: event.method, headers: event.headers, + // @ts-expect-error - 'cf' is a valid property in the RequestInit type for Cloudflare cf: getCfProperties(event), - }) as Request>; + }); const requestHandlerOptions = { options: cloudflareOptions, diff --git a/packages/remix/src/vendor/instrumentation.ts b/packages/remix/src/vendor/instrumentation.ts index 317a17da663d..6ccc56c7a88f 100644 --- a/packages/remix/src/vendor/instrumentation.ts +++ b/packages/remix/src/vendor/instrumentation.ts @@ -310,11 +310,7 @@ export class RemixInstrumentation extends InstrumentationBase { const { actionFormDataAttributes: actionFormAttributes } = plugin.getConfig(); formData.forEach((value: unknown, key: string) => { - if ( - actionFormAttributes?.[key] && - actionFormAttributes[key] !== false && - typeof value === 'string' - ) { + if (actionFormAttributes?.[key] && typeof value === 'string') { const keyName = actionFormAttributes[key] === true ? key : actionFormAttributes[key]; span.setAttribute(`formData.${keyName}`, value.toString()); } diff --git a/packages/remix/test/integration/package.json b/packages/remix/test/integration/package.json index 04e20e5f3a56..d138a0eb8eaa 100644 --- a/packages/remix/test/integration/package.json +++ b/packages/remix/test/integration/package.json @@ -21,7 +21,7 @@ "@types/react": "^18", "@types/react-dom": "^18", "nock": "^13.5.5", - "typescript": "~5.0.0" + "typescript": "~5.8.0" }, "resolutions": { "@sentry/browser": "file:../../../browser", diff --git a/packages/remix/tsconfig.test.json b/packages/remix/tsconfig.test.json index f62d7ff34d09..dace64b4fd9a 100644 --- a/packages/remix/tsconfig.test.json +++ b/packages/remix/tsconfig.test.json @@ -8,6 +8,7 @@ "types": ["node"], // Required for top-level await in tests "module": "Node16", + "moduleResolution": "Node16", "target": "es2020", "esModuleInterop": true diff --git a/packages/sveltekit/src/worker/cloudflare.ts b/packages/sveltekit/src/worker/cloudflare.ts index 612b174f6c69..9cacad6f4cb8 100644 --- a/packages/sveltekit/src/worker/cloudflare.ts +++ b/packages/sveltekit/src/worker/cloudflare.ts @@ -39,7 +39,7 @@ export function initCloudflareSentryHandle(options: CloudflareOptions): Handle { return wrapRequestHandler( { options: opts, - request: event.request as Request>, + request: event.request, // @ts-expect-error This will exist in Cloudflare context: event.platform.context, // We don't want to capture errors here, as we want to capture them in the `sentryHandle` handler diff --git a/packages/tanstackstart-react/tsconfig.json b/packages/tanstackstart-react/tsconfig.json index ff4cadba841a..220ba3fa2b86 100644 --- a/packages/tanstackstart-react/tsconfig.json +++ b/packages/tanstackstart-react/tsconfig.json @@ -3,6 +3,7 @@ "include": ["src/**/*"], "compilerOptions": { "lib": ["es2020"], - "module": "Node16" + "module": "Node16", + "moduleResolution": "Node16" } } diff --git a/packages/tanstackstart/tsconfig.json b/packages/tanstackstart/tsconfig.json index ff4cadba841a..220ba3fa2b86 100644 --- a/packages/tanstackstart/tsconfig.json +++ b/packages/tanstackstart/tsconfig.json @@ -3,6 +3,7 @@ "include": ["src/**/*"], "compilerOptions": { "lib": ["es2020"], - "module": "Node16" + "module": "Node16", + "moduleResolution": "Node16" } } diff --git a/packages/typescript/package.json b/packages/typescript/package.json index dc465ec207dd..430842c16d09 100644 --- a/packages/typescript/package.json +++ b/packages/typescript/package.json @@ -13,7 +13,7 @@ "tsconfig.json" ], "peerDependencies": { - "typescript": "~5.0.0" + "typescript": "~5.8.0" }, "scripts": { "clean": "yarn rimraf sentry-internal-typescript-*.tgz", diff --git a/scripts/verify-packages-versions.js b/scripts/verify-packages-versions.js index e6f0837cb38c..81eac62e9c90 100644 --- a/scripts/verify-packages-versions.js +++ b/scripts/verify-packages-versions.js @@ -1,6 +1,6 @@ const pkg = require('../package.json'); -const TYPESCRIPT_VERSION = '~5.0.0'; +const TYPESCRIPT_VERSION = '~5.8.0'; if (pkg.devDependencies.typescript !== TYPESCRIPT_VERSION) { console.error(` diff --git a/yarn.lock b/yarn.lock index 70c9e3d80b73..3917862a705f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -30045,7 +30045,7 @@ typescript@4.6.4: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.4.tgz#caa78bbc3a59e6a5c510d35703f6a09877ce45e9" integrity sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg== -"typescript@>=3 < 6", typescript@^5.0.4, typescript@^5.4.4, typescript@^5.7.3: +"typescript@>=3 < 6", typescript@^5.0.4, typescript@^5.4.4, typescript@^5.7.3, typescript@~5.8.0: version "5.8.3" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.8.3.tgz#92f8a3e5e3cf497356f4178c34cd65a7f5e8440e" integrity sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ== @@ -30060,11 +30060,6 @@ typescript@next: resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.0-dev.20230530.tgz#4251ade97a9d8a86850c4d5c3c4f3e1cb2ccf52c" integrity sha512-bIoMajCZWzLB+pWwncaba/hZc6dRnw7x8T/fenOnP9gYQB/gc4xdm48AXp5SH5I/PvvSeZ/dXkUMtc8s8BiDZw== -typescript@~5.0.0: - version "5.0.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b" - integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw== - typeson-registry@^1.0.0-alpha.20: version "1.0.0-alpha.39" resolved "https://registry.yarnpkg.com/typeson-registry/-/typeson-registry-1.0.0-alpha.39.tgz#9e0f5aabd5eebfcffd65a796487541196f4b1211" From b3fd7fa83e600eccbb48e51db9eca067525440a3 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Tue, 23 Sep 2025 16:30:24 +0200 Subject: [PATCH 2/9] fixes --- .../test-applications/hydrogen-react-router-7/package.json | 1 + .../test-applications/hydrogen-react-router-7/tsconfig.json | 2 +- packages/browser-utils/src/metrics/instrument.ts | 2 +- packages/nextjs/src/config/webpack.ts | 2 +- packages/node-core/src/integrations/anr/worker.ts | 2 +- packages/node-core/test/helpers/mockSdkInit.ts | 2 +- packages/node-native/src/event-loop-block-watchdog.ts | 4 ++-- packages/node/test/helpers/mockSdkInit.ts | 2 +- packages/remix/src/utils/utils.ts | 2 +- 9 files changed, 10 insertions(+), 9 deletions(-) diff --git a/dev-packages/e2e-tests/test-applications/hydrogen-react-router-7/package.json b/dev-packages/e2e-tests/test-applications/hydrogen-react-router-7/package.json index 503ad2758767..bf0b59ca0adf 100644 --- a/dev-packages/e2e-tests/test-applications/hydrogen-react-router-7/package.json +++ b/dev-packages/e2e-tests/test-applications/hydrogen-react-router-7/package.json @@ -41,6 +41,7 @@ "@total-typescript/ts-reset": "^0.4.2", "@types/eslint": "^8.4.10", "@types/react": "^18.2.22", + "@types/node": "^18.19.1", "@types/react-dom": "^18.2.7", "esbuild": "0.25.0", "eslint": "^9.18.0", diff --git a/dev-packages/e2e-tests/test-applications/hydrogen-react-router-7/tsconfig.json b/dev-packages/e2e-tests/test-applications/hydrogen-react-router-7/tsconfig.json index 0d4c4dc2e4de..6b1b95f76f6f 100644 --- a/dev-packages/e2e-tests/test-applications/hydrogen-react-router-7/tsconfig.json +++ b/dev-packages/e2e-tests/test-applications/hydrogen-react-router-7/tsconfig.json @@ -14,7 +14,7 @@ "forceConsistentCasingInFileNames": true, "skipLibCheck": true, "baseUrl": ".", - "types": ["@shopify/oxygen-workers-types"], + "types": ["@shopify/oxygen-workers-types", "node"], "paths": { "~/*": ["app/*"] }, diff --git a/packages/browser-utils/src/metrics/instrument.ts b/packages/browser-utils/src/metrics/instrument.ts index 8017bd4c89e1..4c461ec6776c 100644 --- a/packages/browser-utils/src/metrics/instrument.ts +++ b/packages/browser-utils/src/metrics/instrument.ts @@ -301,7 +301,7 @@ function instrumentPerformanceObserver(type: InstrumentHandlerTypePerformanceObs function addHandler(type: InstrumentHandlerType, handler: InstrumentHandlerCallback): void { handlers[type] = handlers[type] || []; - (handlers[type] as InstrumentHandlerCallback[]).push(handler); + handlers[type].push(handler); } // Get a callback which can be called to remove the instrumentation handler diff --git a/packages/nextjs/src/config/webpack.ts b/packages/nextjs/src/config/webpack.ts index 6ba07cd09f8f..0b0506d373b0 100644 --- a/packages/nextjs/src/config/webpack.ts +++ b/packages/nextjs/src/config/webpack.ts @@ -331,7 +331,7 @@ export function constructWebpackConfigFunction({ .map(extension => `global-error.${extension}`) .some( // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - globalErrorFile => fs.existsSync(path.join(appDirPath!, globalErrorFile)), + globalErrorFile => fs.existsSync(path.join(appDirPath, globalErrorFile)), ); if ( diff --git a/packages/node-core/src/integrations/anr/worker.ts b/packages/node-core/src/integrations/anr/worker.ts index 7c2ac91f30af..3ae9e009625c 100644 --- a/packages/node-core/src/integrations/anr/worker.ts +++ b/packages/node-core/src/integrations/anr/worker.ts @@ -110,7 +110,7 @@ function applyDebugMeta(event: Event): void { for (const frame of exception.stacktrace?.frames || []) { const filename = frame.abs_path || frame.filename; if (filename && normalisedDebugImages[filename]) { - filenameToDebugId.set(filename, normalisedDebugImages[filename] as string); + filenameToDebugId.set(filename, normalisedDebugImages[filename]); } } } diff --git a/packages/node-core/test/helpers/mockSdkInit.ts b/packages/node-core/test/helpers/mockSdkInit.ts index 0ea8a93cb064..8d4cb28bfd66 100644 --- a/packages/node-core/test/helpers/mockSdkInit.ts +++ b/packages/node-core/test/helpers/mockSdkInit.ts @@ -149,7 +149,7 @@ export function getSpanProcessor(): SentrySpanProcessor | undefined { const spanProcessor = multiSpanProcessor?.['_spanProcessors']?.find( (spanProcessor: SpanProcessor) => spanProcessor instanceof SentrySpanProcessor, - ) as SentrySpanProcessor | undefined; + ); return spanProcessor; } diff --git a/packages/node-native/src/event-loop-block-watchdog.ts b/packages/node-native/src/event-loop-block-watchdog.ts index 26b9bb683930..492070a2d1dc 100644 --- a/packages/node-native/src/event-loop-block-watchdog.ts +++ b/packages/node-native/src/event-loop-block-watchdog.ts @@ -149,7 +149,7 @@ function applyDebugMeta(event: Event, debugImages: Record): void for (const frame of exception.stacktrace?.frames || []) { const filename = stripFileProtocol(frame.abs_path || frame.filename); if (filename && normalisedDebugImages[filename]) { - filenameToDebugId.set(filename, normalisedDebugImages[filename] as string); + filenameToDebugId.set(filename, normalisedDebugImages[filename]); } } } @@ -158,7 +158,7 @@ function applyDebugMeta(event: Event, debugImages: Record): void for (const frame of thread.stacktrace?.frames || []) { const filename = stripFileProtocol(frame.abs_path || frame.filename); if (filename && normalisedDebugImages[filename]) { - filenameToDebugId.set(filename, normalisedDebugImages[filename] as string); + filenameToDebugId.set(filename, normalisedDebugImages[filename]); } } } diff --git a/packages/node/test/helpers/mockSdkInit.ts b/packages/node/test/helpers/mockSdkInit.ts index dc4c3586d978..8f8be9e8af68 100644 --- a/packages/node/test/helpers/mockSdkInit.ts +++ b/packages/node/test/helpers/mockSdkInit.ts @@ -61,7 +61,7 @@ export function getSpanProcessor(): SentrySpanProcessor | undefined { const spanProcessor = multiSpanProcessor?.['_spanProcessors']?.find( (spanProcessor: SpanProcessor) => spanProcessor instanceof SentrySpanProcessor, - ) as SentrySpanProcessor | undefined; + ); return spanProcessor; } diff --git a/packages/remix/src/utils/utils.ts b/packages/remix/src/utils/utils.ts index 5485cff5e0a3..9cc02341ac0a 100644 --- a/packages/remix/src/utils/utils.ts +++ b/packages/remix/src/utils/utils.ts @@ -29,7 +29,7 @@ export async function storeFormDataKeys( if (formDataKeys?.[key]) { if (typeof formDataKeys[key] === 'string') { - attrKey = formDataKeys[key] as string; + attrKey = formDataKeys[key]; } span.setAttribute( From f85e9745b3d79e833ca56226313b20634508c6f2 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Wed, 24 Sep 2025 13:06:53 +0200 Subject: [PATCH 3/9] PR feedback --- packages/browser/src/profiling/utils.ts | 7 +++---- packages/core/src/utils/lru.ts | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/browser/src/profiling/utils.ts b/packages/browser/src/profiling/utils.ts index 691d43a2a5a2..8b7039be7a9b 100644 --- a/packages/browser/src/profiling/utils.ts +++ b/packages/browser/src/profiling/utils.ts @@ -564,9 +564,8 @@ export function addProfileToGlobalCache(profile_id: string, profile: JSSelfProfi PROFILE_MAP.set(profile_id, profile); if (PROFILE_MAP.size > 30) { - const last = PROFILE_MAP.keys().next().value; - if (last) { - PROFILE_MAP.delete(last); - } + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const last = PROFILE_MAP.keys().next().value!; + PROFILE_MAP.delete(last); } } diff --git a/packages/core/src/utils/lru.ts b/packages/core/src/utils/lru.ts index 20cbc31e4bf5..3158dff7d413 100644 --- a/packages/core/src/utils/lru.ts +++ b/packages/core/src/utils/lru.ts @@ -27,10 +27,9 @@ export class LRUMap { public set(key: K, value: V): void { if (this._cache.size >= this._maxSize) { // keys() returns an iterator in insertion order so keys().next() gives us the oldest key - const nextKey = this._cache.keys().next().value; - if (nextKey) { - this._cache.delete(nextKey); - } + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const nextKey = this._cache.keys().next().value!; + this._cache.delete(nextKey); } this._cache.set(key, value); } From 9f279ab26c9c269538db6834bff1af81847c0046 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Wed, 24 Sep 2025 13:11:57 +0200 Subject: [PATCH 4/9] types emit old --- packages/aws-serverless/package.json | 2 +- packages/browser-utils/package.json | 2 +- packages/browser/package.json | 2 +- packages/bun/package.json | 2 +- packages/cloudflare/package.json | 2 +- packages/core/package.json | 2 +- packages/feedback/package.json | 2 +- packages/gatsby/package.json | 2 +- packages/google-cloud-serverless/package.json | 2 +- packages/integration-shims/package.json | 2 +- packages/nextjs/package.json | 2 +- packages/node-core/package.json | 2 +- packages/node-native/package.json | 2 +- packages/node/package.json | 2 +- packages/opentelemetry/package.json | 2 +- packages/profiling-node/package.json | 2 +- packages/react/package.json | 2 +- packages/remix/package.json | 2 +- packages/replay-canvas/package.json | 2 +- packages/replay-internal/package.json | 2 +- packages/replay-worker/package.json | 2 +- packages/svelte/package.json | 2 +- packages/tanstackstart-react/package.json | 2 +- packages/tanstackstart/package.json | 2 +- packages/types/package.json | 2 +- packages/vercel-edge/package.json | 2 +- packages/vue/package.json | 2 +- packages/wasm/package.json | 2 +- 28 files changed, 28 insertions(+), 28 deletions(-) diff --git a/packages/aws-serverless/package.json b/packages/aws-serverless/package.json index 2c9d74fcd065..1f9860d32ca1 100644 --- a/packages/aws-serverless/package.json +++ b/packages/aws-serverless/package.json @@ -55,7 +55,7 @@ } }, "typesVersions": { - "<5.0": { + "<5.8": { "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 363b725915ba..405ba4f0f724 100644 --- a/packages/browser-utils/package.json +++ b/packages/browser-utils/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<5.0": { + "<5.8": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/browser/package.json b/packages/browser/package.json index 3b01f272299f..9f1cf8fd8ce6 100644 --- a/packages/browser/package.json +++ b/packages/browser/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<5.0": { + "<5.8": { "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 15eb9481f99a..b517c2573142 100644 --- a/packages/bun/package.json +++ b/packages/bun/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<5.0": { + "<5.8": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/cloudflare/package.json b/packages/cloudflare/package.json index df04b7ad30ac..55e7c46770ad 100644 --- a/packages/cloudflare/package.json +++ b/packages/cloudflare/package.json @@ -39,7 +39,7 @@ } }, "typesVersions": { - "<5.0": { + "<5.8": { "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 2e7f2d55018a..27c054cfe40d 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<5.0": { + "<5.8": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/feedback/package.json b/packages/feedback/package.json index cfd607c98884..595f7607c9e8 100644 --- a/packages/feedback/package.json +++ b/packages/feedback/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<5.0": { + "<5.8": { "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 e54d827079d9..cd6f04cbed52 100644 --- a/packages/gatsby/package.json +++ b/packages/gatsby/package.json @@ -35,7 +35,7 @@ } }, "typesVersions": { - "<5.0": { + "<5.8": { "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 a4507d3482f3..36c87bc2b7ba 100644 --- a/packages/google-cloud-serverless/package.json +++ b/packages/google-cloud-serverless/package.json @@ -38,7 +38,7 @@ } }, "typesVersions": { - "<5.0": { + "<5.8": { "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 b13790dbfb95..783124d6af73 100644 --- a/packages/integration-shims/package.json +++ b/packages/integration-shims/package.json @@ -22,7 +22,7 @@ } }, "typesVersions": { - "<5.0": { + "<5.8": { "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 9464ced6a3ed..4905be145096 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -66,7 +66,7 @@ } }, "typesVersions": { - "<5.0": { + "<5.8": { "build/npm/types/index.d.ts": [ "build/npm/types-ts3.8/index.d.ts" ] diff --git a/packages/node-core/package.json b/packages/node-core/package.json index 701991d15783..668c087425aa 100644 --- a/packages/node-core/package.json +++ b/packages/node-core/package.json @@ -47,7 +47,7 @@ } }, "typesVersions": { - "<5.0": { + "<5.8": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/node-native/package.json b/packages/node-native/package.json index eaf0b9f4f15e..b46b039a4e00 100644 --- a/packages/node-native/package.json +++ b/packages/node-native/package.json @@ -31,7 +31,7 @@ } }, "typesVersions": { - "<5.0": { + "<5.8": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/node/package.json b/packages/node/package.json index a78a670a6cdd..9250b37753ec 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -55,7 +55,7 @@ } }, "typesVersions": { - "<5.0": { + "<5.8": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/opentelemetry/package.json b/packages/opentelemetry/package.json index 8be9d3fe62dd..66eebd6dee05 100644 --- a/packages/opentelemetry/package.json +++ b/packages/opentelemetry/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<5.0": { + "<5.8": { "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 177badb3987c..545a26ebb218 100644 --- a/packages/profiling-node/package.json +++ b/packages/profiling-node/package.json @@ -23,7 +23,7 @@ } }, "typesVersions": { - "<5.0": { + "<5.8": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/react/package.json b/packages/react/package.json index 8b4c9be1e4fa..936fd789d2a0 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<5.0": { + "<5.8": { "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 49f8547e9e47..edfa656c6176 100644 --- a/packages/remix/package.json +++ b/packages/remix/package.json @@ -54,7 +54,7 @@ } }, "typesVersions": { - "<5.0": { + "<5.8": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/replay-canvas/package.json b/packages/replay-canvas/package.json index 2d5cbe1f4979..3bab81a5a750 100644 --- a/packages/replay-canvas/package.json +++ b/packages/replay-canvas/package.json @@ -19,7 +19,7 @@ } }, "typesVersions": { - "<5.0": { + "<5.8": { "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 ba9f70516b01..8c7bf29c3282 100644 --- a/packages/replay-internal/package.json +++ b/packages/replay-internal/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<5.0": { + "<5.8": { "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 3e02a1ef7fd7..0a04f59a5f53 100644 --- a/packages/replay-worker/package.json +++ b/packages/replay-worker/package.json @@ -23,7 +23,7 @@ } }, "typesVersions": { - "<5.0": { + "<5.8": { "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 e65fa84fd435..5463404a14c7 100644 --- a/packages/svelte/package.json +++ b/packages/svelte/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<5.0": { + "<5.8": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/tanstackstart-react/package.json b/packages/tanstackstart-react/package.json index 71ae6f8c4e53..6b11926a8a35 100644 --- a/packages/tanstackstart-react/package.json +++ b/packages/tanstackstart-react/package.json @@ -40,7 +40,7 @@ } }, "typesVersions": { - "<5.0": { + "<5.8": { "build/npm/types/index.d.ts": [ "build/npm/types-ts3.8/index.d.ts" ] diff --git a/packages/tanstackstart/package.json b/packages/tanstackstart/package.json index b03139402bdb..ba1cdc5eb051 100644 --- a/packages/tanstackstart/package.json +++ b/packages/tanstackstart/package.json @@ -30,7 +30,7 @@ } }, "typesVersions": { - "<5.0": { + "<5.8": { "build/npm/types/index.d.ts": [ "build/npm/types-ts3.8/index.d.ts" ] diff --git a/packages/types/package.json b/packages/types/package.json index e393534729c7..c88050e1ea19 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<5.0": { + "<5.8": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/vercel-edge/package.json b/packages/vercel-edge/package.json index 94ce4856d199..fc89752a28da 100644 --- a/packages/vercel-edge/package.json +++ b/packages/vercel-edge/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<5.0": { + "<5.8": { "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 ba35ef861b38..fd9ae173d5e2 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<5.0": { + "<5.8": { "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 35515307262d..8de39784457a 100644 --- a/packages/wasm/package.json +++ b/packages/wasm/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<5.0": { + "<5.8": { "build/npm/types/index.d.ts": [ "build/npm/types-ts3.8/index.d.ts" ] From 996220411a3eb8787264d4f42f5c801455cda0b3 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Mon, 29 Sep 2025 13:15:27 +0200 Subject: [PATCH 5/9] fix log parameter types??? --- packages/node-core/src/logs/capture.ts | 25 +- packages/node-core/src/logs/exports.ts | 346 ++++++++++++++++++++++++- 2 files changed, 365 insertions(+), 6 deletions(-) diff --git a/packages/node-core/src/logs/capture.ts b/packages/node-core/src/logs/capture.ts index 4c2fdc73a34c..e40cb2f1c2b4 100644 --- a/packages/node-core/src/logs/capture.ts +++ b/packages/node-core/src/logs/capture.ts @@ -5,7 +5,7 @@ import { _INTERNAL_captureLog } from '@sentry/core'; /** * Additional metadata to capture the log with. */ -interface CaptureLogMetadata { +export interface CaptureLogMetadata { scope?: Scope; } @@ -26,10 +26,25 @@ export type CaptureLogArgs = CaptureLogArgWithTemplate | CaptureLogArgWithoutTem /** * Capture a log with the given level. - * - * @param level - The level of the log. - * @param message - The message to log. - * @param attributes - Arbitrary structured data that stores information about the log - e.g., userId: 100. + */ +export function captureLog( + level: LogSeverityLevel, + message: ParameterizedString, + attributes?: Log['attributes'], + metadata?: CaptureLogMetadata, +): void; +/** + * Capture a log with the given level. + */ +export function captureLog( + level: LogSeverityLevel, + messageTemplate: string, + messageParams: Array, + attributes?: Log['attributes'], + metadata?: CaptureLogMetadata, +): void; +/** + * Capture a log with the given level. */ export function captureLog(level: LogSeverityLevel, ...args: CaptureLogArgs): void { const [messageOrMessageTemplate, paramsOrAttributes, maybeAttributesOrMetadata, maybeMetadata] = args; diff --git a/packages/node-core/src/logs/exports.ts b/packages/node-core/src/logs/exports.ts index 665d4d78d9ad..bf6888e5d00c 100644 --- a/packages/node-core/src/logs/exports.ts +++ b/packages/node-core/src/logs/exports.ts @@ -1,4 +1,65 @@ -import { type CaptureLogArgs, captureLog } from './capture'; +import type { Log, ParameterizedString } from '@sentry/core'; +import type { CaptureLogArgs, CaptureLogMetadata } from './capture'; +import { captureLog } from './capture'; + +/** + * @summary Capture a log with the `trace` level. Requires the `enableLogs` option to be enabled. + * + * You can either pass a message and attributes or a message template, params and attributes. + * + * @example + * + * ``` + * Sentry.logger.trace('Starting database connection', { + * database: 'users', + * connectionId: 'conn_123' + * }); + * ``` + * + * @example With template strings + * + * ``` + * Sentry.logger.trace('Database connection %s established for %s', + * ['successful', 'users'], + * { connectionId: 'conn_123' } + * ); + * ``` + */ +export function trace( + message: ParameterizedString, + attributes?: Log['attributes'], + metadata?: CaptureLogMetadata, +): void; + +/** + * @summary Capture a log with the `trace` level. Requires the `enableLogs` option to be enabled. + * + * You can either pass a message and attributes or a message template, params and attributes. + * + * @example + * + * ``` + * Sentry.logger.trace('Starting database connection', { + * database: 'users', + * connectionId: 'conn_123' + * }); + * ``` + * + * @example With template strings + * + * ``` + * Sentry.logger.trace('Database connection %s established for %s', + * ['successful', 'users'], + * { connectionId: 'conn_123' } + * ); + * ``` + */ +export function trace( + messageTemplate: string, + messageParams: Array, + attributes?: Log['attributes'], + metadata?: CaptureLogMetadata, +): void; /** * @summary Capture a log with the `trace` level. Requires the `enableLogs` option to be enabled. @@ -27,6 +88,63 @@ export function trace(...args: CaptureLogArgs): void { captureLog('trace', ...args); } +/** + * @summary Capture a log with the `debug` level. Requires the `enableLogs` option to be enabled. + * + * You can either pass a message and attributes or a message template, params and attributes. + * + * @example + * + * ``` + * Sentry.logger.debug('Cache miss for user profile', { + * userId: 'user_123', + * cacheKey: 'profile:user_123' + * }); + * ``` + * + * @example With template strings + * + * ``` + * Sentry.logger.debug('Cache %s for %s: %s', + * ['miss', 'user profile', 'key not found'], + * { userId: 'user_123' } + * ); + * ``` + */ +export function debug( + message: ParameterizedString, + attributes?: Log['attributes'], + metadata?: CaptureLogMetadata, +): void; +/** + * @summary Capture a log with the `debug` level. Requires the `enableLogs` option to be enabled. + * + * You can either pass a message and attributes or a message template, params and attributes. + * + * @example + * + * ``` + * Sentry.logger.debug('Cache miss for user profile', { + * userId: 'user_123', + * cacheKey: 'profile:user_123' + * }); + * ``` + * + * @example With template strings + * + * ``` + * Sentry.logger.debug('Cache %s for %s: %s', + * ['miss', 'user profile', 'key not found'], + * { userId: 'user_123' } + * ); + * ``` + */ +export function debug( + messageTemplate: string, + messageParams: Array, + attributes?: Log['attributes'], + metadata?: CaptureLogMetadata, +): void; /** * @summary Capture a log with the `debug` level. Requires the `enableLogs` option to be enabled. * @@ -54,6 +172,59 @@ export function debug(...args: CaptureLogArgs): void { captureLog('debug', ...args); } +/** + * @summary Capture a log with the `info` level. Requires the `enableLogs` option to be enabled. + * + * You can either pass a message and attributes or a message template, params and attributes. + * + * @example + * + * ``` + * Sentry.logger.info('User profile updated', { + * userId: 'user_123', + * updatedFields: ['email', 'preferences'] + * }); + * ``` + * + * @example With template strings + * + * ``` + * Sentry.logger.info('User %s updated their %s', + * ['John Doe', 'profile settings'], + * { userId: 'user_123' } + * ); + * ``` + */ +export function info(message: ParameterizedString, attributes?: Log['attributes'], metadata?: CaptureLogMetadata): void; +/** + * @summary Capture a log with the `info` level. Requires the `enableLogs` option to be enabled. + * + * You can either pass a message and attributes or a message template, params and attributes. + * + * @example + * + * ``` + * Sentry.logger.info('User profile updated', { + * userId: 'user_123', + * updatedFields: ['email', 'preferences'] + * }); + * ``` + * + * @example With template strings + * + * ``` + * Sentry.logger.info('User %s updated their %s', + * ['John Doe', 'profile settings'], + * { userId: 'user_123' } + * ); + * ``` + */ +export function info( + messageTemplate: string, + messageParams: Array, + attributes?: Log['attributes'], + metadata?: CaptureLogMetadata, +): void; /** * @summary Capture a log with the `info` level. Requires the `enableLogs` option to be enabled. * @@ -81,6 +252,61 @@ export function info(...args: CaptureLogArgs): void { captureLog('info', ...args); } +/** + * @summary Capture a log with the `warn` level. Requires the `enableLogs` option to be enabled. + * + * You can either pass a message and attributes or a message template, params and attributes. + * + * @example + * + * ``` + * Sentry.logger.warn('Rate limit approaching', { + * endpoint: '/api/users', + * currentRate: '95/100', + * resetTime: '2024-03-20T10:00:00Z' + * }); + * ``` + * + * @example With template strings + * + * ``` + * Sentry.logger.warn('Rate limit %s for %s: %s', + * ['approaching', '/api/users', '95/100 requests'], + * { resetTime: '2024-03-20T10:00:00Z' } + * ); + * ``` + */ +export function warn(message: ParameterizedString, attributes?: Log['attributes'], metadata?: CaptureLogMetadata): void; +/** + * @summary Capture a log with the `warn` level. Requires the `enableLogs` option to be enabled. + * + * You can either pass a message and attributes or a message template, params and attributes. + * + * @example + * + * ``` + * Sentry.logger.warn('Rate limit approaching', { + * endpoint: '/api/users', + * currentRate: '95/100', + * resetTime: '2024-03-20T10:00:00Z' + * }); + * ``` + * + * @example With template strings + * + * ``` + * Sentry.logger.warn('Rate limit %s for %s: %s', + * ['approaching', '/api/users', '95/100 requests'], + * { resetTime: '2024-03-20T10:00:00Z' } + * ); + * ``` + */ +export function warn( + messageTemplate: string, + messageParams: Array, + attributes?: Log['attributes'], + metadata?: CaptureLogMetadata, +): void; /** * @summary Capture a log with the `warn` level. Requires the `enableLogs` option to be enabled. * @@ -109,6 +335,65 @@ export function warn(...args: CaptureLogArgs): void { captureLog('warn', ...args); } +/** + * @summary Capture a log with the `error` level. Requires the `enableLogs` option to be enabled. + * + * You can either pass a message and attributes or a message template, params and attributes. + * + * @example + * + * ``` + * Sentry.logger.error('Failed to process payment', { + * orderId: 'order_123', + * errorCode: 'PAYMENT_FAILED', + * amount: 99.99 + * }); + * ``` + * + * @example With template strings + * + * ``` + * Sentry.logger.error('Payment processing failed for order %s: %s', + * ['order_123', 'insufficient funds'], + * { amount: 99.99 } + * ); + * ``` + */ +export function error( + message: ParameterizedString, + attributes?: Log['attributes'], + metadata?: CaptureLogMetadata, +): void; +/** + * @summary Capture a log with the `error` level. Requires the `enableLogs` option to be enabled. + * + * You can either pass a message and attributes or a message template, params and attributes. + * + * @example + * + * ``` + * Sentry.logger.error('Failed to process payment', { + * orderId: 'order_123', + * errorCode: 'PAYMENT_FAILED', + * amount: 99.99 + * }); + * ``` + * + * @example With template strings + * + * ``` + * Sentry.logger.error('Payment processing failed for order %s: %s', + * ['order_123', 'insufficient funds'], + * { amount: 99.99 } + * ); + * ``` + */ +export function error( + messageTemplate: string, + messageParams: Array, + attributes?: Log['attributes'], + metadata?: CaptureLogMetadata, +): void; /** * @summary Capture a log with the `error` level. Requires the `enableLogs` option to be enabled. * @@ -137,6 +422,65 @@ export function error(...args: CaptureLogArgs): void { captureLog('error', ...args); } +/** + * @summary Capture a log with the `fatal` level. Requires the `enableLogs` option to be enabled. + * + * You can either pass a message and attributes or a message template, params and attributes. + * + * @example + * + * ``` + * Sentry.logger.fatal('Database connection pool exhausted', { + * database: 'users', + * activeConnections: 100, + * maxConnections: 100 + * }); + * ``` + * + * @example With template strings + * + * ``` + * Sentry.logger.fatal('Database %s: %s connections active', + * ['connection pool exhausted', '100/100'], + * { database: 'users' } + * ); + * ``` + */ +export function fatal( + message: ParameterizedString, + attributes?: Log['attributes'], + metadata?: CaptureLogMetadata, +): void; +/** + * @summary Capture a log with the `fatal` level. Requires the `enableLogs` option to be enabled. + * + * You can either pass a message and attributes or a message template, params and attributes. + * + * @example + * + * ``` + * Sentry.logger.fatal('Database connection pool exhausted', { + * database: 'users', + * activeConnections: 100, + * maxConnections: 100 + * }); + * ``` + * + * @example With template strings + * + * ``` + * Sentry.logger.fatal('Database %s: %s connections active', + * ['connection pool exhausted', '100/100'], + * { database: 'users' } + * ); + * ``` + */ +export function fatal( + messageTemplate: string, + messageParams: Array, + attributes?: Log['attributes'], + metadata?: CaptureLogMetadata, +): void; /** * @summary Capture a log with the `fatal` level. Requires the `enableLogs` option to be enabled. * From ea2be26ebb8046fcd3db1f778ec4dcffd19e6133 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Mon, 29 Sep 2025 14:09:25 +0200 Subject: [PATCH 6/9] Revert "fix log parameter types???" This reverts commit 73919e64810972dc6f27d1a987a205fb8198678f. --- packages/node-core/src/logs/capture.ts | 25 +- packages/node-core/src/logs/exports.ts | 346 +------------------------ 2 files changed, 6 insertions(+), 365 deletions(-) diff --git a/packages/node-core/src/logs/capture.ts b/packages/node-core/src/logs/capture.ts index e40cb2f1c2b4..4c2fdc73a34c 100644 --- a/packages/node-core/src/logs/capture.ts +++ b/packages/node-core/src/logs/capture.ts @@ -5,7 +5,7 @@ import { _INTERNAL_captureLog } from '@sentry/core'; /** * Additional metadata to capture the log with. */ -export interface CaptureLogMetadata { +interface CaptureLogMetadata { scope?: Scope; } @@ -26,25 +26,10 @@ export type CaptureLogArgs = CaptureLogArgWithTemplate | CaptureLogArgWithoutTem /** * Capture a log with the given level. - */ -export function captureLog( - level: LogSeverityLevel, - message: ParameterizedString, - attributes?: Log['attributes'], - metadata?: CaptureLogMetadata, -): void; -/** - * Capture a log with the given level. - */ -export function captureLog( - level: LogSeverityLevel, - messageTemplate: string, - messageParams: Array, - attributes?: Log['attributes'], - metadata?: CaptureLogMetadata, -): void; -/** - * Capture a log with the given level. + * + * @param level - The level of the log. + * @param message - The message to log. + * @param attributes - Arbitrary structured data that stores information about the log - e.g., userId: 100. */ export function captureLog(level: LogSeverityLevel, ...args: CaptureLogArgs): void { const [messageOrMessageTemplate, paramsOrAttributes, maybeAttributesOrMetadata, maybeMetadata] = args; diff --git a/packages/node-core/src/logs/exports.ts b/packages/node-core/src/logs/exports.ts index bf6888e5d00c..665d4d78d9ad 100644 --- a/packages/node-core/src/logs/exports.ts +++ b/packages/node-core/src/logs/exports.ts @@ -1,65 +1,4 @@ -import type { Log, ParameterizedString } from '@sentry/core'; -import type { CaptureLogArgs, CaptureLogMetadata } from './capture'; -import { captureLog } from './capture'; - -/** - * @summary Capture a log with the `trace` level. Requires the `enableLogs` option to be enabled. - * - * You can either pass a message and attributes or a message template, params and attributes. - * - * @example - * - * ``` - * Sentry.logger.trace('Starting database connection', { - * database: 'users', - * connectionId: 'conn_123' - * }); - * ``` - * - * @example With template strings - * - * ``` - * Sentry.logger.trace('Database connection %s established for %s', - * ['successful', 'users'], - * { connectionId: 'conn_123' } - * ); - * ``` - */ -export function trace( - message: ParameterizedString, - attributes?: Log['attributes'], - metadata?: CaptureLogMetadata, -): void; - -/** - * @summary Capture a log with the `trace` level. Requires the `enableLogs` option to be enabled. - * - * You can either pass a message and attributes or a message template, params and attributes. - * - * @example - * - * ``` - * Sentry.logger.trace('Starting database connection', { - * database: 'users', - * connectionId: 'conn_123' - * }); - * ``` - * - * @example With template strings - * - * ``` - * Sentry.logger.trace('Database connection %s established for %s', - * ['successful', 'users'], - * { connectionId: 'conn_123' } - * ); - * ``` - */ -export function trace( - messageTemplate: string, - messageParams: Array, - attributes?: Log['attributes'], - metadata?: CaptureLogMetadata, -): void; +import { type CaptureLogArgs, captureLog } from './capture'; /** * @summary Capture a log with the `trace` level. Requires the `enableLogs` option to be enabled. @@ -88,63 +27,6 @@ export function trace(...args: CaptureLogArgs): void { captureLog('trace', ...args); } -/** - * @summary Capture a log with the `debug` level. Requires the `enableLogs` option to be enabled. - * - * You can either pass a message and attributes or a message template, params and attributes. - * - * @example - * - * ``` - * Sentry.logger.debug('Cache miss for user profile', { - * userId: 'user_123', - * cacheKey: 'profile:user_123' - * }); - * ``` - * - * @example With template strings - * - * ``` - * Sentry.logger.debug('Cache %s for %s: %s', - * ['miss', 'user profile', 'key not found'], - * { userId: 'user_123' } - * ); - * ``` - */ -export function debug( - message: ParameterizedString, - attributes?: Log['attributes'], - metadata?: CaptureLogMetadata, -): void; -/** - * @summary Capture a log with the `debug` level. Requires the `enableLogs` option to be enabled. - * - * You can either pass a message and attributes or a message template, params and attributes. - * - * @example - * - * ``` - * Sentry.logger.debug('Cache miss for user profile', { - * userId: 'user_123', - * cacheKey: 'profile:user_123' - * }); - * ``` - * - * @example With template strings - * - * ``` - * Sentry.logger.debug('Cache %s for %s: %s', - * ['miss', 'user profile', 'key not found'], - * { userId: 'user_123' } - * ); - * ``` - */ -export function debug( - messageTemplate: string, - messageParams: Array, - attributes?: Log['attributes'], - metadata?: CaptureLogMetadata, -): void; /** * @summary Capture a log with the `debug` level. Requires the `enableLogs` option to be enabled. * @@ -172,59 +54,6 @@ export function debug(...args: CaptureLogArgs): void { captureLog('debug', ...args); } -/** - * @summary Capture a log with the `info` level. Requires the `enableLogs` option to be enabled. - * - * You can either pass a message and attributes or a message template, params and attributes. - * - * @example - * - * ``` - * Sentry.logger.info('User profile updated', { - * userId: 'user_123', - * updatedFields: ['email', 'preferences'] - * }); - * ``` - * - * @example With template strings - * - * ``` - * Sentry.logger.info('User %s updated their %s', - * ['John Doe', 'profile settings'], - * { userId: 'user_123' } - * ); - * ``` - */ -export function info(message: ParameterizedString, attributes?: Log['attributes'], metadata?: CaptureLogMetadata): void; -/** - * @summary Capture a log with the `info` level. Requires the `enableLogs` option to be enabled. - * - * You can either pass a message and attributes or a message template, params and attributes. - * - * @example - * - * ``` - * Sentry.logger.info('User profile updated', { - * userId: 'user_123', - * updatedFields: ['email', 'preferences'] - * }); - * ``` - * - * @example With template strings - * - * ``` - * Sentry.logger.info('User %s updated their %s', - * ['John Doe', 'profile settings'], - * { userId: 'user_123' } - * ); - * ``` - */ -export function info( - messageTemplate: string, - messageParams: Array, - attributes?: Log['attributes'], - metadata?: CaptureLogMetadata, -): void; /** * @summary Capture a log with the `info` level. Requires the `enableLogs` option to be enabled. * @@ -252,61 +81,6 @@ export function info(...args: CaptureLogArgs): void { captureLog('info', ...args); } -/** - * @summary Capture a log with the `warn` level. Requires the `enableLogs` option to be enabled. - * - * You can either pass a message and attributes or a message template, params and attributes. - * - * @example - * - * ``` - * Sentry.logger.warn('Rate limit approaching', { - * endpoint: '/api/users', - * currentRate: '95/100', - * resetTime: '2024-03-20T10:00:00Z' - * }); - * ``` - * - * @example With template strings - * - * ``` - * Sentry.logger.warn('Rate limit %s for %s: %s', - * ['approaching', '/api/users', '95/100 requests'], - * { resetTime: '2024-03-20T10:00:00Z' } - * ); - * ``` - */ -export function warn(message: ParameterizedString, attributes?: Log['attributes'], metadata?: CaptureLogMetadata): void; -/** - * @summary Capture a log with the `warn` level. Requires the `enableLogs` option to be enabled. - * - * You can either pass a message and attributes or a message template, params and attributes. - * - * @example - * - * ``` - * Sentry.logger.warn('Rate limit approaching', { - * endpoint: '/api/users', - * currentRate: '95/100', - * resetTime: '2024-03-20T10:00:00Z' - * }); - * ``` - * - * @example With template strings - * - * ``` - * Sentry.logger.warn('Rate limit %s for %s: %s', - * ['approaching', '/api/users', '95/100 requests'], - * { resetTime: '2024-03-20T10:00:00Z' } - * ); - * ``` - */ -export function warn( - messageTemplate: string, - messageParams: Array, - attributes?: Log['attributes'], - metadata?: CaptureLogMetadata, -): void; /** * @summary Capture a log with the `warn` level. Requires the `enableLogs` option to be enabled. * @@ -335,65 +109,6 @@ export function warn(...args: CaptureLogArgs): void { captureLog('warn', ...args); } -/** - * @summary Capture a log with the `error` level. Requires the `enableLogs` option to be enabled. - * - * You can either pass a message and attributes or a message template, params and attributes. - * - * @example - * - * ``` - * Sentry.logger.error('Failed to process payment', { - * orderId: 'order_123', - * errorCode: 'PAYMENT_FAILED', - * amount: 99.99 - * }); - * ``` - * - * @example With template strings - * - * ``` - * Sentry.logger.error('Payment processing failed for order %s: %s', - * ['order_123', 'insufficient funds'], - * { amount: 99.99 } - * ); - * ``` - */ -export function error( - message: ParameterizedString, - attributes?: Log['attributes'], - metadata?: CaptureLogMetadata, -): void; -/** - * @summary Capture a log with the `error` level. Requires the `enableLogs` option to be enabled. - * - * You can either pass a message and attributes or a message template, params and attributes. - * - * @example - * - * ``` - * Sentry.logger.error('Failed to process payment', { - * orderId: 'order_123', - * errorCode: 'PAYMENT_FAILED', - * amount: 99.99 - * }); - * ``` - * - * @example With template strings - * - * ``` - * Sentry.logger.error('Payment processing failed for order %s: %s', - * ['order_123', 'insufficient funds'], - * { amount: 99.99 } - * ); - * ``` - */ -export function error( - messageTemplate: string, - messageParams: Array, - attributes?: Log['attributes'], - metadata?: CaptureLogMetadata, -): void; /** * @summary Capture a log with the `error` level. Requires the `enableLogs` option to be enabled. * @@ -422,65 +137,6 @@ export function error(...args: CaptureLogArgs): void { captureLog('error', ...args); } -/** - * @summary Capture a log with the `fatal` level. Requires the `enableLogs` option to be enabled. - * - * You can either pass a message and attributes or a message template, params and attributes. - * - * @example - * - * ``` - * Sentry.logger.fatal('Database connection pool exhausted', { - * database: 'users', - * activeConnections: 100, - * maxConnections: 100 - * }); - * ``` - * - * @example With template strings - * - * ``` - * Sentry.logger.fatal('Database %s: %s connections active', - * ['connection pool exhausted', '100/100'], - * { database: 'users' } - * ); - * ``` - */ -export function fatal( - message: ParameterizedString, - attributes?: Log['attributes'], - metadata?: CaptureLogMetadata, -): void; -/** - * @summary Capture a log with the `fatal` level. Requires the `enableLogs` option to be enabled. - * - * You can either pass a message and attributes or a message template, params and attributes. - * - * @example - * - * ``` - * Sentry.logger.fatal('Database connection pool exhausted', { - * database: 'users', - * activeConnections: 100, - * maxConnections: 100 - * }); - * ``` - * - * @example With template strings - * - * ``` - * Sentry.logger.fatal('Database %s: %s connections active', - * ['connection pool exhausted', '100/100'], - * { database: 'users' } - * ); - * ``` - */ -export function fatal( - messageTemplate: string, - messageParams: Array, - attributes?: Log['attributes'], - metadata?: CaptureLogMetadata, -): void; /** * @summary Capture a log with the `fatal` level. Requires the `enableLogs` option to be enabled. * From 29725514310b101cc186ea9fd57b293144b3bf8a Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Mon, 29 Sep 2025 14:58:43 +0200 Subject: [PATCH 7/9] use regular types for 5.0 and add test for ts5 --- .../test-applications/generic-ts5.0/.npmrc | 2 ++ .../test-applications/generic-ts5.0/index.ts | 5 ++++ .../generic-ts5.0/package.json | 26 +++++++++++++++++++ .../generic-ts5.0/tsconfig.json | 11 ++++++++ packages/aws-serverless/package.json | 2 +- packages/browser-utils/package.json | 2 +- packages/browser/package.json | 2 +- packages/bun/package.json | 2 +- packages/cloudflare/package.json | 2 +- packages/core/package.json | 2 +- packages/feedback/package.json | 2 +- packages/gatsby/package.json | 2 +- packages/google-cloud-serverless/package.json | 2 +- packages/integration-shims/package.json | 2 +- packages/nextjs/package.json | 2 +- packages/node-core/package.json | 2 +- packages/node-native/package.json | 2 +- packages/node/package.json | 2 +- packages/opentelemetry/package.json | 2 +- packages/profiling-node/package.json | 2 +- packages/react/package.json | 2 +- packages/remix/package.json | 2 +- packages/replay-canvas/package.json | 2 +- packages/replay-internal/package.json | 2 +- packages/replay-worker/package.json | 2 +- packages/svelte/package.json | 2 +- packages/tanstackstart-react/package.json | 2 +- packages/tanstackstart/package.json | 2 +- packages/types/package.json | 2 +- packages/vercel-edge/package.json | 2 +- packages/vue/package.json | 2 +- packages/wasm/package.json | 2 +- 32 files changed, 72 insertions(+), 28 deletions(-) create mode 100644 dev-packages/e2e-tests/test-applications/generic-ts5.0/.npmrc create mode 100644 dev-packages/e2e-tests/test-applications/generic-ts5.0/index.ts create mode 100644 dev-packages/e2e-tests/test-applications/generic-ts5.0/package.json create mode 100644 dev-packages/e2e-tests/test-applications/generic-ts5.0/tsconfig.json diff --git a/dev-packages/e2e-tests/test-applications/generic-ts5.0/.npmrc b/dev-packages/e2e-tests/test-applications/generic-ts5.0/.npmrc new file mode 100644 index 000000000000..070f80f05092 --- /dev/null +++ b/dev-packages/e2e-tests/test-applications/generic-ts5.0/.npmrc @@ -0,0 +1,2 @@ +@sentry:registry=http://127.0.0.1:4873 +@sentry-internal:registry=http://127.0.0.1:4873 diff --git a/dev-packages/e2e-tests/test-applications/generic-ts5.0/index.ts b/dev-packages/e2e-tests/test-applications/generic-ts5.0/index.ts new file mode 100644 index 000000000000..beb10260da38 --- /dev/null +++ b/dev-packages/e2e-tests/test-applications/generic-ts5.0/index.ts @@ -0,0 +1,5 @@ +import * as _SentryReplay from '@sentry-internal/replay'; +import * as _SentryBrowser from '@sentry/browser'; +import * as _SentryCore from '@sentry/core'; +import * as _SentryNode from '@sentry/node'; +import * as _SentryWasm from '@sentry/wasm'; diff --git a/dev-packages/e2e-tests/test-applications/generic-ts5.0/package.json b/dev-packages/e2e-tests/test-applications/generic-ts5.0/package.json new file mode 100644 index 000000000000..28260cc4de5a --- /dev/null +++ b/dev-packages/e2e-tests/test-applications/generic-ts5.0/package.json @@ -0,0 +1,26 @@ +{ + "name": "@sentry-internal/ts5.0-test", + "private": true, + "license": "MIT", + "scripts": { + "build:types": "pnpm run type-check", + "ts-version": "tsc --version", + "type-check": "tsc --project tsconfig.json", + "test:build": "pnpm install && pnpm run build:types", + "test:assert": "pnpm -v" + }, + "devDependencies": { + "typescript": "5.0.0", + "@types/node": "^18.19.1" + }, + "dependencies": { + "@sentry/browser": "latest || *", + "@sentry/core": "latest || *", + "@sentry/node": "latest || *", + "@sentry-internal/replay": "latest || *", + "@sentry/wasm": "latest || *" + }, + "volta": { + "extends": "../../package.json" + } +} diff --git a/dev-packages/e2e-tests/test-applications/generic-ts5.0/tsconfig.json b/dev-packages/e2e-tests/test-applications/generic-ts5.0/tsconfig.json new file mode 100644 index 000000000000..95de9c93fc38 --- /dev/null +++ b/dev-packages/e2e-tests/test-applications/generic-ts5.0/tsconfig.json @@ -0,0 +1,11 @@ +{ + "include": ["index.ts"], + "compilerOptions": { + "lib": ["es2018", "DOM"], + "skipLibCheck": false, + "noEmit": true, + "types": [], + "target": "es2018", + "moduleResolution": "node" + } +} diff --git a/packages/aws-serverless/package.json b/packages/aws-serverless/package.json index 1f9860d32ca1..2c9d74fcd065 100644 --- a/packages/aws-serverless/package.json +++ b/packages/aws-serverless/package.json @@ -55,7 +55,7 @@ } }, "typesVersions": { - "<5.8": { + "<5.0": { "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 405ba4f0f724..363b725915ba 100644 --- a/packages/browser-utils/package.json +++ b/packages/browser-utils/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<5.8": { + "<5.0": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/browser/package.json b/packages/browser/package.json index 9f1cf8fd8ce6..3b01f272299f 100644 --- a/packages/browser/package.json +++ b/packages/browser/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<5.8": { + "<5.0": { "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 b517c2573142..15eb9481f99a 100644 --- a/packages/bun/package.json +++ b/packages/bun/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<5.8": { + "<5.0": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/cloudflare/package.json b/packages/cloudflare/package.json index 55e7c46770ad..df04b7ad30ac 100644 --- a/packages/cloudflare/package.json +++ b/packages/cloudflare/package.json @@ -39,7 +39,7 @@ } }, "typesVersions": { - "<5.8": { + "<5.0": { "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 27c054cfe40d..2e7f2d55018a 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<5.8": { + "<5.0": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/feedback/package.json b/packages/feedback/package.json index 595f7607c9e8..cfd607c98884 100644 --- a/packages/feedback/package.json +++ b/packages/feedback/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<5.8": { + "<5.0": { "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 cd6f04cbed52..e54d827079d9 100644 --- a/packages/gatsby/package.json +++ b/packages/gatsby/package.json @@ -35,7 +35,7 @@ } }, "typesVersions": { - "<5.8": { + "<5.0": { "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 36c87bc2b7ba..a4507d3482f3 100644 --- a/packages/google-cloud-serverless/package.json +++ b/packages/google-cloud-serverless/package.json @@ -38,7 +38,7 @@ } }, "typesVersions": { - "<5.8": { + "<5.0": { "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 783124d6af73..b13790dbfb95 100644 --- a/packages/integration-shims/package.json +++ b/packages/integration-shims/package.json @@ -22,7 +22,7 @@ } }, "typesVersions": { - "<5.8": { + "<5.0": { "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 4905be145096..9464ced6a3ed 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -66,7 +66,7 @@ } }, "typesVersions": { - "<5.8": { + "<5.0": { "build/npm/types/index.d.ts": [ "build/npm/types-ts3.8/index.d.ts" ] diff --git a/packages/node-core/package.json b/packages/node-core/package.json index 668c087425aa..701991d15783 100644 --- a/packages/node-core/package.json +++ b/packages/node-core/package.json @@ -47,7 +47,7 @@ } }, "typesVersions": { - "<5.8": { + "<5.0": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/node-native/package.json b/packages/node-native/package.json index b46b039a4e00..eaf0b9f4f15e 100644 --- a/packages/node-native/package.json +++ b/packages/node-native/package.json @@ -31,7 +31,7 @@ } }, "typesVersions": { - "<5.8": { + "<5.0": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/node/package.json b/packages/node/package.json index 9250b37753ec..a78a670a6cdd 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -55,7 +55,7 @@ } }, "typesVersions": { - "<5.8": { + "<5.0": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/opentelemetry/package.json b/packages/opentelemetry/package.json index 66eebd6dee05..8be9d3fe62dd 100644 --- a/packages/opentelemetry/package.json +++ b/packages/opentelemetry/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<5.8": { + "<5.0": { "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 545a26ebb218..177badb3987c 100644 --- a/packages/profiling-node/package.json +++ b/packages/profiling-node/package.json @@ -23,7 +23,7 @@ } }, "typesVersions": { - "<5.8": { + "<5.0": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/react/package.json b/packages/react/package.json index 936fd789d2a0..8b4c9be1e4fa 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<5.8": { + "<5.0": { "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 edfa656c6176..49f8547e9e47 100644 --- a/packages/remix/package.json +++ b/packages/remix/package.json @@ -54,7 +54,7 @@ } }, "typesVersions": { - "<5.8": { + "<5.0": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/replay-canvas/package.json b/packages/replay-canvas/package.json index 3bab81a5a750..2d5cbe1f4979 100644 --- a/packages/replay-canvas/package.json +++ b/packages/replay-canvas/package.json @@ -19,7 +19,7 @@ } }, "typesVersions": { - "<5.8": { + "<5.0": { "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 8c7bf29c3282..ba9f70516b01 100644 --- a/packages/replay-internal/package.json +++ b/packages/replay-internal/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<5.8": { + "<5.0": { "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 0a04f59a5f53..3e02a1ef7fd7 100644 --- a/packages/replay-worker/package.json +++ b/packages/replay-worker/package.json @@ -23,7 +23,7 @@ } }, "typesVersions": { - "<5.8": { + "<5.0": { "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 5463404a14c7..e65fa84fd435 100644 --- a/packages/svelte/package.json +++ b/packages/svelte/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<5.8": { + "<5.0": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/tanstackstart-react/package.json b/packages/tanstackstart-react/package.json index 6b11926a8a35..71ae6f8c4e53 100644 --- a/packages/tanstackstart-react/package.json +++ b/packages/tanstackstart-react/package.json @@ -40,7 +40,7 @@ } }, "typesVersions": { - "<5.8": { + "<5.0": { "build/npm/types/index.d.ts": [ "build/npm/types-ts3.8/index.d.ts" ] diff --git a/packages/tanstackstart/package.json b/packages/tanstackstart/package.json index ba1cdc5eb051..b03139402bdb 100644 --- a/packages/tanstackstart/package.json +++ b/packages/tanstackstart/package.json @@ -30,7 +30,7 @@ } }, "typesVersions": { - "<5.8": { + "<5.0": { "build/npm/types/index.d.ts": [ "build/npm/types-ts3.8/index.d.ts" ] diff --git a/packages/types/package.json b/packages/types/package.json index c88050e1ea19..e393534729c7 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<5.8": { + "<5.0": { "build/types/index.d.ts": [ "build/types-ts3.8/index.d.ts" ] diff --git a/packages/vercel-edge/package.json b/packages/vercel-edge/package.json index fc89752a28da..94ce4856d199 100644 --- a/packages/vercel-edge/package.json +++ b/packages/vercel-edge/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<5.8": { + "<5.0": { "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 fd9ae173d5e2..ba35ef861b38 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<5.8": { + "<5.0": { "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 8de39784457a..35515307262d 100644 --- a/packages/wasm/package.json +++ b/packages/wasm/package.json @@ -29,7 +29,7 @@ } }, "typesVersions": { - "<5.8": { + "<5.0": { "build/npm/types/index.d.ts": [ "build/npm/types-ts3.8/index.d.ts" ] From 23fff21b6d97601a3fded3e7889b243a17b9f6ee Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Mon, 29 Sep 2025 15:44:17 +0200 Subject: [PATCH 8/9] pin to typescript 5.0.2 --- .../e2e-tests/test-applications/generic-ts5.0/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev-packages/e2e-tests/test-applications/generic-ts5.0/package.json b/dev-packages/e2e-tests/test-applications/generic-ts5.0/package.json index 28260cc4de5a..1079d8f4c793 100644 --- a/dev-packages/e2e-tests/test-applications/generic-ts5.0/package.json +++ b/dev-packages/e2e-tests/test-applications/generic-ts5.0/package.json @@ -10,7 +10,7 @@ "test:assert": "pnpm -v" }, "devDependencies": { - "typescript": "5.0.0", + "typescript": "5.0.2", "@types/node": "^18.19.1" }, "dependencies": { From ba626d3b073ea28bd522d8170a1aeae9c25568b7 Mon Sep 17 00:00:00 2001 From: s1gr1d Date: Thu, 16 Oct 2025 14:29:00 +0200 Subject: [PATCH 9/9] fix ts linting error --- packages/nuxt/src/module.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/nuxt/src/module.ts b/packages/nuxt/src/module.ts index 1e806e4dc2eb..6d159785a5ba 100644 --- a/packages/nuxt/src/module.ts +++ b/packages/nuxt/src/module.ts @@ -75,14 +75,16 @@ export default defineNuxtModule({ // Add the sentry config file to the include array nuxt.hook('prepare:types', options => { - if (!options.tsConfig.include) { - options.tsConfig.include = []; + const tsConfig = options.tsConfig as { include?: string[] }; + + if (!tsConfig.include) { + tsConfig.include = []; } // Add type references for useRuntimeConfig in root files for nuxt v4 // Should be relative to `root/.nuxt` const relativePath = path.relative(nuxt.options.buildDir, clientConfigFile); - options.tsConfig.include.push(relativePath); + tsConfig.include.push(relativePath); }); }