feat: bump TypeScript to 5.x and target ES2022#741
Draft
nelson-parente wants to merge 2 commits intodapr:mainfrom
Draft
feat: bump TypeScript to 5.x and target ES2022#741nelson-parente wants to merge 2 commits intodapr:mainfrom
nelson-parente wants to merge 2 commits intodapr:mainfrom
Conversation
Modernize the build toolchain: - TypeScript: ^4.5.5 → ^5.7.0 (enables satisfies operator, improved type inference, decorator metadata, const type parameters) - tsconfig target: ES2020 → ES2022 (native Error.cause, top-level await, Array.at(), Object.hasOwn(), RegExp /d flag) - Jest: ^27.2.0 → ^29.7.0 (current LTS, better ESM support) - ts-jest: ^27.0.5 → ^29.2.0 (compatible with Jest 29 + TS 5.x) - @types/jest: ^27.0.1 → ^29.5.0 - @types/node: ^16.9.1 → ^22.0.0 (match Node 22 LTS used in CI) - Add engines field requiring Node >=18.0.0 - Clean up tsconfig.json (remove commented-out options) - Add explicit ts-jest transform config for Jest 29 compatibility Signed-off-by: Nelson Parente <nelson_parente@live.com.pt>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #741 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 6 6
Branches 1 1
=========================================
Hits 6 6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Upgrade @typescript-eslint/eslint-plugin and parser from ^5.1.0 to ^7.0.0 (v5 only supports up to TS 5.3, incompatible with TS 5.7) - Upgrade eslint from ^8.1.0 to ^8.57.0 (required by @typescript-eslint v7) - Remove redundant preset: "ts-jest" from jest.config.js (the explicit transform block already configures ts-jest 29; having both is a maintenance hazard) - Regenerate package-lock.json to match package.json version bumps (lockfile was stale, resolving old Jest 27 and TS 4.x versions) Resolved versions: typescript 5.9.3, jest 29.7.0, ts-jest 29.4.6, @typescript-eslint/parser 7.18.0 Signed-off-by: Nelson Parente <nelson_parente@live.com.pt>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
^4.5.5to^5.7.0ES2020toES2022^27→^29), ts-jest (^27→^29), and type definitions to match@types/nodeto^22.0.0(matches Node 22 LTS used in CI)enginesfield requiring Node>=18.0.0Motivation
The SDK's TypeScript and Jest versions are significantly behind. TypeScript 5.x has been stable since March 2023 and brings important improvements:
satisfiesoperator for type-safe configuration objectsconsttype parametersES2022 target enables native:
Error.causefor error chainingArray.at()for safe indexingObject.hasOwn()as a safehasOwnPropertyreplacementawaitTest plan
npm installto verify dependency resolutionnpm run buildto verify TypeScript 5.x compilationnpm run test:unit:allto verify Jest 29 compatibilitynpm run lintto verify ESLint still works with TS 5.x parser