Skip to content

Fix compatibility with TypeScript 6 or 7 - #1390

Open
pxseu wants to merge 1 commit into
egoist:mainfrom
pxseu:pxseu/ts6
Open

Fix compatibility with TypeScript 6 or 7#1390
pxseu wants to merge 1 commit into
egoist:mainfrom
pxseu:pxseu/ts6

Conversation

@pxseu

@pxseu pxseu commented Mar 25, 2026

Copy link
Copy Markdown

Fixes:
#1389
#1388

error TS5101: Option 'baseUrl' is deprecated and will stop functioning in TypeScript 7.0.
Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.

Tested as a monkey patch here:

pxseu/fami@08c396d
https://github.com/pxseu/fami/actions/runs/23560643308/job/68599308721#step:5:9

@codesandbox

codesandbox Bot commented Mar 25, 2026

Copy link
Copy Markdown

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@vercel

vercel Bot commented Mar 25, 2026

Copy link
Copy Markdown

@pxseu is attempting to deploy a commit to the EGOIST's projects Team on Vercel.

A member of the Team first needs to authorize it.

@pxseu pxseu changed the title Fix compatibility with TypeScript 6 Fix compatibility with TypeScript 6 or 7 Mar 25, 2026
@lgarron

lgarron commented Mar 31, 2026

Copy link
Copy Markdown

I've also confirmed that this patch unbreaks tsup with TypeScript 6 for a fairly complex repo.

This looks like a very effective fix, since it still passes baseUrl via compilerOptions when this is explicitly set. So any projects that need to set this value still have a way to do so.

I'd like to implore the maintainers to merge this and include it in a release, rather than continuing to sit on it.

mcarter-astronautdev added a commit to DriverDigital/vite-plugin-shopify-clean that referenced this pull request Apr 17, 2026
tsup unconditionally sets baseUrl when generating .d.ts files,
which triggers TS5101 in TypeScript 6. Adding ignoreDeprecations
until tsup merges egoist/tsup#1390.
TylerBarnes added a commit to mastra-ai/mastra that referenced this pull request Apr 29, 2026
## Description

Upgrade TypeScript from `5.9.3` to `6.0.3` across the monorepo. TS 6 is
the last JS-based release before the Go-based TS 7 — this upgrade
prepares the codebase for the eventual v7 migration.

### What changed

**Version bump:**
- pnpm catalog: `^5.9.3` → `^6.0.3`

**Deprecated option removals (TS 6 deprecations → errors in TS 7):**
- Removed `baseUrl` from 5 tsconfig files (playground-ui, playground,
react SDK) — `paths` now resolves relative to the tsconfig without
`baseUrl`
- Removed `baseUrl` from 3 e2e test template tsconfigs (no-bundling,
monorepo app, inner-tools)
- Updated root `tsconfig.json` `moduleResolution` from `"Node"` (alias
for deprecated `Node10`) to `"bundler"`

**@types auto-discovery (TS 6 breaking change):**
- Added `"types": ["node"]` to `tsconfig.node.json` (base config for
most packages)
- Added `"types": ["node"]` to standalone tsconfigs that don't extend
`tsconfig.node.json` (`mcp-registry-registry`, `create-mastra`,
`memory/integration-tests`, `playground/e2e/kitchen-sink`)
- Added `"types": ["node"]` to e2e test templates (`commonjs`,
`no-bundling`, `type-check`)

**Build fixes:**
- Patched `tsup@8.5.1` to fix `baseUrl` deprecation error in DTS builder
(upstream
[egoist/tsup#1388](egoist/tsup#1388), unmerged
[fix PR #1390](egoist/tsup#1390))
- Fixed `convex` and `elasticsearch` `tsconfig.build.json` to properly
extend local `tsconfig.json` (matching all other stores)

**Code fixes:**
- Removed 2 now-unused `@ts-expect-error` directives in `packages/core`
for `ReadableStream` async iteration (natively supported in TS 6's
ES2025 lib)
- Added type assertion for `Response.json()` return in `mcp-docs-server`
(now returns `Promise<unknown>` instead of `Promise<any>`)
- Fixed type narrowing in `editor/processor-graph-hydrator.ts` for
`.parallel()` and `.map()` calls

### Verified locally
- **Full monorepo build**: 122/122 tasks pass — all `.d.ts` generation
works correctly
- **Typecheck**: all packages pass
- **Lint**: 112/112 tasks pass
- **E2E tests**: monorepo + no-bundling suites pass locally

## Type of Change

- [x] Code refactoring

## Checklist

- [x] I have made corresponding changes to the documentation (if
applicable)
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] I have addressed all Coderabbit comments on this PR

Link to Devin session:
https://app.devin.ai/sessions/286c1e429f144e4eb8f4a69033a347fd
Requested by: @TylerBarnes

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: tyler <tylerdbarnes@gmail.com>
pgerke added a commit to lion-and-bear/freeathome-local-api-client that referenced this pull request May 16, 2026
egoist/tsup#1390
Signed-off-by: Philip Gerke <me@philipgerke.com>
@zanlucathiago

Copy link
Copy Markdown

Just ran into this and can confirm the PR fixes it. Tested with tsup 8.5.1 and typescript 6.0.3: dropping that baseUrl line makes dts: true build cleanly again, no more TS5101, and my generated .d.ts came out the same as before.

One thing worth a look before merging: I'm assuming that fallback was there to help path-alias resolution in the dts build, so it'd be good to confirm alias-based builds still resolve. My repo doesn't use path aliases so I couldn't cover that case myself.

Either way it'd be great to see this land. Right now ignoreDeprecations: "6.0" is the only workaround, and that stops working in TS 7.

zanlucathiago added a commit to zanlucathiago/xls-reader that referenced this pull request Jul 6, 2026
The `ignoreDeprecations: "6.0"` line exists only because tsup's DTS build injects
a default `baseUrl` (deprecated in TS 6, removed in TS 7). Reference the upstream
tracking so we know when the workaround can go: egoist/tsup#1388, fixed by
egoist/tsup#1390.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@thibmeu

thibmeu commented Jul 7, 2026

Copy link
Copy Markdown

Worth noting that the project is not actively maintained and that #1332 added a recommendation to migrate to tsdown in the README

kodiakhq Bot pushed a commit to hyperdxio/hyperdx that referenced this pull request Jul 10, 2026
## Why

Move the monorepo onto TypeScript 6 (latest stable, `6.0.3`) from `5.9`. TS 6 is
the transition release before TS 7 — it converts several soon-to-be-removed
compiler options into **deprecation errors**, so upgrading now surfaces and
lets us fix those ahead of the (breaking) TS 7 release. Staying on v6 for now,
not v7.

TypeScript is a `devDependency` in every package (build-time only, not shipped),
so there is no runtime behavior change for users.

## What changed

**Dependency**
- `typescript` → `^6.0.3` in all 5 packages.
- `ts-jest` → `^29.4.11` (its peer range now allows TS 6, and it no longer
  forces `node10` module resolution).

**TS 6 deprecations fixed at the source (not just silenced)**
- Removed no-op `downlevelIteration` from `tsconfig.base.json` (target is ES2022).
- Removed deprecated `baseUrl`; rewrote `paths` mappings to be relative to each
  tsconfig (api, app, common-utils, hdx-eval).
- Switched `hdx-eval` off deprecated `node10` resolution → `node16`.

**New TS 6 requirements**
- Added explicit `types: ["jest","node"]` + `rootDir` to `common-utils`
  (TS 6 changed auto-`@types` inclusion; hoisted root `@types` no longer
  auto-resolve).
- Added `tests/*` path mapping and a `css.d.ts` ambient shim for plain
  `.css`/`.scss` side-effect imports — Next 16 only ships `*.module.css` types
  and TS 6 now enforces `TS2882` for untyped side-effect imports.

**Tooling workarounds (scoped, documented)**
- `ts-jest` transforms (api, app): explicit `rootDir` — TS 6 requires it when
  compiling a file subset per-file (`TS5011`).
- api dev/e2e server runs via `ts-node`, which also hit `TS5011`; added a
  `ts-node.compilerOptions.rootDir` override (scoped to ts-node; the full `tsc`
  build keeps its multi-dir root).
- `tsup` still hardcodes the now-deprecated `baseUrl` in its DTS build
  ([egoist/tsup#1388](egoist/tsup#1388), fix PR
  [#1390](egoist/tsup#1390) still open), so its DTS
  transform sets `ignoreDeprecations: "6.0"`.
- `common-utils` eslint now ignores `*.config.ts` (parity with the existing
  `*.config.js`/`.mjs` ignores).

Relevant upstream: TS 6 deprecation list
[microsoft/TypeScript#54500](microsoft/TypeScript#54500),
ts-jest TS 6 support
[kulshekhar/ts-jest#4198](kulshekhar/ts-jest#4198)
(shipped in 29.4.11).

## Verification

- `make ci-lint` — ✅ 5 projects (lint + `tsc --noEmit`, 0 errors)
- `make ci-unit` — ✅ common-utils (1406), cli (8), app (2272), hdx-eval (211)
- Integration — ✅ api (`make dev-int`, 1716), common-utils (51)
- E2E (`make e2e`) — ✅ 223 passed; the ts-node `TS5011` was caught and fixed
  here. Remaining failures were all pre-existing flaky timeouts (unrelated to
  TS) that pass in isolation.
- Dev-mode dry run (`yarn dev`) — ✅ api (ts-node) `/health` 200, app (Next 16)
  ready, no TS errors.

## Notes

- Branch prefix is `brandon/` rather than `claude/`/`agent/` because the
  worktree/branch was set up ahead of time; happy to rename if triage prefers.
@carvalhoviniciusluiz

Copy link
Copy Markdown

Confirmed this resolves #1388. I applied this change (dropping baseUrl: compilerOptions.baseUrl || '.' from the dts rollup compilerOptions) on top of tsup@8.5.1 with typescript@6.0.3 in a real pnpm + Turborepo monorepo (8 dual-format libs). Result: the TS5101 DTS failure is gone, all packages emit .d.ts again, every package type-checks with 0 errors, and dependency-cruiser passes. 👍

One note for completeness: this diff only addresses the baseUrl deprecation (#1388). The "node types not resolved (Buffer/process)" part described in #1389 isn't touched here — in our case that turned out to be a consumer-side tsconfig (types: ["node"]) matter, so it may be out of scope for tsup, but flagging in case #1389 is meant to be fully closed by this PR.

jordan-simonovski pushed a commit to hyperdxio/hyperdx that referenced this pull request Jul 13, 2026
## Why

Move the monorepo onto TypeScript 6 (latest stable, `6.0.3`) from `5.9`. TS 6 is
the transition release before TS 7 — it converts several soon-to-be-removed
compiler options into **deprecation errors**, so upgrading now surfaces and
lets us fix those ahead of the (breaking) TS 7 release. Staying on v6 for now,
not v7.

TypeScript is a `devDependency` in every package (build-time only, not shipped),
so there is no runtime behavior change for users.

## What changed

**Dependency**
- `typescript` → `^6.0.3` in all 5 packages.
- `ts-jest` → `^29.4.11` (its peer range now allows TS 6, and it no longer
  forces `node10` module resolution).

**TS 6 deprecations fixed at the source (not just silenced)**
- Removed no-op `downlevelIteration` from `tsconfig.base.json` (target is ES2022).
- Removed deprecated `baseUrl`; rewrote `paths` mappings to be relative to each
  tsconfig (api, app, common-utils, hdx-eval).
- Switched `hdx-eval` off deprecated `node10` resolution → `node16`.

**New TS 6 requirements**
- Added explicit `types: ["jest","node"]` + `rootDir` to `common-utils`
  (TS 6 changed auto-`@types` inclusion; hoisted root `@types` no longer
  auto-resolve).
- Added `tests/*` path mapping and a `css.d.ts` ambient shim for plain
  `.css`/`.scss` side-effect imports — Next 16 only ships `*.module.css` types
  and TS 6 now enforces `TS2882` for untyped side-effect imports.

**Tooling workarounds (scoped, documented)**
- `ts-jest` transforms (api, app): explicit `rootDir` — TS 6 requires it when
  compiling a file subset per-file (`TS5011`).
- api dev/e2e server runs via `ts-node`, which also hit `TS5011`; added a
  `ts-node.compilerOptions.rootDir` override (scoped to ts-node; the full `tsc`
  build keeps its multi-dir root).
- `tsup` still hardcodes the now-deprecated `baseUrl` in its DTS build
  ([egoist/tsup#1388](egoist/tsup#1388), fix PR
  [#1390](egoist/tsup#1390) still open), so its DTS
  transform sets `ignoreDeprecations: "6.0"`.
- `common-utils` eslint now ignores `*.config.ts` (parity with the existing
  `*.config.js`/`.mjs` ignores).

Relevant upstream: TS 6 deprecation list
[microsoft/TypeScript#54500](microsoft/TypeScript#54500),
ts-jest TS 6 support
[kulshekhar/ts-jest#4198](kulshekhar/ts-jest#4198)
(shipped in 29.4.11).

## Verification

- `make ci-lint` — ✅ 5 projects (lint + `tsc --noEmit`, 0 errors)
- `make ci-unit` — ✅ common-utils (1406), cli (8), app (2272), hdx-eval (211)
- Integration — ✅ api (`make dev-int`, 1716), common-utils (51)
- E2E (`make e2e`) — ✅ 223 passed; the ts-node `TS5011` was caught and fixed
  here. Remaining failures were all pre-existing flaky timeouts (unrelated to
  TS) that pass in isolation.
- Dev-mode dry run (`yarn dev`) — ✅ api (ts-node) `/health` 200, app (Next 16)
  ready, no TS errors.

## Notes

- Branch prefix is `brandon/` rather than `claude/`/`agent/` because the
  worktree/branch was set up ahead of time; happy to rename if triage prefers.
DevZonayed pushed a commit to DevZonayed/nexalance-skill-mastra-ai-mastra that referenced this pull request Aug 17, 2026
## Description

Upgrade TypeScript from `5.9.3` to `6.0.3` across the monorepo. TS 6 is
the last JS-based release before the Go-based TS 7 — this upgrade
prepares the codebase for the eventual v7 migration.

### What changed

**Version bump:**
- pnpm catalog: `^5.9.3` → `^6.0.3`

**Deprecated option removals (TS 6 deprecations → errors in TS 7):**
- Removed `baseUrl` from 5 tsconfig files (playground-ui, playground,
react SDK) — `paths` now resolves relative to the tsconfig without
`baseUrl`
- Removed `baseUrl` from 3 e2e test template tsconfigs (no-bundling,
monorepo app, inner-tools)
- Updated root `tsconfig.json` `moduleResolution` from `"Node"` (alias
for deprecated `Node10`) to `"bundler"`

**@types auto-discovery (TS 6 breaking change):**
- Added `"types": ["node"]` to `tsconfig.node.json` (base config for
most packages)
- Added `"types": ["node"]` to standalone tsconfigs that don't extend
`tsconfig.node.json` (`mcp-registry-registry`, `create-mastra`,
`memory/integration-tests`, `playground/e2e/kitchen-sink`)
- Added `"types": ["node"]` to e2e test templates (`commonjs`,
`no-bundling`, `type-check`)

**Build fixes:**
- Patched `tsup@8.5.1` to fix `baseUrl` deprecation error in DTS builder
(upstream
[egoist/tsup#1388](egoist/tsup#1388), unmerged
[fix PR mastra-ai#1390](egoist/tsup#1390))
- Fixed `convex` and `elasticsearch` `tsconfig.build.json` to properly
extend local `tsconfig.json` (matching all other stores)

**Code fixes:**
- Removed 2 now-unused `@ts-expect-error` directives in `packages/core`
for `ReadableStream` async iteration (natively supported in TS 6's
ES2025 lib)
- Added type assertion for `Response.json()` return in `mcp-docs-server`
(now returns `Promise<unknown>` instead of `Promise<any>`)
- Fixed type narrowing in `editor/processor-graph-hydrator.ts` for
`.parallel()` and `.map()` calls

### Verified locally
- **Full monorepo build**: 122/122 tasks pass — all `.d.ts` generation
works correctly
- **Typecheck**: all packages pass
- **Lint**: 112/112 tasks pass
- **E2E tests**: monorepo + no-bundling suites pass locally

## Type of Change

- [x] Code refactoring

## Checklist

- [x] I have made corresponding changes to the documentation (if
applicable)
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] I have addressed all Coderabbit comments on this PR

Link to Devin session:
https://app.devin.ai/sessions/286c1e429f144e4eb8f4a69033a347fd
Requested by: @TylerBarnes

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: tyler <tylerdbarnes@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants