[Track2] Add downlevel types to all track2 packages #8275
Labels
Client
This issue points to a problem in the data-plane of the library.
EngSys
This issue is impacting the engineering system.
help wanted
This issue is tracking work for which community contributions would be welcomed and appreciated
Milestone
This issue is to track adding downleveled types to our track2 packages to ensure we support older versions of TypeScript, targeting 3.1 where possible.
What is downleveling?
Just like we can use the TypeScript compiler to downlevel JavaScript code for older runtimes, we can also generate 'down-leveled' types that will work with older versions of TypeScript than the SDK packages use.
Changes
"downlevel-dts": "~0.4.0",
as a devDependency.api-extractor.json
config so that thedtsRollup.publicTrimmedFilePath
points to the new location for the current types.E.g.
"./types/core-auth.d.ts"
->"./types/latest/core-auth.d.ts"
build:types
script to the package.json and update thebuild
script to run it as the last step."build:types": "downlevel-dts types/latest types/3.1"
types
field to point to the new location from step 2.E.g.
"types": "./types/core-auth.d.ts"
->"types": "./types/latest/core-auth.d.ts"
typesVersions
field to the package.json file. This is used to map type declarations based on the version of TypeScript the user is using. Example fromcore-auth
:package.json
files
entry to includetypes/latest/
andtypes/3.1/
.Example
Here's an example of making the above changes to the event-hubs SDK:
#8654
Packages to update
Core packages:
Client packages:
The text was updated successfully, but these errors were encountered: