Skip to content
Open
Show file tree
Hide file tree
Changes from 11 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
1 change: 0 additions & 1 deletion dev-packages/browser-integration-tests/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

"compilerOptions": {
"lib": ["dom", "ES2020"],
"moduleResolution": "node",
"noEmit": true,
"strict": true,
"allowSyntheticDefaultImports": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,11 @@ const tsConfig = require(baseTscConfigPath);
// TS 3.8 fails build when it encounters a config option it does not understand, so we remove it :(
delete tsConfig.compilerOptions.noUncheckedIndexedAccess;

// TS 3.8 predates `node16` module/moduleResolution (added in TS 4.7). Restore the pre-`node16`
// base shape: drop `module` (so ts-node, which runs the scenarios, keeps emitting CommonJS) and
// use plain `node` resolution. Setting `module` to an ESM value here breaks the `ts-node/register`
// scenarios, which are loaded as CommonJS.
delete tsConfig.compilerOptions.module;
tsConfig.compilerOptions.moduleResolution = 'node';

writeFileSync(baseTscConfigPath, JSON.stringify(tsConfig, null, 2));
7 changes: 7 additions & 0 deletions dev-packages/node-integration-tests/scripts/use-ts-3_8.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,11 @@ const tsConfig = require(baseTscConfigPath);
// TS 3.8 fails build when it encounters a config option it does not understand, so we remove it :(
delete tsConfig.compilerOptions.noUncheckedIndexedAccess;

// TS 3.8 predates `node16` module/moduleResolution (added in TS 4.7). Restore the pre-`node16`
// base shape: drop `module` (so ts-node, which runs the scenarios, keeps emitting CommonJS) and
// use plain `node` resolution. Setting `module` to an ESM value here breaks the `ts-node/register`
// scenarios, which are loaded as CommonJS.
delete tsConfig.compilerOptions.module;
tsConfig.compilerOptions.moduleResolution = 'node';

writeFileSync(baseTscConfigPath, JSON.stringify(tsConfig, null, 2));
1 change: 0 additions & 1 deletion dev-packages/test-utils/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"target": "ES2022",
"module": "ES2022",
// package-specific options
"esModuleInterop": true
},
Expand Down
3 changes: 2 additions & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"{workspaceRoot}/*.js",
"{workspaceRoot}/*.json",
"{workspaceRoot}/yarn.lock",
"{workspaceRoot}/dev-packages/rollup-utils/**"
"{workspaceRoot}/dev-packages/rollup-utils/**",
"{workspaceRoot}/packages/typescript/**"
],
"production": ["default", "!{projectRoot}/test/**/*", "!{projectRoot}/**/*.md", "!{projectRoot}/*.tgz"]
},
Expand Down
29 changes: 26 additions & 3 deletions packages/angular/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,35 @@
{
"extends": "../../tsconfig.json",

// NOTE: Unlike every other package, this config does NOT extend the shared base config
// (`../../tsconfig.json`). `@sentry/angular` is built with `ng-packagr`, which pins an older
// TypeScript (4.6) that doesn't understand the `node16` module/moduleResolution our base config
// defaults to (and rejects the literal even when overridden). We therefore inline the relevant
// base compiler options here and use `esnext`/`node` instead.
"include": ["**/*.ts", "src/**/*"],

"exclude": ["patch-vitest.ts", "setup-test.ts"],

"compilerOptions": {
// package-specific options
"declaration": false,
"declarationMap": false,
"downlevelIteration": true,
"importHelpers": true,
"inlineSources": true,
"isolatedModules": true,
"lib": ["es2020"],
"module": "esnext",
"moduleResolution": "node",
"noErrorTruncation": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"preserveWatchOutput": true,
"sourceMap": true,
"strict": true,
"strictBindCallApply": false,
"target": "es2020",
"noUncheckedIndexedAccess": true,
"skipLibCheck": true,
"experimentalDecorators": true
}
}
1 change: 1 addition & 0 deletions packages/astro/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"include": ["src/**/*"],

"compilerOptions": {
"module": "esnext",
"moduleResolution": "bundler"
// package-specific options
}
Expand Down
1 change: 1 addition & 0 deletions packages/browser/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"include": ["src/**/*", "test/loader.js"],

"compilerOptions": {
"module": "esnext",
"moduleResolution": "bundler",
"lib": ["DOM", "es2020", "WebWorker"]
}
Expand Down
1 change: 1 addition & 0 deletions packages/cloudflare/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

"compilerOptions": {
"module": "esnext",
"moduleResolution": "bundler",
"types": ["node", "@cloudflare/workers-types"]
}
}
1 change: 1 addition & 0 deletions packages/deno/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"compilerOptions": {
"lib": ["esnext"],
"module": "esnext",
"moduleResolution": "bundler",
"target": "esnext"
}
}
1 change: 1 addition & 0 deletions packages/feedback/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"module": "esnext",
"moduleResolution": "bundler",

/* Preact Config */
"jsx": "react-jsx",
Expand Down
1 change: 1 addition & 0 deletions packages/hono/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

"compilerOptions": {
"module": "esnext",
"moduleResolution": "bundler",
"types": ["node", "@cloudflare/workers-types"]
}
}
1 change: 1 addition & 0 deletions packages/integration-shims/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"include": ["src/**/*"],

"compilerOptions": {
"module": "esnext",
"moduleResolution": "bundler"
// package-specific options
}
Expand Down
4 changes: 1 addition & 3 deletions packages/node-core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
"include": ["src/**/*"],

"compilerOptions": {
"lib": ["ES2020", "ES2021.WeakRef"],
"module": "Node16",
"moduleResolution": "Node16"
"lib": ["ES2020", "ES2021.WeakRef"]
}
}
2 changes: 1 addition & 1 deletion packages/node-native/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"module": "esnext",
"lib": ["es2020"],
"moduleResolution": "bundler",
Comment thread
sentry[bot] marked this conversation as resolved.
Outdated
"outDir": "build",
"types": ["node"]
},
Expand Down
8 changes: 1 addition & 7 deletions packages/node/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
{
"extends": "../../tsconfig.json",

"include": ["src/**/*"],

"compilerOptions": {
"lib": ["es2020"],
"module": "Node16",
"moduleResolution": "Node16"
}
"include": ["src/**/*"]
}
2 changes: 1 addition & 1 deletion packages/profiling-node/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"module": "esnext",
"lib": ["es2020"],
"moduleResolution": "bundler",
"outDir": "build",
"types": ["node"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ describe('wrapServerAction', () => {
it('should skip span creation and warn when instrumentation API is used', async () => {
// Reset modules to get a fresh copy with unset warning flag
vi.resetModules();
// @ts-expect-error - Dynamic import for module reset works at runtime but vitest's typecheck doesn't fully support it
const { wrapServerAction: freshWrapServerAction } = await import('../../src/server/wrapServerAction');

// Set the global flag indicating instrumentation API is in use
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ describe('wrapServerLoader', () => {
it('should skip span creation and warn when instrumentation API is used', async () => {
// Reset modules to get a fresh copy with unset warning flag
vi.resetModules();
// @ts-expect-error - Dynamic import for module reset works at runtime but vitest's typecheck doesn't fully support it
const { wrapServerLoader: freshWrapServerLoader } = await import('../../src/server/wrapServerLoader');

// Set the global flag indicating instrumentation API is in use
Expand Down
1 change: 1 addition & 0 deletions packages/react-router/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"include": ["src/**/*"],

"compilerOptions": {
"module": "esnext",
"moduleResolution": "bundler",
"jsx": "react"
}
Expand Down
3 changes: 2 additions & 1 deletion packages/replay-canvas/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"lib": ["DOM", "es2020"],
"module": "esnext"
"module": "esnext",
"moduleResolution": "bundler"
},
"include": ["src/**/*.ts"]
}
3 changes: 2 additions & 1 deletion packages/replay-internal/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"lib": ["DOM", "es2020"],
"module": "esnext"
"module": "esnext",
"moduleResolution": "bundler"
},
"include": ["src/**/*.ts"]
}
1 change: 1 addition & 0 deletions packages/replay-worker/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"module": "esnext",
"moduleResolution": "bundler",
"lib": ["webworker", "scripthost"],
"esModuleInterop": true,
"target": "es2020",
Expand Down
6 changes: 1 addition & 5 deletions packages/server-utils/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"extends": "../../tsconfig.json",

"include": ["src/**/*"],

"compilerOptions": {
"lib": ["ES2020"]
}
"include": ["src/**/*"]
}
7 changes: 6 additions & 1 deletion packages/solid/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
"include": ["src/**/*"],

"compilerOptions": {
"lib": ["DOM", "es2020"]
"lib": ["DOM", "es2020"],
// This package imports ESM-only deps (`solid-js`); under `node16` resolution a CommonJS file
// can't `require` those (TS1479/TS1541). Like our other framework packages it's compiled via a
// bundler, so use `esnext`/`bundler` here instead of the `node16` default.
"module": "esnext",
"moduleResolution": "bundler"
}
}
7 changes: 6 additions & 1 deletion packages/svelte/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
"include": ["src/**/*"],

"compilerOptions": {
"lib": ["DOM", "es2020"]
"lib": ["DOM", "es2020"],
// We still support Svelte 3, which imports types from deep paths (e.g. `svelte/types/compiler/preprocess`)
// that aren't declared in Svelte's `exports` map. `node16` resolution honors that map and rejects them,
// so we keep the legacy `node` resolver here, which resolves them via filesystem lookup.
"module": "esnext",
"moduleResolution": "node"
}
}
7 changes: 1 addition & 6 deletions packages/tanstackstart/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["src/**/*"],
"compilerOptions": {
"lib": ["es2020"],
"module": "Node16",
"moduleResolution": "Node16"
}
"include": ["src/**/*"]
}
6 changes: 1 addition & 5 deletions packages/types/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"extends": "../../tsconfig.json",

"include": ["src/**/*"],

"compilerOptions": {
"lib": ["es2020"]
}
"include": ["src/**/*"]
}
3 changes: 2 additions & 1 deletion packages/typescript/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"inlineSources": true,
"isolatedModules": true,
"lib": ["es2020"],
"moduleResolution": "node",
"module": "node16",
"moduleResolution": "node16",
"noErrorTruncation": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
Expand Down
Loading