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
feat: Added TypeScript definitions #2916
Conversation
Fully implemented TS definitions for semantic-release package
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.
should we add type tests with tsd
, at least some basic ones that we can add to as needed?
declare interface AggregateError extends Error { | ||
errors: any[]; | ||
} |
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.
do we still need to define it? It's a global object now:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError
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.
we're still using the library rather than the built-in. i think there is something that would make the switch a breaking change, but i do think we should migrate
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.
We need to defined it because we can't cross-reference node types easily.
It's builtin since node 15.
I can add those later in. The typedef file added in this PR is also in @semantic-release/wordpress, and in a PR https://github.com/DefinitelyTyped/DefinitelyTyped/pull/66223. Since that PR won't be merged anytime soon, let's roll our own, and I can implement a full typechecking test later on. |
🎉 This PR is included in version 21.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
These type definitions are feature complete and include all of the interfaces, options and callbacks from the main semantic-release package.