Skip to content

mono - chore: upgrade TypeScript to 6 (breaking)#1672

Merged
jaredwray merged 1 commit into
mainfrom
claude/cacheable-dependency-management-d6gb1r
Jul 5, 2026
Merged

mono - chore: upgrade TypeScript to 6 (breaking)#1672
jaredwray merged 1 commit into
mainfrom
claude/cacheable-dependency-management-d6gb1r

Conversation

@jaredwray

Copy link
Copy Markdown
Owner

Please check if the PR fulfills these requirements

  • Followed the Contributing guidelines and Code of Conduct
  • Tests for the changes have been added (for bug fixes/features) with 100% code coverage. — N/A: build-tooling major upgrade with no source changes; existing suites still pass at 100% coverage where runnable in this environment.

What kind of change does this PR introduce?

Maintenance (chore) — major upgrade of the TypeScript compiler 5.9.36.0.3 across all 9 packages that declare it. This is a devDependency/build-tooling change; the emitted JS and .d.ts are unchanged in shape, so there is no impact for consumers of the published @cacheable/* packages.

Versions

  • typescript ^5.9.3^6.0.3 (cacheable, cache-manager, cacheable-request, file-entry-cache, flat-cache, @cacheable/memory, @cacheable/net, @cacheable/node-cache, @cacheable/utils)

Breaking notes

  • TS6 requires an explicit rootDir when the output layout depends on it (error TS5011). This surfaced only in cacheable-request, the one package that builds with tsc directly. Fix: added "rootDir": "./src" to packages/cacheable-request/tsconfig.build.json. This is behavior-preserving — it makes explicit what TypeScript previously inferred as the common source directory.
  • The tsdown-built packages that still use the now-deprecated moduleResolution: "node" / baseUrl build cleanly — those options don't error under TS 6 through tsdown's declaration generation, so I left them untouched here. Modernizing them (nodebundler, dropping baseUrl) is TS 7 preparation and belongs in its own change, not this compiler bump.
  • TS 6.0's changed defaults (strict, types: [], module, target) have no effect here because every package sets those options explicitly in its tsconfig.

Verification

  • pnpm build passes (all 9 packages, incl. the tsc build of cacheable-request)

  • node scripts/test-build.mjs (build-output validation: runtime + publint + attw on the TS6-generated .d.ts) passes for all packages

  • pnpm test — every package passes at 100% coverage except the same 3 tests that fail on main and are specific to this sandbox (not caused by this change):

    • cacheable-request › return with url and port — real request to external mockhttp.org:8080, unreachable here (the :80 variant passes).
    • file-entry-cache › should return a file descriptor with checksum and error and normalizeEntries() › should return all entries — both chmod 0o000 a file to force a read error, but this sandbox runs as root, which bypasses permission bits.

    All three pass on GitHub CI (non-root runner, full network).


Generated by Claude Code

Upgrade the TypeScript compiler 5.9.3 -> 6.0.3 across all 9 packages that
declare it.

TS 6.0 requires an explicit rootDir when the output layout depends on it
(TS5011); this surfaced in cacheable-request's tsc-based build. Added
rootDir "./src" to its tsconfig.build.json -- behavior-preserving, it makes
explicit what TypeScript previously inferred.

The tsdown-built packages (which still use the now-deprecated
moduleResolution "node" / baseUrl) build cleanly: those options don't error
under TS 6 via tsdown, so they're left as-is for a separate TS 7-prep
cleanup rather than expanding this upgrade.

- typescript ^5.9.3 -> ^6.0.3 (9 packages)
- cacheable-request/tsconfig.build.json: add rootDir "./src"

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P1TBuMiXotBjpNHYcbwvqf
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedtypescript@​5.9.3 ⏵ 6.0.3100 +110090 +19690

View full report

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request upgrades the TypeScript dependency from version 5.9.3 to 6.0.3 across multiple packages and updates the lockfile. It also adds the rootDir compiler option to the build configuration of cacheable-request. There are no review comments, and I have no feedback to provide.

@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (df417aa) to head (00ff38e).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1672   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           29        29           
  Lines         3504      3504           
  Branches       794       795    +1     
=========================================
  Hits          3504      3504           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jaredwray jaredwray merged commit d1589d5 into main Jul 5, 2026
12 checks passed
@jaredwray jaredwray deleted the claude/cacheable-dependency-management-d6gb1r branch July 5, 2026 21:44

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 00ff38eefa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"cacheable": "workspace:^",
"tsdown": "^0.22.3",
"typescript": "^5.9.3"
"typescript": "^6.0.3"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Fix TS6-deprecated config before bumping compiler

With this TypeScript 6 bump, the package tsconfig for this package is no longer valid: tsc -p packages/cache-manager/tsconfig.json --noEmit reports TS5107 for moduleResolution: "node" and TS5101 for baseUrl unless ignoreDeprecations: "6.0" is set. The same deprecated options are still present in cacheable, flat-cache, memory, net, and node-cache, so any TS6 declaration/type-check path that reads those package configs will fail before it reaches source type checking.

Useful? React with 👍 / 👎.

"pino": "^10.3.1",
"tsdown": "^0.22.3",
"typescript": "^5.9.3"
"typescript": "^6.0.3"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add explicit Node types for TS6 builds

TypeScript 6 now defaults compilerOptions.types to an empty list, but this package's tsconfig leaves types unset while src/index.ts imports node:* modules and uses process/NodeJS.ErrnoException. Even with @types/node visible in the workspace, TS6 will not load those declarations automatically, so declaration builds fail with TS2591/TS2503 until the config explicitly includes Node types; @cacheable/net has the same pattern for Buffer/BufferEncoding.

Useful? React with 👍 / 👎.

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.

2 participants