-
-
Notifications
You must be signed in to change notification settings - Fork 55
feat: add types #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat: add types #88
Conversation
|
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏽
|
Hey @RobinTail, can you review again please? I implemented your suggestions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, @Phillip9587
Co-authored-by: Anna Bocharova <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🏅
|
Can we release this as a minor and recommend users to migrate away from |
|
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about merging this into the master branch without publishing it for now?
That way, we can continue iterating and improving the types.
Once we're ready to release v3, we can add index.d.ts to the files and types fields in package.json.
| "repository": "pillarjs/finalhandler", | ||
| "type": "commonjs", | ||
| "main": "index.js", | ||
| "types": "index.d.ts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "types": "index.d.ts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe types would be resolved automatically even without this entry.
Just because of the index.* naming
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least in my PR attw resolves them without types in package.json
| "index.js", | ||
| "index.d.ts" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "index.js", | |
| "index.d.ts" | |
| "index.js" |
|
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. |
This PR adds type definitions to
finalhandler. It includes the following changes:@types/finalhandlerinto the repository (https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/finalhandler)type,mainandtypesfield topackage.jsontsconfig.jsonwhich extends@tsconfig/node18from https://github.com/tsconfig/bases@arethetypeswrong/cliandtsdRef: expressjs/typescript-wg#1
cc @RobinTail @hichemfantar