feat: add types
This PR adds type definitions to finalhandler. It includes the following changes:
- moving types from
@types/finalhandlerinto the repository (https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/finalhandler) - adding
type,mainandtypesfield topackage.json - adding a
tsconfig.jsonwhich extends@tsconfig/node18from https://github.com/tsconfig/bases - adding type tests with
@arethetypeswrong/cliandtsd
Ref: https://github.com/expressjs/typescript-wg/issues/1
cc @RobinTail @hichemfantar
New dependencies detected. Learn more about Socket for GitHub ↗︎
| Package | New capabilities | Transitives | Size | Publisher |
|---|---|---|---|---|
| npm/@arethetypeswrong/[email protected] | Transitive: environment, filesystem, network, shell, unsafe | +52 |
31.7 MB | andrewbranch |
| npm/@tsconfig/[email protected] | None | 0 |
2.36 kB | typescript-deploys |
| npm/@types/[email protected] | None | +1 |
83.3 kB | |
| npm/[email protected] | None | 0 |
0 B | |
| npm/[email protected] | None | 0 |
22.9 MB | typescript-bot |
Hey @RobinTail, can you review again please? I implemented your suggestions.
Can we release this as a minor and recommend users to migrate away from @types/finalhandler to the built-in types, or would this require a major release?
Nope, this should be released in a major version, mainly because it could break TypeScript users, whether they use it with Express or not. Besides, it's not natural to add TypeScript support in a non-major version.
Just to say, it's normal to release this in a minor version. Also, this is blocked until the types are officially accepted in the repositories.