Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dev-packages/e2e-tests/test-applications/generic-ts5.0/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@sentry:registry=http://127.0.0.1:4873
@sentry-internal:registry=http://127.0.0.1:4873
Original file line number Diff line number Diff line change
@@ -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';
Original file line number Diff line number Diff line change
@@ -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.2",
"@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"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"include": ["index.ts"],
"compilerOptions": {
"lib": ["es2018", "DOM"],
"skipLibCheck": false,
"noEmit": true,
"types": [],
"target": "es2018",
"moduleResolution": "node"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true,
"baseUrl": ".",
"types": ["@shopify/oxygen-workers-types"],
"types": ["@shopify/oxygen-workers-types", "node"],
"paths": {
"~/*": ["app/*"]
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion packages/browser-utils/src/metrics/instrument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion packages/browser/src/profiling/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,8 @@ 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;
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const last = PROFILE_MAP.keys().next().value!;
PROFILE_MAP.delete(last);
}
}
2 changes: 1 addition & 1 deletion packages/core/src/instrument/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/utils/debug-ids.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export function getDebugImagesForResources(
images.push({
type: 'sourcemap',
code_file: path,
debug_id: filenameDebugIdMap[path] as string,
debug_id: filenameDebugIdMap[path],
});
}
}
Expand Down
4 changes: 3 additions & 1 deletion packages/core/src/utils/lru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ export class LRUMap<K, V> {
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);
// 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);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/nextjs/src/config/webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
1 change: 1 addition & 0 deletions packages/nextjs/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

// require for top-level await
"module": "Node16",
"moduleResolution": "Node16",
"target": "es2020",

// other package-specific, test-specific options
Expand Down
2 changes: 1 addition & 1 deletion packages/node-core/src/integrations/anr/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/node-core/test/helpers/mockSdkInit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export function getSpanProcessor(): SentrySpanProcessor | undefined {

const spanProcessor = multiSpanProcessor?.['_spanProcessors']?.find(
(spanProcessor: SpanProcessor) => spanProcessor instanceof SentrySpanProcessor,
) as SentrySpanProcessor | undefined;
);

return spanProcessor;
}
Expand Down
3 changes: 2 additions & 1 deletion packages/node-core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

"compilerOptions": {
"lib": ["ES2020", "ES2021.WeakRef"],
"module": "Node16"
"module": "Node16",
"moduleResolution": "Node16"
}
}
4 changes: 2 additions & 2 deletions packages/node-native/src/event-loop-block-watchdog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ function applyDebugMeta(event: Event, debugImages: Record<string, string>): 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]);
}
}
}
Expand All @@ -158,7 +158,7 @@ function applyDebugMeta(event: Event, debugImages: Record<string, string>): 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]);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/node/test/helpers/mockSdkInit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function getSpanProcessor(): SentrySpanProcessor | undefined {

const spanProcessor = multiSpanProcessor?.['_spanProcessors']?.find(
(spanProcessor: SpanProcessor) => spanProcessor instanceof SentrySpanProcessor,
) as SentrySpanProcessor | undefined;
);

return spanProcessor;
}
Expand Down
3 changes: 2 additions & 1 deletion packages/node/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

"compilerOptions": {
"lib": ["es2020"],
"module": "Node16"
"module": "Node16",
"moduleResolution": "Node16"
}
}
8 changes: 5 additions & 3 deletions packages/nuxt/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,16 @@ export default defineNuxtModule<ModuleOptions>({

// 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);
});
}

Expand Down
4 changes: 2 additions & 2 deletions packages/nuxt/src/runtime/plugins/sentry-cloudflare.server.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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<unknown, IncomingRequestCfProperties<unknown>>;
});

const requestHandlerOptions = {
options: cloudflareOptions,
Expand Down
2 changes: 1 addition & 1 deletion packages/remix/src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 1 addition & 5 deletions packages/remix/src/vendor/instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
2 changes: 1 addition & 1 deletion packages/remix/test/integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions packages/remix/tsconfig.test.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"types": ["node"],
// Required for top-level await in tests
"module": "Node16",
"moduleResolution": "Node16",
"target": "es2020",

"esModuleInterop": true
Expand Down
2 changes: 1 addition & 1 deletion packages/sveltekit/src/worker/cloudflare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function initCloudflareSentryHandle(options: CloudflareOptions): Handle {
return wrapRequestHandler(
{
options: opts,
request: event.request as Request<unknown, IncomingRequestCfProperties<unknown>>,
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
Expand Down
3 changes: 2 additions & 1 deletion packages/tanstackstart-react/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"include": ["src/**/*"],
"compilerOptions": {
"lib": ["es2020"],
"module": "Node16"
"module": "Node16",
"moduleResolution": "Node16"
}
}
3 changes: 2 additions & 1 deletion packages/tanstackstart/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"include": ["src/**/*"],
"compilerOptions": {
"lib": ["es2020"],
"module": "Node16"
"module": "Node16",
"moduleResolution": "Node16"
}
}
2 changes: 1 addition & 1 deletion packages/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"tsconfig.json"
],
"peerDependencies": {
"typescript": "~5.0.0"
"typescript": "~5.8.0"
},
"scripts": {
"clean": "yarn rimraf sentry-internal-typescript-*.tgz",
Expand Down
2 changes: 1 addition & 1 deletion scripts/verify-packages-versions.js
Original file line number Diff line number Diff line change
@@ -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(`
Expand Down
7 changes: 1 addition & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -30045,7 +30045,7 @@ [email protected]:
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==
Expand All @@ -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"
Expand Down