mono - chore: upgrade TypeScript to 6 (breaking)#1672
Conversation
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
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
💡 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" |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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 👍 / 👎.
Please check if the PR fulfills these requirements
What kind of change does this PR introduce?
Maintenance (
chore) — major upgrade of the TypeScript compiler5.9.3→6.0.3across all 9 packages that declare it. This is adevDependency/build-tooling change; the emitted JS and.d.tsare 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
rootDirwhen the output layout depends on it (error TS5011). This surfaced only incacheable-request, the one package that builds withtscdirectly. Fix: added"rootDir": "./src"topackages/cacheable-request/tsconfig.build.json. This is behavior-preserving — it makes explicit what TypeScript previously inferred as the common source directory.tsdown-built packages that still use the now-deprecatedmoduleResolution: "node"/baseUrlbuild cleanly — those options don't error under TS 6 throughtsdown's declaration generation, so I left them untouched here. Modernizing them (node→bundler, droppingbaseUrl) is TS 7 preparation and belongs in its own change, not this compiler bump.strict,types: [],module,target) have no effect here because every package sets those options explicitly in itstsconfig.Verification
pnpm buildpasses (all 9 packages, incl. thetscbuild ofcacheable-request)node scripts/test-build.mjs(build-output validation: runtime + publint + attw on the TS6-generated.d.ts) passes for all packagespnpm test— every package passes at 100% coverage except the same 3 tests that fail onmainand are specific to this sandbox (not caused by this change):cacheable-request › return with url and port— real request to externalmockhttp.org:8080, unreachable here (the:80variant passes).file-entry-cache › should return a file descriptor with checksum and errorandnormalizeEntries() › should return all entries— bothchmod 0o000a 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